<?php

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

/**
 * Binance Derivatives Trading USDS Futures REST API.
 *
 * OpenAPI Specification for the Binance Derivatives Trading USDS 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\DerivativesTradingUsdsFutures\Model;

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

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

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

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $openAPITypes = [
        'filterType' => 'string',
        'maxPrice' => 'string',
        'minPrice' => 'string',
        'tickSize' => 'string',
        'maxQty' => 'string',
        'minQty' => 'string',
        'stepSize' => 'string',
        'limit' => 'int',
        'notional' => 'string',
        'multiplierUp' => 'string',
        'multiplierDown' => 'string',
        'multiplierDecimal' => '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 = [
        'filterType' => null,
        'maxPrice' => null,
        'minPrice' => null,
        'tickSize' => null,
        'maxQty' => null,
        'minQty' => null,
        'stepSize' => null,
        'limit' => 'int64',
        'notional' => null,
        'multiplierUp' => null,
        'multiplierDown' => null,
        'multiplierDecimal' => null,
    ];

    /**
     * Array of nullable properties. Used for (de)serialization.
     *
     * @var bool[]
     */
    protected static array $openAPINullables = [
        'filterType' => false,
        'maxPrice' => false,
        'minPrice' => false,
        'tickSize' => false,
        'maxQty' => false,
        'minQty' => false,
        'stepSize' => false,
        'limit' => false,
        'notional' => false,
        'multiplierUp' => false,
        'multiplierDown' => false,
        'multiplierDecimal' => 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 = [
        'filterType' => 'filterType',
        'maxPrice' => 'maxPrice',
        'minPrice' => 'minPrice',
        'tickSize' => 'tickSize',
        'maxQty' => 'maxQty',
        'minQty' => 'minQty',
        'stepSize' => 'stepSize',
        'limit' => 'limit',
        'notional' => 'notional',
        'multiplierUp' => 'multiplierUp',
        'multiplierDown' => 'multiplierDown',
        'multiplierDecimal' => 'multiplierDecimal',
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     *
     * @var string[]
     */
    protected static $setters = [
        'filterType' => 'setFilterType',
        'maxPrice' => 'setMaxPrice',
        'minPrice' => 'setMinPrice',
        'tickSize' => 'setTickSize',
        'maxQty' => 'setMaxQty',
        'minQty' => 'setMinQty',
        'stepSize' => 'setStepSize',
        'limit' => 'setLimit',
        'notional' => 'setNotional',
        'multiplierUp' => 'setMultiplierUp',
        'multiplierDown' => 'setMultiplierDown',
        'multiplierDecimal' => 'setMultiplierDecimal',
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests).
     *
     * @var string[]
     */
    protected static $getters = [
        'filterType' => 'getFilterType',
        'maxPrice' => 'getMaxPrice',
        'minPrice' => 'getMinPrice',
        'tickSize' => 'getTickSize',
        'maxQty' => 'getMaxQty',
        'minQty' => 'getMinQty',
        'stepSize' => 'getStepSize',
        'limit' => 'getLimit',
        'notional' => 'getNotional',
        'multiplierUp' => 'getMultiplierUp',
        'multiplierDown' => 'getMultiplierDown',
        'multiplierDecimal' => 'getMultiplierDecimal',
    ];

    /**
     * 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('filterType', $data ?? [], null);
        $this->setIfExists('maxPrice', $data ?? [], null);
        $this->setIfExists('minPrice', $data ?? [], null);
        $this->setIfExists('tickSize', $data ?? [], null);
        $this->setIfExists('maxQty', $data ?? [], null);
        $this->setIfExists('minQty', $data ?? [], null);
        $this->setIfExists('stepSize', $data ?? [], null);
        $this->setIfExists('limit', $data ?? [], null);
        $this->setIfExists('notional', $data ?? [], null);
        $this->setIfExists('multiplierUp', $data ?? [], null);
        $this->setIfExists('multiplierDown', $data ?? [], null);
        $this->setIfExists('multiplierDecimal', $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 filterType.
     *
     * @return null|string
     */
    public function getFilterType()
    {
        return $this->container['filterType'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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