Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: preview changes by twiml gather #845

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
22 changes: 22 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
twilio-php Changelog
====================

[2025-01-31] Version 8.4.0
--------------------------
**Library - Chore**
- [PR #841](https://github.com/twilio/twilio-php/pull/841): update changelog for 8.3.11. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
- [PR #840](https://github.com/twilio/twilio-php/pull/840): fix model names in json serialize and payload. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!

**Api**
- Add open-api file tag to `conference/call recordings` and `recording_transcriptions`.

**Events**
- Add support for subaccount subscriptions (beta)

**Insights**
- add new region to conference APIs

**Lookups**
- Add new `parnter_sub_id` query parameter to the lookup request

**Twiml**
- Convert Twiml Attribute `speechModel` of type enum to string **(breaking change)**


[2025-01-28] Version 8.3.13
---------------------------
**Api**
Expand Down
46 changes: 0 additions & 46 deletions src/Twilio/Rest/Content/V1/ContentModels.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,6 @@ public static function createTwilioFlows(array $payload = []): TwilioFlows
return new TwilioFlows($payload);
}

/**
* @property string $id
* @property string $title
* @property string $timeSlots
*/
public static function createTwilioSchedule(array $payload = []): TwilioSchedule
{
return new TwilioSchedule($payload);
}

/**
* @property string $body
* @property string $footer
Expand Down Expand Up @@ -273,7 +263,6 @@ public static function createWhatsappAuthentication(array $payload = []): Whatsa
* @property TwilioCatalog $twilioCatalog
* @property TwilioCarousel $twilioCarousel
* @property TwilioFlows $twilioFlows
* @property TwilioSchedule $twilioSchedule
* @property WhatsappCard $whatsappCard
* @property WhatsappAuthentication $whatsappAuthentication
*/
Expand Down Expand Up @@ -936,37 +925,6 @@ public function jsonSerialize(): array
}
}

class TwilioSchedule implements \JsonSerializable
{
/**
* @property string $id
* @property string $title
* @property string $timeSlots
*/
protected $id;
protected $title;
protected $timeSlots;
public function __construct(array $payload = []) {
$this->id = Values::array_get($payload, 'id');
$this->title = Values::array_get($payload, 'title');
$this->timeSlots = Values::array_get($payload, 'timeSlots');
}

public function toArray(): array
{
return $this->jsonSerialize();
}

public function jsonSerialize(): array
{
return [
'id' => $this->id,
'title' => $this->title,
'timeSlots' => $this->timeSlots
];
}
}

class WhatsappCard implements \JsonSerializable
{
/**
Expand Down Expand Up @@ -1077,7 +1035,6 @@ class Types implements \JsonSerializable
* @property TwilioCatalog $twilioCatalog
* @property TwilioCarousel $twilioCarousel
* @property TwilioFlows $twilioFlows
* @property TwilioSchedule $twilioSchedule
* @property WhatsappCard $whatsappCard
* @property WhatsappAuthentication $whatsappAuthentication
*/
Expand All @@ -1091,7 +1048,6 @@ class Types implements \JsonSerializable
protected $twilioCatalog;
protected $twilioCarousel;
protected $twilioFlows;
protected $twilioSchedule;
protected $whatsappCard;
protected $whatsappAuthentication;
public function __construct(array $payload = []) {
Expand All @@ -1105,7 +1061,6 @@ public function __construct(array $payload = []) {
$this->twilioCatalog = Values::array_get($payload, 'twilio/catalog');
$this->twilioCarousel = Values::array_get($payload, 'twilio/carousel');
$this->twilioFlows = Values::array_get($payload, 'twilio/flows');
$this->twilioSchedule = Values::array_get($payload, 'twilio/schedule');
$this->whatsappCard = Values::array_get($payload, 'whatsapp/card');
$this->whatsappAuthentication = Values::array_get($payload, 'whatsapp/authentication');
}
Expand All @@ -1128,7 +1083,6 @@ public function jsonSerialize(): array
'twilio/catalog' => $this->twilioCatalog,
'twilio/carousel' => $this->twilioCarousel,
'twilio/flows' => $this->twilioFlows,
'twilio/schedule' => $this->twilioSchedule,
'whatsapp/card' => $this->whatsappCard,
'whatsapp/authentication' => $this->whatsappAuthentication
];
Expand Down
3 changes: 0 additions & 3 deletions src/Twilio/Rest/Events/V1/SubscriptionContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
use Twilio\Values;
use Twilio\Version;
use Twilio\InstanceContext;
use Twilio\Serialize;
use Twilio\Rest\Events\V1\Subscription\SubscribedEventList;


Expand Down Expand Up @@ -108,8 +107,6 @@ public function update(array $options = []): SubscriptionInstance
$options['description'],
'SinkSid' =>
$options['sinkSid'],
'ReceiveEventsFromSubaccounts' =>
Serialize::booleanToString($options['receiveEventsFromSubaccounts']),
]);

$headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]);
Expand Down
2 changes: 0 additions & 2 deletions src/Twilio/Rest/Events/V1/SubscriptionInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
* @property string|null $sinkSid
* @property string|null $url
* @property array|null $links
* @property bool|null $receiveEventsFromSubaccounts
*/
class SubscriptionInstance extends InstanceResource
{
Expand All @@ -62,7 +61,6 @@ public function __construct(Version $version, array $payload, string $sid = null
'sinkSid' => Values::array_get($payload, 'sink_sid'),
'url' => Values::array_get($payload, 'url'),
'links' => Values::array_get($payload, 'links'),
'receiveEventsFromSubaccounts' => Values::array_get($payload, 'receive_events_from_subaccounts'),
];

$this->solution = ['sid' => $sid ?: $this->properties['sid'], ];
Expand Down
7 changes: 1 addition & 6 deletions src/Twilio/Rest/Events/V1/SubscriptionList.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,19 @@ public function __construct(
* @param string $description A human readable description for the Subscription **This value should not contain PII.**
* @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created.
* @param array[] $types An array of objects containing the subscribed Event Types
* @param array|Options $options Optional Arguments
* @return SubscriptionInstance Created SubscriptionInstance
* @throws TwilioException When an HTTP error occurs.
*/
public function create(string $description, string $sinkSid, array $types, array $options = []): SubscriptionInstance
public function create(string $description, string $sinkSid, array $types): SubscriptionInstance
{

$options = new Values($options);

$data = Values::of([
'Description' =>
$description,
'SinkSid' =>
$sinkSid,
'Types' =>
Serialize::map($types,function ($e) { return Serialize::jsonObject($e); }),
'ReceiveEventsFromSubaccounts' =>
Serialize::booleanToString($options['receiveEventsFromSubaccounts']),
]);

$headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]);
Expand Down
74 changes: 3 additions & 71 deletions src/Twilio/Rest/Events/V1/SubscriptionOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,6 @@

abstract class SubscriptionOptions
{
/**
* @param bool $receiveEventsFromSubaccounts Receive events from all children accounts in the parent account subscription.
* @return CreateSubscriptionOptions Options builder
*/
public static function create(

bool $receiveEventsFromSubaccounts = Values::BOOL_NONE

): CreateSubscriptionOptions
{
return new CreateSubscriptionOptions(
$receiveEventsFromSubaccounts
);
}



Expand All @@ -55,62 +41,23 @@ public static function read(
/**
* @param string $description A human readable description for the Subscription.
* @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created.
* @param bool $receiveEventsFromSubaccounts Receive events from all children accounts in the parent account subscription.
* @return UpdateSubscriptionOptions Options builder
*/
public static function update(

string $description = Values::NONE,
string $sinkSid = Values::NONE,
bool $receiveEventsFromSubaccounts = Values::BOOL_NONE
string $sinkSid = Values::NONE

): UpdateSubscriptionOptions
{
return new UpdateSubscriptionOptions(
$description,
$sinkSid,
$receiveEventsFromSubaccounts
$sinkSid
);
}

}

class CreateSubscriptionOptions extends Options
{
/**
* @param bool $receiveEventsFromSubaccounts Receive events from all children accounts in the parent account subscription.
*/
public function __construct(

bool $receiveEventsFromSubaccounts = Values::BOOL_NONE

) {
$this->options['receiveEventsFromSubaccounts'] = $receiveEventsFromSubaccounts;
}

/**
* Receive events from all children accounts in the parent account subscription.
*
* @param bool $receiveEventsFromSubaccounts Receive events from all children accounts in the parent account subscription.
* @return $this Fluent Builder
*/
public function setReceiveEventsFromSubaccounts(bool $receiveEventsFromSubaccounts): self
{
$this->options['receiveEventsFromSubaccounts'] = $receiveEventsFromSubaccounts;
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.Events.V1.CreateSubscriptionOptions ' . $options . ']';
}
}



Expand Down Expand Up @@ -156,18 +103,15 @@ class UpdateSubscriptionOptions extends Options
/**
* @param string $description A human readable description for the Subscription.
* @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created.
* @param bool $receiveEventsFromSubaccounts Receive events from all children accounts in the parent account subscription.
*/
public function __construct(

string $description = Values::NONE,
string $sinkSid = Values::NONE,
bool $receiveEventsFromSubaccounts = Values::BOOL_NONE
string $sinkSid = Values::NONE

) {
$this->options['description'] = $description;
$this->options['sinkSid'] = $sinkSid;
$this->options['receiveEventsFromSubaccounts'] = $receiveEventsFromSubaccounts;
}

/**
Expand All @@ -194,18 +138,6 @@ public function setSinkSid(string $sinkSid): self
return $this;
}

/**
* Receive events from all children accounts in the parent account subscription.
*
* @param bool $receiveEventsFromSubaccounts Receive events from all children accounts in the parent account subscription.
* @return $this Fluent Builder
*/
public function setReceiveEventsFromSubaccounts(bool $receiveEventsFromSubaccounts): self
{
$this->options['receiveEventsFromSubaccounts'] = $receiveEventsFromSubaccounts;
return $this;
}

/**
* Provide a friendly representation
*
Expand Down
14 changes: 7 additions & 7 deletions src/Twilio/Rest/Iam/V1.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@
use Twilio\InstanceContext;
use Twilio\Rest\Iam\V1\ApiKeyList;
use Twilio\Rest\Iam\V1\GetApiKeysList;
use Twilio\Rest\Iam\V1\NewApiKeyList;
use Twilio\Rest\Iam\V1\KeyList;
use Twilio\Version;

/**
* @property ApiKeyList $apiKey
* @property GetApiKeysList $getApiKeys
* @property NewApiKeyList $newApiKey
* @property KeyList $keys
* @method \Twilio\Rest\Iam\V1\ApiKeyContext apiKey(string $sid)
*/
class V1 extends Version
{
protected $_apiKey;
protected $_getApiKeys;
protected $_newApiKey;
protected $_keys;

/**
* Construct the V1 version of Iam
Expand Down Expand Up @@ -62,12 +62,12 @@ protected function getGetApiKeys(): GetApiKeysList
return $this->_getApiKeys;
}

protected function getNewApiKey(): NewApiKeyList
protected function getKeys(): KeyList
{
if (!$this->_newApiKey) {
$this->_newApiKey = new NewApiKeyList($this);
if (!$this->_keys) {
$this->_keys = new KeyList($this);
}
return $this->_newApiKey;
return $this->_keys;
}

/**
Expand Down
Loading
Loading