<?php
/**
 * This code was generated by
 * ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
 *  |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
 *  |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
 *
 * Twilio Memory API
 * APIs for managing memory stores, profiles, events, and conversational intelligence capabilities.
 *
 * NOTE: This class is auto generated by OpenAPI Generator.
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace Twilio\Rest\Memory\V1;

use Twilio\Values;
abstract class RecallModels
{
    /**
     * @property string $conversationId A unique identifier for the conversation using Twilio Type ID (TTID) format.
     * @property string $query Hybrid search query for finding relevant memories. Omit to use query expansion to generate query from previous 10 communications in conversation.
     * @property \DateTime $beginDate Start date for filtering memories (inclusive).
     * @property \DateTime $endDate End date for filtering memories (exclusive).
     * @property int $communicationsLimit Maximum number of conversational session memories to return. If omitted or set to 0, no session memories will be fetched.
     * @property int $observationsLimit Maximum number of observation memories to return. If omitted, defaults to 20. If set to 0, no observation memories will be fetched.
     * @property int $summariesLimit Maximum number of summary memories to return. If omitted, defaults to 5. If set to 0, no summary memories will be fetched.
     * @property string $relevanceThreshold Minimum relevance score threshold for observations and summaries to be returned. Only memories with a relevance score greater than or equal to this threshold will be included in the response. This threshold only applies when results are ranked by relevance. When results are returned in most-recent order, this field has no effect.
    */
    public static function createMemoryRetrievalRequest(array $payload = []): MemoryRetrievalRequest
    {
        return new MemoryRetrievalRequest($payload);
    }

    /**
     * @property int $queryTime Query execution time in milliseconds.
    */
    public static function createMemoryRetrievalResponseMeta(array $payload = []): MemoryRetrievalResponseMeta
    {
        return new MemoryRetrievalResponseMeta($payload);
    }

}

class MemoryRetrievalRequest implements \JsonSerializable
{
    /**
     * @property string $conversationId A unique identifier for the conversation using Twilio Type ID (TTID) format.
     * @property string $query Hybrid search query for finding relevant memories. Omit to use query expansion to generate query from previous 10 communications in conversation.
     * @property \DateTime $beginDate Start date for filtering memories (inclusive).
     * @property \DateTime $endDate End date for filtering memories (exclusive).
     * @property int $communicationsLimit Maximum number of conversational session memories to return. If omitted or set to 0, no session memories will be fetched.
     * @property int $observationsLimit Maximum number of observation memories to return. If omitted, defaults to 20. If set to 0, no observation memories will be fetched.
     * @property int $summariesLimit Maximum number of summary memories to return. If omitted, defaults to 5. If set to 0, no summary memories will be fetched.
     * @property string $relevanceThreshold Minimum relevance score threshold for observations and summaries to be returned. Only memories with a relevance score greater than or equal to this threshold will be included in the response. This threshold only applies when results are ranked by relevance. When results are returned in most-recent order, this field has no effect.
    */
        protected $conversationId;
        protected $query;
        protected $beginDate;
        protected $endDate;
        protected $communicationsLimit;
        protected $observationsLimit;
        protected $summariesLimit;
        protected $relevanceThreshold;
    public function __construct(array $payload = []) {
        $this->conversationId = Values::array_get($payload, 'conversationId');
        $this->query = Values::array_get($payload, 'query');
        $this->beginDate = Values::array_get($payload, 'beginDate');
        $this->endDate = Values::array_get($payload, 'endDate');
        $this->communicationsLimit = Values::array_get($payload, 'communicationsLimit');
        $this->observationsLimit = Values::array_get($payload, 'observationsLimit');
        $this->summariesLimit = Values::array_get($payload, 'summariesLimit');
        $this->relevanceThreshold = Values::array_get($payload, 'relevanceThreshold');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->conversationId)) {
            $jsonString['conversationId'] = $this->conversationId;
        }
        if (isset($this->query)) {
            $jsonString['query'] = $this->query;
        }
        if (isset($this->beginDate)) {
            $jsonString['beginDate'] = $this->beginDate;
        }
        if (isset($this->endDate)) {
            $jsonString['endDate'] = $this->endDate;
        }
        if (isset($this->communicationsLimit)) {
            $jsonString['communicationsLimit'] = $this->communicationsLimit;
        }
        if (isset($this->observationsLimit)) {
            $jsonString['observationsLimit'] = $this->observationsLimit;
        }
        if (isset($this->summariesLimit)) {
            $jsonString['summariesLimit'] = $this->summariesLimit;
        }
        if (isset($this->relevanceThreshold)) {
            $jsonString['relevanceThreshold'] = $this->relevanceThreshold;
        }
        return $jsonString;
    }
}

class MemoryRetrievalResponseMeta implements \JsonSerializable
{
    /**
     * @property int $queryTime Query execution time in milliseconds.
    */
        protected $queryTime;
    public function __construct(array $payload = []) {
        $this->queryTime = Values::array_get($payload, 'queryTime');
    }

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

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

