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

/**
 * FX Historical REST API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1
 * Contact: support@apibricks.io
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.14.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 OpenAPI\Client\Model;

use \ArrayAccess;
use \OpenAPI\Client\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'asset_id' => 'string',
        'name' => 'string',
        'type_is_crypto' => 'int',
        'data_quote_start' => '\DateTime',
        'data_quote_end' => '\DateTime',
        'data_orderbook_start' => '\DateTime',
        'data_orderbook_end' => '\DateTime',
        'data_trade_start' => '\DateTime',
        'data_trade_end' => '\DateTime',
        'data_symbols_count' => 'int',
        'volume_1hrs_usd' => 'float',
        'volume_1day_usd' => 'float',
        'volume_1mth_usd' => 'float',
        'price_usd' => 'float',
        'id_icon' => 'string',
        'supply_current' => 'float',
        'supply_total' => 'float',
        'supply_max' => 'float',
        'chain_addresses' => '\OpenAPI\Client\Model\V1ChainNetworkAddress[]',
        'data_start' => 'string',
        'data_end' => '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 = [
        'asset_id' => null,
        'name' => null,
        'type_is_crypto' => 'int32',
        'data_quote_start' => 'date-time',
        'data_quote_end' => 'date-time',
        'data_orderbook_start' => 'date-time',
        'data_orderbook_end' => 'date-time',
        'data_trade_start' => 'date-time',
        'data_trade_end' => 'date-time',
        'data_symbols_count' => 'int64',
        'volume_1hrs_usd' => 'double',
        'volume_1day_usd' => 'double',
        'volume_1mth_usd' => 'double',
        'price_usd' => 'double',
        'id_icon' => 'uuid',
        'supply_current' => 'double',
        'supply_total' => 'double',
        'supply_max' => 'double',
        'chain_addresses' => null,
        'data_start' => null,
        'data_end' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'asset_id' => true,
        'name' => true,
        'type_is_crypto' => false,
        'data_quote_start' => true,
        'data_quote_end' => true,
        'data_orderbook_start' => true,
        'data_orderbook_end' => true,
        'data_trade_start' => true,
        'data_trade_end' => true,
        'data_symbols_count' => true,
        'volume_1hrs_usd' => true,
        'volume_1day_usd' => true,
        'volume_1mth_usd' => true,
        'price_usd' => true,
        'id_icon' => true,
        'supply_current' => true,
        'supply_total' => true,
        'supply_max' => true,
        'chain_addresses' => true,
        'data_start' => true,
        'data_end' => true
    ];

    /**
      * If a nullable field gets set to null, insert it here
      *
      * @var boolean[]
      */
    protected array $openAPINullablesSetToNull = [];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPITypes()
    {
        return self::$openAPITypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPIFormats()
    {
        return self::$openAPIFormats;
    }

    /**
     * Array of nullable properties
     *
     * @return array
     */
    protected static function openAPINullables(): array
    {
        return self::$openAPINullables;
    }

    /**
     * Array of nullable field names deliberately set to null
     *
     * @return boolean[]
     */
    private function getOpenAPINullablesSetToNull(): array
    {
        return $this->openAPINullablesSetToNull;
    }

    /**
     * Setter - Array of nullable field names deliberately set to null
     *
     * @param boolean[] $openAPINullablesSetToNull
     */
    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
    {
        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
    }

    /**
     * Checks if a property is nullable
     *
     * @param string $property
     * @return bool
     */
    public static function isNullable(string $property): bool
    {
        return self::openAPINullables()[$property] ?? false;
    }

    /**
     * Checks if a nullable property is set to null.
     *
     * @param string $property
     * @return bool
     */
    public function isNullableSetToNull(string $property): bool
    {
        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'asset_id' => 'asset_id',
        'name' => 'name',
        'type_is_crypto' => 'type_is_crypto',
        'data_quote_start' => 'data_quote_start',
        'data_quote_end' => 'data_quote_end',
        'data_orderbook_start' => 'data_orderbook_start',
        'data_orderbook_end' => 'data_orderbook_end',
        'data_trade_start' => 'data_trade_start',
        'data_trade_end' => 'data_trade_end',
        'data_symbols_count' => 'data_symbols_count',
        'volume_1hrs_usd' => 'volume_1hrs_usd',
        'volume_1day_usd' => 'volume_1day_usd',
        'volume_1mth_usd' => 'volume_1mth_usd',
        'price_usd' => 'price_usd',
        'id_icon' => 'id_icon',
        'supply_current' => 'supply_current',
        'supply_total' => 'supply_total',
        'supply_max' => 'supply_max',
        'chain_addresses' => 'chain_addresses',
        'data_start' => 'data_start',
        'data_end' => 'data_end'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'asset_id' => 'setAssetId',
        'name' => 'setName',
        'type_is_crypto' => 'setTypeIsCrypto',
        'data_quote_start' => 'setDataQuoteStart',
        'data_quote_end' => 'setDataQuoteEnd',
        'data_orderbook_start' => 'setDataOrderbookStart',
        'data_orderbook_end' => 'setDataOrderbookEnd',
        'data_trade_start' => 'setDataTradeStart',
        'data_trade_end' => 'setDataTradeEnd',
        'data_symbols_count' => 'setDataSymbolsCount',
        'volume_1hrs_usd' => 'setVolume1hrsUsd',
        'volume_1day_usd' => 'setVolume1dayUsd',
        'volume_1mth_usd' => 'setVolume1mthUsd',
        'price_usd' => 'setPriceUsd',
        'id_icon' => 'setIdIcon',
        'supply_current' => 'setSupplyCurrent',
        'supply_total' => 'setSupplyTotal',
        'supply_max' => 'setSupplyMax',
        'chain_addresses' => 'setChainAddresses',
        'data_start' => 'setDataStart',
        'data_end' => 'setDataEnd'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'asset_id' => 'getAssetId',
        'name' => 'getName',
        'type_is_crypto' => 'getTypeIsCrypto',
        'data_quote_start' => 'getDataQuoteStart',
        'data_quote_end' => 'getDataQuoteEnd',
        'data_orderbook_start' => 'getDataOrderbookStart',
        'data_orderbook_end' => 'getDataOrderbookEnd',
        'data_trade_start' => 'getDataTradeStart',
        'data_trade_end' => 'getDataTradeEnd',
        'data_symbols_count' => 'getDataSymbolsCount',
        'volume_1hrs_usd' => 'getVolume1hrsUsd',
        'volume_1day_usd' => 'getVolume1dayUsd',
        'volume_1mth_usd' => 'getVolume1mthUsd',
        'price_usd' => 'getPriceUsd',
        'id_icon' => 'getIdIcon',
        'supply_current' => 'getSupplyCurrent',
        'supply_total' => 'getSupplyTotal',
        'supply_max' => 'getSupplyMax',
        'chain_addresses' => 'getChainAddresses',
        'data_start' => 'getDataStart',
        'data_end' => 'getDataEnd'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$openAPIModelName;
    }


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

    /**
     * Constructor
     *
     * @param mixed[]|null $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('asset_id', $data ?? [], null);
        $this->setIfExists('name', $data ?? [], null);
        $this->setIfExists('type_is_crypto', $data ?? [], null);
        $this->setIfExists('data_quote_start', $data ?? [], null);
        $this->setIfExists('data_quote_end', $data ?? [], null);
        $this->setIfExists('data_orderbook_start', $data ?? [], null);
        $this->setIfExists('data_orderbook_end', $data ?? [], null);
        $this->setIfExists('data_trade_start', $data ?? [], null);
        $this->setIfExists('data_trade_end', $data ?? [], null);
        $this->setIfExists('data_symbols_count', $data ?? [], null);
        $this->setIfExists('volume_1hrs_usd', $data ?? [], null);
        $this->setIfExists('volume_1day_usd', $data ?? [], null);
        $this->setIfExists('volume_1mth_usd', $data ?? [], null);
        $this->setIfExists('price_usd', $data ?? [], null);
        $this->setIfExists('id_icon', $data ?? [], null);
        $this->setIfExists('supply_current', $data ?? [], null);
        $this->setIfExists('supply_total', $data ?? [], null);
        $this->setIfExists('supply_max', $data ?? [], null);
        $this->setIfExists('chain_addresses', $data ?? [], null);
        $this->setIfExists('data_start', $data ?? [], null);
        $this->setIfExists('data_end', $data ?? [], null);
    }

    /**
    * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
    * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
    * $this->openAPINullablesSetToNull array
    *
    * @param string $variableName
    * @param array  $fields
    * @param mixed  $defaultValue
    */
    private function setIfExists(string $variableName, array $fields, $defaultValue): void
    {
        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
            $this->openAPINullablesSetToNull[] = $variableName;
        }

        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


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

    /**
     * Sets asset_id
     *
     * @param string|null $asset_id Gets or sets the asset ID.
     *
     * @return self
     */
    public function setAssetId($asset_id)
    {
        if (is_null($asset_id)) {
            array_push($this->openAPINullablesSetToNull, 'asset_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('asset_id', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['asset_id'] = $asset_id;

        return $this;
    }

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

    /**
     * Sets name
     *
     * @param string|null $name Gets or sets the name of the asset.
     *
     * @return self
     */
    public function setName($name)
    {
        if (is_null($name)) {
            array_push($this->openAPINullablesSetToNull, 'name');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('name', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['name'] = $name;

        return $this;
    }

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

    /**
     * Sets type_is_crypto
     *
     * @param int|null $type_is_crypto Gets or sets a value indicating whether the asset is a cryptocurrency.
     *
     * @return self
     */
    public function setTypeIsCrypto($type_is_crypto)
    {
        if (is_null($type_is_crypto)) {
            throw new \InvalidArgumentException('non-nullable type_is_crypto cannot be null');
        }
        $this->container['type_is_crypto'] = $type_is_crypto;

        return $this;
    }

    /**
     * Gets data_quote_start
     *
     * @return \DateTime|null
     */
    public function getDataQuoteStart()
    {
        return $this->container['data_quote_start'];
    }

    /**
     * Sets data_quote_start
     *
     * @param \DateTime|null $data_quote_start Gets or sets the start date of quote data.
     *
     * @return self
     */
    public function setDataQuoteStart($data_quote_start)
    {
        if (is_null($data_quote_start)) {
            array_push($this->openAPINullablesSetToNull, 'data_quote_start');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('data_quote_start', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['data_quote_start'] = $data_quote_start;

        return $this;
    }

    /**
     * Gets data_quote_end
     *
     * @return \DateTime|null
     */
    public function getDataQuoteEnd()
    {
        return $this->container['data_quote_end'];
    }

    /**
     * Sets data_quote_end
     *
     * @param \DateTime|null $data_quote_end Gets or sets the end date of quote data.
     *
     * @return self
     */
    public function setDataQuoteEnd($data_quote_end)
    {
        if (is_null($data_quote_end)) {
            array_push($this->openAPINullablesSetToNull, 'data_quote_end');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('data_quote_end', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['data_quote_end'] = $data_quote_end;

        return $this;
    }

    /**
     * Gets data_orderbook_start
     *
     * @return \DateTime|null
     */
    public function getDataOrderbookStart()
    {
        return $this->container['data_orderbook_start'];
    }

    /**
     * Sets data_orderbook_start
     *
     * @param \DateTime|null $data_orderbook_start Gets or sets the start date of order book data.
     *
     * @return self
     */
    public function setDataOrderbookStart($data_orderbook_start)
    {
        if (is_null($data_orderbook_start)) {
            array_push($this->openAPINullablesSetToNull, 'data_orderbook_start');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('data_orderbook_start', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['data_orderbook_start'] = $data_orderbook_start;

        return $this;
    }

    /**
     * Gets data_orderbook_end
     *
     * @return \DateTime|null
     */
    public function getDataOrderbookEnd()
    {
        return $this->container['data_orderbook_end'];
    }

    /**
     * Sets data_orderbook_end
     *
     * @param \DateTime|null $data_orderbook_end Gets or sets the end date of order book data.
     *
     * @return self
     */
    public function setDataOrderbookEnd($data_orderbook_end)
    {
        if (is_null($data_orderbook_end)) {
            array_push($this->openAPINullablesSetToNull, 'data_orderbook_end');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('data_orderbook_end', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['data_orderbook_end'] = $data_orderbook_end;

        return $this;
    }

    /**
     * Gets data_trade_start
     *
     * @return \DateTime|null
     */
    public function getDataTradeStart()
    {
        return $this->container['data_trade_start'];
    }

    /**
     * Sets data_trade_start
     *
     * @param \DateTime|null $data_trade_start Gets or sets the start date of trade data.
     *
     * @return self
     */
    public function setDataTradeStart($data_trade_start)
    {
        if (is_null($data_trade_start)) {
            array_push($this->openAPINullablesSetToNull, 'data_trade_start');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('data_trade_start', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['data_trade_start'] = $data_trade_start;

        return $this;
    }

    /**
     * Gets data_trade_end
     *
     * @return \DateTime|null
     */
    public function getDataTradeEnd()
    {
        return $this->container['data_trade_end'];
    }

    /**
     * Sets data_trade_end
     *
     * @param \DateTime|null $data_trade_end Gets or sets the end date of trade data.
     *
     * @return self
     */
    public function setDataTradeEnd($data_trade_end)
    {
        if (is_null($data_trade_end)) {
            array_push($this->openAPINullablesSetToNull, 'data_trade_end');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('data_trade_end', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['data_trade_end'] = $data_trade_end;

        return $this;
    }

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

    /**
     * Sets data_symbols_count
     *
     * @param int|null $data_symbols_count Gets or sets the number of symbols.
     *
     * @return self
     */
    public function setDataSymbolsCount($data_symbols_count)
    {
        if (is_null($data_symbols_count)) {
            array_push($this->openAPINullablesSetToNull, 'data_symbols_count');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('data_symbols_count', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['data_symbols_count'] = $data_symbols_count;

        return $this;
    }

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

    /**
     * Sets volume_1hrs_usd
     *
     * @param float|null $volume_1hrs_usd Gets or sets the USD volume in the last 1 hour.
     *
     * @return self
     */
    public function setVolume1hrsUsd($volume_1hrs_usd)
    {
        if (is_null($volume_1hrs_usd)) {
            array_push($this->openAPINullablesSetToNull, 'volume_1hrs_usd');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('volume_1hrs_usd', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['volume_1hrs_usd'] = $volume_1hrs_usd;

        return $this;
    }

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

    /**
     * Sets volume_1day_usd
     *
     * @param float|null $volume_1day_usd Gets or sets the USD volume in the last 1 day.
     *
     * @return self
     */
    public function setVolume1dayUsd($volume_1day_usd)
    {
        if (is_null($volume_1day_usd)) {
            array_push($this->openAPINullablesSetToNull, 'volume_1day_usd');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('volume_1day_usd', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['volume_1day_usd'] = $volume_1day_usd;

        return $this;
    }

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

    /**
     * Sets volume_1mth_usd
     *
     * @param float|null $volume_1mth_usd Gets or sets the USD volume in the last 1 month.
     *
     * @return self
     */
    public function setVolume1mthUsd($volume_1mth_usd)
    {
        if (is_null($volume_1mth_usd)) {
            array_push($this->openAPINullablesSetToNull, 'volume_1mth_usd');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('volume_1mth_usd', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['volume_1mth_usd'] = $volume_1mth_usd;

        return $this;
    }

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

    /**
     * Sets price_usd
     *
     * @param float|null $price_usd Gets or sets the USD price of the asset.
     *
     * @return self
     */
    public function setPriceUsd($price_usd)
    {
        if (is_null($price_usd)) {
            array_push($this->openAPINullablesSetToNull, 'price_usd');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('price_usd', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['price_usd'] = $price_usd;

        return $this;
    }

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

    /**
     * Sets id_icon
     *
     * @param string|null $id_icon Gets or sets the ID of the icon for the asset.
     *
     * @return self
     */
    public function setIdIcon($id_icon)
    {
        if (is_null($id_icon)) {
            array_push($this->openAPINullablesSetToNull, 'id_icon');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('id_icon', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['id_icon'] = $id_icon;

        return $this;
    }

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

    /**
     * Sets supply_current
     *
     * @param float|null $supply_current Gets or sets the current supply of the asset.
     *
     * @return self
     */
    public function setSupplyCurrent($supply_current)
    {
        if (is_null($supply_current)) {
            array_push($this->openAPINullablesSetToNull, 'supply_current');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('supply_current', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['supply_current'] = $supply_current;

        return $this;
    }

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

    /**
     * Sets supply_total
     *
     * @param float|null $supply_total Gets or sets the total supply of the asset.
     *
     * @return self
     */
    public function setSupplyTotal($supply_total)
    {
        if (is_null($supply_total)) {
            array_push($this->openAPINullablesSetToNull, 'supply_total');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('supply_total', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['supply_total'] = $supply_total;

        return $this;
    }

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

    /**
     * Sets supply_max
     *
     * @param float|null $supply_max Gets or sets the maximum supply of the asset.
     *
     * @return self
     */
    public function setSupplyMax($supply_max)
    {
        if (is_null($supply_max)) {
            array_push($this->openAPINullablesSetToNull, 'supply_max');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('supply_max', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['supply_max'] = $supply_max;

        return $this;
    }

    /**
     * Gets chain_addresses
     *
     * @return \OpenAPI\Client\Model\V1ChainNetworkAddress[]|null
     */
    public function getChainAddresses()
    {
        return $this->container['chain_addresses'];
    }

    /**
     * Sets chain_addresses
     *
     * @param \OpenAPI\Client\Model\V1ChainNetworkAddress[]|null $chain_addresses 
     *
     * @return self
     */
    public function setChainAddresses($chain_addresses)
    {
        if (is_null($chain_addresses)) {
            array_push($this->openAPINullablesSetToNull, 'chain_addresses');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('chain_addresses', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['chain_addresses'] = $chain_addresses;

        return $this;
    }

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

    /**
     * Sets data_start
     *
     * @param string|null $data_start data_start
     *
     * @return self
     */
    public function setDataStart($data_start)
    {
        if (is_null($data_start)) {
            array_push($this->openAPINullablesSetToNull, 'data_start');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('data_start', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['data_start'] = $data_start;

        return $this;
    }

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

    /**
     * Sets data_end
     *
     * @param string|null $data_end data_end
     *
     * @return self
     */
    public function setDataEnd($data_end)
    {
        if (is_null($data_end)) {
            array_push($this->openAPINullablesSetToNull, 'data_end');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('data_end', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['data_end'] = $data_end;

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

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed|null
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return $this->container[$offset] ?? null;
    }

    /**
     * Sets value based on offset.
     *
     * @param int|null $offset Offset
     * @param mixed    $value  Value to be set
     *
     * @return void
     */
    public function offsetSet($offset, $value): void
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    public function offsetUnset($offset): void
    {
        unset($this->container[$offset]);
    }

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed Returns data which can be serialized by json_encode(), which is a value
     * of any type other than a resource.
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
       return ObjectSerializer::sanitizeForSerialization($this);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

    /**
     * Gets a header-safe presentation of the object
     *
     * @return string
     */
    public function toHeaderValue()
    {
        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}


