Skip to content
Snippets Groups Projects
Commit 60d76190 authored by John Twyman's avatar John Twyman
Browse files

Clean up old SDK files

parent c4f5ed4e
Branches
Tags
1 merge request!3Update Twilio SDK to v8
Showing
with 0 additions and 2016 deletions
<?php
namespace Twilio\Jwt\Grants;
class ConversationsGrant implements Grant {
private $configurationProfileSid;
public function __construct() {
trigger_error("ConversationsGrant is deprecated, please use VideoGrant", E_USER_NOTICE);
}
/**
* Returns the configuration profile sid
*
* @return string the configuration profile sid
*/
public function getConfigurationProfileSid() {
return $this->configurationProfileSid;
}
/**
* @param string $configurationProfileSid the configuration profile sid
* we want to enable for this grant
*
* @return $this updated grant
*/
public function setConfigurationProfileSid($configurationProfileSid) {
$this->configurationProfileSid = $configurationProfileSid;
return $this;
}
/**
* Returns the grant type
*
* @return string type of the grant
*/
public function getGrantKey() {
return "rtc";
}
/**
* Returns the grant data
*
* @return array data of the grant
*/
public function getPayload() {
$payload = array();
if ($this->configurationProfileSid) {
$payload['configuration_profile_sid'] = $this->configurationProfileSid;
}
return $payload;
}
}
<?php
namespace Twilio\Jwt\Grants;
class IpMessagingGrant implements Grant {
private $serviceSid;
private $endpointId;
private $deploymentRoleSid;
private $pushCredentialSid;
/**
* Returns the service sid
*
* @return string the service sid
*/
public function getServiceSid() {
return $this->serviceSid;
}
/**
* Set the service sid of this grant
*
* @param string $serviceSid service sid of the grant
*
* @return $this updated grant
*/
public function setServiceSid($serviceSid) {
$this->serviceSid = $serviceSid;
return $this;
}
/**
* Returns the endpoint id of the grant
*
* @return string the endpoint id
*/
public function getEndpointId() {
return $this->endpointId;
}
/**
* Set the endpoint id of the grant
*
* @param string $endpointId endpoint id of the grant
*
* @return $this updated grant
*/
public function setEndpointId($endpointId) {
$this->endpointId = $endpointId;
return $this;
}
/**
* Returns the deployment role sid of the grant
*
* @return string the deployment role sid
*/
public function getDeploymentRoleSid() {
return $this->deploymentRoleSid;
}
/**
* Set the role sid of the grant
*
* @param string $deploymentRoleSid role sid of the grant
*
* @return $this updated grant
*/
public function setDeploymentRoleSid($deploymentRoleSid) {
$this->deploymentRoleSid = $deploymentRoleSid;
return $this;
}
/**
* Returns the push credential sid of the grant
*
* @return string the push credential sid
*/
public function getPushCredentialSid() {
return $this->pushCredentialSid;
}
/**
* Set the credential sid of the grant
*
* @param string $pushCredentialSid push credential sid of the grant
*
* @return $this updated grant
*/
public function setPushCredentialSid($pushCredentialSid) {
$this->pushCredentialSid = $pushCredentialSid;
return $this;
}
/**
* Returns the grant type
*
* @return string type of the grant
*/
public function getGrantKey() {
return "ip_messaging";
}
/**
* Returns the grant data
*
* @return array data of the grant
*/
public function getPayload() {
$payload = array();
if ($this->serviceSid) {
$payload['service_sid'] = $this->serviceSid;
}
if ($this->endpointId) {
$payload['endpoint_id'] = $this->endpointId;
}
if ($this->deploymentRoleSid) {
$payload['deployment_role_sid'] = $this->deploymentRoleSid;
}
if ($this->pushCredentialSid) {
$payload['push_credential_sid'] = $this->pushCredentialSid;
}
return $payload;
}
}
\ No newline at end of file
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Api\V2010\Account\Call;
use Twilio\InstanceContext;
use Twilio\Options;
use Twilio\Values;
use Twilio\Version;
class FeedbackContext extends InstanceContext {
/**
* Initialize the FeedbackContext
*
* @param \Twilio\Version $version Version that contains the resource
* @param string $accountSid The account_sid
* @param string $callSid The call sid that uniquely identifies the call
* @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackContext
*/
public function __construct(Version $version, $accountSid, $callSid) {
parent::__construct($version);
// Path Solution
$this->solution = array(
'accountSid' => $accountSid,
'callSid' => $callSid,
);
$this->uri = '/Accounts/' . rawurlencode($accountSid) . '/Calls/' . rawurlencode($callSid) . '/Feedback.json';
}
/**
* Create a new FeedbackInstance
*
* @param integer $qualityScore The quality_score
* @param array|Options $options Optional Arguments
* @return FeedbackInstance Newly created FeedbackInstance
*/
public function create($qualityScore, $options = array()) {
$options = new Values($options);
$data = Values::of(array(
'QualityScore' => $qualityScore,
'Issue' => $options['issue'],
));
$payload = $this->version->create(
'POST',
$this->uri,
array(),
$data
);
return new FeedbackInstance(
$this->version,
$payload,
$this->solution['accountSid'],
$this->solution['callSid']
);
}
/**
* Fetch a FeedbackInstance
*
* @return FeedbackInstance Fetched FeedbackInstance
*/
public function fetch() {
$params = Values::of(array());
$payload = $this->version->fetch(
'GET',
$this->uri,
$params
);
return new FeedbackInstance(
$this->version,
$payload,
$this->solution['accountSid'],
$this->solution['callSid']
);
}
/**
* Update the FeedbackInstance
*
* @param integer $qualityScore An integer from 1 to 5
* @param array|Options $options Optional Arguments
* @return FeedbackInstance Updated FeedbackInstance
*/
public function update($qualityScore, $options = array()) {
$options = new Values($options);
$data = Values::of(array(
'QualityScore' => $qualityScore,
'Issue' => $options['issue'],
));
$payload = $this->version->update(
'POST',
$this->uri,
array(),
$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() {
$context = array();
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
return '[Twilio.Api.V2010.FeedbackContext ' . implode(' ', $context) . ']';
}
}
\ No newline at end of file
<?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 integer qualityScore
* @property string sid
*/
class FeedbackInstance extends InstanceResource {
/**
* Initialize the FeedbackInstance
*
* @param \Twilio\Version $version Version that contains the resource
* @param mixed[] $payload The response payload
* @param string $accountSid The account_sid
* @param string $callSid A 34 character string that uniquely identifies this
* resource.
* @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackInstance
*/
public function __construct(Version $version, array $payload, $accountSid, $callSid) {
parent::__construct($version);
// Marshaled Properties
$this->properties = array(
'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 = array(
'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 \Twilio\Rest\Api\V2010\Account\Call\FeedbackContext Context for this
* FeedbackInstance
*/
protected function proxy() {
if (!$this->context) {
$this->context = new FeedbackContext(
$this->version,
$this->solution['accountSid'],
$this->solution['callSid']
);
}
return $this->context;
}
/**
* Create a new FeedbackInstance
*
* @param integer $qualityScore The quality_score
* @param array|Options $options Optional Arguments
* @return FeedbackInstance Newly created FeedbackInstance
*/
public function create($qualityScore, $options = array()) {
return $this->proxy()->create(
$qualityScore,
$options
);
}
/**
* Fetch a FeedbackInstance
*
* @return FeedbackInstance Fetched FeedbackInstance
*/
public function fetch() {
return $this->proxy()->fetch();
}
/**
* Update the FeedbackInstance
*
* @param integer $qualityScore An integer from 1 to 5
* @param array|Options $options Optional Arguments
* @return FeedbackInstance Updated FeedbackInstance
*/
public function update($qualityScore, $options = array()) {
return $this->proxy()->update(
$qualityScore,
$options
);
}
/**
* Magic getter to access properties
*
* @param string $name Property to access
* @return mixed The requested property
* @throws TwilioException For unknown properties
*/
public function __get($name) {
if (array_key_exists($name, $this->properties)) {
return $this->properties[$name];
}
if (property_exists($this, '_' . $name)) {
$method = 'get' . ucfirst($name);
return $this->$method();
}
throw new TwilioException('Unknown property: ' . $name);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
$context = array();
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
return '[Twilio.Api.V2010.FeedbackInstance ' . implode(' ', $context) . ']';
}
}
\ No newline at end of file
<?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 account_sid
* @param string $callSid A 34 character string that uniquely identifies this
* resource.
* @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackList
*/
public function __construct(Version $version, $accountSid, $callSid) {
parent::__construct($version);
// Path Solution
$this->solution = array(
'accountSid' => $accountSid,
'callSid' => $callSid,
);
}
/**
* Constructs a FeedbackContext
*
* @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackContext
*/
public function getContext() {
return new FeedbackContext(
$this->version,
$this->solution['accountSid'],
$this->solution['callSid']
);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
return '[Twilio.Api.V2010.FeedbackList]';
}
}
\ No newline at end of file
<?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 The issue
* @return CreateFeedbackOptions Options builder
*/
public static function create($issue = Values::NONE) {
return new CreateFeedbackOptions($issue);
}
/**
* @param string $issue Issues experienced during the call
* @return UpdateFeedbackOptions Options builder
*/
public static function update($issue = Values::NONE) {
return new UpdateFeedbackOptions($issue);
}
}
class CreateFeedbackOptions extends Options {
/**
* @param string $issue The issue
*/
public function __construct($issue = Values::NONE) {
$this->options['issue'] = $issue;
}
/**
* The issue
*
* @param string $issue The issue
* @return $this Fluent Builder
*/
public function setIssue($issue) {
$this->options['issue'] = $issue;
return $this;
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
$options = array();
foreach ($this->options as $key => $value) {
if ($value != Values::NONE) {
$options[] = "$key=$value";
}
}
return '[Twilio.Api.V2010.CreateFeedbackOptions ' . implode(' ', $options) . ']';
}
}
class UpdateFeedbackOptions extends Options {
/**
* @param string $issue Issues experienced during the call
*/
public function __construct($issue = Values::NONE) {
$this->options['issue'] = $issue;
}
/**
* One or more of the issues experienced during the call
*
* @param string $issue Issues experienced during the call
* @return $this Fluent Builder
*/
public function setIssue($issue) {
$this->options['issue'] = $issue;
return $this;
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
$options = array();
foreach ($this->options as $key => $value) {
if ($value != Values::NONE) {
$options[] = "$key=$value";
}
}
return '[Twilio.Api.V2010.UpdateFeedbackOptions ' . implode(' ', $options) . ']';
}
}
\ No newline at end of file
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Api\V2010\Account\Call;
use Twilio\Page;
class FeedbackPage extends Page {
public function __construct($version, $response, $solution) {
parent::__construct($version, $response);
// Path Solution
$this->solution = $solution;
}
public function buildInstance(array $payload) {
return new FeedbackInstance(
$this->version,
$payload,
$this->solution['accountSid'],
$this->solution['callSid']
);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
return '[Twilio.Api.V2010.FeedbackPage]';
}
}
\ No newline at end of file
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Api\V2010\Account\Call;
use Twilio\InstanceContext;
use Twilio\Values;
use Twilio\Version;
class FeedbackSummaryContext extends InstanceContext {
/**
* Initialize the FeedbackSummaryContext
*
* @param \Twilio\Version $version Version that contains the resource
* @param string $accountSid The account_sid
* @param string $sid The sid
* @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryContext
*/
public function __construct(Version $version, $accountSid, $sid) {
parent::__construct($version);
// Path Solution
$this->solution = array(
'accountSid' => $accountSid,
'sid' => $sid,
);
$this->uri = '/Accounts/' . rawurlencode($accountSid) . '/Calls/FeedbackSummary/' . rawurlencode($sid) . '.json';
}
/**
* Fetch a FeedbackSummaryInstance
*
* @return FeedbackSummaryInstance Fetched FeedbackSummaryInstance
*/
public function fetch() {
$params = Values::of(array());
$payload = $this->version->fetch(
'GET',
$this->uri,
$params
);
return new FeedbackSummaryInstance(
$this->version,
$payload,
$this->solution['accountSid'],
$this->solution['sid']
);
}
/**
* Deletes the FeedbackSummaryInstance
*
* @return boolean True if delete succeeds, false otherwise
*/
public function delete() {
return $this->version->delete('delete', $this->uri);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
$context = array();
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
return '[Twilio.Api.V2010.FeedbackSummaryContext ' . implode(' ', $context) . ']';
}
}
\ No newline at end of file
<?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 integer callCount
* @property integer callFeedbackCount
* @property \DateTime dateCreated
* @property \DateTime dateUpdated
* @property \DateTime endDate
* @property boolean includeSubaccounts
* @property string 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 \Twilio\Version $version Version that contains the resource
* @param mixed[] $payload The response payload
* @param string $accountSid The unique id of the Account responsible for
* creating this Call
* @param string $sid The sid
* @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryInstance
*/
public function __construct(Version $version, array $payload, $accountSid, $sid = null) {
parent::__construct($version);
// Marshaled Properties
$this->properties = array(
'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 = array(
'accountSid' => $accountSid,
'sid' => $sid ?: $this->properties['sid'],
);
}
/**
* Generate an instance context for the instance, the context is capable of
* performing various actions. All instance actions are proxied to the context
*
* @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryContext Context
* for this
* FeedbackSummaryInstance
*/
protected function proxy() {
if (!$this->context) {
$this->context = new FeedbackSummaryContext(
$this->version,
$this->solution['accountSid'],
$this->solution['sid']
);
}
return $this->context;
}
/**
* Fetch a FeedbackSummaryInstance
*
* @return FeedbackSummaryInstance Fetched FeedbackSummaryInstance
*/
public function fetch() {
return $this->proxy()->fetch();
}
/**
* Deletes the FeedbackSummaryInstance
*
* @return boolean True if delete succeeds, false otherwise
*/
public function delete() {
return $this->proxy()->delete();
}
/**
* Magic getter to access properties
*
* @param string $name Property to access
* @return mixed The requested property
* @throws TwilioException For unknown properties
*/
public function __get($name) {
if (array_key_exists($name, $this->properties)) {
return $this->properties[$name];
}
if (property_exists($this, '_' . $name)) {
$method = 'get' . ucfirst($name);
return $this->$method();
}
throw new TwilioException('Unknown property: ' . $name);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
$context = array();
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
return '[Twilio.Api.V2010.FeedbackSummaryInstance ' . implode(' ', $context) . ']';
}
}
\ No newline at end of file
<?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\Values;
use Twilio\Version;
class FeedbackSummaryList extends ListResource {
/**
* Construct the FeedbackSummaryList
*
* @param Version $version Version that contains the resource
* @param string $accountSid The unique id of the Account responsible for
* creating this Call
* @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryList
*/
public function __construct(Version $version, $accountSid) {
parent::__construct($version);
// Path Solution
$this->solution = array(
'accountSid' => $accountSid,
);
$this->uri = '/Accounts/' . rawurlencode($accountSid) . '/Calls/FeedbackSummary.json';
}
/**
* Create a new FeedbackSummaryInstance
*
* @param \DateTime $startDate The start_date
* @param \DateTime $endDate The end_date
* @param array|Options $options Optional Arguments
* @return FeedbackSummaryInstance Newly created FeedbackSummaryInstance
*/
public function create($startDate, $endDate, $options = array()) {
$options = new Values($options);
$data = Values::of(array(
'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,
array(),
$data
);
return new FeedbackSummaryInstance(
$this->version,
$payload,
$this->solution['accountSid']
);
}
/**
* Constructs a FeedbackSummaryContext
*
* @param string $sid The sid
* @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryContext
*/
public function getContext($sid) {
return new FeedbackSummaryContext(
$this->version,
$this->solution['accountSid'],
$sid
);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
return '[Twilio.Api.V2010.FeedbackSummaryList]';
}
}
\ No newline at end of file
<?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 boolean $includeSubaccounts The include_subaccounts
* @param string $statusCallback The status_callback
* @param string $statusCallbackMethod The status_callback_method
* @return CreateFeedbackSummaryOptions Options builder
*/
public static function create($includeSubaccounts = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE) {
return new CreateFeedbackSummaryOptions($includeSubaccounts, $statusCallback, $statusCallbackMethod);
}
}
class CreateFeedbackSummaryOptions extends Options {
/**
* @param boolean $includeSubaccounts The include_subaccounts
* @param string $statusCallback The status_callback
* @param string $statusCallbackMethod The status_callback_method
*/
public function __construct($includeSubaccounts = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE) {
$this->options['includeSubaccounts'] = $includeSubaccounts;
$this->options['statusCallback'] = $statusCallback;
$this->options['statusCallbackMethod'] = $statusCallbackMethod;
}
/**
* The include_subaccounts
*
* @param boolean $includeSubaccounts The include_subaccounts
* @return $this Fluent Builder
*/
public function setIncludeSubaccounts($includeSubaccounts) {
$this->options['includeSubaccounts'] = $includeSubaccounts;
return $this;
}
/**
* The status_callback
*
* @param string $statusCallback The status_callback
* @return $this Fluent Builder
*/
public function setStatusCallback($statusCallback) {
$this->options['statusCallback'] = $statusCallback;
return $this;
}
/**
* The status_callback_method
*
* @param string $statusCallbackMethod The status_callback_method
* @return $this Fluent Builder
*/
public function setStatusCallbackMethod($statusCallbackMethod) {
$this->options['statusCallbackMethod'] = $statusCallbackMethod;
return $this;
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
$options = array();
foreach ($this->options as $key => $value) {
if ($value != Values::NONE) {
$options[] = "$key=$value";
}
}
return '[Twilio.Api.V2010.CreateFeedbackSummaryOptions ' . implode(' ', $options) . ']';
}
}
\ No newline at end of file
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Api\V2010\Account\Call;
use Twilio\Page;
class FeedbackSummaryPage extends Page {
public function __construct($version, $response, $solution) {
parent::__construct($version, $response);
// Path Solution
$this->solution = $solution;
}
public function buildInstance(array $payload) {
return new FeedbackSummaryInstance(
$this->version,
$payload,
$this->solution['accountSid']
);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
return '[Twilio.Api.V2010.FeedbackSummaryPage]';
}
}
\ No newline at end of file
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest;
use Twilio\Domain;
use Twilio\Exceptions\TwilioException;
use Twilio\Rest\Fax\V1;
/**
* @property \Twilio\Rest\Fax\V1 v1
* @property \Twilio\Rest\Fax\V1\FaxList faxes
* @method \Twilio\Rest\Fax\V1\FaxContext faxes(string $sid)
*/
class Fax extends Domain {
protected $_v1 = null;
/**
* Construct the Fax Domain
*
* @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with
* Twilio
* @return \Twilio\Rest\Fax Domain for Fax
*/
public function __construct(Client $client) {
parent::__construct($client);
$this->baseUrl = 'https://fax.twilio.com';
}
/**
* @return \Twilio\Rest\Fax\V1 Version v1 of fax
*/
protected function getV1() {
if (!$this->_v1) {
$this->_v1 = new V1($this);
}
return $this->_v1;
}
/**
* Magic getter to lazy load version
*
* @param string $name Version to return
* @return \Twilio\Version The requested version
* @throws \Twilio\Exceptions\TwilioException For unknown versions
*/
public function __get($name) {
$method = 'get' . ucfirst($name);
if (method_exists($this, $method)) {
return $this->$method();
}
throw new TwilioException('Unknown version ' . $name);
}
/**
* Magic caller to get resource contexts
*
* @param string $name Resource to return
* @param array $arguments Context parameters
* @return \Twilio\InstanceContext The requested resource context
* @throws \Twilio\Exceptions\TwilioException For unknown resource
*/
public function __call($name, $arguments) {
$method = 'context' . ucfirst($name);
if (method_exists($this, $method)) {
return call_user_func_array(array($this, $method), $arguments);
}
throw new TwilioException('Unknown context ' . $name);
}
/**
* @return \Twilio\Rest\Fax\V1\FaxList
*/
protected function getFaxes() {
return $this->v1->faxes;
}
/**
* @param string $sid A string that uniquely identifies this fax.
* @return \Twilio\Rest\Fax\V1\FaxContext
*/
protected function contextFaxes($sid) {
return $this->v1->faxes($sid);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
return '[Twilio.Fax]';
}
}
\ No newline at end of file
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Fax;
use Twilio\Domain;
use Twilio\Exceptions\TwilioException;
use Twilio\Rest\Fax\V1\FaxList;
use Twilio\Version;
/**
* @property \Twilio\Rest\Fax\V1\FaxList faxes
* @method \Twilio\Rest\Fax\V1\FaxContext faxes(string $sid)
*/
class V1 extends Version {
protected $_faxes = null;
/**
* Construct the V1 version of Fax
*
* @param \Twilio\Domain $domain Domain that contains the version
* @return \Twilio\Rest\Fax\V1 V1 version of Fax
*/
public function __construct(Domain $domain) {
parent::__construct($domain);
$this->version = 'v1';
}
/**
* @return \Twilio\Rest\Fax\V1\FaxList
*/
protected function getFaxes() {
if (!$this->_faxes) {
$this->_faxes = new FaxList($this);
}
return $this->_faxes;
}
/**
* Magic getter to lazy load root resources
*
* @param string $name Resource to return
* @return \Twilio\ListResource The requested resource
* @throws \Twilio\Exceptions\TwilioException For unknown resource
*/
public function __get($name) {
$method = 'get' . ucfirst($name);
if (method_exists($this, $method)) {
return $this->$method();
}
throw new TwilioException('Unknown resource ' . $name);
}
/**
* Magic caller to get resource contexts
*
* @param string $name Resource to return
* @param array $arguments Context parameters
* @return \Twilio\InstanceContext The requested resource context
* @throws \Twilio\Exceptions\TwilioException For unknown resource
*/
public function __call($name, $arguments) {
$property = $this->$name;
if (method_exists($property, 'getContext')) {
return call_user_func_array(array($property, 'getContext'), $arguments);
}
throw new TwilioException('Resource does not have a context');
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
return '[Twilio.Fax.V1]';
}
}
\ No newline at end of file
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Fax\V1\Fax;
use Twilio\InstanceContext;
use Twilio\Values;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
*/
class FaxMediaContext extends InstanceContext {
/**
* Initialize the FaxMediaContext
*
* @param \Twilio\Version $version Version that contains the resource
* @param string $faxSid Fax SID
* @param string $sid A string that uniquely identifies this fax media
* @return \Twilio\Rest\Fax\V1\Fax\FaxMediaContext
*/
public function __construct(Version $version, $faxSid, $sid) {
parent::__construct($version);
// Path Solution
$this->solution = array(
'faxSid' => $faxSid,
'sid' => $sid,
);
$this->uri = '/Faxes/' . rawurlencode($faxSid) . '/Media/' . rawurlencode($sid) . '';
}
/**
* Fetch a FaxMediaInstance
*
* @return FaxMediaInstance Fetched FaxMediaInstance
*/
public function fetch() {
$params = Values::of(array());
$payload = $this->version->fetch(
'GET',
$this->uri,
$params
);
return new FaxMediaInstance(
$this->version,
$payload,
$this->solution['faxSid'],
$this->solution['sid']
);
}
/**
* Deletes the FaxMediaInstance
*
* @return boolean True if delete succeeds, false otherwise
*/
public function delete() {
return $this->version->delete('delete', $this->uri);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
$context = array();
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
return '[Twilio.Fax.V1.FaxMediaContext ' . implode(' ', $context) . ']';
}
}
\ No newline at end of file
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Fax\V1\Fax;
use Twilio\Deserialize;
use Twilio\Exceptions\TwilioException;
use Twilio\InstanceResource;
use Twilio\Values;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
*
* @property string sid
* @property string accountSid
* @property string faxSid
* @property string contentType
* @property \DateTime dateCreated
* @property \DateTime dateUpdated
* @property string url
*/
class FaxMediaInstance extends InstanceResource {
/**
* Initialize the FaxMediaInstance
*
* @param \Twilio\Version $version Version that contains the resource
* @param mixed[] $payload The response payload
* @param string $faxSid Fax SID
* @param string $sid A string that uniquely identifies this fax media
* @return \Twilio\Rest\Fax\V1\Fax\FaxMediaInstance
*/
public function __construct(Version $version, array $payload, $faxSid, $sid = null) {
parent::__construct($version);
// Marshaled Properties
$this->properties = array(
'sid' => Values::array_get($payload, 'sid'),
'accountSid' => Values::array_get($payload, 'account_sid'),
'faxSid' => Values::array_get($payload, 'fax_sid'),
'contentType' => Values::array_get($payload, 'content_type'),
'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 = array(
'faxSid' => $faxSid,
'sid' => $sid ?: $this->properties['sid'],
);
}
/**
* Generate an instance context for the instance, the context is capable of
* performing various actions. All instance actions are proxied to the context
*
* @return \Twilio\Rest\Fax\V1\Fax\FaxMediaContext Context for this
* FaxMediaInstance
*/
protected function proxy() {
if (!$this->context) {
$this->context = new FaxMediaContext(
$this->version,
$this->solution['faxSid'],
$this->solution['sid']
);
}
return $this->context;
}
/**
* Fetch a FaxMediaInstance
*
* @return FaxMediaInstance Fetched FaxMediaInstance
*/
public function fetch() {
return $this->proxy()->fetch();
}
/**
* Deletes the FaxMediaInstance
*
* @return boolean True if delete succeeds, false otherwise
*/
public function delete() {
return $this->proxy()->delete();
}
/**
* Magic getter to access properties
*
* @param string $name Property to access
* @return mixed The requested property
* @throws TwilioException For unknown properties
*/
public function __get($name) {
if (array_key_exists($name, $this->properties)) {
return $this->properties[$name];
}
if (property_exists($this, '_' . $name)) {
$method = 'get' . ucfirst($name);
return $this->$method();
}
throw new TwilioException('Unknown property: ' . $name);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
$context = array();
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
return '[Twilio.Fax.V1.FaxMediaInstance ' . implode(' ', $context) . ']';
}
}
\ No newline at end of file
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Fax\V1\Fax;
use Twilio\ListResource;
use Twilio\Values;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
*/
class FaxMediaList extends ListResource {
/**
* Construct the FaxMediaList
*
* @param Version $version Version that contains the resource
* @param string $faxSid Fax SID
* @return \Twilio\Rest\Fax\V1\Fax\FaxMediaList
*/
public function __construct(Version $version, $faxSid) {
parent::__construct($version);
// Path Solution
$this->solution = array(
'faxSid' => $faxSid,
);
$this->uri = '/Faxes/' . rawurlencode($faxSid) . '/Media';
}
/**
* Streams FaxMediaInstance records from the API as a generator stream.
* This operation lazily loads records as efficiently as possible until the
* limit
* is reached.
* The results are returned as a generator, so this operation is memory
* efficient.
*
* @param int $limit Upper limit for the number of records to return. stream()
* guarantees to never return more than limit. Default is no
* limit
* @param mixed $pageSize Number of records to fetch per request, when not set
* will use the default value of 50 records. If no
* page_size is defined but a limit is defined, stream()
* will attempt to read the limit with the most
* efficient page size, i.e. min(limit, 1000)
* @return \Twilio\Stream stream of results
*/
public function stream($limit = null, $pageSize = null) {
$limits = $this->version->readLimits($limit, $pageSize);
$page = $this->page($limits['pageSize']);
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
}
/**
* Reads FaxMediaInstance 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 FaxMediaInstance[] Array of results
*/
public function read($limit = null, $pageSize = null) {
return iterator_to_array($this->stream($limit, $pageSize), false);
}
/**
* Retrieve a single page of FaxMediaInstance records from the API.
* Request is executed immediately
*
* @param mixed $pageSize Number of records to return, defaults to 50
* @param string $pageToken PageToken provided by the API
* @param mixed $pageNumber Page Number, this value is simply for client state
* @return \Twilio\Page Page of FaxMediaInstance
*/
public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) {
$params = Values::of(array(
'PageToken' => $pageToken,
'Page' => $pageNumber,
'PageSize' => $pageSize,
));
$response = $this->version->page(
'GET',
$this->uri,
$params
);
return new FaxMediaPage($this->version, $response, $this->solution);
}
/**
* Retrieve a specific page of FaxMediaInstance records from the API.
* Request is executed immediately
*
* @param string $targetUrl API-generated URL for the requested results page
* @return \Twilio\Page Page of FaxMediaInstance
*/
public function getPage($targetUrl) {
$response = $this->version->getDomain()->getClient()->request(
'GET',
$targetUrl
);
return new FaxMediaPage($this->version, $response, $this->solution);
}
/**
* Constructs a FaxMediaContext
*
* @param string $sid A string that uniquely identifies this fax media
* @return \Twilio\Rest\Fax\V1\Fax\FaxMediaContext
*/
public function getContext($sid) {
return new FaxMediaContext(
$this->version,
$this->solution['faxSid'],
$sid
);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
return '[Twilio.Fax.V1.FaxMediaList]';
}
}
\ No newline at end of file
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Fax\V1\Fax;
use Twilio\Page;
/**
* PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
*/
class FaxMediaPage extends Page {
public function __construct($version, $response, $solution) {
parent::__construct($version, $response);
// Path Solution
$this->solution = $solution;
}
public function buildInstance(array $payload) {
return new FaxMediaInstance(
$this->version,
$payload,
$this->solution['faxSid']
);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
return '[Twilio.Fax.V1.FaxMediaPage]';
}
}
\ No newline at end of file
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Fax\V1;
use Twilio\Exceptions\TwilioException;
use Twilio\InstanceContext;
use Twilio\Options;
use Twilio\Rest\Fax\V1\Fax\FaxMediaList;
use Twilio\Values;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
*
* @property \Twilio\Rest\Fax\V1\Fax\FaxMediaList media
* @method \Twilio\Rest\Fax\V1\Fax\FaxMediaContext media(string $sid)
*/
class FaxContext extends InstanceContext {
protected $_media = null;
/**
* Initialize the FaxContext
*
* @param \Twilio\Version $version Version that contains the resource
* @param string $sid A string that uniquely identifies this fax.
* @return \Twilio\Rest\Fax\V1\FaxContext
*/
public function __construct(Version $version, $sid) {
parent::__construct($version);
// Path Solution
$this->solution = array(
'sid' => $sid,
);
$this->uri = '/Faxes/' . rawurlencode($sid) . '';
}
/**
* Fetch a FaxInstance
*
* @return FaxInstance Fetched FaxInstance
*/
public function fetch() {
$params = Values::of(array());
$payload = $this->version->fetch(
'GET',
$this->uri,
$params
);
return new FaxInstance(
$this->version,
$payload,
$this->solution['sid']
);
}
/**
* Update the FaxInstance
*
* @param array|Options $options Optional Arguments
* @return FaxInstance Updated FaxInstance
*/
public function update($options = array()) {
$options = new Values($options);
$data = Values::of(array(
'Status' => $options['status'],
));
$payload = $this->version->update(
'POST',
$this->uri,
array(),
$data
);
return new FaxInstance(
$this->version,
$payload,
$this->solution['sid']
);
}
/**
* Deletes the FaxInstance
*
* @return boolean True if delete succeeds, false otherwise
*/
public function delete() {
return $this->version->delete('delete', $this->uri);
}
/**
* Access the media
*
* @return \Twilio\Rest\Fax\V1\Fax\FaxMediaList
*/
protected function getMedia() {
if (!$this->_media) {
$this->_media = new FaxMediaList(
$this->version,
$this->solution['sid']
);
}
return $this->_media;
}
/**
* Magic getter to lazy load subresources
*
* @param string $name Subresource to return
* @return \Twilio\ListResource The requested subresource
* @throws \Twilio\Exceptions\TwilioException For unknown subresources
*/
public function __get($name) {
if (property_exists($this, '_' . $name)) {
$method = 'get' . ucfirst($name);
return $this->$method();
}
throw new TwilioException('Unknown subresource ' . $name);
}
/**
* Magic caller to get resource contexts
*
* @param string $name Resource to return
* @param array $arguments Context parameters
* @return \Twilio\InstanceContext The requested resource context
* @throws \Twilio\Exceptions\TwilioException For unknown resource
*/
public function __call($name, $arguments) {
$property = $this->$name;
if (method_exists($property, 'getContext')) {
return call_user_func_array(array($property, 'getContext'), $arguments);
}
throw new TwilioException('Resource does not have a context');
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
$context = array();
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
return '[Twilio.Fax.V1.FaxContext ' . implode(' ', $context) . ']';
}
}
\ No newline at end of file
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Fax\V1;
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 beta products that are subject to change. Use them with caution.
*
* @property string sid
* @property string accountSid
* @property string from
* @property string to
* @property string quality
* @property string mediaSid
* @property string mediaUrl
* @property integer numPages
* @property integer duration
* @property string status
* @property string direction
* @property string apiVersion
* @property string price
* @property string priceUnit
* @property \DateTime dateCreated
* @property \DateTime dateUpdated
* @property array links
* @property string url
*/
class FaxInstance extends InstanceResource {
protected $_media = null;
/**
* Initialize the FaxInstance
*
* @param \Twilio\Version $version Version that contains the resource
* @param mixed[] $payload The response payload
* @param string $sid A string that uniquely identifies this fax.
* @return \Twilio\Rest\Fax\V1\FaxInstance
*/
public function __construct(Version $version, array $payload, $sid = null) {
parent::__construct($version);
// Marshaled Properties
$this->properties = array(
'sid' => Values::array_get($payload, 'sid'),
'accountSid' => Values::array_get($payload, 'account_sid'),
'from' => Values::array_get($payload, 'from'),
'to' => Values::array_get($payload, 'to'),
'quality' => Values::array_get($payload, 'quality'),
'mediaSid' => Values::array_get($payload, 'media_sid'),
'mediaUrl' => Values::array_get($payload, 'media_url'),
'numPages' => Values::array_get($payload, 'num_pages'),
'duration' => Values::array_get($payload, 'duration'),
'status' => Values::array_get($payload, 'status'),
'direction' => Values::array_get($payload, 'direction'),
'apiVersion' => Values::array_get($payload, 'api_version'),
'price' => Values::array_get($payload, 'price'),
'priceUnit' => Values::array_get($payload, 'price_unit'),
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
'links' => Values::array_get($payload, 'links'),
'url' => Values::array_get($payload, 'url'),
);
$this->solution = array(
'sid' => $sid ?: $this->properties['sid'],
);
}
/**
* Generate an instance context for the instance, the context is capable of
* performing various actions. All instance actions are proxied to the context
*
* @return \Twilio\Rest\Fax\V1\FaxContext Context for this FaxInstance
*/
protected function proxy() {
if (!$this->context) {
$this->context = new FaxContext(
$this->version,
$this->solution['sid']
);
}
return $this->context;
}
/**
* Fetch a FaxInstance
*
* @return FaxInstance Fetched FaxInstance
*/
public function fetch() {
return $this->proxy()->fetch();
}
/**
* Update the FaxInstance
*
* @param array|Options $options Optional Arguments
* @return FaxInstance Updated FaxInstance
*/
public function update($options = array()) {
return $this->proxy()->update(
$options
);
}
/**
* Deletes the FaxInstance
*
* @return boolean True if delete succeeds, false otherwise
*/
public function delete() {
return $this->proxy()->delete();
}
/**
* Access the media
*
* @return \Twilio\Rest\Fax\V1\Fax\FaxMediaList
*/
protected function getMedia() {
return $this->proxy()->media;
}
/**
* Magic getter to access properties
*
* @param string $name Property to access
* @return mixed The requested property
* @throws TwilioException For unknown properties
*/
public function __get($name) {
if (array_key_exists($name, $this->properties)) {
return $this->properties[$name];
}
if (property_exists($this, '_' . $name)) {
$method = 'get' . ucfirst($name);
return $this->$method();
}
throw new TwilioException('Unknown property: ' . $name);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
$context = array();
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
return '[Twilio.Fax.V1.FaxInstance ' . implode(' ', $context) . ']';
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment