<?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 ConfigurationModels
{
    /**
     * @property string $url The destination URL for webhooks.
     * @property string $method The HTTP method used to invoke the webhook URL.
    */
    public static function createCreateConfigurationRequestStatusCallbacks(array $payload = []): CreateConfigurationRequestStatusCallbacks
    {
        return new CreateConfigurationRequestStatusCallbacks($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 The strategy Conversation Orchestrator uses to assign communications to conversations.
     * @property string $memoryStoreId The memory store ID that Conversation Orchestrator uses for profile resolution.
     * @property string $channelSettings
     * @property CreateConfigurationRequestStatusCallbacks[] $statusCallbacks A list of webhook configurations.
     * @property string[] $intelligenceConfigurationIds A list of Conversational Intelligence configuration IDs.
     * @property bool $memoryExtractionEnabled Whether memory extraction is enabled for conversations under this configuration. Defaults to false.
    */
    public static function createCreateConfigurationRequest(array $payload = []): CreateConfigurationRequest
    {
        return new CreateConfigurationRequest($payload);
    }

    /**
     * @property string $url
     * @property string $method
    */
    public static function createUpdateConfigurationRequestStatusCallbacks(array $payload = []): UpdateConfigurationRequestStatusCallbacks
    {
        return new UpdateConfigurationRequestStatusCallbacks($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 The strategy Conversation Orchestrator uses to assign communications to conversations.
     * @property string $memoryStoreId The Memory Store ID for profile resolution.
     * @property string $channelSettings
     * @property UpdateConfigurationRequestStatusCallbacks[] $statusCallbacks
     * @property string[] $intelligenceConfigurationIds A list of Conversational Intelligence configuration IDs.
     * @property bool $memoryExtractionEnabled Whether memory extraction is enabled for conversations under this configuration. Defaults to false.
    */
    public static function createUpdateConfigurationRequest(array $payload = []): UpdateConfigurationRequest
    {
        return new UpdateConfigurationRequest($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);
    }

}

class CreateConfigurationRequestStatusCallbacks implements \JsonSerializable
{
    /**
     * @property string $url The destination URL for webhooks.
     * @property string $method The 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 CreateConfigurationRequest 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 The strategy Conversation Orchestrator uses to assign communications to conversations.
     * @property string $memoryStoreId The memory store ID that Conversation Orchestrator uses for profile resolution.
     * @property string $channelSettings
     * @property CreateConfigurationRequestStatusCallbacks[] $statusCallbacks A list of webhook configurations.
     * @property string[] $intelligenceConfigurationIds A list of Conversational Intelligence configuration IDs.
     * @property bool $memoryExtractionEnabled Whether memory extraction is enabled for conversations under this configuration. Defaults to false.
    */
        protected $displayName;
        protected $description;
        protected $conversationGroupingType;
        protected $memoryStoreId;
        protected $channelSettings;
        protected $statusCallbacks;
        protected $intelligenceConfigurationIds;
        protected $memoryExtractionEnabled;
    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');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
            'displayName' => $this->displayName,
            'description' => $this->description,
            'conversationGroupingType' => $this->conversationGroupingType,
            '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;
        }
        return $jsonString;
    }
}

class UpdateConfigurationRequestStatusCallbacks implements \JsonSerializable
{
    /**
     * @property string $url
     * @property string $method
    */
        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 UpdateConfigurationRequest 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 The strategy Conversation Orchestrator uses to assign communications to conversations.
     * @property string $memoryStoreId The Memory Store ID for profile resolution.
     * @property string $channelSettings
     * @property UpdateConfigurationRequestStatusCallbacks[] $statusCallbacks
     * @property string[] $intelligenceConfigurationIds A list of Conversational Intelligence configuration IDs.
     * @property bool $memoryExtractionEnabled Whether memory extraction is enabled for conversations under this configuration. Defaults to false.
    */
        protected $displayName;
        protected $description;
        protected $conversationGroupingType;
        protected $memoryStoreId;
        protected $channelSettings;
        protected $statusCallbacks;
        protected $intelligenceConfigurationIds;
        protected $memoryExtractionEnabled;
    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');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
            'description' => $this->description,
            'conversationGroupingType' => $this->conversationGroupingType,
            'memoryStoreId' => $this->memoryStoreId,
            'channelSettings' => $this->channelSettings
        ];
        if (isset($this->displayName)) {
            $jsonString['displayName'] = $this->displayName;
        }
        if (isset($this->statusCallbacks)) {
            $jsonString['statusCallbacks'] = $this->statusCallbacks;
        }
        if (isset($this->intelligenceConfigurationIds)) {
            $jsonString['intelligenceConfigurationIds'] = $this->intelligenceConfigurationIds;
        }
        if (isset($this->memoryExtractionEnabled)) {
            $jsonString['memoryExtractionEnabled'] = $this->memoryExtractionEnabled;
        }
        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;
    }
}

