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

/**
 * Flotiq User API
 *
 * ## Getting started  This API Documentation reflects the endpoints defined in your [Flotiq](https://flotiq.com) account. The documentation is generated using an OpenAPI schema describing the API, which can be obtained in several flavors:  - [OAS 3.0/3.1](https://api.flotiq.com/api/v1/open-api-schema.json?auth_token=REPLACE_KEY_VALUE)   - without hydration, will not expand relations between content types (this is the default version which provides maximum compatibility with downstream systems)   - with hydration, pass [hydrate=1](https://api.flotiq.com/api/v1/open-api-schema.json?auth_token=REPLACE_KEY_VALUE&amp;hydrate=1) - use this for a better type support in exported OpenAPI schemas   - without system endpoints, pass [user_only=1](https://api.flotiq.com/api/v1/open-api-schema.json?auth_token=REPLACE_KEY_VALUE&amp;hydrate=1&amp;user_only=1) - use this to only include your endpoints, without system ones   - for version 3.1, pass [version=3.1](https://api.flotiq.com/api/v1/open-api-schema.json?auth_token=REPLACE_KEY_VALUE&amp;version=3.1) - [OAS 2.0](https://api.flotiq.com/api/v1/open-api-schema.json?auth_token=REPLACE_KEY_VALUE&amp;version=2) - provided for compatibility with several older systems  Check Flotiq documentation for more information about [Flotiq OpenAPI capabilities](https://flotiq.com/docs/API/open-api-schema/), instructions how to generate code and other useful tips.  ### Access to data  There are several methods that you can use to access your data:  * Live API docs - available via &lt;code&gt;Try it out&lt;/code&gt; button available next to each endpoint   * Copying example code on the right side of each endpoint  * By downloading the SDKs available in multiple languages.  * By downloading the Postman collection and importing it into Postman.    Each of these methods is described in length in the [user documentation](https://flotiq.com/docs/).   ### Authorization   In order to make use of the provided documentation, example code, SDKs and so on - you will need to pull out your API key. We recommend that you start with the ReadOnly API Key which will allow you to make all the `GET` requests but will error-out when you try to modify content. Please remember to replace the key for `POST`, `PUT` and `DELETE` calls.   It&#039;s also possible to use scoped API keys - you can create those in the API keys section of the Flotiq user interface. This will allow you to create a key that only authorizes access to a specific content type (or a set of content types, if you choose so). Read more about how to use and create API keys in the [API keys documentation](https://flotiq.com/docs/API/).   ## Object access   Once you define a Content Type it will become available in your Content API as a set of endpoints that will allow you to work with objects:   * create  * list  * update  * delete  * batch create  * retrieve single object.  ### Hydration   When you build Content Types that have relation to others your objects will optionally support hydration of related entities. The endpoints that support object retrieval accept a `hydrate` parameter, which can be used to easily fetch hydrated objects. Since this breaks the standard REST concepts - it&#039;s not enabled by default, but it&#039;s a very handy feature that allows to reduce the amount of HTTP requests sent over the wire and we strongly recommend to use it.
 *
 * The version of the OpenAPI document: 2.0.1
 * Contact: hello@flotiq.com
 * 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 OpenAPI\Client\Model;

use \ArrayAccess;
use \OpenAPI\Client\ObjectSerializer;

/**
 * AbstractContentTypeSchemaDefinitionInternal Class Doc Comment
 *
 * @category Class
 * @description Immutable object containing system information, it will be automatically generated on object creation and regenerated on updates.
 * @package  OpenAPI\Client
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<TKey, TValue>
 * @template TKey int|null
 * @template TValue mixed|null
 */
