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

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

There is a newer version: 3.1.6.ALL
Show newest version
/*
 * 支付宝开放平台API
 * 支付宝开放平台v3协议文档
 *
 * The version of the OpenAPI document: 2024-11-12
 * 
 *
 * 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.DiscountInfoData;
import com.alipay.v3.model.ItemOrderInfo;
import com.alipay.v3.model.OrderExtInfo;
import com.alipay.v3.model.OrderJourneyInfo;
import com.alipay.v3.model.OrderLogisticsInformationRequest;
import com.alipay.v3.model.OrderShopInfo;
import com.alipay.v3.model.TicketInfo;
import com.alipay.v3.model.TicketOrderInfo;
import com.alipay.v3.model.UserInfomation;
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;

/**
 * AlipayMerchantOrderSyncModel
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AlipayMerchantOrderSyncModel {
  public static final String SERIALIZED_NAME_AMOUNT = "amount";
  @SerializedName(SERIALIZED_NAME_AMOUNT)
  private String amount;

  public static final String SERIALIZED_NAME_BUYER_ID = "buyer_id";
  @SerializedName(SERIALIZED_NAME_BUYER_ID)
  private String buyerId;

  public static final String SERIALIZED_NAME_BUYER_INFO = "buyer_info";
  @SerializedName(SERIALIZED_NAME_BUYER_INFO)
  private UserInfomation buyerInfo;

  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_CATEGORY_ID = "category_id";
  @SerializedName(SERIALIZED_NAME_CATEGORY_ID)
  private String categoryId;

  public static final String SERIALIZED_NAME_DISCOUNT_AMOUNT = "discount_amount";
  @SerializedName(SERIALIZED_NAME_DISCOUNT_AMOUNT)
  private String discountAmount;

  public static final String SERIALIZED_NAME_DISCOUNT_INFO_LIST = "discount_info_list";
  @SerializedName(SERIALIZED_NAME_DISCOUNT_INFO_LIST)
  private List discountInfoList = null;

  public static final String SERIALIZED_NAME_EXT_INFO = "ext_info";
  @SerializedName(SERIALIZED_NAME_EXT_INFO)
  private List extInfo = null;

  public static final String SERIALIZED_NAME_ITEM_ORDER_LIST = "item_order_list";
  @SerializedName(SERIALIZED_NAME_ITEM_ORDER_LIST)
  private List itemOrderList = null;

  public static final String SERIALIZED_NAME_JOURNEY_ORDER_LIST = "journey_order_list";
  @SerializedName(SERIALIZED_NAME_JOURNEY_ORDER_LIST)
  private List journeyOrderList = null;

  public static final String SERIALIZED_NAME_LOGISTICS_INFO_LIST = "logistics_info_list";
  @SerializedName(SERIALIZED_NAME_LOGISTICS_INFO_LIST)
  private List logisticsInfoList = null;

  public static final String SERIALIZED_NAME_ORDER_AUTH_CODE = "order_auth_code";
  @SerializedName(SERIALIZED_NAME_ORDER_AUTH_CODE)
  private String orderAuthCode;

  public static final String SERIALIZED_NAME_ORDER_CREATE_TIME = "order_create_time";
  @SerializedName(SERIALIZED_NAME_ORDER_CREATE_TIME)
  private String orderCreateTime;

  public static final String SERIALIZED_NAME_ORDER_MODIFIED_TIME = "order_modified_time";
  @SerializedName(SERIALIZED_NAME_ORDER_MODIFIED_TIME)
  private String orderModifiedTime;

  public static final String SERIALIZED_NAME_ORDER_PAY_TIME = "order_pay_time";
  @SerializedName(SERIALIZED_NAME_ORDER_PAY_TIME)
  private String orderPayTime;

  public static final String SERIALIZED_NAME_ORDER_TYPE = "order_type";
  @SerializedName(SERIALIZED_NAME_ORDER_TYPE)
  private String orderType;

  public static final String SERIALIZED_NAME_OUT_BIZ_NO = "out_biz_no";
  @SerializedName(SERIALIZED_NAME_OUT_BIZ_NO)
  private String outBizNo;

  public static final String SERIALIZED_NAME_PARTNER_ID = "partner_id";
  @SerializedName(SERIALIZED_NAME_PARTNER_ID)
  private String partnerId;

  public static final String SERIALIZED_NAME_PAY_AMOUNT = "pay_amount";
  @SerializedName(SERIALIZED_NAME_PAY_AMOUNT)
  private String payAmount;

  public static final String SERIALIZED_NAME_PAY_TIMEOUT_EXPRESS = "pay_timeout_express";
  @SerializedName(SERIALIZED_NAME_PAY_TIMEOUT_EXPRESS)
  private String payTimeoutExpress;

  public static final String SERIALIZED_NAME_RECORD_ID = "record_id";
  @SerializedName(SERIALIZED_NAME_RECORD_ID)
  private String recordId;

  public static final String SERIALIZED_NAME_SELLER_ID = "seller_id";
  @SerializedName(SERIALIZED_NAME_SELLER_ID)
  private String sellerId;

  public static final String SERIALIZED_NAME_SEND_MSG = "send_msg";
  @SerializedName(SERIALIZED_NAME_SEND_MSG)
  private String sendMsg;

  public static final String SERIALIZED_NAME_SERVICE_CODE = "service_code";
  @SerializedName(SERIALIZED_NAME_SERVICE_CODE)
  private String serviceCode;

  public static final String SERIALIZED_NAME_SHOP_INFO = "shop_info";
  @SerializedName(SERIALIZED_NAME_SHOP_INFO)
  private OrderShopInfo shopInfo;

  public static final String SERIALIZED_NAME_SOURCE_APP = "source_app";
  @SerializedName(SERIALIZED_NAME_SOURCE_APP)
  private String sourceApp;

  public static final String SERIALIZED_NAME_SYNC_CONTENT = "sync_content";
  @SerializedName(SERIALIZED_NAME_SYNC_CONTENT)
  private String syncContent;

  public static final String SERIALIZED_NAME_TICKET_INFO = "ticket_info";
  @SerializedName(SERIALIZED_NAME_TICKET_INFO)
  private TicketInfo ticketInfo;

  public static final String SERIALIZED_NAME_TICKET_ORDER_LIST = "ticket_order_list";
  @SerializedName(SERIALIZED_NAME_TICKET_ORDER_LIST)
  private List ticketOrderList = null;

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

  public static final String SERIALIZED_NAME_TRADE_TYPE = "trade_type";
  @SerializedName(SERIALIZED_NAME_TRADE_TYPE)
  private String tradeType;

  public AlipayMerchantOrderSyncModel() { 
  }

  public AlipayMerchantOrderSyncModel amount(String amount) {
    
    this.amount = amount;
    return this;
  }

   /**
   * 订单总金额:某笔交易订单优惠前的总金额,单位为【元】</br> <a href=\"https://mdn.alipayobjects.com/portal_ykdvdu/afts/img/A*UuuWRpmekegAAAAAAAAAAAAAAQAAAQ/original\" target=\"_blank\">实际案例一</a> <br><a href=\"https://mdn.alipayobjects.com/portal_ykdvdu/afts/img/A*kBkOTZpqP40AAAAAAAAAAAAAAQAAAQ/original\" target=\"_blank\">实际案例二</a> <br><a href=\"https://mdn.alipayobjects.com/portal_ykdvdu/afts/img/A*ZpkjTJQlFVAAAAAAAAAAAAAAAQAAAQ/original\" target=\"_blank\">实际案例三</a>
   * @return amount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "12.34", value = "订单总金额:某笔交易订单优惠前的总金额,单位为【元】
实际案例一
实际案例二
实际案例三") public String getAmount() { return amount; } public void setAmount(String amount) { this.amount = amount; } public AlipayMerchantOrderSyncModel buyerId(String buyerId) { this.buyerId = buyerId; return this; } /** * 买家userId * @return buyerId **/ @javax.annotation.Nullable @ApiModelProperty(example = "20880010xxxxxxxx", value = "买家userId") public String getBuyerId() { return buyerId; } public void setBuyerId(String buyerId) { this.buyerId = buyerId; } public AlipayMerchantOrderSyncModel buyerInfo(UserInfomation buyerInfo) { this.buyerInfo = buyerInfo; return this; } /** * Get buyerInfo * @return buyerInfo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public UserInfomation getBuyerInfo() { return buyerInfo; } public void setBuyerInfo(UserInfomation buyerInfo) { this.buyerInfo = buyerInfo; } public AlipayMerchantOrderSyncModel buyerOpenId(String buyerOpenId) { this.buyerOpenId = buyerOpenId; return this; } /** * 用户open_id * @return buyerOpenId **/ @javax.annotation.Nullable @ApiModelProperty(example = "074a1CcTG1LelxKe4xQC0zgNdId0nxi95b5lsNpazWYoCo5", value = "用户open_id") public String getBuyerOpenId() { return buyerOpenId; } public void setBuyerOpenId(String buyerOpenId) { this.buyerOpenId = buyerOpenId; } public AlipayMerchantOrderSyncModel categoryId(String categoryId) { this.categoryId = categoryId; return this; } /** * 标准服务类目 * @return categoryId **/ @javax.annotation.Nullable @ApiModelProperty(example = "C000003191", value = "标准服务类目") public String getCategoryId() { return categoryId; } public void setCategoryId(String categoryId) { this.categoryId = categoryId; } public AlipayMerchantOrderSyncModel discountAmount(String discountAmount) { this.discountAmount = discountAmount; return this; } /** * 商户总计优惠金额:代表商户侧给予用户的总计优惠金额 (不包含选择支付宝付款时,支付宝给予的优惠减免金额),单位为【元】。</br> <a href=\"https://mdn.alipayobjects.com/portal_ykdvdu/afts/img/A*UuuWRpmekegAAAAAAAAAAAAAAQAAAQ/original\" target=\"_blank\">实际案例一</a> <br><a href=\"https://mdn.alipayobjects.com/portal_ykdvdu/afts/img/A*kBkOTZpqP40AAAAAAAAAAAAAAQAAAQ/original\" target=\"_blank\">实际案例二</a> <br><a href=\"https://mdn.alipayobjects.com/portal_ykdvdu/afts/img/A*ZpkjTJQlFVAAAAAAAAAAAAAAAQAAAQ/original\" target=\"_blank\">实际案例三</a> * @return discountAmount **/ @javax.annotation.Nullable @ApiModelProperty(example = "2.44", value = "商户总计优惠金额:代表商户侧给予用户的总计优惠金额 (不包含选择支付宝付款时,支付宝给予的优惠减免金额),单位为【元】。
实际案例一
实际案例二
实际案例三") public String getDiscountAmount() { return discountAmount; } public void setDiscountAmount(String discountAmount) { this.discountAmount = discountAmount; } public AlipayMerchantOrderSyncModel discountInfoList(List discountInfoList) { this.discountInfoList = discountInfoList; return this; } public AlipayMerchantOrderSyncModel addDiscountInfoListItem(DiscountInfoData discountInfoListItem) { if (this.discountInfoList == null) { this.discountInfoList = new ArrayList<>(); } this.discountInfoList.add(discountInfoListItem); return this; } /** * 订单优惠信息 * @return discountInfoList **/ @javax.annotation.Nullable @ApiModelProperty(value = "订单优惠信息") public List getDiscountInfoList() { return discountInfoList; } public void setDiscountInfoList(List discountInfoList) { this.discountInfoList = discountInfoList; } public AlipayMerchantOrderSyncModel extInfo(List extInfo) { this.extInfo = extInfo; return this; } public AlipayMerchantOrderSyncModel addExtInfoItem(OrderExtInfo extInfoItem) { if (this.extInfo == null) { this.extInfo = new ArrayList<>(); } this.extInfo.add(extInfoItem); return this; } /** * 扩展信息,请参见 <a href=\"https://opendocs.alipay.com/mini/04zsxt?pathHash=654d4f10\">小程序订单中心模板</a> * @return extInfo **/ @javax.annotation.Nullable @ApiModelProperty(value = "扩展信息,请参见 小程序订单中心模板") public List getExtInfo() { return extInfo; } public void setExtInfo(List extInfo) { this.extInfo = extInfo; } public AlipayMerchantOrderSyncModel itemOrderList(List itemOrderList) { this.itemOrderList = itemOrderList; return this; } public AlipayMerchantOrderSyncModel addItemOrderListItem(ItemOrderInfo itemOrderListItem) { if (this.itemOrderList == null) { this.itemOrderList = new ArrayList<>(); } this.itemOrderList.add(itemOrderListItem); return this; } /** * 商品信息列表 * @return itemOrderList **/ @javax.annotation.Nullable @ApiModelProperty(value = "商品信息列表") public List getItemOrderList() { return itemOrderList; } public void setItemOrderList(List itemOrderList) { this.itemOrderList = itemOrderList; } public AlipayMerchantOrderSyncModel journeyOrderList(List journeyOrderList) { this.journeyOrderList = journeyOrderList; return this; } public AlipayMerchantOrderSyncModel addJourneyOrderListItem(OrderJourneyInfo journeyOrderListItem) { if (this.journeyOrderList == null) { this.journeyOrderList = new ArrayList<>(); } this.journeyOrderList.add(journeyOrderListItem); return this; } /** * 行程信息 * @return journeyOrderList **/ @javax.annotation.Nullable @ApiModelProperty(value = "行程信息") public List getJourneyOrderList() { return journeyOrderList; } public void setJourneyOrderList(List journeyOrderList) { this.journeyOrderList = journeyOrderList; } public AlipayMerchantOrderSyncModel logisticsInfoList(List logisticsInfoList) { this.logisticsInfoList = logisticsInfoList; return this; } public AlipayMerchantOrderSyncModel addLogisticsInfoListItem(OrderLogisticsInformationRequest logisticsInfoListItem) { if (this.logisticsInfoList == null) { this.logisticsInfoList = new ArrayList<>(); } this.logisticsInfoList.add(logisticsInfoListItem); return this; } /** * 物流信息列表 * @return logisticsInfoList **/ @javax.annotation.Nullable @ApiModelProperty(value = "物流信息列表") public List getLogisticsInfoList() { return logisticsInfoList; } public void setLogisticsInfoList(List logisticsInfoList) { this.logisticsInfoList = logisticsInfoList; } public AlipayMerchantOrderSyncModel orderAuthCode(String orderAuthCode) { this.orderAuthCode = orderAuthCode; return this; } /** * 本字段已废弃,无需填写!(本字段已废弃 不再使用) * @return orderAuthCode * @deprecated **/ @Deprecated @javax.annotation.Nullable @ApiModelProperty(example = "DFSDLIGWGDF5SDLFA", value = "本字段已废弃,无需填写!(本字段已废弃 不再使用)") public String getOrderAuthCode() { return orderAuthCode; } public void setOrderAuthCode(String orderAuthCode) { this.orderAuthCode = orderAuthCode; } public AlipayMerchantOrderSyncModel orderCreateTime(String orderCreateTime) { this.orderCreateTime = orderCreateTime; return this; } /** * 订单创建时间 * @return orderCreateTime **/ @javax.annotation.Nullable @ApiModelProperty(example = "2020-01-01 08:00:00", value = "订单创建时间") public String getOrderCreateTime() { return orderCreateTime; } public void setOrderCreateTime(String orderCreateTime) { this.orderCreateTime = orderCreateTime; } public AlipayMerchantOrderSyncModel orderModifiedTime(String orderModifiedTime) { this.orderModifiedTime = orderModifiedTime; return this; } /** * 订单修改时间 * @return orderModifiedTime **/ @javax.annotation.Nullable @ApiModelProperty(example = "2020-01-01 08:00:01", value = "订单修改时间") public String getOrderModifiedTime() { return orderModifiedTime; } public void setOrderModifiedTime(String orderModifiedTime) { this.orderModifiedTime = orderModifiedTime; } public AlipayMerchantOrderSyncModel orderPayTime(String orderPayTime) { this.orderPayTime = orderPayTime; return this; } /** * 订单支付时间 * @return orderPayTime **/ @javax.annotation.Nullable @ApiModelProperty(example = "2020-01-02 08:00:00", value = "订单支付时间") public String getOrderPayTime() { return orderPayTime; } public void setOrderPayTime(String orderPayTime) { this.orderPayTime = orderPayTime; } public AlipayMerchantOrderSyncModel orderType(String orderType) { this.orderType = orderType; return this; } /** * 订单类型 * @return orderType **/ @javax.annotation.Nullable @ApiModelProperty(example = "SERVICE_ORDER", value = "订单类型") public String getOrderType() { return orderType; } public void setOrderType(String orderType) { this.orderType = orderType; } public AlipayMerchantOrderSyncModel outBizNo(String outBizNo) { this.outBizNo = outBizNo; return this; } /** * 外部订单号 out_biz_no唯一对应一笔订单,相同的订单需传入相同的out_biz_no * @return outBizNo **/ @javax.annotation.Nullable @ApiModelProperty(example = "1234", value = "外部订单号 out_biz_no唯一对应一笔订单,相同的订单需传入相同的out_biz_no") public String getOutBizNo() { return outBizNo; } public void setOutBizNo(String outBizNo) { this.outBizNo = outBizNo; } public AlipayMerchantOrderSyncModel partnerId(String partnerId) { this.partnerId = partnerId; return this; } /** * 交易对应的签约商户userId(注意:该字段自2020-02-16日起,可以不传入) * @return partnerId * @deprecated **/ @Deprecated @javax.annotation.Nullable @ApiModelProperty(example = "20880010xxxxxxxx", value = "交易对应的签约商户userId(注意:该字段自2020-02-16日起,可以不传入)") public String getPartnerId() { return partnerId; } public void setPartnerId(String partnerId) { this.partnerId = partnerId; } public AlipayMerchantOrderSyncModel payAmount(String payAmount) { this.payAmount = payAmount; return this; } /** * 用户应付金额 :用户最终结算时需要支付金额(不包含选择支付宝付款时,支付宝给予的优惠减免金额),单位为【元】</br> <a href=\"https://mdn.alipayobjects.com/portal_ykdvdu/afts/img/A*UuuWRpmekegAAAAAAAAAAAAAAQAAAQ/original\" target=\"_blank\">实际案例一</a> <br><a href=\"https://mdn.alipayobjects.com/portal_ykdvdu/afts/img/A*kBkOTZpqP40AAAAAAAAAAAAAAQAAAQ/original\" target=\"_blank\">实际案例二</a> <br><a href=\"https://mdn.alipayobjects.com/portal_ykdvdu/afts/img/A*ZpkjTJQlFVAAAAAAAAAAAAAAAQAAAQ/original\" target=\"_blank\">实际案例三</a> * @return payAmount **/ @javax.annotation.Nullable @ApiModelProperty(example = "9.99", value = "用户应付金额 :用户最终结算时需要支付金额(不包含选择支付宝付款时,支付宝给予的优惠减免金额),单位为【元】
实际案例一
实际案例二
实际案例三") public String getPayAmount() { return payAmount; } public void setPayAmount(String payAmount) { this.payAmount = payAmount; } public AlipayMerchantOrderSyncModel payTimeoutExpress(String payTimeoutExpress) { this.payTimeoutExpress = payTimeoutExpress; return this; } /** * 支付超时时间,超过时间支付宝自行关闭订单 * @return payTimeoutExpress **/ @javax.annotation.Nullable @ApiModelProperty(example = "15h", value = "支付超时时间,超过时间支付宝自行关闭订单") public String getPayTimeoutExpress() { return payTimeoutExpress; } public void setPayTimeoutExpress(String payTimeoutExpress) { this.payTimeoutExpress = payTimeoutExpress; } public AlipayMerchantOrderSyncModel recordId(String recordId) { this.recordId = recordId; return this; } /** * 商户订单同步记录id(仅部分存量接入和行业模板需要外,其他情况可以不传入) * @return recordId * @deprecated **/ @Deprecated @javax.annotation.Nullable @ApiModelProperty(example = "2019103000502300270200000001268074", value = "商户订单同步记录id(仅部分存量接入和行业模板需要外,其他情况可以不传入)") public String getRecordId() { return recordId; } public void setRecordId(String recordId) { this.recordId = recordId; } public AlipayMerchantOrderSyncModel sellerId(String sellerId) { this.sellerId = sellerId; return this; } /** * 卖家userId(注意:该字段自2020-02-16日起,可以不传入) * @return sellerId * @deprecated **/ @Deprecated @javax.annotation.Nullable @ApiModelProperty(example = "2088301176313427", value = "卖家userId(注意:该字段自2020-02-16日起,可以不传入)") public String getSellerId() { return sellerId; } public void setSellerId(String sellerId) { this.sellerId = sellerId; } public AlipayMerchantOrderSyncModel sendMsg(String sendMsg) { this.sendMsg = sendMsg; return this; } /** * 是否需要小程序订单代理发送模版消息。不传默认不发送 * @return sendMsg **/ @javax.annotation.Nullable @ApiModelProperty(example = "Y", value = "是否需要小程序订单代理发送模版消息。不传默认不发送") public String getSendMsg() { return sendMsg; } public void setSendMsg(String sendMsg) { this.sendMsg = sendMsg; } public AlipayMerchantOrderSyncModel serviceCode(String serviceCode) { this.serviceCode = serviceCode; return this; } /** * 服务code:传入小程序后台提报的服务id,将订单与服务关联,有利于提高服务曝光机会;入参服务id的类目须与订单类型相符,若不相符将会报错;如订单类型为“外卖”,则入参的服务ID所对应的服务类目也必须得是”外卖“;service_code 通过 <a href=\"https://opendocs.alipay.com/mini/e1c835a1_alipay.open.app.service.apply\" target=\"_blank\">alipay.open.app.service.apply</a> ,(服务提报申请)接口创建服务后获取。 * @return serviceCode **/ @javax.annotation.Nullable @ApiModelProperty(example = "2018072411000000099497", value = "服务code:传入小程序后台提报的服务id,将订单与服务关联,有利于提高服务曝光机会;入参服务id的类目须与订单类型相符,若不相符将会报错;如订单类型为“外卖”,则入参的服务ID所对应的服务类目也必须得是”外卖“;service_code 通过 alipay.open.app.service.apply ,(服务提报申请)接口创建服务后获取。") public String getServiceCode() { return serviceCode; } public void setServiceCode(String serviceCode) { this.serviceCode = serviceCode; } public AlipayMerchantOrderSyncModel shopInfo(OrderShopInfo shopInfo) { this.shopInfo = shopInfo; return this; } /** * Get shopInfo * @return shopInfo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public OrderShopInfo getShopInfo() { return shopInfo; } public void setShopInfo(OrderShopInfo shopInfo) { this.shopInfo = shopInfo; } public AlipayMerchantOrderSyncModel sourceApp(String sourceApp) { this.sourceApp = sourceApp; return this; } /** * 用于区分用户下单的订单来源 * @return sourceApp **/ @javax.annotation.Nullable @ApiModelProperty(example = "Alipay", value = "用于区分用户下单的订单来源") public String getSourceApp() { return sourceApp; } public void setSourceApp(String sourceApp) { this.sourceApp = sourceApp; } public AlipayMerchantOrderSyncModel syncContent(String syncContent) { this.syncContent = syncContent; return this; } /** * 同步内容 * @return syncContent **/ @javax.annotation.Nullable @ApiModelProperty(example = "ALL", value = "同步内容") public String getSyncContent() { return syncContent; } public void setSyncContent(String syncContent) { this.syncContent = syncContent; } public AlipayMerchantOrderSyncModel ticketInfo(TicketInfo ticketInfo) { this.ticketInfo = ticketInfo; return this; } /** * Get ticketInfo * @return ticketInfo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public TicketInfo getTicketInfo() { return ticketInfo; } public void setTicketInfo(TicketInfo ticketInfo) { this.ticketInfo = ticketInfo; } public AlipayMerchantOrderSyncModel ticketOrderList(List ticketOrderList) { this.ticketOrderList = ticketOrderList; return this; } public AlipayMerchantOrderSyncModel addTicketOrderListItem(TicketOrderInfo ticketOrderListItem) { if (this.ticketOrderList == null) { this.ticketOrderList = new ArrayList<>(); } this.ticketOrderList.add(ticketOrderListItem); return this; } /** * 凭证信息 * @return ticketOrderList **/ @javax.annotation.Nullable @ApiModelProperty(value = "凭证信息") public List getTicketOrderList() { return ticketOrderList; } public void setTicketOrderList(List ticketOrderList) { this.ticketOrderList = ticketOrderList; } public AlipayMerchantOrderSyncModel tradeNo(String tradeNo) { this.tradeNo = tradeNo; return this; } /** * 订单所对应的支付宝交易号 * @return tradeNo **/ @javax.annotation.Nullable @ApiModelProperty(example = "2019052322001400191000023731", value = "订单所对应的支付宝交易号") public String getTradeNo() { return tradeNo; } public void setTradeNo(String tradeNo) { this.tradeNo = tradeNo; } public AlipayMerchantOrderSyncModel tradeType(String tradeType) { this.tradeType = tradeType; return this; } /** * 交易号类型 * @return tradeType **/ @javax.annotation.Nullable @ApiModelProperty(example = "TRADE", value = "交易号类型") public String getTradeType() { return tradeType; } public void setTradeType(String tradeType) { this.tradeType = tradeType; } /** * 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 AlipayMerchantOrderSyncModel instance itself */ public AlipayMerchantOrderSyncModel 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; } AlipayMerchantOrderSyncModel alipayMerchantOrderSyncModel = (AlipayMerchantOrderSyncModel) o; return Objects.equals(this.amount, alipayMerchantOrderSyncModel.amount) && Objects.equals(this.buyerId, alipayMerchantOrderSyncModel.buyerId) && Objects.equals(this.buyerInfo, alipayMerchantOrderSyncModel.buyerInfo) && Objects.equals(this.buyerOpenId, alipayMerchantOrderSyncModel.buyerOpenId) && Objects.equals(this.categoryId, alipayMerchantOrderSyncModel.categoryId) && Objects.equals(this.discountAmount, alipayMerchantOrderSyncModel.discountAmount) && Objects.equals(this.discountInfoList, alipayMerchantOrderSyncModel.discountInfoList) && Objects.equals(this.extInfo, alipayMerchantOrderSyncModel.extInfo) && Objects.equals(this.itemOrderList, alipayMerchantOrderSyncModel.itemOrderList) && Objects.equals(this.journeyOrderList, alipayMerchantOrderSyncModel.journeyOrderList) && Objects.equals(this.logisticsInfoList, alipayMerchantOrderSyncModel.logisticsInfoList) && Objects.equals(this.orderAuthCode, alipayMerchantOrderSyncModel.orderAuthCode) && Objects.equals(this.orderCreateTime, alipayMerchantOrderSyncModel.orderCreateTime) && Objects.equals(this.orderModifiedTime, alipayMerchantOrderSyncModel.orderModifiedTime) && Objects.equals(this.orderPayTime, alipayMerchantOrderSyncModel.orderPayTime) && Objects.equals(this.orderType, alipayMerchantOrderSyncModel.orderType) && Objects.equals(this.outBizNo, alipayMerchantOrderSyncModel.outBizNo) && Objects.equals(this.partnerId, alipayMerchantOrderSyncModel.partnerId) && Objects.equals(this.payAmount, alipayMerchantOrderSyncModel.payAmount) && Objects.equals(this.payTimeoutExpress, alipayMerchantOrderSyncModel.payTimeoutExpress) && Objects.equals(this.recordId, alipayMerchantOrderSyncModel.recordId) && Objects.equals(this.sellerId, alipayMerchantOrderSyncModel.sellerId) && Objects.equals(this.sendMsg, alipayMerchantOrderSyncModel.sendMsg) && Objects.equals(this.serviceCode, alipayMerchantOrderSyncModel.serviceCode) && Objects.equals(this.shopInfo, alipayMerchantOrderSyncModel.shopInfo) && Objects.equals(this.sourceApp, alipayMerchantOrderSyncModel.sourceApp) && Objects.equals(this.syncContent, alipayMerchantOrderSyncModel.syncContent) && Objects.equals(this.ticketInfo, alipayMerchantOrderSyncModel.ticketInfo) && Objects.equals(this.ticketOrderList, alipayMerchantOrderSyncModel.ticketOrderList) && Objects.equals(this.tradeNo, alipayMerchantOrderSyncModel.tradeNo) && Objects.equals(this.tradeType, alipayMerchantOrderSyncModel.tradeType)&& Objects.equals(this.additionalProperties, alipayMerchantOrderSyncModel.additionalProperties); } @Override public int hashCode() { return Objects.hash(amount, buyerId, buyerInfo, buyerOpenId, categoryId, discountAmount, discountInfoList, extInfo, itemOrderList, journeyOrderList, logisticsInfoList, orderAuthCode, orderCreateTime, orderModifiedTime, orderPayTime, orderType, outBizNo, partnerId, payAmount, payTimeoutExpress, recordId, sellerId, sendMsg, serviceCode, shopInfo, sourceApp, syncContent, ticketInfo, ticketOrderList, tradeNo, tradeType, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AlipayMerchantOrderSyncModel {\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" buyerId: ").append(toIndentedString(buyerId)).append("\n"); sb.append(" buyerInfo: ").append(toIndentedString(buyerInfo)).append("\n"); sb.append(" buyerOpenId: ").append(toIndentedString(buyerOpenId)).append("\n"); sb.append(" categoryId: ").append(toIndentedString(categoryId)).append("\n"); sb.append(" discountAmount: ").append(toIndentedString(discountAmount)).append("\n"); sb.append(" discountInfoList: ").append(toIndentedString(discountInfoList)).append("\n"); sb.append(" extInfo: ").append(toIndentedString(extInfo)).append("\n"); sb.append(" itemOrderList: ").append(toIndentedString(itemOrderList)).append("\n"); sb.append(" journeyOrderList: ").append(toIndentedString(journeyOrderList)).append("\n"); sb.append(" logisticsInfoList: ").append(toIndentedString(logisticsInfoList)).append("\n"); sb.append(" orderAuthCode: ").append(toIndentedString(orderAuthCode)).append("\n"); sb.append(" orderCreateTime: ").append(toIndentedString(orderCreateTime)).append("\n"); sb.append(" orderModifiedTime: ").append(toIndentedString(orderModifiedTime)).append("\n"); sb.append(" orderPayTime: ").append(toIndentedString(orderPayTime)).append("\n"); sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); sb.append(" outBizNo: ").append(toIndentedString(outBizNo)).append("\n"); sb.append(" partnerId: ").append(toIndentedString(partnerId)).append("\n"); sb.append(" payAmount: ").append(toIndentedString(payAmount)).append("\n"); sb.append(" payTimeoutExpress: ").append(toIndentedString(payTimeoutExpress)).append("\n"); sb.append(" recordId: ").append(toIndentedString(recordId)).append("\n"); sb.append(" sellerId: ").append(toIndentedString(sellerId)).append("\n"); sb.append(" sendMsg: ").append(toIndentedString(sendMsg)).append("\n"); sb.append(" serviceCode: ").append(toIndentedString(serviceCode)).append("\n"); sb.append(" shopInfo: ").append(toIndentedString(shopInfo)).append("\n"); sb.append(" sourceApp: ").append(toIndentedString(sourceApp)).append("\n"); sb.append(" syncContent: ").append(toIndentedString(syncContent)).append("\n"); sb.append(" ticketInfo: ").append(toIndentedString(ticketInfo)).append("\n"); sb.append(" ticketOrderList: ").append(toIndentedString(ticketOrderList)).append("\n"); sb.append(" tradeNo: ").append(toIndentedString(tradeNo)).append("\n"); sb.append(" tradeType: ").append(toIndentedString(tradeType)).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("amount"); openapiFields.add("buyer_id"); openapiFields.add("buyer_info"); openapiFields.add("buyer_open_id"); openapiFields.add("category_id"); openapiFields.add("discount_amount"); openapiFields.add("discount_info_list"); openapiFields.add("ext_info"); openapiFields.add("item_order_list"); openapiFields.add("journey_order_list"); openapiFields.add("logistics_info_list"); openapiFields.add("order_auth_code"); openapiFields.add("order_create_time"); openapiFields.add("order_modified_time"); openapiFields.add("order_pay_time"); openapiFields.add("order_type"); openapiFields.add("out_biz_no"); openapiFields.add("partner_id"); openapiFields.add("pay_amount"); openapiFields.add("pay_timeout_express"); openapiFields.add("record_id"); openapiFields.add("seller_id"); openapiFields.add("send_msg"); openapiFields.add("service_code"); openapiFields.add("shop_info"); openapiFields.add("source_app"); openapiFields.add("sync_content"); openapiFields.add("ticket_info"); openapiFields.add("ticket_order_list"); openapiFields.add("trade_no"); openapiFields.add("trade_type"); // 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 AlipayMerchantOrderSyncModel */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { if (AlipayMerchantOrderSyncModel.openapiRequiredFields.isEmpty()) { return; } else { // has required fields throw new IllegalArgumentException(String.format("The required field(s) %s in AlipayMerchantOrderSyncModel is not found in the empty JSON string", AlipayMerchantOrderSyncModel.openapiRequiredFields.toString())); } } if (jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("amount").toString())); } if (jsonObj.get("buyer_id") != null && !jsonObj.get("buyer_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `buyer_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("buyer_id").toString())); } // validate the optional field `buyer_info` if (jsonObj.getAsJsonObject("buyer_info") != null) { UserInfomation.validateJsonObject(jsonObj.getAsJsonObject("buyer_info")); } 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("category_id") != null && !jsonObj.get("category_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `category_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("category_id").toString())); } if (jsonObj.get("discount_amount") != null && !jsonObj.get("discount_amount").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `discount_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("discount_amount").toString())); } JsonArray jsonArraydiscountInfoList = jsonObj.getAsJsonArray("discount_info_list"); if (jsonArraydiscountInfoList != null) { // ensure the json data is an array if (!jsonObj.get("discount_info_list").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `discount_info_list` to be an array in the JSON string but got `%s`", jsonObj.get("discount_info_list").toString())); } // validate the optional field `discount_info_list` (array) for (int i = 0; i < jsonArraydiscountInfoList.size(); i++) { DiscountInfoData.validateJsonObject(jsonArraydiscountInfoList.get(i).getAsJsonObject()); }; } JsonArray jsonArrayextInfo = jsonObj.getAsJsonArray("ext_info"); if (jsonArrayextInfo != null) { // ensure the json data is an array if (!jsonObj.get("ext_info").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `ext_info` to be an array in the JSON string but got `%s`", jsonObj.get("ext_info").toString())); } // validate the optional field `ext_info` (array) for (int i = 0; i < jsonArrayextInfo.size(); i++) { OrderExtInfo.validateJsonObject(jsonArrayextInfo.get(i).getAsJsonObject()); }; } JsonArray jsonArrayitemOrderList = jsonObj.getAsJsonArray("item_order_list"); if (jsonArrayitemOrderList != null) { // ensure the json data is an array if (!jsonObj.get("item_order_list").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `item_order_list` to be an array in the JSON string but got `%s`", jsonObj.get("item_order_list").toString())); } // validate the optional field `item_order_list` (array) for (int i = 0; i < jsonArrayitemOrderList.size(); i++) { ItemOrderInfo.validateJsonObject(jsonArrayitemOrderList.get(i).getAsJsonObject()); }; } JsonArray jsonArrayjourneyOrderList = jsonObj.getAsJsonArray("journey_order_list"); if (jsonArrayjourneyOrderList != null) { // ensure the json data is an array if (!jsonObj.get("journey_order_list").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `journey_order_list` to be an array in the JSON string but got `%s`", jsonObj.get("journey_order_list").toString())); } // validate the optional field `journey_order_list` (array) for (int i = 0; i < jsonArrayjourneyOrderList.size(); i++) { OrderJourneyInfo.validateJsonObject(jsonArrayjourneyOrderList.get(i).getAsJsonObject()); }; } JsonArray jsonArraylogisticsInfoList = jsonObj.getAsJsonArray("logistics_info_list"); if (jsonArraylogisticsInfoList != null) { // ensure the json data is an array if (!jsonObj.get("logistics_info_list").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `logistics_info_list` to be an array in the JSON string but got `%s`", jsonObj.get("logistics_info_list").toString())); } // validate the optional field `logistics_info_list` (array) for (int i = 0; i < jsonArraylogisticsInfoList.size(); i++) { OrderLogisticsInformationRequest.validateJsonObject(jsonArraylogisticsInfoList.get(i).getAsJsonObject()); }; } if (jsonObj.get("order_auth_code") != null && !jsonObj.get("order_auth_code").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `order_auth_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("order_auth_code").toString())); } if (jsonObj.get("order_create_time") != null && !jsonObj.get("order_create_time").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `order_create_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("order_create_time").toString())); } if (jsonObj.get("order_modified_time") != null && !jsonObj.get("order_modified_time").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `order_modified_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("order_modified_time").toString())); } if (jsonObj.get("order_pay_time") != null && !jsonObj.get("order_pay_time").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `order_pay_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("order_pay_time").toString())); } if (jsonObj.get("order_type") != null && !jsonObj.get("order_type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `order_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("order_type").toString())); } if (jsonObj.get("out_biz_no") != null && !jsonObj.get("out_biz_no").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `out_biz_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("out_biz_no").toString())); } if (jsonObj.get("partner_id") != null && !jsonObj.get("partner_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `partner_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("partner_id").toString())); } if (jsonObj.get("pay_amount") != null && !jsonObj.get("pay_amount").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `pay_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pay_amount").toString())); } if (jsonObj.get("pay_timeout_express") != null && !jsonObj.get("pay_timeout_express").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `pay_timeout_express` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pay_timeout_express").toString())); } if (jsonObj.get("record_id") != null && !jsonObj.get("record_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `record_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("record_id").toString())); } if (jsonObj.get("seller_id") != null && !jsonObj.get("seller_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `seller_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("seller_id").toString())); } if (jsonObj.get("send_msg") != null && !jsonObj.get("send_msg").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `send_msg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("send_msg").toString())); } if (jsonObj.get("service_code") != null && !jsonObj.get("service_code").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `service_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("service_code").toString())); } // validate the optional field `shop_info` if (jsonObj.getAsJsonObject("shop_info") != null) { OrderShopInfo.validateJsonObject(jsonObj.getAsJsonObject("shop_info")); } if (jsonObj.get("source_app") != null && !jsonObj.get("source_app").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `source_app` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source_app").toString())); } if (jsonObj.get("sync_content") != null && !jsonObj.get("sync_content").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `sync_content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sync_content").toString())); } // validate the optional field `ticket_info` if (jsonObj.getAsJsonObject("ticket_info") != null) { TicketInfo.validateJsonObject(jsonObj.getAsJsonObject("ticket_info")); } JsonArray jsonArrayticketOrderList = jsonObj.getAsJsonArray("ticket_order_list"); if (jsonArrayticketOrderList != null) { // ensure the json data is an array if (!jsonObj.get("ticket_order_list").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `ticket_order_list` to be an array in the JSON string but got `%s`", jsonObj.get("ticket_order_list").toString())); } // validate the optional field `ticket_order_list` (array) for (int i = 0; i < jsonArrayticketOrderList.size(); i++) { TicketOrderInfo.validateJsonObject(jsonArrayticketOrderList.get(i).getAsJsonObject()); }; } 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())); } if (jsonObj.get("trade_type") != null && !jsonObj.get("trade_type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `trade_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trade_type").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { if (!AlipayMerchantOrderSyncModel.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'AlipayMerchantOrderSyncModel' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(AlipayMerchantOrderSyncModel.class)); return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, AlipayMerchantOrderSyncModel 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 AlipayMerchantOrderSyncModel read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); // store additional fields in the deserialized instance AlipayMerchantOrderSyncModel 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 AlipayMerchantOrderSyncModel given an JSON string * * @param jsonString JSON string * @return An instance of AlipayMerchantOrderSyncModel * @throws IOException if the JSON string is invalid with respect to AlipayMerchantOrderSyncModel */ public static AlipayMerchantOrderSyncModel fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AlipayMerchantOrderSyncModel.class); } /** * Convert an instance of AlipayMerchantOrderSyncModel to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy