<?php
/**
 * This code was generated by
 * ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
 *  |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
 *  |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
 *
 * Conversation Orchestrator
 * Manage configurations, conversations, participants, and communications. Create configurations to define capture rules and channel settings, then use conversations to group related communications.
 *
 * NOTE: This class is auto generated by OpenAPI Generator.
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace Twilio\Rest\Conversations\V2;

use Twilio\Values;
abstract class ConversationModels
{
    /**
     * @property string[] $intelligenceConfigurationIds A list of Conversational Intelligence configuration IDs.
    */
    public static function createCreateConversationWithConfigRequestConfiguration(array $payload = []): CreateConversationWithConfigRequestConfiguration
    {
        return new CreateConversationWithConfigRequestConfiguration($payload);
    }

    /**
     * @property string $channel
     * @property string $address
     * @property string $channelId
    */
    public static function createCreateConversationWithConfigRequestParticipantsAddresses(array $payload = []): CreateConversationWithConfigRequestParticipantsAddresses
    {
        return new CreateConversationWithConfigRequestParticipantsAddresses($payload);
    }

    /**
     * @property string $name Display name for the Participant.
     * @property string $type Type of Participant in the Conversation.
     * @property string $profileId Resolved profile ID.
     * @property CreateConversationWithConfigRequestParticipantsAddresses[] $addresses List of Communication addresses for the Participant.
    */
    public static function createCreateConversationWithConfigRequestParticipants(array $payload = []): CreateConversationWithConfigRequestParticipants
    {
        return new CreateConversationWithConfigRequestParticipants($payload);
    }

    /**
     * @property string $configurationId The ID of an existing configuration.
     * @property string $name The name of the conversation.
     * @property CreateConversationWithConfigRequestConfiguration $configuration
     * @property CreateConversationWithConfigRequestParticipants[] $participants Optional list of Participants to create with the Conversation.
    */
    public static function createCreateConversationWithConfigRequest(array $payload = []): CreateConversationWithConfigRequest
    {
        return new CreateConversationWithConfigRequest($payload);
    }

    /**
     * @property string $url Destination URL for webhooks.
     * @property string $method HTTP method used to invoke the webhook URL.
    */
    public static function createConversationsV2StatusCallbackConfig(array $payload = []): ConversationsV2StatusCallbackConfig
    {
        return new ConversationsV2StatusCallbackConfig($payload);
    }

    /**
     * @property ConversationsV2StatusCallbackConfig[] $statusCallbacks List of webhook configurations for this conversation. Send an empty array to clear all callbacks and stop webhook delivery.
    */
    public static function createPatchConversationByIdRequestConfiguration(array $payload = []): PatchConversationByIdRequestConfiguration
    {
        return new PatchConversationByIdRequestConfiguration($payload);
    }

    /**
     * @property string $name The name of the Conversation.
     * @property string $status The state of the Conversation.
     * @property PatchConversationByIdRequestConfiguration $configuration
    */
    public static function createPatchConversationByIdRequest(array $payload = []): PatchConversationByIdRequest
    {
        return new PatchConversationByIdRequest($payload);
    }

    /**
     * @property string $name The name of the Conversation.
     * @property string $status The state of the Conversation.
    */
    public static function createUpdateConversationByIdRequest(array $payload = []): UpdateConversationByIdRequest
    {
        return new UpdateConversationByIdRequest($payload);
    }

    /**
     * @property string $serviceId The Conversations V1 Service SID (IS prefix). One configuration per V1 Service SID.
    */
    public static function createConversationsV2ConversationsV1Bridge(array $payload = []): ConversationsV2ConversationsV1Bridge
    {
        return new ConversationsV2ConversationsV1Bridge($payload);
    }

    /**
     * @property string $displayName A human-readable name for the configuration. Limited to 32 characters.
     * @property string $description Human-readable description for the Configuration.
     * @property string $conversationGroupingType Type of Conversation grouping strategy: - `GROUP_BY_PROFILE`: Groups Communications by resolved Profile from the Memory Store.   A Profile is looked up or created for `CUSTOMER` Participant types. All Communications from the same Profile are in the same Conversation, regardless of address or channel. - `GROUP_BY_PARTICIPANT_ADDRESSES`: Groups Communications by Participant addresses across all channels.   A customer using +18005550100 will be in the same Conversation whether they contact by SMS, WhatsApp, or RCS. - `GROUP_BY_PARTICIPANT_ADDRESSES_AND_CHANNEL_TYPE`: Groups Communications by both Participant addresses AND channel.   A customer using +18005550100 by SMS will be in a different Conversation than the same customer by Voice.
     * @property string $memoryStoreId Memory Store ID for Profile resolution.
     * @property array<string,mixed> $channelSettings Channel-specific parameters forwarded as-is to the downstream sending service. Allows passing backend-specific fields without requiring API changes.
     * @property ConversationsV2StatusCallbackConfig[] $statusCallbacks List of default webhook configurations applied to Conversations under this Configuration.
     * @property string[] $intelligenceConfigurationIds List of Intelligence Configuration IDs configured for this Configuration.
     * @property bool $memoryExtractionEnabled Whether memory extraction is enabled for conversations under this configuration. Defaults to false.
     * @property ConversationsV2ConversationsV1Bridge $conversationsV1Bridge
    */
    public static function createListConversationByAccount200ResponseConversationsConfiguration(array $payload = []): ListConversationByAccount200ResponseConversationsConfiguration
    {
        return new ListConversationByAccount200ResponseConversationsConfiguration($payload);
    }

}

class CreateConversationWithConfigRequestConfiguration implements \JsonSerializable
{
    /**
     * @property string[] $intelligenceConfigurationIds A list of Conversational Intelligence configuration IDs.
    */
        protected $intelligenceConfigurationIds;
    public function __construct(array $payload = []) {
        $this->intelligenceConfigurationIds = Values::array_get($payload, 'intelligenceConfigurationIds');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->intelligenceConfigurationIds)) {
            $jsonString['intelligenceConfigurationIds'] = $this->intelligenceConfigurationIds;
        }
        return $jsonString;
    }
}

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

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

    public function jsonSerialize(): array
    {
        $jsonString = [
            'channel' => $this->channel,
            'address' => $this->address
        ];
        if (isset($this->channelId)) {
            $jsonString['channelId'] = $this->channelId;
        }
        return $jsonString;
    }
}

class CreateConversationWithConfigRequestParticipants implements \JsonSerializable
{
    /**
     * @property string $name Display name for the Participant.
     * @property string $type Type of Participant in the Conversation.
     * @property string $profileId Resolved profile ID.
     * @property CreateConversationWithConfigRequestParticipantsAddresses[] $addresses List of Communication addresses for the Participant.
    */
        protected $name;
        protected $type;
        protected $profileId;
        protected $addresses;
    public function __construct(array $payload = []) {
        $this->name = Values::array_get($payload, 'name');
        $this->type = Values::array_get($payload, 'type');
        $this->profileId = Values::array_get($payload, 'profileId');
        $this->addresses = Values::array_get($payload, 'addresses');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->name)) {
            $jsonString['name'] = $this->name;
        }
        if (isset($this->type)) {
            $jsonString['type'] = $this->type;
        }
        if (isset($this->profileId)) {
            $jsonString['profileId'] = $this->profileId;
        }
        if (isset($this->addresses)) {
            $jsonString['addresses'] = $this->addresses;
        }
        return $jsonString;
    }
}

class CreateConversationWithConfigRequest implements \JsonSerializable
{
    /**
     * @property string $configurationId The ID of an existing configuration.
     * @property string $name The name of the conversation.
     * @property CreateConversationWithConfigRequestConfiguration $configuration
     * @property CreateConversationWithConfigRequestParticipants[] $participants Optional list of Participants to create with the Conversation.
    */
        protected $configurationId;
        protected $name;
        protected $configuration;
        protected $participants;
    public function __construct(array $payload = []) {
        $this->configurationId = Values::array_get($payload, 'configurationId');
        $this->name = Values::array_get($payload, 'name');
        $this->configuration = Values::array_get($payload, 'configuration');
        $this->participants = Values::array_get($payload, 'participants');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
            'configurationId' => $this->configurationId
        ];
        if (isset($this->name)) {
            $jsonString['name'] = $this->name;
        }
        if (isset($this->configuration)) {
            $jsonString['configuration'] = $this->configuration;
        }
        if (isset($this->participants)) {
            $jsonString['participants'] = $this->participants;
        }
        return $jsonString;
    }
}

class ConversationsV2StatusCallbackConfig implements \JsonSerializable
{
    /**
     * @property string $url Destination URL for webhooks.
     * @property string $method HTTP method used to invoke the webhook URL.
    */
        protected $url;
        protected $method;
    public function __construct(array $payload = []) {
        $this->url = Values::array_get($payload, 'url');
        $this->method = Values::array_get($payload, 'method');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
            'url' => $this->url
        ];
        if (isset($this->method)) {
            $jsonString['method'] = $this->method;
        }
        return $jsonString;
    }
}

class PatchConversationByIdRequestConfiguration implements \JsonSerializable
{
    /**
     * @property ConversationsV2StatusCallbackConfig[] $statusCallbacks List of webhook configurations for this conversation. Send an empty array to clear all callbacks and stop webhook delivery.
    */
        protected $statusCallbacks;
    public function __construct(array $payload = []) {
        $this->statusCallbacks = Values::array_get($payload, 'statusCallbacks');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->statusCallbacks)) {
            $jsonString['statusCallbacks'] = $this->statusCallbacks;
        }
        return $jsonString;
    }
}

class PatchConversationByIdRequest implements \JsonSerializable
{
    /**
     * @property string $name The name of the Conversation.
     * @property string $status The state of the Conversation.
     * @property PatchConversationByIdRequestConfiguration $configuration
    */
        protected $name;
        protected $status;
        protected $configuration;
    public function __construct(array $payload = []) {
        $this->name = Values::array_get($payload, 'name');
        $this->status = Values::array_get($payload, 'status');
        $this->configuration = Values::array_get($payload, 'configuration');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->name)) {
            $jsonString['name'] = $this->name;
        }
        if (isset($this->status)) {
            $jsonString['status'] = $this->status;
        }
        if (isset($this->configuration)) {
            $jsonString['configuration'] = $this->configuration;
        }
        return $jsonString;
    }
}

