All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alipay.v3.model.AlipayTradeFastpayRefundQueryResponseModel Maven / Gradle / Ivy

The newest version!
/*
 * 支付宝开放平台API
 * 支付宝开放平台v3协议文档
 *
 * The version of the OpenAPI document: 2024-08-30
 * 
 *
 * 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.DepositBackInfo;
import com.alipay.v3.model.EnterprisePayInfo;
import com.alipay.v3.model.RefundChargeInfo;
import com.alipay.v3.model.RefundRoyaltyResult;
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;

/**
 * AlipayTradeFastpayRefundQueryResponseModel
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AlipayTradeFastpayRefundQueryResponseModel {
  public static final String SERIALIZED_NAME_DEPOSIT_BACK_INFO = "deposit_back_info";
  @SerializedName(SERIALIZED_NAME_DEPOSIT_BACK_INFO)
  private DepositBackInfo depositBackInfo;

  public static final String SERIALIZED_NAME_DEPOSIT_BACK_INFO_LIST = "deposit_back_info_list";
  @SerializedName(SERIALIZED_NAME_DEPOSIT_BACK_INFO_LIST)
  private List depositBackInfoList = null;

  public static final String SERIALIZED_NAME_ENTERPRISE_PAY_INFO = "enterprise_pay_info";
  @SerializedName(SERIALIZED_NAME_ENTERPRISE_PAY_INFO)
  private EnterprisePayInfo enterprisePayInfo;

  public static final String SERIALIZED_NAME_ERROR_CODE = "error_code";
  @SerializedName(SERIALIZED_NAME_ERROR_CODE)
  private String errorCode;

  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_INDUSTRY_SEPC_DETAIL = "industry_sepc_detail";
  @SerializedName(SERIALIZED_NAME_INDUSTRY_SEPC_DETAIL)
  private String industrySepcDetail;

  public static final String SERIALIZED_NAME_OUT_REQUEST_NO = "out_request_no";
  @SerializedName(SERIALIZED_NAME_OUT_REQUEST_NO)
  private String outRequestNo;

  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_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_AMOUNT = "refund_amount";
  @SerializedName(SERIALIZED_NAME_REFUND_AMOUNT)
  private String refundAmount;

  public static final String SERIALIZED_NAME_REFUND_CHANNEL_LIST = "refund_channel_list";
  @SerializedName(SERIALIZED_NAME_REFUND_CHANNEL_LIST)
  private String refundChannelList;

  public static final String SERIALIZED_NAME_REFUND_CHANNEL_STATUS = "refund_channel_status";
  @SerializedName(SERIALIZED_NAME_REFUND_CHANNEL_STATUS)
  private String refundChannelStatus;

  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 refundChargeInfoList = null;

  public static final String SERIALIZED_NAME_REFUND_DETAIL_ITEM_LIST = "refund_detail_item_list";
  @SerializedName(SERIALIZED_NAME_REFUND_DETAIL_ITEM_LIST)
  private List refundDetailItemList = null;

  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_REASON = "refund_reason";
  @SerializedName(SERIALIZED_NAME_REFUND_REASON)
  private String refundReason;

  public static final String SERIALIZED_NAME_REFUND_ROYALTYS = "refund_royaltys";
  @SerializedName(SERIALIZED_NAME_REFUND_ROYALTYS)
  private List refundRoyaltys = null;

  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_STATUS = "refund_status";
  @SerializedName(SERIALIZED_NAME_REFUND_STATUS)
  private String refundStatus;

  public static final String SERIALIZED_NAME_REFUND_VOUCHER_DETAIL_LIST = "refund_voucher_detail_list";
  @SerializedName(SERIALIZED_NAME_REFUND_VOUCHER_DETAIL_LIST)
  private List 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_TOTAL_AMOUNT = "total_amount";
  @SerializedName(SERIALIZED_NAME_TOTAL_AMOUNT)
  private String totalAmount;

  public static final String SERIALIZED_NAME_TRADE_NO = "trade_no";
  @SerializedName(SERIALIZED_NAME_TRADE_NO)
  private String tradeNo;

  public AlipayTradeFastpayRefundQueryResponseModel() { 
  }

  public AlipayTradeFastpayRefundQueryResponseModel depositBackInfo(DepositBackInfo depositBackInfo) {
    
    this.depositBackInfo = depositBackInfo;
    return this;
  }

   /**
   * Get depositBackInfo
   * @return depositBackInfo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public DepositBackInfo getDepositBackInfo() {
    return depositBackInfo;
  }


  public void setDepositBackInfo(DepositBackInfo depositBackInfo) {
    this.depositBackInfo = depositBackInfo;
  }


  public AlipayTradeFastpayRefundQueryResponseModel depositBackInfoList(List depositBackInfoList) {
    
    this.depositBackInfoList = depositBackInfoList;
    return this;
  }

  public AlipayTradeFastpayRefundQueryResponseModel addDepositBackInfoListItem(DepositBackInfo depositBackInfoListItem) {
    if (this.depositBackInfoList == null) {
      this.depositBackInfoList = new ArrayList<>();
    }
    this.depositBackInfoList.add(depositBackInfoListItem);
    return this;
  }

   /**
   * 银行卡冲退信息列表。 默认不返回该信息,需要在入参的query_options中指定\"deposit_back_info_list\"值时才返回该字段信息。
   * @return depositBackInfoList
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "银行卡冲退信息列表。 默认不返回该信息,需要在入参的query_options中指定\"deposit_back_info_list\"值时才返回该字段信息。")

  public List getDepositBackInfoList() {
    return depositBackInfoList;
  }


  public void setDepositBackInfoList(List depositBackInfoList) {
    this.depositBackInfoList = depositBackInfoList;
  }


  public AlipayTradeFastpayRefundQueryResponseModel enterprisePayInfo(EnterprisePayInfo enterprisePayInfo) {
    
    this.enterprisePayInfo = enterprisePayInfo;
    return this;
  }

   /**
   * Get enterprisePayInfo
   * @return enterprisePayInfo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public EnterprisePayInfo getEnterprisePayInfo() {
    return enterprisePayInfo;
  }


  public void setEnterprisePayInfo(EnterprisePayInfo enterprisePayInfo) {
    this.enterprisePayInfo = enterprisePayInfo;
  }


  public AlipayTradeFastpayRefundQueryResponseModel errorCode(String errorCode) {
    
    this.errorCode = errorCode;
    return this;
  }

   /**
   * 退款失败错误码。只在使用异步退款接口情况下才会返回该字段
   * @return errorCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "SELLER_BALANCE_NOT_ENOUGH", value = "退款失败错误码。只在使用异步退款接口情况下才会返回该字段")

  public String getErrorCode() {
    return errorCode;
  }


  public void setErrorCode(String errorCode) {
    this.errorCode = errorCode;
  }


  public AlipayTradeFastpayRefundQueryResponseModel gmtRefundPay(String gmtRefundPay) {
    
    this.gmtRefundPay = gmtRefundPay;
    return this;
  }

   /**
   * 退款时间。默认不返回该信息,需要在入参的query_options中指定\"gmt_refund_pay\"值时才返回该字段信息。
   * @return gmtRefundPay
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2014-11-27 15:45:57", value = "退款时间。默认不返回该信息,需要在入参的query_options中指定\"gmt_refund_pay\"值时才返回该字段信息。")

  public String getGmtRefundPay() {
    return gmtRefundPay;
  }


  public void setGmtRefundPay(String gmtRefundPay) {
    this.gmtRefundPay = gmtRefundPay;
  }


  public AlipayTradeFastpayRefundQueryResponseModel industrySepcDetail(String industrySepcDetail) {
    
    this.industrySepcDetail = industrySepcDetail;
    return this;
  }

   /**
   * 行业特殊信息(例如在医保卡支付退款中,医保局向商户返回医疗信息)。
   * @return industrySepcDetail
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "[{\"bizType\":\"REFUND\",\"modelName\":\"tradeCancelContext\",\"contextData\":{\"response_content\":\"{\\\"WxResToll\\\":{\\\"dealID\\\":\\\"\\\",}}\"}}]", value = "行业特殊信息(例如在医保卡支付退款中,医保局向商户返回医疗信息)。")

  public String getIndustrySepcDetail() {
    return industrySepcDetail;
  }


  public void setIndustrySepcDetail(String industrySepcDetail) {
    this.industrySepcDetail = industrySepcDetail;
  }


  public AlipayTradeFastpayRefundQueryResponseModel outRequestNo(String outRequestNo) {
    
    this.outRequestNo = outRequestNo;
    return this;
  }

   /**
   * 本笔退款对应的退款请求号
   * @return outRequestNo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "20150320010101001", value = "本笔退款对应的退款请求号")

  public String getOutRequestNo() {
    return outRequestNo;
  }


  public void setOutRequestNo(String outRequestNo) {
    this.outRequestNo = outRequestNo;
  }


  public AlipayTradeFastpayRefundQueryResponseModel outTradeNo(String outTradeNo) {
    
    this.outTradeNo = outTradeNo;
    return this;
  }

   /**
   * 创建交易传入的商户订单号
   * @return outTradeNo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "20150320010101001", value = "创建交易传入的商户订单号")

  public String getOutTradeNo() {
    return outTradeNo;
  }


  public void setOutTradeNo(String outTradeNo) {
    this.outTradeNo = outTradeNo;
  }


  public AlipayTradeFastpayRefundQueryResponseModel 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 AlipayTradeFastpayRefundQueryResponseModel 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 AlipayTradeFastpayRefundQueryResponseModel 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 AlipayTradeFastpayRefundQueryResponseModel refundAmount(String refundAmount) {
    
    this.refundAmount = refundAmount;
    return this;
  }

   /**
   * 本次退款请求,对应的退款金额。单位:元。
   * @return refundAmount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "12.33", value = "本次退款请求,对应的退款金额。单位:元。")

  public String getRefundAmount() {
    return refundAmount;
  }


  public void setRefundAmount(String refundAmount) {
    this.refundAmount = refundAmount;
  }


  public AlipayTradeFastpayRefundQueryResponseModel refundChannelList(String refundChannelList) {
    
    this.refundChannelList = refundChannelList;
    return this;
  }

   /**
   * 若支付渠道包含医保统筹、个账,则显示退款的渠道信息。如统筹OUTSIDEGOVCARD,个账OUTSIDEACCCARD
   * @return refundChannelList
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "OUTSIDEGOVCARD", value = "若支付渠道包含医保统筹、个账,则显示退款的渠道信息。如统筹OUTSIDEGOVCARD,个账OUTSIDEACCCARD")

  public String getRefundChannelList() {
    return refundChannelList;
  }


  public void setRefundChannelList(String refundChannelList) {
    this.refundChannelList = refundChannelList;
  }


  public AlipayTradeFastpayRefundQueryResponseModel refundChannelStatus(String refundChannelStatus) {
    
    this.refundChannelStatus = refundChannelStatus;
    return this;
  }

   /**
   * 若支付渠道包含医保统筹、个账,全渠道退款成功时返回SUCCESS,全失败时返回FAIL,部分成功时返回PART_SUCCESS
   * @return refundChannelStatus
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "SUCCESS", value = "若支付渠道包含医保统筹、个账,全渠道退款成功时返回SUCCESS,全失败时返回FAIL,部分成功时返回PART_SUCCESS")

  public String getRefundChannelStatus() {
    return refundChannelStatus;
  }


  public void setRefundChannelStatus(String refundChannelStatus) {
    this.refundChannelStatus = refundChannelStatus;
  }


  public AlipayTradeFastpayRefundQueryResponseModel 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 AlipayTradeFastpayRefundQueryResponseModel refundChargeInfoList(List refundChargeInfoList) {
    
    this.refundChargeInfoList = refundChargeInfoList;
    return this;
  }

  public AlipayTradeFastpayRefundQueryResponseModel 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 getRefundChargeInfoList() {
    return refundChargeInfoList;
  }


  public void setRefundChargeInfoList(List refundChargeInfoList) {
    this.refundChargeInfoList = refundChargeInfoList;
  }


  public AlipayTradeFastpayRefundQueryResponseModel refundDetailItemList(List refundDetailItemList) {
    
    this.refundDetailItemList = refundDetailItemList;
    return this;
  }

  public AlipayTradeFastpayRefundQueryResponseModel addRefundDetailItemListItem(TradeFundBill refundDetailItemListItem) {
    if (this.refundDetailItemList == null) {
      this.refundDetailItemList = new ArrayList<>();
    }
    this.refundDetailItemList.add(refundDetailItemListItem);
    return this;
  }

   /**
   * 本次退款使用的资金渠道; 默认不返回该信息,需要在入参的query_options中指定\"refund_detail_item_list\"值时才返回该字段信息。
   * @return refundDetailItemList
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "本次退款使用的资金渠道; 默认不返回该信息,需要在入参的query_options中指定\"refund_detail_item_list\"值时才返回该字段信息。")

  public List getRefundDetailItemList() {
    return refundDetailItemList;
  }


  public void setRefundDetailItemList(List refundDetailItemList) {
    this.refundDetailItemList = refundDetailItemList;
  }


  public AlipayTradeFastpayRefundQueryResponseModel 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 AlipayTradeFastpayRefundQueryResponseModel refundReason(String refundReason) {
    
    this.refundReason = refundReason;
    return this;
  }

   /**
   * 发起退款时,传入的退款原因
   * @return refundReason
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "用户退款请求", value = "发起退款时,传入的退款原因")

  public String getRefundReason() {
    return refundReason;
  }


  public void setRefundReason(String refundReason) {
    this.refundReason = refundReason;
  }


  public AlipayTradeFastpayRefundQueryResponseModel refundRoyaltys(List refundRoyaltys) {
    
    this.refundRoyaltys = refundRoyaltys;
    return this;
  }

  public AlipayTradeFastpayRefundQueryResponseModel addRefundRoyaltysItem(RefundRoyaltyResult refundRoyaltysItem) {
    if (this.refundRoyaltys == null) {
      this.refundRoyaltys = new ArrayList<>();
    }
    this.refundRoyaltys.add(refundRoyaltysItem);
    return this;
  }

   /**
   * 退分账明细信息,当前仅在直付通产品中返回。
   * @return refundRoyaltys
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "退分账明细信息,当前仅在直付通产品中返回。")

  public List getRefundRoyaltys() {
    return refundRoyaltys;
  }


  public void setRefundRoyaltys(List refundRoyaltys) {
    this.refundRoyaltys = refundRoyaltys;
  }


  public AlipayTradeFastpayRefundQueryResponseModel 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 AlipayTradeFastpayRefundQueryResponseModel refundStatus(String refundStatus) {
    
    this.refundStatus = refundStatus;
    return this;
  }

   /**
   * 退款状态。枚举值: REFUND_SUCCESS 退款处理成功; 未返回该字段表示退款请求未收到或者退款失败; 注:如果退款查询发起时间早于退款时间,或者间隔退款发起时间太短,可能出现退款查询时还没处理成功,后面又处理成功的情况,建议商户在退款发起后间隔10秒以上再发起退款查询请求。
   * @return refundStatus
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "REFUND_SUCCESS", value = "退款状态。枚举值: REFUND_SUCCESS 退款处理成功; 未返回该字段表示退款请求未收到或者退款失败; 注:如果退款查询发起时间早于退款时间,或者间隔退款发起时间太短,可能出现退款查询时还没处理成功,后面又处理成功的情况,建议商户在退款发起后间隔10秒以上再发起退款查询请求。")

  public String getRefundStatus() {
    return refundStatus;
  }


  public void setRefundStatus(String refundStatus) {
    this.refundStatus = refundStatus;
  }


  public AlipayTradeFastpayRefundQueryResponseModel refundVoucherDetailList(List refundVoucherDetailList) {
    
    this.refundVoucherDetailList = refundVoucherDetailList;
    return this;
  }

  public AlipayTradeFastpayRefundQueryResponseModel 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 getRefundVoucherDetailList() {
    return refundVoucherDetailList;
  }


  public void setRefundVoucherDetailList(List refundVoucherDetailList) {
    this.refundVoucherDetailList = refundVoucherDetailList;
  }


  public AlipayTradeFastpayRefundQueryResponseModel sendBackFee(String sendBackFee) {
    
    this.sendBackFee = sendBackFee;
    return this;
  }

   /**
   * 本次商户实际退回金额;单位:元。 默认不返回该信息,需要在入参的query_options中指定\"refund_detail_item_list\"值时才返回该字段信息。
   * @return sendBackFee
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "88", value = "本次商户实际退回金额;单位:元。 默认不返回该信息,需要在入参的query_options中指定\"refund_detail_item_list\"值时才返回该字段信息。")

  public String getSendBackFee() {
    return sendBackFee;
  }


  public void setSendBackFee(String sendBackFee) {
    this.sendBackFee = sendBackFee;
  }


  public AlipayTradeFastpayRefundQueryResponseModel totalAmount(String totalAmount) {
    
    this.totalAmount = totalAmount;
    return this;
  }

   /**
   * 该笔退款所对应的交易的订单金额。单位:元。
   * @return totalAmount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "100.20", value = "该笔退款所对应的交易的订单金额。单位:元。")

  public String getTotalAmount() {
    return totalAmount;
  }


  public void setTotalAmount(String totalAmount) {
    this.totalAmount = totalAmount;
  }


  public AlipayTradeFastpayRefundQueryResponseModel tradeNo(String tradeNo) {
    
    this.tradeNo = tradeNo;
    return this;
  }

   /**
   * 支付宝交易号
   * @return tradeNo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2014112611001004680073956707", 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 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 AlipayTradeFastpayRefundQueryResponseModel instance itself
   */
  public AlipayTradeFastpayRefundQueryResponseModel putAdditionalProperty(String key, Object value) {
    if (this.additionalProperties == null) {
        this.additionalProperties = new HashMap();
    }
    this.additionalProperties.put(key, value);
    return this;
  }

  /**
   * Return the additional (undeclared) property.
   *
   * @return a map of objects
   */
  public Map 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;
    }
    AlipayTradeFastpayRefundQueryResponseModel alipayTradeFastpayRefundQueryResponseModel = (AlipayTradeFastpayRefundQueryResponseModel) o;
    return Objects.equals(this.depositBackInfo, alipayTradeFastpayRefundQueryResponseModel.depositBackInfo) &&
        Objects.equals(this.depositBackInfoList, alipayTradeFastpayRefundQueryResponseModel.depositBackInfoList) &&
        Objects.equals(this.enterprisePayInfo, alipayTradeFastpayRefundQueryResponseModel.enterprisePayInfo) &&
        Objects.equals(this.errorCode, alipayTradeFastpayRefundQueryResponseModel.errorCode) &&
        Objects.equals(this.gmtRefundPay, alipayTradeFastpayRefundQueryResponseModel.gmtRefundPay) &&
        Objects.equals(this.industrySepcDetail, alipayTradeFastpayRefundQueryResponseModel.industrySepcDetail) &&
        Objects.equals(this.outRequestNo, alipayTradeFastpayRefundQueryResponseModel.outRequestNo) &&
        Objects.equals(this.outTradeNo, alipayTradeFastpayRefundQueryResponseModel.outTradeNo) &&
        Objects.equals(this.presentRefundBuyerAmount, alipayTradeFastpayRefundQueryResponseModel.presentRefundBuyerAmount) &&
        Objects.equals(this.presentRefundDiscountAmount, alipayTradeFastpayRefundQueryResponseModel.presentRefundDiscountAmount) &&
        Objects.equals(this.presentRefundMdiscountAmount, alipayTradeFastpayRefundQueryResponseModel.presentRefundMdiscountAmount) &&
        Objects.equals(this.refundAmount, alipayTradeFastpayRefundQueryResponseModel.refundAmount) &&
        Objects.equals(this.refundChannelList, alipayTradeFastpayRefundQueryResponseModel.refundChannelList) &&
        Objects.equals(this.refundChannelStatus, alipayTradeFastpayRefundQueryResponseModel.refundChannelStatus) &&
        Objects.equals(this.refundChargeAmount, alipayTradeFastpayRefundQueryResponseModel.refundChargeAmount) &&
        Objects.equals(this.refundChargeInfoList, alipayTradeFastpayRefundQueryResponseModel.refundChargeInfoList) &&
        Objects.equals(this.refundDetailItemList, alipayTradeFastpayRefundQueryResponseModel.refundDetailItemList) &&
        Objects.equals(this.refundHybAmount, alipayTradeFastpayRefundQueryResponseModel.refundHybAmount) &&
        Objects.equals(this.refundReason, alipayTradeFastpayRefundQueryResponseModel.refundReason) &&
        Objects.equals(this.refundRoyaltys, alipayTradeFastpayRefundQueryResponseModel.refundRoyaltys) &&
        Objects.equals(this.refundSettlementId, alipayTradeFastpayRefundQueryResponseModel.refundSettlementId) &&
        Objects.equals(this.refundStatus, alipayTradeFastpayRefundQueryResponseModel.refundStatus) &&
        Objects.equals(this.refundVoucherDetailList, alipayTradeFastpayRefundQueryResponseModel.refundVoucherDetailList) &&
        Objects.equals(this.sendBackFee, alipayTradeFastpayRefundQueryResponseModel.sendBackFee) &&
        Objects.equals(this.totalAmount, alipayTradeFastpayRefundQueryResponseModel.totalAmount) &&
        Objects.equals(this.tradeNo, alipayTradeFastpayRefundQueryResponseModel.tradeNo)&&
        Objects.equals(this.additionalProperties, alipayTradeFastpayRefundQueryResponseModel.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(depositBackInfo, depositBackInfoList, enterprisePayInfo, errorCode, gmtRefundPay, industrySepcDetail, outRequestNo, outTradeNo, presentRefundBuyerAmount, presentRefundDiscountAmount, presentRefundMdiscountAmount, refundAmount, refundChannelList, refundChannelStatus, refundChargeAmount, refundChargeInfoList, refundDetailItemList, refundHybAmount, refundReason, refundRoyaltys, refundSettlementId, refundStatus, refundVoucherDetailList, sendBackFee, totalAmount, tradeNo, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class AlipayTradeFastpayRefundQueryResponseModel {\n");
    sb.append("    depositBackInfo: ").append(toIndentedString(depositBackInfo)).append("\n");
    sb.append("    depositBackInfoList: ").append(toIndentedString(depositBackInfoList)).append("\n");
    sb.append("    enterprisePayInfo: ").append(toIndentedString(enterprisePayInfo)).append("\n");
    sb.append("    errorCode: ").append(toIndentedString(errorCode)).append("\n");
    sb.append("    gmtRefundPay: ").append(toIndentedString(gmtRefundPay)).append("\n");
    sb.append("    industrySepcDetail: ").append(toIndentedString(industrySepcDetail)).append("\n");
    sb.append("    outRequestNo: ").append(toIndentedString(outRequestNo)).append("\n");
    sb.append("    outTradeNo: ").append(toIndentedString(outTradeNo)).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("    refundAmount: ").append(toIndentedString(refundAmount)).append("\n");
    sb.append("    refundChannelList: ").append(toIndentedString(refundChannelList)).append("\n");
    sb.append("    refundChannelStatus: ").append(toIndentedString(refundChannelStatus)).append("\n");
    sb.append("    refundChargeAmount: ").append(toIndentedString(refundChargeAmount)).append("\n");
    sb.append("    refundChargeInfoList: ").append(toIndentedString(refundChargeInfoList)).append("\n");
    sb.append("    refundDetailItemList: ").append(toIndentedString(refundDetailItemList)).append("\n");
    sb.append("    refundHybAmount: ").append(toIndentedString(refundHybAmount)).append("\n");
    sb.append("    refundReason: ").append(toIndentedString(refundReason)).append("\n");
    sb.append("    refundRoyaltys: ").append(toIndentedString(refundRoyaltys)).append("\n");
    sb.append("    refundSettlementId: ").append(toIndentedString(refundSettlementId)).append("\n");
    sb.append("    refundStatus: ").append(toIndentedString(refundStatus)).append("\n");
    sb.append("    refundVoucherDetailList: ").append(toIndentedString(refundVoucherDetailList)).append("\n");
    sb.append("    sendBackFee: ").append(toIndentedString(sendBackFee)).append("\n");
    sb.append("    totalAmount: ").append(toIndentedString(totalAmount)).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 openapiFields;
  public static HashSet openapiRequiredFields;

  static {
    // a set of all properties/fields (JSON key names)
    openapiFields = new HashSet();
    openapiFields.add("deposit_back_info");
    openapiFields.add("deposit_back_info_list");
    openapiFields.add("enterprise_pay_info");
    openapiFields.add("error_code");
    openapiFields.add("gmt_refund_pay");
    openapiFields.add("industry_sepc_detail");
    openapiFields.add("out_request_no");
    openapiFields.add("out_trade_no");
    openapiFields.add("present_refund_buyer_amount");
    openapiFields.add("present_refund_discount_amount");
    openapiFields.add("present_refund_mdiscount_amount");
    openapiFields.add("refund_amount");
    openapiFields.add("refund_channel_list");
    openapiFields.add("refund_channel_status");
    openapiFields.add("refund_charge_amount");
    openapiFields.add("refund_charge_info_list");
    openapiFields.add("refund_detail_item_list");
    openapiFields.add("refund_hyb_amount");
    openapiFields.add("refund_reason");
    openapiFields.add("refund_royaltys");
    openapiFields.add("refund_settlement_id");
    openapiFields.add("refund_status");
    openapiFields.add("refund_voucher_detail_list");
    openapiFields.add("send_back_fee");
    openapiFields.add("total_amount");
    openapiFields.add("trade_no");

    // a set of required properties/fields (JSON key names)
    openapiRequiredFields = new HashSet();
  }

 /**
  * 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 AlipayTradeFastpayRefundQueryResponseModel
  */
  public static void validateJsonObject(JsonObject jsonObj) throws IOException {
      if (jsonObj == null) {
        if (AlipayTradeFastpayRefundQueryResponseModel.openapiRequiredFields.isEmpty()) {
          return;
        } else { // has required fields
          throw new IllegalArgumentException(String.format("The required field(s) %s in AlipayTradeFastpayRefundQueryResponseModel is not found in the empty JSON string", AlipayTradeFastpayRefundQueryResponseModel.openapiRequiredFields.toString()));
        }
      }
      // validate the optional field `deposit_back_info`
      if (jsonObj.getAsJsonObject("deposit_back_info") != null) {
        DepositBackInfo.validateJsonObject(jsonObj.getAsJsonObject("deposit_back_info"));
      }
      JsonArray jsonArraydepositBackInfoList = jsonObj.getAsJsonArray("deposit_back_info_list");
      if (jsonArraydepositBackInfoList != null) {
        // ensure the json data is an array
        if (!jsonObj.get("deposit_back_info_list").isJsonArray()) {
          throw new IllegalArgumentException(String.format("Expected the field `deposit_back_info_list` to be an array in the JSON string but got `%s`", jsonObj.get("deposit_back_info_list").toString()));
        }

        // validate the optional field `deposit_back_info_list` (array)
        for (int i = 0; i < jsonArraydepositBackInfoList.size(); i++) {
          DepositBackInfo.validateJsonObject(jsonArraydepositBackInfoList.get(i).getAsJsonObject());
        };
      }
      // validate the optional field `enterprise_pay_info`
      if (jsonObj.getAsJsonObject("enterprise_pay_info") != null) {
        EnterprisePayInfo.validateJsonObject(jsonObj.getAsJsonObject("enterprise_pay_info"));
      }
      if (jsonObj.get("error_code") != null && !jsonObj.get("error_code").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `error_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error_code").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("industry_sepc_detail") != null && !jsonObj.get("industry_sepc_detail").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `industry_sepc_detail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("industry_sepc_detail").toString()));
      }
      if (jsonObj.get("out_request_no") != null && !jsonObj.get("out_request_no").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `out_request_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("out_request_no").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("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_amount") != null && !jsonObj.get("refund_amount").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `refund_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_amount").toString()));
      }
      if (jsonObj.get("refund_channel_list") != null && !jsonObj.get("refund_channel_list").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `refund_channel_list` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_channel_list").toString()));
      }
      if (jsonObj.get("refund_channel_status") != null && !jsonObj.get("refund_channel_status").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `refund_channel_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_channel_status").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());
        };
      }
      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_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()));
      }
      if (jsonObj.get("refund_reason") != null && !jsonObj.get("refund_reason").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `refund_reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_reason").toString()));
      }
      JsonArray jsonArrayrefundRoyaltys = jsonObj.getAsJsonArray("refund_royaltys");
      if (jsonArrayrefundRoyaltys != null) {
        // ensure the json data is an array
        if (!jsonObj.get("refund_royaltys").isJsonArray()) {
          throw new IllegalArgumentException(String.format("Expected the field `refund_royaltys` to be an array in the JSON string but got `%s`", jsonObj.get("refund_royaltys").toString()));
        }

        // validate the optional field `refund_royaltys` (array)
        for (int i = 0; i < jsonArrayrefundRoyaltys.size(); i++) {
          RefundRoyaltyResult.validateJsonObject(jsonArrayrefundRoyaltys.get(i).getAsJsonObject());
        };
      }
      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()));
      }
      if (jsonObj.get("refund_status") != null && !jsonObj.get("refund_status").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `refund_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_status").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("total_amount") != null && !jsonObj.get("total_amount").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `total_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("total_amount").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  TypeAdapter create(Gson gson, TypeToken type) {
       if (!AlipayTradeFastpayRefundQueryResponseModel.class.isAssignableFrom(type.getRawType())) {
         return null; // this class only serializes 'AlipayTradeFastpayRefundQueryResponseModel' and its subtypes
       }
       final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
       final TypeAdapter thisAdapter
                        = gson.getDelegateAdapter(this, TypeToken.get(AlipayTradeFastpayRefundQueryResponseModel.class));

       return (TypeAdapter) new TypeAdapter() {
           @Override
           public void write(JsonWriter out, AlipayTradeFastpayRefundQueryResponseModel value) throws IOException {
             JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
             obj.remove("additionalProperties");
             // serialize additonal properties
             if (value.getAdditionalProperties() != null) {
               for (Map.Entry 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 AlipayTradeFastpayRefundQueryResponseModel read(JsonReader in) throws IOException {
             JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
             validateJsonObject(jsonObj);
             // store additional fields in the deserialized instance
             AlipayTradeFastpayRefundQueryResponseModel instance = thisAdapter.fromJsonTree(jsonObj);
             for (Map.Entry 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 AlipayTradeFastpayRefundQueryResponseModel given an JSON string
  *
  * @param jsonString JSON string
  * @return An instance of AlipayTradeFastpayRefundQueryResponseModel
  * @throws IOException if the JSON string is invalid with respect to AlipayTradeFastpayRefundQueryResponseModel
  */
  public static AlipayTradeFastpayRefundQueryResponseModel fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, AlipayTradeFastpayRefundQueryResponseModel.class);
  }

 /**
  * Convert an instance of AlipayTradeFastpayRefundQueryResponseModel to an JSON string
  *
  * @return JSON string
  */
  public String toJson() {
    return JSON.getGson().toJson(this);
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy