<?php
/**
 * PriceList
 *
 * 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;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'id' => 'int',
'title' => 'string',
'date_update' => '\PartScannerClient\Model\\DateTime',
'price_list_file_name' => 'string',
'currency_id' => 'int',
'currency_name' => 'string',
'assortment_type' => 'int',
'price_upload_status' => 'string',
'count_positions' => 'int',
'price_upload_mode' => '\PartScannerClient\Model\PriceListPriceUploadMode',
'price_upload_settings' => '\PartScannerClient\Model\PriceListPriceUploadSettings',
'marking' => '\PartScannerClient\Model\PriceListMarking',
'file' => '\PartScannerClient\Model\InlineResponse20012'    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'id' => null,
'title' => null,
'date_update' => null,
'price_list_file_name' => null,
'currency_id' => null,
'currency_name' => null,
'assortment_type' => null,
'price_upload_status' => null,
'count_positions' => null,
'price_upload_mode' => null,
'price_upload_settings' => null,
'marking' => null,
'file' => 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',
'title' => 'title',
'date_update' => 'dateUpdate',
'price_list_file_name' => 'priceListFileName',
'currency_id' => 'currencyId',
'currency_name' => 'currencyName',
'assortment_type' => 'assortmentType',
'price_upload_status' => 'priceUploadStatus',
'count_positions' => 'countPositions',
'price_upload_mode' => 'priceUploadMode',
'price_upload_settings' => 'priceUploadSettings',
'marking' => 'marking',
'file' => 'file'    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
'title' => 'setTitle',
'date_update' => 'setDateUpdate',
'price_list_file_name' => 'setPriceListFileName',
'currency_id' => 'setCurrencyId',
'currency_name' => 'setCurrencyName',
'assortment_type' => 'setAssortmentType',
'price_upload_status' => 'setPriceUploadStatus',
'count_positions' => 'setCountPositions',
'price_upload_mode' => 'setPriceUploadMode',
'price_upload_settings' => 'setPriceUploadSettings',
'marking' => 'setMarking',
'file' => 'setFile'    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
'title' => 'getTitle',
'date_update' => 'getDateUpdate',
'price_list_file_name' => 'getPriceListFileName',
'currency_id' => 'getCurrencyId',
'currency_name' => 'getCurrencyName',
'assortment_type' => 'getAssortmentType',
'price_upload_status' => 'getPriceUploadStatus',
'count_positions' => 'getCountPositions',
'price_upload_mode' => 'getPriceUploadMode',
'price_upload_settings' => 'getPriceUploadSettings',
'marking' => 'getMarking',
'file' => 'getFile'    ];

    /**
     * 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['title'] = isset($data['title']) ? $data['title'] : null;
        $this->container['date_update'] = isset($data['date_update']) ? $data['date_update'] : null;
        $this->container['price_list_file_name'] = isset($data['price_list_file_name']) ? $data['price_list_file_name'] : null;
        $this->container['currency_id'] = isset($data['currency_id']) ? $data['currency_id'] : null;
        $this->container['currency_name'] = isset($data['currency_name']) ? $data['currency_name'] : null;
        $this->container['assortment_type'] = isset($data['assortment_type']) ? $data['assortment_type'] : null;
        $this->container['price_upload_status'] = isset($data['price_upload_status']) ? $data['price_upload_status'] : null;
        $this->container['count_positions'] = isset($data['count_positions']) ? $data['count_positions'] : null;
        $this->container['price_upload_mode'] = isset($data['price_upload_mode']) ? $data['price_upload_mode'] : null;
        $this->container['price_upload_settings'] = isset($data['price_upload_settings']) ? $data['price_upload_settings'] : null;
        $this->container['marking'] = isset($data['marking']) ? $data['marking'] : null;
        $this->container['file'] = isset($data['file']) ? $data['file'] : 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['title'] === null) {
            $invalidProperties[] = "'title' can't be null";
        }
        if ($this->container['date_update'] === null) {
            $invalidProperties[] = "'date_update' can't be null";
        }
        if ($this->container['currency_id'] === null) {
            $invalidProperties[] = "'currency_id' can't be null";
        }
        if ($this->container['currency_name'] === null) {
            $invalidProperties[] = "'currency_name' can't be null";
        }
        if ($this->container['assortment_type'] === null) {
            $invalidProperties[] = "'assortment_type' can't be null";
        }
        if ($this->container['count_positions'] === null) {
            $invalidProperties[] = "'count_positions' can't be null";
        }
        if ($this->container['price_upload_mode'] === null) {
            $invalidProperties[] = "'price_upload_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 title
     *
     * @return string
     */
    public function getTitle()
    {
        return $this->container['title'];
    }

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

        return $this;
    }

    /**
     * Gets date_update
     *
     * @return \PartScannerClient\Model\\DateTime
     */
    public function getDateUpdate()
    {
        return $this->container['date_update'];
    }

    /**
     * Sets date_update
     *
     * @param \PartScannerClient\Model\\DateTime $date_update date_update
     *
     * @return $this
     */
    public function setDateUpdate($date_update)
    {
        $this->container['date_update'] = $date_update;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets price_upload_mode
     *
     * @return \PartScannerClient\Model\PriceListPriceUploadMode
     */
    public function getPriceUploadMode()
    {
        return $this->container['price_upload_mode'];
    }

    /**
     * Sets price_upload_mode
     *
     * @param \PartScannerClient\Model\PriceListPriceUploadMode $price_upload_mode price_upload_mode
     *
     * @return $this
     */
    public function setPriceUploadMode($price_upload_mode)
    {
        $this->container['price_upload_mode'] = $price_upload_mode;

        return $this;
    }

    /**
     * Gets price_upload_settings
     *
     * @return \PartScannerClient\Model\PriceListPriceUploadSettings
     */
    public function getPriceUploadSettings()
    {
        return $this->container['price_upload_settings'];
    }

    /**
     * Sets price_upload_settings
     *
     * @param \PartScannerClient\Model\PriceListPriceUploadSettings $price_upload_settings price_upload_settings
     *
     * @return $this
     */
    public function setPriceUploadSettings($price_upload_settings)
    {
        $this->container['price_upload_settings'] = $price_upload_settings;

        return $this;
    }

    /**
     * Gets marking
     *
     * @return \PartScannerClient\Model\PriceListMarking
     */
    public function getMarking()
    {
        return $this->container['marking'];
    }

    /**
     * Sets marking
     *
     * @param \PartScannerClient\Model\PriceListMarking $marking marking
     *
     * @return $this
     */
    public function setMarking($marking)
    {
        $this->container['marking'] = $marking;

        return $this;
    }

    /**
     * Gets file
     *
     * @return \PartScannerClient\Model\InlineResponse20012
     */
    public function getFile()
    {
        return $this->container['file'];
    }

    /**
     * Sets file
     *
     * @param \PartScannerClient\Model\InlineResponse20012 $file file
     *
     * @return $this
     */
    public function setFile($file)
    {
        $this->container['file'] = $file;

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