<?php

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

/**
 * Binance Margin Trading REST API.
 *
 * OpenAPI Specification for the Binance Margin Trading 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\MarginTrading\Model;

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

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

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

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $openAPITypes = [
        'symbol' => 'string',
        'isIsolated' => 'string',
        'sideEffectType' => 'string',
        'autoRepayAtCancel' => 'bool',
        'listClientOrderId' => 'string',
        'newOrderRespType' => '\Binance\Client\MarginTrading\Model\NewOrderRespType',
        'selfTradePreventionMode' => 'string',
        'workingType' => 'string',
        'workingSide' => 'string',
        'workingClientOrderId' => 'string',
        'workingPrice' => 'float',
        'workingQuantity' => 'float',
        'workingIcebergQty' => 'float',
        'workingTimeInForce' => 'string',
        'pendingSide' => 'string',
        'pendingQuantity' => 'float',
        'pendingAboveType' => 'string',
        'pendingAboveClientOrderId' => 'string',
        'pendingAbovePrice' => 'float',
        'pendingAboveStopPrice' => 'float',
        'pendingAboveTrailingDelta' => 'float',
        'pendingAboveIcebergQty' => 'float',
        'pendingAboveTimeInForce' => 'string',
        'pendingBelowType' => 'string',
        'pendingBelowClientOrderId' => 'string',
        'pendingBelowPrice' => 'float',
        'pendingBelowStopPrice' => 'float',
        'pendingBelowTrailingDelta' => 'float',
        'pendingBelowIcebergQty' => 'float',
        'pendingBelowTimeInForce' => '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 = [
        'symbol' => null,
        'isIsolated' => null,
        'sideEffectType' => null,
        'autoRepayAtCancel' => null,
        'listClientOrderId' => null,
        'newOrderRespType' => null,
        'selfTradePreventionMode' => null,
        'workingType' => null,
        'workingSide' => null,
        'workingClientOrderId' => null,
        'workingPrice' => 'float',
        'workingQuantity' => 'float',
        'workingIcebergQty' => 'float',
        'workingTimeInForce' => null,
        'pendingSide' => null,
        'pendingQuantity' => 'float',
        'pendingAboveType' => null,
        'pendingAboveClientOrderId' => null,
        'pendingAbovePrice' => 'float',
        'pendingAboveStopPrice' => 'float',
        'pendingAboveTrailingDelta' => 'float',
        'pendingAboveIcebergQty' => 'float',
        'pendingAboveTimeInForce' => null,
        'pendingBelowType' => null,
        'pendingBelowClientOrderId' => null,
        'pendingBelowPrice' => 'float',
        'pendingBelowStopPrice' => 'float',
        'pendingBelowTrailingDelta' => 'float',
        'pendingBelowIcebergQty' => 'float',
        'pendingBelowTimeInForce' => null,
    ];

    /**
     * Array of nullable properties. Used for (de)serialization.
     *
     * @var bool[]
     */
    protected static array $openAPINullables = [
        'symbol' => false,
        'isIsolated' => false,
        'sideEffectType' => false,
        'autoRepayAtCancel' => false,
        'listClientOrderId' => false,
        'newOrderRespType' => false,
        'selfTradePreventionMode' => false,
        'workingType' => false,
        'workingSide' => false,
        'workingClientOrderId' => false,
        'workingPrice' => false,
        'workingQuantity' => false,
        'workingIcebergQty' => false,
        'workingTimeInForce' => false,
        'pendingSide' => false,
        'pendingQuantity' => false,
        'pendingAboveType' => false,
        'pendingAboveClientOrderId' => false,
        'pendingAbovePrice' => false,
        'pendingAboveStopPrice' => false,
        'pendingAboveTrailingDelta' => false,
        'pendingAboveIcebergQty' => false,
        'pendingAboveTimeInForce' => false,
        'pendingBelowType' => false,
        'pendingBelowClientOrderId' => false,
        'pendingBelowPrice' => false,
        'pendingBelowStopPrice' => false,
        'pendingBelowTrailingDelta' => false,
        'pendingBelowIcebergQty' => false,
        'pendingBelowTimeInForce' => 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',
        'isIsolated' => 'isIsolated',
        'sideEffectType' => 'sideEffectType',
        'autoRepayAtCancel' => 'autoRepayAtCancel',
        'listClientOrderId' => 'listClientOrderId',
        'newOrderRespType' => 'newOrderRespType',
        'selfTradePreventionMode' => 'selfTradePreventionMode',
        'workingType' => 'workingType',
        'workingSide' => 'workingSide',
        'workingClientOrderId' => 'workingClientOrderId',
        'workingPrice' => 'workingPrice',
        'workingQuantity' => 'workingQuantity',
        'workingIcebergQty' => 'workingIcebergQty',
        'workingTimeInForce' => 'workingTimeInForce',
        'pendingSide' => 'pendingSide',
        'pendingQuantity' => 'pendingQuantity',
        'pendingAboveType' => 'pendingAboveType',
        'pendingAboveClientOrderId' => 'pendingAboveClientOrderId',
        'pendingAbovePrice' => 'pendingAbovePrice',
        'pendingAboveStopPrice' => 'pendingAboveStopPrice',
        'pendingAboveTrailingDelta' => 'pendingAboveTrailingDelta',
        'pendingAboveIcebergQty' => 'pendingAboveIcebergQty',
        'pendingAboveTimeInForce' => 'pendingAboveTimeInForce',
        'pendingBelowType' => 'pendingBelowType',
        'pendingBelowClientOrderId' => 'pendingBelowClientOrderId',
        'pendingBelowPrice' => 'pendingBelowPrice',
        'pendingBelowStopPrice' => 'pendingBelowStopPrice',
        'pendingBelowTrailingDelta' => 'pendingBelowTrailingDelta',
        'pendingBelowIcebergQty' => 'pendingBelowIcebergQty',
        'pendingBelowTimeInForce' => 'pendingBelowTimeInForce',
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     *
     * @var string[]
     */
    protected static $setters = [
        'symbol' => 'setSymbol',
        'isIsolated' => 'setIsIsolated',
        'sideEffectType' => 'setSideEffectType',
        'autoRepayAtCancel' => 'setAutoRepayAtCancel',
        'listClientOrderId' => 'setListClientOrderId',
        'newOrderRespType' => 'setNewOrderRespType',
        'selfTradePreventionMode' => 'setSelfTradePreventionMode',
        'workingType' => 'setWorkingType',
        'workingSide' => 'setWorkingSide',
        'workingClientOrderId' => 'setWorkingClientOrderId',
        'workingPrice' => 'setWorkingPrice',
        'workingQuantity' => 'setWorkingQuantity',
        'workingIcebergQty' => 'setWorkingIcebergQty',
        'workingTimeInForce' => 'setWorkingTimeInForce',
        'pendingSide' => 'setPendingSide',
        'pendingQuantity' => 'setPendingQuantity',
        'pendingAboveType' => 'setPendingAboveType',
        'pendingAboveClientOrderId' => 'setPendingAboveClientOrderId',
        'pendingAbovePrice' => 'setPendingAbovePrice',
        'pendingAboveStopPrice' => 'setPendingAboveStopPrice',
        'pendingAboveTrailingDelta' => 'setPendingAboveTrailingDelta',
        'pendingAboveIcebergQty' => 'setPendingAboveIcebergQty',
        'pendingAboveTimeInForce' => 'setPendingAboveTimeInForce',
        'pendingBelowType' => 'setPendingBelowType',
        'pendingBelowClientOrderId' => 'setPendingBelowClientOrderId',
        'pendingBelowPrice' => 'setPendingBelowPrice',
        'pendingBelowStopPrice' => 'setPendingBelowStopPrice',
        'pendingBelowTrailingDelta' => 'setPendingBelowTrailingDelta',
        'pendingBelowIcebergQty' => 'setPendingBelowIcebergQty',
        'pendingBelowTimeInForce' => 'setPendingBelowTimeInForce',
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests).
     *
     * @var string[]
     */
    protected static $getters = [
        'symbol' => 'getSymbol',
        'isIsolated' => 'getIsIsolated',
        'sideEffectType' => 'getSideEffectType',
        'autoRepayAtCancel' => 'getAutoRepayAtCancel',
        'listClientOrderId' => 'getListClientOrderId',
        'newOrderRespType' => 'getNewOrderRespType',
        'selfTradePreventionMode' => 'getSelfTradePreventionMode',
        'workingType' => 'getWorkingType',
        'workingSide' => 'getWorkingSide',
        'workingClientOrderId' => 'getWorkingClientOrderId',
        'workingPrice' => 'getWorkingPrice',
        'workingQuantity' => 'getWorkingQuantity',
        'workingIcebergQty' => 'getWorkingIcebergQty',
        'workingTimeInForce' => 'getWorkingTimeInForce',
        'pendingSide' => 'getPendingSide',
        'pendingQuantity' => 'getPendingQuantity',
        'pendingAboveType' => 'getPendingAboveType',
        'pendingAboveClientOrderId' => 'getPendingAboveClientOrderId',
        'pendingAbovePrice' => 'getPendingAbovePrice',
        'pendingAboveStopPrice' => 'getPendingAboveStopPrice',
        'pendingAboveTrailingDelta' => 'getPendingAboveTrailingDelta',
        'pendingAboveIcebergQty' => 'getPendingAboveIcebergQty',
        'pendingAboveTimeInForce' => 'getPendingAboveTimeInForce',
        'pendingBelowType' => 'getPendingBelowType',
        'pendingBelowClientOrderId' => 'getPendingBelowClientOrderId',
        'pendingBelowPrice' => 'getPendingBelowPrice',
        'pendingBelowStopPrice' => 'getPendingBelowStopPrice',
        'pendingBelowTrailingDelta' => 'getPendingBelowTrailingDelta',
        'pendingBelowIcebergQty' => 'getPendingBelowIcebergQty',
        'pendingBelowTimeInForce' => 'getPendingBelowTimeInForce',
    ];

    /**
     * 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('isIsolated', $data ?? [], null);
        $this->setIfExists('sideEffectType', $data ?? [], null);
        $this->setIfExists('autoRepayAtCancel', $data ?? [], null);
        $this->setIfExists('listClientOrderId', $data ?? [], null);
        $this->setIfExists('newOrderRespType', $data ?? [], null);
        $this->setIfExists('selfTradePreventionMode', $data ?? [], null);
        $this->setIfExists('workingType', $data ?? [], null);
        $this->setIfExists('workingSide', $data ?? [], null);
        $this->setIfExists('workingClientOrderId', $data ?? [], null);
        $this->setIfExists('workingPrice', $data ?? [], null);
        $this->setIfExists('workingQuantity', $data ?? [], null);
        $this->setIfExists('workingIcebergQty', $data ?? [], null);
        $this->setIfExists('workingTimeInForce', $data ?? [], null);
        $this->setIfExists('pendingSide', $data ?? [], null);
        $this->setIfExists('pendingQuantity', $data ?? [], null);
        $this->setIfExists('pendingAboveType', $data ?? [], null);
        $this->setIfExists('pendingAboveClientOrderId', $data ?? [], null);
        $this->setIfExists('pendingAbovePrice', $data ?? [], null);
        $this->setIfExists('pendingAboveStopPrice', $data ?? [], null);
        $this->setIfExists('pendingAboveTrailingDelta', $data ?? [], null);
        $this->setIfExists('pendingAboveIcebergQty', $data ?? [], null);
        $this->setIfExists('pendingAboveTimeInForce', $data ?? [], null);
        $this->setIfExists('pendingBelowType', $data ?? [], null);
        $this->setIfExists('pendingBelowClientOrderId', $data ?? [], null);
        $this->setIfExists('pendingBelowPrice', $data ?? [], null);
        $this->setIfExists('pendingBelowStopPrice', $data ?? [], null);
        $this->setIfExists('pendingBelowTrailingDelta', $data ?? [], null);
        $this->setIfExists('pendingBelowIcebergQty', $data ?? [], null);
        $this->setIfExists('pendingBelowTimeInForce', $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['workingType']) {
            $invalidProperties[] = "'workingType' can't be null";
        }
        if (null === $this->container['workingSide']) {
            $invalidProperties[] = "'workingSide' can't be null";
        }
        if (null === $this->container['workingPrice']) {
            $invalidProperties[] = "'workingPrice' can't be null";
        }
        if (null === $this->container['workingQuantity']) {
            $invalidProperties[] = "'workingQuantity' can't be null";
        }
        if (null === $this->container['pendingSide']) {
            $invalidProperties[] = "'pendingSide' can't be null";
        }
        if (null === $this->container['pendingQuantity']) {
            $invalidProperties[] = "'pendingQuantity' can't be null";
        }
        if (null === $this->container['pendingAboveType']) {
            $invalidProperties[] = "'pendingAboveType' 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 isIsolated.
     *
     * @return null|string
     */
    public function getIsIsolated()
    {
        return $this->container['isIsolated'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets autoRepayAtCancel.
     *
     * @return null|bool
     */
    public function getAutoRepayAtCancel()
    {
        return $this->container['autoRepayAtCancel'];
    }

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

        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 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|string
     */
    public function getSelfTradePreventionMode()
    {
        return $this->container['selfTradePreventionMode'];
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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