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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'at_url' => 'string',
        'active' => 'bool',
        'article_number' => 'string',
        'bulky' => 'bool',
        'commodity_code' => 'string',
        'construction_account' => 'int',
        'cost_calculation_method' => 'string',
        'default_stock_location' => 'string',
        'default_stock_point' => 'string',
        'depth' => 'int',
        'description' => 'string',
        'direct_cost' => 'float',
        'disposable_quantity' => 'float',
        'ean' => 'string',
        'eu_account' => 'int',
        'euvat_account' => 'int',
        'expired' => 'bool',
        'export_account' => 'int',
        'freight_cost' => 'float',
        'height' => 'int',
        'housework' => 'bool',
        'housework_type' => 'string',
        'manufacturer' => 'string',
        'manufacturer_article_number' => 'string',
        'note' => 'string',
        'other_cost' => 'float',
        'purchase_account' => 'int',
        'purchase_price' => 'float',
        'quantity_in_stock' => 'float',
        'reserved_quantity' => 'float',
        'sales_account' => 'int',
        'sales_price' => 'float',
        'stock_account' => 'int',
        'stock_change_account' => 'int',
        'stock_goods' => 'bool',
        'stock_place' => 'string',
        'stock_value' => 'float',
        'stock_warning' => 'float',
        'supplier_name' => 'string',
        'supplier_number' => 'string',
        'type' => 'string',
        'unit' => 'string',
        'vat' => 'float',
        'webshop_article' => 'bool',
        'weight' => 'int',
        'width' => 'int'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      * @phpstan-var array<string, string|null>
      * @psalm-var array<string, string|null>
      */
    protected static $openAPIFormats = [
        'at_url' => null,
        'active' => null,
        'article_number' => null,
        'bulky' => null,
        'commodity_code' => null,
        'construction_account' => 'int32',
        'cost_calculation_method' => null,
        'default_stock_location' => null,
        'default_stock_point' => null,
        'depth' => 'int32',
        'description' => null,
        'direct_cost' => 'double',
        'disposable_quantity' => 'double',
        'ean' => null,
        'eu_account' => 'int32',
        'euvat_account' => 'int32',
        'expired' => null,
        'export_account' => 'int32',
        'freight_cost' => 'double',
        'height' => 'int32',
        'housework' => null,
        'housework_type' => null,
        'manufacturer' => null,
        'manufacturer_article_number' => null,
        'note' => null,
        'other_cost' => 'double',
        'purchase_account' => 'int32',
        'purchase_price' => 'double',
        'quantity_in_stock' => 'double',
        'reserved_quantity' => 'double',
        'sales_account' => 'int32',
        'sales_price' => 'double',
        'stock_account' => 'int32',
        'stock_change_account' => 'int32',
        'stock_goods' => null,
        'stock_place' => null,
        'stock_value' => 'double',
        'stock_warning' => 'double',
        'supplier_name' => null,
        'supplier_number' => null,
        'type' => null,
        'unit' => null,
        'vat' => 'double',
        'webshop_article' => null,
        'weight' => 'int32',
        'width' => 'int32'
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'at_url' => false,
        'active' => false,
        'article_number' => false,
        'bulky' => false,
        'commodity_code' => false,
        'construction_account' => false,
        'cost_calculation_method' => false,
        'default_stock_location' => false,
        'default_stock_point' => false,
        'depth' => false,
        'description' => false,
        'direct_cost' => false,
        'disposable_quantity' => false,
        'ean' => false,
        'eu_account' => false,
        'euvat_account' => false,
        'expired' => false,
        'export_account' => false,
        'freight_cost' => false,
        'height' => false,
        'housework' => false,
        'housework_type' => false,
        'manufacturer' => false,
        'manufacturer_article_number' => false,
        'note' => false,
        'other_cost' => false,
        'purchase_account' => false,
        'purchase_price' => false,
        'quantity_in_stock' => false,
        'reserved_quantity' => false,
        'sales_account' => false,
        'sales_price' => false,
        'stock_account' => false,
        'stock_change_account' => false,
        'stock_goods' => false,
        'stock_place' => false,
        'stock_value' => false,
        'stock_warning' => false,
        'supplier_name' => false,
        'supplier_number' => false,
        'type' => false,
        'unit' => false,
        'vat' => false,
        'webshop_article' => false,
        'weight' => false,
        'width' => false
    ];

    /**
      * If a nullable field gets set to null, insert it here
      *
      * @var boolean[]
      */
    protected array $openAPINullablesSetToNull = [];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPITypes()
    {
        return self::$openAPITypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPIFormats()
    {
        return self::$openAPIFormats;
    }

    /**
     * Array of nullable properties
     *
     * @return array
     */
    protected static function openAPINullables(): array
    {
        return self::$openAPINullables;
    }

    /**
     * Array of nullable field names deliberately set to null
     *
     * @return boolean[]
     */
    private function getOpenAPINullablesSetToNull(): array
    {
        return $this->openAPINullablesSetToNull;
    }

    /**
     * Setter - Array of nullable field names deliberately set to null
     *
     * @param boolean[] $openAPINullablesSetToNull
     */
    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
    {
        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
    }

    /**
     * Checks if a property is nullable
     *
     * @param string $property
     * @return bool
     */
    public static function isNullable(string $property): bool
    {
        return self::openAPINullables()[$property] ?? false;
    }

    /**
     * Checks if a nullable property is set to null.
     *
     * @param string $property
     * @return bool
     */
    public function isNullableSetToNull(string $property): bool
    {
        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'at_url' => '@url',
        'active' => 'Active',
        'article_number' => 'ArticleNumber',
        'bulky' => 'Bulky',
        'commodity_code' => 'CommodityCode',
        'construction_account' => 'ConstructionAccount',
        'cost_calculation_method' => 'CostCalculationMethod',
        'default_stock_location' => 'DefaultStockLocation',
        'default_stock_point' => 'DefaultStockPoint',
        'depth' => 'Depth',
        'description' => 'Description',
        'direct_cost' => 'DirectCost',
        'disposable_quantity' => 'DisposableQuantity',
        'ean' => 'EAN',
        'eu_account' => 'EUAccount',
        'euvat_account' => 'EUVATAccount',
        'expired' => 'Expired',
        'export_account' => 'ExportAccount',
        'freight_cost' => 'FreightCost',
        'height' => 'Height',
        'housework' => 'Housework',
        'housework_type' => 'HouseworkType',
        'manufacturer' => 'Manufacturer',
        'manufacturer_article_number' => 'ManufacturerArticleNumber',
        'note' => 'Note',
        'other_cost' => 'OtherCost',
        'purchase_account' => 'PurchaseAccount',
        'purchase_price' => 'PurchasePrice',
        'quantity_in_stock' => 'QuantityInStock',
        'reserved_quantity' => 'ReservedQuantity',
        'sales_account' => 'SalesAccount',
        'sales_price' => 'SalesPrice',
        'stock_account' => 'StockAccount',
        'stock_change_account' => 'StockChangeAccount',
        'stock_goods' => 'StockGoods',
        'stock_place' => 'StockPlace',
        'stock_value' => 'StockValue',
        'stock_warning' => 'StockWarning',
        'supplier_name' => 'SupplierName',
        'supplier_number' => 'SupplierNumber',
        'type' => 'Type',
        'unit' => 'Unit',
        'vat' => 'VAT',
        'webshop_article' => 'WebshopArticle',
        'weight' => 'Weight',
        'width' => 'Width'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'at_url' => 'setAtUrl',
        'active' => 'setActive',
        'article_number' => 'setArticleNumber',
        'bulky' => 'setBulky',
        'commodity_code' => 'setCommodityCode',
        'construction_account' => 'setConstructionAccount',
        'cost_calculation_method' => 'setCostCalculationMethod',
        'default_stock_location' => 'setDefaultStockLocation',
        'default_stock_point' => 'setDefaultStockPoint',
        'depth' => 'setDepth',
        'description' => 'setDescription',
        'direct_cost' => 'setDirectCost',
        'disposable_quantity' => 'setDisposableQuantity',
        'ean' => 'setEan',
        'eu_account' => 'setEuAccount',
        'euvat_account' => 'setEuvatAccount',
        'expired' => 'setExpired',
        'export_account' => 'setExportAccount',
        'freight_cost' => 'setFreightCost',
        'height' => 'setHeight',
        'housework' => 'setHousework',
        'housework_type' => 'setHouseworkType',
        'manufacturer' => 'setManufacturer',
        'manufacturer_article_number' => 'setManufacturerArticleNumber',
        'note' => 'setNote',
        'other_cost' => 'setOtherCost',
        'purchase_account' => 'setPurchaseAccount',
        'purchase_price' => 'setPurchasePrice',
        'quantity_in_stock' => 'setQuantityInStock',
        'reserved_quantity' => 'setReservedQuantity',
        'sales_account' => 'setSalesAccount',
        'sales_price' => 'setSalesPrice',
        'stock_account' => 'setStockAccount',
        'stock_change_account' => 'setStockChangeAccount',
        'stock_goods' => 'setStockGoods',
        'stock_place' => 'setStockPlace',
        'stock_value' => 'setStockValue',
        'stock_warning' => 'setStockWarning',
        'supplier_name' => 'setSupplierName',
        'supplier_number' => 'setSupplierNumber',
        'type' => 'setType',
        'unit' => 'setUnit',
        'vat' => 'setVat',
        'webshop_article' => 'setWebshopArticle',
        'weight' => 'setWeight',
        'width' => 'setWidth'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'at_url' => 'getAtUrl',
        'active' => 'getActive',
        'article_number' => 'getArticleNumber',
        'bulky' => 'getBulky',
        'commodity_code' => 'getCommodityCode',
        'construction_account' => 'getConstructionAccount',
        'cost_calculation_method' => 'getCostCalculationMethod',
        'default_stock_location' => 'getDefaultStockLocation',
        'default_stock_point' => 'getDefaultStockPoint',
        'depth' => 'getDepth',
        'description' => 'getDescription',
        'direct_cost' => 'getDirectCost',
        'disposable_quantity' => 'getDisposableQuantity',
        'ean' => 'getEan',
        'eu_account' => 'getEuAccount',
        'euvat_account' => 'getEuvatAccount',
        'expired' => 'getExpired',
        'export_account' => 'getExportAccount',
        'freight_cost' => 'getFreightCost',
        'height' => 'getHeight',
        'housework' => 'getHousework',
        'housework_type' => 'getHouseworkType',
        'manufacturer' => 'getManufacturer',
        'manufacturer_article_number' => 'getManufacturerArticleNumber',
        'note' => 'getNote',
        'other_cost' => 'getOtherCost',
        'purchase_account' => 'getPurchaseAccount',
        'purchase_price' => 'getPurchasePrice',
        'quantity_in_stock' => 'getQuantityInStock',
        'reserved_quantity' => 'getReservedQuantity',
        'sales_account' => 'getSalesAccount',
        'sales_price' => 'getSalesPrice',
        'stock_account' => 'getStockAccount',
        'stock_change_account' => 'getStockChangeAccount',
        'stock_goods' => 'getStockGoods',
        'stock_place' => 'getStockPlace',
        'stock_value' => 'getStockValue',
        'stock_warning' => 'getStockWarning',
        'supplier_name' => 'getSupplierName',
        'supplier_number' => 'getSupplierNumber',
        'type' => 'getType',
        'unit' => 'getUnit',
        'vat' => 'getVat',
        'webshop_article' => 'getWebshopArticle',
        'weight' => 'getWeight',
        'width' => 'getWidth'
    ];

    /**
     * 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 HOUSEWORK_TYPE_CONSTRUCTION = 'CONSTRUCTION';
    public const HOUSEWORK_TYPE_ELECTRICITY = 'ELECTRICITY';
    public const HOUSEWORK_TYPE_GLASSMETALWORK = 'GLASSMETALWORK';
    public const HOUSEWORK_TYPE_GROUNDDRAINAGEWORK = 'GROUNDDRAINAGEWORK';
    public const HOUSEWORK_TYPE_MASONRY = 'MASONRY';
    public const HOUSEWORK_TYPE_PAINTINGWALLPAPERING = 'PAINTINGWALLPAPERING';
    public const HOUSEWORK_TYPE_HVAC = 'HVAC';
    public const HOUSEWORK_TYPE_CLEANING = 'CLEANING';
    public const HOUSEWORK_TYPE_TEXTILECLOTHING = 'TEXTILECLOTHING';
    public const HOUSEWORK_TYPE_COOKING = 'COOKING';
    public const HOUSEWORK_TYPE_SNOWPLOWING = 'SNOWPLOWING';
    public const HOUSEWORK_TYPE_GARDENING = 'GARDENING';
    public const HOUSEWORK_TYPE_BABYSITTING = 'BABYSITTING';
    public const HOUSEWORK_TYPE_OTHERCARE = 'OTHERCARE';
    public const HOUSEWORK_TYPE_TUTORING = 'TUTORING';
    public const HOUSEWORK_TYPE_FURNISHING = 'FURNISHING';
    public const HOUSEWORK_TYPE_HOMEMAINTENANCE = 'HOMEMAINTENANCE';
    public const HOUSEWORK_TYPE_TRANSPORTATIONSERVICES = 'TRANSPORTATIONSERVICES';
    public const HOUSEWORK_TYPE_WASHINGANDCAREOFCLOTHING = 'WASHINGANDCAREOFCLOTHING';
    public const HOUSEWORK_TYPE_SOLARCELLS = 'SOLARCELLS';
    public const HOUSEWORK_TYPE_STORAGESELFPRODUCEDELECTRICITY = 'STORAGESELFPRODUCEDELECTRICITY';
    public const HOUSEWORK_TYPE_CHARGINGSTATIONELECTRICVEHICLE = 'CHARGINGSTATIONELECTRICVEHICLE';
    public const HOUSEWORK_TYPE_EMPTYHOUSEWORK = 'EMPTYHOUSEWORK';
    public const HOUSEWORK_TYPE_OTHERCOSTS = 'OTHERCOSTS';
    public const TYPE_STOCK = 'STOCK';
    public const TYPE_SERVICE = 'SERVICE';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getHouseworkTypeAllowableValues()
    {
        return [
            self::HOUSEWORK_TYPE_CONSTRUCTION,
            self::HOUSEWORK_TYPE_ELECTRICITY,
            self::HOUSEWORK_TYPE_GLASSMETALWORK,
            self::HOUSEWORK_TYPE_GROUNDDRAINAGEWORK,
            self::HOUSEWORK_TYPE_MASONRY,
            self::HOUSEWORK_TYPE_PAINTINGWALLPAPERING,
            self::HOUSEWORK_TYPE_HVAC,
            self::HOUSEWORK_TYPE_CLEANING,
            self::HOUSEWORK_TYPE_TEXTILECLOTHING,
            self::HOUSEWORK_TYPE_COOKING,
            self::HOUSEWORK_TYPE_SNOWPLOWING,
            self::HOUSEWORK_TYPE_GARDENING,
            self::HOUSEWORK_TYPE_BABYSITTING,
            self::HOUSEWORK_TYPE_OTHERCARE,
            self::HOUSEWORK_TYPE_TUTORING,
            self::HOUSEWORK_TYPE_FURNISHING,
            self::HOUSEWORK_TYPE_HOMEMAINTENANCE,
            self::HOUSEWORK_TYPE_TRANSPORTATIONSERVICES,
            self::HOUSEWORK_TYPE_WASHINGANDCAREOFCLOTHING,
            self::HOUSEWORK_TYPE_SOLARCELLS,
            self::HOUSEWORK_TYPE_STORAGESELFPRODUCEDELECTRICITY,
            self::HOUSEWORK_TYPE_CHARGINGSTATIONELECTRICVEHICLE,
            self::HOUSEWORK_TYPE_EMPTYHOUSEWORK,
            self::HOUSEWORK_TYPE_OTHERCOSTS,
        ];
    }

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getTypeAllowableValues()
    {
        return [
            self::TYPE_STOCK,
            self::TYPE_SERVICE,
        ];
    }

    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[]|null $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('at_url', $data ?? [], null);
        $this->setIfExists('active', $data ?? [], null);
        $this->setIfExists('article_number', $data ?? [], null);
        $this->setIfExists('bulky', $data ?? [], null);
        $this->setIfExists('commodity_code', $data ?? [], null);
        $this->setIfExists('construction_account', $data ?? [], null);
        $this->setIfExists('cost_calculation_method', $data ?? [], null);
        $this->setIfExists('default_stock_location', $data ?? [], null);
        $this->setIfExists('default_stock_point', $data ?? [], null);
        $this->setIfExists('depth', $data ?? [], null);
        $this->setIfExists('description', $data ?? [], null);
        $this->setIfExists('direct_cost', $data ?? [], null);
        $this->setIfExists('disposable_quantity', $data ?? [], null);
        $this->setIfExists('ean', $data ?? [], null);
        $this->setIfExists('eu_account', $data ?? [], null);
        $this->setIfExists('euvat_account', $data ?? [], null);
        $this->setIfExists('expired', $data ?? [], null);
        $this->setIfExists('export_account', $data ?? [], null);
        $this->setIfExists('freight_cost', $data ?? [], null);
        $this->setIfExists('height', $data ?? [], null);
        $this->setIfExists('housework', $data ?? [], null);
        $this->setIfExists('housework_type', $data ?? [], null);
        $this->setIfExists('manufacturer', $data ?? [], null);
        $this->setIfExists('manufacturer_article_number', $data ?? [], null);
        $this->setIfExists('note', $data ?? [], null);
        $this->setIfExists('other_cost', $data ?? [], null);
        $this->setIfExists('purchase_account', $data ?? [], null);
        $this->setIfExists('purchase_price', $data ?? [], null);
        $this->setIfExists('quantity_in_stock', $data ?? [], null);
        $this->setIfExists('reserved_quantity', $data ?? [], null);
        $this->setIfExists('sales_account', $data ?? [], null);
        $this->setIfExists('sales_price', $data ?? [], null);
        $this->setIfExists('stock_account', $data ?? [], null);
        $this->setIfExists('stock_change_account', $data ?? [], null);
        $this->setIfExists('stock_goods', $data ?? [], null);
        $this->setIfExists('stock_place', $data ?? [], null);
        $this->setIfExists('stock_value', $data ?? [], null);
        $this->setIfExists('stock_warning', $data ?? [], null);
        $this->setIfExists('supplier_name', $data ?? [], null);
        $this->setIfExists('supplier_number', $data ?? [], null);
        $this->setIfExists('type', $data ?? [], null);
        $this->setIfExists('unit', $data ?? [], null);
        $this->setIfExists('vat', $data ?? [], null);
        $this->setIfExists('webshop_article', $data ?? [], null);
        $this->setIfExists('weight', $data ?? [], null);
        $this->setIfExists('width', $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['article_number']) && (mb_strlen($this->container['article_number']) > 50)) {
            $invalidProperties[] = "invalid value for 'article_number', the character length must be smaller than or equal to 50.";
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        if (($construction_account > 99999)) {
            throw new \InvalidArgumentException('invalid value for $construction_account when calling FortnoxArticleSingleItem., must be smaller than or equal to 99999.');
        }
        if (($construction_account < 1000)) {
            throw new \InvalidArgumentException('invalid value for $construction_account when calling FortnoxArticleSingleItem., must be bigger than or equal to 1000.');
        }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        if (($depth > 999999999)) {
            throw new \InvalidArgumentException('invalid value for $depth when calling FortnoxArticleSingleItem., must be smaller than or equal to 999999999.');
        }
        if (($depth < 0)) {
            throw new \InvalidArgumentException('invalid value for $depth when calling FortnoxArticleSingleItem., must be bigger than or equal to 0.');
        }

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

        if (($eu_account > 99999)) {
            throw new \InvalidArgumentException('invalid value for $eu_account when calling FortnoxArticleSingleItem., must be smaller than or equal to 99999.');
        }
        if (($eu_account < 1000)) {
            throw new \InvalidArgumentException('invalid value for $eu_account when calling FortnoxArticleSingleItem., must be bigger than or equal to 1000.');
        }

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

        return $this;
    }

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

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

        if (($euvat_account > 99999)) {
            throw new \InvalidArgumentException('invalid value for $euvat_account when calling FortnoxArticleSingleItem., must be smaller than or equal to 99999.');
        }
        if (($euvat_account < 1000)) {
            throw new \InvalidArgumentException('invalid value for $euvat_account when calling FortnoxArticleSingleItem., must be bigger than or equal to 1000.');
        }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        if (($export_account > 99999)) {
            throw new \InvalidArgumentException('invalid value for $export_account when calling FortnoxArticleSingleItem., must be smaller than or equal to 99999.');
        }
        if (($export_account < 1000)) {
            throw new \InvalidArgumentException('invalid value for $export_account when calling FortnoxArticleSingleItem., must be bigger than or equal to 1000.');
        }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        if (($height > 999999999)) {
            throw new \InvalidArgumentException('invalid value for $height when calling FortnoxArticleSingleItem., must be smaller than or equal to 999999999.');
        }
        if (($height < 0)) {
            throw new \InvalidArgumentException('invalid value for $height when calling FortnoxArticleSingleItem., must be bigger than or equal to 0.');
        }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        if (($purchase_account > 99999)) {
            throw new \InvalidArgumentException('invalid value for $purchase_account when calling FortnoxArticleSingleItem., must be smaller than or equal to 99999.');
        }
        if (($purchase_account < 1000)) {
            throw new \InvalidArgumentException('invalid value for $purchase_account when calling FortnoxArticleSingleItem., must be bigger than or equal to 1000.');
        }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        if (($sales_account > 99999)) {
            throw new \InvalidArgumentException('invalid value for $sales_account when calling FortnoxArticleSingleItem., must be smaller than or equal to 99999.');
        }
        if (($sales_account < 1000)) {
            throw new \InvalidArgumentException('invalid value for $sales_account when calling FortnoxArticleSingleItem., must be bigger than or equal to 1000.');
        }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        if (($weight > 999999999)) {
            throw new \InvalidArgumentException('invalid value for $weight when calling FortnoxArticleSingleItem., must be smaller than or equal to 999999999.');
        }
        if (($weight < 0)) {
            throw new \InvalidArgumentException('invalid value for $weight when calling FortnoxArticleSingleItem., must be bigger than or equal to 0.');
        }

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

        return $this;
    }

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

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

        if (($width > 999999999)) {
            throw new \InvalidArgumentException('invalid value for $width when calling FortnoxArticleSingleItem., must be smaller than or equal to 999999999.');
        }
        if (($width < 0)) {
            throw new \InvalidArgumentException('invalid value for $width when calling FortnoxArticleSingleItem., must be bigger than or equal to 0.');
        }

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

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


