<?php
/**
 * BlockProcessingPerformanceModel
 *
 * PHP version 8.1
 *
 * @package  lthn
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * Lethean Blockchain API
 *
 * OpenAPI for Lethean Blockchain
 *
 * The version of the OpenAPI document: 6.0.1
 * @generated Generated by: https://openapi-generator.tech
 * Generator version: 7.16.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 lthn\lthn;

use ArrayAccess;
use JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use lthn\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var array<string, string>
      */
    protected static array $openAPITypes = [
        'block_processing_time_0' => 'int',
        'block_processing_time_1' => 'int',
        'target_calculating_time_2' => 'int',
        'longhash_calculating_time_3' => 'int',
        'all_txs_insert_time_5' => 'int',
        'etc_stuff_6' => 'int',
        'insert_time_4' => 'int',
        'raise_block_core_event' => 'int',
        'validate_miner_transaction_time' => 'int',
        'collect_rangeproofs_data_from_tx_time' => 'int',
        'verify_multiple_zc_outs_range_proofs_time' => 'int',
        'target_calculating_enum_blocks' => 'int',
        'target_calculating_calc' => 'int',
        'pos_validate_ki_search' => 'int',
        'pos_validate_get_out_keys_for_inputs' => 'int',
        'pos_validate_zvp' => 'int'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var array<string, string|null>
      */
    protected static array $openAPIFormats = [
        'block_processing_time_0' => null,
        'block_processing_time_1' => null,
        'target_calculating_time_2' => null,
        'longhash_calculating_time_3' => null,
        'all_txs_insert_time_5' => null,
        'etc_stuff_6' => null,
        'insert_time_4' => null,
        'raise_block_core_event' => null,
        'validate_miner_transaction_time' => null,
        'collect_rangeproofs_data_from_tx_time' => null,
        'verify_multiple_zc_outs_range_proofs_time' => null,
        'target_calculating_enum_blocks' => null,
        'target_calculating_calc' => null,
        'pos_validate_ki_search' => null,
        'pos_validate_get_out_keys_for_inputs' => null,
        'pos_validate_zvp' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var array<string, bool>
      */
    protected static array $openAPINullables = [
        'block_processing_time_0' => false,
        'block_processing_time_1' => false,
        'target_calculating_time_2' => false,
        'longhash_calculating_time_3' => false,
        'all_txs_insert_time_5' => false,
        'etc_stuff_6' => false,
        'insert_time_4' => false,
        'raise_block_core_event' => false,
        'validate_miner_transaction_time' => false,
        'collect_rangeproofs_data_from_tx_time' => false,
        'verify_multiple_zc_outs_range_proofs_time' => false,
        'target_calculating_enum_blocks' => false,
        'target_calculating_calc' => false,
        'pos_validate_ki_search' => false,
        'pos_validate_get_out_keys_for_inputs' => false,
        'pos_validate_zvp' => false
    ];

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

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

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

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

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

    /**
     * Setter - Array of nullable field names deliberately set to null
     *
     * @param array<string, bool> $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 array<string, string>
     */
    protected static array $attributeMap = [
        'block_processing_time_0' => 'block_processing_time_0',
        'block_processing_time_1' => 'block_processing_time_1',
        'target_calculating_time_2' => 'target_calculating_time_2',
        'longhash_calculating_time_3' => 'longhash_calculating_time_3',
        'all_txs_insert_time_5' => 'all_txs_insert_time_5',
        'etc_stuff_6' => 'etc_stuff_6',
        'insert_time_4' => 'insert_time_4',
        'raise_block_core_event' => 'raise_block_core_event',
        'validate_miner_transaction_time' => 'validate_miner_transaction_time',
        'collect_rangeproofs_data_from_tx_time' => 'collect_rangeproofs_data_from_tx_time',
        'verify_multiple_zc_outs_range_proofs_time' => 'verify_multiple_zc_outs_range_proofs_time',
        'target_calculating_enum_blocks' => 'target_calculating_enum_blocks',
        'target_calculating_calc' => 'target_calculating_calc',
        'pos_validate_ki_search' => 'pos_validate_ki_search',
        'pos_validate_get_out_keys_for_inputs' => 'pos_validate_get_out_keys_for_inputs',
        'pos_validate_zvp' => 'pos_validate_zvp'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var array<string, string>
     */
    protected static array $setters = [
        'block_processing_time_0' => 'setBlockProcessingTime0',
        'block_processing_time_1' => 'setBlockProcessingTime1',
        'target_calculating_time_2' => 'setTargetCalculatingTime2',
        'longhash_calculating_time_3' => 'setLonghashCalculatingTime3',
        'all_txs_insert_time_5' => 'setAllTxsInsertTime5',
        'etc_stuff_6' => 'setEtcStuff6',
        'insert_time_4' => 'setInsertTime4',
        'raise_block_core_event' => 'setRaiseBlockCoreEvent',
        'validate_miner_transaction_time' => 'setValidateMinerTransactionTime',
        'collect_rangeproofs_data_from_tx_time' => 'setCollectRangeproofsDataFromTxTime',
        'verify_multiple_zc_outs_range_proofs_time' => 'setVerifyMultipleZcOutsRangeProofsTime',
        'target_calculating_enum_blocks' => 'setTargetCalculatingEnumBlocks',
        'target_calculating_calc' => 'setTargetCalculatingCalc',
        'pos_validate_ki_search' => 'setPosValidateKiSearch',
        'pos_validate_get_out_keys_for_inputs' => 'setPosValidateGetOutKeysForInputs',
        'pos_validate_zvp' => 'setPosValidateZvp'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var array<string, string>
     */
    protected static array $getters = [
        'block_processing_time_0' => 'getBlockProcessingTime0',
        'block_processing_time_1' => 'getBlockProcessingTime1',
        'target_calculating_time_2' => 'getTargetCalculatingTime2',
        'longhash_calculating_time_3' => 'getLonghashCalculatingTime3',
        'all_txs_insert_time_5' => 'getAllTxsInsertTime5',
        'etc_stuff_6' => 'getEtcStuff6',
        'insert_time_4' => 'getInsertTime4',
        'raise_block_core_event' => 'getRaiseBlockCoreEvent',
        'validate_miner_transaction_time' => 'getValidateMinerTransactionTime',
        'collect_rangeproofs_data_from_tx_time' => 'getCollectRangeproofsDataFromTxTime',
        'verify_multiple_zc_outs_range_proofs_time' => 'getVerifyMultipleZcOutsRangeProofsTime',
        'target_calculating_enum_blocks' => 'getTargetCalculatingEnumBlocks',
        'target_calculating_calc' => 'getTargetCalculatingCalc',
        'pos_validate_ki_search' => 'getPosValidateKiSearch',
        'pos_validate_get_out_keys_for_inputs' => 'getPosValidateGetOutKeysForInputs',
        'pos_validate_zvp' => 'getPosValidateZvp'
    ];

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

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

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

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


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

    /**
     * Constructor
     *
     * @param array $data Associated array of property values initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('block_processing_time_0', $data ?? [], null);
        $this->setIfExists('block_processing_time_1', $data ?? [], null);
        $this->setIfExists('target_calculating_time_2', $data ?? [], null);
        $this->setIfExists('longhash_calculating_time_3', $data ?? [], null);
        $this->setIfExists('all_txs_insert_time_5', $data ?? [], null);
        $this->setIfExists('etc_stuff_6', $data ?? [], null);
        $this->setIfExists('insert_time_4', $data ?? [], null);
        $this->setIfExists('raise_block_core_event', $data ?? [], null);
        $this->setIfExists('validate_miner_transaction_time', $data ?? [], null);
        $this->setIfExists('collect_rangeproofs_data_from_tx_time', $data ?? [], null);
        $this->setIfExists('verify_multiple_zc_outs_range_proofs_time', $data ?? [], null);
        $this->setIfExists('target_calculating_enum_blocks', $data ?? [], null);
        $this->setIfExists('target_calculating_calc', $data ?? [], null);
        $this->setIfExists('pos_validate_ki_search', $data ?? [], null);
        $this->setIfExists('pos_validate_get_out_keys_for_inputs', $data ?? [], null);
        $this->setIfExists('pos_validate_zvp', $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, mixed $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 string[] invalid properties with reasons
     */
    public function listInvalidProperties(): array
    {
        $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(): bool
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets block_processing_time_0
     *
     * @return int|null
     */
    public function getBlockProcessingTime0(): ?int
    {
        return $this->container['block_processing_time_0'];
    }

    /**
     * Sets block_processing_time_0
     *
     * @param int|null $block_processing_time_0 block_processing_time_0
     *
     * @return $this
     */
    public function setBlockProcessingTime0(?int $block_processing_time_0): static
    {
        if (is_null($block_processing_time_0)) {
            throw new InvalidArgumentException('non-nullable block_processing_time_0 cannot be null');
        }
        $this->container['block_processing_time_0'] = $block_processing_time_0;

        return $this;
    }

    /**
     * Gets block_processing_time_1
     *
     * @return int|null
     */
    public function getBlockProcessingTime1(): ?int
    {
        return $this->container['block_processing_time_1'];
    }

    /**
     * Sets block_processing_time_1
     *
     * @param int|null $block_processing_time_1 block_processing_time_1
     *
     * @return $this
     */
    public function setBlockProcessingTime1(?int $block_processing_time_1): static
    {
        if (is_null($block_processing_time_1)) {
            throw new InvalidArgumentException('non-nullable block_processing_time_1 cannot be null');
        }
        $this->container['block_processing_time_1'] = $block_processing_time_1;

        return $this;
    }

    /**
     * Gets target_calculating_time_2
     *
     * @return int|null
     */
    public function getTargetCalculatingTime2(): ?int
    {
        return $this->container['target_calculating_time_2'];
    }

    /**
     * Sets target_calculating_time_2
     *
     * @param int|null $target_calculating_time_2 target_calculating_time_2
     *
     * @return $this
     */
    public function setTargetCalculatingTime2(?int $target_calculating_time_2): static
    {
        if (is_null($target_calculating_time_2)) {
            throw new InvalidArgumentException('non-nullable target_calculating_time_2 cannot be null');
        }
        $this->container['target_calculating_time_2'] = $target_calculating_time_2;

        return $this;
    }

    /**
     * Gets longhash_calculating_time_3
     *
     * @return int|null
     */
    public function getLonghashCalculatingTime3(): ?int
    {
        return $this->container['longhash_calculating_time_3'];
    }

    /**
     * Sets longhash_calculating_time_3
     *
     * @param int|null $longhash_calculating_time_3 longhash_calculating_time_3
     *
     * @return $this
     */
    public function setLonghashCalculatingTime3(?int $longhash_calculating_time_3): static
    {
        if (is_null($longhash_calculating_time_3)) {
            throw new InvalidArgumentException('non-nullable longhash_calculating_time_3 cannot be null');
        }
        $this->container['longhash_calculating_time_3'] = $longhash_calculating_time_3;

        return $this;
    }

    /**
     * Gets all_txs_insert_time_5
     *
     * @return int|null
     */
    public function getAllTxsInsertTime5(): ?int
    {
        return $this->container['all_txs_insert_time_5'];
    }

    /**
     * Sets all_txs_insert_time_5
     *
     * @param int|null $all_txs_insert_time_5 all_txs_insert_time_5
     *
     * @return $this
     */
    public function setAllTxsInsertTime5(?int $all_txs_insert_time_5): static
    {
        if (is_null($all_txs_insert_time_5)) {
            throw new InvalidArgumentException('non-nullable all_txs_insert_time_5 cannot be null');
        }
        $this->container['all_txs_insert_time_5'] = $all_txs_insert_time_5;

        return $this;
    }

    /**
     * Gets etc_stuff_6
     *
     * @return int|null
     */
    public function getEtcStuff6(): ?int
    {
        return $this->container['etc_stuff_6'];
    }

    /**
     * Sets etc_stuff_6
     *
     * @param int|null $etc_stuff_6 etc_stuff_6
     *
     * @return $this
     */
    public function setEtcStuff6(?int $etc_stuff_6): static
    {
        if (is_null($etc_stuff_6)) {
            throw new InvalidArgumentException('non-nullable etc_stuff_6 cannot be null');
        }
        $this->container['etc_stuff_6'] = $etc_stuff_6;

        return $this;
    }

    /**
     * Gets insert_time_4
     *
     * @return int|null
     */
    public function getInsertTime4(): ?int
    {
        return $this->container['insert_time_4'];
    }

    /**
     * Sets insert_time_4
     *
     * @param int|null $insert_time_4 insert_time_4
     *
     * @return $this
     */
    public function setInsertTime4(?int $insert_time_4): static
    {
        if (is_null($insert_time_4)) {
            throw new InvalidArgumentException('non-nullable insert_time_4 cannot be null');
        }
        $this->container['insert_time_4'] = $insert_time_4;

        return $this;
    }

    /**
     * Gets raise_block_core_event
     *
     * @return int|null
     */
    public function getRaiseBlockCoreEvent(): ?int
    {
        return $this->container['raise_block_core_event'];
    }

    /**
     * Sets raise_block_core_event
     *
     * @param int|null $raise_block_core_event raise_block_core_event
     *
     * @return $this
     */
    public function setRaiseBlockCoreEvent(?int $raise_block_core_event): static
    {
        if (is_null($raise_block_core_event)) {
            throw new InvalidArgumentException('non-nullable raise_block_core_event cannot be null');
        }
        $this->container['raise_block_core_event'] = $raise_block_core_event;

        return $this;
    }

    /**
     * Gets validate_miner_transaction_time
     *
     * @return int|null
     */
    public function getValidateMinerTransactionTime(): ?int
    {
        return $this->container['validate_miner_transaction_time'];
    }

    /**
     * Sets validate_miner_transaction_time
     *
     * @param int|null $validate_miner_transaction_time validate_miner_transaction_time
     *
     * @return $this
     */
    public function setValidateMinerTransactionTime(?int $validate_miner_transaction_time): static
    {
        if (is_null($validate_miner_transaction_time)) {
            throw new InvalidArgumentException('non-nullable validate_miner_transaction_time cannot be null');
        }
        $this->container['validate_miner_transaction_time'] = $validate_miner_transaction_time;

        return $this;
    }

    /**
     * Gets collect_rangeproofs_data_from_tx_time
     *
     * @return int|null
     */
    public function getCollectRangeproofsDataFromTxTime(): ?int
    {
        return $this->container['collect_rangeproofs_data_from_tx_time'];
    }

    /**
     * Sets collect_rangeproofs_data_from_tx_time
     *
     * @param int|null $collect_rangeproofs_data_from_tx_time collect_rangeproofs_data_from_tx_time
     *
     * @return $this
     */
    public function setCollectRangeproofsDataFromTxTime(?int $collect_rangeproofs_data_from_tx_time): static
    {
        if (is_null($collect_rangeproofs_data_from_tx_time)) {
            throw new InvalidArgumentException('non-nullable collect_rangeproofs_data_from_tx_time cannot be null');
        }
        $this->container['collect_rangeproofs_data_from_tx_time'] = $collect_rangeproofs_data_from_tx_time;

        return $this;
    }

    /**
     * Gets verify_multiple_zc_outs_range_proofs_time
     *
     * @return int|null
     */
    public function getVerifyMultipleZcOutsRangeProofsTime(): ?int
    {
        return $this->container['verify_multiple_zc_outs_range_proofs_time'];
    }

    /**
     * Sets verify_multiple_zc_outs_range_proofs_time
     *
     * @param int|null $verify_multiple_zc_outs_range_proofs_time verify_multiple_zc_outs_range_proofs_time
     *
     * @return $this
     */
    public function setVerifyMultipleZcOutsRangeProofsTime(?int $verify_multiple_zc_outs_range_proofs_time): static
    {
        if (is_null($verify_multiple_zc_outs_range_proofs_time)) {
            throw new InvalidArgumentException('non-nullable verify_multiple_zc_outs_range_proofs_time cannot be null');
        }
        $this->container['verify_multiple_zc_outs_range_proofs_time'] = $verify_multiple_zc_outs_range_proofs_time;

        return $this;
    }

    /**
     * Gets target_calculating_enum_blocks
     *
     * @return int|null
     */
    public function getTargetCalculatingEnumBlocks(): ?int
    {
        return $this->container['target_calculating_enum_blocks'];
    }

    /**
     * Sets target_calculating_enum_blocks
     *
     * @param int|null $target_calculating_enum_blocks target_calculating_enum_blocks
     *
     * @return $this
     */
    public function setTargetCalculatingEnumBlocks(?int $target_calculating_enum_blocks): static
    {
        if (is_null($target_calculating_enum_blocks)) {
            throw new InvalidArgumentException('non-nullable target_calculating_enum_blocks cannot be null');
        }
        $this->container['target_calculating_enum_blocks'] = $target_calculating_enum_blocks;

        return $this;
    }

    /**
     * Gets target_calculating_calc
     *
     * @return int|null
     */
    public function getTargetCalculatingCalc(): ?int
    {
        return $this->container['target_calculating_calc'];
    }

    /**
     * Sets target_calculating_calc
     *
     * @param int|null $target_calculating_calc target_calculating_calc
     *
     * @return $this
     */
    public function setTargetCalculatingCalc(?int $target_calculating_calc): static
    {
        if (is_null($target_calculating_calc)) {
            throw new InvalidArgumentException('non-nullable target_calculating_calc cannot be null');
        }
        $this->container['target_calculating_calc'] = $target_calculating_calc;

        return $this;
    }

    /**
     * Gets pos_validate_ki_search
     *
     * @return int|null
     */
    public function getPosValidateKiSearch(): ?int
    {
        return $this->container['pos_validate_ki_search'];
    }

    /**
     * Sets pos_validate_ki_search
     *
     * @param int|null $pos_validate_ki_search pos_validate_ki_search
     *
     * @return $this
     */
    public function setPosValidateKiSearch(?int $pos_validate_ki_search): static
    {
        if (is_null($pos_validate_ki_search)) {
            throw new InvalidArgumentException('non-nullable pos_validate_ki_search cannot be null');
        }
        $this->container['pos_validate_ki_search'] = $pos_validate_ki_search;

        return $this;
    }

    /**
     * Gets pos_validate_get_out_keys_for_inputs
     *
     * @return int|null
     */
    public function getPosValidateGetOutKeysForInputs(): ?int
    {
        return $this->container['pos_validate_get_out_keys_for_inputs'];
    }

    /**
     * Sets pos_validate_get_out_keys_for_inputs
     *
     * @param int|null $pos_validate_get_out_keys_for_inputs pos_validate_get_out_keys_for_inputs
     *
     * @return $this
     */
    public function setPosValidateGetOutKeysForInputs(?int $pos_validate_get_out_keys_for_inputs): static
    {
        if (is_null($pos_validate_get_out_keys_for_inputs)) {
            throw new InvalidArgumentException('non-nullable pos_validate_get_out_keys_for_inputs cannot be null');
        }
        $this->container['pos_validate_get_out_keys_for_inputs'] = $pos_validate_get_out_keys_for_inputs;

        return $this;
    }

    /**
     * Gets pos_validate_zvp
     *
     * @return int|null
     */
    public function getPosValidateZvp(): ?int
    {
        return $this->container['pos_validate_zvp'];
    }

    /**
     * Sets pos_validate_zvp
     *
     * @param int|null $pos_validate_zvp pos_validate_zvp
     *
     * @return $this
     */
    public function setPosValidateZvp(?int $pos_validate_zvp): static
    {
        if (is_null($pos_validate_zvp)) {
            throw new InvalidArgumentException('non-nullable pos_validate_zvp cannot be null');
        }
        $this->container['pos_validate_zvp'] = $pos_validate_zvp;

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

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed|null
     */
    #[ReturnTypeWillChange]
    public function offsetGet(mixed $offset): mixed
    {
        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(mixed $offset, mixed $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(mixed $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(): mixed
    {
       return ObjectSerializer::sanitizeForSerialization($this);
    }

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

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


