<?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            

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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'shipment_number' => 'string',
        'insurance_currency' => 'string',
        'insurance_price' => 'double',
        'label_url' => 'string',
        'import_state' => '\PPLCZCPL\Model\EpsApiMyApi2BusinessEnumsConstImportState',
        'error_message' => 'string',
        'error_code' => 'string',
        'relation_type' => '\PPLCZCPL\Model\EpsApiMyApi2BusinessEnumsConstRelationType'
    ];

    /**
      * 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 = [
        'shipment_number' => null,
        'insurance_currency' => null,
        'insurance_price' => 'double',
        'label_url' => 'uri',
        'import_state' => null,
        'error_message' => null,
        'error_code' => null,
        'relation_type' => 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 = [
        'shipment_number' => 'shipmentNumber',
        'insurance_currency' => 'insuranceCurrency',
        'insurance_price' => 'insurancePrice',
        'label_url' => 'labelUrl',
        'import_state' => 'importState',
        'error_message' => 'errorMessage',
        'error_code' => 'errorCode',
        'relation_type' => 'relationType'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'shipment_number' => 'setShipmentNumber',
        'insurance_currency' => 'setInsuranceCurrency',
        'insurance_price' => 'setInsurancePrice',
        'label_url' => 'setLabelUrl',
        'import_state' => 'setImportState',
        'error_message' => 'setErrorMessage',
        'error_code' => 'setErrorCode',
        'relation_type' => 'setRelationType'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'shipment_number' => 'getShipmentNumber',
        'insurance_currency' => 'getInsuranceCurrency',
        'insurance_price' => 'getInsurancePrice',
        'label_url' => 'getLabelUrl',
        'import_state' => 'getImportState',
        'error_message' => 'getErrorMessage',
        'error_code' => 'getErrorCode',
        'relation_type' => 'getRelationType'
    ];

    /**
     * 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['shipment_number'] = $data['shipment_number'] ?? null;
        $this->container['insurance_currency'] = $data['insurance_currency'] ?? null;
        $this->container['insurance_price'] = $data['insurance_price'] ?? null;
        $this->container['label_url'] = $data['label_url'] ?? null;
        $this->container['import_state'] = $data['import_state'] ?? null;
        $this->container['error_message'] = $data['error_message'] ?? null;
        $this->container['error_code'] = $data['error_code'] ?? null;
        $this->container['relation_type'] = $data['relation_type'] ?? 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 shipment_number
     *
     * @return string|null
     */
    public function getShipmentNumber()
    {
        return $this->container['shipment_number'];
    }

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

        return $this;
    }

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

    /**
     * Sets insurance_currency
     *
     * @param string|null $insurance_currency Insurance currency
     *
     * @return self
     */
    public function setInsuranceCurrency($insurance_currency)
    {
        $this->container['insurance_currency'] = $insurance_currency;

        return $this;
    }

    /**
     * Gets insurance_price
     *
     * @return double|null
     */
    public function getInsurancePrice()
    {
        return $this->container['insurance_price'];
    }

    /**
     * Sets insurance_price
     *
     * @param double|null $insurance_price Insurance price
     *
     * @return self
     */
    public function setInsurancePrice($insurance_price)
    {
        $this->container['insurance_price'] = $insurance_price;

        return $this;
    }

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

    /**
     * Sets label_url
     *
     * @param string|null $label_url Label uri
     *
     * @return self
     */
    public function setLabelUrl($label_url)
    {
        $this->container['label_url'] = $label_url;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets error_message
     *
     * @param string|null $error_message Error message
     *
     * @return self
     */
    public function setErrorMessage($error_message)
    {
        $this->container['error_message'] = $error_message;

        return $this;
    }

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

    /**
     * Sets error_code
     *
     * @param string|null $error_code Error code
     *
     * @return self
     */
    public function setErrorCode($error_code)
    {
        $this->container['error_code'] = $error_code;

        return $this;
    }

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

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

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


