Skip to content

Commit

Permalink
[Librarian] Regenerated @ fffff4e2a9903902262deb482f4cefeb44c2d081
Browse files Browse the repository at this point in the history
  • Loading branch information
twilio-dx committed May 18, 2023
1 parent 6d1f88c commit 48aa082
Show file tree
Hide file tree
Showing 47 changed files with 1,394 additions and 280 deletions.
17 changes: 17 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
twilio-php Changelog
====================

[2023-05-18] Version 7.4.1
--------------------------
**Conversations**
- Added `AddressCountry` parameter to Address Configuration endpoint, to support regional short code addresses
- Added query parameters `start_date`, `end_date` and `state` in list Conversations resource for filtering

**Insights**
- Added annotations parameters to list summary api

**Messaging**
- Add GET domainByMessagingService endpoint to linkShortening service
- Add `disable_https` to link shortening domain_config properties

**Numbers**
- Add bulk_eligibility api under version `/v1`.


[2023-05-04] Version 7.4.0
--------------------------
**Conversations**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* @property \DateTime|null $dateCreated
* @property \DateTime|null $dateUpdated
* @property string|null $url
* @property string|null $addressCountry
*/
class AddressConfigurationInstance extends InstanceResource
{
Expand All @@ -60,6 +61,7 @@ public function __construct(Version $version, array $payload, string $sid = null
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
'url' => Values::array_get($payload, 'url'),
'addressCountry' => Values::array_get($payload, 'address_country'),
];

$this->solution = ['sid' => $sid ?: $this->properties['sid'], ];
Expand Down
2 changes: 2 additions & 0 deletions src/Twilio/Rest/Conversations/V1/AddressConfigurationList.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public function create(string $type, string $address, array $options = []): Addr
$options['autoCreationStudioFlowSid'],
'AutoCreation.StudioRetryCount' =>
$options['autoCreationStudioRetryCount'],
'AddressCountry' =>
$options['addressCountry'],
]);

