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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'amount_per_invoicing' => 'int',
        'cost_center_id' => 'string',
        'currency' => 'string',
        'customer' => '\Fortnox\Model\RecurringAPIRecurringCustomer',
        'delivery' => '\Fortnox\Model\RecurringAPIRecurringDelivery',
        'distribution_method' => 'string',
        'email' => '\Fortnox\Model\RecurringAPIRecurringEmail',
        'invoice_handling' => 'string',
        'invoice_service_type' => 'string',
        'order_number' => 'string',
        'our_reference' => 'string',
        'payment_terms' => 'string',
        'price_list_id' => 'string',
        'print_configuration' => '\Fortnox\Model\RecurringAPIPrintConfiguration',
        'project_id' => 'string',
        'remark' => 'string',
        'status' => '\Fortnox\Model\RecurringAPIRecurringStatus',
        'tax_reduction_category' => 'string',
        'vat_option' => '\Fortnox\Model\RecurringAPIVatOption',
        'vat_payment_type' => 'string',
        'your_reference' => 'string',
        'accrual' => '\Fortnox\Model\RecurringAPIListAccrual',
        'created_at' => '\DateTime',
        'dates' => '\Fortnox\Model\RecurringAPIRecurringDates',
        'id' => 'string',
        'modified_at' => '\DateTime',
        'serial_number' => 'int',
        'totals' => '\Fortnox\Model\RecurringAPIRecurringTotals'
    ];

    /**
      * 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 = [
        'amount_per_invoicing' => null,
        'cost_center_id' => null,
        'currency' => null,
        'customer' => null,
        'delivery' => null,
        'distribution_method' => null,
        'email' => null,
        'invoice_handling' => null,
        'invoice_service_type' => null,
        'order_number' => null,
        'our_reference' => null,
        'payment_terms' => null,
        'price_list_id' => null,
        'print_configuration' => null,
        'project_id' => null,
        'remark' => null,
        'status' => null,
        'tax_reduction_category' => null,
        'vat_option' => null,
        'vat_payment_type' => null,
        'your_reference' => null,
        'accrual' => null,
        'created_at' => 'date-time',
        'dates' => null,
        'id' => 'uuid',
        'modified_at' => 'date-time',
        'serial_number' => null,
        'totals' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'amount_per_invoicing' => false,
        'cost_center_id' => false,
        'currency' => false,
        'customer' => false,
        'delivery' => false,
        'distribution_method' => false,
        'email' => false,
        'invoice_handling' => false,
        'invoice_service_type' => false,
        'order_number' => false,
        'our_reference' => false,
        'payment_terms' => false,
        'price_list_id' => false,
        'print_configuration' => false,
        'project_id' => false,
        'remark' => false,
        'status' => false,
        'tax_reduction_category' => false,
        'vat_option' => false,
        'vat_payment_type' => false,
        'your_reference' => false,
        'accrual' => false,
        'created_at' => false,
        'dates' => false,
        'id' => false,
        'modified_at' => false,
        'serial_number' => false,
        'totals' => 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 = [
        'amount_per_invoicing' => 'amount_per_invoicing',
        'cost_center_id' => 'cost_center_id',
        'currency' => 'currency',
        'customer' => 'customer',
        'delivery' => 'delivery',
        'distribution_method' => 'distribution_method',
        'email' => 'email',
        'invoice_handling' => 'invoice_handling',
        'invoice_service_type' => 'invoice_service_type',
        'order_number' => 'order_number',
        'our_reference' => 'our_reference',
        'payment_terms' => 'payment_terms',
        'price_list_id' => 'price_list_id',
        'print_configuration' => 'print_configuration',
        'project_id' => 'project_id',
        'remark' => 'remark',
        'status' => 'status',
        'tax_reduction_category' => 'tax_reduction_category',
        'vat_option' => 'vat_option',
        'vat_payment_type' => 'vat_payment_type',
        'your_reference' => 'your_reference',
        'accrual' => 'accrual',
        'created_at' => 'created_at',
        'dates' => 'dates',
        'id' => 'id',
        'modified_at' => 'modified_at',
        'serial_number' => 'serial_number',
        'totals' => 'totals'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'amount_per_invoicing' => 'setAmountPerInvoicing',
        'cost_center_id' => 'setCostCenterId',
        'currency' => 'setCurrency',
        'customer' => 'setCustomer',
        'delivery' => 'setDelivery',
        'distribution_method' => 'setDistributionMethod',
        'email' => 'setEmail',
        'invoice_handling' => 'setInvoiceHandling',
        'invoice_service_type' => 'setInvoiceServiceType',
        'order_number' => 'setOrderNumber',
        'our_reference' => 'setOurReference',
        'payment_terms' => 'setPaymentTerms',
        'price_list_id' => 'setPriceListId',
        'print_configuration' => 'setPrintConfiguration',
        'project_id' => 'setProjectId',
        'remark' => 'setRemark',
        'status' => 'setStatus',
        'tax_reduction_category' => 'setTaxReductionCategory',
        'vat_option' => 'setVatOption',
        'vat_payment_type' => 'setVatPaymentType',
        'your_reference' => 'setYourReference',
        'accrual' => 'setAccrual',
        'created_at' => 'setCreatedAt',
        'dates' => 'setDates',
        'id' => 'setId',
        'modified_at' => 'setModifiedAt',
        'serial_number' => 'setSerialNumber',
        'totals' => 'setTotals'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'amount_per_invoicing' => 'getAmountPerInvoicing',
        'cost_center_id' => 'getCostCenterId',
        'currency' => 'getCurrency',
        'customer' => 'getCustomer',
        'delivery' => 'getDelivery',
        'distribution_method' => 'getDistributionMethod',
        'email' => 'getEmail',
        'invoice_handling' => 'getInvoiceHandling',
        'invoice_service_type' => 'getInvoiceServiceType',
        'order_number' => 'getOrderNumber',
        'our_reference' => 'getOurReference',
        'payment_terms' => 'getPaymentTerms',
        'price_list_id' => 'getPriceListId',
        'print_configuration' => 'getPrintConfiguration',
        'project_id' => 'getProjectId',
        'remark' => 'getRemark',
        'status' => 'getStatus',
        'tax_reduction_category' => 'getTaxReductionCategory',
        'vat_option' => 'getVatOption',
        'vat_payment_type' => 'getVatPaymentType',
        'your_reference' => 'getYourReference',
        'accrual' => 'getAccrual',
        'created_at' => 'getCreatedAt',
        'dates' => 'getDates',
        'id' => 'getId',
        'modified_at' => 'getModifiedAt',
        'serial_number' => 'getSerialNumber',
        'totals' => 'getTotals'
    ];

    /**
     * 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('amount_per_invoicing', $data ?? [], 1);
        $this->setIfExists('cost_center_id', $data ?? [], null);
        $this->setIfExists('currency', $data ?? [], null);
        $this->setIfExists('customer', $data ?? [], null);
        $this->setIfExists('delivery', $data ?? [], null);
        $this->setIfExists('distribution_method', $data ?? [], null);
        $this->setIfExists('email', $data ?? [], null);
        $this->setIfExists('invoice_handling', $data ?? [], null);
        $this->setIfExists('invoice_service_type', $data ?? [], null);
        $this->setIfExists('order_number', $data ?? [], null);
        $this->setIfExists('our_reference', $data ?? [], null);
        $this->setIfExists('payment_terms', $data ?? [], null);
        $this->setIfExists('price_list_id', $data ?? [], null);
        $this->setIfExists('print_configuration', $data ?? [], null);
        $this->setIfExists('project_id', $data ?? [], null);
        $this->setIfExists('remark', $data ?? [], null);
        $this->setIfExists('status', $data ?? [], null);
        $this->setIfExists('tax_reduction_category', $data ?? [], null);
        $this->setIfExists('vat_option', $data ?? [], null);
        $this->setIfExists('vat_payment_type', $data ?? [], null);
        $this->setIfExists('your_reference', $data ?? [], null);
        $this->setIfExists('accrual', $data ?? [], null);
        $this->setIfExists('created_at', $data ?? [], null);
        $this->setIfExists('dates', $data ?? [], null);
        $this->setIfExists('id', $data ?? [], null);
        $this->setIfExists('modified_at', $data ?? [], null);
        $this->setIfExists('serial_number', $data ?? [], null);
        $this->setIfExists('totals', $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 amount_per_invoicing
     *
     * @return int|null
     */
    public function getAmountPerInvoicing()
    {
        return $this->container['amount_per_invoicing'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets invoice_service_type
     *
     * @param string|null $invoice_service_type Specifies the type of invoice service to use; only applicable when invoice_handling is AUTOMATIC_WITH_INVOICE_SERVICE. If invoice_handling is MANUAL or AUTOMATIC, this field should be omitted.
     *
     * @return self
     */
    public function setInvoiceServiceType($invoice_service_type)
    {
        if (is_null($invoice_service_type)) {
            throw new \InvalidArgumentException('non-nullable invoice_service_type cannot be null');
        }
        $this->container['invoice_service_type'] = $invoice_service_type;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets created_at
     *
     * @return \DateTime|null
     */
    public function getCreatedAt()
    {
        return $this->container['created_at'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets id
     *
     * @param string|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 modified_at
     *
     * @return \DateTime|null
     */
    public function getModifiedAt()
    {
        return $this->container['modified_at'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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


