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

/**
 * Partscanner API
 *
 * This is a partscanner API
 *
 * OpenAPI spec version: 1.0.0
 * Contact: info@studio-7.ru
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 * Swagger Codegen version: 3.0.32
 */
/**
 * 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 PartScannerClient\Model;

use \ArrayAccess;
use \PartScannerClient\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'id' => 'int',
'name' => 'string',
'native' => 'bool',
'position' => 'int',
'html_sign' => 'string',
'round_price' => 'int',
'displayed' => 'bool',
'iso' => 'string',
'rbk_sync' => 'bool',
'round_mode' => 'string'    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'id' => null,
'name' => null,
'native' => null,
'position' => null,
'html_sign' => null,
'round_price' => null,
'displayed' => null,
'iso' => null,
'rbk_sync' => null,
'round_mode' => 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 = [
        'id' => 'id',
'name' => 'name',
'native' => 'native',
'position' => 'position',
'html_sign' => 'html_sign',
'round_price' => 'round_price',
'displayed' => 'displayed',
'iso' => 'iso',
'rbk_sync' => 'rbk_sync',
'round_mode' => 'round_mode'    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
'name' => 'setName',
'native' => 'setNative',
'position' => 'setPosition',
'html_sign' => 'setHtmlSign',
'round_price' => 'setRoundPrice',
'displayed' => 'setDisplayed',
'iso' => 'setIso',
'rbk_sync' => 'setRbkSync',
'round_mode' => 'setRoundMode'    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
'name' => 'getName',
'native' => 'getNative',
'position' => 'getPosition',
'html_sign' => 'getHtmlSign',
'round_price' => 'getRoundPrice',
'displayed' => 'getDisplayed',
'iso' => 'getIso',
'rbk_sync' => 'getRbkSync',
'round_mode' => 'getRoundMode'    ];

    /**
     * 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['id'] = isset($data['id']) ? $data['id'] : null;
        $this->container['name'] = isset($data['name']) ? $data['name'] : null;
        $this->container['native'] = isset($data['native']) ? $data['native'] : null;
        $this->container['position'] = isset($data['position']) ? $data['position'] : null;
        $this->container['html_sign'] = isset($data['html_sign']) ? $data['html_sign'] : null;
        $this->container['round_price'] = isset($data['round_price']) ? $data['round_price'] : null;
        $this->container['displayed'] = isset($data['displayed']) ? $data['displayed'] : null;
        $this->container['iso'] = isset($data['iso']) ? $data['iso'] : null;
        $this->container['rbk_sync'] = isset($data['rbk_sync']) ? $data['rbk_sync'] : null;
        $this->container['round_mode'] = isset($data['round_mode']) ? $data['round_mode'] : null;
    }

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

        if ($this->container['id'] === null) {
            $invalidProperties[] = "'id' can't be null";
        }
        if ($this->container['name'] === null) {
            $invalidProperties[] = "'name' can't be null";
        }
        if ($this->container['native'] === null) {
            $invalidProperties[] = "'native' can't be null";
        }
        if ($this->container['position'] === null) {
            $invalidProperties[] = "'position' can't be null";
        }
        if ($this->container['html_sign'] === null) {
            $invalidProperties[] = "'html_sign' can't be null";
        }
        if ($this->container['round_price'] === null) {
            $invalidProperties[] = "'round_price' can't be null";
        }
        if ($this->container['displayed'] === null) {
            $invalidProperties[] = "'displayed' can't be null";
        }
        if ($this->container['iso'] === null) {
            $invalidProperties[] = "'iso' can't be null";
        }
        if ($this->container['rbk_sync'] === null) {
            $invalidProperties[] = "'rbk_sync' can't be null";
        }
        if ($this->container['round_mode'] === null) {
            $invalidProperties[] = "'round_mode' 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 id
     *
     * @return int
     */
    public function getId()
    {
        return $this->container['id'];
    }

    /**
     * Sets id
     *
     * @param int $id id
     *
     * @return $this
     */
    public function setId($id)
    {
        $this->container['id'] = $id;

        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 native
     *
     * @return bool
     */
    public function getNative()
    {
        return $this->container['native'];
    }

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

        return $this;
    }

    /**
     * Gets position
     *
     * @return int
     */
    public function getPosition()
    {
        return $this->container['position'];
    }

    /**
     * Sets position
     *
     * @param int $position position
     *
     * @return $this
     */
    public function setPosition($position)
    {
        $this->container['position'] = $position;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets round_price
     *
     * @return int
     */
    public function getRoundPrice()
    {
        return $this->container['round_price'];
    }

    /**
     * Sets round_price
     *
     * @param int $round_price round_price
     *
     * @return $this
     */
    public function setRoundPrice($round_price)
    {
        $this->container['round_price'] = $round_price;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    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
     */
    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
     */
    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));
    }
}
