<?php
/**
 * ProductInEditVii
 *
 * PHP version 7.4
 *
 * @category Class
 * @package  SmartVolution
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * SV Register Web-services
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 4.15
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 6.0.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace SmartVolution\Model;

use \ArrayAccess;
use \SmartVolution\ObjectSerializer;

/**
 * ProductInEditVii Class Doc Comment
 *
 * @category Class
 * @package  SmartVolution
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<TKey, TValue>
 * @template TKey int|null
 * @template TValue mixed|null
 */
class ProductInEditVii implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'id' => 'int',
        'sku' => 'string',
        'barcode' => 'string',
        'name' => 'string',
        'description' => 'string',
        'price' => 'double',
        'prodType' => 'string',
        'image' => 'string',
        'printOnSecondary' => 'bool',
        'extra' => '\SmartVolution\Model\ProductExtraDetailsVii',
        'custom' => '\SmartVolution\Model\ProductCustomDetails',
        'taxes' => 'int[]',
        'departments' => 'int[]',
        'deleted' => 'bool',
        'locked' => 'bool',
        'commissionPercent' => 'double',
        'uomId' => 'int',
        'symbol' => 'string',
        'uomMultiplier' => 'double'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      * @phpstan-var array<string, string|null>
      * @psalm-var array<string, string|null>
      */
    protected static $openAPIFormats = [
        'id' => 'int64',
        'sku' => null,
        'barcode' => null,
        'name' => null,
        'description' => null,
        'price' => 'double',
        'prodType' => null,
        'image' => null,
        'printOnSecondary' => null,
        'extra' => null,
        'custom' => null,
        'taxes' => 'int64',
        'departments' => 'int64',
        'deleted' => null,
        'locked' => null,
        'commissionPercent' => 'double',
        'uomId' => 'int32',
        'symbol' => null,
        'uomMultiplier' => 'double'
    ];

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

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

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'id' => 'id',
        'sku' => 'sku',
        'barcode' => 'barcode',
        'name' => 'name',
        'description' => 'description',
        'price' => 'price',
        'prodType' => 'prodType',
        'image' => 'image',
        'printOnSecondary' => 'printOnSecondary',
        'extra' => 'extra',
        'custom' => 'custom',
        'taxes' => 'taxes',
        'departments' => 'departments',
        'deleted' => 'deleted',
        'locked' => 'locked',
        'commissionPercent' => 'commissionPercent',
        'uomId' => 'uomId',
        'symbol' => 'symbol',
        'uomMultiplier' => 'uomMultiplier'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
        'sku' => 'setSku',
        'barcode' => 'setBarcode',
        'name' => 'setName',
        'description' => 'setDescription',
        'price' => 'setPrice',
        'prodType' => 'setProdType',
        'image' => 'setImage',
        'printOnSecondary' => 'setPrintOnSecondary',
        'extra' => 'setExtra',
        'custom' => 'setCustom',
        'taxes' => 'setTaxes',
        'departments' => 'setDepartments',
        'deleted' => 'setDeleted',
        'locked' => 'setLocked',
        'commissionPercent' => 'setCommissionPercent',
        'uomId' => 'setUomId',
        'symbol' => 'setSymbol',
        'uomMultiplier' => 'setUomMultiplier'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
        'sku' => 'getSku',
        'barcode' => 'getBarcode',
        'name' => 'getName',
        'description' => 'getDescription',
        'price' => 'getPrice',
        'prodType' => 'getProdType',
        'image' => 'getImage',
        'printOnSecondary' => 'getPrintOnSecondary',
        'extra' => 'getExtra',
        'custom' => 'getCustom',
        'taxes' => 'getTaxes',
        'departments' => 'getDepartments',
        'deleted' => 'getDeleted',
        'locked' => 'getLocked',
        'commissionPercent' => 'getCommissionPercent',
        'uomId' => 'getUomId',
        'symbol' => 'getSymbol',
        'uomMultiplier' => 'getUomMultiplier'
    ];

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


    /**
     * 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'] = $data['id'] ?? null;
        $this->container['sku'] = $data['sku'] ?? null;
        $this->container['barcode'] = $data['barcode'] ?? null;
        $this->container['name'] = $data['name'] ?? null;
        $this->container['description'] = $data['description'] ?? null;
        $this->container['price'] = $data['price'] ?? null;
        $this->container['prodType'] = $data['prodType'] ?? null;
        $this->container['image'] = $data['image'] ?? null;
        $this->container['printOnSecondary'] = $data['printOnSecondary'] ?? null;
        $this->container['extra'] = $data['extra'] ?? null;
        $this->container['custom'] = $data['custom'] ?? null;
        $this->container['taxes'] = $data['taxes'] ?? null;
        $this->container['departments'] = $data['departments'] ?? null;
        $this->container['deleted'] = $data['deleted'] ?? null;
        $this->container['locked'] = $data['locked'] ?? null;
        $this->container['commissionPercent'] = $data['commissionPercent'] ?? null;
        $this->container['uomId'] = $data['uomId'] ?? null;
        $this->container['symbol'] = $data['symbol'] ?? null;
        $this->container['uomMultiplier'] = $data['uomMultiplier'] ?? 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|null
     */
    public function getId()
    {
        return $this->container['id'];
    }

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

        return $this;
    }

    /**
     * Gets sku
     *
     * @return string|null
     */
    public function getSku()
    {
        return $this->container['sku'];
    }

    /**
     * Sets sku
     *
     * @param string|null $sku Product SKU
     *
     * @return self
     */
    public function setSku($sku)
    {
        $this->container['sku'] = $sku;

        return $this;
    }

    /**
     * Gets barcode
     *
     * @return string|null
     */
    public function getBarcode()
    {
        return $this->container['barcode'];
    }

    /**
     * Sets barcode
     *
     * @param string|null $barcode Product Barcode
     *
     * @return self
     */
    public function setBarcode($barcode)
    {
        $this->container['barcode'] = $barcode;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets description
     *
     * @return string|null
     */
    public function getDescription()
    {
        return $this->container['description'];
    }

    /**
     * Sets description
     *
     * @param string|null $description Product Description
     *
     * @return self
     */
    public function setDescription($description)
    {
        $this->container['description'] = $description;

        return $this;
    }

    /**
     * Gets price
     *
     * @return double|null
     */
    public function getPrice()
    {
        return $this->container['price'];
    }

    /**
     * Sets price
     *
     * @param double|null $price Product Price
     *
     * @return self
     */
    public function setPrice($price)
    {
        $this->container['price'] = $price;

        return $this;
    }

    /**
     * Gets prodType
     *
     * @return string|null
     */
    public function getProdType()
    {
        return $this->container['prodType'];
    }

    /**
     * Sets prodType
     *
     * @param string|null $prodType The internal type of product
     *
     * @return self
     */
    public function setProdType($prodType)
    {
        $this->container['prodType'] = $prodType;

        return $this;
    }

    /**
     * Gets image
     *
     * @return string|null
     */
    public function getImage()
    {
        return $this->container['image'];
    }

    /**
     * Sets image
     *
     * @param string|null $image Product Image
     *
     * @return self
     */
    public function setImage($image)
    {
        $this->container['image'] = $image;

        return $this;
    }

    /**
     * Gets printOnSecondary
     *
     * @return bool|null
     */
    public function getPrintOnSecondary()
    {
        return $this->container['printOnSecondary'];
    }

    /**
     * Sets printOnSecondary
     *
     * @param bool|null $printOnSecondary The product need to be printed on secondary printer or not
     *
     * @return self
     */
    public function setPrintOnSecondary($printOnSecondary)
    {
        $this->container['printOnSecondary'] = $printOnSecondary;

        return $this;
    }

    /**
     * Gets extra
     *
     * @return \SmartVolution\Model\ProductExtraDetailsVii|null
     */
    public function getExtra()
    {
        return $this->container['extra'];
    }

    /**
     * Sets extra
     *
     * @param \SmartVolution\Model\ProductExtraDetailsVii|null $extra extra
     *
     * @return self
     */
    public function setExtra($extra)
    {
        $this->container['extra'] = $extra;

        return $this;
    }

    /**
     * Gets custom
     *
     * @return \SmartVolution\Model\ProductCustomDetails|null
     */
    public function getCustom()
    {
        return $this->container['custom'];
    }

    /**
     * Sets custom
     *
     * @param \SmartVolution\Model\ProductCustomDetails|null $custom custom
     *
     * @return self
     */
    public function setCustom($custom)
    {
        $this->container['custom'] = $custom;

        return $this;
    }

    /**
     * Gets taxes
     *
     * @return int[]|null
     */
    public function getTaxes()
    {
        return $this->container['taxes'];
    }

    /**
     * Sets taxes
     *
     * @param int[]|null $taxes List of tax Ids to assign to product
     *
     * @return self
     */
    public function setTaxes($taxes)
    {
        $this->container['taxes'] = $taxes;

        return $this;
    }

    /**
     * Gets departments
     *
     * @return int[]|null
     */
    public function getDepartments()
    {
        return $this->container['departments'];
    }

    /**
     * Sets departments
     *
     * @param int[]|null $departments List of department Ids to assign to product
     *
     * @return self
     */
    public function setDepartments($departments)
    {
        $this->container['departments'] = $departments;

        return $this;
    }

    /**
     * Gets deleted
     *
     * @return bool|null
     */
    public function getDeleted()
    {
        return $this->container['deleted'];
    }

    /**
     * Sets deleted
     *
     * @param bool|null $deleted Boolean for whether the product is deleted
     *
     * @return self
     */
    public function setDeleted($deleted)
    {
        $this->container['deleted'] = $deleted;

        return $this;
    }

    /**
     * Gets locked
     *
     * @return bool|null
     */
    public function getLocked()
    {
        return $this->container['locked'];
    }

    /**
     * Sets locked
     *
     * @param bool|null $locked Boolean for whether the product is locked
     *
     * @return self
     */
    public function setLocked($locked)
    {
        $this->container['locked'] = $locked;

        return $this;
    }

    /**
     * Gets commissionPercent
     *
     * @return double|null
     */
    public function getCommissionPercent()
    {
        return $this->container['commissionPercent'];
    }

    /**
     * Sets commissionPercent
     *
     * @param double|null $commissionPercent Product Commission Percent
     *
     * @return self
     */
    public function setCommissionPercent($commissionPercent)
    {
        $this->container['commissionPercent'] = $commissionPercent;

        return $this;
    }

    /**
     * Gets uomId
     *
     * @return int|null
     */
    public function getUomId()
    {
        return $this->container['uomId'];
    }

    /**
     * Sets uomId
     *
     * @param int|null $uomId UOM Id
     *
     * @return self
     */
    public function setUomId($uomId)
    {
        $this->container['uomId'] = $uomId;

        return $this;
    }

    /**
     * Gets symbol
     *
     * @return string|null
     */
    public function getSymbol()
    {
        return $this->container['symbol'];
    }

    /**
     * Sets symbol
     *
     * @param string|null $symbol UOM Symbol
     *
     * @return self
     */
    public function setSymbol($symbol)
    {
        $this->container['symbol'] = $symbol;

        return $this;
    }

    /**
     * Gets uomMultiplier
     *
     * @return double|null
     */
    public function getUomMultiplier()
    {
        return $this->container['uomMultiplier'];
    }

    /**
     * Sets uomMultiplier
     *
     * @param double|null $uomMultiplier UOM Multiplier
     *
     * @return self
     */
    public function setUomMultiplier($uomMultiplier)
    {
        $this->container['uomMultiplier'] = $uomMultiplier;

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

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

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

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

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed Returns data which can be serialized by json_encode(), which is a value
     * of any type other than a resource.
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
       return ObjectSerializer::sanitizeForSerialization($this);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

    /**
     * Gets a header-safe presentation of the object
     *
     * @return string
     */
    public function toHeaderValue()
    {
        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}


