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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'id' => 'int',
'name' => 'string',
'activated' => 'bool',
'autoload' => 'bool',
'project_name' => 'string',
'provider_id' => 'int',
'autoload_settings' => '\PartScannerClient\Model\AssortmentAutoloadSettings',
'count_prices' => 'int',
'count_positions' => 'int',
'assortment_type' => 'int',
'pricelists' => '\PartScannerClient\Model\InlineResponse2008',
'provider' => '\PartScannerClient\Model\InlineResponse2007'    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'id' => null,
'name' => null,
'activated' => null,
'autoload' => null,
'project_name' => null,
'provider_id' => null,
'autoload_settings' => null,
'count_prices' => null,
'count_positions' => null,
'assortment_type' => null,
'pricelists' => null,
'provider' => 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',
'activated' => 'activated',
'autoload' => 'autoload',
'project_name' => 'projectName',
'provider_id' => 'providerId',
'autoload_settings' => 'autoloadSettings',
'count_prices' => 'countPrices',
'count_positions' => 'countPositions',
'assortment_type' => 'assortmentType',
'pricelists' => 'pricelists',
'provider' => 'provider'    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
'name' => 'setName',
'activated' => 'setActivated',
'autoload' => 'setAutoload',
'project_name' => 'setProjectName',
'provider_id' => 'setProviderId',
'autoload_settings' => 'setAutoloadSettings',
'count_prices' => 'setCountPrices',
'count_positions' => 'setCountPositions',
'assortment_type' => 'setAssortmentType',
'pricelists' => 'setPricelists',
'provider' => 'setProvider'    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
'name' => 'getName',
'activated' => 'getActivated',
'autoload' => 'getAutoload',
'project_name' => 'getProjectName',
'provider_id' => 'getProviderId',
'autoload_settings' => 'getAutoloadSettings',
'count_prices' => 'getCountPrices',
'count_positions' => 'getCountPositions',
'assortment_type' => 'getAssortmentType',
'pricelists' => 'getPricelists',
'provider' => 'getProvider'    ];

    /**
     * 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['activated'] = isset($data['activated']) ? $data['activated'] : null;
        $this->container['autoload'] = isset($data['autoload']) ? $data['autoload'] : null;
        $this->container['project_name'] = isset($data['project_name']) ? $data['project_name'] : null;
        $this->container['provider_id'] = isset($data['provider_id']) ? $data['provider_id'] : null;
        $this->container['autoload_settings'] = isset($data['autoload_settings']) ? $data['autoload_settings'] : null;
        $this->container['count_prices'] = isset($data['count_prices']) ? $data['count_prices'] : null;
        $this->container['count_positions'] = isset($data['count_positions']) ? $data['count_positions'] : null;
        $this->container['assortment_type'] = isset($data['assortment_type']) ? $data['assortment_type'] : null;
        $this->container['pricelists'] = isset($data['pricelists']) ? $data['pricelists'] : null;
        $this->container['provider'] = isset($data['provider']) ? $data['provider'] : 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['activated'] === null) {
            $invalidProperties[] = "'activated' can't be null";
        }
        if ($this->container['autoload'] === null) {
            $invalidProperties[] = "'autoload' can't be null";
        }
        if ($this->container['project_name'] === null) {
            $invalidProperties[] = "'project_name' can't be null";
        }
        if ($this->container['provider_id'] === null) {
            $invalidProperties[] = "'provider_id' can't be null";
        }
        if ($this->container['autoload_settings'] === null) {
            $invalidProperties[] = "'autoload_settings' can't be null";
        }
        if ($this->container['count_prices'] === null) {
            $invalidProperties[] = "'count_prices' can't be null";
        }
        if ($this->container['count_positions'] === null) {
            $invalidProperties[] = "'count_positions' can't be null";
        }
        if ($this->container['assortment_type'] === null) {
            $invalidProperties[] = "'assortment_type' 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 activated
     *
     * @return bool
     */
    public function getActivated()
    {
        return $this->container['activated'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets autoload_settings
     *
     * @return \PartScannerClient\Model\AssortmentAutoloadSettings
     */
    public function getAutoloadSettings()
    {
        return $this->container['autoload_settings'];
    }

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

        return $this;
    }

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

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

        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 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 pricelists
     *
     * @return \PartScannerClient\Model\InlineResponse2008
     */
    public function getPricelists()
    {
        return $this->container['pricelists'];
    }

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

        return $this;
    }

    /**
     * Gets provider
     *
     * @return \PartScannerClient\Model\InlineResponse2007
     */
    public function getProvider()
    {
        return $this->container['provider'];
    }

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

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