<?php

/**
 * ExchangeInformationResponseSymbolsInner.
 *
 * PHP version 8.1
 *
 * @category Class
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 */

/**
 * Binance Derivatives Trading COIN Futures REST API.
 *
 * OpenAPI Specification for the Binance Derivatives Trading COIN Futures REST API
 *
 * The version of the OpenAPI document: 1.0.0
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.12.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 Binance\Client\DerivativesTradingCoinFutures\Model;

use Binance\Common\Dtos\ModelInterface;
use Binance\Common\ObjectSerializer;

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

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

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $openAPITypes = [
        'filters' => '\Binance\Client\DerivativesTradingCoinFutures\Model\ExchangeInformationResponseSymbolsInnerFiltersInner[]',
        'orderType' => 'string[]',
        'timeInForce' => 'string[]',
        'liquidationFee' => 'string',
        'marketTakeBound' => 'string',
        'symbol' => 'string',
        'pair' => 'string',
        'contractType' => 'string',
        'deliveryDate' => 'int',
        'onboardDate' => 'int',
        'contractStatus' => 'string',
        'contractSize' => 'int',
        'quoteAsset' => 'string',
        'baseAsset' => 'string',
        'marginAsset' => 'string',
        'pricePrecision' => 'int',
        'quantityPrecision' => 'int',
        'baseAssetPrecision' => 'int',
        'quotePrecision' => 'int',
        'equalQtyPrecision' => 'int',
        'triggerProtect' => 'string',
        'maintMarginPercent' => 'string',
        'requiredMarginPercent' => 'string',
        'underlyingType' => 'string',
        'underlyingSubType' => '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 = [
        'filters' => null,
        'orderType' => null,
        'timeInForce' => null,
        'liquidationFee' => null,
        'marketTakeBound' => null,
        'symbol' => null,
        'pair' => null,
        'contractType' => null,
        'deliveryDate' => 'int64',
        'onboardDate' => 'int64',
        'contractStatus' => null,
        'contractSize' => 'int64',
        'quoteAsset' => null,
        'baseAsset' => null,
        'marginAsset' => null,
        'pricePrecision' => 'int64',
        'quantityPrecision' => 'int64',
        'baseAssetPrecision' => 'int64',
        'quotePrecision' => 'int64',
        'equalQtyPrecision' => 'int64',
        'triggerProtect' => null,
        'maintMarginPercent' => null,
        'requiredMarginPercent' => null,
        'underlyingType' => null,
        'underlyingSubType' => null,
    ];

    /**
     * Array of nullable properties. Used for (de)serialization.
     *
     * @var bool[]
     */
    protected static array $openAPINullables = [
        'filters' => false,
        'orderType' => false,
        'timeInForce' => false,
        'liquidationFee' => false,
        'marketTakeBound' => false,
        'symbol' => false,
        'pair' => false,
        'contractType' => false,
        'deliveryDate' => false,
        'onboardDate' => false,
        'contractStatus' => false,
        'contractSize' => false,
        'quoteAsset' => false,
        'baseAsset' => false,
        'marginAsset' => false,
        'pricePrecision' => false,
        'quantityPrecision' => false,
        'baseAssetPrecision' => false,
        'quotePrecision' => false,
        'equalQtyPrecision' => false,
        'triggerProtect' => false,
        'maintMarginPercent' => false,
        'requiredMarginPercent' => false,
        'underlyingType' => false,
        'underlyingSubType' => false,
    ];

    /**
     * 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 = [
        'filters' => 'filters',
        'orderType' => 'OrderType',
        'timeInForce' => 'timeInForce',
        'liquidationFee' => 'liquidationFee',
        'marketTakeBound' => 'marketTakeBound',
        'symbol' => 'symbol',
        'pair' => 'pair',
        'contractType' => 'contractType',
        'deliveryDate' => 'deliveryDate',
        'onboardDate' => 'onboardDate',
        'contractStatus' => 'contractStatus',
        'contractSize' => 'contractSize',
        'quoteAsset' => 'quoteAsset',
        'baseAsset' => 'baseAsset',
        'marginAsset' => 'marginAsset',
        'pricePrecision' => 'pricePrecision',
        'quantityPrecision' => 'quantityPrecision',
        'baseAssetPrecision' => 'baseAssetPrecision',
        'quotePrecision' => 'quotePrecision',
        'equalQtyPrecision' => 'equalQtyPrecision',
        'triggerProtect' => 'triggerProtect',
        'maintMarginPercent' => 'maintMarginPercent',
        'requiredMarginPercent' => 'requiredMarginPercent',
        'underlyingType' => 'underlyingType',
        'underlyingSubType' => 'underlyingSubType',
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     *
     * @var string[]
     */
    protected static $setters = [
        'filters' => 'setFilters',
        'orderType' => 'setOrderType',
        'timeInForce' => 'setTimeInForce',
        'liquidationFee' => 'setLiquidationFee',
        'marketTakeBound' => 'setMarketTakeBound',
        'symbol' => 'setSymbol',
        'pair' => 'setPair',
        'contractType' => 'setContractType',
        'deliveryDate' => 'setDeliveryDate',
        'onboardDate' => 'setOnboardDate',
        'contractStatus' => 'setContractStatus',
        'contractSize' => 'setContractSize',
        'quoteAsset' => 'setQuoteAsset',
        'baseAsset' => 'setBaseAsset',
        'marginAsset' => 'setMarginAsset',
        'pricePrecision' => 'setPricePrecision',
        'quantityPrecision' => 'setQuantityPrecision',
        'baseAssetPrecision' => 'setBaseAssetPrecision',
        'quotePrecision' => 'setQuotePrecision',
        'equalQtyPrecision' => 'setEqualQtyPrecision',
        'triggerProtect' => 'setTriggerProtect',
        'maintMarginPercent' => 'setMaintMarginPercent',
        'requiredMarginPercent' => 'setRequiredMarginPercent',
        'underlyingType' => 'setUnderlyingType',
        'underlyingSubType' => 'setUnderlyingSubType',
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests).
     *
     * @var string[]
     */
    protected static $getters = [
        'filters' => 'getFilters',
        'orderType' => 'getOrderType',
        'timeInForce' => 'getTimeInForce',
        'liquidationFee' => 'getLiquidationFee',
        'marketTakeBound' => 'getMarketTakeBound',
        'symbol' => 'getSymbol',
        'pair' => 'getPair',
        'contractType' => 'getContractType',
        'deliveryDate' => 'getDeliveryDate',
        'onboardDate' => 'getOnboardDate',
        'contractStatus' => 'getContractStatus',
        'contractSize' => 'getContractSize',
        'quoteAsset' => 'getQuoteAsset',
        'baseAsset' => 'getBaseAsset',
        'marginAsset' => 'getMarginAsset',
        'pricePrecision' => 'getPricePrecision',
        'quantityPrecision' => 'getQuantityPrecision',
        'baseAssetPrecision' => 'getBaseAssetPrecision',
        'quotePrecision' => 'getQuotePrecision',
        'equalQtyPrecision' => 'getEqualQtyPrecision',
        'triggerProtect' => 'getTriggerProtect',
        'maintMarginPercent' => 'getMaintMarginPercent',
        'requiredMarginPercent' => 'getRequiredMarginPercent',
        'underlyingType' => 'getUnderlyingType',
        'underlyingSubType' => 'getUnderlyingSubType',
    ];

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

    /**
     * Constructor.
     *
     * @param null|mixed[] $data Associated array of property values
     *                           initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('filters', $data ?? [], null);
        $this->setIfExists('orderType', $data ?? [], null);
        $this->setIfExists('timeInForce', $data ?? [], null);
        $this->setIfExists('liquidationFee', $data ?? [], null);
        $this->setIfExists('marketTakeBound', $data ?? [], null);
        $this->setIfExists('symbol', $data ?? [], null);
        $this->setIfExists('pair', $data ?? [], null);
        $this->setIfExists('contractType', $data ?? [], null);
        $this->setIfExists('deliveryDate', $data ?? [], null);
        $this->setIfExists('onboardDate', $data ?? [], null);
        $this->setIfExists('contractStatus', $data ?? [], null);
        $this->setIfExists('contractSize', $data ?? [], null);
        $this->setIfExists('quoteAsset', $data ?? [], null);
        $this->setIfExists('baseAsset', $data ?? [], null);
        $this->setIfExists('marginAsset', $data ?? [], null);
        $this->setIfExists('pricePrecision', $data ?? [], null);
        $this->setIfExists('quantityPrecision', $data ?? [], null);
        $this->setIfExists('baseAssetPrecision', $data ?? [], null);
        $this->setIfExists('quotePrecision', $data ?? [], null);
        $this->setIfExists('equalQtyPrecision', $data ?? [], null);
        $this->setIfExists('triggerProtect', $data ?? [], null);
        $this->setIfExists('maintMarginPercent', $data ?? [], null);
        $this->setIfExists('requiredMarginPercent', $data ?? [], null);
        $this->setIfExists('underlyingType', $data ?? [], null);
        $this->setIfExists('underlyingSubType', $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;
    }

    /**
     * If oneOf schema, get the possible response types.
     */
    public static function getComposedSchemas(): array
    {
        return [
        ];
    }

    /**
     * Return true if the model is an array.
     */
    public static function isArray(): bool
    {
        return false;
    }

    /**
     * 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()
    {
        return [];
    }

    /**
     * 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 filters.
     *
     * @return null|ExchangeInformationResponseSymbolsInnerFiltersInner[]
     */
    public function getFilters()
    {
        return $this->container['filters'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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