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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'id' => 'int',
        'tenantId' => 'int',
        'name' => 'string',
        'reference' => 'string',
        'openCash' => 'bool',
        'noteMode' => 'int',
        'sortOrder' => 'int',
        'showConfirmation' => 'bool',
        'noManualCashUp' => 'bool',
        'modified' => 'int',
        'canRefunds' => 'bool',
        'canTips' => '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' => 'int64',
        'tenantId' => 'int64',
        'name' => null,
        'reference' => null,
        'openCash' => null,
        'noteMode' => 'int64',
        'sortOrder' => 'int64',
        'showConfirmation' => null,
        'noManualCashUp' => null,
        'modified' => 'int64',
        'canRefunds' => null,
        'canTips' => 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',
        'tenantId' => 'tenantId',
        'name' => 'name',
        'reference' => 'reference',
        'openCash' => 'openCash',
        'noteMode' => 'noteMode',
        'sortOrder' => 'sortOrder',
        'showConfirmation' => 'showConfirmation',
        'noManualCashUp' => 'noManualCashUp',
        'modified' => 'modified',
        'canRefunds' => 'canRefunds',
        'canTips' => 'canTips'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
        'tenantId' => 'setTenantId',
        'name' => 'setName',
        'reference' => 'setReference',
        'openCash' => 'setOpenCash',
        'noteMode' => 'setNoteMode',
        'sortOrder' => 'setSortOrder',
        'showConfirmation' => 'setShowConfirmation',
        'noManualCashUp' => 'setNoManualCashUp',
        'modified' => 'setModified',
        'canRefunds' => 'setCanRefunds',
        'canTips' => 'setCanTips'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
        'tenantId' => 'getTenantId',
        'name' => 'getName',
        'reference' => 'getReference',
        'openCash' => 'getOpenCash',
        'noteMode' => 'getNoteMode',
        'sortOrder' => 'getSortOrder',
        'showConfirmation' => 'getShowConfirmation',
        'noManualCashUp' => 'getNoManualCashUp',
        'modified' => 'getModified',
        'canRefunds' => 'getCanRefunds',
        'canTips' => 'getCanTips'
    ];

    /**
     * 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['name'] = $data['name'] ?? null;
        $this->container['reference'] = $data['reference'] ?? null;
        $this->container['openCash'] = $data['openCash'] ?? null;
        $this->container['noteMode'] = $data['noteMode'] ?? null;
        $this->container['sortOrder'] = $data['sortOrder'] ?? null;
        $this->container['showConfirmation'] = $data['showConfirmation'] ?? null;
        $this->container['noManualCashUp'] = $data['noManualCashUp'] ?? null;
        $this->container['modified'] = $data['modified'] ?? null;
        $this->container['canRefunds'] = $data['canRefunds'] ?? null;
        $this->container['canTips'] = $data['canTips'] ?? 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 Unique tax identifier
     *
     * @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 name
     *
     * @return string|null
     */
    public function getName()
    {
        return $this->container['name'];
    }

    /**
     * Sets name
     *
     * @param string|null $name Name given to the tenant Type
     *
     * @return self
     */
    public function setName($name)
    {
        $this->container['name'] = $name;

        return $this;
    }

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

    /**
     * Sets reference
     *
     * @param string|null $reference TENDER_{ID}
     *
     * @return self
     */
    public function setReference($reference)
    {
        $this->container['reference'] = $reference;

        return $this;
    }

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

    /**
     * Sets openCash
     *
     * @param bool|null $openCash Open the cash drawer or not after payment
     *
     * @return self
     */
    public function setOpenCash($openCash)
    {
        $this->container['openCash'] = $openCash;

        return $this;
    }

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

    /**
     * Sets noteMode
     *
     * @param int|null $noteMode Enter the note or not after payment
     *
     * @return self
     */
    public function setNoteMode($noteMode)
    {
        $this->container['noteMode'] = $noteMode;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets showConfirmation
     *
     * @param bool|null $showConfirmation Show confirm dialog or not after payment
     *
     * @return self
     */
    public function setShowConfirmation($showConfirmation)
    {
        $this->container['showConfirmation'] = $showConfirmation;

        return $this;
    }

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

    /**
     * Sets noManualCashUp
     *
     * @param bool|null $noManualCashUp The tender show or not when manual enter the cash value
     *
     * @return self
     */
    public function setNoManualCashUp($noManualCashUp)
    {
        $this->container['noManualCashUp'] = $noManualCashUp;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets canRefunds
     *
     * @param bool|null $canRefunds The tender can or not refunds
     *
     * @return self
     */
    public function setCanRefunds($canRefunds)
    {
        $this->container['canRefunds'] = $canRefunds;

        return $this;
    }

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

    /**
     * Sets canTips
     *
     * @param bool|null $canTips The tender can or not tips
     *
     * @return self
     */
    public function setCanTips($canTips)
    {
        $this->container['canTips'] = $canTips;

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


