<?php

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

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

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

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $openAPITypes = [
        'accessScope' => 'AccessScope',
        'accessKeyIds' => 'string[]',
        'allowedOrigins' => '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermOrigin[]',
        'status' => 'TaxonomyStatus',
        'isTimeBased' => 'bool',
        'facet' => 'TaxonomyFacet',
        'key' => 'string',
        'name' => 'string',
        'category' => 'TaxonomyCategory',
        'allowedTargets' => '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermTargetType[]',
        'kind' => 'TaxonomyKind',
        'allowAddingTerms' => 'bool',
        'classificationPrompt' => 'string',
        'extractionPrompt' => 'string',
        'mergingPrompt' => 'string',
        'autoClassifyContent' => '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntityAutoClassifyContent',
        'maxTermsPerContentItem' => 'float',
        'allowedCollectionTaxonomies' => '\EdgeBox\SyncCore\V2\Raw\Model\DynamicReference[]',
        '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,
        'allowedOrigins' => null,
        'status' => null,
        'isTimeBased' => null,
        'facet' => null,
        'key' => null,
        'name' => null,
        'category' => null,
        'allowedTargets' => null,
        'kind' => null,
        'allowAddingTerms' => null,
        'classificationPrompt' => null,
        'extractionPrompt' => null,
        'mergingPrompt' => null,
        'autoClassifyContent' => null,
        'maxTermsPerContentItem' => null,
        'allowedCollectionTaxonomies' => 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,
        'allowedOrigins' => false,
        'status' => false,
        'isTimeBased' => false,
        'facet' => false,
        'key' => false,
        'name' => false,
        'category' => false,
        'allowedTargets' => false,
        'kind' => false,
        'allowAddingTerms' => false,
        'classificationPrompt' => true,
        'extractionPrompt' => true,
        'mergingPrompt' => true,
        'autoClassifyContent' => false,
        'maxTermsPerContentItem' => true,
        'allowedCollectionTaxonomies' => 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',
        'allowedOrigins' => 'allowedOrigins',
        'status' => 'status',
        'isTimeBased' => 'isTimeBased',
        'facet' => 'facet',
        'key' => 'key',
        'name' => 'name',
        'category' => 'category',
        'allowedTargets' => 'allowedTargets',
        'kind' => 'kind',
        'allowAddingTerms' => 'allowAddingTerms',
        'classificationPrompt' => 'classificationPrompt',
        'extractionPrompt' => 'extractionPrompt',
        'mergingPrompt' => 'mergingPrompt',
        'autoClassifyContent' => 'autoClassifyContent',
        'maxTermsPerContentItem' => 'maxTermsPerContentItem',
        'allowedCollectionTaxonomies' => 'allowedCollectionTaxonomies',
        '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',
        'allowedOrigins' => 'setAllowedOrigins',
        'status' => 'setStatus',
        'isTimeBased' => 'setIsTimeBased',
        'facet' => 'setFacet',
        'key' => 'setKey',
        'name' => 'setName',
        'category' => 'setCategory',
        'allowedTargets' => 'setAllowedTargets',
        'kind' => 'setKind',
        'allowAddingTerms' => 'setAllowAddingTerms',
        'classificationPrompt' => 'setClassificationPrompt',
        'extractionPrompt' => 'setExtractionPrompt',
        'mergingPrompt' => 'setMergingPrompt',
        'autoClassifyContent' => 'setAutoClassifyContent',
        'maxTermsPerContentItem' => 'setMaxTermsPerContentItem',
        'allowedCollectionTaxonomies' => 'setAllowedCollectionTaxonomies',
        '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',
        'allowedOrigins' => 'getAllowedOrigins',
        'status' => 'getStatus',
        'isTimeBased' => 'getIsTimeBased',
        'facet' => 'getFacet',
        'key' => 'getKey',
        'name' => 'getName',
        'category' => 'getCategory',
        'allowedTargets' => 'getAllowedTargets',
        'kind' => 'getKind',
        'allowAddingTerms' => 'getAllowAddingTerms',
        'classificationPrompt' => 'getClassificationPrompt',
        'extractionPrompt' => 'getExtractionPrompt',
        'mergingPrompt' => 'getMergingPrompt',
        'autoClassifyContent' => 'getAutoClassifyContent',
        'maxTermsPerContentItem' => 'getMaxTermsPerContentItem',
        'allowedCollectionTaxonomies' => 'getAllowedCollectionTaxonomies',
        '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('allowedOrigins', $data ?? [], null);
        $this->setIfExists('status', $data ?? [], null);
        $this->setIfExists('isTimeBased', $data ?? [], null);
        $this->setIfExists('facet', $data ?? [], null);
        $this->setIfExists('key', $data ?? [], null);
        $this->setIfExists('name', $data ?? [], null);
        $this->setIfExists('category', $data ?? [], null);
        $this->setIfExists('allowedTargets', $data ?? [], null);
        $this->setIfExists('kind', $data ?? [], null);
        $this->setIfExists('allowAddingTerms', $data ?? [], null);
        $this->setIfExists('classificationPrompt', $data ?? [], null);
        $this->setIfExists('extractionPrompt', $data ?? [], null);
        $this->setIfExists('mergingPrompt', $data ?? [], null);
        $this->setIfExists('autoClassifyContent', $data ?? [], null);
        $this->setIfExists('maxTermsPerContentItem', $data ?? [], null);
        $this->setIfExists('allowedCollectionTaxonomies', $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['allowedOrigins']) {
            $invalidProperties[] = "'allowedOrigins' can't be null";
        }
        if (null === $this->container['status']) {
            $invalidProperties[] = "'status' can't be null";
        }
        if (null === $this->container['isTimeBased']) {
            $invalidProperties[] = "'isTimeBased' can't be null";
        }
        if (null === $this->container['facet']) {
            $invalidProperties[] = "'facet' can't be null";
        }
        if (null === $this->container['key']) {
            $invalidProperties[] = "'key' can't be null";
        }
        if (null === $this->container['name']) {
            $invalidProperties[] = "'name' can't be null";
        }
        if (null === $this->container['category']) {
            $invalidProperties[] = "'category' can't be null";
        }
        if (null === $this->container['allowedTargets']) {
            $invalidProperties[] = "'allowedTargets' can't be null";
        }
        if (null === $this->container['kind']) {
            $invalidProperties[] = "'kind' can't be null";
        }
        if (null === $this->container['allowAddingTerms']) {
            $invalidProperties[] = "'allowAddingTerms' can't be null";
        }
        if (null === $this->container['autoClassifyContent']) {
            $invalidProperties[] = "'autoClassifyContent' 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 allowedOrigins.
     *
     * @return TaxonomyTermOrigin[]
     */
    public function getAllowedOrigins()
    {
        return $this->container['allowedOrigins'];
    }

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

        return $this;
    }

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

    /**
     * Sets status.
     *
     * @param TaxonomyStatus $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 isTimeBased.
     *
     * @return bool
     */
    public function getIsTimeBased()
    {
        return $this->container['isTimeBased'];
    }

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

        return $this;
    }

    /**
     * Gets facet.
     *
     * @return TaxonomyFacet
     */
    public function getFacet()
    {
        return $this->container['facet'];
    }

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

        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 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 category.
     *
     * @return TaxonomyCategory
     */
    public function getCategory()
    {
        return $this->container['category'];
    }

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

        return $this;
    }

    /**
     * Gets allowedTargets.
     *
     * @return TaxonomyTermTargetType[]
     */
    public function getAllowedTargets()
    {
        return $this->container['allowedTargets'];
    }

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

        return $this;
    }

    /**
     * Gets kind.
     *
     * @return TaxonomyKind
     */
    public function getKind()
    {
        return $this->container['kind'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets autoClassifyContent.
     *
     * @return TaxonomyEntityAutoClassifyContent
     */
    public function getAutoClassifyContent()
    {
        return $this->container['autoClassifyContent'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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