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

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

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

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

    /**
      * 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',
        'title' => null,
        'startTime' => 'date-time',
        'endTime' => 'date-time',
        'appointmentType' => 'int64',
        'notes' => null,
        'storeId' => 'int64',
        'clerkId' => 'int64',
        'customerId' => 'int64',
        'modified' => 'int64',
        'reasonUsageId' => 'int64',
        'reasonId' => 'int64',
        'reasonText' => 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',
        'title' => 'title',
        'startTime' => 'startTime',
        'endTime' => 'endTime',
        'appointmentType' => 'appointmentType',
        'notes' => 'notes',
        'storeId' => 'storeId',
        'clerkId' => 'clerkId',
        'customerId' => 'customerId',
        'modified' => 'modified',
        'reasonUsageId' => 'reasonUsageId',
        'reasonId' => 'reasonId',
        'reasonText' => 'reasonText'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
        'title' => 'setTitle',
        'startTime' => 'setStartTime',
        'endTime' => 'setEndTime',
        'appointmentType' => 'setAppointmentType',
        'notes' => 'setNotes',
        'storeId' => 'setStoreId',
        'clerkId' => 'setClerkId',
        'customerId' => 'setCustomerId',
        'modified' => 'setModified',
        'reasonUsageId' => 'setReasonUsageId',
        'reasonId' => 'setReasonId',
        'reasonText' => 'setReasonText'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
        'title' => 'getTitle',
        'startTime' => 'getStartTime',
        'endTime' => 'getEndTime',
        'appointmentType' => 'getAppointmentType',
        'notes' => 'getNotes',
        'storeId' => 'getStoreId',
        'clerkId' => 'getClerkId',
        'customerId' => 'getCustomerId',
        'modified' => 'getModified',
        'reasonUsageId' => 'getReasonUsageId',
        'reasonId' => 'getReasonId',
        'reasonText' => 'getReasonText'
    ];

    /**
     * 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['title'] = $data['title'] ?? null;
        $this->container['startTime'] = $data['startTime'] ?? null;
        $this->container['endTime'] = $data['endTime'] ?? null;
        $this->container['appointmentType'] = $data['appointmentType'] ?? null;
        $this->container['notes'] = $data['notes'] ?? null;
        $this->container['storeId'] = $data['storeId'] ?? null;
        $this->container['clerkId'] = $data['clerkId'] ?? null;
        $this->container['customerId'] = $data['customerId'] ?? null;
        $this->container['modified'] = $data['modified'] ?? null;
        $this->container['reasonUsageId'] = $data['reasonUsageId'] ?? null;
        $this->container['reasonId'] = $data['reasonId'] ?? null;
        $this->container['reasonText'] = $data['reasonText'] ?? 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 Appointment ID
     *
     * @return self
     */
    public function setId($id)
    {
        $this->container['id'] = $id;

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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


