<?php
/**
 * PriceListPosition
 *
 * 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.40
 */
/**
 * 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;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'id' => 'int',
'article' => 'string',
'brand' => 'string',
'product_name' => 'string',
'provider_price' => 'float',
'remain' => 'string',
'spare_info' => 'string',
'provider_code' => 'string',
'weight' => 'string',
'catalog' => 'string',
'category' => 'string',
'destination' => 'string'    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'id' => null,
'article' => null,
'brand' => null,
'product_name' => null,
'provider_price' => null,
'remain' => null,
'spare_info' => null,
'provider_code' => null,
'weight' => null,
'catalog' => null,
'category' => null,
'destination' => 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',
'article' => 'article',
'brand' => 'brand',
'product_name' => 'productName',
'provider_price' => 'providerPrice',
'remain' => 'remain',
'spare_info' => 'spareInfo',
'provider_code' => 'providerCode',
'weight' => 'weight',
'catalog' => 'catalog',
'category' => 'category',
'destination' => 'destination'    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
'article' => 'setArticle',
'brand' => 'setBrand',
'product_name' => 'setProductName',
'provider_price' => 'setProviderPrice',
'remain' => 'setRemain',
'spare_info' => 'setSpareInfo',
'provider_code' => 'setProviderCode',
'weight' => 'setWeight',
'catalog' => 'setCatalog',
'category' => 'setCategory',
'destination' => 'setDestination'    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
'article' => 'getArticle',
'brand' => 'getBrand',
'product_name' => 'getProductName',
'provider_price' => 'getProviderPrice',
'remain' => 'getRemain',
'spare_info' => 'getSpareInfo',
'provider_code' => 'getProviderCode',
'weight' => 'getWeight',
'catalog' => 'getCatalog',
'category' => 'getCategory',
'destination' => 'getDestination'    ];

    /**
     * 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['article'] = isset($data['article']) ? $data['article'] : null;
        $this->container['brand'] = isset($data['brand']) ? $data['brand'] : null;
        $this->container['product_name'] = isset($data['product_name']) ? $data['product_name'] : null;
        $this->container['provider_price'] = isset($data['provider_price']) ? $data['provider_price'] : null;
        $this->container['remain'] = isset($data['remain']) ? $data['remain'] : null;
        $this->container['spare_info'] = isset($data['spare_info']) ? $data['spare_info'] : null;
        $this->container['provider_code'] = isset($data['provider_code']) ? $data['provider_code'] : null;
        $this->container['weight'] = isset($data['weight']) ? $data['weight'] : null;
        $this->container['catalog'] = isset($data['catalog']) ? $data['catalog'] : null;
        $this->container['category'] = isset($data['category']) ? $data['category'] : null;
        $this->container['destination'] = isset($data['destination']) ? $data['destination'] : null;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets provider_price
     *
     * @return float
     */
    public function getProviderPrice()
    {
        return $this->container['provider_price'];
    }

    /**
     * Sets provider_price
     *
     * @param float $provider_price provider_price
     *
     * @return $this
     */
    public function setProviderPrice($provider_price)
    {
        $this->container['provider_price'] = $provider_price;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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