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

/**
 * MsrpDataProductRenderMsrpPriceInfoInterface 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 MsrpDataProductRenderMsrpPriceInfoInterface implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'msrp_price' => 'string',
        'is_applicable' => 'string',
        'is_shown_price_on_gesture' => 'string',
        'msrp_message' => 'string',
        'explanation_message' => 'string',
        'extension_attributes' => 'object'
    ];

    /**
      * 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 = [
        'msrp_price' => null,
        'is_applicable' => null,
        'is_shown_price_on_gesture' => null,
        'msrp_message' => null,
        'explanation_message' => 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 = [
        'msrp_price' => 'msrp_price',
        'is_applicable' => 'is_applicable',
        'is_shown_price_on_gesture' => 'is_shown_price_on_gesture',
        'msrp_message' => 'msrp_message',
        'explanation_message' => 'explanation_message',
        'extension_attributes' => 'extension_attributes'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'msrp_price' => 'setMsrpPrice',
        'is_applicable' => 'setIsApplicable',
        'is_shown_price_on_gesture' => 'setIsShownPriceOnGesture',
        'msrp_message' => 'setMsrpMessage',
        'explanation_message' => 'setExplanationMessage',
        'extension_attributes' => 'setExtensionAttributes'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'msrp_price' => 'getMsrpPrice',
        'is_applicable' => 'getIsApplicable',
        'is_shown_price_on_gesture' => 'getIsShownPriceOnGesture',
        'msrp_message' => 'getMsrpMessage',
        'explanation_message' => 'getExplanationMessage',
        '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['msrp_price'] = $data['msrp_price'] ?? null;
        $this->container['is_applicable'] = $data['is_applicable'] ?? null;
        $this->container['is_shown_price_on_gesture'] = $data['is_shown_price_on_gesture'] ?? null;
        $this->container['msrp_message'] = $data['msrp_message'] ?? null;
        $this->container['explanation_message'] = $data['explanation_message'] ?? 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['msrp_price'] === null) {
            $invalidProperties[] = "'msrp_price' can't be null";
        }
        if ($this->container['is_applicable'] === null) {
            $invalidProperties[] = "'is_applicable' can't be null";
        }
        if ($this->container['is_shown_price_on_gesture'] === null) {
            $invalidProperties[] = "'is_shown_price_on_gesture' can't be null";
        }
        if ($this->container['msrp_message'] === null) {
            $invalidProperties[] = "'msrp_message' can't be null";
        }
        if ($this->container['explanation_message'] === null) {
            $invalidProperties[] = "'explanation_message' 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 msrp_price
     *
     * @return string
     */
    public function getMsrpPrice()
    {
        return $this->container['msrp_price'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets extension_attributes
     *
     * @param object|null $extension_attributes ExtensionInterface class for @see \\Magento\\Msrp\\Api\\Data\\ProductRender\\MsrpPriceInfoInterface
     *
     * @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));
    }
}


