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

/**
 * Fortnox API
 *
 * # Documentation   The Fortnox API is organized around REST. This means that we’ve designed it to have resource-oriented URLs and be as predictable as possible for you as developer.  It also means that we use HTTP status codes when something goes wrong and HTTP verbs understod by many API clients around the web.  We use a modified version of OAuth2 for authentication to offer a secure way for both you and our users to interact.  The API is generally built to support both XML and JSON but in this documentation all the examples will be in JSON.  We encourage you to read all the articles in the [Guides & Good to Know section](https://www.fortnox.se/developer/guides-and-good-to-know/)</a> first, before going forward and learning about the different resources.  This to ensure you get an understanding of some of the shared components of the API such as parameters and error handling.  ## Rate limits  The limit per access-token is 25 requests per 5 seconds. This equals to 300 requests per minute.  [Read more about this here.](https://www.fortnox.se/developer/guides-and-good-to-know/rate-limits-for-fortnox-api/)  ## Query parameters  Use query parameters with the ?-character and separate parameters with the &-character.   **Example:**  GET - https://api.fortnox.se/3/invoices?accountnumberfrom=3000&accountnumberto=4000 Read more about our parameters [here](https://www.fortnox.se/developer/guides-and-good-to-know/parameters/)   Search the documentation using the search field in the top left corner.
 *
 * The version of the OpenAPI document: 
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.19.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 Fortnox\Model;

use \ArrayAccess;
use \Fortnox\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'approved_amount' => 'float',
        'asked_amount' => 'float',
        'billed_amount' => 'float',
        'customer_name' => 'string',
        'id' => 'int',
        'property_designation' => 'string',
        'reference_document_type' => 'string',
        'reference_number' => 'string',
        'request_sent' => 'bool',
        'residence_association_organisation_number' => 'string',
        'social_security_number' => 'string',
        'tax_reduction_amounts' => '\Fortnox\Model\FortnoxTaxReductionAmountSinglePayloadItem[]',
        'voucher_number' => 'int',
        'voucher_series' => 'string',
        'voucher_year' => '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 = [
        'approved_amount' => 'double',
        'asked_amount' => 'double',
        'billed_amount' => 'double',
        'customer_name' => null,
        'id' => 'int32',
        'property_designation' => null,
        'reference_document_type' => null,
        'reference_number' => null,
        'request_sent' => null,
        'residence_association_organisation_number' => null,
        'social_security_number' => null,
        'tax_reduction_amounts' => null,
        'voucher_number' => 'int32',
        'voucher_series' => null,
        'voucher_year' => 'int32'
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'approved_amount' => false,
        'asked_amount' => false,
        'billed_amount' => false,
        'customer_name' => false,
        'id' => false,
        'property_designation' => false,
        'reference_document_type' => false,
        'reference_number' => false,
        'request_sent' => false,
        'residence_association_organisation_number' => false,
        'social_security_number' => false,
        'tax_reduction_amounts' => false,
        'voucher_number' => false,
        'voucher_series' => false,
        'voucher_year' => 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 = [
        'approved_amount' => 'ApprovedAmount',
        'asked_amount' => 'AskedAmount',
        'billed_amount' => 'BilledAmount',
        'customer_name' => 'CustomerName',
        'id' => 'Id',
        'property_designation' => 'PropertyDesignation',
        'reference_document_type' => 'ReferenceDocumentType',
        'reference_number' => 'ReferenceNumber',
        'request_sent' => 'RequestSent',
        'residence_association_organisation_number' => 'ResidenceAssociationOrganisationNumber',
        'social_security_number' => 'SocialSecurityNumber',
        'tax_reduction_amounts' => 'TaxReductionAmounts',
        'voucher_number' => 'VoucherNumber',
        'voucher_series' => 'VoucherSeries',
        'voucher_year' => 'VoucherYear'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'approved_amount' => 'setApprovedAmount',
        'asked_amount' => 'setAskedAmount',
        'billed_amount' => 'setBilledAmount',
        'customer_name' => 'setCustomerName',
        'id' => 'setId',
        'property_designation' => 'setPropertyDesignation',
        'reference_document_type' => 'setReferenceDocumentType',
        'reference_number' => 'setReferenceNumber',
        'request_sent' => 'setRequestSent',
        'residence_association_organisation_number' => 'setResidenceAssociationOrganisationNumber',
        'social_security_number' => 'setSocialSecurityNumber',
        'tax_reduction_amounts' => 'setTaxReductionAmounts',
        'voucher_number' => 'setVoucherNumber',
        'voucher_series' => 'setVoucherSeries',
        'voucher_year' => 'setVoucherYear'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'approved_amount' => 'getApprovedAmount',
        'asked_amount' => 'getAskedAmount',
        'billed_amount' => 'getBilledAmount',
        'customer_name' => 'getCustomerName',
        'id' => 'getId',
        'property_designation' => 'getPropertyDesignation',
        'reference_document_type' => 'getReferenceDocumentType',
        'reference_number' => 'getReferenceNumber',
        'request_sent' => 'getRequestSent',
        'residence_association_organisation_number' => 'getResidenceAssociationOrganisationNumber',
        'social_security_number' => 'getSocialSecurityNumber',
        'tax_reduction_amounts' => 'getTaxReductionAmounts',
        'voucher_number' => 'getVoucherNumber',
        'voucher_series' => 'getVoucherSeries',
        'voucher_year' => 'getVoucherYear'
    ];

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

    public const REFERENCE_DOCUMENT_TYPE_OFFER = 'OFFER';
    public const REFERENCE_DOCUMENT_TYPE_ORDER = 'ORDER';
    public const REFERENCE_DOCUMENT_TYPE_INVOICE = 'INVOICE';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getReferenceDocumentTypeAllowableValues()
    {
        return [
            self::REFERENCE_DOCUMENT_TYPE_OFFER,
            self::REFERENCE_DOCUMENT_TYPE_ORDER,
            self::REFERENCE_DOCUMENT_TYPE_INVOICE,
        ];
    }

    /**
     * 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('approved_amount', $data ?? [], null);
        $this->setIfExists('asked_amount', $data ?? [], null);
        $this->setIfExists('billed_amount', $data ?? [], null);
        $this->setIfExists('customer_name', $data ?? [], null);
        $this->setIfExists('id', $data ?? [], null);
        $this->setIfExists('property_designation', $data ?? [], null);
        $this->setIfExists('reference_document_type', $data ?? [], null);
        $this->setIfExists('reference_number', $data ?? [], null);
        $this->setIfExists('request_sent', $data ?? [], null);
        $this->setIfExists('residence_association_organisation_number', $data ?? [], null);
        $this->setIfExists('social_security_number', $data ?? [], null);
        $this->setIfExists('tax_reduction_amounts', $data ?? [], null);
        $this->setIfExists('voucher_number', $data ?? [], null);
        $this->setIfExists('voucher_series', $data ?? [], null);
        $this->setIfExists('voucher_year', $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 = [];

        if ($this->container['asked_amount'] === null) {
            $invalidProperties[] = "'asked_amount' can't be null";
        }
        if (($this->container['asked_amount'] < 1)) {
            $invalidProperties[] = "invalid value for 'asked_amount', must be bigger than or equal to 1.";
        }

        if ($this->container['customer_name'] === null) {
            $invalidProperties[] = "'customer_name' can't be null";
        }
        if ((mb_strlen($this->container['customer_name']) > 2147483647)) {
            $invalidProperties[] = "invalid value for 'customer_name', the character length must be smaller than or equal to 2147483647.";
        }

        if ((mb_strlen($this->container['customer_name']) < 1)) {
            $invalidProperties[] = "invalid value for 'customer_name', the character length must be bigger than or equal to 1.";
        }

        if ($this->container['reference_document_type'] === null) {
            $invalidProperties[] = "'reference_document_type' can't be null";
        }
        $allowedValues = $this->getReferenceDocumentTypeAllowableValues();
        if (!is_null($this->container['reference_document_type']) && !in_array($this->container['reference_document_type'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'reference_document_type', must be one of '%s'",
                $this->container['reference_document_type'],
                implode("', '", $allowedValues)
            );
        }

        if ($this->container['reference_number'] === null) {
            $invalidProperties[] = "'reference_number' can't be null";
        }
        if ($this->container['social_security_number'] === null) {
            $invalidProperties[] = "'social_security_number' can't be null";
        }
        if ((mb_strlen($this->container['social_security_number']) > 13)) {
            $invalidProperties[] = "invalid value for 'social_security_number', the character length must be smaller than or equal to 13.";
        }

        if ((mb_strlen($this->container['social_security_number']) < 10)) {
            $invalidProperties[] = "invalid value for 'social_security_number', the character length must be bigger than or equal to 10.";
        }

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

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

        return $this;
    }

    /**
     * Gets asked_amount
     *
     * @return float
     */
    public function getAskedAmount()
    {
        return $this->container['asked_amount'];
    }

    /**
     * Sets asked_amount
     *
     * @param float $asked_amount asked_amount
     *
     * @return self
     */
    public function setAskedAmount($asked_amount)
    {
        if (is_null($asked_amount)) {
            throw new \InvalidArgumentException('non-nullable asked_amount cannot be null');
        }

        if (($asked_amount < 1)) {
            throw new \InvalidArgumentException('invalid value for $asked_amount when calling FortnoxTaxReductionCreatePayload., must be bigger than or equal to 1.');
        }

        $this->container['asked_amount'] = $asked_amount;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets customer_name
     *
     * @param string $customer_name customer_name
     *
     * @return self
     */
    public function setCustomerName($customer_name)
    {
        if (is_null($customer_name)) {
            throw new \InvalidArgumentException('non-nullable customer_name cannot be null');
        }
        if ((mb_strlen($customer_name) > 2147483647)) {
            throw new \InvalidArgumentException('invalid length for $customer_name when calling FortnoxTaxReductionCreatePayload., must be smaller than or equal to 2147483647.');
        }
        if ((mb_strlen($customer_name) < 1)) {
            throw new \InvalidArgumentException('invalid length for $customer_name when calling FortnoxTaxReductionCreatePayload., must be bigger than or equal to 1.');
        }

        $this->container['customer_name'] = $customer_name;

        return $this;
    }

    /**
     * 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)
    {
        if (is_null($id)) {
            throw new \InvalidArgumentException('non-nullable id cannot be null');
        }
        $this->container['id'] = $id;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets reference_document_type
     *
     * @return string
     */
    public function getReferenceDocumentType()
    {
        return $this->container['reference_document_type'];
    }

    /**
     * Sets reference_document_type
     *
     * @param string $reference_document_type reference_document_type
     *
     * @return self
     */
    public function setReferenceDocumentType($reference_document_type)
    {
        if (is_null($reference_document_type)) {
            throw new \InvalidArgumentException('non-nullable reference_document_type cannot be null');
        }
        $allowedValues = $this->getReferenceDocumentTypeAllowableValues();
        if (!in_array($reference_document_type, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'reference_document_type', must be one of '%s'",
                    $reference_document_type,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['reference_document_type'] = $reference_document_type;

        return $this;
    }

    /**
     * Gets reference_number
     *
     * @return string
     */
    public function getReferenceNumber()
    {
        return $this->container['reference_number'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets social_security_number
     *
     * @return string
     */
    public function getSocialSecurityNumber()
    {
        return $this->container['social_security_number'];
    }

    /**
     * Sets social_security_number
     *
     * @param string $social_security_number social_security_number
     *
     * @return self
     */
    public function setSocialSecurityNumber($social_security_number)
    {
        if (is_null($social_security_number)) {
            throw new \InvalidArgumentException('non-nullable social_security_number cannot be null');
        }
        if ((mb_strlen($social_security_number) > 13)) {
            throw new \InvalidArgumentException('invalid length for $social_security_number when calling FortnoxTaxReductionCreatePayload., must be smaller than or equal to 13.');
        }
        if ((mb_strlen($social_security_number) < 10)) {
            throw new \InvalidArgumentException('invalid length for $social_security_number when calling FortnoxTaxReductionCreatePayload., must be bigger than or equal to 10.');
        }

        $this->container['social_security_number'] = $social_security_number;

        return $this;
    }

    /**
     * Gets tax_reduction_amounts
     *
     * @return \Fortnox\Model\FortnoxTaxReductionAmountSinglePayloadItem[]|null
     */
    public function getTaxReductionAmounts()
    {
        return $this->container['tax_reduction_amounts'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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


