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

/**
 * vend
 *
 * Vend 2.1 API
 *
 * The version of the OpenAPI document: 2.1
 * 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 Vend21\Model;

use \ArrayAccess;
use \Vend21\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'is_active' => 'bool',
        'product_codes' => '\Vend21\Model\ProductCode',
        'loyalty_amount' => 'int',
        'price_excluding_tax' => 'int',
        'price_including_tax' => 'int',
        'all_outlet_tax' => '\Vend21\Model\AllOutletTax',
        'outlet_taxes' => '\Vend21\Model\OutletTax[]',
        'product_suppliers' => '\Vend21\Model\Supplier[]',
        'variant_attribute_values' => '\Vend21\Model\VariantAttributeValue[]',
        'index' => 'int',
        'inventory' => '\Vend21\Model\Inventory[]',
        'weight_unit' => 'string',
        'weight' => 'int',
        'dimension_unit' => 'string',
        'width' => 'int',
        'height' => 'int',
        'length' => 'int',
        'packaging' => '\Vend21\Model\Packaging[]'
    ];

    /**
      * 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 = [
        'is_active' => null,
        'product_codes' => null,
        'loyalty_amount' => null,
        'price_excluding_tax' => null,
        'price_including_tax' => null,
        'all_outlet_tax' => null,
        'outlet_taxes' => null,
        'product_suppliers' => null,
        'variant_attribute_values' => null,
        'index' => null,
        'inventory' => null,
        'weight_unit' => null,
        'weight' => null,
        'dimension_unit' => null,
        'width' => null,
        'height' => null,
        'length' => null,
        'packaging' => null
    ];

    /**
     * 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 = [
        'is_active' => 'is_active',
        'product_codes' => 'product_codes',
        'loyalty_amount' => 'loyalty_amount',
        'price_excluding_tax' => 'price_excluding_tax',
        'price_including_tax' => 'price_including_tax',
        'all_outlet_tax' => 'all_outlet_tax',
        'outlet_taxes' => 'outlet_taxes',
        'product_suppliers' => 'product_suppliers',
        'variant_attribute_values' => 'variant_attribute_values',
        'index' => 'index',
        'inventory' => 'inventory',
        'weight_unit' => 'weight_unit',
        'weight' => 'weight',
        'dimension_unit' => 'dimension_unit',
        'width' => 'width',
        'height' => 'height',
        'length' => 'length',
        'packaging' => 'packaging'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'is_active' => 'setIsActive',
        'product_codes' => 'setProductCodes',
        'loyalty_amount' => 'setLoyaltyAmount',
        'price_excluding_tax' => 'setPriceExcludingTax',
        'price_including_tax' => 'setPriceIncludingTax',
        'all_outlet_tax' => 'setAllOutletTax',
        'outlet_taxes' => 'setOutletTaxes',
        'product_suppliers' => 'setProductSuppliers',
        'variant_attribute_values' => 'setVariantAttributeValues',
        'index' => 'setIndex',
        'inventory' => 'setInventory',
        'weight_unit' => 'setWeightUnit',
        'weight' => 'setWeight',
        'dimension_unit' => 'setDimensionUnit',
        'width' => 'setWidth',
        'height' => 'setHeight',
        'length' => 'setLength',
        'packaging' => 'setPackaging'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'is_active' => 'getIsActive',
        'product_codes' => 'getProductCodes',
        'loyalty_amount' => 'getLoyaltyAmount',
        'price_excluding_tax' => 'getPriceExcludingTax',
        'price_including_tax' => 'getPriceIncludingTax',
        'all_outlet_tax' => 'getAllOutletTax',
        'outlet_taxes' => 'getOutletTaxes',
        'product_suppliers' => 'getProductSuppliers',
        'variant_attribute_values' => 'getVariantAttributeValues',
        'index' => 'getIndex',
        'inventory' => 'getInventory',
        'weight_unit' => 'getWeightUnit',
        'weight' => 'getWeight',
        'dimension_unit' => 'getDimensionUnit',
        'width' => 'getWidth',
        'height' => 'getHeight',
        'length' => 'getLength',
        'packaging' => 'getPackaging'
    ];

    /**
     * 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['is_active'] = $data['is_active'] ?? null;
        $this->container['product_codes'] = $data['product_codes'] ?? null;
        $this->container['loyalty_amount'] = $data['loyalty_amount'] ?? null;
        $this->container['price_excluding_tax'] = $data['price_excluding_tax'] ?? null;
        $this->container['price_including_tax'] = $data['price_including_tax'] ?? null;
        $this->container['all_outlet_tax'] = $data['all_outlet_tax'] ?? null;
        $this->container['outlet_taxes'] = $data['outlet_taxes'] ?? null;
        $this->container['product_suppliers'] = $data['product_suppliers'] ?? null;
        $this->container['variant_attribute_values'] = $data['variant_attribute_values'] ?? null;
        $this->container['index'] = $data['index'] ?? null;
        $this->container['inventory'] = $data['inventory'] ?? null;
        $this->container['weight_unit'] = $data['weight_unit'] ?? null;
        $this->container['weight'] = $data['weight'] ?? null;
        $this->container['dimension_unit'] = $data['dimension_unit'] ?? null;
        $this->container['width'] = $data['width'] ?? null;
        $this->container['height'] = $data['height'] ?? null;
        $this->container['length'] = $data['length'] ?? null;
        $this->container['packaging'] = $data['packaging'] ?? 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 is_active
     *
     * @return bool|null
     */
    public function getIsActive()
    {
        return $this->container['is_active'];
    }

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

        return $this;
    }

    /**
     * Gets product_codes
     *
     * @return \Vend21\Model\ProductCode|null
     */
    public function getProductCodes()
    {
        return $this->container['product_codes'];
    }

    /**
     * Sets product_codes
     *
     * @param \Vend21\Model\ProductCode|null $product_codes product_codes
     *
     * @return self
     */
    public function setProductCodes($product_codes)
    {
        $this->container['product_codes'] = $product_codes;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets all_outlet_tax
     *
     * @return \Vend21\Model\AllOutletTax|null
     */
    public function getAllOutletTax()
    {
        return $this->container['all_outlet_tax'];
    }

    /**
     * Sets all_outlet_tax
     *
     * @param \Vend21\Model\AllOutletTax|null $all_outlet_tax all_outlet_tax
     *
     * @return self
     */
    public function setAllOutletTax($all_outlet_tax)
    {
        $this->container['all_outlet_tax'] = $all_outlet_tax;

        return $this;
    }

    /**
     * Gets outlet_taxes
     *
     * @return \Vend21\Model\OutletTax[]|null
     */
    public function getOutletTaxes()
    {
        return $this->container['outlet_taxes'];
    }

    /**
     * Sets outlet_taxes
     *
     * @param \Vend21\Model\OutletTax[]|null $outlet_taxes outlet_taxes
     *
     * @return self
     */
    public function setOutletTaxes($outlet_taxes)
    {
        $this->container['outlet_taxes'] = $outlet_taxes;

        return $this;
    }

    /**
     * Gets product_suppliers
     *
     * @return \Vend21\Model\Supplier[]|null
     */
    public function getProductSuppliers()
    {
        return $this->container['product_suppliers'];
    }

    /**
     * Sets product_suppliers
     *
     * @param \Vend21\Model\Supplier[]|null $product_suppliers product_suppliers
     *
     * @return self
     */
    public function setProductSuppliers($product_suppliers)
    {
        $this->container['product_suppliers'] = $product_suppliers;

        return $this;
    }

    /**
     * Gets variant_attribute_values
     *
     * @return \Vend21\Model\VariantAttributeValue[]|null
     */
    public function getVariantAttributeValues()
    {
        return $this->container['variant_attribute_values'];
    }

    /**
     * Sets variant_attribute_values
     *
     * @param \Vend21\Model\VariantAttributeValue[]|null $variant_attribute_values variant_attribute_values
     *
     * @return self
     */
    public function setVariantAttributeValues($variant_attribute_values)
    {
        $this->container['variant_attribute_values'] = $variant_attribute_values;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets inventory
     *
     * @return \Vend21\Model\Inventory[]|null
     */
    public function getInventory()
    {
        return $this->container['inventory'];
    }

    /**
     * Sets inventory
     *
     * @param \Vend21\Model\Inventory[]|null $inventory inventory
     *
     * @return self
     */
    public function setInventory($inventory)
    {
        $this->container['inventory'] = $inventory;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets packaging
     *
     * @return \Vend21\Model\Packaging[]|null
     */
    public function getPackaging()
    {
        return $this->container['packaging'];
    }

    /**
     * Sets packaging
     *
     * @param \Vend21\Model\Packaging[]|null $packaging packaging
     *
     * @return self
     */
    public function setPackaging($packaging)
    {
        $this->container['packaging'] = $packaging;

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


