<?php

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

/**
 * Binance Spot REST API.
 *
 * OpenAPI Specifications for the Binance Spot REST API  API documents:   - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md)   - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information)
 *
 * 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\Spot\Model;

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

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

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

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $openAPITypes = [
        'symbol' => 'string',
        'listClientOrderId' => 'string',
        'side' => '\Binance\Client\Spot\Model\Side',
        'quantity' => 'float',
        'aboveType' => '\Binance\Client\Spot\Model\AboveType',
        'aboveClientOrderId' => 'string',
        'aboveIcebergQty' => 'int',
        'abovePrice' => 'float',
        'aboveStopPrice' => 'float',
        'aboveTrailingDelta' => 'int',
        'aboveTimeInForce' => 'float',
        'aboveStrategyId' => 'int',
        'aboveStrategyType' => 'int',
        'belowType' => '\Binance\Client\Spot\Model\BelowType',
        'belowClientOrderId' => 'string',
        'belowIcebergQty' => 'int',
        'belowPrice' => 'float',
        'belowStopPrice' => 'float',
        'belowTrailingDelta' => 'int',
        'belowTimeInForce' => '\Binance\Client\Spot\Model\BelowTimeInForce',
        'belowStrategyId' => 'int',
        'belowStrategyType' => 'int',
        'newOrderRespType' => '\Binance\Client\Spot\Model\NewOrderRespType',
        'selfTradePreventionMode' => '\Binance\Client\Spot\Model\SelfTradePreventionMode',
        'recvWindow' => 'int',
    ];

    /**
     * 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 = [
        'symbol' => null,
        'listClientOrderId' => null,
        'side' => null,
        'quantity' => 'float',
        'aboveType' => null,
        'aboveClientOrderId' => null,
        'aboveIcebergQty' => 'int64',
        'abovePrice' => 'float',
        'aboveStopPrice' => 'float',
        'aboveTrailingDelta' => 'int64',
        'aboveTimeInForce' => 'float',
        'aboveStrategyId' => 'int64',
        'aboveStrategyType' => null,
        'belowType' => null,
        'belowClientOrderId' => null,
        'belowIcebergQty' => 'int64',
        'belowPrice' => 'float',
        'belowStopPrice' => 'float',
        'belowTrailingDelta' => 'int64',
        'belowTimeInForce' => null,
        'belowStrategyId' => 'int64',
        'belowStrategyType' => null,
        'newOrderRespType' => null,
        'selfTradePreventionMode' => null,
        'recvWindow' => 'int64',
    ];

    /**
     * Array of nullable properties. Used for (de)serialization.
     *
     * @var bool[]
     */
    protected static array $openAPINullables = [
        'symbol' => false,
        'listClientOrderId' => false,
        'side' => false,
        'quantity' => false,
        'aboveType' => false,
        'aboveClientOrderId' => false,
        'aboveIcebergQty' => false,
        'abovePrice' => false,
        'aboveStopPrice' => false,
        'aboveTrailingDelta' => false,
        'aboveTimeInForce' => false,
        'aboveStrategyId' => false,
        'aboveStrategyType' => false,
        'belowType' => false,
        'belowClientOrderId' => false,
        'belowIcebergQty' => false,
        'belowPrice' => false,
        'belowStopPrice' => false,
        'belowTrailingDelta' => false,
        'belowTimeInForce' => false,
        'belowStrategyId' => false,
        'belowStrategyType' => false,
        'newOrderRespType' => false,
        'selfTradePreventionMode' => false,
        'recvWindow' => 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 = [
        'symbol' => 'symbol',
        'listClientOrderId' => 'listClientOrderId',
        'side' => 'side',
        'quantity' => 'quantity',
        'aboveType' => 'aboveType',
        'aboveClientOrderId' => 'aboveClientOrderId',
        'aboveIcebergQty' => 'aboveIcebergQty',
        'abovePrice' => 'abovePrice',
        'aboveStopPrice' => 'aboveStopPrice',
        'aboveTrailingDelta' => 'aboveTrailingDelta',
        'aboveTimeInForce' => 'aboveTimeInForce',
        'aboveStrategyId' => 'aboveStrategyId',
        'aboveStrategyType' => 'aboveStrategyType',
        'belowType' => 'belowType',
        'belowClientOrderId' => 'belowClientOrderId',
        'belowIcebergQty' => 'belowIcebergQty',
        'belowPrice' => 'belowPrice',
        'belowStopPrice' => 'belowStopPrice',
        'belowTrailingDelta' => 'belowTrailingDelta',
        'belowTimeInForce' => 'belowTimeInForce',
        'belowStrategyId' => 'belowStrategyId',
        'belowStrategyType' => 'belowStrategyType',
        'newOrderRespType' => 'newOrderRespType',
        'selfTradePreventionMode' => 'selfTradePreventionMode',
        'recvWindow' => 'recvWindow',
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     *
     * @var string[]
     */
    protected static $setters = [
        'symbol' => 'setSymbol',
        'listClientOrderId' => 'setListClientOrderId',
        'side' => 'setSide',
        'quantity' => 'setQuantity',
        'aboveType' => 'setAboveType',
        'aboveClientOrderId' => 'setAboveClientOrderId',
        'aboveIcebergQty' => 'setAboveIcebergQty',
        'abovePrice' => 'setAbovePrice',
        'aboveStopPrice' => 'setAboveStopPrice',
        'aboveTrailingDelta' => 'setAboveTrailingDelta',
        'aboveTimeInForce' => 'setAboveTimeInForce',
        'aboveStrategyId' => 'setAboveStrategyId',
        'aboveStrategyType' => 'setAboveStrategyType',
        'belowType' => 'setBelowType',
        'belowClientOrderId' => 'setBelowClientOrderId',
        'belowIcebergQty' => 'setBelowIcebergQty',
        'belowPrice' => 'setBelowPrice',
        'belowStopPrice' => 'setBelowStopPrice',
        'belowTrailingDelta' => 'setBelowTrailingDelta',
        'belowTimeInForce' => 'setBelowTimeInForce',
        'belowStrategyId' => 'setBelowStrategyId',
        'belowStrategyType' => 'setBelowStrategyType',
        'newOrderRespType' => 'setNewOrderRespType',
        'selfTradePreventionMode' => 'setSelfTradePreventionMode',
        'recvWindow' => 'setRecvWindow',
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests).
     *
     * @var string[]
     */
    protected static $getters = [
        'symbol' => 'getSymbol',
        'listClientOrderId' => 'getListClientOrderId',
        'side' => 'getSide',
        'quantity' => 'getQuantity',
        'aboveType' => 'getAboveType',
        'aboveClientOrderId' => 'getAboveClientOrderId',
        'aboveIcebergQty' => 'getAboveIcebergQty',
        'abovePrice' => 'getAbovePrice',
        'aboveStopPrice' => 'getAboveStopPrice',
        'aboveTrailingDelta' => 'getAboveTrailingDelta',
        'aboveTimeInForce' => 'getAboveTimeInForce',
        'aboveStrategyId' => 'getAboveStrategyId',
        'aboveStrategyType' => 'getAboveStrategyType',
        'belowType' => 'getBelowType',
        'belowClientOrderId' => 'getBelowClientOrderId',
        'belowIcebergQty' => 'getBelowIcebergQty',
        'belowPrice' => 'getBelowPrice',
        'belowStopPrice' => 'getBelowStopPrice',
        'belowTrailingDelta' => 'getBelowTrailingDelta',
        'belowTimeInForce' => 'getBelowTimeInForce',
        'belowStrategyId' => 'getBelowStrategyId',
        'belowStrategyType' => 'getBelowStrategyType',
        'newOrderRespType' => 'getNewOrderRespType',
        'selfTradePreventionMode' => 'getSelfTradePreventionMode',
        'recvWindow' => 'getRecvWindow',
    ];

    /**
     * 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('symbol', $data ?? [], null);
        $this->setIfExists('listClientOrderId', $data ?? [], null);
        $this->setIfExists('side', $data ?? [], null);
        $this->setIfExists('quantity', $data ?? [], null);
        $this->setIfExists('aboveType', $data ?? [], null);
        $this->setIfExists('aboveClientOrderId', $data ?? [], null);
        $this->setIfExists('aboveIcebergQty', $data ?? [], null);
        $this->setIfExists('abovePrice', $data ?? [], null);
        $this->setIfExists('aboveStopPrice', $data ?? [], null);
        $this->setIfExists('aboveTrailingDelta', $data ?? [], null);
        $this->setIfExists('aboveTimeInForce', $data ?? [], null);
        $this->setIfExists('aboveStrategyId', $data ?? [], null);
        $this->setIfExists('aboveStrategyType', $data ?? [], null);
        $this->setIfExists('belowType', $data ?? [], null);
        $this->setIfExists('belowClientOrderId', $data ?? [], null);
        $this->setIfExists('belowIcebergQty', $data ?? [], null);
        $this->setIfExists('belowPrice', $data ?? [], null);
        $this->setIfExists('belowStopPrice', $data ?? [], null);
        $this->setIfExists('belowTrailingDelta', $data ?? [], null);
        $this->setIfExists('belowTimeInForce', $data ?? [], null);
        $this->setIfExists('belowStrategyId', $data ?? [], null);
        $this->setIfExists('belowStrategyType', $data ?? [], null);
        $this->setIfExists('newOrderRespType', $data ?? [], null);
        $this->setIfExists('selfTradePreventionMode', $data ?? [], null);
        $this->setIfExists('recvWindow', $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()
    {
        $invalidProperties = [];

        if (null === $this->container['symbol']) {
            $invalidProperties[] = "'symbol' can't be null";
        }
        if (null === $this->container['side']) {
            $invalidProperties[] = "'side' can't be null";
        }
        if (null === $this->container['quantity']) {
            $invalidProperties[] = "'quantity' can't be null";
        }
        if (null === $this->container['aboveType']) {
            $invalidProperties[] = "'aboveType' can't be null";
        }
        if (null === $this->container['belowType']) {
            $invalidProperties[] = "'belowType' 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 0 === count($this->listInvalidProperties());
    }

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

    /**
     * Sets symbol.
     *
     * @param 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 listClientOrderId.
     *
     * @return null|string
     */
    public function getListClientOrderId()
    {
        return $this->container['listClientOrderId'];
    }

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

        return $this;
    }

    /**
     * Gets side.
     *
     * @return Side
     */
    public function getSide()
    {
        return $this->container['side'];
    }

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

        return $this;
    }

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

    /**
     * Sets quantity.
     *
     * @param float $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 aboveType.
     *
     * @return AboveType
     */
    public function getAboveType()
    {
        return $this->container['aboveType'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets belowType.
     *
     * @return BelowType
     */
    public function getBelowType()
    {
        return $this->container['belowType'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets belowTimeInForce.
     *
     * @return null|BelowTimeInForce
     */
    public function getBelowTimeInForce()
    {
        return $this->container['belowTimeInForce'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets newOrderRespType.
     *
     * @return null|NewOrderRespType
     */
    public function getNewOrderRespType()
    {
        return $this->container['newOrderRespType'];
    }

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

        return $this;
    }

    /**
     * Gets selfTradePreventionMode.
     *
     * @return null|SelfTradePreventionMode
     */
    public function getSelfTradePreventionMode()
    {
        return $this->container['selfTradePreventionMode'];
    }

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

        return $this;
    }

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

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

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