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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'final_price' => 'float',
        'max_price' => 'float',
        'max_regular_price' => 'float',
        'minimal_regular_price' => 'float',
        'special_price' => 'float',
        'minimal_price' => 'float',
        'regular_price' => 'float',
        'formatted_prices' => '\Magento2\Model\CatalogDataProductRenderFormattedPriceInfoInterface',
        'extension_attributes' => '\Magento2\Model\CatalogDataProductRenderPriceInfoExtensionInterface'
    ];

    /**
      * 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 = [
        'final_price' => null,
        'max_price' => null,
        'max_regular_price' => null,
        'minimal_regular_price' => null,
        'special_price' => null,
        'minimal_price' => null,
        'regular_price' => null,
        'formatted_prices' => null,
        'extension_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 = [
        'final_price' => 'final_price',
        'max_price' => 'max_price',
        'max_regular_price' => 'max_regular_price',
        'minimal_regular_price' => 'minimal_regular_price',
        'special_price' => 'special_price',
        'minimal_price' => 'minimal_price',
        'regular_price' => 'regular_price',
        'formatted_prices' => 'formatted_prices',
        'extension_attributes' => 'extension_attributes'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'final_price' => 'setFinalPrice',
        'max_price' => 'setMaxPrice',
        'max_regular_price' => 'setMaxRegularPrice',
        'minimal_regular_price' => 'setMinimalRegularPrice',
        'special_price' => 'setSpecialPrice',
        'minimal_price' => 'setMinimalPrice',
        'regular_price' => 'setRegularPrice',
        'formatted_prices' => 'setFormattedPrices',
        'extension_attributes' => 'setExtensionAttributes'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'final_price' => 'getFinalPrice',
        'max_price' => 'getMaxPrice',
        'max_regular_price' => 'getMaxRegularPrice',
        'minimal_regular_price' => 'getMinimalRegularPrice',
        'special_price' => 'getSpecialPrice',
        'minimal_price' => 'getMinimalPrice',
        'regular_price' => 'getRegularPrice',
        'formatted_prices' => 'getFormattedPrices',
        'extension_attributes' => 'getExtensionAttributes'
    ];

    /**
     * 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['final_price'] = $data['final_price'] ?? null;
        $this->container['max_price'] = $data['max_price'] ?? null;
        $this->container['max_regular_price'] = $data['max_regular_price'] ?? null;
        $this->container['minimal_regular_price'] = $data['minimal_regular_price'] ?? null;
        $this->container['special_price'] = $data['special_price'] ?? null;
        $this->container['minimal_price'] = $data['minimal_price'] ?? null;
        $this->container['regular_price'] = $data['regular_price'] ?? null;
        $this->container['formatted_prices'] = $data['formatted_prices'] ?? null;
        $this->container['extension_attributes'] = $data['extension_attributes'] ?? null;
    }

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

        if ($this->container['final_price'] === null) {
            $invalidProperties[] = "'final_price' can't be null";
        }
        if ($this->container['max_price'] === null) {
            $invalidProperties[] = "'max_price' can't be null";
        }
        if ($this->container['max_regular_price'] === null) {
            $invalidProperties[] = "'max_regular_price' can't be null";
        }
        if ($this->container['minimal_regular_price'] === null) {
            $invalidProperties[] = "'minimal_regular_price' can't be null";
        }
        if ($this->container['special_price'] === null) {
            $invalidProperties[] = "'special_price' can't be null";
        }
        if ($this->container['minimal_price'] === null) {
            $invalidProperties[] = "'minimal_price' can't be null";
        }
        if ($this->container['regular_price'] === null) {
            $invalidProperties[] = "'regular_price' can't be null";
        }
        if ($this->container['formatted_prices'] === null) {
            $invalidProperties[] = "'formatted_prices' 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 final_price
     *
     * @return float
     */
    public function getFinalPrice()
    {
        return $this->container['final_price'];
    }

    /**
     * Sets final_price
     *
     * @param float $final_price Final price
     *
     * @return self
     */
    public function setFinalPrice($final_price)
    {
        $this->container['final_price'] = $final_price;

        return $this;
    }

    /**
     * Gets max_price
     *
     * @return float
     */
    public function getMaxPrice()
    {
        return $this->container['max_price'];
    }

    /**
     * Sets max_price
     *
     * @param float $max_price Max price of a product
     *
     * @return self
     */
    public function setMaxPrice($max_price)
    {
        $this->container['max_price'] = $max_price;

        return $this;
    }

    /**
     * Gets max_regular_price
     *
     * @return float
     */
    public function getMaxRegularPrice()
    {
        return $this->container['max_regular_price'];
    }

    /**
     * Sets max_regular_price
     *
     * @param float $max_regular_price Max regular price
     *
     * @return self
     */
    public function setMaxRegularPrice($max_regular_price)
    {
        $this->container['max_regular_price'] = $max_regular_price;

        return $this;
    }

    /**
     * Gets minimal_regular_price
     *
     * @return float
     */
    public function getMinimalRegularPrice()
    {
        return $this->container['minimal_regular_price'];
    }

    /**
     * Sets minimal_regular_price
     *
     * @param float $minimal_regular_price Minimal regular price
     *
     * @return self
     */
    public function setMinimalRegularPrice($minimal_regular_price)
    {
        $this->container['minimal_regular_price'] = $minimal_regular_price;

        return $this;
    }

    /**
     * Gets special_price
     *
     * @return float
     */
    public function getSpecialPrice()
    {
        return $this->container['special_price'];
    }

    /**
     * Sets special_price
     *
     * @param float $special_price Special price
     *
     * @return self
     */
    public function setSpecialPrice($special_price)
    {
        $this->container['special_price'] = $special_price;

        return $this;
    }

    /**
     * Gets minimal_price
     *
     * @return float
     */
    public function getMinimalPrice()
    {
        return $this->container['minimal_price'];
    }

    /**
     * Sets minimal_price
     *
     * @param float $minimal_price Minimal price
     *
     * @return self
     */
    public function setMinimalPrice($minimal_price)
    {
        $this->container['minimal_price'] = $minimal_price;

        return $this;
    }

    /**
     * Gets regular_price
     *
     * @return float
     */
    public function getRegularPrice()
    {
        return $this->container['regular_price'];
    }

    /**
     * Sets regular_price
     *
     * @param float $regular_price Regular price
     *
     * @return self
     */
    public function setRegularPrice($regular_price)
    {
        $this->container['regular_price'] = $regular_price;

        return $this;
    }

    /**
     * Gets formatted_prices
     *
     * @return \Magento2\Model\CatalogDataProductRenderFormattedPriceInfoInterface
     */
    public function getFormattedPrices()
    {
        return $this->container['formatted_prices'];
    }

    /**
     * Sets formatted_prices
     *
     * @param \Magento2\Model\CatalogDataProductRenderFormattedPriceInfoInterface $formatted_prices formatted_prices
     *
     * @return self
     */
    public function setFormattedPrices($formatted_prices)
    {
        $this->container['formatted_prices'] = $formatted_prices;

        return $this;
    }

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

    /**
     * Sets extension_attributes
     *
     * @param \Magento2\Model\CatalogDataProductRenderPriceInfoExtensionInterface|null $extension_attributes extension_attributes
     *
     * @return self
     */
    public function setExtensionAttributes($extension_attributes)
    {
        $this->container['extension_attributes'] = $extension_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));
    }
}