class UpdateConversationByIdRequest implements \JsonSerializable
{
    /**
     * @property string $name The name of the Conversation.
     * @property string $status The state of the Conversation.
    */
        protected $name;
        protected $status;
    public function __construct(array $payload = []) {
        $this->name = Values::array_get($payload, 'name');
        $this->status = Values::array_get($payload, 'status');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
            'status' => $this->status
        ];
        if (isset($this->name)) {
            $jsonString['name'] = $this->name;
        }
        return $jsonString;
    }
}

class ConversationsV2ConversationsV1Bridge implements \JsonSerializable
{
    /**
     * @property string $serviceId The Conversations V1 Service SID (IS prefix). One configuration per V1 Service SID.
    */
        protected $serviceId;
    public function __construct(array $payload = []) {
        $this->serviceId = Values::array_get($payload, 'serviceId');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
            'serviceId' => $this->serviceId
        ];
        return $jsonString;
    }
}

class ListConversationByAccount200ResponseConversationsConfiguration implements \JsonSerializable
{
    /**
     * @property string $displayName A human-readable name for the configuration. Limited to 32 characters.
     * @property string $description Human-readable description for the Configuration.
     * @property string $conversationGroupingType Type of Conversation grouping strategy: - `GROUP_BY_PROFILE`: Groups Communications by resolved Profile from the Memory Store.   A Profile is looked up or created for `CUSTOMER` Participant types. All Communications from the same Profile are in the same Conversation, regardless of address or channel. - `GROUP_BY_PARTICIPANT_ADDRESSES`: Groups Communications by Participant addresses across all channels.   A customer using +18005550100 will be in the same Conversation whether they contact by SMS, WhatsApp, or RCS. - `GROUP_BY_PARTICIPANT_ADDRESSES_AND_CHANNEL_TYPE`: Groups Communications by both Participant addresses AND channel.   A customer using +18005550100 by SMS will be in a different Conversation than the same customer by Voice.
     * @property string $memoryStoreId Memory Store ID for Profile resolution.
     * @property array<string,mixed> $channelSettings Channel-specific parameters forwarded as-is to the downstream sending service. Allows passing backend-specific fields without requiring API changes.
     * @property ConversationsV2StatusCallbackConfig[] $statusCallbacks List of default webhook configurations applied to Conversations under this Configuration.
     * @property string[] $intelligenceConfigurationIds List of Intelligence Configuration IDs configured for this Configuration.
     * @property bool $memoryExtractionEnabled Whether memory extraction is enabled for conversations under this configuration. Defaults to false.
     * @property ConversationsV2ConversationsV1Bridge $conversationsV1Bridge
    */
        protected $displayName;
        protected $description;
        protected $conversationGroupingType;
        protected $memoryStoreId;
        protected $channelSettings;
        protected $statusCallbacks;
        protected $intelligenceConfigurationIds;
        protected $memoryExtractionEnabled;
        protected $conversationsV1Bridge;
    public function __construct(array $payload = []) {
        $this->displayName = Values::array_get($payload, 'displayName');
        $this->description = Values::array_get($payload, 'description');
        $this->conversationGroupingType = Values::array_get($payload, 'conversationGroupingType');
        $this->memoryStoreId = Values::array_get($payload, 'memoryStoreId');
        $this->channelSettings = Values::array_get($payload, 'channelSettings');
        $this->statusCallbacks = Values::array_get($payload, 'statusCallbacks');
        $this->intelligenceConfigurationIds = Values::array_get($payload, 'intelligenceConfigurationIds');
        $this->memoryExtractionEnabled = Values::array_get($payload, 'memoryExtractionEnabled');
        $this->conversationsV1Bridge = Values::array_get($payload, 'conversationsV1Bridge');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->displayName)) {
            $jsonString['displayName'] = $this->displayName;
        }
        if (isset($this->description)) {
            $jsonString['description'] = $this->description;
        }
        if (isset($this->conversationGroupingType)) {
            $jsonString['conversationGroupingType'] = $this->conversationGroupingType;
        }
        if (isset($this->memoryStoreId)) {
            $jsonString['memoryStoreId'] = $this->memoryStoreId;
        }
        if (isset($this->channelSettings)) {
            $jsonString['channelSettings'] = $this->channelSettings;
        }
        if (isset($this->statusCallbacks)) {
            $jsonString['statusCallbacks'] = $this->statusCallbacks;
        }
        if (isset($this->intelligenceConfigurationIds)) {
            $jsonString['intelligenceConfigurationIds'] = $this->intelligenceConfigurationIds;
        }
        if (isset($this->memoryExtractionEnabled)) {
            $jsonString['memoryExtractionEnabled'] = $this->memoryExtractionEnabled;
        }
        if (isset($this->conversationsV1Bridge)) {
            $jsonString['conversationsV1Bridge'] = $this->conversationsV1Bridge;
        }
        return $jsonString;
    }
}

