<?php

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

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

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

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $openAPITypes = [
        'status' => 'MonitoringPromptRunStatus',
        'prompt' => '\EdgeBox\SyncCore\V2\Raw\Model\TermAssignmentTerm',
        'promptTemplate' => 'DynamicRevisionReference',
        'engine' => '\EdgeBox\SyncCore\V2\Raw\Model\TermAssignmentTerm',
        'engineModel' => 'string',
        'country' => 'MonitoringPromptCountry',
        'location' => 'string',
        'locale' => '\EdgeBox\SyncCore\V2\Raw\Model\TermAssignmentTerm',
        'rawResponseFile' => 'DynamicReference',
        'parsedFile' => 'DynamicReference',
        'entities' => '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptRunEntityItem[]',
        'contentItems' => '\EdgeBox\SyncCore\V2\Raw\Model\DynamicRevisionReference[]',
        'terms' => '\EdgeBox\SyncCore\V2\Raw\Model\TermAssignment[]',
        'computedAt' => 'float',
        'scheduledFor' => 'float',
        'customer' => '\EdgeBox\SyncCore\V2\Raw\Model\RuntimeRemoteEntityDependencyWithDependenciesEntity',
        'project' => '\EdgeBox\SyncCore\V2\Raw\Model\RuntimeRemoteEntityDependencyWithDependenciesEntity',
        '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 = [
        'status' => null,
        'prompt' => null,
        'promptTemplate' => null,
        'engine' => null,
        'engineModel' => null,
        'country' => null,
        'location' => null,
        'locale' => null,
        'rawResponseFile' => null,
        'parsedFile' => null,
        'entities' => null,
        'contentItems' => null,
        'terms' => null,
        'computedAt' => null,
        'scheduledFor' => 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 = [
        'status' => false,
        'prompt' => false,
        'promptTemplate' => true,
        'engine' => false,
        'engineModel' => true,
        'country' => false,
        'location' => true,
        'locale' => false,
        'rawResponseFile' => true,
        'parsedFile' => true,
        'entities' => true,
        'contentItems' => true,
        'terms' => true,
        'computedAt' => true,
        'scheduledFor' => false,
        'customer' => false,
        'project' => false,
        '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 = [
        'status' => 'status',
        'prompt' => 'prompt',
        'promptTemplate' => 'promptTemplate',
        'engine' => 'engine',
        'engineModel' => 'engineModel',
        'country' => 'country',
        'location' => 'location',
        'locale' => 'locale',
        'rawResponseFile' => 'rawResponseFile',
        'parsedFile' => 'parsedFile',
        'entities' => 'entities',
        'contentItems' => 'contentItems',
        'terms' => 'terms',
        'computedAt' => 'computedAt',
        'scheduledFor' => 'scheduledFor',
        '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 = [
        'status' => 'setStatus',
        'prompt' => 'setPrompt',
        'promptTemplate' => 'setPromptTemplate',
        'engine' => 'setEngine',
        'engineModel' => 'setEngineModel',
        'country' => 'setCountry',
        'location' => 'setLocation',
        'locale' => 'setLocale',
        'rawResponseFile' => 'setRawResponseFile',
        'parsedFile' => 'setParsedFile',
        'entities' => 'setEntities',
        'contentItems' => 'setContentItems',
        'terms' => 'setTerms',
        'computedAt' => 'setComputedAt',
        'scheduledFor' => 'setScheduledFor',
        '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 = [
        'status' => 'getStatus',
        'prompt' => 'getPrompt',
        'promptTemplate' => 'getPromptTemplate',
        'engine' => 'getEngine',
        'engineModel' => 'getEngineModel',
        'country' => 'getCountry',
        'location' => 'getLocation',
        'locale' => 'getLocale',
        'rawResponseFile' => 'getRawResponseFile',
        'parsedFile' => 'getParsedFile',
        'entities' => 'getEntities',
        'contentItems' => 'getContentItems',
        'terms' => 'getTerms',
        'computedAt' => 'getComputedAt',
        'scheduledFor' => 'getScheduledFor',
        '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('status', $data ?? [], null);
        $this->setIfExists('prompt', $data ?? [], null);
        $this->setIfExists('promptTemplate', $data ?? [], null);
        $this->setIfExists('engine', $data ?? [], null);
        $this->setIfExists('engineModel', $data ?? [], null);
        $this->setIfExists('country', $data ?? [], null);
        $this->setIfExists('location', $data ?? [], null);
        $this->setIfExists('locale', $data ?? [], null);
        $this->setIfExists('rawResponseFile', $data ?? [], null);
        $this->setIfExists('parsedFile', $data ?? [], null);
        $this->setIfExists('entities', $data ?? [], null);
        $this->setIfExists('contentItems', $data ?? [], null);
        $this->setIfExists('terms', $data ?? [], null);
        $this->setIfExists('computedAt', $data ?? [], null);
        $this->setIfExists('scheduledFor', $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['status']) {
            $invalidProperties[] = "'status' can't be null";
        }
        if (null === $this->container['prompt']) {
            $invalidProperties[] = "'prompt' can't be null";
        }
        if (null === $this->container['engine']) {
            $invalidProperties[] = "'engine' can't be null";
        }
        if (null === $this->container['country']) {
            $invalidProperties[] = "'country' can't be null";
        }
        if (null === $this->container['locale']) {
            $invalidProperties[] = "'locale' can't be null";
        }
        if (null === $this->container['scheduledFor']) {
            $invalidProperties[] = "'scheduledFor' can't be null";
        }
        if (null === $this->container['customer']) {
            $invalidProperties[] = "'customer' can't be null";
        }
        if (null === $this->container['project']) {
            $invalidProperties[] = "'project' 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 status.
     *
     * @return MonitoringPromptRunStatus
     */
    public function getStatus()
    {
        return $this->container['status'];
    }

    /**
     * Sets status.
     *
     * @param MonitoringPromptRunStatus $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 prompt.
     *
     * @return TermAssignmentTerm
     */
    public function getPrompt()
    {
        return $this->container['prompt'];
    }

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

        return $this;
    }

    /**
     * Gets promptTemplate.
     *
     * @return null|DynamicRevisionReference
     */
    public function getPromptTemplate()
    {
        return $this->container['promptTemplate'];
    }

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

        return $this;
    }

    /**
     * Gets engine.
     *
     * @return TermAssignmentTerm
     */
    public function getEngine()
    {
        return $this->container['engine'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets country.
     *
     * @return MonitoringPromptCountry
     */
    public function getCountry()
    {
        return $this->container['country'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets locale.
     *
     * @return TermAssignmentTerm
     */
    public function getLocale()
    {
        return $this->container['locale'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets entities.
     *
     * @return null|MonitoringPromptRunEntityItem[]
     */
    public function getEntities()
    {
        return $this->container['entities'];
    }

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

        return $this;
    }

    /**
     * Gets contentItems.
     *
     * @return null|DynamicRevisionReference[]
     */
    public function getContentItems()
    {
        return $this->container['contentItems'];
    }

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

        return $this;
    }

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

    /**
     * Sets terms.
     *
     * @param null|TermAssignment[] $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 computedAt.
     *
     * @return null|float
     */
    public function getComputedAt()
    {
        return $this->container['computedAt'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets project.
     *
     * @param RuntimeRemoteEntityDependencyWithDependenciesEntity $project project
     *
     * @return self
     */
    public function setProject($project)
    {
        if (is_null($project)) {
            throw new \InvalidArgumentException('non-nullable project cannot be null');
        }
        $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;
    }
}
