<?php

/**
 * AiPromptTemplateEntity.
 *
 * PHP version 7.4
 *
 * @category Class
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 */

/**
 * Sync Core.
 *
 * The Sync Core that sends and receives content from all connected sites and services for Content Sync.
 *
 * The version of the OpenAPI document: 1.0
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 6.4.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace EdgeBox\SyncCore\V2\Raw\Model;

use EdgeBox\SyncCore\V2\Raw\ObjectSerializer;

/**
 * AiPromptTemplateEntity Class Doc Comment.
 *
 * @category Class
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 *
 * @implements \ArrayAccess<string, mixed>
 */
class AiPromptTemplateEntity implements ModelInterface, \ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

    /**
     * The original name of the model.
     *
     * @var string
     */
    protected static $openAPIModelName = 'AiPromptTemplateEntity';

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $openAPITypes = [
        'accessScope' => 'AccessScope',
        'accessKeyIds' => 'string[]',
        'key' => 'string',
        'servicePrompt' => 'AiServicePrompt',
        'version' => 'float',
        'changeLog' => 'string',
        'status' => 'AiPromptTemplateStatus',
        'previousStatus' => 'AiPromptTemplateStatus',
        'revisionArchivedAt' => 'float',
        'frozen' => 'bool',
        'name' => 'string',
        'useCase' => 'AiModelUseCase',
        'provider' => '\EdgeBox\SyncCore\V2\Raw\Model\RuntimeRemoteEntityDependencyWithDependenciesEntity',
        'model' => '\EdgeBox\SyncCore\V2\Raw\Model\RuntimeRemoteEntityDependencyWithDependenciesEntity',
        'variables' => 'mixed',
        'systemPrompt' => 'SyncCoreAiPromptSystemPrompt',
        'userMessage' => 'string',
        'output' => '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntityOutput',
        'terms' => 'Terms',
        'tokensMax' => 'float',
        'tokensMin' => 'float',
        'costsMin' => 'float',
        'costsMax' => 'float',
        'defaultParameters' => 'mixed',
        'customer' => 'DynamicReference',
        'project' => 'DynamicReference',
        'id' => 'string',
        'createdAt' => 'float',
        'updatedAt' => 'float',
        'deletedAt' => 'float',
    ];

    /**
     * Array of property to format mappings. Used for (de)serialization.
     *
     * @var string[]
     *
     * @phpstan-var array<string, string|null>
     *
     * @psalm-var array<string, string|null>
     */
    protected static $openAPIFormats = [
        'accessScope' => null,
        'accessKeyIds' => null,
        'key' => null,
        'servicePrompt' => null,
        'version' => null,
        'changeLog' => null,
        'status' => null,
        'previousStatus' => null,
        'revisionArchivedAt' => null,
        'frozen' => null,
        'name' => null,
        'useCase' => null,
        'provider' => null,
        'model' => null,
        'variables' => null,
        'systemPrompt' => null,
        'userMessage' => null,
        'output' => null,
        'terms' => null,
        'tokensMax' => null,
        'tokensMin' => null,
        'costsMin' => null,
        'costsMax' => null,
        'defaultParameters' => null,
        'customer' => null,
        'project' => null,
        'id' => null,
        'createdAt' => null,
        'updatedAt' => null,
        'deletedAt' => null,
    ];

    /**
     * Array of nullable properties. Used for (de)serialization.
     *
     * @var bool[]
     */
    protected static array $openAPINullables = [
        'accessScope' => false,
        'accessKeyIds' => false,
        'key' => false,
        'servicePrompt' => true,
        'version' => false,
        'changeLog' => true,
        'status' => false,
        'previousStatus' => true,
        'revisionArchivedAt' => true,
        'frozen' => false,
        'name' => false,
        'useCase' => false,
        'provider' => false,
        'model' => false,
        'variables' => true,
        'systemPrompt' => true,
        'userMessage' => false,
        'output' => false,
        'terms' => true,
        'tokensMax' => false,
        'tokensMin' => true,
        'costsMin' => true,
        'costsMax' => true,
        'defaultParameters' => true,
        'customer' => true,
        'project' => true,
        'id' => false,
        'createdAt' => false,
        'updatedAt' => false,
        'deletedAt' => true,
    ];

    /**
     * If a nullable field gets set to null, insert it here.
     *
     * @var bool[]
     */
    protected array $openAPINullablesSetToNull = [];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name.
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'accessScope' => 'accessScope',
        'accessKeyIds' => 'accessKeyIds',
        'key' => 'key',
        'servicePrompt' => 'servicePrompt',
        'version' => 'version',
        'changeLog' => 'changeLog',
        'status' => 'status',
        'previousStatus' => 'previousStatus',
        'revisionArchivedAt' => 'revisionArchivedAt',
        'frozen' => 'frozen',
        'name' => 'name',
        'useCase' => 'useCase',
        'provider' => 'provider',
        'model' => 'model',
        'variables' => 'variables',
        'systemPrompt' => 'systemPrompt',
        'userMessage' => 'userMessage',
        'output' => 'output',
        'terms' => 'terms',
        'tokensMax' => 'tokensMax',
        'tokensMin' => 'tokensMin',
        'costsMin' => 'costsMin',
        'costsMax' => 'costsMax',
        'defaultParameters' => 'defaultParameters',
        'customer' => 'customer',
        'project' => 'project',
        'id' => 'id',
        'createdAt' => 'createdAt',
        'updatedAt' => 'updatedAt',
        'deletedAt' => 'deletedAt',
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     *
     * @var string[]
     */
    protected static $setters = [
        'accessScope' => 'setAccessScope',
        'accessKeyIds' => 'setAccessKeyIds',
        'key' => 'setKey',
        'servicePrompt' => 'setServicePrompt',
        'version' => 'setVersion',
        'changeLog' => 'setChangeLog',
        'status' => 'setStatus',
        'previousStatus' => 'setPreviousStatus',
        'revisionArchivedAt' => 'setRevisionArchivedAt',
        'frozen' => 'setFrozen',
        'name' => 'setName',
        'useCase' => 'setUseCase',
        'provider' => 'setProvider',
        'model' => 'setModel',
        'variables' => 'setVariables',
        'systemPrompt' => 'setSystemPrompt',
        'userMessage' => 'setUserMessage',
        'output' => 'setOutput',
        'terms' => 'setTerms',
        'tokensMax' => 'setTokensMax',
        'tokensMin' => 'setTokensMin',
        'costsMin' => 'setCostsMin',
        'costsMax' => 'setCostsMax',
        'defaultParameters' => 'setDefaultParameters',
        'customer' => 'setCustomer',
        'project' => 'setProject',
        'id' => 'setId',
        'createdAt' => 'setCreatedAt',
        'updatedAt' => 'setUpdatedAt',
        'deletedAt' => 'setDeletedAt',
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests).
     *
     * @var string[]
     */
    protected static $getters = [
        'accessScope' => 'getAccessScope',
        'accessKeyIds' => 'getAccessKeyIds',
        'key' => 'getKey',
        'servicePrompt' => 'getServicePrompt',
        'version' => 'getVersion',
        'changeLog' => 'getChangeLog',
        'status' => 'getStatus',
        'previousStatus' => 'getPreviousStatus',
        'revisionArchivedAt' => 'getRevisionArchivedAt',
        'frozen' => 'getFrozen',
        'name' => 'getName',
        'useCase' => 'getUseCase',
        'provider' => 'getProvider',
        'model' => 'getModel',
        'variables' => 'getVariables',
        'systemPrompt' => 'getSystemPrompt',
        'userMessage' => 'getUserMessage',
        'output' => 'getOutput',
        'terms' => 'getTerms',
        'tokensMax' => 'getTokensMax',
        'tokensMin' => 'getTokensMin',
        'costsMin' => 'getCostsMin',
        'costsMax' => 'getCostsMax',
        'defaultParameters' => 'getDefaultParameters',
        'customer' => 'getCustomer',
        'project' => 'getProject',
        'id' => 'getId',
        'createdAt' => 'getCreatedAt',
        'updatedAt' => 'getUpdatedAt',
        'deletedAt' => 'getDeletedAt',
    ];

    /**
     * Associative array for storing property values.
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor.
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('accessScope', $data ?? [], null);
        $this->setIfExists('accessKeyIds', $data ?? [], null);
        $this->setIfExists('key', $data ?? [], null);
        $this->setIfExists('servicePrompt', $data ?? [], null);
        $this->setIfExists('version', $data ?? [], null);
        $this->setIfExists('changeLog', $data ?? [], null);
        $this->setIfExists('status', $data ?? [], null);
        $this->setIfExists('previousStatus', $data ?? [], null);
        $this->setIfExists('revisionArchivedAt', $data ?? [], null);
        $this->setIfExists('frozen', $data ?? [], null);
        $this->setIfExists('name', $data ?? [], null);
        $this->setIfExists('useCase', $data ?? [], null);
        $this->setIfExists('provider', $data ?? [], null);
        $this->setIfExists('model', $data ?? [], null);
        $this->setIfExists('variables', $data ?? [], null);
        $this->setIfExists('systemPrompt', $data ?? [], null);
        $this->setIfExists('userMessage', $data ?? [], null);
        $this->setIfExists('output', $data ?? [], null);
        $this->setIfExists('terms', $data ?? [], null);
        $this->setIfExists('tokensMax', $data ?? [], null);
        $this->setIfExists('tokensMin', $data ?? [], null);
        $this->setIfExists('costsMin', $data ?? [], null);
        $this->setIfExists('costsMax', $data ?? [], null);
        $this->setIfExists('defaultParameters', $data ?? [], null);
        $this->setIfExists('customer', $data ?? [], null);
        $this->setIfExists('project', $data ?? [], null);
        $this->setIfExists('id', $data ?? [], null);
        $this->setIfExists('createdAt', $data ?? [], null);
        $this->setIfExists('updatedAt', $data ?? [], null);
        $this->setIfExists('deletedAt', $data ?? [], null);
    }

    /**
     * Gets the string presentation of the object.
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @return array
     */
    public static function openAPITypes()
    {
        return self::$openAPITypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization.
     *
     * @return array
     */
    public static function openAPIFormats()
    {
        return self::$openAPIFormats;
    }

    /**
     * Checks if a property is nullable.
     */
    public static function isNullable(string $property): bool
    {
        return self::openAPINullables()[$property] ?? false;
    }

    /**
     * Checks if a nullable property is set to null.
     */
    public function isNullableSetToNull(string $property): bool
    {
        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name.
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests).
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$openAPIModelName;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        if (null === $this->container['accessScope']) {
            $invalidProperties[] = "'accessScope' can't be null";
        }
        if (null === $this->container['accessKeyIds']) {
            $invalidProperties[] = "'accessKeyIds' can't be null";
        }
        if (null === $this->container['key']) {
            $invalidProperties[] = "'key' can't be null";
        }
        if (null === $this->container['version']) {
            $invalidProperties[] = "'version' can't be null";
        }
        if (null === $this->container['status']) {
            $invalidProperties[] = "'status' can't be null";
        }
        if (null === $this->container['frozen']) {
            $invalidProperties[] = "'frozen' can't be null";
        }
        if (null === $this->container['name']) {
            $invalidProperties[] = "'name' can't be null";
        }
        if (null === $this->container['useCase']) {
            $invalidProperties[] = "'useCase' can't be null";
        }
        if (null === $this->container['provider']) {
            $invalidProperties[] = "'provider' can't be null";
        }
        if (null === $this->container['model']) {
            $invalidProperties[] = "'model' can't be null";
        }
        if (null === $this->container['variables']) {
            $invalidProperties[] = "'variables' can't be null";
        }
        if (null === $this->container['userMessage']) {
            $invalidProperties[] = "'userMessage' can't be null";
        }
        if (null === $this->container['output']) {
            $invalidProperties[] = "'output' can't be null";
        }
        if (null === $this->container['tokensMax']) {
            $invalidProperties[] = "'tokensMax' can't be null";
        }
        if (null === $this->container['defaultParameters']) {
            $invalidProperties[] = "'defaultParameters' can't be null";
        }
        if (null === $this->container['id']) {
            $invalidProperties[] = "'id' can't be null";
        }
        if (null === $this->container['createdAt']) {
            $invalidProperties[] = "'createdAt' can't be null";
        }
        if (null === $this->container['updatedAt']) {
            $invalidProperties[] = "'updatedAt' can't be null";
        }

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed.
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return 0 === count($this->listInvalidProperties());
    }

    /**
     * Gets accessScope.
     *
     * @return AccessScope
     */
    public function getAccessScope()
    {
        return $this->container['accessScope'];
    }

    /**
     * Sets accessScope.
     *
     * @param AccessScope $accessScope accessScope
     *
     * @return self
     */
    public function setAccessScope($accessScope)
    {
        if (is_null($accessScope)) {
            throw new \InvalidArgumentException('non-nullable accessScope cannot be null');
        }
        $this->container['accessScope'] = $accessScope;

        return $this;
    }

    /**
     * Gets accessKeyIds.
     *
     * @return string[]
     */
    public function getAccessKeyIds()
    {
        return $this->container['accessKeyIds'];
    }

    /**
     * Sets accessKeyIds.
     *
     * @param string[] $accessKeyIds accessKeyIds
     *
     * @return self
     */
    public function setAccessKeyIds($accessKeyIds)
    {
        if (is_null($accessKeyIds)) {
            throw new \InvalidArgumentException('non-nullable accessKeyIds cannot be null');
        }
        $this->container['accessKeyIds'] = $accessKeyIds;

        return $this;
    }

    /**
     * Gets key.
     *
     * @return string
     */
    public function getKey()
    {
        return $this->container['key'];
    }

    /**
     * Sets key.
     *
     * @param string $key key
     *
     * @return self
     */
    public function setKey($key)
    {
        if (is_null($key)) {
            throw new \InvalidArgumentException('non-nullable key cannot be null');
        }
        $this->container['key'] = $key;

        return $this;
    }

    /**
     * Gets servicePrompt.
     *
     * @return null|AiServicePrompt
     */
    public function getServicePrompt()
    {
        return $this->container['servicePrompt'];
    }

    /**
     * Sets servicePrompt.
     *
     * @param null|AiServicePrompt $servicePrompt servicePrompt
     *
     * @return self
     */
    public function setServicePrompt($servicePrompt)
    {
        if (is_null($servicePrompt)) {
            array_push($this->openAPINullablesSetToNull, 'servicePrompt');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('servicePrompt', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['servicePrompt'] = $servicePrompt;

        return $this;
    }

    /**
     * Gets version.
     *
     * @return float
     */
    public function getVersion()
    {
        return $this->container['version'];
    }

    /**
     * Sets version.
     *
     * @param float $version version
     *
     * @return self
     */
    public function setVersion($version)
    {
        if (is_null($version)) {
            throw new \InvalidArgumentException('non-nullable version cannot be null');
        }
        $this->container['version'] = $version;

        return $this;
    }

    /**
     * Gets changeLog.
     *
     * @return null|string
     */
    public function getChangeLog()
    {
        return $this->container['changeLog'];
    }

    /**
     * Sets changeLog.
     *
     * @param null|string $changeLog changeLog
     *
     * @return self
     */
    public function setChangeLog($changeLog)
    {
        if (is_null($changeLog)) {
            array_push($this->openAPINullablesSetToNull, 'changeLog');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('changeLog', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['changeLog'] = $changeLog;

        return $this;
    }

    /**
     * Gets status.
     *
     * @return AiPromptTemplateStatus
     */
    public function getStatus()
    {
        return $this->container['status'];
    }

    /**
     * Sets status.
     *
     * @param AiPromptTemplateStatus $status status
     *
     * @return self
     */
    public function setStatus($status)
    {
        if (is_null($status)) {
            throw new \InvalidArgumentException('non-nullable status cannot be null');
        }
        $this->container['status'] = $status;

        return $this;
    }

    /**
     * Gets previousStatus.
     *
     * @return null|AiPromptTemplateStatus
     */
    public function getPreviousStatus()
    {
        return $this->container['previousStatus'];
    }

    /**
     * Sets previousStatus.
     *
     * @param null|AiPromptTemplateStatus $previousStatus previousStatus
     *
     * @return self
     */
    public function setPreviousStatus($previousStatus)
    {
        if (is_null($previousStatus)) {
            array_push($this->openAPINullablesSetToNull, 'previousStatus');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('previousStatus', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['previousStatus'] = $previousStatus;

        return $this;
    }

    /**
     * Gets revisionArchivedAt.
     *
     * @return null|float
     */
    public function getRevisionArchivedAt()
    {
        return $this->container['revisionArchivedAt'];
    }

    /**
     * Sets revisionArchivedAt.
     *
     * @param null|float $revisionArchivedAt revisionArchivedAt
     *
     * @return self
     */
    public function setRevisionArchivedAt($revisionArchivedAt)
    {
        if (is_null($revisionArchivedAt)) {
            array_push($this->openAPINullablesSetToNull, 'revisionArchivedAt');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('revisionArchivedAt', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['revisionArchivedAt'] = $revisionArchivedAt;

        return $this;
    }

    /**
     * Gets frozen.
     *
     * @return bool
     */
    public function getFrozen()
    {
        return $this->container['frozen'];
    }

    /**
     * Sets frozen.
     *
     * @param bool $frozen frozen
     *
     * @return self
     */
    public function setFrozen($frozen)
    {
        if (is_null($frozen)) {
            throw new \InvalidArgumentException('non-nullable frozen cannot be null');
        }
        $this->container['frozen'] = $frozen;

        return $this;
    }

    /**
     * Gets name.
     *
     * @return string
     */
    public function getName()
    {
        return $this->container['name'];
    }

    /**
     * Sets name.
     *
     * @param string $name name
     *
     * @return self
     */
    public function setName($name)
    {
        if (is_null($name)) {
            throw new \InvalidArgumentException('non-nullable name cannot be null');
        }
        $this->container['name'] = $name;

        return $this;
    }

    /**
     * Gets useCase.
     *
     * @return AiModelUseCase
     */
    public function getUseCase()
    {
        return $this->container['useCase'];
    }

    /**
     * Sets useCase.
     *
     * @param AiModelUseCase $useCase useCase
     *
     * @return self
     */
    public function setUseCase($useCase)
    {
        if (is_null($useCase)) {
            throw new \InvalidArgumentException('non-nullable useCase cannot be null');
        }
        $this->container['useCase'] = $useCase;

        return $this;
    }

    /**
     * Gets provider.
     *
     * @return RuntimeRemoteEntityDependencyWithDependenciesEntity
     */
    public function getProvider()
    {
        return $this->container['provider'];
    }

    /**
     * Sets provider.
     *
     * @param RuntimeRemoteEntityDependencyWithDependenciesEntity $provider provider
     *
     * @return self
     */
    public function setProvider($provider)
    {
        if (is_null($provider)) {
            throw new \InvalidArgumentException('non-nullable provider cannot be null');
        }
        $this->container['provider'] = $provider;

        return $this;
    }

    /**
     * Gets model.
     *
     * @return RuntimeRemoteEntityDependencyWithDependenciesEntity
     */
    public function getModel()
    {
        return $this->container['model'];
    }

    /**
     * Sets model.
     *
     * @param RuntimeRemoteEntityDependencyWithDependenciesEntity $model model
     *
     * @return self
     */
    public function setModel($model)
    {
        if (is_null($model)) {
            throw new \InvalidArgumentException('non-nullable model cannot be null');
        }
        $this->container['model'] = $model;

        return $this;
    }

    /**
     * Gets variables.
     *
     * @return mixed
     */
    public function getVariables()
    {
        return $this->container['variables'];
    }

    /**
     * Sets variables.
     *
     * @param mixed $variables variables
     *
     * @return self
     */
    public function setVariables($variables)
    {
        if (is_null($variables)) {
            array_push($this->openAPINullablesSetToNull, 'variables');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('variables', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['variables'] = $variables;

        return $this;
    }

    /**
     * Gets systemPrompt.
     *
     * @return null|SyncCoreAiPromptSystemPrompt
     */
    public function getSystemPrompt()
    {
        return $this->container['systemPrompt'];
    }

    /**
     * Sets systemPrompt.
     *
     * @param null|SyncCoreAiPromptSystemPrompt $systemPrompt systemPrompt
     *
     * @return self
     */
    public function setSystemPrompt($systemPrompt)
    {
        if (is_null($systemPrompt)) {
            array_push($this->openAPINullablesSetToNull, 'systemPrompt');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('systemPrompt', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['systemPrompt'] = $systemPrompt;

        return $this;
    }

    /**
     * Gets userMessage.
     *
     * @return string
     */
    public function getUserMessage()
    {
        return $this->container['userMessage'];
    }

    /**
     * Sets userMessage.
     *
     * @param string $userMessage userMessage
     *
     * @return self
     */
    public function setUserMessage($userMessage)
    {
        if (is_null($userMessage)) {
            throw new \InvalidArgumentException('non-nullable userMessage cannot be null');
        }
        $this->container['userMessage'] = $userMessage;

        return $this;
    }

    /**
     * Gets output.
     *
     * @return AiPromptTemplateEntityOutput
     */
    public function getOutput()
    {
        return $this->container['output'];
    }

    /**
     * Sets output.
     *
     * @param AiPromptTemplateEntityOutput $output output
     *
     * @return self
     */
    public function setOutput($output)
    {
        if (is_null($output)) {
            throw new \InvalidArgumentException('non-nullable output cannot be null');
        }
        $this->container['output'] = $output;

        return $this;
    }

    /**
     * Gets terms.
     *
     * @return null|Terms
     */
    public function getTerms()
    {
        return $this->container['terms'];
    }

    /**
     * Sets terms.
     *
     * @param null|Terms $terms terms
     *
     * @return self
     */
    public function setTerms($terms)
    {
        if (is_null($terms)) {
            array_push($this->openAPINullablesSetToNull, 'terms');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('terms', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['terms'] = $terms;

        return $this;
    }

    /**
     * Gets tokensMax.
     *
     * @return float
     */
    public function getTokensMax()
    {
        return $this->container['tokensMax'];
    }

    /**
     * Sets tokensMax.
     *
     * @param float $tokensMax tokensMax
     *
     * @return self
     */
    public function setTokensMax($tokensMax)
    {
        if (is_null($tokensMax)) {
            throw new \InvalidArgumentException('non-nullable tokensMax cannot be null');
        }
        $this->container['tokensMax'] = $tokensMax;

        return $this;
    }

    /**
     * Gets tokensMin.
     *
     * @return null|float
     */
    public function getTokensMin()
    {
        return $this->container['tokensMin'];
    }

    /**
     * Sets tokensMin.
     *
     * @param null|float $tokensMin tokensMin
     *
     * @return self
     */
    public function setTokensMin($tokensMin)
    {
        if (is_null($tokensMin)) {
            array_push($this->openAPINullablesSetToNull, 'tokensMin');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('tokensMin', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['tokensMin'] = $tokensMin;

        return $this;
    }

    /**
     * Gets costsMin.
     *
     * @return null|float
     */
    public function getCostsMin()
    {
        return $this->container['costsMin'];
    }

    /**
     * Sets costsMin.
     *
     * @param null|float $costsMin costsMin
     *
     * @return self
     */
    public function setCostsMin($costsMin)
    {
        if (is_null($costsMin)) {
            array_push($this->openAPINullablesSetToNull, 'costsMin');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('costsMin', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['costsMin'] = $costsMin;

        return $this;
    }

    /**
     * Gets costsMax.
     *
     * @return null|float
     */
    public function getCostsMax()
    {
        return $this->container['costsMax'];
    }

    /**
     * Sets costsMax.
     *
     * @param null|float $costsMax costsMax
     *
     * @return self
     */
    public function setCostsMax($costsMax)
    {
        if (is_null($costsMax)) {
            array_push($this->openAPINullablesSetToNull, 'costsMax');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('costsMax', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['costsMax'] = $costsMax;

        return $this;
    }

    /**
     * Gets defaultParameters.
     *
     * @return mixed
     */
    public function getDefaultParameters()
    {
        return $this->container['defaultParameters'];
    }

    /**
     * Sets defaultParameters.
     *
     * @param mixed $defaultParameters defaultParameters
     *
     * @return self
     */
    public function setDefaultParameters($defaultParameters)
    {
        if (is_null($defaultParameters)) {
            array_push($this->openAPINullablesSetToNull, 'defaultParameters');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('defaultParameters', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['defaultParameters'] = $defaultParameters;

        return $this;
    }

    /**
     * Gets customer.
     *
     * @return null|DynamicReference
     */
    public function getCustomer()
    {
        return $this->container['customer'];
    }

    /**
     * Sets customer.
     *
     * @param null|DynamicReference $customer customer
     *
     * @return self
     */
    public function setCustomer($customer)
    {
        if (is_null($customer)) {
            array_push($this->openAPINullablesSetToNull, 'customer');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('customer', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['customer'] = $customer;

        return $this;
    }

    /**
     * Gets project.
     *
     * @return null|DynamicReference
     */
    public function getProject()
    {
        return $this->container['project'];
    }

    /**
     * Sets project.
     *
     * @param null|DynamicReference $project project
     *
     * @return self
     */
    public function setProject($project)
    {
        if (is_null($project)) {
            array_push($this->openAPINullablesSetToNull, 'project');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('project', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['project'] = $project;

        return $this;
    }

    /**
     * Gets id.
     *
     * @return string
     */
    public function getId()
    {
        return $this->container['id'];
    }

    /**
     * Sets id.
     *
     * @param string $id id
     *
     * @return self
     */
    public function setId($id)
    {
        if (is_null($id)) {
            throw new \InvalidArgumentException('non-nullable id cannot be null');
        }
        $this->container['id'] = $id;

        return $this;
    }

    /**
     * Gets createdAt.
     *
     * @return float
     */
    public function getCreatedAt()
    {
        return $this->container['createdAt'];
    }

    /**
     * Sets createdAt.
     *
     * @param float $createdAt createdAt
     *
     * @return self
     */
    public function setCreatedAt($createdAt)
    {
        if (is_null($createdAt)) {
            throw new \InvalidArgumentException('non-nullable createdAt cannot be null');
        }
        $this->container['createdAt'] = $createdAt;

        return $this;
    }

    /**
     * Gets updatedAt.
     *
     * @return float
     */
    public function getUpdatedAt()
    {
        return $this->container['updatedAt'];
    }

    /**
     * Sets updatedAt.
     *
     * @param float $updatedAt updatedAt
     *
     * @return self
     */
    public function setUpdatedAt($updatedAt)
    {
        if (is_null($updatedAt)) {
            throw new \InvalidArgumentException('non-nullable updatedAt cannot be null');
        }
        $this->container['updatedAt'] = $updatedAt;

        return $this;
    }

    /**
     * Gets deletedAt.
     *
     * @return null|float
     */
    public function getDeletedAt()
    {
        return $this->container['deletedAt'];
    }

    /**
     * Sets deletedAt.
     *
     * @param null|float $deletedAt deletedAt
     *
     * @return self
     */
    public function setDeletedAt($deletedAt)
    {
        if (is_null($deletedAt)) {
            array_push($this->openAPINullablesSetToNull, 'deletedAt');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('deletedAt', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['deletedAt'] = $deletedAt;

        return $this;
    }

    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param int $offset Offset
     */
    public function offsetExists($offset): bool
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param int $offset Offset
     *
     * @return null|mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return $this->container[$offset] ?? null;
    }

    /**
     * Sets value based on offset.
     *
     * @param null|int $offset Offset
     * @param mixed    $value  Value to be set
     */
    public function offsetSet($offset, $value): void
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param int $offset Offset
     */
    public function offsetUnset($offset): void
    {
        unset($this->container[$offset]);
    }

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     *
     * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed returns data which can be serialized by json_encode(), which is a value
     * of any type other than a resource
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
        return ObjectSerializer::sanitizeForSerialization($this);
    }

    /**
     * Gets a header-safe presentation of the object.
     *
     * @return string
     */
    public function toHeaderValue()
    {
        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }

    /**
     * Array of nullable properties.
     */
    protected static function openAPINullables(): array
    {
        return self::$openAPINullables;
    }

    /**
     * Array of nullable field names deliberately set to null.
     *
     * @return bool[]
     */
    private function getOpenAPINullablesSetToNull(): array
    {
        return $this->openAPINullablesSetToNull;
    }

    /**
     * Setter - Array of nullable field names deliberately set to null.
     *
     * @param bool[] $openAPINullablesSetToNull
     */
    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
    {
        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
    }

    /**
     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
     * $this->openAPINullablesSetToNull array.
     *
     * @param mixed  $defaultValue
     */
    private function setIfExists(string $variableName, array $fields, $defaultValue): void
    {
        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
            $this->openAPINullablesSetToNull[] = $variableName;
        }

        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
    }
}
