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

/**
 * ProductModifierProduct 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 ProductModifierProduct implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'id' => 'int',
        'parentProductId' => 'int',
        'childProductId' => 'int',
        'appliedByDefault' => 'bool',
        'defaultQty' => 'double',
        'editable' => 'bool',
        'minQty' => 'double',
        'maxQty' => 'double',
        'displayInJournal' => 'bool',
        'usePricebook' => 'bool',
        'followTransactionPricebook' => 'bool',
        'priceBookId' => 'int',
        'defaultQuantityFreeOfCharge' => 'bool',
        'sortorder' => 'int',
        'modified' => 'int',
        'deleted' => 'bool',
        'locked' => 'bool',
        'childProductName' => 'string',
        'childProductSKU' => 'string',
        'childProductType' => 'string',
        'childProductSymbol' => 'string',
        'childProductUomMultiplier' => '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',
        'parentProductId' => 'int64',
        'childProductId' => 'int64',
        'appliedByDefault' => null,
        'defaultQty' => 'double',
        'editable' => null,
        'minQty' => 'double',
        'maxQty' => 'double',
        'displayInJournal' => null,
        'usePricebook' => null,
        'followTransactionPricebook' => null,
        'priceBookId' => 'int64',
        'defaultQuantityFreeOfCharge' => null,
        'sortorder' => 'int64',
        'modified' => 'int64',
        'deleted' => null,
        'locked' => null,
        'childProductName' => null,
        'childProductSKU' => null,
        'childProductType' => null,
        'childProductSymbol' => null,
        'childProductUomMultiplier' => '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',
        'parentProductId' => 'parentProductId',
        'childProductId' => 'childProductId',
        'appliedByDefault' => 'appliedByDefault',
        'defaultQty' => 'defaultQty',
        'editable' => 'editable',
        'minQty' => 'minQty',
        'maxQty' => 'maxQty',
        'displayInJournal' => 'displayInJournal',
        'usePricebook' => 'usePricebook',
        'followTransactionPricebook' => 'followTransactionPricebook',
        'priceBookId' => 'priceBookId',
        'defaultQuantityFreeOfCharge' => 'defaultQuantityFreeOfCharge',
        'sortorder' => 'sortorder',
        'modified' => 'modified',
        'deleted' => 'deleted',
        'locked' => 'locked',
        'childProductName' => 'childProductName',
        'childProductSKU' => 'childProductSKU',
        'childProductType' => 'childProductType',
        'childProductSymbol' => 'childProductSymbol',
        'childProductUomMultiplier' => 'childProductUomMultiplier'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
        'parentProductId' => 'setParentProductId',
        'childProductId' => 'setChildProductId',
        'appliedByDefault' => 'setAppliedByDefault',
        'defaultQty' => 'setDefaultQty',
        'editable' => 'setEditable',
        'minQty' => 'setMinQty',
        'maxQty' => 'setMaxQty',
        'displayInJournal' => 'setDisplayInJournal',
        'usePricebook' => 'setUsePricebook',
        'followTransactionPricebook' => 'setFollowTransactionPricebook',
        'priceBookId' => 'setPriceBookId',
        'defaultQuantityFreeOfCharge' => 'setDefaultQuantityFreeOfCharge',
        'sortorder' => 'setSortorder',
        'modified' => 'setModified',
        'deleted' => 'setDeleted',
        'locked' => 'setLocked',
        'childProductName' => 'setChildProductName',
        'childProductSKU' => 'setChildProductSKU',
        'childProductType' => 'setChildProductType',
        'childProductSymbol' => 'setChildProductSymbol',
        'childProductUomMultiplier' => 'setChildProductUomMultiplier'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
        'parentProductId' => 'getParentProductId',
        'childProductId' => 'getChildProductId',
        'appliedByDefault' => 'getAppliedByDefault',
        'defaultQty' => 'getDefaultQty',
        'editable' => 'getEditable',
        'minQty' => 'getMinQty',
        'maxQty' => 'getMaxQty',
        'displayInJournal' => 'getDisplayInJournal',
        'usePricebook' => 'getUsePricebook',
        'followTransactionPricebook' => 'getFollowTransactionPricebook',
        'priceBookId' => 'getPriceBookId',
        'defaultQuantityFreeOfCharge' => 'getDefaultQuantityFreeOfCharge',
        'sortorder' => 'getSortorder',
        'modified' => 'getModified',
        'deleted' => 'getDeleted',
        'locked' => 'getLocked',
        'childProductName' => 'getChildProductName',
        'childProductSKU' => 'getChildProductSKU',
        'childProductType' => 'getChildProductType',
        'childProductSymbol' => 'getChildProductSymbol',
        'childProductUomMultiplier' => 'getChildProductUomMultiplier'
    ];

    /**
     * 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['parentProductId'] = $data['parentProductId'] ?? null;
        $this->container['childProductId'] = $data['childProductId'] ?? null;
        $this->container['appliedByDefault'] = $data['appliedByDefault'] ?? null;
        $this->container['defaultQty'] = $data['defaultQty'] ?? null;
        $this->container['editable'] = $data['editable'] ?? null;
        $this->container['minQty'] = $data['minQty'] ?? null;
        $this->container['maxQty'] = $data['maxQty'] ?? null;
        $this->container['displayInJournal'] = $data['displayInJournal'] ?? null;
        $this->container['usePricebook'] = $data['usePricebook'] ?? null;
        $this->container['followTransactionPricebook'] = $data['followTransactionPricebook'] ?? null;
        $this->container['priceBookId'] = $data['priceBookId'] ?? null;
        $this->container['defaultQuantityFreeOfCharge'] = $data['defaultQuantityFreeOfCharge'] ?? null;
        $this->container['sortorder'] = $data['sortorder'] ?? null;
        $this->container['modified'] = $data['modified'] ?? null;
        $this->container['deleted'] = $data['deleted'] ?? null;
        $this->container['locked'] = $data['locked'] ?? null;
        $this->container['childProductName'] = $data['childProductName'] ?? null;
        $this->container['childProductSKU'] = $data['childProductSKU'] ?? null;
        $this->container['childProductType'] = $data['childProductType'] ?? null;
        $this->container['childProductSymbol'] = $data['childProductSymbol'] ?? null;
        $this->container['childProductUomMultiplier'] = $data['childProductUomMultiplier'] ?? 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 id
     *
     * @return self
     */
    public function setId($id)
    {
        $this->container['id'] = $id;

        return $this;
    }

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

    /**
     * Sets parentProductId
     *
     * @param int|null $parentProductId Parent Product Id
     *
     * @return self
     */
    public function setParentProductId($parentProductId)
    {
        $this->container['parentProductId'] = $parentProductId;

        return $this;
    }

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

    /**
     * Sets childProductId
     *
     * @param int|null $childProductId Child Product Id
     *
     * @return self
     */
    public function setChildProductId($childProductId)
    {
        $this->container['childProductId'] = $childProductId;

        return $this;
    }

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

    /**
     * Sets appliedByDefault
     *
     * @param bool|null $appliedByDefault Applied By Default
     *
     * @return self
     */
    public function setAppliedByDefault($appliedByDefault)
    {
        $this->container['appliedByDefault'] = $appliedByDefault;

        return $this;
    }

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

    /**
     * Sets defaultQty
     *
     * @param double|null $defaultQty Default quantity
     *
     * @return self
     */
    public function setDefaultQty($defaultQty)
    {
        $this->container['defaultQty'] = $defaultQty;

        return $this;
    }

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

    /**
     * Sets editable
     *
     * @param bool|null $editable Editable
     *
     * @return self
     */
    public function setEditable($editable)
    {
        $this->container['editable'] = $editable;

        return $this;
    }

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

    /**
     * Sets minQty
     *
     * @param double|null $minQty Min quantity
     *
     * @return self
     */
    public function setMinQty($minQty)
    {
        $this->container['minQty'] = $minQty;

        return $this;
    }

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

    /**
     * Sets maxQty
     *
     * @param double|null $maxQty Max quantity
     *
     * @return self
     */
    public function setMaxQty($maxQty)
    {
        $this->container['maxQty'] = $maxQty;

        return $this;
    }

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

    /**
     * Sets displayInJournal
     *
     * @param bool|null $displayInJournal Display In Journal
     *
     * @return self
     */
    public function setDisplayInJournal($displayInJournal)
    {
        $this->container['displayInJournal'] = $displayInJournal;

        return $this;
    }

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

    /**
     * Sets usePricebook
     *
     * @param bool|null $usePricebook Use Price Book
     *
     * @return self
     */
    public function setUsePricebook($usePricebook)
    {
        $this->container['usePricebook'] = $usePricebook;

        return $this;
    }

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

    /**
     * Sets followTransactionPricebook
     *
     * @param bool|null $followTransactionPricebook Follow Transaction Price Book
     *
     * @return self
     */
    public function setFollowTransactionPricebook($followTransactionPricebook)
    {
        $this->container['followTransactionPricebook'] = $followTransactionPricebook;

        return $this;
    }

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

    /**
     * Sets priceBookId
     *
     * @param int|null $priceBookId Price Book Id
     *
     * @return self
     */
    public function setPriceBookId($priceBookId)
    {
        $this->container['priceBookId'] = $priceBookId;

        return $this;
    }

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

    /**
     * Sets defaultQuantityFreeOfCharge
     *
     * @param bool|null $defaultQuantityFreeOfCharge Default quantity free of charge
     *
     * @return self
     */
    public function setDefaultQuantityFreeOfCharge($defaultQuantityFreeOfCharge)
    {
        $this->container['defaultQuantityFreeOfCharge'] = $defaultQuantityFreeOfCharge;

        return $this;
    }

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

    /**
     * Sets sortorder
     *
     * @param int|null $sortorder Sort Order
     *
     * @return self
     */
    public function setSortorder($sortorder)
    {
        $this->container['sortorder'] = $sortorder;

        return $this;
    }

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

    /**
     * Sets modified
     *
     * @param int|null $modified The time in seconds since midnight January 1st 1970 UTC that was modified
     *
     * @return self
     */
    public function setModified($modified)
    {
        $this->container['modified'] = $modified;

        return $this;
    }

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

    /**
     * Sets deleted
     *
     * @param bool|null $deleted 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 Locked
     *
     * @return self
     */
    public function setLocked($locked)
    {
        $this->container['locked'] = $locked;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets childProductType
     *
     * @param string|null $childProductType Child Product Type
     *
     * @return self
     */
    public function setChildProductType($childProductType)
    {
        $this->container['childProductType'] = $childProductType;

        return $this;
    }

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

    /**
     * Sets childProductSymbol
     *
     * @param string|null $childProductSymbol Child Product Symbol
     *
     * @return self
     */
    public function setChildProductSymbol($childProductSymbol)
    {
        $this->container['childProductSymbol'] = $childProductSymbol;

        return $this;
    }

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

    /**
     * Sets childProductUomMultiplier
     *
     * @param double|null $childProductUomMultiplier Child Product UomMultiplier
     *
     * @return self
     */
    public function setChildProductUomMultiplier($childProductUomMultiplier)
    {
        $this->container['childProductUomMultiplier'] = $childProductUomMultiplier;

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


