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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'at_url' => 'string',
        'at_url_tax_reduction_list' => 'string',
        'address1' => 'string',
        'address2' => 'string',
        'administration_fee' => 'float',
        'administration_fee_vat' => 'float',
        'basis_tax_reduction' => 'float',
        'cancelled' => 'bool',
        'city' => 'string',
        'comments' => 'string',
        'contribution_percent' => 'float',
        'contribution_value' => 'float',
        'copy_remarks' => 'bool',
        'cost_center' => 'string',
        'country' => 'string',
        'currency' => 'string',
        'currency_rate' => 'float',
        'currency_unit' => 'int',
        'customer_name' => 'string',
        'customer_number' => 'string',
        'delivery_address1' => 'string',
        'delivery_address2' => 'string',
        'delivery_city' => 'string',
        'delivery_country' => 'string',
        'delivery_date' => '\DateTime',
        'delivery_name' => 'string',
        'delivery_zip_code' => 'string',
        'document_number' => 'string',
        'email_information' => '\Fortnox\Model\FortnoxDocumentEmailFieldSingleItem',
        'expire_date' => '\DateTime',
        'freight' => 'float',
        'freight_vat' => 'float',
        'gross' => 'float',
        'house_work' => 'bool',
        'invoice_reference' => 'string',
        'labels' => '\Fortnox\Model\FortnoxOOFDocumentTagsOnDocumentSingleItem[]',
        'language' => 'string',
        'net' => 'float',
        'not_completed' => 'bool',
        'offer_date' => '\DateTime',
        'offer_rows' => '\Fortnox\Model\FortnoxOfferOfferRowSingleItem[]',
        'order_reference' => 'string',
        'organisation_number' => 'string',
        'our_reference' => 'string',
        'phone1' => 'string',
        'phone2' => 'string',
        'price_list' => 'string',
        'print_template' => 'string',
        'project' => 'string',
        'remarks' => 'string',
        'round_off' => 'float',
        'sent' => 'bool',
        'tax_reduction' => 'int',
        'tax_reduction_type' => 'string',
        'terms_of_delivery' => 'string',
        'terms_of_payment' => 'string',
        'total' => 'float',
        'total_to_pay' => 'float',
        'total_vat' => 'float',
        'vat_included' => 'bool',
        'way_of_delivery' => 'string',
        'your_reference' => 'string',
        'your_reference_number' => 'string',
        'zip_code' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      * @phpstan-var array<string, string|null>
      * @psalm-var array<string, string|null>
      */
    protected static $openAPIFormats = [
        'at_url' => null,
        'at_url_tax_reduction_list' => null,
        'address1' => null,
        'address2' => null,
        'administration_fee' => 'double',
        'administration_fee_vat' => 'double',
        'basis_tax_reduction' => 'double',
        'cancelled' => null,
        'city' => null,
        'comments' => null,
        'contribution_percent' => 'double',
        'contribution_value' => 'double',
        'copy_remarks' => null,
        'cost_center' => null,
        'country' => null,
        'currency' => null,
        'currency_rate' => 'double',
        'currency_unit' => 'int32',
        'customer_name' => null,
        'customer_number' => null,
        'delivery_address1' => null,
        'delivery_address2' => null,
        'delivery_city' => null,
        'delivery_country' => null,
        'delivery_date' => 'date',
        'delivery_name' => null,
        'delivery_zip_code' => null,
        'document_number' => null,
        'email_information' => null,
        'expire_date' => 'date',
        'freight' => 'double',
        'freight_vat' => 'double',
        'gross' => 'double',
        'house_work' => null,
        'invoice_reference' => null,
        'labels' => null,
        'language' => null,
        'net' => 'double',
        'not_completed' => null,
        'offer_date' => 'date',
        'offer_rows' => null,
        'order_reference' => null,
        'organisation_number' => null,
        'our_reference' => null,
        'phone1' => null,
        'phone2' => null,
        'price_list' => null,
        'print_template' => null,
        'project' => null,
        'remarks' => null,
        'round_off' => 'double',
        'sent' => null,
        'tax_reduction' => 'int32',
        'tax_reduction_type' => null,
        'terms_of_delivery' => null,
        'terms_of_payment' => null,
        'total' => 'double',
        'total_to_pay' => 'double',
        'total_vat' => 'double',
        'vat_included' => null,
        'way_of_delivery' => null,
        'your_reference' => null,
        'your_reference_number' => null,
        'zip_code' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'at_url' => false,
        'at_url_tax_reduction_list' => false,
        'address1' => false,
        'address2' => false,
        'administration_fee' => false,
        'administration_fee_vat' => false,
        'basis_tax_reduction' => false,
        'cancelled' => false,
        'city' => false,
        'comments' => false,
        'contribution_percent' => false,
        'contribution_value' => false,
        'copy_remarks' => false,
        'cost_center' => false,
        'country' => false,
        'currency' => false,
        'currency_rate' => false,
        'currency_unit' => false,
        'customer_name' => false,
        'customer_number' => false,
        'delivery_address1' => false,
        'delivery_address2' => false,
        'delivery_city' => false,
        'delivery_country' => false,
        'delivery_date' => false,
        'delivery_name' => false,
        'delivery_zip_code' => false,
        'document_number' => false,
        'email_information' => false,
        'expire_date' => false,
        'freight' => false,
        'freight_vat' => false,
        'gross' => false,
        'house_work' => false,
        'invoice_reference' => false,
        'labels' => false,
        'language' => false,
        'net' => false,
        'not_completed' => false,
        'offer_date' => false,
        'offer_rows' => false,
        'order_reference' => false,
        'organisation_number' => false,
        'our_reference' => false,
        'phone1' => false,
        'phone2' => false,
        'price_list' => false,
        'print_template' => false,
        'project' => false,
        'remarks' => false,
        'round_off' => false,
        'sent' => false,
        'tax_reduction' => false,
        'tax_reduction_type' => false,
        'terms_of_delivery' => false,
        'terms_of_payment' => false,
        'total' => false,
        'total_to_pay' => false,
        'total_vat' => false,
        'vat_included' => false,
        'way_of_delivery' => false,
        'your_reference' => false,
        'your_reference_number' => false,
        'zip_code' => 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 = [
        'at_url' => '@url',
        'at_url_tax_reduction_list' => '@urlTaxReductionList',
        'address1' => 'Address1',
        'address2' => 'Address2',
        'administration_fee' => 'AdministrationFee',
        'administration_fee_vat' => 'AdministrationFeeVAT',
        'basis_tax_reduction' => 'BasisTaxReduction',
        'cancelled' => 'Cancelled',
        'city' => 'City',
        'comments' => 'Comments',
        'contribution_percent' => 'ContributionPercent',
        'contribution_value' => 'ContributionValue',
        'copy_remarks' => 'CopyRemarks',
        'cost_center' => 'CostCenter',
        'country' => 'Country',
        'currency' => 'Currency',
        'currency_rate' => 'CurrencyRate',
        'currency_unit' => 'CurrencyUnit',
        'customer_name' => 'CustomerName',
        'customer_number' => 'CustomerNumber',
        'delivery_address1' => 'DeliveryAddress1',
        'delivery_address2' => 'DeliveryAddress2',
        'delivery_city' => 'DeliveryCity',
        'delivery_country' => 'DeliveryCountry',
        'delivery_date' => 'DeliveryDate',
        'delivery_name' => 'DeliveryName',
        'delivery_zip_code' => 'DeliveryZipCode',
        'document_number' => 'DocumentNumber',
        'email_information' => 'EmailInformation',
        'expire_date' => 'ExpireDate',
        'freight' => 'Freight',
        'freight_vat' => 'FreightVAT',
        'gross' => 'Gross',
        'house_work' => 'HouseWork',
        'invoice_reference' => 'InvoiceReference',
        'labels' => 'Labels',
        'language' => 'Language',
        'net' => 'Net',
        'not_completed' => 'NotCompleted',
        'offer_date' => 'OfferDate',
        'offer_rows' => 'OfferRows',
        'order_reference' => 'OrderReference',
        'organisation_number' => 'OrganisationNumber',
        'our_reference' => 'OurReference',
        'phone1' => 'Phone1',
        'phone2' => 'Phone2',
        'price_list' => 'PriceList',
        'print_template' => 'PrintTemplate',
        'project' => 'Project',
        'remarks' => 'Remarks',
        'round_off' => 'RoundOff',
        'sent' => 'Sent',
        'tax_reduction' => 'TaxReduction',
        'tax_reduction_type' => 'TaxReductionType',
        'terms_of_delivery' => 'TermsOfDelivery',
        'terms_of_payment' => 'TermsOfPayment',
        'total' => 'Total',
        'total_to_pay' => 'TotalToPay',
        'total_vat' => 'TotalVAT',
        'vat_included' => 'VATIncluded',
        'way_of_delivery' => 'WayOfDelivery',
        'your_reference' => 'YourReference',
        'your_reference_number' => 'YourReferenceNumber',
        'zip_code' => 'ZipCode'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'at_url' => 'setAtUrl',
        'at_url_tax_reduction_list' => 'setAtUrlTaxReductionList',
        'address1' => 'setAddress1',
        'address2' => 'setAddress2',
        'administration_fee' => 'setAdministrationFee',
        'administration_fee_vat' => 'setAdministrationFeeVat',
        'basis_tax_reduction' => 'setBasisTaxReduction',
        'cancelled' => 'setCancelled',
        'city' => 'setCity',
        'comments' => 'setComments',
        'contribution_percent' => 'setContributionPercent',
        'contribution_value' => 'setContributionValue',
        'copy_remarks' => 'setCopyRemarks',
        'cost_center' => 'setCostCenter',
        'country' => 'setCountry',
        'currency' => 'setCurrency',
        'currency_rate' => 'setCurrencyRate',
        'currency_unit' => 'setCurrencyUnit',
        'customer_name' => 'setCustomerName',
        'customer_number' => 'setCustomerNumber',
        'delivery_address1' => 'setDeliveryAddress1',
        'delivery_address2' => 'setDeliveryAddress2',
        'delivery_city' => 'setDeliveryCity',
        'delivery_country' => 'setDeliveryCountry',
        'delivery_date' => 'setDeliveryDate',
        'delivery_name' => 'setDeliveryName',
        'delivery_zip_code' => 'setDeliveryZipCode',
        'document_number' => 'setDocumentNumber',
        'email_information' => 'setEmailInformation',
        'expire_date' => 'setExpireDate',
        'freight' => 'setFreight',
        'freight_vat' => 'setFreightVat',
        'gross' => 'setGross',
        'house_work' => 'setHouseWork',
        'invoice_reference' => 'setInvoiceReference',
        'labels' => 'setLabels',
        'language' => 'setLanguage',
        'net' => 'setNet',
        'not_completed' => 'setNotCompleted',
        'offer_date' => 'setOfferDate',
        'offer_rows' => 'setOfferRows',
        'order_reference' => 'setOrderReference',
        'organisation_number' => 'setOrganisationNumber',
        'our_reference' => 'setOurReference',
        'phone1' => 'setPhone1',
        'phone2' => 'setPhone2',
        'price_list' => 'setPriceList',
        'print_template' => 'setPrintTemplate',
        'project' => 'setProject',
        'remarks' => 'setRemarks',
        'round_off' => 'setRoundOff',
        'sent' => 'setSent',
        'tax_reduction' => 'setTaxReduction',
        'tax_reduction_type' => 'setTaxReductionType',
        'terms_of_delivery' => 'setTermsOfDelivery',
        'terms_of_payment' => 'setTermsOfPayment',
        'total' => 'setTotal',
        'total_to_pay' => 'setTotalToPay',
        'total_vat' => 'setTotalVat',
        'vat_included' => 'setVatIncluded',
        'way_of_delivery' => 'setWayOfDelivery',
        'your_reference' => 'setYourReference',
        'your_reference_number' => 'setYourReferenceNumber',
        'zip_code' => 'setZipCode'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'at_url' => 'getAtUrl',
        'at_url_tax_reduction_list' => 'getAtUrlTaxReductionList',
        'address1' => 'getAddress1',
        'address2' => 'getAddress2',
        'administration_fee' => 'getAdministrationFee',
        'administration_fee_vat' => 'getAdministrationFeeVat',
        'basis_tax_reduction' => 'getBasisTaxReduction',
        'cancelled' => 'getCancelled',
        'city' => 'getCity',
        'comments' => 'getComments',
        'contribution_percent' => 'getContributionPercent',
        'contribution_value' => 'getContributionValue',
        'copy_remarks' => 'getCopyRemarks',
        'cost_center' => 'getCostCenter',
        'country' => 'getCountry',
        'currency' => 'getCurrency',
        'currency_rate' => 'getCurrencyRate',
        'currency_unit' => 'getCurrencyUnit',
        'customer_name' => 'getCustomerName',
        'customer_number' => 'getCustomerNumber',
        'delivery_address1' => 'getDeliveryAddress1',
        'delivery_address2' => 'getDeliveryAddress2',
        'delivery_city' => 'getDeliveryCity',
        'delivery_country' => 'getDeliveryCountry',
        'delivery_date' => 'getDeliveryDate',
        'delivery_name' => 'getDeliveryName',
        'delivery_zip_code' => 'getDeliveryZipCode',
        'document_number' => 'getDocumentNumber',
        'email_information' => 'getEmailInformation',
        'expire_date' => 'getExpireDate',
        'freight' => 'getFreight',
        'freight_vat' => 'getFreightVat',
        'gross' => 'getGross',
        'house_work' => 'getHouseWork',
        'invoice_reference' => 'getInvoiceReference',
        'labels' => 'getLabels',
        'language' => 'getLanguage',
        'net' => 'getNet',
        'not_completed' => 'getNotCompleted',
        'offer_date' => 'getOfferDate',
        'offer_rows' => 'getOfferRows',
        'order_reference' => 'getOrderReference',
        'organisation_number' => 'getOrganisationNumber',
        'our_reference' => 'getOurReference',
        'phone1' => 'getPhone1',
        'phone2' => 'getPhone2',
        'price_list' => 'getPriceList',
        'print_template' => 'getPrintTemplate',
        'project' => 'getProject',
        'remarks' => 'getRemarks',
        'round_off' => 'getRoundOff',
        'sent' => 'getSent',
        'tax_reduction' => 'getTaxReduction',
        'tax_reduction_type' => 'getTaxReductionType',
        'terms_of_delivery' => 'getTermsOfDelivery',
        'terms_of_payment' => 'getTermsOfPayment',
        'total' => 'getTotal',
        'total_to_pay' => 'getTotalToPay',
        'total_vat' => 'getTotalVat',
        'vat_included' => 'getVatIncluded',
        'way_of_delivery' => 'getWayOfDelivery',
        'your_reference' => 'getYourReference',
        'your_reference_number' => 'getYourReferenceNumber',
        'zip_code' => 'getZipCode'
    ];

    /**
     * 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 TAX_REDUCTION_TYPE_NONE = 'none';
    public const TAX_REDUCTION_TYPE_ROT = 'rot';
    public const TAX_REDUCTION_TYPE_RUT = 'rut';
    public const TAX_REDUCTION_TYPE_GREEN = 'green';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getTaxReductionTypeAllowableValues()
    {
        return [
            self::TAX_REDUCTION_TYPE_NONE,
            self::TAX_REDUCTION_TYPE_ROT,
            self::TAX_REDUCTION_TYPE_RUT,
            self::TAX_REDUCTION_TYPE_GREEN,
        ];
    }

    /**
     * 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('at_url', $data ?? [], null);
        $this->setIfExists('at_url_tax_reduction_list', $data ?? [], null);
        $this->setIfExists('address1', $data ?? [], null);
        $this->setIfExists('address2', $data ?? [], null);
        $this->setIfExists('administration_fee', $data ?? [], null);
        $this->setIfExists('administration_fee_vat', $data ?? [], null);
        $this->setIfExists('basis_tax_reduction', $data ?? [], null);
        $this->setIfExists('cancelled', $data ?? [], null);
        $this->setIfExists('city', $data ?? [], null);
        $this->setIfExists('comments', $data ?? [], null);
        $this->setIfExists('contribution_percent', $data ?? [], null);
        $this->setIfExists('contribution_value', $data ?? [], null);
        $this->setIfExists('copy_remarks', $data ?? [], null);
        $this->setIfExists('cost_center', $data ?? [], null);
        $this->setIfExists('country', $data ?? [], null);
        $this->setIfExists('currency', $data ?? [], null);
        $this->setIfExists('currency_rate', $data ?? [], null);
        $this->setIfExists('currency_unit', $data ?? [], null);
        $this->setIfExists('customer_name', $data ?? [], null);
        $this->setIfExists('customer_number', $data ?? [], null);
        $this->setIfExists('delivery_address1', $data ?? [], null);
        $this->setIfExists('delivery_address2', $data ?? [], null);
        $this->setIfExists('delivery_city', $data ?? [], null);
        $this->setIfExists('delivery_country', $data ?? [], null);
        $this->setIfExists('delivery_date', $data ?? [], null);
        $this->setIfExists('delivery_name', $data ?? [], null);
        $this->setIfExists('delivery_zip_code', $data ?? [], null);
        $this->setIfExists('document_number', $data ?? [], null);
        $this->setIfExists('email_information', $data ?? [], null);
        $this->setIfExists('expire_date', $data ?? [], null);
        $this->setIfExists('freight', $data ?? [], null);
        $this->setIfExists('freight_vat', $data ?? [], null);
        $this->setIfExists('gross', $data ?? [], null);
        $this->setIfExists('house_work', $data ?? [], null);
        $this->setIfExists('invoice_reference', $data ?? [], null);
        $this->setIfExists('labels', $data ?? [], null);
        $this->setIfExists('language', $data ?? [], null);
        $this->setIfExists('net', $data ?? [], null);
        $this->setIfExists('not_completed', $data ?? [], null);
        $this->setIfExists('offer_date', $data ?? [], null);
        $this->setIfExists('offer_rows', $data ?? [], null);
        $this->setIfExists('order_reference', $data ?? [], null);
        $this->setIfExists('organisation_number', $data ?? [], null);
        $this->setIfExists('our_reference', $data ?? [], null);
        $this->setIfExists('phone1', $data ?? [], null);
        $this->setIfExists('phone2', $data ?? [], null);
        $this->setIfExists('price_list', $data ?? [], null);
        $this->setIfExists('print_template', $data ?? [], null);
        $this->setIfExists('project', $data ?? [], null);
        $this->setIfExists('remarks', $data ?? [], null);
        $this->setIfExists('round_off', $data ?? [], null);
        $this->setIfExists('sent', $data ?? [], null);
        $this->setIfExists('tax_reduction', $data ?? [], null);
        $this->setIfExists('tax_reduction_type', $data ?? [], null);
        $this->setIfExists('terms_of_delivery', $data ?? [], null);
        $this->setIfExists('terms_of_payment', $data ?? [], null);
        $this->setIfExists('total', $data ?? [], null);
        $this->setIfExists('total_to_pay', $data ?? [], null);
        $this->setIfExists('total_vat', $data ?? [], null);
        $this->setIfExists('vat_included', $data ?? [], null);
        $this->setIfExists('way_of_delivery', $data ?? [], null);
        $this->setIfExists('your_reference', $data ?? [], null);
        $this->setIfExists('your_reference_number', $data ?? [], null);
        $this->setIfExists('zip_code', $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 (!is_null($this->container['address1']) && (mb_strlen($this->container['address1']) > 1024)) {
            $invalidProperties[] = "invalid value for 'address1', the character length must be smaller than or equal to 1024.";
        }

        if (!is_null($this->container['address2']) && (mb_strlen($this->container['address2']) > 1024)) {
            $invalidProperties[] = "invalid value for 'address2', the character length must be smaller than or equal to 1024.";
        }

        if (!is_null($this->container['city']) && (mb_strlen($this->container['city']) > 1024)) {
            $invalidProperties[] = "invalid value for 'city', the character length must be smaller than or equal to 1024.";
        }

        if (!is_null($this->container['comments']) && (mb_strlen($this->container['comments']) > 1024)) {
            $invalidProperties[] = "invalid value for 'comments', the character length must be smaller than or equal to 1024.";
        }

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

        if (!is_null($this->container['delivery_address2']) && (mb_strlen($this->container['delivery_address2']) > 1024)) {
            $invalidProperties[] = "invalid value for 'delivery_address2', the character length must be smaller than or equal to 1024.";
        }

        if (!is_null($this->container['delivery_city']) && (mb_strlen($this->container['delivery_city']) > 1024)) {
            $invalidProperties[] = "invalid value for 'delivery_city', the character length must be smaller than or equal to 1024.";
        }

        if (!is_null($this->container['delivery_name']) && (mb_strlen($this->container['delivery_name']) > 1024)) {
            $invalidProperties[] = "invalid value for 'delivery_name', the character length must be smaller than or equal to 1024.";
        }

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets address1
     *
     * @param string|null $address1 address1
     *
     * @return self
     */
    public function setAddress1($address1)
    {
        if (is_null($address1)) {
            throw new \InvalidArgumentException('non-nullable address1 cannot be null');
        }
        if ((mb_strlen($address1) > 1024)) {
            throw new \InvalidArgumentException('invalid length for $address1 when calling FortnoxOfferOfferSingleItem., must be smaller than or equal to 1024.');
        }

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

        return $this;
    }

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

    /**
     * Sets address2
     *
     * @param string|null $address2 address2
     *
     * @return self
     */
    public function setAddress2($address2)
    {
        if (is_null($address2)) {
            throw new \InvalidArgumentException('non-nullable address2 cannot be null');
        }
        if ((mb_strlen($address2) > 1024)) {
            throw new \InvalidArgumentException('invalid length for $address2 when calling FortnoxOfferOfferSingleItem., must be smaller than or equal to 1024.');
        }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets city
     *
     * @param string|null $city city
     *
     * @return self
     */
    public function setCity($city)
    {
        if (is_null($city)) {
            throw new \InvalidArgumentException('non-nullable city cannot be null');
        }
        if ((mb_strlen($city) > 1024)) {
            throw new \InvalidArgumentException('invalid length for $city when calling FortnoxOfferOfferSingleItem., must be smaller than or equal to 1024.');
        }

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

        return $this;
    }

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

    /**
     * Sets comments
     *
     * @param string|null $comments comments
     *
     * @return self
     */
    public function setComments($comments)
    {
        if (is_null($comments)) {
            throw new \InvalidArgumentException('non-nullable comments cannot be null');
        }
        if ((mb_strlen($comments) > 1024)) {
            throw new \InvalidArgumentException('invalid length for $comments when calling FortnoxOfferOfferSingleItem., must be smaller than or equal to 1024.');
        }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets customer_name
     *
     * @param string|null $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');
        }
        $this->container['customer_name'] = $customer_name;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets delivery_address1
     *
     * @param string|null $delivery_address1 delivery_address1
     *
     * @return self
     */
    public function setDeliveryAddress1($delivery_address1)
    {
        if (is_null($delivery_address1)) {
            throw new \InvalidArgumentException('non-nullable delivery_address1 cannot be null');
        }
        if ((mb_strlen($delivery_address1) > 1024)) {
            throw new \InvalidArgumentException('invalid length for $delivery_address1 when calling FortnoxOfferOfferSingleItem., must be smaller than or equal to 1024.');
        }

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

        return $this;
    }

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

    /**
     * Sets delivery_address2
     *
     * @param string|null $delivery_address2 delivery_address2
     *
     * @return self
     */
    public function setDeliveryAddress2($delivery_address2)
    {
        if (is_null($delivery_address2)) {
            throw new \InvalidArgumentException('non-nullable delivery_address2 cannot be null');
        }
        if ((mb_strlen($delivery_address2) > 1024)) {
            throw new \InvalidArgumentException('invalid length for $delivery_address2 when calling FortnoxOfferOfferSingleItem., must be smaller than or equal to 1024.');
        }

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

        return $this;
    }

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

    /**
     * Sets delivery_city
     *
     * @param string|null $delivery_city delivery_city
     *
     * @return self
     */
    public function setDeliveryCity($delivery_city)
    {
        if (is_null($delivery_city)) {
            throw new \InvalidArgumentException('non-nullable delivery_city cannot be null');
        }
        if ((mb_strlen($delivery_city) > 1024)) {
            throw new \InvalidArgumentException('invalid length for $delivery_city when calling FortnoxOfferOfferSingleItem., must be smaller than or equal to 1024.');
        }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets delivery_name
     *
     * @param string|null $delivery_name delivery_name
     *
     * @return self
     */
    public function setDeliveryName($delivery_name)
    {
        if (is_null($delivery_name)) {
            throw new \InvalidArgumentException('non-nullable delivery_name cannot be null');
        }
        if ((mb_strlen($delivery_name) > 1024)) {
            throw new \InvalidArgumentException('invalid length for $delivery_name when calling FortnoxOfferOfferSingleItem., must be smaller than or equal to 1024.');
        }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets organisation_number
     *
     * @param string|null $organisation_number organisation_number
     *
     * @return self
     */
    public function setOrganisationNumber($organisation_number)
    {
        if (is_null($organisation_number)) {
            throw new \InvalidArgumentException('non-nullable organisation_number cannot be null');
        }
        $this->container['organisation_number'] = $organisation_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 phone1
     *
     * @return string|null
     */
    public function getPhone1()
    {
        return $this->container['phone1'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

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

        return $this;
    }

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

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

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