class AbstractContentTypeSchemaDefinitionInternal implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $openAPIModelName = 'AbstractContentTypeSchemaDefinition_internal';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'content_type' => 'string',
        'created_at' => 'string',
        'updated_at' => 'string',
        'deleted_at' => 'string',
        'workflow_state' => 'string',
        'status' => 'string',
        'object_title' => 'string',
        'latest_version' => 'float',
        'workflow_public_version' => 'float',
        'workflow_published_at' => 'string',
        'published_at' => 'string',
        'public_version' => 'float'
    ];

    /**
      * 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 = [
        'content_type' => null,
        'created_at' => null,
        'updated_at' => null,
        'deleted_at' => null,
        'workflow_state' => null,
        'status' => null,
        'object_title' => null,
        'latest_version' => null,
        'workflow_public_version' => null,
        'workflow_published_at' => null,
        'published_at' => null,
        'public_version' => 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 = [
        'content_type' => 'contentType',
        'created_at' => 'createdAt',
        'updated_at' => 'updatedAt',
        'deleted_at' => 'deletedAt',
        'workflow_state' => 'workflowState',
        'status' => 'status',
        'object_title' => 'objectTitle',
        'latest_version' => 'latestVersion',
        'workflow_public_version' => 'workflowPublicVersion',
        'workflow_published_at' => 'workflowPublishedAt',
        'published_at' => 'publishedAt',
        'public_version' => 'publicVersion'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'content_type' => 'setContentType',
        'created_at' => 'setCreatedAt',
        'updated_at' => 'setUpdatedAt',
        'deleted_at' => 'setDeletedAt',
        'workflow_state' => 'setWorkflowState',
        'status' => 'setStatus',
        'object_title' => 'setObjectTitle',
        'latest_version' => 'setLatestVersion',
        'workflow_public_version' => 'setWorkflowPublicVersion',
        'workflow_published_at' => 'setWorkflowPublishedAt',
        'published_at' => 'setPublishedAt',
        'public_version' => 'setPublicVersion'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'content_type' => 'getContentType',
        'created_at' => 'getCreatedAt',
        'updated_at' => 'getUpdatedAt',
        'deleted_at' => 'getDeletedAt',
        'workflow_state' => 'getWorkflowState',
        'status' => 'getStatus',
        'object_title' => 'getObjectTitle',
        'latest_version' => 'getLatestVersion',
        'workflow_public_version' => 'getWorkflowPublicVersion',
        'workflow_published_at' => 'getWorkflowPublishedAt',
        'published_at' => 'getPublishedAt',
        'public_version' => 'getPublicVersion'
    ];

    /**
     * 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['content_type'] = $data['content_type'] ?? null;
        $this->container['created_at'] = $data['created_at'] ?? null;
        $this->container['updated_at'] = $data['updated_at'] ?? null;
        $this->container['deleted_at'] = $data['deleted_at'] ?? null;
        $this->container['workflow_state'] = $data['workflow_state'] ?? null;
        $this->container['status'] = $data['status'] ?? null;
        $this->container['object_title'] = $data['object_title'] ?? null;
        $this->container['latest_version'] = $data['latest_version'] ?? null;
        $this->container['workflow_public_version'] = $data['workflow_public_version'] ?? null;
        $this->container['workflow_published_at'] = $data['workflow_published_at'] ?? null;
        $this->container['published_at'] = $data['published_at'] ?? null;
        $this->container['public_version'] = $data['public_version'] ?? null;
    }

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

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

    /**
     * Sets content_type
     *
     * @param string $content_type Name of Content Type Definition of object
     *
     * @return self
     */
    public function setContentType($content_type)
    {
        $this->container['content_type'] = $content_type;

        return $this;
    }

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

    /**
     * Sets created_at
     *
     * @param string $created_at Date and time of creation of Content Object, in ISO 8601 date format
     *
     * @return self
     */
    public function setCreatedAt($created_at)
    {
        $this->container['created_at'] = $created_at;

        return $this;
    }

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

    /**
     * Sets updated_at
     *
     * @param string $updated_at Date and time of last update of Content Object, in ISO 8601 date format
     *
     * @return self
     */
    public function setUpdatedAt($updated_at)
    {
        $this->container['updated_at'] = $updated_at;

        return $this;
    }

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

    /**
     * Sets deleted_at
     *
     * @param string $deleted_at Date and time of deletion of Content Object, in ISO 8601 date format
     *
     * @return self
     */
    public function setDeletedAt($deleted_at)
    {
        $this->container['deleted_at'] = $deleted_at;

        return $this;
    }

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

    /**
     * Sets workflow_state
     *
     * @param string|null $workflow_state Information about object's current state in workflow
     *
     * @return self
     */
    public function setWorkflowState($workflow_state)
    {
        $this->container['workflow_state'] = $workflow_state;

        return $this;
    }

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

    /**
     * Sets status
     *
     * @param string|null $status Information about object's current status. Available states: draft, public, modified
     *
     * @return self
     */
    public function setStatus($status)
    {
        $this->container['status'] = $status;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets latest_version
     *
     * @param float|null $latest_version Latest version of the Content Object
     *
     * @return self
     */
    public function setLatestVersion($latest_version)
    {
        $this->container['latest_version'] = $latest_version;

        return $this;
    }

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

    /**
     * Sets workflow_public_version
     *
     * @param float|null $workflow_public_version number of latest published version of Content Object
     *
     * @return self
     */
    public function setWorkflowPublicVersion($workflow_public_version)
    {
        $this->container['workflow_public_version'] = $workflow_public_version;

        return $this;
    }

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

    /**
     * Sets workflow_published_at
     *
     * @param string|null $workflow_published_at publication date of latest publish version of Content Object
     *
     * @return self
     */
    public function setWorkflowPublishedAt($workflow_published_at)
    {
        $this->container['workflow_published_at'] = $workflow_published_at;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets public_version
     *
     * @param float|null $public_version number of latest published version of Content Object
     *
     * @return self
     */
    public function setPublicVersion($public_version)
    {
        $this->container['public_version'] = $public_version;

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


