v3/src/Model/AlipayMarketingCardUpdateModel.php
<?php
/**
 * AlipayMarketingCardUpdateModel
 *
 * 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: 2025-08-26
 * 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;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'cardInfo' => '\Alipay\OpenAPISDK\Model\MerchantCard',
        'extInfo' => 'string',
        'mcardStyleInfo' => '\Alipay\OpenAPISDK\Model\McardStylInfo',
        'merchantCardMsgInfo' => '\Alipay\OpenAPISDK\Model\MerchantCardMsgInfo',
        'notifyMessages' => '\Alipay\OpenAPISDK\Model\McardNotifyMessage[]',
        'occurTime' => 'string',
        'paidOuterCardInfo' => '\Alipay\OpenAPISDK\Model\PaidOuterCardExtraInfoDTO',
        'targetCardNo' => 'string',
        'targetCardNoType' => '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 = [
        'cardInfo' => null,
        'extInfo' => null,
        'mcardStyleInfo' => null,
        'merchantCardMsgInfo' => null,
        'notifyMessages' => null,
        'occurTime' => null,
        'paidOuterCardInfo' => null,
        'targetCardNo' => null,
        'targetCardNoType' => 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 = [
        'cardInfo' => 'card_info',
        'extInfo' => 'ext_info',
        'mcardStyleInfo' => 'mcard_style_info',
        'merchantCardMsgInfo' => 'merchant_card_msg_info',
        'notifyMessages' => 'notify_messages',
        'occurTime' => 'occur_time',
        'paidOuterCardInfo' => 'paid_outer_card_info',
        'targetCardNo' => 'target_card_no',
        'targetCardNoType' => 'target_card_no_type'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'cardInfo' => 'setCardInfo',
        'extInfo' => 'setExtInfo',
        'mcardStyleInfo' => 'setMcardStyleInfo',
        'merchantCardMsgInfo' => 'setMerchantCardMsgInfo',
        'notifyMessages' => 'setNotifyMessages',
        'occurTime' => 'setOccurTime',
        'paidOuterCardInfo' => 'setPaidOuterCardInfo',
        'targetCardNo' => 'setTargetCardNo',
        'targetCardNoType' => 'setTargetCardNoType'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'cardInfo' => 'getCardInfo',
        'extInfo' => 'getExtInfo',
        'mcardStyleInfo' => 'getMcardStyleInfo',
        'merchantCardMsgInfo' => 'getMerchantCardMsgInfo',
        'notifyMessages' => 'getNotifyMessages',
        'occurTime' => 'getOccurTime',
        'paidOuterCardInfo' => 'getPaidOuterCardInfo',
        'targetCardNo' => 'getTargetCardNo',
        'targetCardNoType' => 'getTargetCardNoType'
    ];

    /**
     * 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['cardInfo'] = $data['cardInfo'] ?? null;
        $this->container['extInfo'] = $data['extInfo'] ?? null;
        $this->container['mcardStyleInfo'] = $data['mcardStyleInfo'] ?? null;
        $this->container['merchantCardMsgInfo'] = $data['merchantCardMsgInfo'] ?? null;
        $this->container['notifyMessages'] = $data['notifyMessages'] ?? null;
        $this->container['occurTime'] = $data['occurTime'] ?? null;
        $this->container['paidOuterCardInfo'] = $data['paidOuterCardInfo'] ?? null;
        $this->container['targetCardNo'] = $data['targetCardNo'] ?? null;
        $this->container['targetCardNoType'] = $data['targetCardNoType'] ?? 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 cardInfo
     *
     * @return \Alipay\OpenAPISDK\Model\MerchantCard|null
     */
    public function getCardInfo()
    {
        return $this->container['cardInfo'];
    }

    /**
     * Sets cardInfo
     *
     * @param \Alipay\OpenAPISDK\Model\MerchantCard|null $cardInfo cardInfo
     *
     * @return self
     */
    public function setCardInfo($cardInfo)
    {
        $this->container['cardInfo'] = $cardInfo;

        return $this;
    }

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

    /**
     * Sets extInfo
     *
     * @param string|null $extInfo 扩展信息(暂时无用)
     *
     * @return self
     */
    public function setExtInfo($extInfo)
    {
        $this->container['extInfo'] = $extInfo;

        return $this;
    }

    /**
     * Gets mcardStyleInfo
     *
     * @return \Alipay\OpenAPISDK\Model\McardStylInfo|null
     */
    public function getMcardStyleInfo()
    {
        return $this->container['mcardStyleInfo'];
    }

    /**
     * Sets mcardStyleInfo
     *
     * @param \Alipay\OpenAPISDK\Model\McardStylInfo|null $mcardStyleInfo mcardStyleInfo
     *
     * @return self
     */
    public function setMcardStyleInfo($mcardStyleInfo)
    {
        $this->container['mcardStyleInfo'] = $mcardStyleInfo;

        return $this;
    }

    /**
     * Gets merchantCardMsgInfo
     *
     * @return \Alipay\OpenAPISDK\Model\MerchantCardMsgInfo|null
     */
    public function getMerchantCardMsgInfo()
    {
        return $this->container['merchantCardMsgInfo'];
    }

    /**
     * Sets merchantCardMsgInfo
     *
     * @param \Alipay\OpenAPISDK\Model\MerchantCardMsgInfo|null $merchantCardMsgInfo merchantCardMsgInfo
     *
     * @return self
     */
    public function setMerchantCardMsgInfo($merchantCardMsgInfo)
    {
        $this->container['merchantCardMsgInfo'] = $merchantCardMsgInfo;

        return $this;
    }

    /**
     * Gets notifyMessages
     *
     * @return \Alipay\OpenAPISDK\Model\McardNotifyMessage[]|null
     */
    public function getNotifyMessages()
    {
        return $this->container['notifyMessages'];
    }

    /**
     * Sets notifyMessages
     *
     * @param \Alipay\OpenAPISDK\Model\McardNotifyMessage[]|null $notifyMessages 注意：此字段已废弃。 卡信息变更通知消息 1、在列表中定义的消息，才会发送给用户，消息格式一定。 2、根据卡信息变更情况，一次可发送多个消息
     *
     * @return self
     */
    public function setNotifyMessages($notifyMessages)
    {
        $this->container['notifyMessages'] = $notifyMessages;

        return $this;
    }

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

    /**
     * Sets occurTime
     *
     * @param string|null $occurTime 业务发生时间，时间格式为\"yyyy-MM-dd HH:mm:ss\"。
     *
     * @return self
     */
    public function setOccurTime($occurTime)
    {
        $this->container['occurTime'] = $occurTime;

        return $this;
    }

    /**
     * Gets paidOuterCardInfo
     *
     * @return \Alipay\OpenAPISDK\Model\PaidOuterCardExtraInfoDTO|null
     */
    public function getPaidOuterCardInfo()
    {
        return $this->container['paidOuterCardInfo'];
    }

    /**
     * Sets paidOuterCardInfo
     *
     * @param \Alipay\OpenAPISDK\Model\PaidOuterCardExtraInfoDTO|null $paidOuterCardInfo paidOuterCardInfo
     *
     * @return self
     */
    public function setPaidOuterCardInfo($paidOuterCardInfo)
    {
        $this->container['paidOuterCardInfo'] = $paidOuterCardInfo;

        return $this;
    }

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

    /**
     * Sets targetCardNo
     *
     * @param string|null $targetCardNo 支付宝业务卡号：1、3.0（历史版本）版本来源于alipay.marketing.card.open(会员卡开卡)接口开卡后获取的 card_info.biz_card_no 值；2、极速版来源于spi.alipay.user.opencard.get(会员卡开通，获取会员卡信息)请求参数中的biz_card_no值。
     *
     * @return self
     */
    public function setTargetCardNo($targetCardNo)
    {
        $this->container['targetCardNo'] = $targetCardNo;

        return $this;
    }

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

    /**
     * Sets targetCardNoType
     *
     * @param string|null $targetCardNoType 卡号ID类型
     *
     * @return self
     */
    public function setTargetCardNoType($targetCardNoType)
    {
        $this->container['targetCardNoType'] = $targetCardNoType;

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


