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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'batch' => 'string',
        'cost_center_code' => 'string',
        'document_state' => 'string',
        'id' => 'int',
        'inbound_stock_location_id' => 'string',
        'inbound_stock_point_id' => 'string',
        'item_description' => 'string',
        'item_id' => 'string',
        'item_unit' => 'string',
        'note' => 'string',
        'outbound_stock_point_id' => 'string',
        'package_items' => '\Fortnox\Model\WarehousePackageItem[]',
        'production_date' => '\DateTime',
        'production_state' => 'string',
        'project_id' => 'string',
        'quantity' => 'float',
        'start_date' => '\DateTime'
    ];

    /**
      * 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 = [
        'batch' => null,
        'cost_center_code' => null,
        'document_state' => null,
        'id' => 'int64',
        'inbound_stock_location_id' => 'uuid',
        'inbound_stock_point_id' => 'uuid',
        'item_description' => null,
        'item_id' => null,
        'item_unit' => null,
        'note' => null,
        'outbound_stock_point_id' => 'uuid',
        'package_items' => null,
        'production_date' => 'date',
        'production_state' => null,
        'project_id' => null,
        'quantity' => null,
        'start_date' => 'date'
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'batch' => false,
        'cost_center_code' => false,
        'document_state' => false,
        'id' => false,
        'inbound_stock_location_id' => false,
        'inbound_stock_point_id' => false,
        'item_description' => false,
        'item_id' => false,
        'item_unit' => false,
        'note' => false,
        'outbound_stock_point_id' => false,
        'package_items' => false,
        'production_date' => false,
        'production_state' => false,
        'project_id' => false,
        'quantity' => false,
        'start_date' => 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 = [
        'batch' => 'batch',
        'cost_center_code' => 'costCenterCode',
        'document_state' => 'documentState',
        'id' => 'id',
        'inbound_stock_location_id' => 'inboundStockLocationId',
        'inbound_stock_point_id' => 'inboundStockPointId',
        'item_description' => 'itemDescription',
        'item_id' => 'itemId',
        'item_unit' => 'itemUnit',
        'note' => 'note',
        'outbound_stock_point_id' => 'outboundStockPointId',
        'package_items' => 'packageItems',
        'production_date' => 'productionDate',
        'production_state' => 'productionState',
        'project_id' => 'projectId',
        'quantity' => 'quantity',
        'start_date' => 'startDate'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'batch' => 'setBatch',
        'cost_center_code' => 'setCostCenterCode',
        'document_state' => 'setDocumentState',
        'id' => 'setId',
        'inbound_stock_location_id' => 'setInboundStockLocationId',
        'inbound_stock_point_id' => 'setInboundStockPointId',
        'item_description' => 'setItemDescription',
        'item_id' => 'setItemId',
        'item_unit' => 'setItemUnit',
        'note' => 'setNote',
        'outbound_stock_point_id' => 'setOutboundStockPointId',
        'package_items' => 'setPackageItems',
        'production_date' => 'setProductionDate',
        'production_state' => 'setProductionState',
        'project_id' => 'setProjectId',
        'quantity' => 'setQuantity',
        'start_date' => 'setStartDate'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'batch' => 'getBatch',
        'cost_center_code' => 'getCostCenterCode',
        'document_state' => 'getDocumentState',
        'id' => 'getId',
        'inbound_stock_location_id' => 'getInboundStockLocationId',
        'inbound_stock_point_id' => 'getInboundStockPointId',
        'item_description' => 'getItemDescription',
        'item_id' => 'getItemId',
        'item_unit' => 'getItemUnit',
        'note' => 'getNote',
        'outbound_stock_point_id' => 'getOutboundStockPointId',
        'package_items' => 'getPackageItems',
        'production_date' => 'getProductionDate',
        'production_state' => 'getProductionState',
        'project_id' => 'getProjectId',
        'quantity' => 'getQuantity',
        'start_date' => 'getStartDate'
    ];

    /**
     * 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 DOCUMENT_STATE_COMPLETED = 'completed';
    public const DOCUMENT_STATE_VOIDED = 'voided';
    public const PRODUCTION_STATE_REGISTERED = 'registered';
    public const PRODUCTION_STATE_RESERVED = 'reserved';
    public const PRODUCTION_STATE_ONGOING = 'ongoing';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getDocumentStateAllowableValues()
    {
        return [
            self::DOCUMENT_STATE_COMPLETED,
            self::DOCUMENT_STATE_VOIDED,
        ];
    }

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getProductionStateAllowableValues()
    {
        return [
            self::PRODUCTION_STATE_REGISTERED,
            self::PRODUCTION_STATE_RESERVED,
            self::PRODUCTION_STATE_ONGOING,
        ];
    }

    /**
     * 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('batch', $data ?? [], null);
        $this->setIfExists('cost_center_code', $data ?? [], null);
        $this->setIfExists('document_state', $data ?? [], null);
        $this->setIfExists('id', $data ?? [], null);
        $this->setIfExists('inbound_stock_location_id', $data ?? [], null);
        $this->setIfExists('inbound_stock_point_id', $data ?? [], null);
        $this->setIfExists('item_description', $data ?? [], null);
        $this->setIfExists('item_id', $data ?? [], null);
        $this->setIfExists('item_unit', $data ?? [], null);
        $this->setIfExists('note', $data ?? [], null);
        $this->setIfExists('outbound_stock_point_id', $data ?? [], null);
        $this->setIfExists('package_items', $data ?? [], null);
        $this->setIfExists('production_date', $data ?? [], null);
        $this->setIfExists('production_state', $data ?? [], null);
        $this->setIfExists('project_id', $data ?? [], null);
        $this->setIfExists('quantity', $data ?? [], null);
        $this->setIfExists('start_date', $data ?? [], null);
    }

    /**
    * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
    * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
    * $this->openAPINullablesSetToNull array
    *
    * @param string $variableName
    * @param array  $fields
    * @param mixed  $defaultValue
    */
    private function setIfExists(string $variableName, array $fields, $defaultValue): void
    {
        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
            $this->openAPINullablesSetToNull[] = $variableName;
        }

        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

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

        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['production_state'] === null) {
            $invalidProperties[] = "'production_state' can't be null";
        }
        $allowedValues = $this->getProductionStateAllowableValues();
        if (!is_null($this->container['production_state']) && !in_array($this->container['production_state'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'production_state', must be one of '%s'",
                $this->container['production_state'],
                implode("', '", $allowedValues)
            );
        }

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

        if ($this->container['start_date'] === null) {
            $invalidProperties[] = "'start_date' can't be null";
        }
        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 batch
     *
     * @return string|null
     */
    public function getBatch()
    {
        return $this->container['batch'];
    }

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

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

        return $this;
    }

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

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

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

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

        return $this;
    }

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

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

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