$payload = $this->version->create('POST', $this->uri, [], $data);
Expand Down
24 changes: 21 additions & 3 deletions src/Twilio/Rest/Conversations/V1/AddressConfigurationOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ abstract class AddressConfigurationOptions
* @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated`
* @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to.
* @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request
* @param string $addressCountry An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses.
* @return CreateAddressConfigurationOptions Options builder
*/
public static function create(
Expand All @@ -42,7 +43,8 @@ public static function create(
string $autoCreationWebhookMethod = Values::NONE,
array $autoCreationWebhookFilters = Values::ARRAY_NONE,
string $autoCreationStudioFlowSid = Values::NONE,
int $autoCreationStudioRetryCount = Values::INT_NONE
int $autoCreationStudioRetryCount = Values::INT_NONE,
string $addressCountry = Values::NONE

): CreateAddressConfigurationOptions
{
Expand All @@ -55,7 +57,8 @@ public static function create(
$autoCreationWebhookMethod,
$autoCreationWebhookFilters,
$autoCreationStudioFlowSid,
$autoCreationStudioRetryCount
$autoCreationStudioRetryCount,
$addressCountry
);
}

Expand Down Expand Up @@ -129,6 +132,7 @@ class CreateAddressConfigurationOptions extends Options
* @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated`
* @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to.
* @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request
* @param string $addressCountry An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses.
*/
public function __construct(

Expand All @@ -140,7 +144,8 @@ public function __construct(
string $autoCreationWebhookMethod = Values::NONE,
array $autoCreationWebhookFilters = Values::ARRAY_NONE,
string $autoCreationStudioFlowSid = Values::NONE,
int $autoCreationStudioRetryCount = Values::INT_NONE
int $autoCreationStudioRetryCount = Values::INT_NONE,
string $addressCountry = Values::NONE

) {
$this->options['friendlyName'] = $friendlyName;
Expand All @@ -152,6 +157,7 @@ public function __construct(
$this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters;
$this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid;
$this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount;
$this->options['addressCountry'] = $addressCountry;
}

/**
Expand Down Expand Up @@ -258,6 +264,18 @@ public function setAutoCreationStudioRetryCount(int $autoCreationStudioRetryCoun
return $this;
}

/**
* An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses.
*
* @param string $addressCountry An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses.
* @return $this Fluent Builder
*/
public function setAddressCountry(string $addressCountry): self
{
$this->options['addressCountry'] = $addressCountry;
return $this;
}

/**
* Provide a friendly representation
*
Expand Down
18 changes: 14 additions & 4 deletions src/Twilio/Rest/Conversations/V1/ConversationList.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public function create(array $options = []): ConversationInstance
* 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
Expand All @@ -103,9 +104,9 @@ public function create(array $options = []): ConversationInstance
* efficient page size, i.e. min(limit, 1000)
* @return ConversationInstance[] Array of results
*/
public function read(int $limit = null, $pageSize = null): array
public function read(array $options = [], int $limit = null, $pageSize = null): array
{
return \iterator_to_array($this->stream($limit, $pageSize), false);
return \iterator_to_array($this->stream($options, $limit, $pageSize), false);
}

/**
Expand All @@ -116,6 +117,7 @@ public function read(int $limit = null, $pageSize = null): array
* 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
Expand All @@ -126,11 +128,11 @@ public function read(int $limit = null, $pageSize = null): array
* efficient page size, i.e. min(limit, 1000)
* @return Stream stream of results
*/
public function stream(int $limit = null, $pageSize = null): Stream
public function stream(array $options = [], int $limit = null, $pageSize = null): Stream
{
$limits = $this->version->readLimits($limit, $pageSize);

$page = $this->page($limits['pageSize']);
$page = $this->page($options, $limits['pageSize']);

return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
}
Expand All @@ -145,13 +147,21 @@ public function stream(int $limit = null, $pageSize = null): Stream
* @return ConversationPage Page of ConversationInstance
*/
public function page(
array $options = [],
$pageSize = Values::NONE,
string $pageToken = Values::NONE,
$pageNumber = Values::NONE
): ConversationPage
{
$options = new Values($options);

$params = Values::of([
'StartDate' =>
$options['startDate'],
'EndDate' =>
$options['endDate'],
'State' =>
$options['state'],
'PageToken' => $pageToken,
'Page' => $pageNumber,
'PageSize' => $pageSize,
Expand Down
86 changes: 86 additions & 0 deletions src/Twilio/Rest/Conversations/V1/ConversationOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,26 @@ public static function delete(
}


/**
* @param string $startDate Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters.
* @param string $endDate End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters.
* @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed`
* @return ReadConversationOptions Options builder
*/
public static function read(

string $startDate = Values::NONE,
string $endDate = Values::NONE,
string $state = Values::NONE

): ReadConversationOptions
{
return new ReadConversationOptions(
$startDate,
$endDate,
$state
);
}

/**
* @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional.
Expand Down Expand Up @@ -331,6 +351,72 @@ public function __toString(): string
}


class ReadConversationOptions extends Options
{
/**
* @param string $startDate Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters.
* @param string $endDate End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters.
* @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed`
*/
public function __construct(

string $startDate = Values::NONE,
string $endDate = Values::NONE,
string $state = Values::NONE

) {
$this->options['startDate'] = $startDate;
$this->options['endDate'] = $endDate;
$this->options['state'] = $state;
}

/**
* Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters.
*
* @param string $startDate Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters.
* @return $this Fluent Builder
*/
public function setStartDate(string $startDate): self
{
$this->options['startDate'] = $startDate;
return $this;
}

/**
* End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters.
*
* @param string $endDate End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters.
* @return $this Fluent Builder
*/
public function setEndDate(string $endDate): self
{
$this->options['endDate'] = $endDate;
return $this;
}

/**
* State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed`
*
* @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed`
* @return $this Fluent Builder
*/
public function setState(string $state): self
{
$this->options['state'] = $state;
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.Conversations.V1.ReadConversationOptions ' . $options . ']';
}
}

class UpdateConversationOptions extends Options
{
Expand Down
18 changes: 14 additions & 4 deletions src/Twilio/Rest/Conversations/V1/Service/ConversationList.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public function create(array $options = []): ConversationInstance
* 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
Expand All @@ -110,9 +111,9 @@ public function create(array $options = []): ConversationInstance
* efficient page size, i.e. min(limit, 1000)
* @return ConversationInstance[] Array of results
*/
public function read(int $limit = null, $pageSize = null): array
public function read(array $options = [], int $limit = null, $pageSize = null): array
{
return \iterator_to_array($this->stream($limit, $pageSize), false);
return \iterator_to_array($this->stream($options, $limit, $pageSize), false);
}

/**
Expand All @@ -123,6 +124,7 @@ public function read(int $limit = null, $pageSize = null): array
* 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
Expand All @@ -133,11 +135,11 @@ public function read(int $limit = null, $pageSize = null): array
* efficient page size, i.e. min(limit, 1000)
* @return Stream stream of results
*/
public function stream(int $limit = null, $pageSize = null): Stream
public function stream(array $options = [], int $limit = null, $pageSize = null): Stream
{
$limits = $this->version->readLimits($limit, $pageSize);

$page = $this->page($limits['pageSize']);
$page = $this->page($options, $limits['pageSize']);

return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
}
Expand All @@ -152,13 +154,21 @@ public function stream(int $limit = null, $pageSize = null): Stream
* @return ConversationPage Page of ConversationInstance
*/
public function page(
array $options = [],
$pageSize = Values::NONE,
string $pageToken = Values::NONE,
$pageNumber = Values::NONE
): ConversationPage
{
$options = new Values($options);

$params = Values::of([
'StartDate' =>
$options['startDate'],
'EndDate' =>
$options['endDate'],
'State' =>
$options['state'],
'PageToken' => $pageToken,
'Page' => $pageNumber,
'PageSize' => $pageSize,
Expand Down
Loading

0 comments on commit 48aa082

Please sign in to comment.