<?php
/**
 * Product
 *
 * PHP version 8.1
 *
 * @category Class
 * @package  Vend202601
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * API 2026-01
 *
 * Lightspeed Retail (X-Series) API.
 *
 * The version of the OpenAPI document: 2026-01
 * Contact: x-series.api@lightspeedhq.com
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.21.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 Vend202601\Model;

use \ArrayAccess;
use \Vend202601\ObjectSerializer;

/**
 * Product Class Doc Comment
 *
 * @category Class
 * @package  Vend202601
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<string, mixed>
 */
class Product implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @var string[]
     */
    protected static $openAPITypes = [
        'account_code' => 'string',
        'account_code_purchase' => 'string',
        'active' => 'bool',
        'attributes' => '\Vend202601\Model\Attribute[]',
        'brand' => '\Vend202601\Model\BrandSample',
        'brand_id' => 'string',
        'button_order' => 'int',
        'categories' => '\Vend202601\Model\Tag[]',
        'composite_bom' => 'object',
        'created_at' => 'string',
        'deleted_at' => 'string',
        'description' => 'string',
        'dimensions_unit' => 'string',
        'family_id' => 'string',
        'handle' => 'string',
        'has_inventory' => 'bool',
        'has_variants' => 'bool',
        'height' => 'float',
        'id' => 'string',
        'image_thumbnail_url' => 'string',
        'image_url' => 'string',
        'images' => '\Vend202601\Model\ImageSample[]',
        'is_composite' => 'bool',
        'length' => 'float',
        'loyalty_amount' => 'float',
        'name' => 'string',
        'price_excluding_tax' => 'float',
        'price_including_tax' => 'float',
        'product_codes' => '\Vend202601\Model\ProductCode[]',
        'product_suppliers' => '\Vend202601\Model\ProductSupplier[]',
        'product_type_id' => 'string',
        'sku' => 'string',
        'source' => 'string',
        'source_id' => 'string',
        'source_variant_id' => 'string',
        'supplier' => '\Vend202601\Model\SupplierSample',
        'supplier_code' => 'string',
        'supplier_id' => 'string',
        'supply_price' => 'float',
        'tag_ids' => 'string[]',
        'type' => '\Vend202601\Model\ProductTypeSample',
        'updated_at' => 'string',
        'variant_count' => 'int',
        'variant_name' => 'string',
        'variant_options' => '\Vend202601\Model\VariantOption[]',
        'variant_parent_id' => 'string',
        'version' => 'int',
        'weight' => 'float',
        'weight_unit' => 'string',
        'width' => 'float'
    ];

    /**
     * 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 = [
        'account_code' => null,
        'account_code_purchase' => null,
        'active' => null,
        'attributes' => null,
        'brand' => null,
        'brand_id' => 'UUID',
        'button_order' => null,
        'categories' => null,
        'composite_bom' => null,
        'created_at' => null,
        'deleted_at' => null,
        'description' => null,
        'dimensions_unit' => null,
        'family_id' => 'UUID',
        'handle' => null,
        'has_inventory' => null,
        'has_variants' => null,
        'height' => null,
        'id' => 'UUID',
        'image_thumbnail_url' => null,
        'image_url' => null,
        'images' => null,
        'is_composite' => null,
        'length' => null,
        'loyalty_amount' => null,
        'name' => null,
        'price_excluding_tax' => null,
        'price_including_tax' => null,
        'product_codes' => null,
        'product_suppliers' => null,
        'product_type_id' => 'UUID',
        'sku' => null,
        'source' => null,
        'source_id' => null,
        'source_variant_id' => null,
        'supplier' => null,
        'supplier_code' => null,
        'supplier_id' => 'UUID',
        'supply_price' => 'double',
        'tag_ids' => 'UUID',
        'type' => null,
        'updated_at' => null,
        'variant_count' => null,
        'variant_name' => null,
        'variant_options' => null,
        'variant_parent_id' => 'UUID',
        'version' => 'int64',
        'weight' => null,
        'weight_unit' => null,
        'width' => null
    ];

    /**
     * Array of nullable properties. Used for (de)serialization
     *
     * @var boolean[]
     */
    protected static array $openAPINullables = [
        'account_code' => true,
        'account_code_purchase' => true,
        'active' => false,
        'attributes' => false,
        'brand' => false,
        'brand_id' => true,
        'button_order' => false,
        'categories' => false,
        'composite_bom' => false,
        'created_at' => false,
        'deleted_at' => true,
        'description' => true,
        'dimensions_unit' => false,
        'family_id' => false,
        'handle' => false,
        'has_inventory' => false,
        'has_variants' => false,
        'height' => false,
        'id' => false,
        'image_thumbnail_url' => false,
        'image_url' => false,
        'images' => false,
        'is_composite' => false,
        'length' => false,
        'loyalty_amount' => true,
        'name' => false,
        'price_excluding_tax' => false,
        'price_including_tax' => false,
        'product_codes' => false,
        'product_suppliers' => false,
        'product_type_id' => true,
        'sku' => true,
        'source' => false,
        'source_id' => true,
        'source_variant_id' => true,
        'supplier' => false,
        'supplier_code' => true,
        'supplier_id' => true,
        'supply_price' => false,
        'tag_ids' => false,
        'type' => false,
        'updated_at' => false,
        'variant_count' => false,
        'variant_name' => true,
        'variant_options' => false,
        'variant_parent_id' => true,
        'version' => false,
        'weight' => false,
        'weight_unit' => false,
        'width' => false
    ];

    /**
     * If a nullable field gets set to null, insert it here
     *
     * @var boolean[]
     */
    protected array $openAPINullablesSetToNull = [];

    /**
     * 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 nullable properties
     *
     * @return array
     */
    protected static function openAPINullables(): array
    {
        return self::$openAPINullables;
    }

    /**
     * Array of nullable field names deliberately set to null
     *
     * @return boolean[]
     */
    private function getOpenAPINullablesSetToNull(): array
    {
        return $this->openAPINullablesSetToNull;
    }

    /**
     * Setter - Array of nullable field names deliberately set to null
     *
     * @param boolean[] $openAPINullablesSetToNull
     */
    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
    {
        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
    }

    /**
     * Checks if a property is nullable
     *
     * @param string $property
     * @return bool
     */
    public static function isNullable(string $property): bool
    {
        return self::openAPINullables()[$property] ?? false;
    }

    /**
     * Checks if a nullable property is set to null.
     *
     * @param string $property
     * @return bool
     */
    public function isNullableSetToNull(string $property): bool
    {
        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'account_code' => 'account_code',
        'account_code_purchase' => 'account_code_purchase',
        'active' => 'active',
        'attributes' => 'attributes',
        'brand' => 'brand',
        'brand_id' => 'brand_id',
        'button_order' => 'button_order',
        'categories' => 'categories',
        'composite_bom' => 'composite_bom',
        'created_at' => 'created_at',
        'deleted_at' => 'deleted_at',
        'description' => 'description',
        'dimensions_unit' => 'dimensions_unit',
        'family_id' => 'family_id',
        'handle' => 'handle',
        'has_inventory' => 'has_inventory',
        'has_variants' => 'has_variants',
        'height' => 'height',
        'id' => 'id',
        'image_thumbnail_url' => 'image_thumbnail_url',
        'image_url' => 'image_url',
        'images' => 'images',
        'is_composite' => 'is_composite',
        'length' => 'length',
        'loyalty_amount' => 'loyalty_amount',
        'name' => 'name',
        'price_excluding_tax' => 'price_excluding_tax',
        'price_including_tax' => 'price_including_tax',
        'product_codes' => 'product_codes',
        'product_suppliers' => 'product_suppliers',
        'product_type_id' => 'product_type_id',
        'sku' => 'sku',
        'source' => 'source',
        'source_id' => 'source_id',
        'source_variant_id' => 'source_variant_id',
        'supplier' => 'supplier',
        'supplier_code' => 'supplier_code',
        'supplier_id' => 'supplier_id',
        'supply_price' => 'supply_price',
        'tag_ids' => 'tag_ids',
        'type' => 'type',
        'updated_at' => 'updated_at',
        'variant_count' => 'variant_count',
        'variant_name' => 'variant_name',
        'variant_options' => 'variant_options',
        'variant_parent_id' => 'variant_parent_id',
        'version' => 'version',
        'weight' => 'weight',
        'weight_unit' => 'weight_unit',
        'width' => 'width'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'account_code' => 'setAccountCode',
        'account_code_purchase' => 'setAccountCodePurchase',
        'active' => 'setActive',
        'attributes' => 'setAttributes',
        'brand' => 'setBrand',
        'brand_id' => 'setBrandId',
        'button_order' => 'setButtonOrder',
        'categories' => 'setCategories',
        'composite_bom' => 'setCompositeBom',
        'created_at' => 'setCreatedAt',
        'deleted_at' => 'setDeletedAt',
        'description' => 'setDescription',
        'dimensions_unit' => 'setDimensionsUnit',
        'family_id' => 'setFamilyId',
        'handle' => 'setHandle',
        'has_inventory' => 'setHasInventory',
        'has_variants' => 'setHasVariants',
        'height' => 'setHeight',
        'id' => 'setId',
        'image_thumbnail_url' => 'setImageThumbnailUrl',
        'image_url' => 'setImageUrl',
        'images' => 'setImages',
        'is_composite' => 'setIsComposite',
        'length' => 'setLength',
        'loyalty_amount' => 'setLoyaltyAmount',
        'name' => 'setName',
        'price_excluding_tax' => 'setPriceExcludingTax',
        'price_including_tax' => 'setPriceIncludingTax',
        'product_codes' => 'setProductCodes',
        'product_suppliers' => 'setProductSuppliers',
        'product_type_id' => 'setProductTypeId',
        'sku' => 'setSku',
        'source' => 'setSource',
        'source_id' => 'setSourceId',
        'source_variant_id' => 'setSourceVariantId',
        'supplier' => 'setSupplier',
        'supplier_code' => 'setSupplierCode',
        'supplier_id' => 'setSupplierId',
        'supply_price' => 'setSupplyPrice',
        'tag_ids' => 'setTagIds',
        'type' => 'setType',
        'updated_at' => 'setUpdatedAt',
        'variant_count' => 'setVariantCount',
        'variant_name' => 'setVariantName',
        'variant_options' => 'setVariantOptions',
        'variant_parent_id' => 'setVariantParentId',
        'version' => 'setVersion',
        'weight' => 'setWeight',
        'weight_unit' => 'setWeightUnit',
        'width' => 'setWidth'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'account_code' => 'getAccountCode',
        'account_code_purchase' => 'getAccountCodePurchase',
        'active' => 'getActive',
        'attributes' => 'getAttributes',
        'brand' => 'getBrand',
        'brand_id' => 'getBrandId',
        'button_order' => 'getButtonOrder',
        'categories' => 'getCategories',
        'composite_bom' => 'getCompositeBom',
        'created_at' => 'getCreatedAt',
        'deleted_at' => 'getDeletedAt',
        'description' => 'getDescription',
        'dimensions_unit' => 'getDimensionsUnit',
        'family_id' => 'getFamilyId',
        'handle' => 'getHandle',
        'has_inventory' => 'getHasInventory',
        'has_variants' => 'getHasVariants',
        'height' => 'getHeight',
        'id' => 'getId',
        'image_thumbnail_url' => 'getImageThumbnailUrl',
        'image_url' => 'getImageUrl',
        'images' => 'getImages',
        'is_composite' => 'getIsComposite',
        'length' => 'getLength',
        'loyalty_amount' => 'getLoyaltyAmount',
        'name' => 'getName',
        'price_excluding_tax' => 'getPriceExcludingTax',
        'price_including_tax' => 'getPriceIncludingTax',
        'product_codes' => 'getProductCodes',
        'product_suppliers' => 'getProductSuppliers',
        'product_type_id' => 'getProductTypeId',
        'sku' => 'getSku',
        'source' => 'getSource',
        'source_id' => 'getSourceId',
        'source_variant_id' => 'getSourceVariantId',
        'supplier' => 'getSupplier',
        'supplier_code' => 'getSupplierCode',
        'supplier_id' => 'getSupplierId',
        'supply_price' => 'getSupplyPrice',
        'tag_ids' => 'getTagIds',
        'type' => 'getType',
        'updated_at' => 'getUpdatedAt',
        'variant_count' => 'getVariantCount',
        'variant_name' => 'getVariantName',
        'variant_options' => 'getVariantOptions',
        'variant_parent_id' => 'getVariantParentId',
        'version' => 'getVersion',
        'weight' => 'getWeight',
        'weight_unit' => 'getWeightUnit',
        'width' => 'getWidth'
    ];

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

    public const DIMENSIONS_UNIT_IN = 'IN';
    public const DIMENSIONS_UNIT_CM = 'CM';
    public const DIMENSIONS_UNIT_MM = 'MM';
    public const DIMENSIONS_UNIT_YD = 'YD';
    public const WEIGHT_UNIT_CT = 'CT';
    public const WEIGHT_UNIT_G = 'G';
    public const WEIGHT_UNIT_OZ = 'OZ';
    public const WEIGHT_UNIT_LB = 'LB';
    public const WEIGHT_UNIT_KG = 'KG';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getDimensionsUnitAllowableValues()
    {
        return [
            self::DIMENSIONS_UNIT_IN,
            self::DIMENSIONS_UNIT_CM,
            self::DIMENSIONS_UNIT_MM,
            self::DIMENSIONS_UNIT_YD,
        ];
    }

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getWeightUnitAllowableValues()
    {
        return [
            self::WEIGHT_UNIT_CT,
            self::WEIGHT_UNIT_G,
            self::WEIGHT_UNIT_OZ,
            self::WEIGHT_UNIT_LB,
            self::WEIGHT_UNIT_KG,
        ];
    }

    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[]|null $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('account_code', $data ?? [], null);
        $this->setIfExists('account_code_purchase', $data ?? [], null);
        $this->setIfExists('active', $data ?? [], null);
        $this->setIfExists('attributes', $data ?? [], null);
        $this->setIfExists('brand', $data ?? [], null);
        $this->setIfExists('brand_id', $data ?? [], null);
        $this->setIfExists('button_order', $data ?? [], null);
        $this->setIfExists('categories', $data ?? [], null);
        $this->setIfExists('composite_bom', $data ?? [], null);
        $this->setIfExists('created_at', $data ?? [], null);
        $this->setIfExists('deleted_at', $data ?? [], null);
        $this->setIfExists('description', $data ?? [], null);
        $this->setIfExists('dimensions_unit', $data ?? [], null);
        $this->setIfExists('family_id', $data ?? [], null);
        $this->setIfExists('handle', $data ?? [], null);
        $this->setIfExists('has_inventory', $data ?? [], null);
        $this->setIfExists('has_variants', $data ?? [], null);
        $this->setIfExists('height', $data ?? [], null);
        $this->setIfExists('id', $data ?? [], null);
        $this->setIfExists('image_thumbnail_url', $data ?? [], null);
        $this->setIfExists('image_url', $data ?? [], null);
        $this->setIfExists('images', $data ?? [], null);
        $this->setIfExists('is_composite', $data ?? [], null);
        $this->setIfExists('length', $data ?? [], null);
        $this->setIfExists('loyalty_amount', $data ?? [], null);
        $this->setIfExists('name', $data ?? [], null);
        $this->setIfExists('price_excluding_tax', $data ?? [], null);
        $this->setIfExists('price_including_tax', $data ?? [], null);
        $this->setIfExists('product_codes', $data ?? [], null);
        $this->setIfExists('product_suppliers', $data ?? [], null);
        $this->setIfExists('product_type_id', $data ?? [], null);
        $this->setIfExists('sku', $data ?? [], null);
        $this->setIfExists('source', $data ?? [], null);
        $this->setIfExists('source_id', $data ?? [], null);
        $this->setIfExists('source_variant_id', $data ?? [], null);
        $this->setIfExists('supplier', $data ?? [], null);
        $this->setIfExists('supplier_code', $data ?? [], null);
        $this->setIfExists('supplier_id', $data ?? [], null);
        $this->setIfExists('supply_price', $data ?? [], null);
        $this->setIfExists('tag_ids', $data ?? [], null);
        $this->setIfExists('type', $data ?? [], null);
        $this->setIfExists('updated_at', $data ?? [], null);
        $this->setIfExists('variant_count', $data ?? [], null);
        $this->setIfExists('variant_name', $data ?? [], null);
        $this->setIfExists('variant_options', $data ?? [], null);
        $this->setIfExists('variant_parent_id', $data ?? [], null);
        $this->setIfExists('version', $data ?? [], null);
        $this->setIfExists('weight', $data ?? [], null);
        $this->setIfExists('weight_unit', $data ?? [], null);
        $this->setIfExists('width', $data ?? [], null);
    }

    /**
     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
     * $this->openAPINullablesSetToNull array
     *
     * @param string $variableName
     * @param array  $fields
     * @param mixed  $defaultValue
     */
    private function setIfExists(string $variableName, array $fields, $defaultValue): void
    {
        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
            $this->openAPINullablesSetToNull[] = $variableName;
        }

        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        $allowedValues = $this->getDimensionsUnitAllowableValues();
        if (!is_null($this->container['dimensions_unit']) && !in_array($this->container['dimensions_unit'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'dimensions_unit', must be one of '%s'",
                $this->container['dimensions_unit'],
                implode("', '", $allowedValues)
            );
        }

        if ($this->container['handle'] === null) {
            $invalidProperties[] = "'handle' can't be null";
        }
        if ($this->container['name'] === null) {
            $invalidProperties[] = "'name' can't be null";
        }
        if ($this->container['sku'] === null && !$this->isNullableSetToNull('sku')) {
            $invalidProperties[] = "'sku' can't be null";
        }
        $allowedValues = $this->getWeightUnitAllowableValues();
        if (!is_null($this->container['weight_unit']) && !in_array($this->container['weight_unit'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'weight_unit', must be one of '%s'",
                $this->container['weight_unit'],
                implode("', '", $allowedValues)
            );
        }

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

    /**
     * Sets account_code
     *
     * @param string|null $account_code ???
     *
     * @return self
     */
    public function setAccountCode($account_code)
    {
        if (is_null($account_code)) {
            array_push($this->openAPINullablesSetToNull, 'account_code');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('account_code', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['account_code'] = $account_code;

        return $this;
    }

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

    /**
     * Sets account_code_purchase
     *
     * @param string|null $account_code_purchase ???
     *
     * @return self
     */
    public function setAccountCodePurchase($account_code_purchase)
    {
        if (is_null($account_code_purchase)) {
            array_push($this->openAPINullablesSetToNull, 'account_code_purchase');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('account_code_purchase', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['account_code_purchase'] = $account_code_purchase;

        return $this;
    }

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

    /**
     * Sets active
     *
     * @param bool|null $active Indicated whether the Product is active.
     *
     * @return self
     */
    public function setActive($active)
    {
        if (is_null($active)) {
            throw new \InvalidArgumentException('non-nullable active cannot be null');
        }
        $this->container['active'] = $active;

        return $this;
    }

    /**
     * Gets attributes
     *
     * @return \Vend202601\Model\Attribute[]|null
     */
    public function getAttributes()
    {
        return $this->container['attributes'];
    }

    /**
     * Sets attributes
     *
     * @param \Vend202601\Model\Attribute[]|null $attributes A list of attributes
     *
     * @return self
     */
    public function setAttributes($attributes)
    {
        if (is_null($attributes)) {
            throw new \InvalidArgumentException('non-nullable attributes cannot be null');
        }
        $this->container['attributes'] = $attributes;

        return $this;
    }

    /**
     * Gets brand
     *
     * @return \Vend202601\Model\BrandSample|null
     */
    public function getBrand()
    {
        return $this->container['brand'];
    }

    /**
     * Sets brand
     *
     * @param \Vend202601\Model\BrandSample|null $brand brand
     *
     * @return self
     */
    public function setBrand($brand)
    {
        if (is_null($brand)) {
            throw new \InvalidArgumentException('non-nullable brand cannot be null');
        }
        $this->container['brand'] = $brand;

        return $this;
    }

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

    /**
     * Sets brand_id
     *
     * @param string|null $brand_id The brand ID.
     *
     * @return self
     */
    public function setBrandId($brand_id)
    {
        if (is_null($brand_id)) {
            array_push($this->openAPINullablesSetToNull, 'brand_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('brand_id', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['brand_id'] = $brand_id;

        return $this;
    }

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

    /**
     * Sets button_order
     *
     * @param int|null $button_order ???
     *
     * @return self
     */
    public function setButtonOrder($button_order)
    {
        if (is_null($button_order)) {
            throw new \InvalidArgumentException('non-nullable button_order cannot be null');
        }
        $this->container['button_order'] = $button_order;

        return $this;
    }

    /**
     * Gets categories
     *
     * @return \Vend202601\Model\Tag[]|null
     */
    public function getCategories()
    {
        return $this->container['categories'];
    }

    /**
     * Sets categories
     *
     * @param \Vend202601\Model\Tag[]|null $categories A list of tag objects.
     *
     * @return self
     */
    public function setCategories($categories)
    {
        if (is_null($categories)) {
            throw new \InvalidArgumentException('non-nullable categories cannot be null');
        }
        $this->container['categories'] = $categories;

        return $this;
    }

    /**
     * Gets composite_bom
     *
     * @return object|null
     */
    public function getCompositeBom()
    {
        return $this->container['composite_bom'];
    }

    /**
     * Sets composite_bom
     *
     * @param object|null $composite_bom A bill of materials object. This field is only relevant for composite products. It is a map of product ids to the quantity of each product that is needed to make up the composite product.
     *
     * @return self
     */
    public function setCompositeBom($composite_bom)
    {
        if (is_null($composite_bom)) {
            throw new \InvalidArgumentException('non-nullable composite_bom cannot be null');
        }
        $this->container['composite_bom'] = $composite_bom;

        return $this;
    }

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

    /**
     * Sets created_at
     *
     * @param string|null $created_at Creation timestamp in UTC.
     *
     * @return self
     */
    public function setCreatedAt($created_at)
    {
        if (is_null($created_at)) {
            throw new \InvalidArgumentException('non-nullable created_at cannot be null');
        }
        $this->container['created_at'] = $created_at;

        return $this;
    }

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

    /**
     * Sets deleted_at
     *
     * @param string|null $deleted_at Deletion timestamp in UTC.
     *
     * @return self
     */
    public function setDeletedAt($deleted_at)
    {
        if (is_null($deleted_at)) {
            array_push($this->openAPINullablesSetToNull, 'deleted_at');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('deleted_at', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['deleted_at'] = $deleted_at;

        return $this;
    }

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

    /**
     * Sets description
     *
     * @param string|null $description A detailed description of the Product. **Note** Can contain HTML.
     *
     * @return self
     */
    public function setDescription($description)
    {
        if (is_null($description)) {
            array_push($this->openAPINullablesSetToNull, 'description');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('description', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['description'] = $description;

        return $this;
    }

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

    /**
     * Sets dimensions_unit
     *
     * @param string|null $dimensions_unit Unit of measurement for product dimensions. These are used to calculate variable shipping rates for stores using Lightspeed eCom.
     *
     * @return self
     */
    public function setDimensionsUnit($dimensions_unit)
    {
        if (is_null($dimensions_unit)) {
            throw new \InvalidArgumentException('non-nullable dimensions_unit cannot be null');
        }
        $allowedValues = $this->getDimensionsUnitAllowableValues();
        if (!in_array($dimensions_unit, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'dimensions_unit', must be one of '%s'",
                    $dimensions_unit,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['dimensions_unit'] = $dimensions_unit;

        return $this;
    }

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

    /**
     * Sets family_id
     *
     * @param string|null $family_id This is a family identifier. All members of a product family will have the same identifier. In the future, this will replace the variant_parent_id as the family group identifier. This field is currently read-only.
     *
     * @return self
     */
    public function setFamilyId($family_id)
    {
        if (is_null($family_id)) {
            throw new \InvalidArgumentException('non-nullable family_id cannot be null');
        }
        $this->container['family_id'] = $family_id;

        return $this;
    }

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

    /**
     * Sets handle
     *
     * @param string $handle Product handle. **Note:** Variants share the same handle.
     *
     * @return self
     */
    public function setHandle($handle)
    {
        if (is_null($handle)) {
            throw new \InvalidArgumentException('non-nullable handle cannot be null');
        }
        $this->container['handle'] = $handle;

        return $this;
    }

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

    /**
     * Sets has_inventory
     *
     * @param bool|null $has_inventory Indicates whether inventory is being tracked for the Product.
     *
     * @return self
     */
    public function setHasInventory($has_inventory)
    {
        if (is_null($has_inventory)) {
            throw new \InvalidArgumentException('non-nullable has_inventory cannot be null');
        }
        $this->container['has_inventory'] = $has_inventory;

        return $this;
    }

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

    /**
     * Sets has_variants
     *
     * @param bool|null $has_variants Indicated whether product has variants.
     *
     * @return self
     */
    public function setHasVariants($has_variants)
    {
        if (is_null($has_variants)) {
            throw new \InvalidArgumentException('non-nullable has_variants cannot be null');
        }
        $this->container['has_variants'] = $has_variants;

        return $this;
    }

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

    /**
     * Sets height
     *
     * @param float|null $height Product height. These are used to calculate variable shipping rates for stores using Lightspeed eCom.
     *
     * @return self
     */
    public function setHeight($height)
    {
        if (is_null($height)) {
            throw new \InvalidArgumentException('non-nullable height cannot be null');
        }
        $this->container['height'] = $height;

        return $this;
    }

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

    /**
     * Sets id
     *
     * @param string|null $id Auto-generated object ID.
     *
     * @return self
     */
    public function setId($id)
    {
        if (is_null($id)) {
            throw new \InvalidArgumentException('non-nullable id cannot be null');
        }
        $this->container['id'] = $id;

        return $this;
    }

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

    /**
     * Sets image_thumbnail_url
     *
     * @param string|null $image_thumbnail_url image_thumbnail_url
     *
     * @return self
     */
    public function setImageThumbnailUrl($image_thumbnail_url)
    {
        if (is_null($image_thumbnail_url)) {
            throw new \InvalidArgumentException('non-nullable image_thumbnail_url cannot be null');
        }
        $this->container['image_thumbnail_url'] = $image_thumbnail_url;

        return $this;
    }

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

    /**
     * Sets image_url
     *
     * @param string|null $image_url image_url
     *
     * @return self
     */
    public function setImageUrl($image_url)
    {
        if (is_null($image_url)) {
            throw new \InvalidArgumentException('non-nullable image_url cannot be null');
        }
        $this->container['image_url'] = $image_url;

        return $this;
    }

    /**
     * Gets images
     *
     * @return \Vend202601\Model\ImageSample[]|null
     */
    public function getImages()
    {
        return $this->container['images'];
    }

    /**
     * Sets images
     *
     * @param \Vend202601\Model\ImageSample[]|null $images A list of image objects.
     *
     * @return self
     */
    public function setImages($images)
    {
        if (is_null($images)) {
            throw new \InvalidArgumentException('non-nullable images cannot be null');
        }
        $this->container['images'] = $images;

        return $this;
    }

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

    /**
     * Sets is_composite
     *
     * @param bool|null $is_composite Indicates whether the Product is a composite one.
     *
     * @return self
     */
    public function setIsComposite($is_composite)
    {
        if (is_null($is_composite)) {
            throw new \InvalidArgumentException('non-nullable is_composite cannot be null');
        }
        $this->container['is_composite'] = $is_composite;

        return $this;
    }

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

    /**
     * Sets length
     *
     * @param float|null $length Product length. These are used to calculate variable shipping rates for stores using Lightspeed eCom.
     *
     * @return self
     */
    public function setLength($length)
    {
        if (is_null($length)) {
            throw new \InvalidArgumentException('non-nullable length cannot be null');
        }
        $this->container['length'] = $length;

        return $this;
    }

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

    /**
     * Sets loyalty_amount
     *
     * @param float|null $loyalty_amount The amount of loyalty the customer receives buying this item.
     *
     * @return self
     */
    public function setLoyaltyAmount($loyalty_amount)
    {
        if (is_null($loyalty_amount)) {
            array_push($this->openAPINullablesSetToNull, 'loyalty_amount');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('loyalty_amount', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['loyalty_amount'] = $loyalty_amount;

        return $this;
    }

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

    /**
     * Sets name
     *
     * @param string $name Product name.
     *
     * @return self
     */
    public function setName($name)
    {
        if (is_null($name)) {
            throw new \InvalidArgumentException('non-nullable name cannot be null');
        }
        $this->container['name'] = $name;

        return $this;
    }

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

    /**
     * Sets price_excluding_tax
     *
     * @param float|null $price_excluding_tax The price before tax is added.
     *
     * @return self
     */
    public function setPriceExcludingTax($price_excluding_tax)
    {
        if (is_null($price_excluding_tax)) {
            throw new \InvalidArgumentException('non-nullable price_excluding_tax cannot be null');
        }
        $this->container['price_excluding_tax'] = $price_excluding_tax;

        return $this;
    }

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

    /**
     * Sets price_including_tax
     *
     * @param float|null $price_including_tax The price including all the relevant taxes.
     *
     * @return self
     */
    public function setPriceIncludingTax($price_including_tax)
    {
        if (is_null($price_including_tax)) {
            throw new \InvalidArgumentException('non-nullable price_including_tax cannot be null');
        }
        $this->container['price_including_tax'] = $price_including_tax;

        return $this;
    }

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

    /**
     * Sets product_codes
     *
     * @param \Vend202601\Model\ProductCode[]|null $product_codes A list of product code objects.
     *
     * @return self
     */
    public function setProductCodes($product_codes)
    {
        if (is_null($product_codes)) {
            throw new \InvalidArgumentException('non-nullable product_codes cannot be null');
        }
        $this->container['product_codes'] = $product_codes;

        return $this;
    }

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

    /**
     * Sets product_suppliers
     *
     * @param \Vend202601\Model\ProductSupplier[]|null $product_suppliers A list of product supplier objects.
     *
     * @return self
     */
    public function setProductSuppliers($product_suppliers)
    {
        if (is_null($product_suppliers)) {
            throw new \InvalidArgumentException('non-nullable product_suppliers cannot be null');
        }
        $this->container['product_suppliers'] = $product_suppliers;

        return $this;
    }

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

    /**
     * Sets product_type_id
     *
     * @param string|null $product_type_id The product type.
     *
     * @return self
     */
    public function setProductTypeId($product_type_id)
    {
        if (is_null($product_type_id)) {
            array_push($this->openAPINullablesSetToNull, 'product_type_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('product_type_id', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['product_type_id'] = $product_type_id;

        return $this;
    }

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

    /**
     * Sets sku
     *
     * @param string|null $sku Product sku. **Note:** Should be unique.
     *
     * @return self
     */
    public function setSku($sku)
    {
        if (is_null($sku)) {
            array_push($this->openAPINullablesSetToNull, 'sku');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('sku', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['sku'] = $sku;

        return $this;
    }

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

    /**
     * Sets source
     *
     * @param string|null $source Indicates the origin of the product. Can be USER, SHOPIFY.
     *
     * @return self
     */
    public function setSource($source)
    {
        if (is_null($source)) {
            throw new \InvalidArgumentException('non-nullable source cannot be null');
        }
        $this->container['source'] = $source;

        return $this;
    }

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

    /**
     * Sets source_id
     *
     * @param string|null $source_id External reference ID.
     *
     * @return self
     */
    public function setSourceId($source_id)
    {
        if (is_null($source_id)) {
            array_push($this->openAPINullablesSetToNull, 'source_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('source_id', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['source_id'] = $source_id;

        return $this;
    }

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

    /**
     * Sets source_variant_id
     *
     * @param string|null $source_variant_id Secondary external reference ID.
     *
     * @return self
     */
    public function setSourceVariantId($source_variant_id)
    {
        if (is_null($source_variant_id)) {
            array_push($this->openAPINullablesSetToNull, 'source_variant_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('source_variant_id', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['source_variant_id'] = $source_variant_id;

        return $this;
    }

    /**
     * Gets supplier
     *
     * @return \Vend202601\Model\SupplierSample|null
     */
    public function getSupplier()
    {
        return $this->container['supplier'];
    }

    /**
     * Sets supplier
     *
     * @param \Vend202601\Model\SupplierSample|null $supplier supplier
     *
     * @return self
     */
    public function setSupplier($supplier)
    {
        if (is_null($supplier)) {
            throw new \InvalidArgumentException('non-nullable supplier cannot be null');
        }
        $this->container['supplier'] = $supplier;

        return $this;
    }

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

    /**
     * Sets supplier_code
     *
     * @param string|null $supplier_code Supplier code.
     *
     * @return self
     */
    public function setSupplierCode($supplier_code)
    {
        if (is_null($supplier_code)) {
            array_push($this->openAPINullablesSetToNull, 'supplier_code');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('supplier_code', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['supplier_code'] = $supplier_code;

        return $this;
    }

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

    /**
     * Sets supplier_id
     *
     * @param string|null $supplier_id The supplier ID.
     *
     * @return self
     */
    public function setSupplierId($supplier_id)
    {
        if (is_null($supplier_id)) {
            array_push($this->openAPINullablesSetToNull, 'supplier_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('supplier_id', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['supplier_id'] = $supplier_id;

        return $this;
    }

    /**
     * Gets supply_price
     *
     * @return float|null
     */
    public function getSupplyPrice()
    {
        return $this->container['supply_price'];
    }

    /**
     * Sets supply_price
     *
     * @param float|null $supply_price Default supply price,
     *
     * @return self
     */
    public function setSupplyPrice($supply_price)
    {
        if (is_null($supply_price)) {
            throw new \InvalidArgumentException('non-nullable supply_price cannot be null');
        }
        $this->container['supply_price'] = $supply_price;

        return $this;
    }

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

    /**
     * Sets tag_ids
     *
     * @param string[]|null $tag_ids An array of tag IDs associated with this product.
     *
     * @return self
     */
    public function setTagIds($tag_ids)
    {
        if (is_null($tag_ids)) {
            throw new \InvalidArgumentException('non-nullable tag_ids cannot be null');
        }
        $this->container['tag_ids'] = $tag_ids;

        return $this;
    }

    /**
     * Gets type
     *
     * @return \Vend202601\Model\ProductTypeSample|null
     */
    public function getType()
    {
        return $this->container['type'];
    }

    /**
     * Sets type
     *
     * @param \Vend202601\Model\ProductTypeSample|null $type type
     *
     * @return self
     */
    public function setType($type)
    {
        if (is_null($type)) {
            throw new \InvalidArgumentException('non-nullable type cannot be null');
        }
        $this->container['type'] = $type;

        return $this;
    }

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

    /**
     * Sets updated_at
     *
     * @param string|null $updated_at Last update timestamp in UTC.
     *
     * @return self
     */
    public function setUpdatedAt($updated_at)
    {
        if (is_null($updated_at)) {
            throw new \InvalidArgumentException('non-nullable updated_at cannot be null');
        }
        $this->container['updated_at'] = $updated_at;

        return $this;
    }

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

    /**
     * Sets variant_count
     *
     * @param int|null $variant_count The number of variants for this product.
     *
     * @return self
     */
    public function setVariantCount($variant_count)
    {
        if (is_null($variant_count)) {
            throw new \InvalidArgumentException('non-nullable variant_count cannot be null');
        }
        $this->container['variant_count'] = $variant_count;

        return $this;
    }

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

    /**
     * Sets variant_name
     *
     * @param string|null $variant_name The name of the variant product.
     *
     * @return self
     */
    public function setVariantName($variant_name)
    {
        if (is_null($variant_name)) {
            array_push($this->openAPINullablesSetToNull, 'variant_name');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('variant_name', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['variant_name'] = $variant_name;

        return $this;
    }

    /**
     * Gets variant_options
     *
     * @return \Vend202601\Model\VariantOption[]|null
     */
    public function getVariantOptions()
    {
        return $this->container['variant_options'];
    }

    /**
     * Sets variant_options
     *
     * @param \Vend202601\Model\VariantOption[]|null $variant_options A list of variant option objects.
     *
     * @return self
     */
    public function setVariantOptions($variant_options)
    {
        if (is_null($variant_options)) {
            throw new \InvalidArgumentException('non-nullable variant_options cannot be null');
        }
        $this->container['variant_options'] = $variant_options;

        return $this;
    }

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

    /**
     * Sets variant_parent_id
     *
     * @param string|null $variant_parent_id This value is set if a Product is a variant of another Product.
     *
     * @return self
     */
    public function setVariantParentId($variant_parent_id)
    {
        if (is_null($variant_parent_id)) {
            array_push($this->openAPINullablesSetToNull, 'variant_parent_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('variant_parent_id', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['variant_parent_id'] = $variant_parent_id;

        return $this;
    }

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

    /**
     * Sets version
     *
     * @param int|null $version Auto-incrementing object version number.
     *
     * @return self
     */
    public function setVersion($version)
    {
        if (is_null($version)) {
            throw new \InvalidArgumentException('non-nullable version cannot be null');
        }
        $this->container['version'] = $version;

        return $this;
    }

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

    /**
     * Sets weight
     *
     * @param float|null $weight Product weight. These are used to calculate variable shipping rates for stores using Lightspeed eCom.
     *
     * @return self
     */
    public function setWeight($weight)
    {
        if (is_null($weight)) {
            throw new \InvalidArgumentException('non-nullable weight cannot be null');
        }
        $this->container['weight'] = $weight;

        return $this;
    }

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

    /**
     * Sets weight_unit
     *
     * @param string|null $weight_unit Unit of measurement for product weight. These are used to calculate variable shipping rates for stores using Lightspeed eCom.
     *
     * @return self
     */
    public function setWeightUnit($weight_unit)
    {
        if (is_null($weight_unit)) {
            throw new \InvalidArgumentException('non-nullable weight_unit cannot be null');
        }
        $allowedValues = $this->getWeightUnitAllowableValues();
        if (!in_array($weight_unit, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'weight_unit', must be one of '%s'",
                    $weight_unit,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['weight_unit'] = $weight_unit;

        return $this;
    }

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

    /**
     * Sets width
     *
     * @param float|null $width Product width. These are used to calculate variable shipping rates for stores using Lightspeed eCom.
     *
     * @return self
     */
    public function setWidth($width)
    {
        if (is_null($width)) {
            throw new \InvalidArgumentException('non-nullable width cannot be null');
        }
        $this->container['width'] = $width;

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

    /**
     * Gets offset.
     *
     * @param integer|string $offset Offset
     *
     * @return mixed|null
     */
    #[\ReturnTypeWillChange]
    public function offsetGet(mixed $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|string $offset Offset
     *
     * @return void
     */
    public function offsetUnset(mixed $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));
    }
}


