<?php

/**
 * AiPromptExecutionEntity.
 *
 * 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;

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

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

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $openAPITypes = [
        'accessKeyIds' => 'string[]',
        'useCase' => 'AiModelUseCase',
        'provider' => '\EdgeBox\SyncCore\V2\Raw\Model\RuntimeRemoteEntityDependencyWithDependenciesEntity',
        'model' => '\EdgeBox\SyncCore\V2\Raw\Model\RuntimeRemoteEntityDependencyWithDependenciesEntity',
        'promptTemplate' => '\EdgeBox\SyncCore\V2\Raw\Model\TermAssignmentTerm',
        'retentionUntil' => 'float',
        'storagePolicy' => '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptExecutionEntityStoragePolicy',
        'previousAttempt' => 'DynamicReference',
        'isFinalAttempt' => 'bool',
        'isBatched' => 'bool',
        'status' => 'AiPromptExecutionStatus',
        'startedAt' => 'float',
        'completedAt' => 'float',
        'durationMs' => 'float',
        'retryCount' => 'float',
        'inputLogFile' => 'DynamicReference',
        'outputLogFile' => 'DynamicReference',
        'outputFixExecution' => 'DynamicReference',
        'usage' => '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptExecutionEntityUsage',
        'terms' => 'Terms',
        'meta' => '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 = [
        'accessKeyIds' => null,
        'useCase' => null,
        'provider' => null,
        'model' => null,
        'promptTemplate' => null,
        'retentionUntil' => null,
        'storagePolicy' => null,
        'previousAttempt' => null,
        'isFinalAttempt' => null,
        'isBatched' => null,
        'status' => null,
        'startedAt' => null,
        'completedAt' => null,
        'durationMs' => null,
        'retryCount' => null,
        'inputLogFile' => null,
        'outputLogFile' => null,
        'outputFixExecution' => null,
        'usage' => null,
        'terms' => null,
        'meta' => 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 = [
        'accessKeyIds' => false,
        'useCase' => false,
        'provider' => false,
        'model' => false,
        'promptTemplate' => false,
        'retentionUntil' => true,
        'storagePolicy' => false,
        'previousAttempt' => true,
        'isFinalAttempt' => false,
        'isBatched' => false,
        'status' => false,
        'startedAt' => true,
        'completedAt' => true,
        'durationMs' => true,
        'retryCount' => false,
        'inputLogFile' => true,
        'outputLogFile' => true,
        'outputFixExecution' => true,
        'usage' => false,
        'terms' => true,
        'meta' => 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 = [
        'accessKeyIds' => 'accessKeyIds',
        'useCase' => 'useCase',
        'provider' => 'provider',
        'model' => 'model',
        'promptTemplate' => 'promptTemplate',
        'retentionUntil' => 'retentionUntil',
        'storagePolicy' => 'storagePolicy',
        'previousAttempt' => 'previousAttempt',
        'isFinalAttempt' => 'isFinalAttempt',
        'isBatched' => 'isBatched',
        'status' => 'status',
        'startedAt' => 'startedAt',
        'completedAt' => 'completedAt',
        'durationMs' => 'durationMs',
        'retryCount' => 'retryCount',
        'inputLogFile' => 'inputLogFile',
        'outputLogFile' => 'outputLogFile',
        'outputFixExecution' => 'outputFixExecution',
        'usage' => 'usage',
        'terms' => 'terms',
        'meta' => 'meta',
        '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 = [
        'accessKeyIds' => 'setAccessKeyIds',
        'useCase' => 'setUseCase',
        'provider' => 'setProvider',
        'model' => 'setModel',
        'promptTemplate' => 'setPromptTemplate',
        'retentionUntil' => 'setRetentionUntil',
        'storagePolicy' => 'setStoragePolicy',
        'previousAttempt' => 'setPreviousAttempt',
        'isFinalAttempt' => 'setIsFinalAttempt',
        'isBatched' => 'setIsBatched',
        'status' => 'setStatus',
        'startedAt' => 'setStartedAt',
        'completedAt' => 'setCompletedAt',
        'durationMs' => 'setDurationMs',
        'retryCount' => 'setRetryCount',
        'inputLogFile' => 'setInputLogFile',
        'outputLogFile' => 'setOutputLogFile',
        'outputFixExecution' => 'setOutputFixExecution',
        'usage' => 'setUsage',
        'terms' => 'setTerms',
        'meta' => 'setMeta',
        '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 = [
        'accessKeyIds' => 'getAccessKeyIds',
        'useCase' => 'getUseCase',
        'provider' => 'getProvider',
        'model' => 'getModel',
        'promptTemplate' => 'getPromptTemplate',
        'retentionUntil' => 'getRetentionUntil',
        'storagePolicy' => 'getStoragePolicy',
        'previousAttempt' => 'getPreviousAttempt',
        'isFinalAttempt' => 'getIsFinalAttempt',
        'isBatched' => 'getIsBatched',
        'status' => 'getStatus',
        'startedAt' => 'getStartedAt',
        'completedAt' => 'getCompletedAt',
        'durationMs' => 'getDurationMs',
        'retryCount' => 'getRetryCount',
        'inputLogFile' => 'getInputLogFile',
        'outputLogFile' => 'getOutputLogFile',
        'outputFixExecution' => 'getOutputFixExecution',
        'usage' => 'getUsage',
        'terms' => 'getTerms',
        'meta' => 'getMeta',
        '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('accessKeyIds', $data ?? [], null);
        $this->setIfExists('useCase', $data ?? [], null);
        $this->setIfExists('provider', $data ?? [], null);
        $this->setIfExists('model', $data ?? [], null);
        $this->setIfExists('promptTemplate', $data ?? [], null);
        $this->setIfExists('retentionUntil', $data ?? [], null);
        $this->setIfExists('storagePolicy', $data ?? [], null);
        $this->setIfExists('previousAttempt', $data ?? [], null);
        $this->setIfExists('isFinalAttempt', $data ?? [], null);
        $this->setIfExists('isBatched', $data ?? [], null);
        $this->setIfExists('status', $data ?? [], null);
        $this->setIfExists('startedAt', $data ?? [], null);
        $this->setIfExists('completedAt', $data ?? [], null);
        $this->setIfExists('durationMs', $data ?? [], null);
        $this->setIfExists('retryCount', $data ?? [], null);
        $this->setIfExists('inputLogFile', $data ?? [], null);
        $this->setIfExists('outputLogFile', $data ?? [], null);
        $this->setIfExists('outputFixExecution', $data ?? [], null);
        $this->setIfExists('usage', $data ?? [], null);
        $this->setIfExists('terms', $data ?? [], null);
        $this->setIfExists('meta', $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['accessKeyIds']) {
            $invalidProperties[] = "'accessKeyIds' 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['promptTemplate']) {
            $invalidProperties[] = "'promptTemplate' can't be null";
        }
        if (null === $this->container['storagePolicy']) {
            $invalidProperties[] = "'storagePolicy' can't be null";
        }
        if (null === $this->container['isFinalAttempt']) {
            $invalidProperties[] = "'isFinalAttempt' can't be null";
        }
        if (null === $this->container['isBatched']) {
            $invalidProperties[] = "'isBatched' can't be null";
        }
        if (null === $this->container['status']) {
            $invalidProperties[] = "'status' can't be null";
        }
        if (null === $this->container['retryCount']) {
            $invalidProperties[] = "'retryCount' can't be null";
        }
        if (null === $this->container['usage']) {
            $invalidProperties[] = "'usage' 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 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 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 promptTemplate.
     *
     * @return TermAssignmentTerm
     */
    public function getPromptTemplate()
    {
        return $this->container['promptTemplate'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets storagePolicy.
     *
     * @return AiPromptExecutionEntityStoragePolicy
     */
    public function getStoragePolicy()
    {
        return $this->container['storagePolicy'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets status.
     *
     * @param AiPromptExecutionStatus $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 startedAt.
     *
     * @return null|float
     */
    public function getStartedAt()
    {
        return $this->container['startedAt'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets usage.
     *
     * @return AiPromptExecutionEntityUsage
     */
    public function getUsage()
    {
        return $this->container['usage'];
    }

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

        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 meta.
     *
     * @return null|mixed
     */
    public function getMeta()
    {
        return $this->container['meta'];
    }

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

        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;
    }
}
