<?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 ObservationModels
{
    /**
     * @property string $content The main content of the observation.
     * @property \DateTime $occurredAt The timestamp when the observation originally occurred.
     * @property string $source The source system that generated this observation. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters.
     * @property string[] $conversationIds Array of conversation IDs associated with this observation.
    */
    public static function createObservationCore(array $payload = []): ObservationCore
    {
        return new ObservationCore($payload);
    }

    /**
     * @property ObservationCore[] $observations Array of observations to create in a single batch operation.
    */
    public static function createCreateObservationsRequest(array $payload = []): CreateObservationsRequest
    {
        return new CreateObservationsRequest($payload);
    }

}

class ObservationCore implements \JsonSerializable
{
    /**
     * @property string $content The main content of the observation.
     * @property \DateTime $occurredAt The timestamp when the observation originally occurred.
     * @property string $source The source system that generated this observation. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters.
     * @property string[] $conversationIds Array of conversation IDs associated with this observation.
    */
        protected $content;
        protected $occurredAt;
        protected $source;
        protected $conversationIds;
    public function __construct(array $payload = []) {
        $this->content = Values::array_get($payload, 'content');
        $this->occurredAt = Values::array_get($payload, 'occurredAt');
        $this->source = Values::array_get($payload, 'source');
        $this->conversationIds = Values::array_get($payload, 'conversationIds');
    }

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

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

class CreateObservationsRequest implements \JsonSerializable
{
    /**
     * @property ObservationCore[] $observations Array of observations to create in a single batch operation.
    */
        protected $observations;
    public function __construct(array $payload = []) {
        $this->observations = Values::array_get($payload, 'observations');
    }

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

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

