Skip to content

Commit

Permalink
[Librarian] Regenerated @ 2e932f6c59e0f9fb6cb96952802e5ebedd83b6f0 18…
Browse files Browse the repository at this point in the history
…52557f82faade033dbd5bd0615c9e1aa4d9fae
  • Loading branch information
twilio-dx committed Oct 24, 2024
1 parent 0c67059 commit 12b597a
Show file tree
Hide file tree
Showing 24 changed files with 1,291 additions and 226 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
twilio-php Changelog
====================

[2024-10-24] Version 8.3.5
--------------------------
**Conversations**
- Expose ConversationWithParticipants resource that allows creating a conversation with participants


[2024-10-17] Version 8.3.4
--------------------------
**Api**
Expand Down
11 changes: 11 additions & 0 deletions src/Twilio/Rest/Conversations/V1.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Twilio\Rest\Conversations\V1\AddressConfigurationList;
use Twilio\Rest\Conversations\V1\ConfigurationList;
use Twilio\Rest\Conversations\V1\ConversationList;
use Twilio\Rest\Conversations\V1\ConversationWithParticipantsList;
use Twilio\Rest\Conversations\V1\CredentialList;
use Twilio\Rest\Conversations\V1\ParticipantConversationList;
use Twilio\Rest\Conversations\V1\RoleList;
Expand All @@ -32,6 +33,7 @@
* @property AddressConfigurationList $addressConfigurations
* @property ConfigurationList $configuration
* @property ConversationList $conversations
* @property ConversationWithParticipantsList $conversationWithParticipants
* @property CredentialList $credentials
* @property ParticipantConversationList $participantConversations
* @property RoleList $roles
Expand All @@ -49,6 +51,7 @@ class V1 extends Version
protected $_addressConfigurations;
protected $_configuration;
protected $_conversations;
protected $_conversationWithParticipants;
protected $_credentials;
protected $_participantConversations;
protected $_roles;
Expand Down Expand Up @@ -90,6 +93,14 @@ protected function getConversations(): ConversationList
return $this->_conversations;
}

protected function getConversationWithParticipants(): ConversationWithParticipantsList
{
if (!$this->_conversationWithParticipants) {
$this->_conversationWithParticipants = new ConversationWithParticipantsList($this);
}
return $this->_conversationWithParticipants;
}

