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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'confirmation_email' => 'string',
        'cost_center_code' => 'string',
        'currency_code' => 'string',
        'currency_rate' => 'float',
        'currency_unit' => 'int',
        'customer_id' => 'string',
        'customer_name' => 'string',
        'customer_number' => 'string',
        'delivery_address' => 'string',
        'delivery_address2' => 'string',
        'delivery_city' => 'string',
        'delivery_country_code' => 'string',
        'delivery_date' => '\DateTime',
        'delivery_name' => 'string',
        'delivery_zip_code' => 'string',
        'dropship' => 'bool',
        'id' => 'int',
        'internal_reference' => 'string',
        'language_code' => 'string',
        'manually_completed' => 'bool',
        'message_to_supplier' => 'string',
        'note' => 'string',
        'order_date' => '\DateTime',
        'order_value' => 'float',
        'order_value_in_sek' => 'float',
        'our_reference' => 'string',
        'outbound_document_reference' => '\Fortnox\Model\WarehouseDocumentReference',
        'payment_terms_code' => 'string',
        'project_id' => 'string',
        'purchase_order_state' => 'string',
        'purchase_type' => 'string',
        'response_state' => 'string',
        'rows' => '\Fortnox\Model\WarehousePurchaseOrderRow[]',
        'stock_point_code' => 'string',
        'stock_point_id' => 'string',
        'supplier' => 'string',
        'supplier_address' => 'string',
        'supplier_address2' => 'string',
        'supplier_city' => 'string',
        'supplier_country_code' => 'string',
        'supplier_email' => 'string',
        'supplier_name' => 'string',
        'supplier_number' => 'string',
        'supplier_post_code' => 'string',
        'total_received_quantity' => 'float',
        'translated_response_state' => 'string',
        'voided' => 'bool',
        'your_reference' => '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 = [
        'confirmation_email' => null,
        'cost_center_code' => null,
        'currency_code' => null,
        'currency_rate' => null,
        'currency_unit' => 'int32',
        'customer_id' => null,
        'customer_name' => null,
        'customer_number' => null,
        'delivery_address' => null,
        'delivery_address2' => null,
        'delivery_city' => null,
        'delivery_country_code' => null,
        'delivery_date' => 'date',
        'delivery_name' => null,
        'delivery_zip_code' => null,
        'dropship' => null,
        'id' => 'int64',
        'internal_reference' => null,
        'language_code' => null,
        'manually_completed' => null,
        'message_to_supplier' => null,
        'note' => null,
        'order_date' => 'date',
        'order_value' => null,
        'order_value_in_sek' => null,
        'our_reference' => null,
        'outbound_document_reference' => null,
        'payment_terms_code' => null,
        'project_id' => null,
        'purchase_order_state' => null,
        'purchase_type' => null,
        'response_state' => null,
        'rows' => null,
        'stock_point_code' => null,
        'stock_point_id' => 'uuid',
        'supplier' => null,
        'supplier_address' => null,
        'supplier_address2' => null,
        'supplier_city' => null,
        'supplier_country_code' => null,
        'supplier_email' => null,
        'supplier_name' => null,
        'supplier_number' => null,
        'supplier_post_code' => null,
        'total_received_quantity' => null,
        'translated_response_state' => null,
        'voided' => null,
        'your_reference' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'confirmation_email' => false,
        'cost_center_code' => false,
        'currency_code' => false,
        'currency_rate' => false,
        'currency_unit' => false,
        'customer_id' => false,
        'customer_name' => false,
        'customer_number' => false,
        'delivery_address' => false,
        'delivery_address2' => false,
        'delivery_city' => false,
        'delivery_country_code' => false,
        'delivery_date' => false,
        'delivery_name' => false,
        'delivery_zip_code' => false,
        'dropship' => false,
        'id' => false,
        'internal_reference' => false,
        'language_code' => false,
        'manually_completed' => false,
        'message_to_supplier' => false,
        'note' => false,
        'order_date' => false,
        'order_value' => false,
        'order_value_in_sek' => false,
        'our_reference' => false,
        'outbound_document_reference' => false,
        'payment_terms_code' => false,
        'project_id' => false,
        'purchase_order_state' => false,
        'purchase_type' => false,
        'response_state' => false,
        'rows' => false,
        'stock_point_code' => false,
        'stock_point_id' => false,
        'supplier' => false,
        'supplier_address' => false,
        'supplier_address2' => false,
        'supplier_city' => false,
        'supplier_country_code' => false,
        'supplier_email' => false,
        'supplier_name' => false,
        'supplier_number' => false,
        'supplier_post_code' => false,
        'total_received_quantity' => false,
        'translated_response_state' => false,
        'voided' => false,
        'your_reference' => 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 = [
        'confirmation_email' => 'confirmationEmail',
        'cost_center_code' => 'costCenterCode',
        'currency_code' => 'currencyCode',
        'currency_rate' => 'currencyRate',
        'currency_unit' => 'currencyUnit',
        'customer_id' => 'customerId',
        'customer_name' => 'customerName',
        'customer_number' => 'customerNumber',
        'delivery_address' => 'deliveryAddress',
        'delivery_address2' => 'deliveryAddress2',
        'delivery_city' => 'deliveryCity',
        'delivery_country_code' => 'deliveryCountryCode',
        'delivery_date' => 'deliveryDate',
        'delivery_name' => 'deliveryName',
        'delivery_zip_code' => 'deliveryZipCode',
        'dropship' => 'dropship',
        'id' => 'id',
        'internal_reference' => 'internalReference',
        'language_code' => 'languageCode',
        'manually_completed' => 'manuallyCompleted',
        'message_to_supplier' => 'messageToSupplier',
        'note' => 'note',
        'order_date' => 'orderDate',
        'order_value' => 'orderValue',
        'order_value_in_sek' => 'orderValueInSEK',
        'our_reference' => 'ourReference',
        'outbound_document_reference' => 'outboundDocumentReference',
        'payment_terms_code' => 'paymentTermsCode',
        'project_id' => 'projectId',
        'purchase_order_state' => 'purchaseOrderState',
        'purchase_type' => 'purchaseType',
        'response_state' => 'responseState',
        'rows' => 'rows',
        'stock_point_code' => 'stockPointCode',
        'stock_point_id' => 'stockPointId',
        'supplier' => 'supplier',
        'supplier_address' => 'supplierAddress',
        'supplier_address2' => 'supplierAddress2',
        'supplier_city' => 'supplierCity',
        'supplier_country_code' => 'supplierCountryCode',
        'supplier_email' => 'supplierEmail',
        'supplier_name' => 'supplierName',
        'supplier_number' => 'supplierNumber',
        'supplier_post_code' => 'supplierPostCode',
        'total_received_quantity' => 'totalReceivedQuantity',
        'translated_response_state' => 'translatedResponseState',
        'voided' => 'voided',
        'your_reference' => 'yourReference'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'confirmation_email' => 'setConfirmationEmail',
        'cost_center_code' => 'setCostCenterCode',
        'currency_code' => 'setCurrencyCode',
        'currency_rate' => 'setCurrencyRate',
        'currency_unit' => 'setCurrencyUnit',
        'customer_id' => 'setCustomerId',
        'customer_name' => 'setCustomerName',
        'customer_number' => 'setCustomerNumber',
        'delivery_address' => 'setDeliveryAddress',
        'delivery_address2' => 'setDeliveryAddress2',
        'delivery_city' => 'setDeliveryCity',
        'delivery_country_code' => 'setDeliveryCountryCode',
        'delivery_date' => 'setDeliveryDate',
        'delivery_name' => 'setDeliveryName',
        'delivery_zip_code' => 'setDeliveryZipCode',
        'dropship' => 'setDropship',
        'id' => 'setId',
        'internal_reference' => 'setInternalReference',
        'language_code' => 'setLanguageCode',
        'manually_completed' => 'setManuallyCompleted',
        'message_to_supplier' => 'setMessageToSupplier',
        'note' => 'setNote',
        'order_date' => 'setOrderDate',
        'order_value' => 'setOrderValue',
        'order_value_in_sek' => 'setOrderValueInSek',
        'our_reference' => 'setOurReference',
        'outbound_document_reference' => 'setOutboundDocumentReference',
        'payment_terms_code' => 'setPaymentTermsCode',
        'project_id' => 'setProjectId',
        'purchase_order_state' => 'setPurchaseOrderState',
        'purchase_type' => 'setPurchaseType',
        'response_state' => 'setResponseState',
        'rows' => 'setRows',
        'stock_point_code' => 'setStockPointCode',
        'stock_point_id' => 'setStockPointId',
        'supplier' => 'setSupplier',
        'supplier_address' => 'setSupplierAddress',
        'supplier_address2' => 'setSupplierAddress2',
        'supplier_city' => 'setSupplierCity',
        'supplier_country_code' => 'setSupplierCountryCode',
        'supplier_email' => 'setSupplierEmail',
        'supplier_name' => 'setSupplierName',
        'supplier_number' => 'setSupplierNumber',
        'supplier_post_code' => 'setSupplierPostCode',
        'total_received_quantity' => 'setTotalReceivedQuantity',
        'translated_response_state' => 'setTranslatedResponseState',
        'voided' => 'setVoided',
        'your_reference' => 'setYourReference'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'confirmation_email' => 'getConfirmationEmail',
        'cost_center_code' => 'getCostCenterCode',
        'currency_code' => 'getCurrencyCode',
        'currency_rate' => 'getCurrencyRate',
        'currency_unit' => 'getCurrencyUnit',
        'customer_id' => 'getCustomerId',
        'customer_name' => 'getCustomerName',
        'customer_number' => 'getCustomerNumber',
        'delivery_address' => 'getDeliveryAddress',
        'delivery_address2' => 'getDeliveryAddress2',
        'delivery_city' => 'getDeliveryCity',
        'delivery_country_code' => 'getDeliveryCountryCode',
        'delivery_date' => 'getDeliveryDate',
        'delivery_name' => 'getDeliveryName',
        'delivery_zip_code' => 'getDeliveryZipCode',
        'dropship' => 'getDropship',
        'id' => 'getId',
        'internal_reference' => 'getInternalReference',
        'language_code' => 'getLanguageCode',
        'manually_completed' => 'getManuallyCompleted',
        'message_to_supplier' => 'getMessageToSupplier',
        'note' => 'getNote',
        'order_date' => 'getOrderDate',
        'order_value' => 'getOrderValue',
        'order_value_in_sek' => 'getOrderValueInSek',
        'our_reference' => 'getOurReference',
        'outbound_document_reference' => 'getOutboundDocumentReference',
        'payment_terms_code' => 'getPaymentTermsCode',
        'project_id' => 'getProjectId',
        'purchase_order_state' => 'getPurchaseOrderState',
        'purchase_type' => 'getPurchaseType',
        'response_state' => 'getResponseState',
        'rows' => 'getRows',
        'stock_point_code' => 'getStockPointCode',
        'stock_point_id' => 'getStockPointId',
        'supplier' => 'getSupplier',
        'supplier_address' => 'getSupplierAddress',
        'supplier_address2' => 'getSupplierAddress2',
        'supplier_city' => 'getSupplierCity',
        'supplier_country_code' => 'getSupplierCountryCode',
        'supplier_email' => 'getSupplierEmail',
        'supplier_name' => 'getSupplierName',
        'supplier_number' => 'getSupplierNumber',
        'supplier_post_code' => 'getSupplierPostCode',
        'total_received_quantity' => 'getTotalReceivedQuantity',
        'translated_response_state' => 'getTranslatedResponseState',
        'voided' => 'getVoided',
        'your_reference' => 'getYourReference'
    ];

    /**
     * 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 PURCHASE_ORDER_STATE_NOT_SENT = 'NOT_SENT';
    public const PURCHASE_ORDER_STATE_SENT = 'SENT';
    public const PURCHASE_ORDER_STATE_SENT_NOT_REJECTED = 'SENT_NOT_REJECTED';
    public const PURCHASE_ORDER_STATE_DELAYED = 'DELAYED';
    public const PURCHASE_ORDER_STATE_RECEIVED = 'RECEIVED';
    public const PURCHASE_ORDER_STATE_VOIDED = 'VOIDED';
    public const PURCHASE_ORDER_STATE_CURRENT = 'CURRENT';
    public const PURCHASE_ORDER_STATE_ALL = 'ALL';
    public const PURCHASE_TYPE_WAREHOUSE = 'WAREHOUSE';
    public const PURCHASE_TYPE_DROPSHIP = 'DROPSHIP';
    public const RESPONSE_STATE_NOT_SENT = 'NOT_SENT';
    public const RESPONSE_STATE_SENT = 'SENT';
    public const RESPONSE_STATE_ACCEPTED_WITH_REQ_DLV_DATE = 'ACCEPTED_WITH_REQ_DLV_DATE';
    public const RESPONSE_STATE_ACCEPTED_WITH_CHANGED_DLV_DATE = 'ACCEPTED_WITH_CHANGED_DLV_DATE';
    public const RESPONSE_STATE_PARTLY_ACCEPTED_WITH_REQ_DLV_DATE = 'PARTLY_ACCEPTED_WITH_REQ_DLV_DATE';
    public const RESPONSE_STATE_PARTLY_ACCEPTED_WITH_CHANGED_DLV_DATE = 'PARTLY_ACCEPTED_WITH_CHANGED_DLV_DATE';
    public const RESPONSE_STATE_REJECTED = 'REJECTED';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getPurchaseOrderStateAllowableValues()
    {
        return [
            self::PURCHASE_ORDER_STATE_NOT_SENT,
            self::PURCHASE_ORDER_STATE_SENT,
            self::PURCHASE_ORDER_STATE_SENT_NOT_REJECTED,
            self::PURCHASE_ORDER_STATE_DELAYED,
            self::PURCHASE_ORDER_STATE_RECEIVED,
            self::PURCHASE_ORDER_STATE_VOIDED,
            self::PURCHASE_ORDER_STATE_CURRENT,
            self::PURCHASE_ORDER_STATE_ALL,
        ];
    }

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getPurchaseTypeAllowableValues()
    {
        return [
            self::PURCHASE_TYPE_WAREHOUSE,
            self::PURCHASE_TYPE_DROPSHIP,
        ];
    }

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getResponseStateAllowableValues()
    {
        return [
            self::RESPONSE_STATE_NOT_SENT,
            self::RESPONSE_STATE_SENT,
            self::RESPONSE_STATE_ACCEPTED_WITH_REQ_DLV_DATE,
            self::RESPONSE_STATE_ACCEPTED_WITH_CHANGED_DLV_DATE,
            self::RESPONSE_STATE_PARTLY_ACCEPTED_WITH_REQ_DLV_DATE,
            self::RESPONSE_STATE_PARTLY_ACCEPTED_WITH_CHANGED_DLV_DATE,
            self::RESPONSE_STATE_REJECTED,
        ];
    }

    /**
     * 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('confirmation_email', $data ?? [], null);
        $this->setIfExists('cost_center_code', $data ?? [], null);
        $this->setIfExists('currency_code', $data ?? [], null);
        $this->setIfExists('currency_rate', $data ?? [], null);
        $this->setIfExists('currency_unit', $data ?? [], null);
        $this->setIfExists('customer_id', $data ?? [], null);
        $this->setIfExists('customer_name', $data ?? [], null);
        $this->setIfExists('customer_number', $data ?? [], null);
        $this->setIfExists('delivery_address', $data ?? [], null);
        $this->setIfExists('delivery_address2', $data ?? [], null);
        $this->setIfExists('delivery_city', $data ?? [], null);
        $this->setIfExists('delivery_country_code', $data ?? [], null);
        $this->setIfExists('delivery_date', $data ?? [], null);
        $this->setIfExists('delivery_name', $data ?? [], null);
        $this->setIfExists('delivery_zip_code', $data ?? [], null);
        $this->setIfExists('dropship', $data ?? [], null);
        $this->setIfExists('id', $data ?? [], null);
        $this->setIfExists('internal_reference', $data ?? [], null);
        $this->setIfExists('language_code', $data ?? [], null);
        $this->setIfExists('manually_completed', $data ?? [], null);
        $this->setIfExists('message_to_supplier', $data ?? [], null);
        $this->setIfExists('note', $data ?? [], null);
        $this->setIfExists('order_date', $data ?? [], null);
        $this->setIfExists('order_value', $data ?? [], null);
        $this->setIfExists('order_value_in_sek', $data ?? [], null);
        $this->setIfExists('our_reference', $data ?? [], null);
        $this->setIfExists('outbound_document_reference', $data ?? [], null);
        $this->setIfExists('payment_terms_code', $data ?? [], null);
        $this->setIfExists('project_id', $data ?? [], null);
        $this->setIfExists('purchase_order_state', $data ?? [], null);
        $this->setIfExists('purchase_type', $data ?? [], null);
        $this->setIfExists('response_state', $data ?? [], null);
        $this->setIfExists('rows', $data ?? [], null);
        $this->setIfExists('stock_point_code', $data ?? [], null);
        $this->setIfExists('stock_point_id', $data ?? [], null);
        $this->setIfExists('supplier', $data ?? [], null);
        $this->setIfExists('supplier_address', $data ?? [], null);
        $this->setIfExists('supplier_address2', $data ?? [], null);
        $this->setIfExists('supplier_city', $data ?? [], null);
        $this->setIfExists('supplier_country_code', $data ?? [], null);
        $this->setIfExists('supplier_email', $data ?? [], null);
        $this->setIfExists('supplier_name', $data ?? [], null);
        $this->setIfExists('supplier_number', $data ?? [], null);
        $this->setIfExists('supplier_post_code', $data ?? [], null);
        $this->setIfExists('total_received_quantity', $data ?? [], null);
        $this->setIfExists('translated_response_state', $data ?? [], null);
        $this->setIfExists('voided', $data ?? [], null);
        $this->setIfExists('your_reference', $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['confirmation_email']) && (mb_strlen($this->container['confirmation_email']) > 100)) {
            $invalidProperties[] = "invalid value for 'confirmation_email', the character length must be smaller than or equal to 100.";
        }

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

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

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

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

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

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

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

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

        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 ($this->container['delivery_city'] === null) {
            $invalidProperties[] = "'delivery_city' can't be null";
        }
        if ((mb_strlen($this->container['delivery_city']) > 50)) {
            $invalidProperties[] = "invalid value for 'delivery_city', the character length must be smaller than or equal to 50.";
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

    /**
     * Sets currency_rate
     *
     * @param float $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');
        }

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

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

        return $this;
    }

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

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

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

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

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

        return $this;
    }

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

    /**
     * Sets customer_number
     *
     * @param string|null $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');
        }
        if ((mb_strlen($customer_number) > 1024)) {
            throw new \InvalidArgumentException('invalid length for $customer_number when calling WarehousePurchaseOrder., must be smaller than or equal to 1024.');
        }

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

        return $this;
    }

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

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

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

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

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

        return $this;
    }

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

    /**
     * Sets delivery_city
     *
     * @param string $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) > 50)) {
            throw new \InvalidArgumentException('invalid length for $delivery_city when calling WarehousePurchaseOrder., must be smaller than or equal to 50.');
        }
        if ((mb_strlen($delivery_city) < 1)) {
            throw new \InvalidArgumentException('invalid length for $delivery_city when calling WarehousePurchaseOrder., must be bigger than or equal to 1.');
        }

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

        return $this;
    }

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

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

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

        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
     */
    public function getDeliveryName()
    {
        return $this->container['delivery_name'];
    }

    /**
     * Sets delivery_name
     *
     * @param string $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) > 50)) {
            throw new \InvalidArgumentException('invalid length for $delivery_name when calling WarehousePurchaseOrder., must be smaller than or equal to 50.');
        }
        if ((mb_strlen($delivery_name) < 1)) {
            throw new \InvalidArgumentException('invalid length for $delivery_name when calling WarehousePurchaseOrder., must be bigger than or equal to 1.');
        }

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

        return $this;
    }

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

    /**
     * Sets delivery_zip_code
     *
     * @param string $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');
        }
        if ((mb_strlen($delivery_zip_code) > 10)) {
            throw new \InvalidArgumentException('invalid length for $delivery_zip_code when calling WarehousePurchaseOrder., must be smaller than or equal to 10.');
        }
        if ((mb_strlen($delivery_zip_code) < 1)) {
            throw new \InvalidArgumentException('invalid length for $delivery_zip_code when calling WarehousePurchaseOrder., must be bigger than or equal to 1.');
        }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

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

        return $this;
    }

    /**
     * Gets order_date
     *
     * @return \DateTime
     */
    public function getOrderDate()
    {
        return $this->container['order_date'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

    /**
     * Sets supplier_number
     *
     * @param string $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');
        }
        if ((mb_strlen($supplier_number) > 1024)) {
            throw new \InvalidArgumentException('invalid length for $supplier_number when calling WarehousePurchaseOrder., must be smaller than or equal to 1024.');
        }

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

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

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


