<?php
/**
 * LineItem
 *
 * PHP version 8.1
 *
 * @category Class
 * @package  Vend202601
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * API 2026-01
 *
 * Lightspeed Retail (X-Series) API.
 *
 * The version of the OpenAPI document: 2026-01
 * Contact: x-series.api@lightspeedhq.com
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.20.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 Vend202601\Model;

use \ArrayAccess;
use \Vend202601\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'cost' => 'float',
        'cost_total' => 'float',
        'discount' => 'float',
        'discount_total' => 'float',
        'id' => 'string',
        'is_return' => 'bool',
        'loyalty_value' => 'float',
        'note' => 'string',
        'price' => 'float',
        'price_set' => 'bool',
        'price_total' => 'float',
        'product_id' => 'string',
        'quantity' => 'float',
        'salesperson_id' => 'string',
        'sequence' => 'float',
        'status' => 'string',
        'surcharges' => '\Vend202601\Model\LineItemSurcharge[]',
        'tax' => 'float',
        'tax_components' => '\Vend202601\Model\LineItemTaxComponent[]',
        'tax_id' => 'string',
        'tax_total' => 'float'
    ];

    /**
      * 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 = [
        'cost' => 'double',
        'cost_total' => 'double',
        'discount' => 'double',
        'discount_total' => 'double',
        'id' => 'uuid',
        'is_return' => null,
        'loyalty_value' => 'double',
        'note' => null,
        'price' => 'double',
        'price_set' => null,
        'price_total' => 'double',
        'product_id' => 'uuid',
        'quantity' => 'double',
        'salesperson_id' => 'uuid',
        'sequence' => 'double',
        'status' => null,
        'surcharges' => null,
        'tax' => 'double',
        'tax_components' => null,
        'tax_id' => 'uuid',
        'tax_total' => 'double'
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'cost' => false,
        'cost_total' => false,
        'discount' => false,
        'discount_total' => false,
        'id' => false,
        'is_return' => false,
        'loyalty_value' => false,
        'note' => true,
        'price' => false,
        'price_set' => false,
        'price_total' => false,
        'product_id' => false,
        'quantity' => false,
        'salesperson_id' => false,
        'sequence' => false,
        'status' => false,
        'surcharges' => false,
        'tax' => false,
        'tax_components' => false,
        'tax_id' => false,
        'tax_total' => 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 = [
        'cost' => 'cost',
        'cost_total' => 'cost_total',
        'discount' => 'discount',
        'discount_total' => 'discount_total',
        'id' => 'id',
        'is_return' => 'is_return',
        'loyalty_value' => 'loyalty_value',
        'note' => 'note',
        'price' => 'price',
        'price_set' => 'price_set',
        'price_total' => 'price_total',
        'product_id' => 'product_id',
        'quantity' => 'quantity',
        'salesperson_id' => 'salesperson_id',
        'sequence' => 'sequence',
        'status' => 'status',
        'surcharges' => 'surcharges',
        'tax' => 'tax',
        'tax_components' => 'tax_components',
        'tax_id' => 'tax_id',
        'tax_total' => 'tax_total'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'cost' => 'setCost',
        'cost_total' => 'setCostTotal',
        'discount' => 'setDiscount',
        'discount_total' => 'setDiscountTotal',
        'id' => 'setId',
        'is_return' => 'setIsReturn',
        'loyalty_value' => 'setLoyaltyValue',
        'note' => 'setNote',
        'price' => 'setPrice',
        'price_set' => 'setPriceSet',
        'price_total' => 'setPriceTotal',
        'product_id' => 'setProductId',
        'quantity' => 'setQuantity',
        'salesperson_id' => 'setSalespersonId',
        'sequence' => 'setSequence',
        'status' => 'setStatus',
        'surcharges' => 'setSurcharges',
        'tax' => 'setTax',
        'tax_components' => 'setTaxComponents',
        'tax_id' => 'setTaxId',
        'tax_total' => 'setTaxTotal'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'cost' => 'getCost',
        'cost_total' => 'getCostTotal',
        'discount' => 'getDiscount',
        'discount_total' => 'getDiscountTotal',
        'id' => 'getId',
        'is_return' => 'getIsReturn',
        'loyalty_value' => 'getLoyaltyValue',
        'note' => 'getNote',
        'price' => 'getPrice',
        'price_set' => 'getPriceSet',
        'price_total' => 'getPriceTotal',
        'product_id' => 'getProductId',
        'quantity' => 'getQuantity',
        'salesperson_id' => 'getSalespersonId',
        'sequence' => 'getSequence',
        'status' => 'getStatus',
        'surcharges' => 'getSurcharges',
        'tax' => 'getTax',
        'tax_components' => 'getTaxComponents',
        'tax_id' => 'getTaxId',
        'tax_total' => 'getTaxTotal'
    ];

    /**
     * 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 STATUS_SAVED = 'SAVED';
    public const STATUS_VOIDED = 'VOIDED';
    public const STATUS_CONFIRMED = 'CONFIRMED';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getStatusAllowableValues()
    {
        return [
            self::STATUS_SAVED,
            self::STATUS_VOIDED,
            self::STATUS_CONFIRMED,
        ];
    }

    /**
     * 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('cost', $data ?? [], null);
        $this->setIfExists('cost_total', $data ?? [], null);
        $this->setIfExists('discount', $data ?? [], null);
        $this->setIfExists('discount_total', $data ?? [], null);
        $this->setIfExists('id', $data ?? [], null);
        $this->setIfExists('is_return', $data ?? [], null);
        $this->setIfExists('loyalty_value', $data ?? [], null);
        $this->setIfExists('note', $data ?? [], null);
        $this->setIfExists('price', $data ?? [], null);
        $this->setIfExists('price_set', $data ?? [], null);
        $this->setIfExists('price_total', $data ?? [], null);
        $this->setIfExists('product_id', $data ?? [], null);
        $this->setIfExists('quantity', $data ?? [], null);
        $this->setIfExists('salesperson_id', $data ?? [], null);
        $this->setIfExists('sequence', $data ?? [], null);
        $this->setIfExists('status', $data ?? [], null);
        $this->setIfExists('surcharges', $data ?? [], null);
        $this->setIfExists('tax', $data ?? [], null);
        $this->setIfExists('tax_components', $data ?? [], null);
        $this->setIfExists('tax_id', $data ?? [], null);
        $this->setIfExists('tax_total', $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->getStatusAllowableValues();
        if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'status', must be one of '%s'",
                $this->container['status'],
                implode("', '", $allowedValues)
            );
        }

        return $invalidProperties;
    }

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


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

    /**
     * Sets cost
     *
     * @param float|null $cost Unit cost for the line item.
     *
     * @return self
     */
    public function setCost($cost)
    {
        if (is_null($cost)) {
            throw new \InvalidArgumentException('non-nullable cost cannot be null');
        }
        $this->container['cost'] = $cost;

        return $this;
    }

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

    /**
     * Sets cost_total
     *
     * @param float|null $cost_total Total cost for the line item.
     *
     * @return self
     */
    public function setCostTotal($cost_total)
    {
        if (is_null($cost_total)) {
            throw new \InvalidArgumentException('non-nullable cost_total cannot be null');
        }
        $this->container['cost_total'] = $cost_total;

        return $this;
    }

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

    /**
     * Sets discount
     *
     * @param float|null $discount Discount value of the line item.
     *
     * @return self
     */
    public function setDiscount($discount)
    {
        if (is_null($discount)) {
            throw new \InvalidArgumentException('non-nullable discount cannot be null');
        }
        $this->container['discount'] = $discount;

        return $this;
    }

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

    /**
     * Sets discount_total
     *
     * @param float|null $discount_total Total discount for the line item.
     *
     * @return self
     */
    public function setDiscountTotal($discount_total)
    {
        if (is_null($discount_total)) {
            throw new \InvalidArgumentException('non-nullable discount_total cannot be null');
        }
        $this->container['discount_total'] = $discount_total;

        return $this;
    }

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

    /**
     * Sets id
     *
     * @param string|null $id The ID of this line item.
     *
     * @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 is_return
     *
     * @return bool|null
     */
    public function getIsReturn()
    {
        return $this->container['is_return'];
    }

    /**
     * Sets is_return
     *
     * @param bool|null $is_return Indicates whether this line item is a return from another sale (referenced by `return_for` on the main sale object).
     *
     * @return self
     */
    public function setIsReturn($is_return)
    {
        if (is_null($is_return)) {
            throw new \InvalidArgumentException('non-nullable is_return cannot be null');
        }
        $this->container['is_return'] = $is_return;

        return $this;
    }

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

    /**
     * Sets loyalty_value
     *
     * @param float|null $loyalty_value The value that should be added to associated customer's loyalty balance.
     *
     * @return self
     */
    public function setLoyaltyValue($loyalty_value)
    {
        if (is_null($loyalty_value)) {
            throw new \InvalidArgumentException('non-nullable loyalty_value cannot be null');
        }
        $this->container['loyalty_value'] = $loyalty_value;

        return $this;
    }

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

    /**
     * Sets note
     *
     * @param string|null $note Line item note.
     *
     * @return self
     */
    public function setNote($note)
    {
        if (is_null($note)) {
            array_push($this->openAPINullablesSetToNull, 'note');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('note', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['note'] = $note;

        return $this;
    }

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

    /**
     * Sets price
     *
     * @param float|null $price Unit price of the line item.
     *
     * @return self
     */
    public function setPrice($price)
    {
        if (is_null($price)) {
            throw new \InvalidArgumentException('non-nullable price cannot be null');
        }
        $this->container['price'] = $price;

        return $this;
    }

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

    /**
     * Sets price_set
     *
     * @param bool|null $price_set Indicates whether the price was set manually. Using `true` means that the value will never be refreshed from the Price Book when reloaded (sale retrieved from parked sales).
     *
     * @return self
     */
    public function setPriceSet($price_set)
    {
        if (is_null($price_set)) {
            throw new \InvalidArgumentException('non-nullable price_set cannot be null');
        }
        $this->container['price_set'] = $price_set;

        return $this;
    }

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

    /**
     * Sets price_total
     *
     * @param float|null $price_total Total price for the line item.
     *
     * @return self
     */
    public function setPriceTotal($price_total)
    {
        if (is_null($price_total)) {
            throw new \InvalidArgumentException('non-nullable price_total cannot be null');
        }
        $this->container['price_total'] = $price_total;

        return $this;
    }

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

    /**
     * Sets product_id
     *
     * @param string|null $product_id The ID of the product associated with this line item.
     *
     * @return self
     */
    public function setProductId($product_id)
    {
        if (is_null($product_id)) {
            throw new \InvalidArgumentException('non-nullable product_id cannot be null');
        }
        $this->container['product_id'] = $product_id;

        return $this;
    }

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

    /**
     * Sets quantity
     *
     * @param float|null $quantity Quantity of products for the line item.
     *
     * @return self
     */
    public function setQuantity($quantity)
    {
        if (is_null($quantity)) {
            throw new \InvalidArgumentException('non-nullable quantity cannot be null');
        }
        $this->container['quantity'] = $quantity;

        return $this;
    }

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

    /**
     * Sets salesperson_id
     *
     * @param string|null $salesperson_id The ID of the salesperson associated with this line item. Salesperson IDs can be retrieved from the /api/2.0/users endpoint. Only needed when this line item is not sold by current login user.
     *
     * @return self
     */
    public function setSalespersonId($salesperson_id)
    {
        if (is_null($salesperson_id)) {
            throw new \InvalidArgumentException('non-nullable salesperson_id cannot be null');
        }
        $this->container['salesperson_id'] = $salesperson_id;

        return $this;
    }

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

    /**
     * Sets sequence
     *
     * @param float|null $sequence Order of the line item in the sale.
     *
     * @return self
     */
    public function setSequence($sequence)
    {
        if (is_null($sequence)) {
            throw new \InvalidArgumentException('non-nullable sequence cannot be null');
        }
        $this->container['sequence'] = $sequence;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets surcharges
     *
     * @return \Vend202601\Model\LineItemSurcharge[]|null
     */
    public function getSurcharges()
    {
        return $this->container['surcharges'];
    }

    /**
     * Sets surcharges
     *
     * @param \Vend202601\Model\LineItemSurcharge[]|null $surcharges Collection of surcharges associated with the line item.
     *
     * @return self
     */
    public function setSurcharges($surcharges)
    {
        if (is_null($surcharges)) {
            throw new \InvalidArgumentException('non-nullable surcharges cannot be null');
        }
        $this->container['surcharges'] = $surcharges;

        return $this;
    }

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

    /**
     * Sets tax
     *
     * @param float|null $tax The unit tax value associated with this line item. **deprecated**
     *
     * @return self
     * @deprecated
     */
    public function setTax($tax)
    {
        if (is_null($tax)) {
            throw new \InvalidArgumentException('non-nullable tax cannot be null');
        }
        $this->container['tax'] = $tax;

        return $this;
    }

    /**
     * Gets tax_components
     *
     * @return \Vend202601\Model\LineItemTaxComponent[]|null
     */
    public function getTaxComponents()
    {
        return $this->container['tax_components'];
    }

    /**
     * Sets tax_components
     *
     * @param \Vend202601\Model\LineItemTaxComponent[]|null $tax_components Collection of tax components associated with the line item.
     *
     * @return self
     */
    public function setTaxComponents($tax_components)
    {
        if (is_null($tax_components)) {
            throw new \InvalidArgumentException('non-nullable tax_components cannot be null');
        }
        $this->container['tax_components'] = $tax_components;

        return $this;
    }

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

    /**
     * Sets tax_id
     *
     * @param string|null $tax_id The ID of the tax associated with this line item.
     *
     * @return self
     */
    public function setTaxId($tax_id)
    {
        if (is_null($tax_id)) {
            throw new \InvalidArgumentException('non-nullable tax_id cannot be null');
        }
        $this->container['tax_id'] = $tax_id;

        return $this;
    }

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

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

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


