<?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 CommunicationModels
{
    /**
     * @property string $address
     * @property string $channel
     * @property string $participantId
    */
    public static function createCreateCommunicationInConversationRequestAuthor(array $payload = []): CreateCommunicationInConversationRequestAuthor
    {
        return new CreateCommunicationInConversationRequestAuthor($payload);
    }

    /**
     * @property int $channel
     * @property string $confidence
     * @property string $engine
    */
    public static function createContentTranscriptionTranscription(array $payload = []): ContentTranscriptionTranscription
    {
        return new ContentTranscriptionTranscription($payload);
    }

    /**
     * @property string $type
     * @property string $text
     * @property ContentTranscriptionTranscription $transcription
    */
    public static function createCreateCommunicationInConversationRequestContent(array $payload = []): CreateCommunicationInConversationRequestContent
    {
        return new CreateCommunicationInConversationRequestContent($payload);
    }

    /**
     * @property CreateCommunicationInConversationRequestAuthor $author
     * @property CreateCommunicationInConversationRequestContent $content
     * @property string $channelId
     * @property CreateCommunicationInConversationRequestAuthor[] $recipients
    */
    public static function createCreateCommunicationInConversationRequest(array $payload = []): CreateCommunicationInConversationRequest
    {
        return new CreateCommunicationInConversationRequest($payload);
    }

    /**
     * @property string $address The address value formatted according to channel type: - SMS/VOICE: E.164 phone number (such as \"+18005550100\") - WHATSAPP: Phone number with whatsapp prefix (such as \"whatsapp:+18005550100\") - RCS: Sender ID or phone number with rcs prefix (such as \"rcs:brand_acme_agent\" or \"rcs:+18005550100\") - CHAT: Customer-defined string identifier
     * @property string $channel Channel type for the Participant address.
     * @property string $participantId Participant ID associated with this address.
    */
    public static function createConversationsV2ParticipantAddress(array $payload = []): ConversationsV2ParticipantAddress
    {
        return new ConversationsV2ParticipantAddress($payload);
    }

    /**
     * @property int $channel Audio channel identifier (0 for inbound, 1 for outbound).
     * @property float $confidence Overall confidence score for the transcription (0.0-1.0).
     * @property string $engine Transcription engine used.
     * @property ConversationsV2ContentTranscriptionTranscriptionWords[] $words Word-level transcription data with timing information.
    */
    public static function createConversationsV2ContentTranscriptionTranscription(array $payload = []): ConversationsV2ContentTranscriptionTranscription
    {
        return new ConversationsV2ContentTranscriptionTranscription($payload);
    }

    /**
     * @property string $type Content type discriminator.
     * @property string $text Transcribed text.
     * @property ConversationsV2ContentTranscriptionTranscription $transcription
    */
    public static function createListCommunicationByConversation200ResponseCommunicationsContent(array $payload = []): ListCommunicationByConversation200ResponseCommunicationsContent
    {
        return new ListCommunicationByConversation200ResponseCommunicationsContent($payload);
    }

}

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

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

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

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

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

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

class CreateCommunicationInConversationRequestContent implements \JsonSerializable
{
    /**
     * @property string $type
     * @property string $text
     * @property ContentTranscriptionTranscription $transcription
    */
        protected $type;
        protected $text;
        protected $transcription;
    public function __construct(array $payload = []) {
        $this->type = Values::array_get($payload, 'type');
        $this->text = Values::array_get($payload, 'text');
        $this->transcription = Values::array_get($payload, 'transcription');
    }

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

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

class CreateCommunicationInConversationRequest implements \JsonSerializable
{
    /**
     * @property CreateCommunicationInConversationRequestAuthor $author
     * @property CreateCommunicationInConversationRequestContent $content
     * @property string $channelId
     * @property CreateCommunicationInConversationRequestAuthor[] $recipients
    */
        protected $author;
        protected $content;
        protected $channelId;
        protected $recipients;
    public function __construct(array $payload = []) {
        $this->author = Values::array_get($payload, 'author');
        $this->content = Values::array_get($payload, 'content');
        $this->channelId = Values::array_get($payload, 'channelId');
        $this->recipients = Values::array_get($payload, 'recipients');
    }

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

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

class ConversationsV2ParticipantAddress implements \JsonSerializable
{
    /**
     * @property string $address The address value formatted according to channel type: - SMS/VOICE: E.164 phone number (such as \"+18005550100\") - WHATSAPP: Phone number with whatsapp prefix (such as \"whatsapp:+18005550100\") - RCS: Sender ID or phone number with rcs prefix (such as \"rcs:brand_acme_agent\" or \"rcs:+18005550100\") - CHAT: Customer-defined string identifier
     * @property string $channel Channel type for the Participant address.
     * @property string $participantId Participant ID associated with this address.
    */
        protected $address;
        protected $channel;
        protected $participantId;
    public function __construct(array $payload = []) {
        $this->address = Values::array_get($payload, 'address');
        $this->channel = Values::array_get($payload, 'channel');
        $this->participantId = Values::array_get($payload, 'participantId');
    }

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

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

class ConversationsV2ContentTranscriptionTranscription implements \JsonSerializable
{
    /**
     * @property int $channel Audio channel identifier (0 for inbound, 1 for outbound).
     * @property float $confidence Overall confidence score for the transcription (0.0-1.0).
     * @property string $engine Transcription engine used.
     * @property ConversationsV2ContentTranscriptionTranscriptionWords[] $words Word-level transcription data with timing information.
    */
        protected $channel;
        protected $confidence;
        protected $engine;
        protected $words;
    public function __construct(array $payload = []) {
        $this->channel = Values::array_get($payload, 'channel');
        $this->confidence = Values::array_get($payload, 'confidence');
        $this->engine = Values::array_get($payload, 'engine');
        $this->words = Values::array_get($payload, 'words');
    }

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

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

class ListCommunicationByConversation200ResponseCommunicationsContent implements \JsonSerializable
{
    /**
     * @property string $type Content type discriminator.
     * @property string $text Transcribed text.
     * @property ConversationsV2ContentTranscriptionTranscription $transcription
    */
        protected $type;
        protected $text;
        protected $transcription;
    public function __construct(array $payload = []) {
        $this->type = Values::array_get($payload, 'type');
        $this->text = Values::array_get($payload, 'text');
        $this->transcription = Values::array_get($payload, 'transcription');
    }

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

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

