Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<?php
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Accounts
* This is the public Twilio REST API.
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

namespace Twilio\Rest\Accounts\V1\Credential;
namespace Twilio\Rest\Api\V2010\Account\Call;

use Twilio\Http\Response;
use Twilio\Page;
Expand All @@ -21,10 +34,10 @@ public function __construct(Version $version, Response $response, array $solutio

/**
* @param array $payload Payload response from the API
* @return AwsInstance \Twilio\Rest\Api\V2010\Credential\FeedbackCallSummaryInstance
* @return FeedbackCallSummaryInstance \Twilio\Rest\Api\V2010\Account\Call\FeedbackCallSummaryInstance
*/
public function buildInstance(array $payload): AwsInstance {
return new AwsInstance($this->version, $payload);
public function buildInstance(array $payload): FeedbackCallSummaryInstance {
return new FeedbackCallSummaryInstance($this->version, $payload, $this->solution['accountSid']);
}

/**
Expand Down
21 changes: 17 additions & 4 deletions examples/php/src/Twilio/Rest/Api/V2010/Account/CallPage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<?php
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Accounts
* This is the public Twilio REST API.
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

namespace Twilio\Rest\Accounts\V1\Credential;
namespace Twilio\Rest\Api\V2010\Account;

use Twilio\Http\Response;
use Twilio\Page;
Expand All @@ -21,10 +34,10 @@ public function __construct(Version $version, Response $response, array $solutio

/**
* @param array $payload Payload response from the API
* @return AwsInstance \Twilio\Rest\Api\V2010\Credential\CallInstance
* @return CallInstance \Twilio\Rest\Api\V2010\Account\CallInstance
*/
public function buildInstance(array $payload): AwsInstance {
return new AwsInstance($this->version, $payload);
public function buildInstance(array $payload): CallInstance {
return new CallInstance($this->version, $payload, $this->solution['accountSid']);
}

/**
Expand Down
9 changes: 4 additions & 5 deletions examples/php/src/Twilio/Rest/Api/V2010/AccountList.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,10 @@ public function page(array $options = [], $pageSize = Values::NONE, string $pag
$options = new Values($options);

$params = Values::of([
'DateCreated' => Serialize::iso8601DateTime($options['DateCreated']),
'Date.Test' => Serialize::iso8601Date($options['Date.Test']),
'DateCreated&lt;' => Serialize::iso8601DateTime($options['DateCreated&lt;']),
'DateCreated&gt;' => Serialize::iso8601DateTime($options['DateCreated&gt;']),
'PageSize' => $options['PageSize'],
'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']),
'Date.Test' => Serialize::iso8601Date($options['dateTest']),
'DateCreated<' => Serialize::iso8601DateTime($options['dateCreatedBefore']),
'DateCreated>' => Serialize::iso8601DateTime($options['dateCreatedAfter']),
'PageToken' => $pageToken,
'Page' => $pageNumber,
'PageSize' => $pageSize,
Expand Down
21 changes: 17 additions & 4 deletions examples/php/src/Twilio/Rest/Api/V2010/AccountPage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<?php
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Accounts
* This is the public Twilio REST API.
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

namespace Twilio\Rest\Accounts\V1\Credential;
namespace Twilio\Rest\Api\V2010;

use Twilio\Http\Response;
use Twilio\Page;
Expand All @@ -21,10 +34,10 @@ public function __construct(Version $version, Response $response, array $solutio

/**
* @param array $payload Payload response from the API
* @return AwsInstance \Twilio\Rest\Api\V2010\Credential\AccountInstance
* @return AccountInstance \Twilio\Rest\Api\V2010\AccountInstance
*/
public function buildInstance(array $payload): AwsInstance {
return new AwsInstance($this->version, $payload);
public function buildInstance(array $payload): AccountInstance {
return new AccountInstance($this->version, $payload);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<?php
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Accounts
* This is the public Twilio REST API.
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

namespace Twilio\Rest\Accounts\V1\Credential;
namespace Twilio\Rest\FlexApi\V1\Credential\Aws;

use Twilio\Http\Response;
use Twilio\Page;
Expand All @@ -21,10 +34,10 @@ public function __construct(Version $version, Response $response, array $solutio

/**
* @param array $payload Payload response from the API
* @return AwsInstance \Twilio\Rest\FlexApi\V1\Credential\HistoryInstance
* @return HistoryInstance \Twilio\Rest\FlexApi\V1\Credential\Aws\HistoryInstance
*/
public function buildInstance(array $payload): AwsInstance {
return new AwsInstance($this->version, $payload);
public function buildInstance(array $payload): HistoryInstance {
return new HistoryInstance($this->version, $payload, $this->solution['sid']);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public function stream(int $limit = null, $pageSize = null): Stream {
public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): AwsPage {

$params = Values::of([
'PageSize' => $options['PageSize'],
'PageToken' => $pageToken,
'Page' => $pageNumber,
'PageSize' => $pageSize,
Expand Down
15 changes: 14 additions & 1 deletion examples/php/src/Twilio/Rest/FlexApi/V1/Credential/AwsPage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<?php
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Accounts
* This is the public Twilio REST API.
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

namespace Twilio\Rest\Accounts\V1\Credential;
namespace Twilio\Rest\FlexApi\V1\Credential;

use Twilio\Http\Response;
use Twilio\Page;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<?php
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Accounts
* This is the public Twilio REST API.
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

namespace Twilio\Rest\Accounts\V1\Credential;
namespace Twilio\Rest\FlexApi\V1\Credential;

use Twilio\Http\Response;
use Twilio\Page;
Expand All @@ -21,10 +34,10 @@ public function __construct(Version $version, Response $response, array $solutio

/**
* @param array $payload Payload response from the API
* @return AwsInstance \Twilio\Rest\FlexApi\V1\Credential\NewCredentialsInstance
* @return NewCredentialsInstance \Twilio\Rest\FlexApi\V1\Credential\NewCredentialsInstance
*/
public function buildInstance(array $payload): AwsInstance {
return new AwsInstance($this->version, $payload);
public function buildInstance(array $payload): NewCredentialsInstance {
return new NewCredentialsInstance($this->version, $payload);
}

/**
Expand Down
21 changes: 17 additions & 4 deletions examples/php/src/Twilio/Rest/FlexApi/V1/CredentialPage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<?php
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Accounts
* This is the public Twilio REST API.
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

namespace Twilio\Rest\Accounts\V1\Credential;
namespace Twilio\Rest\FlexApi\V1;

use Twilio\Http\Response;
use Twilio\Page;
Expand All @@ -21,10 +34,10 @@ public function __construct(Version $version, Response $response, array $solutio

/**
* @param array $payload Payload response from the API
* @return AwsInstance \Twilio\Rest\FlexApi\V1\Credential\CredentialInstance
* @return CredentialInstance \Twilio\Rest\FlexApi\V1\CredentialInstance
*/
public function buildInstance(array $payload): AwsInstance {
return new AwsInstance($this->version, $payload);
public function buildInstance(array $payload): CredentialInstance {
return new CredentialInstance($this->version, $payload);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<?php
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Versionless
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

namespace Twilio\Rest\Accounts\V1\Credential;
namespace Twilio\Rest\Versionless\DeployedDevices;

use Twilio\Http\Response;
use Twilio\Page;
Expand All @@ -21,10 +34,10 @@ public function __construct(Version $version, Response $response, array $solutio

/**
* @param array $payload Payload response from the API
* @return AwsInstance \Twilio\Rest\Versionless\DeployedDevices\Credential\FleetInstance
* @return FleetInstance \Twilio\Rest\Versionless\DeployedDevices\FleetInstance
*/
public function buildInstance(array $payload): AwsInstance {
return new AwsInstance($this->version, $payload);
public function buildInstance(array $payload): FleetInstance {
return new FleetInstance($this->version, $payload);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<?php
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Versionless
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

namespace Twilio\Rest\Accounts\V1\Credential;
namespace Twilio\Rest\Versionless\Understand;

use Twilio\Http\Response;
use Twilio\Page;
Expand All @@ -21,10 +34,10 @@ public function __construct(Version $version, Response $response, array $solutio

/**
* @param array $payload Payload response from the API
* @return AwsInstance \Twilio\Rest\Versionless\Understand\Credential\AssistantInstance
* @return AssistantInstance \Twilio\Rest\Versionless\Understand\AssistantInstance
*/
public function buildInstance(array $payload): AwsInstance {
return new AwsInstance($this->version, $payload);
public function buildInstance(array $payload): AssistantInstance {
return new AssistantInstance($this->version, $payload);
}

/**
Expand Down
40 changes: 40 additions & 0 deletions examples/php/tests/Twilio/Integration/Rest/TwilioRestFlexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,44 @@ public function testShouldSerializePrefixedMap(): void {
['AddOns.status' => 'successful', 'AddOns.message' => 'hi']
));
}

public function testReadRequestCredentials(): void
{
$this->holodeck->mock(new Response(500, ''));

try {
$this->twilio->flexApi->v1->credentials->read();
} catch (DeserializeException $e) {
} catch (TwilioException $e) {
}

$this->assertRequest(new Request(
'get',
'https://flex-api.twilio.com/v1/Credentials'
));
}

public function testReadEmptyResponseCredentials(): void
{
$this->holodeck->mock(new Response(
200,
'
{
"first_page_uri": "/https://flex-api.twilio.com/v1/Credentials?Page=0",
"end": 0,
"previous_page_uri": null,
"credentials": [],
"uri": "https://flex-api.twilio.com/v1/Credentials?Page=0",
"page_size": 50,
"start": 0,
"next_page_uri": null,
"page": 0
}
'
));

$actual = $this->twilio->flexApi->v1->credentials->read();

$this->assertNotNull($actual);
}
}
Loading