<?php
/**
 * AssetsConfig
 *
 * PHP version 5
 *
 * @category Class
 * @package  Swagger\Client
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * BitMEX API
 *
 * ## REST API for the BitMEX Trading Platform  _If you are building automated tools, please subscribe to the_ _[BitMEX API RSS Feed](https://blog.bitmex.com/api_announcement/feed/) for changes. The feed will be updated_ _regularly and is the most reliable way to get downtime and update announcements._  [View Changelog](/app/apiChangelog)  -  #### Getting Started  Base URI: [https://www.bitmex.com/api/v1](/api/v1)  ##### Fetching Data  All REST endpoints are documented below. You can try out any query right from this interface.  Most table queries accept `count`, `start`, and `reverse` params. Set `reverse=true` to get rows newest-first.  Additional documentation regarding filters, timestamps, and authentication is available in [the main API documentation](/app/restAPI).  _All_ table data is available via the [Websocket](/app/wsAPI). We highly recommend using the socket if you want to have the quickest possible data without being subject to ratelimits.  ##### Return Types  By default, all data is returned as JSON. Send `?_format=csv` to get CSV data or `?_format=xml` to get XML data.  ##### Trade Data Queries  _This is only a small subset of what is available, to get you started._  Fill in the parameters and click the `Try it out!` button to try any of these queries.  - [Pricing Data](#!/Quote/Quote_get)  - [Trade Data](#!/Trade/Trade_get)  - [OrderBook Data](#!/OrderBook/OrderBook_getL2)  - [Settlement Data](#!/Settlement/Settlement_get)  - [Exchange Statistics](#!/Stats/Stats_history)  Every function of the BitMEX.com platform is exposed here and documented. Many more functions are available.  ##### Swagger Specification  [⇩ Download Swagger JSON](swagger.json)  -  ## All API Endpoints  Click to expand a section.
 *
 * OpenAPI spec version: 1.2.0
 * Contact: support@bitmex.com
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 * Swagger Codegen version: 2.4.42-SNAPSHOT
 */

/**
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */

namespace Swagger\Client\Model;

use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;

