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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'website_ids' => 'int[]',
        'category_links' => '\Magento2\Model\CatalogDataCategoryLinkInterface[]',
        'stock_item' => '\Magento2\Model\CatalogInventoryDataStockItemInterface',
        'configurable_product_options' => '\Magento2\Model\ConfigurableProductDataOptionInterface[]',
        'configurable_product_links' => 'int[]',
        'downloadable_product_links' => '\Magento2\Model\DownloadableDataLinkInterface[]',
        'downloadable_product_samples' => '\Magento2\Model\DownloadableDataSampleInterface[]',
        'bundle_product_options' => '\Magento2\Model\BundleDataOptionInterface[]'
    ];

    /**
      * 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 = [
        'website_ids' => null,
        'category_links' => null,
        'stock_item' => null,
        'configurable_product_options' => null,
        'configurable_product_links' => null,
        'downloadable_product_links' => null,
        'downloadable_product_samples' => null,
        'bundle_product_options' => 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 = [
        'website_ids' => 'website_ids',
        'category_links' => 'category_links',
        'stock_item' => 'stock_item',
        'configurable_product_options' => 'configurable_product_options',
        'configurable_product_links' => 'configurable_product_links',
        'downloadable_product_links' => 'downloadable_product_links',
        'downloadable_product_samples' => 'downloadable_product_samples',
        'bundle_product_options' => 'bundle_product_options'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'website_ids' => 'setWebsiteIds',
        'category_links' => 'setCategoryLinks',
        'stock_item' => 'setStockItem',
        'configurable_product_options' => 'setConfigurableProductOptions',
        'configurable_product_links' => 'setConfigurableProductLinks',
        'downloadable_product_links' => 'setDownloadableProductLinks',
        'downloadable_product_samples' => 'setDownloadableProductSamples',
        'bundle_product_options' => 'setBundleProductOptions'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'website_ids' => 'getWebsiteIds',
        'category_links' => 'getCategoryLinks',
        'stock_item' => 'getStockItem',
        'configurable_product_options' => 'getConfigurableProductOptions',
        'configurable_product_links' => 'getConfigurableProductLinks',
        'downloadable_product_links' => 'getDownloadableProductLinks',
        'downloadable_product_samples' => 'getDownloadableProductSamples',
        'bundle_product_options' => 'getBundleProductOptions'
    ];

    /**
     * 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['website_ids'] = $data['website_ids'] ?? null;
        $this->container['category_links'] = $data['category_links'] ?? null;
        $this->container['stock_item'] = $data['stock_item'] ?? null;
        $this->container['configurable_product_options'] = $data['configurable_product_options'] ?? null;
        $this->container['configurable_product_links'] = $data['configurable_product_links'] ?? null;
        $this->container['downloadable_product_links'] = $data['downloadable_product_links'] ?? null;
        $this->container['downloadable_product_samples'] = $data['downloadable_product_samples'] ?? null;
        $this->container['bundle_product_options'] = $data['bundle_product_options'] ?? 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 website_ids
     *
     * @return int[]|null
     */
    public function getWebsiteIds()
    {
        return $this->container['website_ids'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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


