<?php 
// phpcs:ignoreFile WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
// phpcs:ignoreFile WordPress.WP.AlternativeFunctions.file_system_operations_fwrite
// phpcs:ignoreFile WordPress.WP.AlternativeFunctions.file_system_operations_fclose
// phpcs:ignoreFile WordPress.WP.AlternativeFunctions.file_system_operations_fopen
// phpcs:ignoreFile WordPress.Security.EscapeOutput.ExceptionNotEscaped            

/**
 * EpsApiMyApi2WebModelsOrderOrderModel
 *
 * PHP version 7.4
 *
 * @category Class
 * @package  PPLCZCPL
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * CPL
 *
 * **Changelog**    * 2024-08-22 - SPRJ-13791 - validace PRTE / PRBC externích čísel - nelze použít najednou    - /shipment/batch    * 2024-07-01 - SPRJ-13838 - přidání    - /customer/address    * 2023-11-23 - SPRJ-12703 - CPL - /shipment - timestamp    - /shipment - Rozšíření výstupu o LastUpdateDate.    * 2023-07-13 - SPRJ-11888 - přidání    - /codelist/status - číselník statusů    * 2023-07-13 - SPRJ-11953 - přidání    - /order/cancel - storno objednávky
 *
 * The version of the OpenAPI document: v1
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 6.0.1
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace PPLCZCPL\Model;

use \ArrayAccess;
use \PPLCZCPL\ObjectSerializer;

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

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $openAPIModelName = 'Eps.Api.MyApi2.Web.Models.Order.OrderModel';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'order_number' => 'string',
        'order_state' => '\PPLCZCPL\Model\EpsApiMyApi2WebModelsEnumOrderStates',
        'reference_id' => 'string',
        'shipment_count' => 'int',
        'real_shipment_count' => 'int',
        'email' => 'string',
        'note' => 'string',
        'customer_reference' => 'string',
        'product_type' => 'string',
        'send_date' => '\DateTime',
        'real_collection_date' => '\DateTime',
        'delivery_date_time' => '\DateTime',
        'sender' => '\PPLCZCPL\Model\EpsApiMyApi2WebModelsOrderOrderModelSender',
        'recipient' => '\PPLCZCPL\Model\EpsApiMyApi2WebModelsOrderOrderModelRecipient',
        'shipment_numbers' => 'string[]'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      * @phpstan-var array<string, string|null>
      * @psalm-var array<string, string|null>
      */
    protected static $openAPIFormats = [
        'order_number' => null,
        'order_state' => null,
        'reference_id' => null,
        'shipment_count' => 'int32',
        'real_shipment_count' => 'int32',
        'email' => null,
        'note' => null,
        'customer_reference' => null,
        'product_type' => null,
        'send_date' => 'date-time',
        'real_collection_date' => 'date-time',
        'delivery_date_time' => 'date-time',
        'sender' => null,
        'recipient' => null,
        'shipment_numbers' => null
    ];

    /**
     * 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 attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'order_number' => 'orderNumber',
        'order_state' => 'orderState',
        'reference_id' => 'referenceId',
        'shipment_count' => 'shipmentCount',
        'real_shipment_count' => 'realShipmentCount',
        'email' => 'email',
        'note' => 'note',
        'customer_reference' => 'customerReference',
        'product_type' => 'productType',
        'send_date' => 'sendDate',
        'real_collection_date' => 'realCollectionDate',
        'delivery_date_time' => 'deliveryDateTime',
        'sender' => 'sender',
        'recipient' => 'recipient',
        'shipment_numbers' => 'shipmentNumbers'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'order_number' => 'setOrderNumber',
        'order_state' => 'setOrderState',
        'reference_id' => 'setReferenceId',
        'shipment_count' => 'setShipmentCount',
        'real_shipment_count' => 'setRealShipmentCount',
        'email' => 'setEmail',
        'note' => 'setNote',
        'customer_reference' => 'setCustomerReference',
        'product_type' => 'setProductType',
        'send_date' => 'setSendDate',
        'real_collection_date' => 'setRealCollectionDate',
        'delivery_date_time' => 'setDeliveryDateTime',
        'sender' => 'setSender',
        'recipient' => 'setRecipient',
        'shipment_numbers' => 'setShipmentNumbers'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'order_number' => 'getOrderNumber',
        'order_state' => 'getOrderState',
        'reference_id' => 'getReferenceId',
        'shipment_count' => 'getShipmentCount',
        'real_shipment_count' => 'getRealShipmentCount',
        'email' => 'getEmail',
        'note' => 'getNote',
        'customer_reference' => 'getCustomerReference',
        'product_type' => 'getProductType',
        'send_date' => 'getSendDate',
        'real_collection_date' => 'getRealCollectionDate',
        'delivery_date_time' => 'getDeliveryDateTime',
        'sender' => 'getSender',
        'recipient' => 'getRecipient',
        'shipment_numbers' => 'getShipmentNumbers'
    ];

    /**
     * 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;
    }


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

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->container['order_number'] = $data['order_number'] ?? null;
        $this->container['order_state'] = $data['order_state'] ?? null;
        $this->container['reference_id'] = $data['reference_id'] ?? null;
        $this->container['shipment_count'] = $data['shipment_count'] ?? null;
        $this->container['real_shipment_count'] = $data['real_shipment_count'] ?? null;
        $this->container['email'] = $data['email'] ?? null;
        $this->container['note'] = $data['note'] ?? null;
        $this->container['customer_reference'] = $data['customer_reference'] ?? null;
        $this->container['product_type'] = $data['product_type'] ?? null;
        $this->container['send_date'] = $data['send_date'] ?? null;
        $this->container['real_collection_date'] = $data['real_collection_date'] ?? null;
        $this->container['delivery_date_time'] = $data['delivery_date_time'] ?? null;
        $this->container['sender'] = $data['sender'] ?? null;
        $this->container['recipient'] = $data['recipient'] ?? null;
        $this->container['shipment_numbers'] = $data['shipment_numbers'] ?? null;
    }

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

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

    /**
     * Sets order_number
     *
     * @param string|null $order_number Order number
     *
     * @return self
     */
    public function setOrderNumber($order_number)
    {
        $this->container['order_number'] = $order_number;

        return $this;
    }

    /**
     * Gets order_state
     *
     * @return \PPLCZCPL\Model\EpsApiMyApi2WebModelsEnumOrderStates|null
     */
    public function getOrderState()
    {
        return $this->container['order_state'];
    }

    /**
     * Sets order_state
     *
     * @param \PPLCZCPL\Model\EpsApiMyApi2WebModelsEnumOrderStates|null $order_state order_state
     *
     * @return self
     */
    public function setOrderState($order_state)
    {
        $this->container['order_state'] = $order_state;

        return $this;
    }

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

    /**
     * Sets reference_id
     *
     * @param string|null $reference_id Reference Id
     *
     * @return self
     */
    public function setReferenceId($reference_id)
    {
        $this->container['reference_id'] = $reference_id;

        return $this;
    }

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

    /**
     * Sets shipment_count
     *
     * @param int|null $shipment_count Count of shipments
     *
     * @return self
     */
    public function setShipmentCount($shipment_count)
    {
        $this->container['shipment_count'] = $shipment_count;

        return $this;
    }

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

    /**
     * Sets real_shipment_count
     *
     * @param int|null $real_shipment_count Real count of shipments
     *
     * @return self
     */
    public function setRealShipmentCount($real_shipment_count)
    {
        $this->container['real_shipment_count'] = $real_shipment_count;

        return $this;
    }

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

    /**
     * Sets email
     *
     * @param string|null $email Email
     *
     * @return self
     */
    public function setEmail($email)
    {
        $this->container['email'] = $email;

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

        return $this;
    }

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

    /**
     * Sets customer_reference
     *
     * @param string|null $customer_reference Customer reference
     *
     * @return self
     */
    public function setCustomerReference($customer_reference)
    {
        $this->container['customer_reference'] = $customer_reference;

        return $this;
    }

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

    /**
     * Sets product_type
     *
     * @param string|null $product_type Typ produktu
     *
     * @return self
     */
    public function setProductType($product_type)
    {
        $this->container['product_type'] = $product_type;

        return $this;
    }

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

    /**
     * Sets send_date
     *
     * @param \DateTime|null $send_date Datum vyzvednutí zadané objednatelem
     *
     * @return self
     */
    public function setSendDate($send_date)
    {
        $this->container['send_date'] = $send_date;

        return $this;
    }

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

    /**
     * Sets real_collection_date
     *
     * @param \DateTime|null $real_collection_date Skutečné datum vyzvednutí
     *
     * @return self
     */
    public function setRealCollectionDate($real_collection_date)
    {
        $this->container['real_collection_date'] = $real_collection_date;

        return $this;
    }

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

    /**
     * Sets delivery_date_time
     *
     * @param \DateTime|null $delivery_date_time Datum doručení
     *
     * @return self
     */
    public function setDeliveryDateTime($delivery_date_time)
    {
        $this->container['delivery_date_time'] = $delivery_date_time;

        return $this;
    }

    /**
     * Gets sender
     *
     * @return \PPLCZCPL\Model\EpsApiMyApi2WebModelsOrderOrderModelSender|null
     */
    public function getSender()
    {
        return $this->container['sender'];
    }

    /**
     * Sets sender
     *
     * @param \PPLCZCPL\Model\EpsApiMyApi2WebModelsOrderOrderModelSender|null $sender sender
     *
     * @return self
     */
    public function setSender($sender)
    {
        $this->container['sender'] = $sender;

        return $this;
    }

    /**
     * Gets recipient
     *
     * @return \PPLCZCPL\Model\EpsApiMyApi2WebModelsOrderOrderModelRecipient|null
     */
    public function getRecipient()
    {
        return $this->container['recipient'];
    }

    /**
     * Sets recipient
     *
     * @param \PPLCZCPL\Model\EpsApiMyApi2WebModelsOrderOrderModelRecipient|null $recipient recipient
     *
     * @return self
     */
    public function setRecipient($recipient)
    {
        $this->container['recipient'] = $recipient;

        return $this;
    }

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

    /**
     * Sets shipment_numbers
     *
     * @param string[]|null $shipment_numbers Zásilky na objednávce
     *
     * @return self
     */
    public function setShipmentNumbers($shipment_numbers)
    {
        $this->container['shipment_numbers'] = $shipment_numbers;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    public function offsetExists($offset): bool
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed|null
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($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 $offset Offset
     *
     * @return void
     */
    public function offsetUnset($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 ObjectSerializerPpl::sanitizeForSerialization($this);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializerPpl::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

    /**
     * Gets a header-safe presentation of the object
     *
     * @return string
     */
    public function toHeaderValue()
    {
        return json_encode(ObjectSerializerPpl::sanitizeForSerialization($this));
    }
}


