<?php
/**
 * AlipayCommerceTransportParkingPaymentinfoSyncModel
 *
 * 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;

/**
 * AlipayCommerceTransportParkingPaymentinfoSyncModel 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 AlipayCommerceTransportParkingPaymentinfoSyncModel implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'freeExitMinutes' => 'string',
        'isEncryptPlateNo' => 'bool',
        'openAppid' => 'string',
        'openId' => 'string',
        'outSerialNo' => 'string',
        'paymentTime' => 'string',
        'paymentType' => 'string',
        'plateColor' => 'string',
        'plateNo' => 'string',
        'serviceUrl' => '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 = [
        'freeExitMinutes' => null,
        'isEncryptPlateNo' => null,
        'openAppid' => null,
        'openId' => null,
        'outSerialNo' => null,
        'paymentTime' => null,
        'paymentType' => null,
        'plateColor' => null,
        'plateNo' => null,
        'serviceUrl' => 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 = [
        'freeExitMinutes' => 'free_exit_minutes',
        'isEncryptPlateNo' => 'is_encrypt_plate_no',
        'openAppid' => 'open_appid',
        'openId' => 'open_id',
        'outSerialNo' => 'out_serial_no',
        'paymentTime' => 'payment_time',
        'paymentType' => 'payment_type',
        'plateColor' => 'plate_color',
        'plateNo' => 'plate_no',
        'serviceUrl' => 'service_url'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'freeExitMinutes' => 'setFreeExitMinutes',
        'isEncryptPlateNo' => 'setIsEncryptPlateNo',
        'openAppid' => 'setOpenAppid',
        'openId' => 'setOpenId',
        'outSerialNo' => 'setOutSerialNo',
        'paymentTime' => 'setPaymentTime',
        'paymentType' => 'setPaymentType',
        'plateColor' => 'setPlateColor',
        'plateNo' => 'setPlateNo',
        'serviceUrl' => 'setServiceUrl'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'freeExitMinutes' => 'getFreeExitMinutes',
        'isEncryptPlateNo' => 'getIsEncryptPlateNo',
        'openAppid' => 'getOpenAppid',
        'openId' => 'getOpenId',
        'outSerialNo' => 'getOutSerialNo',
        'paymentTime' => 'getPaymentTime',
        'paymentType' => 'getPaymentType',
        'plateColor' => 'getPlateColor',
        'plateNo' => 'getPlateNo',
        'serviceUrl' => 'getServiceUrl'
    ];

    /**
     * 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['freeExitMinutes'] = $data['freeExitMinutes'] ?? null;
        $this->container['isEncryptPlateNo'] = $data['isEncryptPlateNo'] ?? null;
        $this->container['openAppid'] = $data['openAppid'] ?? null;
        $this->container['openId'] = $data['openId'] ?? null;
        $this->container['outSerialNo'] = $data['outSerialNo'] ?? null;
        $this->container['paymentTime'] = $data['paymentTime'] ?? null;
        $this->container['paymentType'] = $data['paymentType'] ?? null;
        $this->container['plateColor'] = $data['plateColor'] ?? null;
        $this->container['plateNo'] = $data['plateNo'] ?? null;
        $this->container['serviceUrl'] = $data['serviceUrl'] ?? 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 freeExitMinutes
     *
     * @return string|null
     */
    public function getFreeExitMinutes()
    {
        return $this->container['freeExitMinutes'];
    }

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

        return $this;
    }

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

    /**
     * Sets isEncryptPlateNo
     *
     * @param bool|null $isEncryptPlateNo 车牌是否加密，true为加密，false为不加密，默认为false
     *
     * @return self
     */
    public function setIsEncryptPlateNo($isEncryptPlateNo)
    {
        $this->container['isEncryptPlateNo'] = $isEncryptPlateNo;

        return $this;
    }

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

    /**
     * Sets openAppid
     *
     * @param string|null $openAppid 蚂蚁会员统一ID对应的归属应用appid
     *
     * @return self
     */
    public function setOpenAppid($openAppid)
    {
        $this->container['openAppid'] = $openAppid;

        return $this;
    }

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

    /**
     * Sets openId
     *
     * @param string|null $openId 蚂蚁会员统一ID
     *
     * @return self
     */
    public function setOpenId($openId)
    {
        $this->container['openId'] = $openId;

        return $this;
    }

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

    /**
     * Sets outSerialNo
     *
     * @param string|null $outSerialNo 外部停车流水号(用于串通进场与出场信息)
     *
     * @return self
     */
    public function setOutSerialNo($outSerialNo)
    {
        $this->container['outSerialNo'] = $outSerialNo;

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

    /**
     * Sets paymentType
     *
     * @param string|null $paymentType 支付方式 ALIPAY：支付宝支付 CASH：现金 OTHER：其他渠道 FREE：免费
     *
     * @return self
     */
    public function setPaymentType($paymentType)
    {
        $this->container['paymentType'] = $paymentType;

        return $this;
    }

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

    /**
     * Sets plateColor
     *
     * @param string|null $plateColor 车牌颜色，车牌颜色，枚举支持： *BLUE：蓝。 *GREEN：绿。 *YELLOW：黄。 *WHITE：白。 *BLACK：黑。 *LIMEGREEN：黄绿色。
     *
     * @return self
     */
    public function setPlateColor($plateColor)
    {
        $this->container['plateColor'] = $plateColor;

        return $this;
    }

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

    /**
     * Sets plateNo
     *
     * @param string|null $plateNo 车牌号（支持加密格式）
     *
     * @return self
     */
    public function setPlateNo($plateNo)
    {
        $this->container['plateNo'] = $plateNo;

        return $this;
    }

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

    /**
     * Sets serviceUrl
     *
     * @param string|null $serviceUrl 停车服务页面地址。 1、服务商停车服务页面地址必须是支付宝小程序URL（无需转换https），详见：https://opendocs.alipay.com/support/01rb18#URL%20%E6%A0%BC%E5%BC%8F 2、若服务商没有服务链接，可传输支付宝停车官方小程序的服务链接：alipays://platformapi/startapp?appId=2021001102642986&page=pages%2Fparking-fee%2Findex 3、若此次对接的是无感支付，则服务链接传输为：alipays://platformapi/startapp?appId=2021001102642986&page=%2Fpages%2Fparking-bill%2Findex
     *
     * @return self
     */
    public function setServiceUrl($serviceUrl)
    {
        $this->container['serviceUrl'] = $serviceUrl;

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


