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

    /**
     * @property string $name
     * @property string $type
     * @property string $profileId
     * @property CreateParticipantInConversationRequestAddresses[] $addresses
    */
    public static function createCreateParticipantInConversationRequest(array $payload = []): CreateParticipantInConversationRequest
    {
        return new CreateParticipantInConversationRequest($payload);
    }

    /**
     * @property string $name
     * @property string $type
     * @property string $profileId
     * @property CreateParticipantInConversationRequestAddresses[] $addresses
    */
    public static function createUpdateParticipantInConversationRequest(array $payload = []): UpdateParticipantInConversationRequest
    {
        return new UpdateParticipantInConversationRequest($payload);
    }

}

class CreateParticipantInConversationRequestAddresses 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 CreateParticipantInConversationRequest implements \JsonSerializable
{
    /**
     * @property string $name
     * @property string $type
     * @property string $profileId
     * @property CreateParticipantInConversationRequestAddresses[] $addresses
    */
        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 = [
            'addresses' => $this->addresses
        ];
        if (isset($this->name)) {
            $jsonString['name'] = $this->name;
        }
        if (isset($this->type)) {
            $jsonString['type'] = $this->type;
        }
        if (isset($this->profileId)) {
            $jsonString['profileId'] = $this->profileId;
        }
        return $jsonString;
    }
}

class UpdateParticipantInConversationRequest implements \JsonSerializable
{
    /**
     * @property string $name
     * @property string $type
     * @property string $profileId
     * @property CreateParticipantInConversationRequestAddresses[] $addresses
    */
        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;
    }
}

