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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'consumeErrCode' => 'string',
        'consumeErrMsg' => 'string',
        'consumeState' => 'int',
        'deliverCnt' => 'int',
        'deliverStatus' => 'string',
        'lastDeliverAt' => 'int',
        'msgAckTime' => 'int',
        'msgBida' => 'int',
        'msgExpireTime' => 'int',
        'msgGmtCreate' => 'int',
        'msgPriority' => 'int'
    ];

    /**
      * 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 = [
        'consumeErrCode' => null,
        'consumeErrMsg' => null,
        'consumeState' => null,
        'deliverCnt' => null,
        'deliverStatus' => null,
        'lastDeliverAt' => null,
        'msgAckTime' => null,
        'msgBida' => null,
        'msgExpireTime' => null,
        'msgGmtCreate' => null,
        'msgPriority' => 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 = [
        'consumeErrCode' => 'consume_err_code',
        'consumeErrMsg' => 'consume_err_msg',
        'consumeState' => 'consume_state',
        'deliverCnt' => 'deliver_cnt',
        'deliverStatus' => 'deliver_status',
        'lastDeliverAt' => 'last_deliver_at',
        'msgAckTime' => 'msg_ack_time',
        'msgBida' => 'msg_bida',
        'msgExpireTime' => 'msg_expire_time',
        'msgGmtCreate' => 'msg_gmt_create',
        'msgPriority' => 'msg_priority'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'consumeErrCode' => 'setConsumeErrCode',
        'consumeErrMsg' => 'setConsumeErrMsg',
        'consumeState' => 'setConsumeState',
        'deliverCnt' => 'setDeliverCnt',
        'deliverStatus' => 'setDeliverStatus',
        'lastDeliverAt' => 'setLastDeliverAt',
        'msgAckTime' => 'setMsgAckTime',
        'msgBida' => 'setMsgBida',
        'msgExpireTime' => 'setMsgExpireTime',
        'msgGmtCreate' => 'setMsgGmtCreate',
        'msgPriority' => 'setMsgPriority'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'consumeErrCode' => 'getConsumeErrCode',
        'consumeErrMsg' => 'getConsumeErrMsg',
        'consumeState' => 'getConsumeState',
        'deliverCnt' => 'getDeliverCnt',
        'deliverStatus' => 'getDeliverStatus',
        'lastDeliverAt' => 'getLastDeliverAt',
        'msgAckTime' => 'getMsgAckTime',
        'msgBida' => 'getMsgBida',
        'msgExpireTime' => 'getMsgExpireTime',
        'msgGmtCreate' => 'getMsgGmtCreate',
        'msgPriority' => 'getMsgPriority'
    ];

    /**
     * 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['consumeErrCode'] = $data['consumeErrCode'] ?? null;
        $this->container['consumeErrMsg'] = $data['consumeErrMsg'] ?? null;
        $this->container['consumeState'] = $data['consumeState'] ?? null;
        $this->container['deliverCnt'] = $data['deliverCnt'] ?? null;
        $this->container['deliverStatus'] = $data['deliverStatus'] ?? null;
        $this->container['lastDeliverAt'] = $data['lastDeliverAt'] ?? null;
        $this->container['msgAckTime'] = $data['msgAckTime'] ?? null;
        $this->container['msgBida'] = $data['msgBida'] ?? null;
        $this->container['msgExpireTime'] = $data['msgExpireTime'] ?? null;
        $this->container['msgGmtCreate'] = $data['msgGmtCreate'] ?? null;
        $this->container['msgPriority'] = $data['msgPriority'] ?? 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 consumeErrCode
     *
     * @return string|null
     */
    public function getConsumeErrCode()
    {
        return $this->container['consumeErrCode'];
    }

    /**
     * Sets consumeErrCode
     *
     * @param string|null $consumeErrCode 消息消费返回码，不用的消息类型返回码不一样
     *
     * @return self
     */
    public function setConsumeErrCode($consumeErrCode)
    {
        $this->container['consumeErrCode'] = $consumeErrCode;

        return $this;
    }

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

    /**
     * Sets consumeErrMsg
     *
     * @param string|null $consumeErrMsg 消息消费错误原因
     *
     * @return self
     */
    public function setConsumeErrMsg($consumeErrMsg)
    {
        $this->container['consumeErrMsg'] = $consumeErrMsg;

        return $this;
    }

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

    /**
     * Sets consumeState
     *
     * @param int|null $consumeState 消息消费状态1-未消费; 2-消费成功；3-消费失败
     *
     * @return self
     */
    public function setConsumeState($consumeState)
    {
        $this->container['consumeState'] = $consumeState;

        return $this;
    }

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

    /**
     * Sets deliverCnt
     *
     * @param int|null $deliverCnt 消息投递次数
     *
     * @return self
     */
    public function setDeliverCnt($deliverCnt)
    {
        $this->container['deliverCnt'] = $deliverCnt;

        return $this;
    }

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

    /**
     * Sets deliverStatus
     *
     * @param string|null $deliverStatus 消息投递状态 1: 未投递 2: 投递中 3: 投递成功 4: 投递失败 5: 消息失效不再发送
     *
     * @return self
     */
    public function setDeliverStatus($deliverStatus)
    {
        $this->container['deliverStatus'] = $deliverStatus;

        return $this;
    }

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

    /**
     * Sets lastDeliverAt
     *
     * @param int|null $lastDeliverAt 消息最后一次发送时间
     *
     * @return self
     */
    public function setLastDeliverAt($lastDeliverAt)
    {
        $this->container['lastDeliverAt'] = $lastDeliverAt;

        return $this;
    }

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

    /**
     * Sets msgAckTime
     *
     * @param int|null $msgAckTime 消息确认消费时间(ms)
     *
     * @return self
     */
    public function setMsgAckTime($msgAckTime)
    {
        $this->container['msgAckTime'] = $msgAckTime;

        return $this;
    }

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

    /**
     * Sets msgBida
     *
     * @param int|null $msgBida 消息必达类型 1-非必达; 2-必达.
     *
     * @return self
     */
    public function setMsgBida($msgBida)
    {
        $this->container['msgBida'] = $msgBida;

        return $this;
    }

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

    /**
     * Sets msgExpireTime
     *
     * @param int|null $msgExpireTime 消息过期时间(ms)
     *
     * @return self
     */
    public function setMsgExpireTime($msgExpireTime)
    {
        $this->container['msgExpireTime'] = $msgExpireTime;

        return $this;
    }

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

    /**
     * Sets msgGmtCreate
     *
     * @param int|null $msgGmtCreate 消息创建时间(ms)
     *
     * @return self
     */
    public function setMsgGmtCreate($msgGmtCreate)
    {
        $this->container['msgGmtCreate'] = $msgGmtCreate;

        return $this;
    }

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

    /**
     * Sets msgPriority
     *
     * @param int|null $msgPriority 消息投递优先级
     *
     * @return self
     */
    public function setMsgPriority($msgPriority)
    {
        $this->container['msgPriority'] = $msgPriority;

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


