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

/**
 * Fortnox API
 *
 * # Documentation   The Fortnox API is organized around REST. This means that we’ve designed it to have resource-oriented URLs and be as predictable as possible for you as developer.  It also means that we use HTTP status codes when something goes wrong and HTTP verbs understod by many API clients around the web.  We use a modified version of OAuth2 for authentication to offer a secure way for both you and our users to interact.  The API is generally built to support both XML and JSON but in this documentation all the examples will be in JSON.  We encourage you to read all the articles in the [Guides & Good to Know section](https://www.fortnox.se/developer/guides-and-good-to-know/)</a> first, before going forward and learning about the different resources.  This to ensure you get an understanding of some of the shared components of the API such as parameters and error handling.  ## Rate limits  The limit per access-token is 25 requests per 5 seconds. This equals to 300 requests per minute.  [Read more about this here.](https://www.fortnox.se/developer/guides-and-good-to-know/rate-limits-for-fortnox-api/)  ## Query parameters  Use query parameters with the ?-character and separate parameters with the &-character.   **Example:**  GET - https://api.fortnox.se/3/invoices?accountnumberfrom=3000&accountnumberto=4000 Read more about our parameters [here](https://www.fortnox.se/developer/guides-and-good-to-know/parameters/)   Search the documentation using the search field in the top left corner.
 *
 * The version of the OpenAPI document: 
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.19.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 Fortnox\Model;

use \ArrayAccess;
use \Fortnox\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'from_stock_location_code' => 'string',
        'from_stock_location_id' => 'string',
        'from_stock_location_name' => 'string',
        'from_stock_point_code' => 'string',
        'from_stock_point_id' => 'string',
        'from_stock_point_name' => 'string',
        'item_description' => 'string',
        'item_id' => 'string',
        'item_unit' => 'string',
        'quantity' => 'float',
        'requested_quantity' => 'float',
        'row_num' => 'int',
        'to_stock_location_code' => 'string',
        'to_stock_location_id' => 'string',
        'to_stock_location_name' => 'string',
        'to_stock_point_code' => 'string',
        'to_stock_point_id' => 'string',
        'to_stock_point_name' => '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 = [
        'from_stock_location_code' => null,
        'from_stock_location_id' => 'uuid',
        'from_stock_location_name' => null,
        'from_stock_point_code' => null,
        'from_stock_point_id' => 'uuid',
        'from_stock_point_name' => null,
        'item_description' => null,
        'item_id' => null,
        'item_unit' => null,
        'quantity' => null,
        'requested_quantity' => null,
        'row_num' => 'int64',
        'to_stock_location_code' => null,
        'to_stock_location_id' => 'uuid',
        'to_stock_location_name' => null,
        'to_stock_point_code' => null,
        'to_stock_point_id' => 'uuid',
        'to_stock_point_name' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'from_stock_location_code' => false,
        'from_stock_location_id' => false,
        'from_stock_location_name' => false,
        'from_stock_point_code' => false,
        'from_stock_point_id' => false,
        'from_stock_point_name' => false,
        'item_description' => false,
        'item_id' => false,
        'item_unit' => false,
        'quantity' => false,
        'requested_quantity' => false,
        'row_num' => false,
        'to_stock_location_code' => false,
        'to_stock_location_id' => false,
        'to_stock_location_name' => false,
        'to_stock_point_code' => false,
        'to_stock_point_id' => false,
        'to_stock_point_name' => false
    ];

    /**
      * 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 = [
        'from_stock_location_code' => 'fromStockLocationCode',
        'from_stock_location_id' => 'fromStockLocationId',
        'from_stock_location_name' => 'fromStockLocationName',
        'from_stock_point_code' => 'fromStockPointCode',
        'from_stock_point_id' => 'fromStockPointId',
        'from_stock_point_name' => 'fromStockPointName',
        'item_description' => 'itemDescription',
        'item_id' => 'itemId',
        'item_unit' => 'itemUnit',
        'quantity' => 'quantity',
        'requested_quantity' => 'requestedQuantity',
        'row_num' => 'rowNum',
        'to_stock_location_code' => 'toStockLocationCode',
        'to_stock_location_id' => 'toStockLocationId',
        'to_stock_location_name' => 'toStockLocationName',
        'to_stock_point_code' => 'toStockPointCode',
        'to_stock_point_id' => 'toStockPointId',
        'to_stock_point_name' => 'toStockPointName'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'from_stock_location_code' => 'setFromStockLocationCode',
        'from_stock_location_id' => 'setFromStockLocationId',
        'from_stock_location_name' => 'setFromStockLocationName',
        'from_stock_point_code' => 'setFromStockPointCode',
        'from_stock_point_id' => 'setFromStockPointId',
        'from_stock_point_name' => 'setFromStockPointName',
        'item_description' => 'setItemDescription',
        'item_id' => 'setItemId',
        'item_unit' => 'setItemUnit',
        'quantity' => 'setQuantity',
        'requested_quantity' => 'setRequestedQuantity',
        'row_num' => 'setRowNum',
        'to_stock_location_code' => 'setToStockLocationCode',
        'to_stock_location_id' => 'setToStockLocationId',
        'to_stock_location_name' => 'setToStockLocationName',
        'to_stock_point_code' => 'setToStockPointCode',
        'to_stock_point_id' => 'setToStockPointId',
        'to_stock_point_name' => 'setToStockPointName'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'from_stock_location_code' => 'getFromStockLocationCode',
        'from_stock_location_id' => 'getFromStockLocationId',
        'from_stock_location_name' => 'getFromStockLocationName',
        'from_stock_point_code' => 'getFromStockPointCode',
        'from_stock_point_id' => 'getFromStockPointId',
        'from_stock_point_name' => 'getFromStockPointName',
        'item_description' => 'getItemDescription',
        'item_id' => 'getItemId',
        'item_unit' => 'getItemUnit',
        'quantity' => 'getQuantity',
        'requested_quantity' => 'getRequestedQuantity',
        'row_num' => 'getRowNum',
        'to_stock_location_code' => 'getToStockLocationCode',
        'to_stock_location_id' => 'getToStockLocationId',
        'to_stock_location_name' => 'getToStockLocationName',
        'to_stock_point_code' => 'getToStockPointCode',
        'to_stock_point_id' => 'getToStockPointId',
        'to_stock_point_name' => 'getToStockPointName'
    ];

    /**
     * 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('from_stock_location_code', $data ?? [], null);
        $this->setIfExists('from_stock_location_id', $data ?? [], null);
        $this->setIfExists('from_stock_location_name', $data ?? [], null);
        $this->setIfExists('from_stock_point_code', $data ?? [], null);
        $this->setIfExists('from_stock_point_id', $data ?? [], null);
        $this->setIfExists('from_stock_point_name', $data ?? [], null);
        $this->setIfExists('item_description', $data ?? [], null);
        $this->setIfExists('item_id', $data ?? [], null);
        $this->setIfExists('item_unit', $data ?? [], null);
        $this->setIfExists('quantity', $data ?? [], null);
        $this->setIfExists('requested_quantity', $data ?? [], null);
        $this->setIfExists('row_num', $data ?? [], null);
        $this->setIfExists('to_stock_location_code', $data ?? [], null);
        $this->setIfExists('to_stock_location_id', $data ?? [], null);
        $this->setIfExists('to_stock_location_name', $data ?? [], null);
        $this->setIfExists('to_stock_point_code', $data ?? [], null);
        $this->setIfExists('to_stock_point_id', $data ?? [], null);
        $this->setIfExists('to_stock_point_name', $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 = [];

        if ($this->container['from_stock_point_id'] === null) {
            $invalidProperties[] = "'from_stock_point_id' can't be null";
        }
        if ($this->container['item_id'] === null) {
            $invalidProperties[] = "'item_id' can't be null";
        }
        if ((mb_strlen($this->container['item_id']) > 50)) {
            $invalidProperties[] = "invalid value for 'item_id', the character length must be smaller than or equal to 50.";
        }

        if ((mb_strlen($this->container['item_id']) < 1)) {
            $invalidProperties[] = "invalid value for 'item_id', the character length must be bigger than or equal to 1.";
        }

        if ($this->container['requested_quantity'] === null) {
            $invalidProperties[] = "'requested_quantity' can't be null";
        }
        if (($this->container['requested_quantity'] < 0.01)) {
            $invalidProperties[] = "invalid value for 'requested_quantity', must be bigger than or equal to 0.01.";
        }

        if ($this->container['to_stock_point_id'] === null) {
            $invalidProperties[] = "'to_stock_point_id' 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 count($this->listInvalidProperties()) === 0;
    }


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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets from_stock_point_id
     *
     * @return string
     */
    public function getFromStockPointId()
    {
        return $this->container['from_stock_point_id'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets item_id
     *
     * @return string
     */
    public function getItemId()
    {
        return $this->container['item_id'];
    }

    /**
     * Sets item_id
     *
     * @param string $item_id item_id
     *
     * @return self
     */
    public function setItemId($item_id)
    {
        if (is_null($item_id)) {
            throw new \InvalidArgumentException('non-nullable item_id cannot be null');
        }
        if ((mb_strlen($item_id) > 50)) {
            throw new \InvalidArgumentException('invalid length for $item_id when calling WarehouseStockTransferRow., must be smaller than or equal to 50.');
        }
        if ((mb_strlen($item_id) < 1)) {
            throw new \InvalidArgumentException('invalid length for $item_id when calling WarehouseStockTransferRow., must be bigger than or equal to 1.');
        }

        $this->container['item_id'] = $item_id;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets requested_quantity
     *
     * @param float $requested_quantity requested_quantity
     *
     * @return self
     */
    public function setRequestedQuantity($requested_quantity)
    {
        if (is_null($requested_quantity)) {
            throw new \InvalidArgumentException('non-nullable requested_quantity cannot be null');
        }

        if (($requested_quantity < 0.01)) {
            throw new \InvalidArgumentException('invalid value for $requested_quantity when calling WarehouseStockTransferRow., must be bigger than or equal to 0.01.');
        }

        $this->container['requested_quantity'] = $requested_quantity;

        return $this;
    }

    /**
     * Gets row_num
     *
     * @return int|null
     */
    public function getRowNum()
    {
        return $this->container['row_num'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets to_stock_point_id
     *
     * @return string
     */
    public function getToStockPointId()
    {
        return $this->container['to_stock_point_id'];
    }

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

        return $this;
    }

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

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

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

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


