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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'id' => 'int',
        'tenantId' => 'int',
        'name' => 'string',
        'printerId' => 'int',
        'receiptWidth' => 'int',
        'feedLength' => 'int',
        'printGroup' => 'int',
        'field1' => 'string',
        'field2' => 'string',
        'field3' => 'string',
        'field4' => 'string',
        'field5' => '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',
        'tenantId' => 'int64',
        'name' => null,
        'printerId' => 'int64',
        'receiptWidth' => 'int64',
        'feedLength' => 'int64',
        'printGroup' => 'int64',
        'field1' => null,
        'field2' => null,
        'field3' => null,
        'field4' => null,
        'field5' => 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',
        'printerId' => 'printerId',
        'receiptWidth' => 'receiptWidth',
        'feedLength' => 'feedLength',
        'printGroup' => 'printGroup',
        'field1' => 'field1',
        'field2' => 'field2',
        'field3' => 'field3',
        'field4' => 'field4',
        'field5' => 'field5'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
        'tenantId' => 'setTenantId',
        'name' => 'setName',
        'printerId' => 'setPrinterId',
        'receiptWidth' => 'setReceiptWidth',
        'feedLength' => 'setFeedLength',
        'printGroup' => 'setPrintGroup',
        'field1' => 'setField1',
        'field2' => 'setField2',
        'field3' => 'setField3',
        'field4' => 'setField4',
        'field5' => 'setField5'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
        'tenantId' => 'getTenantId',
        'name' => 'getName',
        'printerId' => 'getPrinterId',
        'receiptWidth' => 'getReceiptWidth',
        'feedLength' => 'getFeedLength',
        'printGroup' => 'getPrintGroup',
        'field1' => 'getField1',
        'field2' => 'getField2',
        'field3' => 'getField3',
        'field4' => 'getField4',
        'field5' => 'getField5'
    ];

    /**
     * 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['printerId'] = $data['printerId'] ?? null;
        $this->container['receiptWidth'] = $data['receiptWidth'] ?? null;
        $this->container['feedLength'] = $data['feedLength'] ?? null;
        $this->container['printGroup'] = $data['printGroup'] ?? null;
        $this->container['field1'] = $data['field1'] ?? null;
        $this->container['field2'] = $data['field2'] ?? null;
        $this->container['field3'] = $data['field3'] ?? null;
        $this->container['field4'] = $data['field4'] ?? null;
        $this->container['field5'] = $data['field5'] ?? 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 tenantPrinter 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 Reference 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 TenantPrinter name
     *
     * @return self
     */
    public function setName($name)
    {
        $this->container['name'] = $name;

        return $this;
    }

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

    /**
     * Sets printerId
     *
     * @param int|null $printerId Reference printer Id
     *
     * @return self
     */
    public function setPrinterId($printerId)
    {
        $this->container['printerId'] = $printerId;

        return $this;
    }

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

    /**
     * Sets receiptWidth
     *
     * @param int|null $receiptWidth receipt width
     *
     * @return self
     */
    public function setReceiptWidth($receiptWidth)
    {
        $this->container['receiptWidth'] = $receiptWidth;

        return $this;
    }

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

    /**
     * Sets feedLength
     *
     * @param int|null $feedLength feed length
     *
     * @return self
     */
    public function setFeedLength($feedLength)
    {
        $this->container['feedLength'] = $feedLength;

        return $this;
    }

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

    /**
     * Sets printGroup
     *
     * @param int|null $printGroup print Group
     *
     * @return self
     */
    public function setPrintGroup($printGroup)
    {
        $this->container['printGroup'] = $printGroup;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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


