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

/**
 * CmsDataPageInterface Class Doc Comment
 *
 * @category Class
 * @description CMS page 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 CmsDataPageInterface implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'id' => 'int',
        'identifier' => 'string',
        'title' => 'string',
        'page_layout' => 'string',
        'meta_title' => 'string',
        'meta_keywords' => 'string',
        'meta_description' => 'string',
        'content_heading' => 'string',
        'content' => 'string',
        'creation_time' => 'string',
        'update_time' => 'string',
        'sort_order' => 'string',
        'layout_update_xml' => 'string',
        'custom_theme' => 'string',
        'custom_root_template' => 'string',
        'custom_layout_update_xml' => 'string',
        'custom_theme_from' => 'string',
        'custom_theme_to' => 'string',
        'active' => 'bool'
    ];

    /**
      * 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,
        'identifier' => null,
        'title' => null,
        'page_layout' => null,
        'meta_title' => null,
        'meta_keywords' => null,
        'meta_description' => null,
        'content_heading' => null,
        'content' => null,
        'creation_time' => null,
        'update_time' => null,
        'sort_order' => null,
        'layout_update_xml' => null,
        'custom_theme' => null,
        'custom_root_template' => null,
        'custom_layout_update_xml' => null,
        'custom_theme_from' => null,
        'custom_theme_to' => null,
        'active' => 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',
        'identifier' => 'identifier',
        'title' => 'title',
        'page_layout' => 'page_layout',
        'meta_title' => 'meta_title',
        'meta_keywords' => 'meta_keywords',
        'meta_description' => 'meta_description',
        'content_heading' => 'content_heading',
        'content' => 'content',
        'creation_time' => 'creation_time',
        'update_time' => 'update_time',
        'sort_order' => 'sort_order',
        'layout_update_xml' => 'layout_update_xml',
        'custom_theme' => 'custom_theme',
        'custom_root_template' => 'custom_root_template',
        'custom_layout_update_xml' => 'custom_layout_update_xml',
        'custom_theme_from' => 'custom_theme_from',
        'custom_theme_to' => 'custom_theme_to',
        'active' => 'active'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
        'identifier' => 'setIdentifier',
        'title' => 'setTitle',
        'page_layout' => 'setPageLayout',
        'meta_title' => 'setMetaTitle',
        'meta_keywords' => 'setMetaKeywords',
        'meta_description' => 'setMetaDescription',
        'content_heading' => 'setContentHeading',
        'content' => 'setContent',
        'creation_time' => 'setCreationTime',
        'update_time' => 'setUpdateTime',
        'sort_order' => 'setSortOrder',
        'layout_update_xml' => 'setLayoutUpdateXml',
        'custom_theme' => 'setCustomTheme',
        'custom_root_template' => 'setCustomRootTemplate',
        'custom_layout_update_xml' => 'setCustomLayoutUpdateXml',
        'custom_theme_from' => 'setCustomThemeFrom',
        'custom_theme_to' => 'setCustomThemeTo',
        'active' => 'setActive'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
        'identifier' => 'getIdentifier',
        'title' => 'getTitle',
        'page_layout' => 'getPageLayout',
        'meta_title' => 'getMetaTitle',
        'meta_keywords' => 'getMetaKeywords',
        'meta_description' => 'getMetaDescription',
        'content_heading' => 'getContentHeading',
        'content' => 'getContent',
        'creation_time' => 'getCreationTime',
        'update_time' => 'getUpdateTime',
        'sort_order' => 'getSortOrder',
        'layout_update_xml' => 'getLayoutUpdateXml',
        'custom_theme' => 'getCustomTheme',
        'custom_root_template' => 'getCustomRootTemplate',
        'custom_layout_update_xml' => 'getCustomLayoutUpdateXml',
        'custom_theme_from' => 'getCustomThemeFrom',
        'custom_theme_to' => 'getCustomThemeTo',
        'active' => 'getActive'
    ];

    /**
     * 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['identifier'] = $data['identifier'] ?? null;
        $this->container['title'] = $data['title'] ?? null;
        $this->container['page_layout'] = $data['page_layout'] ?? null;
        $this->container['meta_title'] = $data['meta_title'] ?? null;
        $this->container['meta_keywords'] = $data['meta_keywords'] ?? null;
        $this->container['meta_description'] = $data['meta_description'] ?? null;
        $this->container['content_heading'] = $data['content_heading'] ?? null;
        $this->container['content'] = $data['content'] ?? null;
        $this->container['creation_time'] = $data['creation_time'] ?? null;
        $this->container['update_time'] = $data['update_time'] ?? null;
        $this->container['sort_order'] = $data['sort_order'] ?? null;
        $this->container['layout_update_xml'] = $data['layout_update_xml'] ?? null;
        $this->container['custom_theme'] = $data['custom_theme'] ?? null;
        $this->container['custom_root_template'] = $data['custom_root_template'] ?? null;
        $this->container['custom_layout_update_xml'] = $data['custom_layout_update_xml'] ?? null;
        $this->container['custom_theme_from'] = $data['custom_theme_from'] ?? null;
        $this->container['custom_theme_to'] = $data['custom_theme_to'] ?? null;
        $this->container['active'] = $data['active'] ?? null;
    }

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets page_layout
     *
     * @param string|null $page_layout Page layout
     *
     * @return self
     */
    public function setPageLayout($page_layout)
    {
        $this->container['page_layout'] = $page_layout;

        return $this;
    }

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

    /**
     * Sets meta_title
     *
     * @param string|null $meta_title Meta title
     *
     * @return self
     */
    public function setMetaTitle($meta_title)
    {
        $this->container['meta_title'] = $meta_title;

        return $this;
    }

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

    /**
     * Sets meta_keywords
     *
     * @param string|null $meta_keywords Meta keywords
     *
     * @return self
     */
    public function setMetaKeywords($meta_keywords)
    {
        $this->container['meta_keywords'] = $meta_keywords;

        return $this;
    }

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

    /**
     * Sets meta_description
     *
     * @param string|null $meta_description Meta description
     *
     * @return self
     */
    public function setMetaDescription($meta_description)
    {
        $this->container['meta_description'] = $meta_description;

        return $this;
    }

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

    /**
     * Sets content_heading
     *
     * @param string|null $content_heading Content heading
     *
     * @return self
     */
    public function setContentHeading($content_heading)
    {
        $this->container['content_heading'] = $content_heading;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets creation_time
     *
     * @param string|null $creation_time Creation time
     *
     * @return self
     */
    public function setCreationTime($creation_time)
    {
        $this->container['creation_time'] = $creation_time;

        return $this;
    }

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

    /**
     * Sets update_time
     *
     * @param string|null $update_time Update time
     *
     * @return self
     */
    public function setUpdateTime($update_time)
    {
        $this->container['update_time'] = $update_time;

        return $this;
    }

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

    /**
     * Sets sort_order
     *
     * @param string|null $sort_order Sort order
     *
     * @return self
     */
    public function setSortOrder($sort_order)
    {
        $this->container['sort_order'] = $sort_order;

        return $this;
    }

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

    /**
     * Sets layout_update_xml
     *
     * @param string|null $layout_update_xml Layout update xml
     *
     * @return self
     */
    public function setLayoutUpdateXml($layout_update_xml)
    {
        $this->container['layout_update_xml'] = $layout_update_xml;

        return $this;
    }

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

    /**
     * Sets custom_theme
     *
     * @param string|null $custom_theme Custom theme
     *
     * @return self
     */
    public function setCustomTheme($custom_theme)
    {
        $this->container['custom_theme'] = $custom_theme;

        return $this;
    }

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

    /**
     * Sets custom_root_template
     *
     * @param string|null $custom_root_template Custom root template
     *
     * @return self
     */
    public function setCustomRootTemplate($custom_root_template)
    {
        $this->container['custom_root_template'] = $custom_root_template;

        return $this;
    }

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

    /**
     * Sets custom_layout_update_xml
     *
     * @param string|null $custom_layout_update_xml Custom layout update xml
     *
     * @return self
     */
    public function setCustomLayoutUpdateXml($custom_layout_update_xml)
    {
        $this->container['custom_layout_update_xml'] = $custom_layout_update_xml;

        return $this;
    }

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

    /**
     * Sets custom_theme_from
     *
     * @param string|null $custom_theme_from Custom theme from
     *
     * @return self
     */
    public function setCustomThemeFrom($custom_theme_from)
    {
        $this->container['custom_theme_from'] = $custom_theme_from;

        return $this;
    }

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

    /**
     * Sets custom_theme_to
     *
     * @param string|null $custom_theme_to Custom theme to
     *
     * @return self
     */
    public function setCustomThemeTo($custom_theme_to)
    {
        $this->container['custom_theme_to'] = $custom_theme_to;

        return $this;
    }

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

    /**
     * Sets active
     *
     * @param bool|null $active Active
     *
     * @return self
     */
    public function setActive($active)
    {
        $this->container['active'] = $active;

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


