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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'bankSuccess' => 'string',
        'buyerLogonId' => 'string',
        'buyerUserId' => 'string',
        'buyerUserOpenId' => 'string',
        'fundChange' => 'string',
        'gmtRefund' => 'string',
        'outRequestNo' => 'string',
        'outTradeNo' => 'string',
        'refundAmount' => 'string',
        'refundDetailItemList' => 'string',
        'refundReason' => 'string',
        'status' => 'string',
        'tradeNo' => '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 = [
        'bankSuccess' => null,
        'buyerLogonId' => null,
        'buyerUserId' => null,
        'buyerUserOpenId' => null,
        'fundChange' => null,
        'gmtRefund' => null,
        'outRequestNo' => null,
        'outTradeNo' => null,
        'refundAmount' => null,
        'refundDetailItemList' => null,
        'refundReason' => null,
        'status' => null,
        'tradeNo' => 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 = [
        'bankSuccess' => 'bank_success',
        'buyerLogonId' => 'buyer_logon_id',
        'buyerUserId' => 'buyer_user_id',
        'buyerUserOpenId' => 'buyer_user_open_id',
        'fundChange' => 'fund_change',
        'gmtRefund' => 'gmt_refund',
        'outRequestNo' => 'out_request_no',
        'outTradeNo' => 'out_trade_no',
        'refundAmount' => 'refund_amount',
        'refundDetailItemList' => 'refund_detail_item_list',
        'refundReason' => 'refund_reason',
        'status' => 'status',
        'tradeNo' => 'trade_no'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'bankSuccess' => 'setBankSuccess',
        'buyerLogonId' => 'setBuyerLogonId',
        'buyerUserId' => 'setBuyerUserId',
        'buyerUserOpenId' => 'setBuyerUserOpenId',
        'fundChange' => 'setFundChange',
        'gmtRefund' => 'setGmtRefund',
        'outRequestNo' => 'setOutRequestNo',
        'outTradeNo' => 'setOutTradeNo',
        'refundAmount' => 'setRefundAmount',
        'refundDetailItemList' => 'setRefundDetailItemList',
        'refundReason' => 'setRefundReason',
        'status' => 'setStatus',
        'tradeNo' => 'setTradeNo'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'bankSuccess' => 'getBankSuccess',
        'buyerLogonId' => 'getBuyerLogonId',
        'buyerUserId' => 'getBuyerUserId',
        'buyerUserOpenId' => 'getBuyerUserOpenId',
        'fundChange' => 'getFundChange',
        'gmtRefund' => 'getGmtRefund',
        'outRequestNo' => 'getOutRequestNo',
        'outTradeNo' => 'getOutTradeNo',
        'refundAmount' => 'getRefundAmount',
        'refundDetailItemList' => 'getRefundDetailItemList',
        'refundReason' => 'getRefundReason',
        'status' => 'getStatus',
        'tradeNo' => 'getTradeNo'
    ];

    /**
     * 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['bankSuccess'] = $data['bankSuccess'] ?? null;
        $this->container['buyerLogonId'] = $data['buyerLogonId'] ?? null;
        $this->container['buyerUserId'] = $data['buyerUserId'] ?? null;
        $this->container['buyerUserOpenId'] = $data['buyerUserOpenId'] ?? null;
        $this->container['fundChange'] = $data['fundChange'] ?? null;
        $this->container['gmtRefund'] = $data['gmtRefund'] ?? null;
        $this->container['outRequestNo'] = $data['outRequestNo'] ?? null;
        $this->container['outTradeNo'] = $data['outTradeNo'] ?? null;
        $this->container['refundAmount'] = $data['refundAmount'] ?? null;
        $this->container['refundDetailItemList'] = $data['refundDetailItemList'] ?? null;
        $this->container['refundReason'] = $data['refundReason'] ?? null;
        $this->container['status'] = $data['status'] ?? null;
        $this->container['tradeNo'] = $data['tradeNo'] ?? 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 bankSuccess
     *
     * @return string|null
     */
    public function getBankSuccess()
    {
        return $this->container['bankSuccess'];
    }

    /**
     * Sets bankSuccess
     *
     * @param string|null $bankSuccess 成功Y，失败N
     *
     * @return self
     */
    public function setBankSuccess($bankSuccess)
    {
        $this->container['bankSuccess'] = $bankSuccess;

        return $this;
    }

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

    /**
     * Sets buyerLogonId
     *
     * @param string|null $buyerLogonId 退款时，支付宝返回的用户的登录id
     *
     * @return self
     */
    public function setBuyerLogonId($buyerLogonId)
    {
        $this->container['buyerLogonId'] = $buyerLogonId;

        return $this;
    }

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

    /**
     * Sets buyerUserId
     *
     * @param string|null $buyerUserId 支付宝返回的买家支付宝用户id
     *
     * @return self
     */
    public function setBuyerUserId($buyerUserId)
    {
        $this->container['buyerUserId'] = $buyerUserId;

        return $this;
    }

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

    /**
     * Sets buyerUserOpenId
     *
     * @param string|null $buyerUserOpenId 支付宝返回的买家支付宝用户id加密后信息
     *
     * @return self
     */
    public function setBuyerUserOpenId($buyerUserOpenId)
    {
        $this->container['buyerUserOpenId'] = $buyerUserOpenId;

        return $this;
    }

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

    /**
     * Sets fundChange
     *
     * @param string|null $fundChange 本次退款是否发生了资金变化
     *
     * @return self
     */
    public function setFundChange($fundChange)
    {
        $this->container['fundChange'] = $fundChange;

        return $this;
    }

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

    /**
     * Sets gmtRefund
     *
     * @param string|null $gmtRefund 支付宝返回的退款时间，而不是商户退款申请的时间
     *
     * @return self
     */
    public function setGmtRefund($gmtRefund)
    {
        $this->container['gmtRefund'] = $gmtRefund;

        return $this;
    }

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

    /**
     * Sets outRequestNo
     *
     * @param string|null $outRequestNo 标识一次退款请求，同一笔交易多次退款需要保证唯一，如需部分退款，则此参数必传。（若退款时填写，则同步退款状态时也必须填写）
     *
     * @return self
     */
    public function setOutRequestNo($outRequestNo)
    {
        $this->container['outRequestNo'] = $outRequestNo;

        return $this;
    }

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

    /**
     * Sets outTradeNo
     *
     * @param string|null $outTradeNo isv系统的订单号
     *
     * @return self
     */
    public function setOutTradeNo($outTradeNo)
    {
        $this->container['outTradeNo'] = $outTradeNo;

        return $this;
    }

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

    /**
     * Sets refundAmount
     *
     * @param string|null $refundAmount 需要退款的金额，该金额不能大于订单金额,单位为元，支持两位小数
     *
     * @return self
     */
    public function setRefundAmount($refundAmount)
    {
        $this->container['refundAmount'] = $refundAmount;

        return $this;
    }

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

    /**
     * Sets refundDetailItemList
     *
     * @param string|null $refundDetailItemList 支付宝返回的退款资金渠道，json格式字符串
     *
     * @return self
     */
    public function setRefundDetailItemList($refundDetailItemList)
    {
        $this->container['refundDetailItemList'] = $refundDetailItemList;

        return $this;
    }

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

    /**
     * Sets refundReason
     *
     * @param string|null $refundReason 退款原因，商家根据客户实际退款原因填写（若退款时填写，则同步退款状态时也必须填写）
     *
     * @return self
     */
    public function setRefundReason($refundReason)
    {
        $this->container['refundReason'] = $refundReason;

        return $this;
    }

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

    /**
     * Sets status
     *
     * @param string|null $status 状态：1:缴费成功，2:关闭账单，3、退费  如果为退款状态，需要填写fund_change,   refund_amount, refund_reason,  out_request_no, buyer_logon_id,  gmt_refund,  buyer_user_id, refund_detail_item_list;  4、同步网商返回的状态,如果是网商银行的账单，bank_success这个字段必填
     *
     * @return self
     */
    public function setStatus($status)
    {
        $this->container['status'] = $status;

        return $this;
    }

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

    /**
     * Sets tradeNo
     *
     * @param string|null $tradeNo 支付宝返回的交易号
     *
     * @return self
     */
    public function setTradeNo($tradeNo)
    {
        $this->container['tradeNo'] = $tradeNo;

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