/**
 * AssetsConfig Class Doc Comment
 *
 * @category Class
 * @package  Swagger\Client
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class AssetsConfig implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'asset' => 'string',
        'currency' => 'string',
        'major_currency' => 'string',
        'name' => 'string',
        'currency_type' => 'string',
        'scale' => 'double',
        'enabled' => 'bool',
        'is_margin_currency' => 'bool',
        'memo_required' => 'bool',
        'networks' => '\Swagger\Client\Model\AssetsConfigNetworkItem[]'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'asset' => null,
        'currency' => null,
        'major_currency' => null,
        'name' => null,
        'currency_type' => null,
        'scale' => 'double',
        'enabled' => null,
        'is_margin_currency' => null,
        'memo_required' => null,
        'networks' => null
    ];

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

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

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'asset' => 'asset',
        'currency' => 'currency',
        'major_currency' => 'majorCurrency',
        'name' => 'name',
        'currency_type' => 'currencyType',
        'scale' => 'scale',
        'enabled' => 'enabled',
        'is_margin_currency' => 'isMarginCurrency',
        'memo_required' => 'memoRequired',
        'networks' => 'networks'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'asset' => 'setAsset',
        'currency' => 'setCurrency',
        'major_currency' => 'setMajorCurrency',
        'name' => 'setName',
        'currency_type' => 'setCurrencyType',
        'scale' => 'setScale',
        'enabled' => 'setEnabled',
        'is_margin_currency' => 'setIsMarginCurrency',
        'memo_required' => 'setMemoRequired',
        'networks' => 'setNetworks'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'asset' => 'getAsset',
        'currency' => 'getCurrency',
        'major_currency' => 'getMajorCurrency',
        'name' => 'getName',
        'currency_type' => 'getCurrencyType',
        'scale' => 'getScale',
        'enabled' => 'getEnabled',
        'is_margin_currency' => 'getIsMarginCurrency',
        'memo_required' => 'getMemoRequired',
        'networks' => 'getNetworks'
    ];

    /**
     * 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::$swaggerModelName;
    }

    

    

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

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['asset'] = isset($data['asset']) ? $data['asset'] : 'XBT';
        $this->container['currency'] = isset($data['currency']) ? $data['currency'] : 'XBt';
        $this->container['major_currency'] = isset($data['major_currency']) ? $data['major_currency'] : 'XBT';
        $this->container['name'] = isset($data['name']) ? $data['name'] : 'Bitcoin';
        $this->container['currency_type'] = isset($data['currency_type']) ? $data['currency_type'] : 'Crypto';
        $this->container['scale'] = isset($data['scale']) ? $data['scale'] : 8.0;
        $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : true;
        $this->container['is_margin_currency'] = isset($data['is_margin_currency']) ? $data['is_margin_currency'] : true;
        $this->container['memo_required'] = isset($data['memo_required']) ? $data['memo_required'] : false;
        $this->container['networks'] = isset($data['networks']) ? $data['networks'] : null;
    }

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

        if ($this->container['asset'] === null) {
            $invalidProperties[] = "'asset' 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 count($this->listInvalidProperties()) === 0;
    }


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

    /**
     * Sets asset
     *
     * @param string $asset asset
     *
     * @return $this
     */
    public function setAsset($asset)
    {
        $this->container['asset'] = $asset;

        return $this;
    }

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

    /**
     * Sets currency
     *
     * @param string $currency currency
     *
     * @return $this
     */
    public function setCurrency($currency)
    {
        $this->container['currency'] = $currency;

        return $this;
    }

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

    /**
     * Sets major_currency
     *
     * @param string $major_currency major_currency
     *
     * @return $this
     */
    public function setMajorCurrency($major_currency)
    {
        $this->container['major_currency'] = $major_currency;

        return $this;
    }

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

    /**
     * Sets name
     *
     * @param string $name name
     *
     * @return $this
     */
    public function setName($name)
    {
        $this->container['name'] = $name;

        return $this;
    }

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

    /**
     * Sets currency_type
     *
     * @param string $currency_type currency_type
     *
     * @return $this
     */
    public function setCurrencyType($currency_type)
    {
        $this->container['currency_type'] = $currency_type;

        return $this;
    }

    /**
     * Gets scale
     *
     * @return double
     */
    public function getScale()
    {
        return $this->container['scale'];
    }

    /**
     * Sets scale
     *
     * @param double $scale scale
     *
     * @return $this
     */
    public function setScale($scale)
    {
        $this->container['scale'] = $scale;

        return $this;
    }

    /**
     * Gets enabled
     *
     * @return bool
     */
    public function getEnabled()
    {
        return $this->container['enabled'];
    }

    /**
     * Sets enabled
     *
     * @param bool $enabled enabled
     *
     * @return $this
     */
    public function setEnabled($enabled)
    {
        $this->container['enabled'] = $enabled;

        return $this;
    }

    /**
     * Gets is_margin_currency
     *
     * @return bool
     */
    public function getIsMarginCurrency()
    {
        return $this->container['is_margin_currency'];
    }

    /**
     * Sets is_margin_currency
     *
     * @param bool $is_margin_currency is_margin_currency
     *
     * @return $this
     */
    public function setIsMarginCurrency($is_margin_currency)
    {
        $this->container['is_margin_currency'] = $is_margin_currency;

        return $this;
    }

    /**
     * Gets memo_required
     *
     * @return bool
     */
    public function getMemoRequired()
    {
        return $this->container['memo_required'];
    }

    /**
     * Sets memo_required
     *
     * @param bool $memo_required memo_required
     *
     * @return $this
     */
    public function setMemoRequired($memo_required)
    {
        $this->container['memo_required'] = $memo_required;

        return $this;
    }

    /**
     * Gets networks
     *
     * @return \Swagger\Client\Model\AssetsConfigNetworkItem[]
     */
    public function getNetworks()
    {
        return $this->container['networks'];
    }

    /**
     * Sets networks
     *
     * @param \Swagger\Client\Model\AssetsConfigNetworkItem[] $networks networks
     *
     * @return $this
     */
    public function setNetworks($networks)
    {
        $this->container['networks'] = $networks;

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

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

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

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

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}


