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

/**
 * SV Register Web-services
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 4.15
 * 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 SmartVolution\Model;

use \ArrayAccess;
use \SmartVolution\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'id' => 'int',
        'tenantId' => 'int',
        'title' => 'string',
        'startTime' => '\DateTime',
        'endTime' => '\DateTime',
        'appointmentType' => 'int',
        'typeName' => 'string',
        'notes' => 'string',
        'storeId' => 'int',
        'storeName' => 'string',
        'clerkId' => 'int',
        'clerkName' => 'string',
        'customerId' => 'int',
        'customerName' => 'string',
        'modified' => 'int'
    ];

    /**
      * 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' => 'int64',
        'tenantId' => 'int64',
        'title' => null,
        'startTime' => 'date-time',
        'endTime' => 'date-time',
        'appointmentType' => 'int64',
        'typeName' => null,
        'notes' => null,
        'storeId' => 'int64',
        'storeName' => null,
        'clerkId' => 'int64',
        'clerkName' => null,
        'customerId' => 'int64',
        'customerName' => null,
        'modified' => 'int64'
    ];

    /**
     * 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',
        'tenantId' => 'tenantId',
        'title' => 'title',
        'startTime' => 'startTime',
        'endTime' => 'endTime',
        'appointmentType' => 'appointmentType',
        'typeName' => 'typeName',
        'notes' => 'notes',
        'storeId' => 'storeId',
        'storeName' => 'storeName',
        'clerkId' => 'clerkId',
        'clerkName' => 'clerkName',
        'customerId' => 'customerId',
        'customerName' => 'customerName',
        'modified' => 'modified'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
        'tenantId' => 'setTenantId',
        'title' => 'setTitle',
        'startTime' => 'setStartTime',
        'endTime' => 'setEndTime',
        'appointmentType' => 'setAppointmentType',
        'typeName' => 'setTypeName',
        'notes' => 'setNotes',
        'storeId' => 'setStoreId',
        'storeName' => 'setStoreName',
        'clerkId' => 'setClerkId',
        'clerkName' => 'setClerkName',
        'customerId' => 'setCustomerId',
        'customerName' => 'setCustomerName',
        'modified' => 'setModified'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
        'tenantId' => 'getTenantId',
        'title' => 'getTitle',
        'startTime' => 'getStartTime',
        'endTime' => 'getEndTime',
        'appointmentType' => 'getAppointmentType',
        'typeName' => 'getTypeName',
        'notes' => 'getNotes',
        'storeId' => 'getStoreId',
        'storeName' => 'getStoreName',
        'clerkId' => 'getClerkId',
        'clerkName' => 'getClerkName',
        'customerId' => 'getCustomerId',
        'customerName' => 'getCustomerName',
        'modified' => 'getModified'
    ];

    /**
     * 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['tenantId'] = $data['tenantId'] ?? null;
        $this->container['title'] = $data['title'] ?? null;
        $this->container['startTime'] = $data['startTime'] ?? null;
        $this->container['endTime'] = $data['endTime'] ?? null;
        $this->container['appointmentType'] = $data['appointmentType'] ?? null;
        $this->container['typeName'] = $data['typeName'] ?? null;
        $this->container['notes'] = $data['notes'] ?? null;
        $this->container['storeId'] = $data['storeId'] ?? null;
        $this->container['storeName'] = $data['storeName'] ?? null;
        $this->container['clerkId'] = $data['clerkId'] ?? null;
        $this->container['clerkName'] = $data['clerkName'] ?? null;
        $this->container['customerId'] = $data['customerId'] ?? null;
        $this->container['customerName'] = $data['customerName'] ?? null;
        $this->container['modified'] = $data['modified'] ?? 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 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 tenantId
     *
     * @return int|null
     */
    public function getTenantId()
    {
        return $this->container['tenantId'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets startTime
     *
     * @return \DateTime|null
     */
    public function getStartTime()
    {
        return $this->container['startTime'];
    }

    /**
     * Sets startTime
     *
     * @param \DateTime|null $startTime Appointment start time
     *
     * @return self
     */
    public function setStartTime($startTime)
    {
        $this->container['startTime'] = $startTime;

        return $this;
    }

    /**
     * Gets endTime
     *
     * @return \DateTime|null
     */
    public function getEndTime()
    {
        return $this->container['endTime'];
    }

    /**
     * Sets endTime
     *
     * @param \DateTime|null $endTime Appointment end time
     *
     * @return self
     */
    public function setEndTime($endTime)
    {
        $this->container['endTime'] = $endTime;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets typeName
     *
     * @param string|null $typeName Appointment type name
     *
     * @return self
     */
    public function setTypeName($typeName)
    {
        $this->container['typeName'] = $typeName;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets storeId
     *
     * @param int|null $storeId Appointment store ID
     *
     * @return self
     */
    public function setStoreId($storeId)
    {
        $this->container['storeId'] = $storeId;

        return $this;
    }

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

    /**
     * Sets storeName
     *
     * @param string|null $storeName Store name
     *
     * @return self
     */
    public function setStoreName($storeName)
    {
        $this->container['storeName'] = $storeName;

        return $this;
    }

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

    /**
     * Sets clerkId
     *
     * @param int|null $clerkId Appointment clerk ID
     *
     * @return self
     */
    public function setClerkId($clerkId)
    {
        $this->container['clerkId'] = $clerkId;

        return $this;
    }

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

    /**
     * Sets clerkName
     *
     * @param string|null $clerkName Clerk name
     *
     * @return self
     */
    public function setClerkName($clerkName)
    {
        $this->container['clerkName'] = $clerkName;

        return $this;
    }

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

    /**
     * Sets customerId
     *
     * @param int|null $customerId Appointment customer ID
     *
     * @return self
     */
    public function setCustomerId($customerId)
    {
        $this->container['customerId'] = $customerId;

        return $this;
    }

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

    /**
     * Sets customerName
     *
     * @param string|null $customerName Customer name
     *
     * @return self
     */
    public function setCustomerName($customerName)
    {
        $this->container['customerName'] = $customerName;

        return $this;
    }

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

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

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


