<?php
/**
 * AlipayEcoMycarParkingPaymentinfoSyncModel
 *
 * PHP version 7.4
 *
 * @category Class
 * @package  Alipay\OpenAPISDK
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * 支付宝开放平台API
 *
 * 支付宝开放平台v3协议文档
 *
 * The version of the OpenAPI document: 2023-12-20
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 6.2.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 Alipay\OpenAPISDK\Model;

use \ArrayAccess;
use \Alipay\OpenAPISDK\ObjectSerializer;

/**
 * AlipayEcoMycarParkingPaymentinfoSyncModel Class Doc Comment
 *
 * @category Class
 * @package  Alipay\OpenAPISDK
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<TKey, TValue>
 * @template TKey int|null
 * @template TValue mixed|null
 */
class AlipayEcoMycarParkingPaymentinfoSyncModel implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'carNumber' => 'string',
        'isvUrl' => 'string',
        'outSerialNo' => 'string',
        'parkingId' => 'string',
        'paymentFreeMinutes' => 'int',
        'paymentTime' => 'string',
        'serialNo' => '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 = [
        'carNumber' => null,
        'isvUrl' => null,
        'outSerialNo' => null,
        'parkingId' => null,
        'paymentFreeMinutes' => null,
        'paymentTime' => null,
        'serialNo' => 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 = [
        'carNumber' => 'car_number',
        'isvUrl' => 'isv_url',
        'outSerialNo' => 'out_serial_no',
        'parkingId' => 'parking_id',
        'paymentFreeMinutes' => 'payment_free_minutes',
        'paymentTime' => 'payment_time',
        'serialNo' => 'serial_no'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'carNumber' => 'setCarNumber',
        'isvUrl' => 'setIsvUrl',
        'outSerialNo' => 'setOutSerialNo',
        'parkingId' => 'setParkingId',
        'paymentFreeMinutes' => 'setPaymentFreeMinutes',
        'paymentTime' => 'setPaymentTime',
        'serialNo' => 'setSerialNo'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'carNumber' => 'getCarNumber',
        'isvUrl' => 'getIsvUrl',
        'outSerialNo' => 'getOutSerialNo',
        'parkingId' => 'getParkingId',
        'paymentFreeMinutes' => 'getPaymentFreeMinutes',
        'paymentTime' => 'getPaymentTime',
        'serialNo' => 'getSerialNo'
    ];

    /**
     * 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['carNumber'] = $data['carNumber'] ?? null;
        $this->container['isvUrl'] = $data['isvUrl'] ?? null;
        $this->container['outSerialNo'] = $data['outSerialNo'] ?? null;
        $this->container['parkingId'] = $data['parkingId'] ?? null;
        $this->container['paymentFreeMinutes'] = $data['paymentFreeMinutes'] ?? null;
        $this->container['paymentTime'] = $data['paymentTime'] ?? null;
        $this->container['serialNo'] = $data['serialNo'] ?? 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 carNumber
     *
     * @return string|null
     */
    public function getCarNumber()
    {
        return $this->container['carNumber'];
    }

    /**
     * Sets carNumber
     *
     * @param string|null $carNumber 车牌号
     *
     * @return self
     */
    public function setCarNumber($carNumber)
    {
        $this->container['carNumber'] = $carNumber;

        return $this;
    }

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

    /**
     * Sets isvUrl
     *
     * @param string|null $isvUrl 停车消息透出后，消息详情的落地承接页链接，可配置ISV维度的统一值
     *
     * @return self
     */
    public function setIsvUrl($isvUrl)
    {
        $this->container['isvUrl'] = $isvUrl;

        return $this;
    }

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

    /**
     * Sets outSerialNo
     *
     * @param string|null $outSerialNo 外部业务停车流水号(用于串通进场与出场信息)。如果 out_serial_no与serial_no都传递，则一起校验。 ● serial_no与out_serial_no二选一必填。 ● 入参有serial_no和out_serial_no，则优先根据serial_no和out_serial_no一起匹配进出场事件 ● 入参仅有serial_no，则优先根据serial_no匹配进出场事件 ● 入参仅有out_serial_no，则根据out_serial_no匹配进出场事件
     *
     * @return self
     */
    public function setOutSerialNo($outSerialNo)
    {
        $this->container['outSerialNo'] = $outSerialNo;

        return $this;
    }

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

    /**
     * Sets parkingId
     *
     * @param string|null $parkingId 支付宝停车平台ID，由支付宝定义的该停车场标识，同一个isv或商户范围内唯一。通过 alipay.eco.mycar.parking.parkinglotinfo.create(录入停车场信息)接口获取。
     *
     * @return self
     */
    public function setParkingId($parkingId)
    {
        $this->container['parkingId'] = $parkingId;

        return $this;
    }

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

    /**
     * Sets paymentFreeMinutes
     *
     * @param int|null $paymentFreeMinutes 停车场内缴费后，允许出场的免费时长分钟数
     *
     * @return self
     */
    public function setPaymentFreeMinutes($paymentFreeMinutes)
    {
        $this->container['paymentFreeMinutes'] = $paymentFreeMinutes;

        return $this;
    }

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

    /**
     * Sets paymentTime
     *
     * @param string|null $paymentTime 场内缴费时间，格式\"YYYY-MM-DD HH:mm:ss\"，24小时制，请保证服务器时间准确，场内缴费不应晚于当前网络时间
     *
     * @return self
     */
    public function setPaymentTime($paymentTime)
    {
        $this->container['paymentTime'] = $paymentTime;

        return $this;
    }

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

    /**
     * Sets serialNo
     *
     * @param string|null $serialNo 支付宝业务流水号(用于串通进场与出场信息)。可通过 alipay.eco.mycar.parking.enterinfo.sync (车辆驶入接口)接口获取。 ● serial_no与out_serial_no二选一必填。 ● 入参有serial_no和out_serial_no，则优先根据serial_no和out_serial_no一起匹配进出场事件 ● 入参仅有serial_no，则优先根据serial_no匹配进出场事件 ● 入参仅有out_serial_no，则根据out_serial_no匹配进出场事件
     *
     * @return self
     */
    public function setSerialNo($serialNo)
    {
        $this->container['serialNo'] = $serialNo;

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


