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

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

/**
 * EpsApiMyApi2WebModelsShipmentBatchDirectInjectionFeatureModel Class Doc Comment
 *
 * @category Class
 * @description DirectInjectionFeatureModel
 * @package  PPLCZCPL
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<string, mixed>
 */
class EpsApiMyApi2WebModelsShipmentBatchDirectInjectionFeatureModel 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.DirectInjectionFeatureModel';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'direct_addressing' => 'bool',
        'gateway_zip_code' => 'string',
        'gateway_city' => 'string',
        'country' => '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 = [
        'direct_addressing' => null,
        'gateway_zip_code' => null,
        'gateway_city' => null,
        'country' => 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 = [
        'direct_addressing' => 'directAddressing',
        'gateway_zip_code' => 'gatewayZipCode',
        'gateway_city' => 'gatewayCity',
        'country' => 'country'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'direct_addressing' => 'setDirectAddressing',
        'gateway_zip_code' => 'setGatewayZipCode',
        'gateway_city' => 'setGatewayCity',
        'country' => 'setCountry'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'direct_addressing' => 'getDirectAddressing',
        'gateway_zip_code' => 'getGatewayZipCode',
        'gateway_city' => 'getGatewayCity',
        'country' => 'getCountry'
    ];

    /**
     * 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['direct_addressing'] = $data['direct_addressing'] ?? null;
        $this->container['gateway_zip_code'] = $data['gateway_zip_code'] ?? null;
        $this->container['gateway_city'] = $data['gateway_city'] ?? null;
        $this->container['country'] = $data['country'] ?? null;
    }

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

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

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

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

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

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

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

    /**
     * Sets direct_addressing
     *
     * @param bool|null $direct_addressing true / false
     *
     * @return self
     */
    public function setDirectAddressing($direct_addressing)
    {
        $this->container['direct_addressing'] = $direct_addressing;

        return $this;
    }

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

    /**
     * Sets gateway_zip_code
     *
     * @param string|null $gateway_zip_code PSČ Délka: 10
     *
     * @return self
     */
    public function setGatewayZipCode($gateway_zip_code)
    {
        if (!is_null($gateway_zip_code) && (mb_strlen($gateway_zip_code) > 10)) {
            throw new \InvalidArgumentException('invalid length for $gateway_zip_code when calling EpsApiMyApi2WebModelsShipmentBatchDirectInjectionFeatureModel., must be smaller than or equal to 10.');
        }
        if (!is_null($gateway_zip_code) && (mb_strlen($gateway_zip_code) < 1)) {
            throw new \InvalidArgumentException('invalid length for $gateway_zip_code when calling EpsApiMyApi2WebModelsShipmentBatchDirectInjectionFeatureModel., must be bigger than or equal to 1.');
        }

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

        return $this;
    }

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

    /**
     * Sets gateway_city
     *
     * @param string|null $gateway_city Město Délka: 35
     *
     * @return self
     */
    public function setGatewayCity($gateway_city)
    {
        if (!is_null($gateway_city) && (mb_strlen($gateway_city) > 35)) {
            throw new \InvalidArgumentException('invalid length for $gateway_city when calling EpsApiMyApi2WebModelsShipmentBatchDirectInjectionFeatureModel., must be smaller than or equal to 35.');
        }
        if (!is_null($gateway_city) && (mb_strlen($gateway_city) < 1)) {
            throw new \InvalidArgumentException('invalid length for $gateway_city when calling EpsApiMyApi2WebModelsShipmentBatchDirectInjectionFeatureModel., must be bigger than or equal to 1.');
        }

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

        return $this;
    }

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

    /**
     * Sets country
     *
     * @param string|null $country Země Délka: 2
     *
     * @return self
     */
    public function setCountry($country)
    {

        if (!is_null($country) && (mb_strlen($country) < 1)) {
            throw new \InvalidArgumentException('invalid length for $country when calling EpsApiMyApi2WebModelsShipmentBatchDirectInjectionFeatureModel., must be bigger than or equal to 1.');
        }

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

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