protected function getCredentials(): CredentialList
{
if (!$this->_credentials) {
Expand Down
28 changes: 14 additions & 14 deletions src/Twilio/Rest/Conversations/V1/ConversationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@
use Twilio\InstanceContext;
use Twilio\Serialize;
use Twilio\Rest\Conversations\V1\Conversation\ParticipantList;
use Twilio\Rest\Conversations\V1\Conversation\WebhookList;
use Twilio\Rest\Conversations\V1\Conversation\MessageList;
use Twilio\Rest\Conversations\V1\Conversation\WebhookList;


/**
* @property ParticipantList $participants
* @property WebhookList $webhooks
* @property MessageList $messages
* @method \Twilio\Rest\Conversations\V1\Conversation\WebhookContext webhooks(string $sid)
* @property WebhookList $webhooks
* @method \Twilio\Rest\Conversations\V1\Conversation\MessageContext messages(string $sid)
* @method \Twilio\Rest\Conversations\V1\Conversation\ParticipantContext participants(string $sid)
* @method \Twilio\Rest\Conversations\V1\Conversation\WebhookContext webhooks(string $sid)
*/
class ConversationContext extends InstanceContext
{
protected $_participants;
protected $_webhooks;
protected $_messages;
protected $_webhooks;

/**
* Initialize the ConversationContext
Expand Down Expand Up @@ -166,33 +166,33 @@ protected function getParticipants(): ParticipantList
}

/**
* Access the webhooks
* Access the messages
*/
protected function getWebhooks(): WebhookList
protected function getMessages(): MessageList
{
if (!$this->_webhooks) {
$this->_webhooks = new WebhookList(
if (!$this->_messages) {
$this->_messages = new MessageList(
$this->version,
$this->solution['sid']
);
}

return $this->_webhooks;
return $this->_messages;
}

/**
* Access the messages
* Access the webhooks
*/
protected function getMessages(): MessageList
protected function getWebhooks(): WebhookList
{
if (!$this->_messages) {
$this->_messages = new MessageList(
if (!$this->_webhooks) {
$this->_webhooks = new WebhookList(
$this->version,
$this->solution['sid']
);
}

return $this->_messages;
return $this->_webhooks;
}

/**
Expand Down
16 changes: 8 additions & 8 deletions src/Twilio/Rest/Conversations/V1/ConversationInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
use Twilio\Version;
use Twilio\Deserialize;
use Twilio\Rest\Conversations\V1\Conversation\ParticipantList;
use Twilio\Rest\Conversations\V1\Conversation\WebhookList;
use Twilio\Rest\Conversations\V1\Conversation\MessageList;
use Twilio\Rest\Conversations\V1\Conversation\WebhookList;


/**
Expand All @@ -47,8 +47,8 @@
class ConversationInstance extends InstanceResource
{
protected $_participants;
protected $_webhooks;
protected $_messages;
protected $_webhooks;

/**
* Initialize the ConversationInstance
Expand Down Expand Up @@ -147,19 +147,19 @@ protected function getParticipants(): ParticipantList
}

/**
* Access the webhooks
* Access the messages
*/
protected function getWebhooks(): WebhookList
protected function getMessages(): MessageList
{
return $this->proxy()->webhooks;
return $this->proxy()->messages;
}

/**
* Access the messages
* Access the webhooks
*/
protected function getMessages(): MessageList
protected function getWebhooks(): WebhookList
{
return $this->proxy()->messages;
return $this->proxy()->webhooks;
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?php

/**
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Conversations
* 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\Conversations\V1;

use Twilio\Exceptions\TwilioException;
use Twilio\InstanceResource;
use Twilio\Values;
use Twilio\Version;
use Twilio\Deserialize;


/**
* @property string|null $accountSid
* @property string|null $chatServiceSid
* @property string|null $messagingServiceSid
* @property string|null $sid
* @property string|null $friendlyName
* @property string|null $uniqueName
* @property string|null $attributes
* @property string $state
* @property \DateTime|null $dateCreated
* @property \DateTime|null $dateUpdated
* @property array|null $timers
* @property array|null $links
* @property array|null $bindings
* @property string|null $url
*/
class ConversationWithParticipantsInstance extends InstanceResource
{
/**
* Initialize the ConversationWithParticipantsInstance
*
* @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'),
'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'),
'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'),
'sid' => Values::array_get($payload, 'sid'),
'friendlyName' => Values::array_get($payload, 'friendly_name'),
'uniqueName' => Values::array_get($payload, 'unique_name'),
'attributes' => Values::array_get($payload, 'attributes'),
'state' => Values::array_get($payload, 'state'),
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
'timers' => Values::array_get($payload, 'timers'),
'links' => Values::array_get($payload, 'links'),
'bindings' => Values::array_get($payload, 'bindings'),
'url' => Values::array_get($payload, 'url'),
];

$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.Conversations.V1.ConversationWithParticipantsInstance]';
}
}

104 changes: 104 additions & 0 deletions src/Twilio/Rest/Conversations/V1/ConversationWithParticipantsList.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?php

/**
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Conversations
* 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\Conversations\V1;

use Twilio\Exceptions\TwilioException;
use Twilio\ListResource;
use Twilio\Options;
use Twilio\Values;
use Twilio\Version;
use Twilio\Serialize;


class ConversationWithParticipantsList extends ListResource
{
/**
* Construct the ConversationWithParticipantsList
*
* @param Version $version Version that contains the resource
*/
public function __construct(
Version $version
) {
parent::__construct($version);

// Path Solution
$this->solution = [
];

$this->uri = '/ConversationWithParticipants';
}

/**
* Create the ConversationWithParticipantsInstance
*
* @param array|Options $options Optional Arguments
* @return ConversationWithParticipantsInstance Created ConversationWithParticipantsInstance
* @throws TwilioException When an HTTP error occurs.
*/
public function create(array $options = []): ConversationWithParticipantsInstance
{

$options = new Values($options);

$data = Values::of([
'FriendlyName' =>
$options['friendlyName'],
'UniqueName' =>
$options['uniqueName'],
'DateCreated' =>
Serialize::iso8601DateTime($options['dateCreated']),
'DateUpdated' =>
Serialize::iso8601DateTime($options['dateUpdated']),
'MessagingServiceSid' =>
$options['messagingServiceSid'],
'Attributes' =>
$options['attributes'],
'State' =>
$options['state'],
'Timers.Inactive' =>
$options['timersInactive'],
'Timers.Closed' =>
$options['timersClosed'],
'Bindings.Email.Address' =>
$options['bindingsEmailAddress'],
'Bindings.Email.Name' =>
$options['bindingsEmailName'],
'Participant' =>
Serialize::map($options['participant'], function ($e) { return $e; }),
]);

$headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]);
$payload = $this->version->create('POST', $this->uri, [], $data, $headers);

return new ConversationWithParticipantsInstance(
$this->version,
$payload
);
}


/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString(): string
{
return '[Twilio.Conversations.V1.ConversationWithParticipantsList]';
}
}
Loading

0 comments on commit 12b597a

Please sign in to comment.