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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'at_url' => 'string',
        'active' => 'bool',
        'address1' => 'string',
        'address2' => 'string',
        'bg' => 'string',
        'bic' => 'string',
        'bank' => 'string',
        'bank_account_number' => 'string',
        'branch_code' => 'string',
        'city' => 'string',
        'clearing_number' => 'string',
        'comments' => 'string',
        'cost_center' => 'string',
        'country' => 'string',
        'country_code' => 'string',
        'currency' => 'string',
        'disable_payment_file' => 'bool',
        'email' => 'string',
        'fax' => 'string',
        'iban' => 'string',
        'name' => 'string',
        'organisation_number' => 'string',
        'our_customer_number' => 'string',
        'our_reference' => 'string',
        'pg' => 'string',
        'phone1' => 'string',
        'phone2' => 'string',
        'pre_defined_account' => 'string',
        'project' => 'string',
        'supplier_number' => 'string',
        'terms_of_payment' => 'string',
        'vat_number' => 'string',
        'vat_type' => 'string',
        'visiting_address' => 'string',
        'visiting_city' => 'string',
        'visiting_country' => 'string',
        'visiting_country_code' => 'string',
        'visiting_zip_code' => 'string',
        'www' => 'string',
        'work_place' => 'string',
        'your_reference' => '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,
        'active' => null,
        'address1' => null,
        'address2' => null,
        'bg' => null,
        'bic' => null,
        'bank' => null,
        'bank_account_number' => null,
        'branch_code' => null,
        'city' => null,
        'clearing_number' => null,
        'comments' => null,
        'cost_center' => null,
        'country' => null,
        'country_code' => null,
        'currency' => null,
        'disable_payment_file' => null,
        'email' => null,
        'fax' => null,
        'iban' => null,
        'name' => null,
        'organisation_number' => null,
        'our_customer_number' => null,
        'our_reference' => null,
        'pg' => null,
        'phone1' => null,
        'phone2' => null,
        'pre_defined_account' => null,
        'project' => null,
        'supplier_number' => null,
        'terms_of_payment' => null,
        'vat_number' => null,
        'vat_type' => null,
        'visiting_address' => null,
        'visiting_city' => null,
        'visiting_country' => null,
        'visiting_country_code' => null,
        'visiting_zip_code' => null,
        'www' => null,
        'work_place' => null,
        'your_reference' => null,
        'zip_code' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'at_url' => false,
        'active' => false,
        'address1' => false,
        'address2' => false,
        'bg' => false,
        'bic' => false,
        'bank' => false,
        'bank_account_number' => false,
        'branch_code' => false,
        'city' => false,
        'clearing_number' => false,
        'comments' => false,
        'cost_center' => false,
        'country' => false,
        'country_code' => false,
        'currency' => false,
        'disable_payment_file' => false,
        'email' => false,
        'fax' => false,
        'iban' => false,
        'name' => false,
        'organisation_number' => false,
        'our_customer_number' => false,
        'our_reference' => false,
        'pg' => false,
        'phone1' => false,
        'phone2' => false,
        'pre_defined_account' => false,
        'project' => false,
        'supplier_number' => false,
        'terms_of_payment' => false,
        'vat_number' => false,
        'vat_type' => false,
        'visiting_address' => false,
        'visiting_city' => false,
        'visiting_country' => false,
        'visiting_country_code' => false,
        'visiting_zip_code' => false,
        'www' => false,
        'work_place' => false,
        'your_reference' => 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',
        'active' => 'Active',
        'address1' => 'Address1',
        'address2' => 'Address2',
        'bg' => 'BG',
        'bic' => 'BIC',
        'bank' => 'Bank',
        'bank_account_number' => 'BankAccountNumber',
        'branch_code' => 'BranchCode',
        'city' => 'City',
        'clearing_number' => 'ClearingNumber',
        'comments' => 'Comments',
        'cost_center' => 'CostCenter',
        'country' => 'Country',
        'country_code' => 'CountryCode',
        'currency' => 'Currency',
        'disable_payment_file' => 'DisablePaymentFile',
        'email' => 'Email',
        'fax' => 'Fax',
        'iban' => 'IBAN',
        'name' => 'Name',
        'organisation_number' => 'OrganisationNumber',
        'our_customer_number' => 'OurCustomerNumber',
        'our_reference' => 'OurReference',
        'pg' => 'PG',
        'phone1' => 'Phone1',
        'phone2' => 'Phone2',
        'pre_defined_account' => 'PreDefinedAccount',
        'project' => 'Project',
        'supplier_number' => 'SupplierNumber',
        'terms_of_payment' => 'TermsOfPayment',
        'vat_number' => 'VATNumber',
        'vat_type' => 'VATType',
        'visiting_address' => 'VisitingAddress',
        'visiting_city' => 'VisitingCity',
        'visiting_country' => 'VisitingCountry',
        'visiting_country_code' => 'VisitingCountryCode',
        'visiting_zip_code' => 'VisitingZipCode',
        'www' => 'WWW',
        'work_place' => 'WorkPlace',
        'your_reference' => 'YourReference',
        'zip_code' => 'ZipCode'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'at_url' => 'setAtUrl',
        'active' => 'setActive',
        'address1' => 'setAddress1',
        'address2' => 'setAddress2',
        'bg' => 'setBg',
        'bic' => 'setBic',
        'bank' => 'setBank',
        'bank_account_number' => 'setBankAccountNumber',
        'branch_code' => 'setBranchCode',
        'city' => 'setCity',
        'clearing_number' => 'setClearingNumber',
        'comments' => 'setComments',
        'cost_center' => 'setCostCenter',
        'country' => 'setCountry',
        'country_code' => 'setCountryCode',
        'currency' => 'setCurrency',
        'disable_payment_file' => 'setDisablePaymentFile',
        'email' => 'setEmail',
        'fax' => 'setFax',
        'iban' => 'setIban',
        'name' => 'setName',
        'organisation_number' => 'setOrganisationNumber',
        'our_customer_number' => 'setOurCustomerNumber',
        'our_reference' => 'setOurReference',
        'pg' => 'setPg',
        'phone1' => 'setPhone1',
        'phone2' => 'setPhone2',
        'pre_defined_account' => 'setPreDefinedAccount',
        'project' => 'setProject',
        'supplier_number' => 'setSupplierNumber',
        'terms_of_payment' => 'setTermsOfPayment',
        'vat_number' => 'setVatNumber',
        'vat_type' => 'setVatType',
        'visiting_address' => 'setVisitingAddress',
        'visiting_city' => 'setVisitingCity',
        'visiting_country' => 'setVisitingCountry',
        'visiting_country_code' => 'setVisitingCountryCode',
        'visiting_zip_code' => 'setVisitingZipCode',
        'www' => 'setWww',
        'work_place' => 'setWorkPlace',
        'your_reference' => 'setYourReference',
        'zip_code' => 'setZipCode'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'at_url' => 'getAtUrl',
        'active' => 'getActive',
        'address1' => 'getAddress1',
        'address2' => 'getAddress2',
        'bg' => 'getBg',
        'bic' => 'getBic',
        'bank' => 'getBank',
        'bank_account_number' => 'getBankAccountNumber',
        'branch_code' => 'getBranchCode',
        'city' => 'getCity',
        'clearing_number' => 'getClearingNumber',
        'comments' => 'getComments',
        'cost_center' => 'getCostCenter',
        'country' => 'getCountry',
        'country_code' => 'getCountryCode',
        'currency' => 'getCurrency',
        'disable_payment_file' => 'getDisablePaymentFile',
        'email' => 'getEmail',
        'fax' => 'getFax',
        'iban' => 'getIban',
        'name' => 'getName',
        'organisation_number' => 'getOrganisationNumber',
        'our_customer_number' => 'getOurCustomerNumber',
        'our_reference' => 'getOurReference',
        'pg' => 'getPg',
        'phone1' => 'getPhone1',
        'phone2' => 'getPhone2',
        'pre_defined_account' => 'getPreDefinedAccount',
        'project' => 'getProject',
        'supplier_number' => 'getSupplierNumber',
        'terms_of_payment' => 'getTermsOfPayment',
        'vat_number' => 'getVatNumber',
        'vat_type' => 'getVatType',
        'visiting_address' => 'getVisitingAddress',
        'visiting_city' => 'getVisitingCity',
        'visiting_country' => 'getVisitingCountry',
        'visiting_country_code' => 'getVisitingCountryCode',
        'visiting_zip_code' => 'getVisitingZipCode',
        'www' => 'getWww',
        'work_place' => 'getWorkPlace',
        'your_reference' => 'getYourReference',
        '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;
    }


    /**
     * 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('active', $data ?? [], null);
        $this->setIfExists('address1', $data ?? [], null);
        $this->setIfExists('address2', $data ?? [], null);
        $this->setIfExists('bg', $data ?? [], null);
        $this->setIfExists('bic', $data ?? [], null);
        $this->setIfExists('bank', $data ?? [], null);
        $this->setIfExists('bank_account_number', $data ?? [], null);
        $this->setIfExists('branch_code', $data ?? [], null);
        $this->setIfExists('city', $data ?? [], null);
        $this->setIfExists('clearing_number', $data ?? [], null);
        $this->setIfExists('comments', $data ?? [], null);
        $this->setIfExists('cost_center', $data ?? [], null);
        $this->setIfExists('country', $data ?? [], null);
        $this->setIfExists('country_code', $data ?? [], null);
        $this->setIfExists('currency', $data ?? [], null);
        $this->setIfExists('disable_payment_file', $data ?? [], null);
        $this->setIfExists('email', $data ?? [], null);
        $this->setIfExists('fax', $data ?? [], null);
        $this->setIfExists('iban', $data ?? [], null);
        $this->setIfExists('name', $data ?? [], null);
        $this->setIfExists('organisation_number', $data ?? [], null);
        $this->setIfExists('our_customer_number', $data ?? [], null);
        $this->setIfExists('our_reference', $data ?? [], null);
        $this->setIfExists('pg', $data ?? [], null);
        $this->setIfExists('phone1', $data ?? [], null);
        $this->setIfExists('phone2', $data ?? [], null);
        $this->setIfExists('pre_defined_account', $data ?? [], null);
        $this->setIfExists('project', $data ?? [], null);
        $this->setIfExists('supplier_number', $data ?? [], null);
        $this->setIfExists('terms_of_payment', $data ?? [], null);
        $this->setIfExists('vat_number', $data ?? [], null);
        $this->setIfExists('vat_type', $data ?? [], null);
        $this->setIfExists('visiting_address', $data ?? [], null);
        $this->setIfExists('visiting_city', $data ?? [], null);
        $this->setIfExists('visiting_country', $data ?? [], null);
        $this->setIfExists('visiting_country_code', $data ?? [], null);
        $this->setIfExists('visiting_zip_code', $data ?? [], null);
        $this->setIfExists('www', $data ?? [], null);
        $this->setIfExists('work_place', $data ?? [], null);
        $this->setIfExists('your_reference', $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['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 (!is_null($this->container['country_code']) && (mb_strlen($this->container['country_code']) > 2)) {
            $invalidProperties[] = "invalid value for 'country_code', the character length must be smaller than or equal to 2.";
        }

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

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

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

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

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

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

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

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

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

        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');
        }
        $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');
        }
        $this->container['address2'] = $address2;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        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 FortnoxLfSupplierSingleItem., must be smaller than or equal to 1024.');
        }

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

        return $this;
    }

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

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

        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 FortnoxLfSupplierSingleItem., must be smaller than or equal to 1024.');
        }

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

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

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

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

        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');
        }
        if ((mb_strlen($currency) > 3)) {
            throw new \InvalidArgumentException('invalid length for $currency when calling FortnoxLfSupplierSingleItem., must be smaller than or equal to 3.');
        }

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets email
     *
     * @param string|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 fax
     *
     * @return string|null
     */
    public function getFax()
    {
        return $this->container['fax'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

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

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

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

        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');
        }
        if ((mb_strlen($phone1) > 1024)) {
            throw new \InvalidArgumentException('invalid length for $phone1 when calling FortnoxLfSupplierSingleItem., must be smaller than or equal to 1024.');
        }

        $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');
        }
        if ((mb_strlen($phone2) > 1024)) {
            throw new \InvalidArgumentException('invalid length for $phone2 when calling FortnoxLfSupplierSingleItem., must be smaller than or equal to 1024.');
        }

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

        return $this;
    }

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

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

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

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

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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


