v3/src/Model/AlipayUserAgreementQueryResponseModel.php
<?php
/**
 * AlipayUserAgreementQueryResponseModel
 *
 * 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;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'agreementNo' => 'string',
        'alipayLogonId' => 'string',
        'creditAuthMode' => 'string',
        'deviceId' => 'string',
        'executionPlans' => '\Alipay\OpenAPISDK\Model\ExecutionPlan[]',
        'externalAgreementNo' => 'string',
        'externalLogonId' => 'string',
        'invalidTime' => 'string',
        'lastDeductTime' => 'string',
        'nextDeductTime' => 'string',
        'personalProductCode' => 'string',
        'pricipalType' => 'string',
        'principalId' => 'string',
        'principalOpenId' => 'string',
        'signScene' => 'string',
        'signTime' => 'string',
        'singleQuota' => 'string',
        'status' => 'string',
        'thirdPartyType' => 'string',
        'validTime' => 'string',
        'zmOpenId' => '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 = [
        'agreementNo' => null,
        'alipayLogonId' => null,
        'creditAuthMode' => null,
        'deviceId' => null,
        'executionPlans' => null,
        'externalAgreementNo' => null,
        'externalLogonId' => null,
        'invalidTime' => null,
        'lastDeductTime' => null,
        'nextDeductTime' => null,
        'personalProductCode' => null,
        'pricipalType' => null,
        'principalId' => null,
        'principalOpenId' => null,
        'signScene' => null,
        'signTime' => null,
        'singleQuota' => null,
        'status' => null,
        'thirdPartyType' => null,
        'validTime' => null,
        'zmOpenId' => 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 = [
        'agreementNo' => 'agreement_no',
        'alipayLogonId' => 'alipay_logon_id',
        'creditAuthMode' => 'credit_auth_mode',
        'deviceId' => 'device_id',
        'executionPlans' => 'execution_plans',
        'externalAgreementNo' => 'external_agreement_no',
        'externalLogonId' => 'external_logon_id',
        'invalidTime' => 'invalid_time',
        'lastDeductTime' => 'last_deduct_time',
        'nextDeductTime' => 'next_deduct_time',
        'personalProductCode' => 'personal_product_code',
        'pricipalType' => 'pricipal_type',
        'principalId' => 'principal_id',
        'principalOpenId' => 'principal_open_id',
        'signScene' => 'sign_scene',
        'signTime' => 'sign_time',
        'singleQuota' => 'single_quota',
        'status' => 'status',
        'thirdPartyType' => 'third_party_type',
        'validTime' => 'valid_time',
        'zmOpenId' => 'zm_open_id'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'agreementNo' => 'setAgreementNo',
        'alipayLogonId' => 'setAlipayLogonId',
        'creditAuthMode' => 'setCreditAuthMode',
        'deviceId' => 'setDeviceId',
        'executionPlans' => 'setExecutionPlans',
        'externalAgreementNo' => 'setExternalAgreementNo',
        'externalLogonId' => 'setExternalLogonId',
        'invalidTime' => 'setInvalidTime',
        'lastDeductTime' => 'setLastDeductTime',
        'nextDeductTime' => 'setNextDeductTime',
        'personalProductCode' => 'setPersonalProductCode',
        'pricipalType' => 'setPricipalType',
        'principalId' => 'setPrincipalId',
        'principalOpenId' => 'setPrincipalOpenId',
        'signScene' => 'setSignScene',
        'signTime' => 'setSignTime',
        'singleQuota' => 'setSingleQuota',
        'status' => 'setStatus',
        'thirdPartyType' => 'setThirdPartyType',
        'validTime' => 'setValidTime',
        'zmOpenId' => 'setZmOpenId'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'agreementNo' => 'getAgreementNo',
        'alipayLogonId' => 'getAlipayLogonId',
        'creditAuthMode' => 'getCreditAuthMode',
        'deviceId' => 'getDeviceId',
        'executionPlans' => 'getExecutionPlans',
        'externalAgreementNo' => 'getExternalAgreementNo',
        'externalLogonId' => 'getExternalLogonId',
        'invalidTime' => 'getInvalidTime',
        'lastDeductTime' => 'getLastDeductTime',
        'nextDeductTime' => 'getNextDeductTime',
        'personalProductCode' => 'getPersonalProductCode',
        'pricipalType' => 'getPricipalType',
        'principalId' => 'getPrincipalId',
        'principalOpenId' => 'getPrincipalOpenId',
        'signScene' => 'getSignScene',
        'signTime' => 'getSignTime',
        'singleQuota' => 'getSingleQuota',
        'status' => 'getStatus',
        'thirdPartyType' => 'getThirdPartyType',
        'validTime' => 'getValidTime',
        'zmOpenId' => 'getZmOpenId'
    ];

    /**
     * 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['agreementNo'] = $data['agreementNo'] ?? null;
        $this->container['alipayLogonId'] = $data['alipayLogonId'] ?? null;
        $this->container['creditAuthMode'] = $data['creditAuthMode'] ?? null;
        $this->container['deviceId'] = $data['deviceId'] ?? null;
        $this->container['executionPlans'] = $data['executionPlans'] ?? null;
        $this->container['externalAgreementNo'] = $data['externalAgreementNo'] ?? null;
        $this->container['externalLogonId'] = $data['externalLogonId'] ?? null;
        $this->container['invalidTime'] = $data['invalidTime'] ?? null;
        $this->container['lastDeductTime'] = $data['lastDeductTime'] ?? null;
        $this->container['nextDeductTime'] = $data['nextDeductTime'] ?? null;
        $this->container['personalProductCode'] = $data['personalProductCode'] ?? null;
        $this->container['pricipalType'] = $data['pricipalType'] ?? null;
        $this->container['principalId'] = $data['principalId'] ?? null;
        $this->container['principalOpenId'] = $data['principalOpenId'] ?? null;
        $this->container['signScene'] = $data['signScene'] ?? null;
        $this->container['signTime'] = $data['signTime'] ?? null;
        $this->container['singleQuota'] = $data['singleQuota'] ?? null;
        $this->container['status'] = $data['status'] ?? null;
        $this->container['thirdPartyType'] = $data['thirdPartyType'] ?? null;
        $this->container['validTime'] = $data['validTime'] ?? null;
        $this->container['zmOpenId'] = $data['zmOpenId'] ?? 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 agreementNo
     *
     * @return string|null
     */
    public function getAgreementNo()
    {
        return $this->container['agreementNo'];
    }

    /**
     * Sets agreementNo
     *
     * @param string|null $agreementNo 用户签约成功后的协议号
     *
     * @return self
     */
    public function setAgreementNo($agreementNo)
    {
        $this->container['agreementNo'] = $agreementNo;

        return $this;
    }

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

    /**
     * Sets alipayLogonId
     *
     * @param string|null $alipayLogonId 返回脱敏的支付宝账号
     *
     * @return self
     */
    public function setAlipayLogonId($alipayLogonId)
    {
        $this->container['alipayLogonId'] = $alipayLogonId;

        return $this;
    }

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

    /**
     * Sets creditAuthMode
     *
     * @param string|null $creditAuthMode 授信模式，目前只在花芝代扣（即花芝go）协议时才会返回
     *
     * @return self
     */
    public function setCreditAuthMode($creditAuthMode)
    {
        $this->container['creditAuthMode'] = $creditAuthMode;

        return $this;
    }

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

    /**
     * Sets deviceId
     *
     * @param string|null $deviceId 设备Id
     *
     * @return self
     */
    public function setDeviceId($deviceId)
    {
        $this->container['deviceId'] = $deviceId;

        return $this;
    }

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

    /**
     * Sets executionPlans
     *
     * @param \Alipay\OpenAPISDK\Model\ExecutionPlan[]|null $executionPlans 还款计划列表
     *
     * @return self
     */
    public function setExecutionPlans($executionPlans)
    {
        $this->container['executionPlans'] = $executionPlans;

        return $this;
    }

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

    /**
     * Sets externalAgreementNo
     *
     * @param string|null $externalAgreementNo 代扣协议中标示用户的唯一签约号(确保在商户系统中唯一)。当入参中传了此参数时返回。
     *
     * @return self
     */
    public function setExternalAgreementNo($externalAgreementNo)
    {
        $this->container['externalAgreementNo'] = $externalAgreementNo;

        return $this;
    }

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

    /**
     * Sets externalLogonId
     *
     * @param string|null $externalLogonId 外部登录Id。当入参中传了此参数时返回。
     *
     * @return self
     */
    public function setExternalLogonId($externalLogonId)
    {
        $this->container['externalLogonId'] = $externalLogonId;

        return $this;
    }

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

    /**
     * Sets invalidTime
     *
     * @param string|null $invalidTime 协议失效时间，格式为 yyyy-MM-dd HH:mm:ss。
     *
     * @return self
     */
    public function setInvalidTime($invalidTime)
    {
        $this->container['invalidTime'] = $invalidTime;

        return $this;
    }

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

    /**
     * Sets lastDeductTime
     *
     * @param string|null $lastDeductTime 周期扣协议，上次扣款成功时间
     *
     * @return self
     */
    public function setLastDeductTime($lastDeductTime)
    {
        $this->container['lastDeductTime'] = $lastDeductTime;

        return $this;
    }

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

    /**
     * Sets nextDeductTime
     *
     * @param string|null $nextDeductTime 周期扣协议，预计下次扣款时间
     *
     * @return self
     */
    public function setNextDeductTime($nextDeductTime)
    {
        $this->container['nextDeductTime'] = $nextDeductTime;

        return $this;
    }

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

    /**
     * Sets personalProductCode
     *
     * @param string|null $personalProductCode 协议产品码，商户和支付宝签约时确定，不同业务场景对应不同的签约产品码。
     *
     * @return self
     */
    public function setPersonalProductCode($personalProductCode)
    {
        $this->container['personalProductCode'] = $personalProductCode;

        return $this;
    }

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

    /**
     * Sets pricipalType
     *
     * @param string|null $pricipalType 签约主体类型。
     *
     * @return self
     */
    public function setPricipalType($pricipalType)
    {
        $this->container['pricipalType'] = $pricipalType;

        return $this;
    }

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

    /**
     * Sets principalId
     *
     * @param string|null $principalId 签约主体标识。 当principal_type为CARD 时，该字段为支付宝用户号;
     *
     * @return self
     */
    public function setPrincipalId($principalId)
    {
        $this->container['principalId'] = $principalId;

        return $this;
    }

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

    /**
     * Sets principalOpenId
     *
     * @param string|null $principalOpenId 签约主体标识。 当principal_type为CARD 时，该字段为支付宝用户号;
     *
     * @return self
     */
    public function setPrincipalOpenId($principalOpenId)
    {
        $this->container['principalOpenId'] = $principalOpenId;

        return $this;
    }

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

    /**
     * Sets signScene
     *
     * @param string|null $signScene 签约协议的场景。
     *
     * @return self
     */
    public function setSignScene($signScene)
    {
        $this->container['signScene'] = $signScene;

        return $this;
    }

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

    /**
     * Sets signTime
     *
     * @param string|null $signTime 协议签约时间，格式为 yyyy-MM-dd HH:mm:ss。
     *
     * @return self
     */
    public function setSignTime($signTime)
    {
        $this->container['signTime'] = $signTime;

        return $this;
    }

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

    /**
     * Sets singleQuota
     *
     * @param string|null $singleQuota 单笔代扣额度
     *
     * @return self
     */
    public function setSingleQuota($singleQuota)
    {
        $this->container['singleQuota'] = $singleQuota;

        return $this;
    }

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

    /**
     * Sets status
     *
     * @param string|null $status 协议当前状态  1. TEMP：暂存，协议未生效过；  2. NORMAL：正常；  3. STOP：暂停
     *
     * @return self
     */
    public function setStatus($status)
    {
        $this->container['status'] = $status;

        return $this;
    }

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

    /**
     * Sets thirdPartyType
     *
     * @param string|null $thirdPartyType 签约第三方主体类型。对于三方协议，表示当前用户和哪一类的第三方主体进行签约。 默认为PARTNER。
     *
     * @return self
     */
    public function setThirdPartyType($thirdPartyType)
    {
        $this->container['thirdPartyType'] = $thirdPartyType;

        return $this;
    }

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

    /**
     * Sets validTime
     *
     * @param string|null $validTime 协议生效时间，格式为 yyyy-MM-dd HH:mm:ss。
     *
     * @return self
     */
    public function setValidTime($validTime)
    {
        $this->container['validTime'] = $validTime;

        return $this;
    }

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

    /**
     * Sets zmOpenId
     *
     * @param string|null $zmOpenId 用户的芝麻信用 openId，供商 户查询用户芝麻信用使用。
     *
     * @return self
     */
    public function setZmOpenId($zmOpenId)
    {
        $this->container['zmOpenId'] = $zmOpenId;

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


