<?php
/**
 * FinFeedAPIExchangeModel
 *
 * PHP version 8.1
 *
 * @category Class
 * @package  OpenAPI\Client
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * FinFeedAPI Stock REST API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1
 * Contact: support@apibricks.io
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.14.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 OpenAPI\Client\Model;

use \ArrayAccess;
use \OpenAPI\Client\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'exchange_id' => 'string',
        'last_datapoint_date' => 'string',
        'mic' => 'string',
        'operating_mic' => 'string',
        'oprt_sgmt' => 'string',
        'market_name_institution_description' => 'string',
        'legal_entity_name' => 'string',
        'lei' => 'string',
        'market_category_code' => 'string',
        'acronym' => 'string',
        'iso_country_code' => 'string',
        'city' => 'string',
        'website' => 'string',
        'status' => 'string',
        'creation_date' => '\DateTime',
        'last_update_date' => '\DateTime',
        'last_validation_date' => '\DateTime',
        'expiry_date' => '\DateTime',
        'comments' => 'string'
    ];

    /**
      * 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 = [
        'exchange_id' => null,
        'last_datapoint_date' => null,
        'mic' => null,
        'operating_mic' => null,
        'oprt_sgmt' => null,
        'market_name_institution_description' => null,
        'legal_entity_name' => null,
        'lei' => null,
        'market_category_code' => null,
        'acronym' => null,
        'iso_country_code' => null,
        'city' => null,
        'website' => null,
        'status' => null,
        'creation_date' => 'date-time',
        'last_update_date' => 'date-time',
        'last_validation_date' => 'date-time',
        'expiry_date' => 'date-time',
        'comments' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'exchange_id' => true,
        'last_datapoint_date' => true,
        'mic' => true,
        'operating_mic' => true,
        'oprt_sgmt' => true,
        'market_name_institution_description' => true,
        'legal_entity_name' => true,
        'lei' => true,
        'market_category_code' => true,
        'acronym' => true,
        'iso_country_code' => true,
        'city' => true,
        'website' => true,
        'status' => true,
        'creation_date' => true,
        'last_update_date' => true,
        'last_validation_date' => true,
        'expiry_date' => true,
        'comments' => true
    ];

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

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

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

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

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

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

    /**
     * Checks if a nullable property is set to null.
     *
     * @param string $property
     * @return bool
     */
    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
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'exchange_id' => 'exchange_id',
        'last_datapoint_date' => 'last_datapoint_date',
        'mic' => 'mic',
        'operating_mic' => 'operating_mic',
        'oprt_sgmt' => 'oprt_sgmt',
        'market_name_institution_description' => 'market_name_institution_description',
        'legal_entity_name' => 'legal_entity_name',
        'lei' => 'lei',
        'market_category_code' => 'market_category_code',
        'acronym' => 'acronym',
        'iso_country_code' => 'iso_country_code',
        'city' => 'city',
        'website' => 'website',
        'status' => 'status',
        'creation_date' => 'creation_date',
        'last_update_date' => 'last_update_date',
        'last_validation_date' => 'last_validation_date',
        'expiry_date' => 'expiry_date',
        'comments' => 'comments'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'exchange_id' => 'setExchangeId',
        'last_datapoint_date' => 'setLastDatapointDate',
        'mic' => 'setMic',
        'operating_mic' => 'setOperatingMic',
        'oprt_sgmt' => 'setOprtSgmt',
        'market_name_institution_description' => 'setMarketNameInstitutionDescription',
        'legal_entity_name' => 'setLegalEntityName',
        'lei' => 'setLei',
        'market_category_code' => 'setMarketCategoryCode',
        'acronym' => 'setAcronym',
        'iso_country_code' => 'setIsoCountryCode',
        'city' => 'setCity',
        'website' => 'setWebsite',
        'status' => 'setStatus',
        'creation_date' => 'setCreationDate',
        'last_update_date' => 'setLastUpdateDate',
        'last_validation_date' => 'setLastValidationDate',
        'expiry_date' => 'setExpiryDate',
        'comments' => 'setComments'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'exchange_id' => 'getExchangeId',
        'last_datapoint_date' => 'getLastDatapointDate',
        'mic' => 'getMic',
        'operating_mic' => 'getOperatingMic',
        'oprt_sgmt' => 'getOprtSgmt',
        'market_name_institution_description' => 'getMarketNameInstitutionDescription',
        'legal_entity_name' => 'getLegalEntityName',
        'lei' => 'getLei',
        'market_category_code' => 'getMarketCategoryCode',
        'acronym' => 'getAcronym',
        'iso_country_code' => 'getIsoCountryCode',
        'city' => 'getCity',
        'website' => 'getWebsite',
        'status' => 'getStatus',
        'creation_date' => 'getCreationDate',
        'last_update_date' => 'getLastUpdateDate',
        'last_validation_date' => 'getLastValidationDate',
        'expiry_date' => 'getExpiryDate',
        'comments' => 'getComments'
    ];

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


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

    /**
     * Constructor
     *
     * @param mixed[]|null $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('exchange_id', $data ?? [], null);
        $this->setIfExists('last_datapoint_date', $data ?? [], null);
        $this->setIfExists('mic', $data ?? [], null);
        $this->setIfExists('operating_mic', $data ?? [], null);
        $this->setIfExists('oprt_sgmt', $data ?? [], null);
        $this->setIfExists('market_name_institution_description', $data ?? [], null);
        $this->setIfExists('legal_entity_name', $data ?? [], null);
        $this->setIfExists('lei', $data ?? [], null);
        $this->setIfExists('market_category_code', $data ?? [], null);
        $this->setIfExists('acronym', $data ?? [], null);
        $this->setIfExists('iso_country_code', $data ?? [], null);
        $this->setIfExists('city', $data ?? [], null);
        $this->setIfExists('website', $data ?? [], null);
        $this->setIfExists('status', $data ?? [], null);
        $this->setIfExists('creation_date', $data ?? [], null);
        $this->setIfExists('last_update_date', $data ?? [], null);
        $this->setIfExists('last_validation_date', $data ?? [], null);
        $this->setIfExists('expiry_date', $data ?? [], null);
        $this->setIfExists('comments', $data ?? [], null);
    }

    /**
    * 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 string $variableName
    * @param array  $fields
    * @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;
    }

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

        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 count($this->listInvalidProperties()) === 0;
    }


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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets creation_date
     *
     * @return \DateTime|null
     */
    public function getCreationDate()
    {
        return $this->container['creation_date'];
    }

    /**
     * Sets creation_date
     *
     * @param \DateTime|null $creation_date creation_date
     *
     * @return self
     */
    public function setCreationDate($creation_date)
    {
        if (is_null($creation_date)) {
            array_push($this->openAPINullablesSetToNull, 'creation_date');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('creation_date', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['creation_date'] = $creation_date;

        return $this;
    }

    /**
     * Gets last_update_date
     *
     * @return \DateTime|null
     */
    public function getLastUpdateDate()
    {
        return $this->container['last_update_date'];
    }

    /**
     * Sets last_update_date
     *
     * @param \DateTime|null $last_update_date last_update_date
     *
     * @return self
     */
    public function setLastUpdateDate($last_update_date)
    {
        if (is_null($last_update_date)) {
            array_push($this->openAPINullablesSetToNull, 'last_update_date');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('last_update_date', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['last_update_date'] = $last_update_date;

        return $this;
    }

    /**
     * Gets last_validation_date
     *
     * @return \DateTime|null
     */
    public function getLastValidationDate()
    {
        return $this->container['last_validation_date'];
    }

    /**
     * Sets last_validation_date
     *
     * @param \DateTime|null $last_validation_date last_validation_date
     *
     * @return self
     */
    public function setLastValidationDate($last_validation_date)
    {
        if (is_null($last_validation_date)) {
            array_push($this->openAPINullablesSetToNull, 'last_validation_date');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('last_validation_date', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['last_validation_date'] = $last_validation_date;

        return $this;
    }

    /**
     * Gets expiry_date
     *
     * @return \DateTime|null
     */
    public function getExpiryDate()
    {
        return $this->container['expiry_date'];
    }

    /**
     * Sets expiry_date
     *
     * @param \DateTime|null $expiry_date expiry_date
     *
     * @return self
     */
    public function setExpiryDate($expiry_date)
    {
        if (is_null($expiry_date)) {
            array_push($this->openAPINullablesSetToNull, 'expiry_date');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('expiry_date', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['expiry_date'] = $expiry_date;

        return $this;
    }

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

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

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

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

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

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

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     * @link 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 the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

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


