content: /*
   * 支付宝开放平台API
   * 支付宝开放平台v3协议文档
   *
   * The version of the OpenAPI document: 2025-08-26
   * 
   *
   * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
   * https://openapi-generator.tech
   * Do not edit the class manually.
   */
  
  
  package com.alipay.v3.model;
  
  import java.util.Objects;
  import java.util.Arrays;
  import com.alipay.v3.model.PresetPayToolInfo;
  import com.alipay.v3.model.RefundChargeInfo;
  import com.alipay.v3.model.TradeFundBill;
  import com.alipay.v3.model.VoucherDetail;
  import com.google.gson.TypeAdapter;
  import com.google.gson.annotations.JsonAdapter;
  import com.google.gson.annotations.SerializedName;
  import com.google.gson.stream.JsonReader;
  import com.google.gson.stream.JsonWriter;
  import io.swagger.annotations.ApiModel;
  import io.swagger.annotations.ApiModelProperty;
  import java.io.IOException;
  import java.util.ArrayList;
  import java.util.List;
  
  import com.google.gson.Gson;
  import com.google.gson.GsonBuilder;
  import com.google.gson.JsonArray;
  import com.google.gson.JsonDeserializationContext;
  import com.google.gson.JsonDeserializer;
  import com.google.gson.JsonElement;
  import com.google.gson.JsonObject;
  import com.google.gson.JsonParseException;
  import com.google.gson.TypeAdapterFactory;
  import com.google.gson.reflect.TypeToken;
  
  import java.lang.reflect.Type;
  import java.util.HashMap;
  import java.util.HashSet;
  import java.util.Map;
  import java.util.Map.Entry;
  import java.util.Set;
  
  import com.alipay.v3.JSON;
  
  /**
   * AlipayTradeRefundResponseModel
   */
  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
  public class AlipayTradeRefundResponseModel {
    public static final String SERIALIZED_NAME_BUYER_LOGON_ID = "buyer_logon_id";
    @SerializedName(SERIALIZED_NAME_BUYER_LOGON_ID)
    private String buyerLogonId;
  
    public static final String SERIALIZED_NAME_BUYER_OPEN_ID = "buyer_open_id";
    @SerializedName(SERIALIZED_NAME_BUYER_OPEN_ID)
    private String buyerOpenId;
  
    public static final String SERIALIZED_NAME_BUYER_USER_ID = "buyer_user_id";
    @SerializedName(SERIALIZED_NAME_BUYER_USER_ID)
    private String buyerUserId;
  
    public static final String SERIALIZED_NAME_FUND_CHANGE = "fund_change";
    @SerializedName(SERIALIZED_NAME_FUND_CHANGE)
    private String fundChange;
  
    public static final String SERIALIZED_NAME_GMT_REFUND_PAY = "gmt_refund_pay";
    @SerializedName(SERIALIZED_NAME_GMT_REFUND_PAY)
    private String gmtRefundPay;
  
    public static final String SERIALIZED_NAME_HAS_DEPOSIT_BACK = "has_deposit_back";
    @SerializedName(SERIALIZED_NAME_HAS_DEPOSIT_BACK)
    private String hasDepositBack;
  
    public static final String SERIALIZED_NAME_OPEN_ID = "open_id";
    @SerializedName(SERIALIZED_NAME_OPEN_ID)
    private String openId;
  
    public static final String SERIALIZED_NAME_OUT_TRADE_NO = "out_trade_no";
    @SerializedName(SERIALIZED_NAME_OUT_TRADE_NO)
    private String outTradeNo;
  
    public static final String SERIALIZED_NAME_PRE_AUTH_CANCEL_FEE = "pre_auth_cancel_fee";
    @SerializedName(SERIALIZED_NAME_PRE_AUTH_CANCEL_FEE)
    private String preAuthCancelFee;
  
    public static final String SERIALIZED_NAME_PRESENT_REFUND_BUYER_AMOUNT = "present_refund_buyer_amount";
    @SerializedName(SERIALIZED_NAME_PRESENT_REFUND_BUYER_AMOUNT)
    private String presentRefundBuyerAmount;
  
    public static final String SERIALIZED_NAME_PRESENT_REFUND_DISCOUNT_AMOUNT = "present_refund_discount_amount";
    @SerializedName(SERIALIZED_NAME_PRESENT_REFUND_DISCOUNT_AMOUNT)
    private String presentRefundDiscountAmount;
  
    public static final String SERIALIZED_NAME_PRESENT_REFUND_MDISCOUNT_AMOUNT = "present_refund_mdiscount_amount";
    @SerializedName(SERIALIZED_NAME_PRESENT_REFUND_MDISCOUNT_AMOUNT)
    private String presentRefundMdiscountAmount;
  
    public static final String SERIALIZED_NAME_REFUND_CHARGE_AMOUNT = "refund_charge_amount";
    @SerializedName(SERIALIZED_NAME_REFUND_CHARGE_AMOUNT)
    private String refundChargeAmount;
  
    public static final String SERIALIZED_NAME_REFUND_CHARGE_INFO_LIST = "refund_charge_info_list";
    @SerializedName(SERIALIZED_NAME_REFUND_CHARGE_INFO_LIST)
    private List<RefundChargeInfo> refundChargeInfoList = null;
  
    public static final String SERIALIZED_NAME_REFUND_CURRENCY = "refund_currency";
    @SerializedName(SERIALIZED_NAME_REFUND_CURRENCY)
    private String refundCurrency;
  
    public static final String SERIALIZED_NAME_REFUND_DETAIL_ITEM_LIST = "refund_detail_item_list";
    @SerializedName(SERIALIZED_NAME_REFUND_DETAIL_ITEM_LIST)
    private List<TradeFundBill> refundDetailItemList = null;
  
    public static final String SERIALIZED_NAME_REFUND_FEE = "refund_fee";
    @SerializedName(SERIALIZED_NAME_REFUND_FEE)
    private String refundFee;
  
    public static final String SERIALIZED_NAME_REFUND_HYB_AMOUNT = "refund_hyb_amount";
    @SerializedName(SERIALIZED_NAME_REFUND_HYB_AMOUNT)
    private String refundHybAmount;
  
    public static final String SERIALIZED_NAME_REFUND_PRESET_PAYTOOL_LIST = "refund_preset_paytool_list";
    @SerializedName(SERIALIZED_NAME_REFUND_PRESET_PAYTOOL_LIST)
    private PresetPayToolInfo refundPresetPaytoolList;
  
    public static final String SERIALIZED_NAME_REFUND_SETTLEMENT_ID = "refund_settlement_id";
    @SerializedName(SERIALIZED_NAME_REFUND_SETTLEMENT_ID)
    private String refundSettlementId;
  
    public static final String SERIALIZED_NAME_REFUND_VOUCHER_DETAIL_LIST = "refund_voucher_detail_list";
    @SerializedName(SERIALIZED_NAME_REFUND_VOUCHER_DETAIL_LIST)
    private List<VoucherDetail> refundVoucherDetailList = null;
  
    public static final String SERIALIZED_NAME_SEND_BACK_FEE = "send_back_fee";
    @SerializedName(SERIALIZED_NAME_SEND_BACK_FEE)
    private String sendBackFee;
  
    public static final String SERIALIZED_NAME_STORE_NAME = "store_name";
    @SerializedName(SERIALIZED_NAME_STORE_NAME)
    private String storeName;
  
    public static final String SERIALIZED_NAME_TRADE_NO = "trade_no";
    @SerializedName(SERIALIZED_NAME_TRADE_NO)
    private String tradeNo;
  
    public AlipayTradeRefundResponseModel() { 
    }
  
    public AlipayTradeRefundResponseModel buyerLogonId(String buyerLogonId) {
      
      this.buyerLogonId = buyerLogonId;
      return this;
    }
  
     /**
     * 用户的登录id
     * @return buyerLogonId
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "159****5620", value = "用户的登录id")
  
    public String getBuyerLogonId() {
      return buyerLogonId;
    }
  
  
    public void setBuyerLogonId(String buyerLogonId) {
      this.buyerLogonId = buyerLogonId;
    }
  
  
    public AlipayTradeRefundResponseModel buyerOpenId(String buyerOpenId) {
      
      this.buyerOpenId = buyerOpenId;
      return this;
    }
  
     /**
     * 买家支付宝用户唯一标识
     * @return buyerOpenId
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "074a1CcTG1LelxKe4xQC0zgNdId0nxi95b5lsNpazWYoCo5", value = "买家支付宝用户唯一标识")
  
    public String getBuyerOpenId() {
      return buyerOpenId;
    }
  
  
    public void setBuyerOpenId(String buyerOpenId) {
      this.buyerOpenId = buyerOpenId;
    }
  
  
    public AlipayTradeRefundResponseModel buyerUserId(String buyerUserId) {
      
      this.buyerUserId = buyerUserId;
      return this;
    }
  
     /**
     * 买家在支付宝的用户id
     * @return buyerUserId
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "2088101117955611", value = "买家在支付宝的用户id")
  
    public String getBuyerUserId() {
      return buyerUserId;
    }
  
  
    public void setBuyerUserId(String buyerUserId) {
      this.buyerUserId = buyerUserId;
    }
  
  
    public AlipayTradeRefundResponseModel fundChange(String fundChange) {
      
      this.fundChange = fundChange;
      return this;
    }
  
     /**
     * 本次退款是否发生了资金变化
     * @return fundChange
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "Y", value = "本次退款是否发生了资金变化")
  
    public String getFundChange() {
      return fundChange;
    }
  
  
    public void setFundChange(String fundChange) {
      this.fundChange = fundChange;
    }
  
  
    public AlipayTradeRefundResponseModel gmtRefundPay(String gmtRefundPay) {
      
      this.gmtRefundPay = gmtRefundPay;
      return this;
    }
  
     /**
     * 退款支付时间
     * @return gmtRefundPay
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "2014-11-27 15:45:57", value = "退款支付时间")
  
    public String getGmtRefundPay() {
      return gmtRefundPay;
    }
  
  
    public void setGmtRefundPay(String gmtRefundPay) {
      this.gmtRefundPay = gmtRefundPay;
    }
  
  
    public AlipayTradeRefundResponseModel hasDepositBack(String hasDepositBack) {
      
      this.hasDepositBack = hasDepositBack;
      return this;
    }
  
     /**
     * 是否有银行卡冲退，仅当query_options中传入deposit_back_info时返回
     * @return hasDepositBack
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "true", value = "是否有银行卡冲退，仅当query_options中传入deposit_back_info时返回")
  
    public String getHasDepositBack() {
      return hasDepositBack;
    }
  
  
    public void setHasDepositBack(String hasDepositBack) {
      this.hasDepositBack = hasDepositBack;
    }
  
  
    public AlipayTradeRefundResponseModel openId(String openId) {
      
      this.openId = openId;
      return this;
    }
  
     /**
     * 买家支付宝用户号，该参数已废弃，请不要使用
     * @return openId
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "2088102122524333", value = "买家支付宝用户号，该参数已废弃，请不要使用")
  
    public String getOpenId() {
      return openId;
    }
  
  
    public void setOpenId(String openId) {
      this.openId = openId;
    }
  
  
    public AlipayTradeRefundResponseModel outTradeNo(String outTradeNo) {
      
      this.outTradeNo = outTradeNo;
      return this;
    }
  
     /**
     * 商户订单号
     * @return outTradeNo
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "6823789339978248", value = "商户订单号")
  
    public String getOutTradeNo() {
      return outTradeNo;
    }
  
  
    public void setOutTradeNo(String outTradeNo) {
      this.outTradeNo = outTradeNo;
    }
  
  
    public AlipayTradeRefundResponseModel preAuthCancelFee(String preAuthCancelFee) {
      
      this.preAuthCancelFee = preAuthCancelFee;
      return this;
    }
  
     /**
     * 当用户使用芝麻信用先享后付时，且当前的操作为预授权撤销动作时，会返回该字段，代表当前撤销的预授权金额，单位元。
     * @return preAuthCancelFee
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "12.45", value = "当用户使用芝麻信用先享后付时，且当前的操作为预授权撤销动作时，会返回该字段，代表当前撤销的预授权金额，单位元。")
  
    public String getPreAuthCancelFee() {
      return preAuthCancelFee;
    }
  
  
    public void setPreAuthCancelFee(String preAuthCancelFee) {
      this.preAuthCancelFee = preAuthCancelFee;
    }
  
  
    public AlipayTradeRefundResponseModel presentRefundBuyerAmount(String presentRefundBuyerAmount) {
      
      this.presentRefundBuyerAmount = presentRefundBuyerAmount;
      return this;
    }
  
     /**
     * 本次退款金额中买家退款金额;单位：元。 该字段默认不返回；
     * @return presentRefundBuyerAmount
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "88.88", value = "本次退款金额中买家退款金额;单位：元。 该字段默认不返回；")
  
    public String getPresentRefundBuyerAmount() {
      return presentRefundBuyerAmount;
    }
  
  
    public void setPresentRefundBuyerAmount(String presentRefundBuyerAmount) {
      this.presentRefundBuyerAmount = presentRefundBuyerAmount;
    }
  
  
    public AlipayTradeRefundResponseModel presentRefundDiscountAmount(String presentRefundDiscountAmount) {
      
      this.presentRefundDiscountAmount = presentRefundDiscountAmount;
      return this;
    }
  
     /**
     * 本次退款金额中平台优惠退款金额；单位：元。 该字段默认不返回；
     * @return presentRefundDiscountAmount
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "88.88", value = "本次退款金额中平台优惠退款金额；单位：元。 该字段默认不返回；")
  
    public String getPresentRefundDiscountAmount() {
      return presentRefundDiscountAmount;
    }
  
  
    public void setPresentRefundDiscountAmount(String presentRefundDiscountAmount) {
      this.presentRefundDiscountAmount = presentRefundDiscountAmount;
    }
  
  
    public AlipayTradeRefundResponseModel presentRefundMdiscountAmount(String presentRefundMdiscountAmount) {
      
      this.presentRefundMdiscountAmount = presentRefundMdiscountAmount;
      return this;
    }
  
     /**
     * 本次退款金额中商家优惠退款金额；单位：元。 该字段默认不返回；
     * @return presentRefundMdiscountAmount
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "88.88", value = "本次退款金额中商家优惠退款金额；单位：元。 该字段默认不返回；")
  
    public String getPresentRefundMdiscountAmount() {
      return presentRefundMdiscountAmount;
    }
  
  
    public void setPresentRefundMdiscountAmount(String presentRefundMdiscountAmount) {
      this.presentRefundMdiscountAmount = presentRefundMdiscountAmount;
    }
  
  
    public AlipayTradeRefundResponseModel refundChargeAmount(String refundChargeAmount) {
      
      this.refundChargeAmount = refundChargeAmount;
      return this;
    }
  
     /**
     * 本次退款针对收款方的退收费金额；单位：元。 只在机构间联模式下返回，其它场景下不返回该字段；
     * @return refundChargeAmount
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "8.88", value = "本次退款针对收款方的退收费金额；单位：元。 只在机构间联模式下返回，其它场景下不返回该字段；")
  
    public String getRefundChargeAmount() {
      return refundChargeAmount;
    }
  
  
    public void setRefundChargeAmount(String refundChargeAmount) {
      this.refundChargeAmount = refundChargeAmount;
    }
  
  
    public AlipayTradeRefundResponseModel refundChargeInfoList(List<RefundChargeInfo> refundChargeInfoList) {
      
      this.refundChargeInfoList = refundChargeInfoList;
      return this;
    }
  
    public AlipayTradeRefundResponseModel addRefundChargeInfoListItem(RefundChargeInfo refundChargeInfoListItem) {
      if (this.refundChargeInfoList == null) {
        this.refundChargeInfoList = new ArrayList<>();
      }
      this.refundChargeInfoList.add(refundChargeInfoListItem);
      return this;
    }
  
     /**
     * 退费信息
     * @return refundChargeInfoList
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "退费信息")
  
    public List<RefundChargeInfo> getRefundChargeInfoList() {
      return refundChargeInfoList;
    }
  
  
    public void setRefundChargeInfoList(List<RefundChargeInfo> refundChargeInfoList) {
      this.refundChargeInfoList = refundChargeInfoList;
    }
  
  
    public AlipayTradeRefundResponseModel refundCurrency(String refundCurrency) {
      
      this.refundCurrency = refundCurrency;
      return this;
    }
  
     /**
     * 退款币种信息
     * @return refundCurrency
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "USD", value = "退款币种信息")
  
    public String getRefundCurrency() {
      return refundCurrency;
    }
  
  
    public void setRefundCurrency(String refundCurrency) {
      this.refundCurrency = refundCurrency;
    }
  
  
    public AlipayTradeRefundResponseModel refundDetailItemList(List<TradeFundBill> refundDetailItemList) {
      
      this.refundDetailItemList = refundDetailItemList;
      return this;
    }
  
    public AlipayTradeRefundResponseModel addRefundDetailItemListItem(TradeFundBill refundDetailItemListItem) {
      if (this.refundDetailItemList == null) {
        this.refundDetailItemList = new ArrayList<>();
      }
      this.refundDetailItemList.add(refundDetailItemListItem);
      return this;
    }
  
     /**
     * 退款使用的资金渠道。 只有在签约中指定需要返回资金明细，或者入参的query_options中指定时才返回该字段信息。
     * @return refundDetailItemList
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "退款使用的资金渠道。 只有在签约中指定需要返回资金明细，或者入参的query_options中指定时才返回该字段信息。")
  
    public List<TradeFundBill> getRefundDetailItemList() {
      return refundDetailItemList;
    }
  
  
    public void setRefundDetailItemList(List<TradeFundBill> refundDetailItemList) {
      this.refundDetailItemList = refundDetailItemList;
    }
  
  
    public AlipayTradeRefundResponseModel refundFee(String refundFee) {
      
      this.refundFee = refundFee;
      return this;
    }
  
     /**
     * 退款总金额。单位：元。 指该笔交易累计已经退款成功的金额。
     * @return refundFee
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "88.88", value = "退款总金额。单位：元。 指该笔交易累计已经退款成功的金额。")
  
    public String getRefundFee() {
      return refundFee;
    }
  
  
    public void setRefundFee(String refundFee) {
      this.refundFee = refundFee;
    }
  
  
    public AlipayTradeRefundResponseModel refundHybAmount(String refundHybAmount) {
      
      this.refundHybAmount = refundHybAmount;
      return this;
    }
  
     /**
     * 本次请求退惠营宝金额。单位：元。
     * @return refundHybAmount
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "10.24", value = "本次请求退惠营宝金额。单位：元。")
  
    public String getRefundHybAmount() {
      return refundHybAmount;
    }
  
  
    public void setRefundHybAmount(String refundHybAmount) {
      this.refundHybAmount = refundHybAmount;
    }
  
  
    public AlipayTradeRefundResponseModel refundPresetPaytoolList(PresetPayToolInfo refundPresetPaytoolList) {
      
      this.refundPresetPaytoolList = refundPresetPaytoolList;
      return this;
    }
  
     /**
     * Get refundPresetPaytoolList
     * @return refundPresetPaytoolList
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "")
  
    public PresetPayToolInfo getRefundPresetPaytoolList() {
      return refundPresetPaytoolList;
    }
  
  
    public void setRefundPresetPaytoolList(PresetPayToolInfo refundPresetPaytoolList) {
      this.refundPresetPaytoolList = refundPresetPaytoolList;
    }
  
  
    public AlipayTradeRefundResponseModel refundSettlementId(String refundSettlementId) {
      
      this.refundSettlementId = refundSettlementId;
      return this;
    }
  
     /**
     * 退款清算编号，用于清算对账使用； 只在机构间联模式下返回，其它场景下不返回该字段；
     * @return refundSettlementId
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "2018101610032004620239146945", value = "退款清算编号，用于清算对账使用； 只在机构间联模式下返回，其它场景下不返回该字段；")
  
    public String getRefundSettlementId() {
      return refundSettlementId;
    }
  
  
    public void setRefundSettlementId(String refundSettlementId) {
      this.refundSettlementId = refundSettlementId;
    }
  
  
    public AlipayTradeRefundResponseModel refundVoucherDetailList(List<VoucherDetail> refundVoucherDetailList) {
      
      this.refundVoucherDetailList = refundVoucherDetailList;
      return this;
    }
  
    public AlipayTradeRefundResponseModel addRefundVoucherDetailListItem(VoucherDetail refundVoucherDetailListItem) {
      if (this.refundVoucherDetailList == null) {
        this.refundVoucherDetailList = new ArrayList<>();
      }
      this.refundVoucherDetailList.add(refundVoucherDetailListItem);
      return this;
    }
  
     /**
     * 本交易支付时使用的所有优惠券信息。 只有在query_options中指定了refund_voucher_detail_list时才返回该字段信息。
     * @return refundVoucherDetailList
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "本交易支付时使用的所有优惠券信息。 只有在query_options中指定了refund_voucher_detail_list时才返回该字段信息。")
  
    public List<VoucherDetail> getRefundVoucherDetailList() {
      return refundVoucherDetailList;
    }
  
  
    public void setRefundVoucherDetailList(List<VoucherDetail> refundVoucherDetailList) {
      this.refundVoucherDetailList = refundVoucherDetailList;
    }
  
  
    public AlipayTradeRefundResponseModel sendBackFee(String sendBackFee) {
      
      this.sendBackFee = sendBackFee;
      return this;
    }
  
     /**
     * 本次商户实际退回金额。单位：元。 说明：如需获取该值，需在入参query_options中传入 refund_detail_item_list。
     * @return sendBackFee
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "1.8", value = "本次商户实际退回金额。单位：元。 说明：如需获取该值，需在入参query_options中传入 refund_detail_item_list。")
  
    public String getSendBackFee() {
      return sendBackFee;
    }
  
  
    public void setSendBackFee(String sendBackFee) {
      this.sendBackFee = sendBackFee;
    }
  
  
    public AlipayTradeRefundResponseModel storeName(String storeName) {
      
      this.storeName = storeName;
      return this;
    }
  
     /**
     * 交易在支付时候的门店名称
     * @return storeName
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "望湘园联洋店", value = "交易在支付时候的门店名称")
  
    public String getStoreName() {
      return storeName;
    }
  
  
    public void setStoreName(String storeName) {
      this.storeName = storeName;
    }
  
  
    public AlipayTradeRefundResponseModel tradeNo(String tradeNo) {
      
      this.tradeNo = tradeNo;
      return this;
    }
  
     /**
     * 支付宝交易号
     * @return tradeNo
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "2013112011001004330000121536", value = "支付宝交易号")
  
    public String getTradeNo() {
      return tradeNo;
    }
  
  
    public void setTradeNo(String tradeNo) {
      this.tradeNo = tradeNo;
    }
  
    /**
     * A container for additional, undeclared properties.
     * This is a holder for any undeclared properties as specified with
     * the 'additionalProperties' keyword in the OAS document.
     */
    private Map<String, Object> additionalProperties;
  
    /**
     * Set the additional (undeclared) property with the specified name and value.
     * If the property does not already exist, create it otherwise replace it.
     *
     * @param key name of the property
     * @param value value of the property
     * @return the AlipayTradeRefundResponseModel instance itself
     */
    public AlipayTradeRefundResponseModel putAdditionalProperty(String key, Object value) {
      if (this.additionalProperties == null) {
          this.additionalProperties = new HashMap<String, Object>();
      }
      this.additionalProperties.put(key, value);
      return this;
    }
  
    /**
     * Return the additional (undeclared) property.
     *
     * @return a map of objects
     */
    public Map<String, Object> getAdditionalProperties() {
      return additionalProperties;
    }
  
    /**
     * Return the additional (undeclared) property with the specified name.
     *
     * @param key name of the property
     * @return an object
     */
    public Object getAdditionalProperty(String key) {
      if (this.additionalProperties == null) {
          return null;
      }
      return this.additionalProperties.get(key);
    }
  
  
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      AlipayTradeRefundResponseModel alipayTradeRefundResponseModel = (AlipayTradeRefundResponseModel) o;
      return Objects.equals(this.buyerLogonId, alipayTradeRefundResponseModel.buyerLogonId) &&
          Objects.equals(this.buyerOpenId, alipayTradeRefundResponseModel.buyerOpenId) &&
          Objects.equals(this.buyerUserId, alipayTradeRefundResponseModel.buyerUserId) &&
          Objects.equals(this.fundChange, alipayTradeRefundResponseModel.fundChange) &&
          Objects.equals(this.gmtRefundPay, alipayTradeRefundResponseModel.gmtRefundPay) &&
          Objects.equals(this.hasDepositBack, alipayTradeRefundResponseModel.hasDepositBack) &&
          Objects.equals(this.openId, alipayTradeRefundResponseModel.openId) &&
          Objects.equals(this.outTradeNo, alipayTradeRefundResponseModel.outTradeNo) &&
          Objects.equals(this.preAuthCancelFee, alipayTradeRefundResponseModel.preAuthCancelFee) &&
          Objects.equals(this.presentRefundBuyerAmount, alipayTradeRefundResponseModel.presentRefundBuyerAmount) &&
          Objects.equals(this.presentRefundDiscountAmount, alipayTradeRefundResponseModel.presentRefundDiscountAmount) &&
          Objects.equals(this.presentRefundMdiscountAmount, alipayTradeRefundResponseModel.presentRefundMdiscountAmount) &&
          Objects.equals(this.refundChargeAmount, alipayTradeRefundResponseModel.refundChargeAmount) &&
          Objects.equals(this.refundChargeInfoList, alipayTradeRefundResponseModel.refundChargeInfoList) &&
          Objects.equals(this.refundCurrency, alipayTradeRefundResponseModel.refundCurrency) &&
          Objects.equals(this.refundDetailItemList, alipayTradeRefundResponseModel.refundDetailItemList) &&
          Objects.equals(this.refundFee, alipayTradeRefundResponseModel.refundFee) &&
          Objects.equals(this.refundHybAmount, alipayTradeRefundResponseModel.refundHybAmount) &&
          Objects.equals(this.refundPresetPaytoolList, alipayTradeRefundResponseModel.refundPresetPaytoolList) &&
          Objects.equals(this.refundSettlementId, alipayTradeRefundResponseModel.refundSettlementId) &&
          Objects.equals(this.refundVoucherDetailList, alipayTradeRefundResponseModel.refundVoucherDetailList) &&
          Objects.equals(this.sendBackFee, alipayTradeRefundResponseModel.sendBackFee) &&
          Objects.equals(this.storeName, alipayTradeRefundResponseModel.storeName) &&
          Objects.equals(this.tradeNo, alipayTradeRefundResponseModel.tradeNo)&&
          Objects.equals(this.additionalProperties, alipayTradeRefundResponseModel.additionalProperties);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(buyerLogonId, buyerOpenId, buyerUserId, fundChange, gmtRefundPay, hasDepositBack, openId, outTradeNo, preAuthCancelFee, presentRefundBuyerAmount, presentRefundDiscountAmount, presentRefundMdiscountAmount, refundChargeAmount, refundChargeInfoList, refundCurrency, refundDetailItemList, refundFee, refundHybAmount, refundPresetPaytoolList, refundSettlementId, refundVoucherDetailList, sendBackFee, storeName, tradeNo, additionalProperties);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class AlipayTradeRefundResponseModel {\n");
      sb.append("    buyerLogonId: ").append(toIndentedString(buyerLogonId)).append("\n");
      sb.append("    buyerOpenId: ").append(toIndentedString(buyerOpenId)).append("\n");
      sb.append("    buyerUserId: ").append(toIndentedString(buyerUserId)).append("\n");
      sb.append("    fundChange: ").append(toIndentedString(fundChange)).append("\n");
      sb.append("    gmtRefundPay: ").append(toIndentedString(gmtRefundPay)).append("\n");
      sb.append("    hasDepositBack: ").append(toIndentedString(hasDepositBack)).append("\n");
      sb.append("    openId: ").append(toIndentedString(openId)).append("\n");
      sb.append("    outTradeNo: ").append(toIndentedString(outTradeNo)).append("\n");
      sb.append("    preAuthCancelFee: ").append(toIndentedString(preAuthCancelFee)).append("\n");
      sb.append("    presentRefundBuyerAmount: ").append(toIndentedString(presentRefundBuyerAmount)).append("\n");
      sb.append("    presentRefundDiscountAmount: ").append(toIndentedString(presentRefundDiscountAmount)).append("\n");
      sb.append("    presentRefundMdiscountAmount: ").append(toIndentedString(presentRefundMdiscountAmount)).append("\n");
      sb.append("    refundChargeAmount: ").append(toIndentedString(refundChargeAmount)).append("\n");
      sb.append("    refundChargeInfoList: ").append(toIndentedString(refundChargeInfoList)).append("\n");
      sb.append("    refundCurrency: ").append(toIndentedString(refundCurrency)).append("\n");
      sb.append("    refundDetailItemList: ").append(toIndentedString(refundDetailItemList)).append("\n");
      sb.append("    refundFee: ").append(toIndentedString(refundFee)).append("\n");
      sb.append("    refundHybAmount: ").append(toIndentedString(refundHybAmount)).append("\n");
      sb.append("    refundPresetPaytoolList: ").append(toIndentedString(refundPresetPaytoolList)).append("\n");
      sb.append("    refundSettlementId: ").append(toIndentedString(refundSettlementId)).append("\n");
      sb.append("    refundVoucherDetailList: ").append(toIndentedString(refundVoucherDetailList)).append("\n");
      sb.append("    sendBackFee: ").append(toIndentedString(sendBackFee)).append("\n");
      sb.append("    storeName: ").append(toIndentedString(storeName)).append("\n");
      sb.append("    tradeNo: ").append(toIndentedString(tradeNo)).append("\n");
      sb.append("    additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
      sb.append("}");
      return sb.toString();
    }
  
    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(Object o) {
      if (o == null) {
        return "null";
      }
      return o.toString().replace("\n", "\n    ");
    }
  
  
    public static HashSet<String> openapiFields;
    public static HashSet<String> openapiRequiredFields;
  
    static {
      // a set of all properties/fields (JSON key names)
      openapiFields = new HashSet<String>();
      openapiFields.add("buyer_logon_id");
      openapiFields.add("buyer_open_id");
      openapiFields.add("buyer_user_id");
      openapiFields.add("fund_change");
      openapiFields.add("gmt_refund_pay");
      openapiFields.add("has_deposit_back");
      openapiFields.add("open_id");
      openapiFields.add("out_trade_no");
      openapiFields.add("pre_auth_cancel_fee");
      openapiFields.add("present_refund_buyer_amount");
      openapiFields.add("present_refund_discount_amount");
      openapiFields.add("present_refund_mdiscount_amount");
      openapiFields.add("refund_charge_amount");
      openapiFields.add("refund_charge_info_list");
      openapiFields.add("refund_currency");
      openapiFields.add("refund_detail_item_list");
      openapiFields.add("refund_fee");
      openapiFields.add("refund_hyb_amount");
      openapiFields.add("refund_preset_paytool_list");
      openapiFields.add("refund_settlement_id");
      openapiFields.add("refund_voucher_detail_list");
      openapiFields.add("send_back_fee");
      openapiFields.add("store_name");
      openapiFields.add("trade_no");
  
      // a set of required properties/fields (JSON key names)
      openapiRequiredFields = new HashSet<String>();
    }
  
   /**
    * Validates the JSON Object and throws an exception if issues found
    *
    * @param jsonObj JSON Object
    * @throws IOException if the JSON Object is invalid with respect to AlipayTradeRefundResponseModel
    */
    public static void validateJsonObject(JsonObject jsonObj) throws IOException {
        if (jsonObj == null) {
          if (AlipayTradeRefundResponseModel.openapiRequiredFields.isEmpty()) {
            return;
          } else { // has required fields
            throw new IllegalArgumentException(String.format("The required field(s) %s in AlipayTradeRefundResponseModel is not found in the empty JSON string", AlipayTradeRefundResponseModel.openapiRequiredFields.toString()));
          }
        }
        if (jsonObj.get("buyer_logon_id") != null && !jsonObj.get("buyer_logon_id").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `buyer_logon_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("buyer_logon_id").toString()));
        }
        if (jsonObj.get("buyer_open_id") != null && !jsonObj.get("buyer_open_id").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `buyer_open_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("buyer_open_id").toString()));
        }
        if (jsonObj.get("buyer_user_id") != null && !jsonObj.get("buyer_user_id").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `buyer_user_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("buyer_user_id").toString()));
        }
        if (jsonObj.get("fund_change") != null && !jsonObj.get("fund_change").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `fund_change` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fund_change").toString()));
        }
        if (jsonObj.get("gmt_refund_pay") != null && !jsonObj.get("gmt_refund_pay").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `gmt_refund_pay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gmt_refund_pay").toString()));
        }
        if (jsonObj.get("has_deposit_back") != null && !jsonObj.get("has_deposit_back").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `has_deposit_back` to be a primitive type in the JSON string but got `%s`", jsonObj.get("has_deposit_back").toString()));
        }
        if (jsonObj.get("open_id") != null && !jsonObj.get("open_id").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `open_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("open_id").toString()));
        }
        if (jsonObj.get("out_trade_no") != null && !jsonObj.get("out_trade_no").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `out_trade_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("out_trade_no").toString()));
        }
        if (jsonObj.get("pre_auth_cancel_fee") != null && !jsonObj.get("pre_auth_cancel_fee").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `pre_auth_cancel_fee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pre_auth_cancel_fee").toString()));
        }
        if (jsonObj.get("present_refund_buyer_amount") != null && !jsonObj.get("present_refund_buyer_amount").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `present_refund_buyer_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("present_refund_buyer_amount").toString()));
        }
        if (jsonObj.get("present_refund_discount_amount") != null && !jsonObj.get("present_refund_discount_amount").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `present_refund_discount_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("present_refund_discount_amount").toString()));
        }
        if (jsonObj.get("present_refund_mdiscount_amount") != null && !jsonObj.get("present_refund_mdiscount_amount").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `present_refund_mdiscount_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("present_refund_mdiscount_amount").toString()));
        }
        if (jsonObj.get("refund_charge_amount") != null && !jsonObj.get("refund_charge_amount").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `refund_charge_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_charge_amount").toString()));
        }
        JsonArray jsonArrayrefundChargeInfoList = jsonObj.getAsJsonArray("refund_charge_info_list");
        if (jsonArrayrefundChargeInfoList != null) {
          // ensure the json data is an array
          if (!jsonObj.get("refund_charge_info_list").isJsonArray()) {
            throw new IllegalArgumentException(String.format("Expected the field `refund_charge_info_list` to be an array in the JSON string but got `%s`", jsonObj.get("refund_charge_info_list").toString()));
          }
  
          // validate the optional field `refund_charge_info_list` (array)
          for (int i = 0; i < jsonArrayrefundChargeInfoList.size(); i++) {
            RefundChargeInfo.validateJsonObject(jsonArrayrefundChargeInfoList.get(i).getAsJsonObject());
          };
        }
        if (jsonObj.get("refund_currency") != null && !jsonObj.get("refund_currency").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `refund_currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_currency").toString()));
        }
        JsonArray jsonArrayrefundDetailItemList = jsonObj.getAsJsonArray("refund_detail_item_list");
        if (jsonArrayrefundDetailItemList != null) {
          // ensure the json data is an array
          if (!jsonObj.get("refund_detail_item_list").isJsonArray()) {
            throw new IllegalArgumentException(String.format("Expected the field `refund_detail_item_list` to be an array in the JSON string but got `%s`", jsonObj.get("refund_detail_item_list").toString()));
          }
  
          // validate the optional field `refund_detail_item_list` (array)
          for (int i = 0; i < jsonArrayrefundDetailItemList.size(); i++) {
            TradeFundBill.validateJsonObject(jsonArrayrefundDetailItemList.get(i).getAsJsonObject());
          };
        }
        if (jsonObj.get("refund_fee") != null && !jsonObj.get("refund_fee").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `refund_fee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_fee").toString()));
        }
        if (jsonObj.get("refund_hyb_amount") != null && !jsonObj.get("refund_hyb_amount").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `refund_hyb_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_hyb_amount").toString()));
        }
        // validate the optional field `refund_preset_paytool_list`
        if (jsonObj.getAsJsonObject("refund_preset_paytool_list") != null) {
          PresetPayToolInfo.validateJsonObject(jsonObj.getAsJsonObject("refund_preset_paytool_list"));
        }
        if (jsonObj.get("refund_settlement_id") != null && !jsonObj.get("refund_settlement_id").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `refund_settlement_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_settlement_id").toString()));
        }
        JsonArray jsonArrayrefundVoucherDetailList = jsonObj.getAsJsonArray("refund_voucher_detail_list");
        if (jsonArrayrefundVoucherDetailList != null) {
          // ensure the json data is an array
          if (!jsonObj.get("refund_voucher_detail_list").isJsonArray()) {
            throw new IllegalArgumentException(String.format("Expected the field `refund_voucher_detail_list` to be an array in the JSON string but got `%s`", jsonObj.get("refund_voucher_detail_list").toString()));
          }
  
          // validate the optional field `refund_voucher_detail_list` (array)
          for (int i = 0; i < jsonArrayrefundVoucherDetailList.size(); i++) {
            VoucherDetail.validateJsonObject(jsonArrayrefundVoucherDetailList.get(i).getAsJsonObject());
          };
        }
        if (jsonObj.get("send_back_fee") != null && !jsonObj.get("send_back_fee").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `send_back_fee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("send_back_fee").toString()));
        }
        if (jsonObj.get("store_name") != null && !jsonObj.get("store_name").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `store_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store_name").toString()));
        }
        if (jsonObj.get("trade_no") != null && !jsonObj.get("trade_no").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `trade_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trade_no").toString()));
        }
    }
  
    public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
      @SuppressWarnings("unchecked")
      @Override
      public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
         if (!AlipayTradeRefundResponseModel.class.isAssignableFrom(type.getRawType())) {
           return null; // this class only serializes 'AlipayTradeRefundResponseModel' and its subtypes
         }
         final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
         final TypeAdapter<AlipayTradeRefundResponseModel> thisAdapter
                          = gson.getDelegateAdapter(this, TypeToken.get(AlipayTradeRefundResponseModel.class));
  
         return (TypeAdapter<T>) new TypeAdapter<AlipayTradeRefundResponseModel>() {
             @Override
             public void write(JsonWriter out, AlipayTradeRefundResponseModel value) throws IOException {
               JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
               obj.remove("additionalProperties");
               // serialize additonal properties
               if (value.getAdditionalProperties() != null) {
                 for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {
                   if (entry.getValue() instanceof String)
                     obj.addProperty(entry.getKey(), (String) entry.getValue());
                   else if (entry.getValue() instanceof Number)
                     obj.addProperty(entry.getKey(), (Number) entry.getValue());
                   else if (entry.getValue() instanceof Boolean)
                     obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
                   else if (entry.getValue() instanceof Character)
                     obj.addProperty(entry.getKey(), (Character) entry.getValue());
                   else {
                     obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
                   }
                 }
               }
               elementAdapter.write(out, obj);
             }
  
             @Override
             public AlipayTradeRefundResponseModel read(JsonReader in) throws IOException {
               JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
               validateJsonObject(jsonObj);
               // store additional fields in the deserialized instance
               AlipayTradeRefundResponseModel instance = thisAdapter.fromJsonTree(jsonObj);
               for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) {
                 if (!openapiFields.contains(entry.getKey())) {
                   if (entry.getValue().isJsonPrimitive()) { // primitive type
                     if (entry.getValue().getAsJsonPrimitive().isString())
                       instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
                     else if (entry.getValue().getAsJsonPrimitive().isNumber())
                       instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
                     else if (entry.getValue().getAsJsonPrimitive().isBoolean())
                       instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
                     else
                       throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
                   } else { // non-primitive type
                     instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
                   }
                 }
               }
               return instance;
             }
  
         }.nullSafe();
      }
    }
  
   /**
    * Create an instance of AlipayTradeRefundResponseModel given an JSON string
    *
    * @param jsonString JSON string
    * @return An instance of AlipayTradeRefundResponseModel
    * @throws IOException if the JSON string is invalid with respect to AlipayTradeRefundResponseModel
    */
    public static AlipayTradeRefundResponseModel fromJson(String jsonString) throws IOException {
      return JSON.getGson().fromJson(jsonString, AlipayTradeRefundResponseModel.class);
    }
  
   /**
    * Convert an instance of AlipayTradeRefundResponseModel to an JSON string
    *
    * @return JSON string
    */
    public String toJson() {
      return JSON.getGson().toJson(this);
    }
  }
  
  