<?php
/**
 * Register
 *
 * PHP version 8.1
 *
 * @category Class
 * @package  Vend202601
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * API 2026-01
 *
 * Lightspeed Retail (X-Series) API.
 *
 * The version of the OpenAPI document: 2026-01
 * Contact: x-series.api@lightspeedhq.com
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.21.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 Vend202601\Model;

use \ArrayAccess;
use \Vend202601\ObjectSerializer;

/**
 * Register Class Doc Comment
 *
 * @category Class
 * @package  Vend202601
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<string, mixed>
 */
class Register implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @var string[]
     */
    protected static $openAPITypes = [
        'ask_for_note_on_save' => 'float',
        'ask_for_user_on_sale' => 'bool',
        'button_layout_id' => 'string',
        'cash_managed_payment_type_id' => 'string',
        'deleted_at' => 'string',
        'email_receipt' => 'bool',
        'id' => 'string',
        'invoice_prefix' => 'string',
        'invoice_sequence' => 'float',
        'invoice_suffix' => 'string',
        'is_open' => 'bool',
        'name' => 'string',
        'outlet_id' => 'string',
        'print_note_on_receipt' => 'bool',
        'print_receipt' => 'bool',
        'receipt_template_id' => 'string',
        'register_close_time' => 'string',
        'register_open_sequence_id' => 'string',
        'register_open_time' => 'string',
        'show_discounts_on_receipts' => 'bool',
        'version' => '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 = [
        'ask_for_note_on_save' => 'double',
        'ask_for_user_on_sale' => null,
        'button_layout_id' => null,
        'cash_managed_payment_type_id' => null,
        'deleted_at' => null,
        'email_receipt' => null,
        'id' => null,
        'invoice_prefix' => null,
        'invoice_sequence' => 'double',
        'invoice_suffix' => null,
        'is_open' => null,
        'name' => null,
        'outlet_id' => null,
        'print_note_on_receipt' => null,
        'print_receipt' => null,
        'receipt_template_id' => null,
        'register_close_time' => null,
        'register_open_sequence_id' => null,
        'register_open_time' => null,
        'show_discounts_on_receipts' => null,
        'version' => 'int64'
    ];

    /**
     * Array of nullable properties. Used for (de)serialization
     *
     * @var boolean[]
     */
    protected static array $openAPINullables = [
        'ask_for_note_on_save' => false,
        'ask_for_user_on_sale' => false,
        'button_layout_id' => true,
        'cash_managed_payment_type_id' => true,
        'deleted_at' => true,
        'email_receipt' => false,
        'id' => false,
        'invoice_prefix' => false,
        'invoice_sequence' => false,
        'invoice_suffix' => false,
        'is_open' => false,
        'name' => false,
        'outlet_id' => false,
        'print_note_on_receipt' => false,
        'print_receipt' => false,
        'receipt_template_id' => false,
        'register_close_time' => true,
        'register_open_sequence_id' => true,
        'register_open_time' => true,
        'show_discounts_on_receipts' => false,
        'version' => false
    ];

    /**
     * If a nullable field gets set to null, insert it here
     *
     * @var boolean[]
     */
    protected array $openAPINullablesSetToNull = [];

    /**
     * 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 nullable properties
     *
     * @return array
     */
    protected static function openAPINullables(): array
    {
        return self::$openAPINullables;
    }

    /**
     * Array of nullable field names deliberately set to null
     *
     * @return boolean[]
     */
    private function getOpenAPINullablesSetToNull(): array
    {
        return $this->openAPINullablesSetToNull;
    }

    /**
     * Setter - Array of nullable field names deliberately set to null
     *
     * @param boolean[] $openAPINullablesSetToNull
     */
    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
    {
        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
    }

    /**
     * Checks if a property is nullable
     *
     * @param string $property
     * @return bool
     */
    public static function isNullable(string $property): bool
    {
        return self::openAPINullables()[$property] ?? false;
    }

    /**
     * Checks if a nullable property is set to null.
     *
     * @param string $property
     * @return bool
     */
    public function isNullableSetToNull(string $property): bool
    {
        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'ask_for_note_on_save' => 'ask_for_note_on_save',
        'ask_for_user_on_sale' => 'ask_for_user_on_sale',
        'button_layout_id' => 'button_layout_id',
        'cash_managed_payment_type_id' => 'cash_managed_payment_type_id',
        'deleted_at' => 'deleted_at',
        'email_receipt' => 'email_receipt',
        'id' => 'id',
        'invoice_prefix' => 'invoice_prefix',
        'invoice_sequence' => 'invoice_sequence',
        'invoice_suffix' => 'invoice_suffix',
        'is_open' => 'is_open',
        'name' => 'name',
        'outlet_id' => 'outlet_id',
        'print_note_on_receipt' => 'print_note_on_receipt',
        'print_receipt' => 'print_receipt',
        'receipt_template_id' => 'receipt_template_id',
        'register_close_time' => 'register_close_time',
        'register_open_sequence_id' => 'register_open_sequence_id',
        'register_open_time' => 'register_open_time',
        'show_discounts_on_receipts' => 'show_discounts_on_receipts',
        'version' => 'version'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'ask_for_note_on_save' => 'setAskForNoteOnSave',
        'ask_for_user_on_sale' => 'setAskForUserOnSale',
        'button_layout_id' => 'setButtonLayoutId',
        'cash_managed_payment_type_id' => 'setCashManagedPaymentTypeId',
        'deleted_at' => 'setDeletedAt',
        'email_receipt' => 'setEmailReceipt',
        'id' => 'setId',
        'invoice_prefix' => 'setInvoicePrefix',
        'invoice_sequence' => 'setInvoiceSequence',
        'invoice_suffix' => 'setInvoiceSuffix',
        'is_open' => 'setIsOpen',
        'name' => 'setName',
        'outlet_id' => 'setOutletId',
        'print_note_on_receipt' => 'setPrintNoteOnReceipt',
        'print_receipt' => 'setPrintReceipt',
        'receipt_template_id' => 'setReceiptTemplateId',
        'register_close_time' => 'setRegisterCloseTime',
        'register_open_sequence_id' => 'setRegisterOpenSequenceId',
        'register_open_time' => 'setRegisterOpenTime',
        'show_discounts_on_receipts' => 'setShowDiscountsOnReceipts',
        'version' => 'setVersion'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'ask_for_note_on_save' => 'getAskForNoteOnSave',
        'ask_for_user_on_sale' => 'getAskForUserOnSale',
        'button_layout_id' => 'getButtonLayoutId',
        'cash_managed_payment_type_id' => 'getCashManagedPaymentTypeId',
        'deleted_at' => 'getDeletedAt',
        'email_receipt' => 'getEmailReceipt',
        'id' => 'getId',
        'invoice_prefix' => 'getInvoicePrefix',
        'invoice_sequence' => 'getInvoiceSequence',
        'invoice_suffix' => 'getInvoiceSuffix',
        'is_open' => 'getIsOpen',
        'name' => 'getName',
        'outlet_id' => 'getOutletId',
        'print_note_on_receipt' => 'getPrintNoteOnReceipt',
        'print_receipt' => 'getPrintReceipt',
        'receipt_template_id' => 'getReceiptTemplateId',
        'register_close_time' => 'getRegisterCloseTime',
        'register_open_sequence_id' => 'getRegisterOpenSequenceId',
        'register_open_time' => 'getRegisterOpenTime',
        'show_discounts_on_receipts' => 'getShowDiscountsOnReceipts',
        'version' => 'getVersion'
    ];

    /**
     * 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[]|null $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('ask_for_note_on_save', $data ?? [], null);
        $this->setIfExists('ask_for_user_on_sale', $data ?? [], null);
        $this->setIfExists('button_layout_id', $data ?? [], null);
        $this->setIfExists('cash_managed_payment_type_id', $data ?? [], null);
        $this->setIfExists('deleted_at', $data ?? [], null);
        $this->setIfExists('email_receipt', $data ?? [], null);
        $this->setIfExists('id', $data ?? [], null);
        $this->setIfExists('invoice_prefix', $data ?? [], null);
        $this->setIfExists('invoice_sequence', $data ?? [], null);
        $this->setIfExists('invoice_suffix', $data ?? [], null);
        $this->setIfExists('is_open', $data ?? [], null);
        $this->setIfExists('name', $data ?? [], null);
        $this->setIfExists('outlet_id', $data ?? [], null);
        $this->setIfExists('print_note_on_receipt', $data ?? [], null);
        $this->setIfExists('print_receipt', $data ?? [], null);
        $this->setIfExists('receipt_template_id', $data ?? [], null);
        $this->setIfExists('register_close_time', $data ?? [], null);
        $this->setIfExists('register_open_sequence_id', $data ?? [], null);
        $this->setIfExists('register_open_time', $data ?? [], null);
        $this->setIfExists('show_discounts_on_receipts', $data ?? [], null);
        $this->setIfExists('version', $data ?? [], null);
    }

    /**
     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
     * $this->openAPINullablesSetToNull array
     *
     * @param string $variableName
     * @param array  $fields
     * @param mixed  $defaultValue
     */
    private function setIfExists(string $variableName, array $fields, $defaultValue): void
    {
        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
            $this->openAPINullablesSetToNull[] = $variableName;
        }

        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
    }

    /**
     * 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 ask_for_note_on_save
     *
     * @return float|null
     */
    public function getAskForNoteOnSave()
    {
        return $this->container['ask_for_note_on_save'];
    }

    /**
     * Sets ask_for_note_on_save
     *
     * @param float|null $ask_for_note_on_save `0` for **Never**, `1` for **On Save/Layby/Account/Return**, `2` for **Always**.
     *
     * @return self
     */
    public function setAskForNoteOnSave($ask_for_note_on_save)
    {
        if (is_null($ask_for_note_on_save)) {
            throw new \InvalidArgumentException('non-nullable ask_for_note_on_save cannot be null');
        }
        $this->container['ask_for_note_on_save'] = $ask_for_note_on_save;

        return $this;
    }

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

    /**
     * Sets ask_for_user_on_sale
     *
     * @param bool|null $ask_for_user_on_sale ask_for_user_on_sale
     *
     * @return self
     */
    public function setAskForUserOnSale($ask_for_user_on_sale)
    {
        if (is_null($ask_for_user_on_sale)) {
            throw new \InvalidArgumentException('non-nullable ask_for_user_on_sale cannot be null');
        }
        $this->container['ask_for_user_on_sale'] = $ask_for_user_on_sale;

        return $this;
    }

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

    /**
     * Sets button_layout_id
     *
     * @param string|null $button_layout_id Register ID.
     *
     * @return self
     */
    public function setButtonLayoutId($button_layout_id)
    {
        if (is_null($button_layout_id)) {
            array_push($this->openAPINullablesSetToNull, 'button_layout_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('button_layout_id', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['button_layout_id'] = $button_layout_id;

        return $this;
    }

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

    /**
     * Sets cash_managed_payment_type_id
     *
     * @param string|null $cash_managed_payment_type_id **internal** The ID of the payment type used for cash management transactions in this regsiter.
     *
     * @return self
     */
    public function setCashManagedPaymentTypeId($cash_managed_payment_type_id)
    {
        if (is_null($cash_managed_payment_type_id)) {
            array_push($this->openAPINullablesSetToNull, 'cash_managed_payment_type_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('cash_managed_payment_type_id', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['cash_managed_payment_type_id'] = $cash_managed_payment_type_id;

        return $this;
    }

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

    /**
     * Sets deleted_at
     *
     * @param string|null $deleted_at Deletion timestamp in UTC.
     *
     * @return self
     */
    public function setDeletedAt($deleted_at)
    {
        if (is_null($deleted_at)) {
            array_push($this->openAPINullablesSetToNull, 'deleted_at');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('deleted_at', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['deleted_at'] = $deleted_at;

        return $this;
    }

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

    /**
     * Sets email_receipt
     *
     * @param bool|null $email_receipt Indicates whether a receipt should be emailed after a sale.
     *
     * @return self
     */
    public function setEmailReceipt($email_receipt)
    {
        if (is_null($email_receipt)) {
            throw new \InvalidArgumentException('non-nullable email_receipt cannot be null');
        }
        $this->container['email_receipt'] = $email_receipt;

        return $this;
    }

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

    /**
     * Sets id
     *
     * @param string|null $id Auto-generated object ID.
     *
     * @return self
     */
    public function setId($id)
    {
        if (is_null($id)) {
            throw new \InvalidArgumentException('non-nullable id cannot be null');
        }
        $this->container['id'] = $id;

        return $this;
    }

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

    /**
     * Sets invoice_prefix
     *
     * @param string|null $invoice_prefix Invoice number prefix.
     *
     * @return self
     */
    public function setInvoicePrefix($invoice_prefix)
    {
        if (is_null($invoice_prefix)) {
            throw new \InvalidArgumentException('non-nullable invoice_prefix cannot be null');
        }
        $this->container['invoice_prefix'] = $invoice_prefix;

        return $this;
    }

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

    /**
     * Sets invoice_sequence
     *
     * @param float|null $invoice_sequence The numeric part of the last issued invoice.
     *
     * @return self
     */
    public function setInvoiceSequence($invoice_sequence)
    {
        if (is_null($invoice_sequence)) {
            throw new \InvalidArgumentException('non-nullable invoice_sequence cannot be null');
        }
        $this->container['invoice_sequence'] = $invoice_sequence;

        return $this;
    }

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

    /**
     * Sets invoice_suffix
     *
     * @param string|null $invoice_suffix Invoice number suffix.
     *
     * @return self
     */
    public function setInvoiceSuffix($invoice_suffix)
    {
        if (is_null($invoice_suffix)) {
            throw new \InvalidArgumentException('non-nullable invoice_suffix cannot be null');
        }
        $this->container['invoice_suffix'] = $invoice_suffix;

        return $this;
    }

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

    /**
     * Sets is_open
     *
     * @param bool|null $is_open Indicates if the Register is currently open.
     *
     * @return self
     */
    public function setIsOpen($is_open)
    {
        if (is_null($is_open)) {
            throw new \InvalidArgumentException('non-nullable is_open cannot be null');
        }
        $this->container['is_open'] = $is_open;

        return $this;
    }

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

    /**
     * Sets name
     *
     * @param string|null $name The Register name.
     *
     * @return self
     */
    public function setName($name)
    {
        if (is_null($name)) {
            throw new \InvalidArgumentException('non-nullable name cannot be null');
        }
        $this->container['name'] = $name;

        return $this;
    }

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

    /**
     * Sets outlet_id
     *
     * @param string|null $outlet_id A valid ID of an Outlet that this register is associated with.
     *
     * @return self
     */
    public function setOutletId($outlet_id)
    {
        if (is_null($outlet_id)) {
            throw new \InvalidArgumentException('non-nullable outlet_id cannot be null');
        }
        $this->container['outlet_id'] = $outlet_id;

        return $this;
    }

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

    /**
     * Sets print_note_on_receipt
     *
     * @param bool|null $print_note_on_receipt print_note_on_receipt
     *
     * @return self
     */
    public function setPrintNoteOnReceipt($print_note_on_receipt)
    {
        if (is_null($print_note_on_receipt)) {
            throw new \InvalidArgumentException('non-nullable print_note_on_receipt cannot be null');
        }
        $this->container['print_note_on_receipt'] = $print_note_on_receipt;

        return $this;
    }

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

    /**
     * Sets print_receipt
     *
     * @param bool|null $print_receipt Indicates whether a receipt should be printed after a sale.
     *
     * @return self
     */
    public function setPrintReceipt($print_receipt)
    {
        if (is_null($print_receipt)) {
            throw new \InvalidArgumentException('non-nullable print_receipt cannot be null');
        }
        $this->container['print_receipt'] = $print_receipt;

        return $this;
    }

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

    /**
     * Sets receipt_template_id
     *
     * @param string|null $receipt_template_id Default receipt template ID used for this register.
     *
     * @return self
     */
    public function setReceiptTemplateId($receipt_template_id)
    {
        if (is_null($receipt_template_id)) {
            throw new \InvalidArgumentException('non-nullable receipt_template_id cannot be null');
        }
        $this->container['receipt_template_id'] = $receipt_template_id;

        return $this;
    }

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

    /**
     * Sets register_close_time
     *
     * @param string|null $register_close_time Date/time when the register was closed. Null if currently open.
     *
     * @return self
     */
    public function setRegisterCloseTime($register_close_time)
    {
        if (is_null($register_close_time)) {
            array_push($this->openAPINullablesSetToNull, 'register_close_time');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('register_close_time', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['register_close_time'] = $register_close_time;

        return $this;
    }

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

    /**
     * Sets register_open_sequence_id
     *
     * @param string|null $register_open_sequence_id **internal** The ID of the current register closure object.
     *
     * @return self
     */
    public function setRegisterOpenSequenceId($register_open_sequence_id)
    {
        if (is_null($register_open_sequence_id)) {
            array_push($this->openAPINullablesSetToNull, 'register_open_sequence_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('register_open_sequence_id', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['register_open_sequence_id'] = $register_open_sequence_id;

        return $this;
    }

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

    /**
     * Sets register_open_time
     *
     * @param string|null $register_open_time Date/time when the register was open. Always in UTC.
     *
     * @return self
     */
    public function setRegisterOpenTime($register_open_time)
    {
        if (is_null($register_open_time)) {
            array_push($this->openAPINullablesSetToNull, 'register_open_time');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('register_open_time', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['register_open_time'] = $register_open_time;

        return $this;
    }

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

    /**
     * Sets show_discounts_on_receipts
     *
     * @param bool|null $show_discounts_on_receipts show_discounts_on_receipts
     *
     * @return self
     */
    public function setShowDiscountsOnReceipts($show_discounts_on_receipts)
    {
        if (is_null($show_discounts_on_receipts)) {
            throw new \InvalidArgumentException('non-nullable show_discounts_on_receipts cannot be null');
        }
        $this->container['show_discounts_on_receipts'] = $show_discounts_on_receipts;

        return $this;
    }

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

    /**
     * Sets version
     *
     * @param int|null $version Auto-incrementing object version number.
     *
     * @return self
     */
    public function setVersion($version)
    {
        if (is_null($version)) {
            throw new \InvalidArgumentException('non-nullable version cannot be null');
        }
        $this->container['version'] = $version;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer|string $offset Offset
     *
     * @return boolean
     */
    public function offsetExists(mixed $offset): bool
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer|string $offset Offset
     *
     * @return mixed|null
     */
    #[\ReturnTypeWillChange]
    public function offsetGet(mixed $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|string $offset Offset
     *
     * @return void
     */
    public function offsetUnset(mixed $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));
    }
}


