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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'address_city' => 'string',
        'address_post_code' => 'string',
        'address_street' => 'string',
        'all_products_being_ordered' => 'array<string,int>',
        'all_products_ids_being_ordered' => 'int[]',
        'campaign_code' => 'string',
        'company_name' => 'string',
        'consultants' => 'int[]',
        'email' => 'string',
        'extra_products' => 'array<string,int>',
        'first_name' => 'string',
        'invoice_interval' => 'int',
        'last_name' => 'string',
        'organization_number' => 'string',
        'payer_products' => 'string',
        'payer_ticks' => 'string',
        'phone_number' => 'string',
        'products' => 'array<string,int>',
        'total_amount_receipt_and_travel' => 'int',
        'users' => '\Fortnox\Model\BureauInvitedUser[]'
    ];

    /**
      * 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 = [
        'address_city' => null,
        'address_post_code' => null,
        'address_street' => null,
        'all_products_being_ordered' => 'int32',
        'all_products_ids_being_ordered' => 'int32',
        'campaign_code' => null,
        'company_name' => null,
        'consultants' => 'int64',
        'email' => null,
        'extra_products' => 'int32',
        'first_name' => null,
        'invoice_interval' => 'int32',
        'last_name' => null,
        'organization_number' => null,
        'payer_products' => null,
        'payer_ticks' => null,
        'phone_number' => null,
        'products' => 'int32',
        'total_amount_receipt_and_travel' => 'int32',
        'users' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'address_city' => false,
        'address_post_code' => false,
        'address_street' => false,
        'all_products_being_ordered' => false,
        'all_products_ids_being_ordered' => false,
        'campaign_code' => false,
        'company_name' => false,
        'consultants' => false,
        'email' => false,
        'extra_products' => false,
        'first_name' => false,
        'invoice_interval' => false,
        'last_name' => false,
        'organization_number' => false,
        'payer_products' => false,
        'payer_ticks' => false,
        'phone_number' => false,
        'products' => false,
        'total_amount_receipt_and_travel' => false,
        'users' => 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 = [
        'address_city' => 'addressCity',
        'address_post_code' => 'addressPostCode',
        'address_street' => 'addressStreet',
        'all_products_being_ordered' => 'allProductsBeingOrdered',
        'all_products_ids_being_ordered' => 'allProductsIdsBeingOrdered',
        'campaign_code' => 'campaignCode',
        'company_name' => 'companyName',
        'consultants' => 'consultants',
        'email' => 'email',
        'extra_products' => 'extraProducts',
        'first_name' => 'firstName',
        'invoice_interval' => 'invoiceInterval',
        'last_name' => 'lastName',
        'organization_number' => 'organizationNumber',
        'payer_products' => 'payerProducts',
        'payer_ticks' => 'payerTicks',
        'phone_number' => 'phoneNumber',
        'products' => 'products',
        'total_amount_receipt_and_travel' => 'totalAmountReceiptAndTravel',
        'users' => 'users'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'address_city' => 'setAddressCity',
        'address_post_code' => 'setAddressPostCode',
        'address_street' => 'setAddressStreet',
        'all_products_being_ordered' => 'setAllProductsBeingOrdered',
        'all_products_ids_being_ordered' => 'setAllProductsIdsBeingOrdered',
        'campaign_code' => 'setCampaignCode',
        'company_name' => 'setCompanyName',
        'consultants' => 'setConsultants',
        'email' => 'setEmail',
        'extra_products' => 'setExtraProducts',
        'first_name' => 'setFirstName',
        'invoice_interval' => 'setInvoiceInterval',
        'last_name' => 'setLastName',
        'organization_number' => 'setOrganizationNumber',
        'payer_products' => 'setPayerProducts',
        'payer_ticks' => 'setPayerTicks',
        'phone_number' => 'setPhoneNumber',
        'products' => 'setProducts',
        'total_amount_receipt_and_travel' => 'setTotalAmountReceiptAndTravel',
        'users' => 'setUsers'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'address_city' => 'getAddressCity',
        'address_post_code' => 'getAddressPostCode',
        'address_street' => 'getAddressStreet',
        'all_products_being_ordered' => 'getAllProductsBeingOrdered',
        'all_products_ids_being_ordered' => 'getAllProductsIdsBeingOrdered',
        'campaign_code' => 'getCampaignCode',
        'company_name' => 'getCompanyName',
        'consultants' => 'getConsultants',
        'email' => 'getEmail',
        'extra_products' => 'getExtraProducts',
        'first_name' => 'getFirstName',
        'invoice_interval' => 'getInvoiceInterval',
        'last_name' => 'getLastName',
        'organization_number' => 'getOrganizationNumber',
        'payer_products' => 'getPayerProducts',
        'payer_ticks' => 'getPayerTicks',
        'phone_number' => 'getPhoneNumber',
        'products' => 'getProducts',
        'total_amount_receipt_and_travel' => 'getTotalAmountReceiptAndTravel',
        'users' => 'getUsers'
    ];

    /**
     * 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 PAYER_PRODUCTS_PARENT_COMPANY = 'PARENT_COMPANY';
    public const PAYER_PRODUCTS_CHILD_COMPANY = 'CHILD_COMPANY';
    public const PAYER_TICKS_PARENT_COMPANY = 'PARENT_COMPANY';
    public const PAYER_TICKS_CHILD_COMPANY = 'CHILD_COMPANY';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getPayerProductsAllowableValues()
    {
        return [
            self::PAYER_PRODUCTS_PARENT_COMPANY,
            self::PAYER_PRODUCTS_CHILD_COMPANY,
        ];
    }

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getPayerTicksAllowableValues()
    {
        return [
            self::PAYER_TICKS_PARENT_COMPANY,
            self::PAYER_TICKS_CHILD_COMPANY,
        ];
    }

    /**
     * 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('address_city', $data ?? [], null);
        $this->setIfExists('address_post_code', $data ?? [], null);
        $this->setIfExists('address_street', $data ?? [], null);
        $this->setIfExists('all_products_being_ordered', $data ?? [], null);
        $this->setIfExists('all_products_ids_being_ordered', $data ?? [], null);
        $this->setIfExists('campaign_code', $data ?? [], null);
        $this->setIfExists('company_name', $data ?? [], null);
        $this->setIfExists('consultants', $data ?? [], null);
        $this->setIfExists('email', $data ?? [], null);
        $this->setIfExists('extra_products', $data ?? [], null);
        $this->setIfExists('first_name', $data ?? [], null);
        $this->setIfExists('invoice_interval', $data ?? [], null);
        $this->setIfExists('last_name', $data ?? [], null);
        $this->setIfExists('organization_number', $data ?? [], null);
        $this->setIfExists('payer_products', $data ?? [], null);
        $this->setIfExists('payer_ticks', $data ?? [], null);
        $this->setIfExists('phone_number', $data ?? [], null);
        $this->setIfExists('products', $data ?? [], null);
        $this->setIfExists('total_amount_receipt_and_travel', $data ?? [], null);
        $this->setIfExists('users', $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 = [];

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

        $allowedValues = $this->getPayerTicksAllowableValues();
        if (!is_null($this->container['payer_ticks']) && !in_array($this->container['payer_ticks'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'payer_ticks', must be one of '%s'",
                $this->container['payer_ticks'],
                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 address_city
     *
     * @return string|null
     */
    public function getAddressCity()
    {
        return $this->container['address_city'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets all_products_being_ordered
     *
     * @return array<string,int>|null
     */
    public function getAllProductsBeingOrdered()
    {
        return $this->container['all_products_being_ordered'];
    }

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

        return $this;
    }

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

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


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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        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 extra_products
     *
     * @return array<string,int>|null
     */
    public function getExtraProducts()
    {
        return $this->container['extra_products'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets products
     *
     * @return array<string,int>|null
     */
    public function getProducts()
    {
        return $this->container['products'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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


