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

/**
 * Magento Community
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 2.3
 * 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 Magento2\Model;

use \ArrayAccess;
use \Magento2\ObjectSerializer;

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

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $openAPIModelName = 'catalog-data-product-interface';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'id' => 'int',
        'sku' => 'string',
        'name' => 'string',
        'attribute_set_id' => 'int',
        'price' => 'float',
        'status' => 'int',
        'visibility' => 'int',
        'type_id' => 'string',
        'created_at' => 'string',
        'updated_at' => 'string',
        'weight' => 'float',
        'extension_attributes' => '\Magento2\Model\CatalogDataProductExtensionInterface',
        'product_links' => '\Magento2\Model\CatalogDataProductLinkInterface[]',
        'options' => '\Magento2\Model\CatalogDataProductCustomOptionInterface[]',
        'media_gallery_entries' => '\Magento2\Model\CatalogDataProductAttributeMediaGalleryEntryInterface[]',
        'tier_prices' => '\Magento2\Model\CatalogDataProductTierPriceInterface[]',
        'custom_attributes' => '\Magento2\Model\FrameworkAttributeInterface[]'
    ];

    /**
      * 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' => null,
        'sku' => null,
        'name' => null,
        'attribute_set_id' => null,
        'price' => null,
        'status' => null,
        'visibility' => null,
        'type_id' => null,
        'created_at' => null,
        'updated_at' => null,
        'weight' => null,
        'extension_attributes' => null,
        'product_links' => null,
        'options' => null,
        'media_gallery_entries' => null,
        'tier_prices' => null,
        'custom_attributes' => 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 = [
        'id' => 'id',
        'sku' => 'sku',
        'name' => 'name',
        'attribute_set_id' => 'attribute_set_id',
        'price' => 'price',
        'status' => 'status',
        'visibility' => 'visibility',
        'type_id' => 'type_id',
        'created_at' => 'created_at',
        'updated_at' => 'updated_at',
        'weight' => 'weight',
        'extension_attributes' => 'extension_attributes',
        'product_links' => 'product_links',
        'options' => 'options',
        'media_gallery_entries' => 'media_gallery_entries',
        'tier_prices' => 'tier_prices',
        'custom_attributes' => 'custom_attributes'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
        'sku' => 'setSku',
        'name' => 'setName',
        'attribute_set_id' => 'setAttributeSetId',
        'price' => 'setPrice',
        'status' => 'setStatus',
        'visibility' => 'setVisibility',
        'type_id' => 'setTypeId',
        'created_at' => 'setCreatedAt',
        'updated_at' => 'setUpdatedAt',
        'weight' => 'setWeight',
        'extension_attributes' => 'setExtensionAttributes',
        'product_links' => 'setProductLinks',
        'options' => 'setOptions',
        'media_gallery_entries' => 'setMediaGalleryEntries',
        'tier_prices' => 'setTierPrices',
        'custom_attributes' => 'setCustomAttributes'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
        'sku' => 'getSku',
        'name' => 'getName',
        'attribute_set_id' => 'getAttributeSetId',
        'price' => 'getPrice',
        'status' => 'getStatus',
        'visibility' => 'getVisibility',
        'type_id' => 'getTypeId',
        'created_at' => 'getCreatedAt',
        'updated_at' => 'getUpdatedAt',
        'weight' => 'getWeight',
        'extension_attributes' => 'getExtensionAttributes',
        'product_links' => 'getProductLinks',
        'options' => 'getOptions',
        'media_gallery_entries' => 'getMediaGalleryEntries',
        'tier_prices' => 'getTierPrices',
        'custom_attributes' => 'getCustomAttributes'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$openAPIModelName;
    }


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

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['id'] = $data['id'] ?? null;
        $this->container['sku'] = $data['sku'] ?? null;
        $this->container['name'] = $data['name'] ?? null;
        $this->container['attribute_set_id'] = $data['attribute_set_id'] ?? null;
        $this->container['price'] = $data['price'] ?? null;
        $this->container['status'] = $data['status'] ?? null;
        $this->container['visibility'] = $data['visibility'] ?? null;
        $this->container['type_id'] = $data['type_id'] ?? null;
        $this->container['created_at'] = $data['created_at'] ?? null;
        $this->container['updated_at'] = $data['updated_at'] ?? null;
        $this->container['weight'] = $data['weight'] ?? null;
        $this->container['extension_attributes'] = $data['extension_attributes'] ?? null;
        $this->container['product_links'] = $data['product_links'] ?? null;
        $this->container['options'] = $data['options'] ?? null;
        $this->container['media_gallery_entries'] = $data['media_gallery_entries'] ?? null;
        $this->container['tier_prices'] = $data['tier_prices'] ?? null;
        $this->container['custom_attributes'] = $data['custom_attributes'] ?? null;
    }

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

        if ($this->container['sku'] === null) {
            $invalidProperties[] = "'sku' can't be null";
        }
        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 sku
     *
     * @return string
     */
    public function getSku()
    {
        return $this->container['sku'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets attribute_set_id
     *
     * @param int|null $attribute_set_id Attribute set id
     *
     * @return self
     */
    public function setAttributeSetId($attribute_set_id)
    {
        $this->container['attribute_set_id'] = $attribute_set_id;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets extension_attributes
     *
     * @return \Magento2\Model\CatalogDataProductExtensionInterface|null
     */
    public function getExtensionAttributes()
    {
        return $this->container['extension_attributes'];
    }

    /**
     * Sets extension_attributes
     *
     * @param \Magento2\Model\CatalogDataProductExtensionInterface|null $extension_attributes extension_attributes
     *
     * @return self
     */
    public function setExtensionAttributes($extension_attributes)
    {
        $this->container['extension_attributes'] = $extension_attributes;

        return $this;
    }

    /**
     * Gets product_links
     *
     * @return \Magento2\Model\CatalogDataProductLinkInterface[]|null
     */
    public function getProductLinks()
    {
        return $this->container['product_links'];
    }

    /**
     * Sets product_links
     *
     * @param \Magento2\Model\CatalogDataProductLinkInterface[]|null $product_links Product links info
     *
     * @return self
     */
    public function setProductLinks($product_links)
    {
        $this->container['product_links'] = $product_links;

        return $this;
    }

    /**
     * Gets options
     *
     * @return \Magento2\Model\CatalogDataProductCustomOptionInterface[]|null
     */
    public function getOptions()
    {
        return $this->container['options'];
    }

    /**
     * Sets options
     *
     * @param \Magento2\Model\CatalogDataProductCustomOptionInterface[]|null $options List of product options
     *
     * @return self
     */
    public function setOptions($options)
    {
        $this->container['options'] = $options;

        return $this;
    }

    /**
     * Gets media_gallery_entries
     *
     * @return \Magento2\Model\CatalogDataProductAttributeMediaGalleryEntryInterface[]|null
     */
    public function getMediaGalleryEntries()
    {
        return $this->container['media_gallery_entries'];
    }

    /**
     * Sets media_gallery_entries
     *
     * @param \Magento2\Model\CatalogDataProductAttributeMediaGalleryEntryInterface[]|null $media_gallery_entries Media gallery entries
     *
     * @return self
     */
    public function setMediaGalleryEntries($media_gallery_entries)
    {
        $this->container['media_gallery_entries'] = $media_gallery_entries;

        return $this;
    }

    /**
     * Gets tier_prices
     *
     * @return \Magento2\Model\CatalogDataProductTierPriceInterface[]|null
     */
    public function getTierPrices()
    {
        return $this->container['tier_prices'];
    }

    /**
     * Sets tier_prices
     *
     * @param \Magento2\Model\CatalogDataProductTierPriceInterface[]|null $tier_prices List of product tier prices
     *
     * @return self
     */
    public function setTierPrices($tier_prices)
    {
        $this->container['tier_prices'] = $tier_prices;

        return $this;
    }

    /**
     * Gets custom_attributes
     *
     * @return \Magento2\Model\FrameworkAttributeInterface[]|null
     */
    public function getCustomAttributes()
    {
        return $this->container['custom_attributes'];
    }

    /**
     * Sets custom_attributes
     *
     * @param \Magento2\Model\FrameworkAttributeInterface[]|null $custom_attributes Custom attributes values.
     *
     * @return self
     */
    public function setCustomAttributes($custom_attributes)
    {
        $this->container['custom_attributes'] = $custom_attributes;

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


