com.alipay.v3.model.SettleDetailInfo Maven / Gradle / Ivy
/*
* 支付宝开放平台API
* 支付宝开放平台v3协议文档
*
* The version of the OpenAPI document: 2022-12-23
*
*
* 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.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.io.Serializable;
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;
/**
* SettleDetailInfo
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class SettleDetailInfo {
private static final long serialVersionUID = 1L;
public static final String SERIALIZED_NAME_AMOUNT = "amount";
@SerializedName(SERIALIZED_NAME_AMOUNT)
private String amount;
public static final String SERIALIZED_NAME_SETTLE_ENTITY_ID = "settle_entity_id";
@SerializedName(SERIALIZED_NAME_SETTLE_ENTITY_ID)
private String settleEntityId;
public static final String SERIALIZED_NAME_SETTLE_ENTITY_TYPE = "settle_entity_type";
@SerializedName(SERIALIZED_NAME_SETTLE_ENTITY_TYPE)
private String settleEntityType;
public static final String SERIALIZED_NAME_SUMMARY_DIMENSION = "summary_dimension";
@SerializedName(SERIALIZED_NAME_SUMMARY_DIMENSION)
private String summaryDimension;
public static final String SERIALIZED_NAME_TRANS_IN = "trans_in";
@SerializedName(SERIALIZED_NAME_TRANS_IN)
private String transIn;
public static final String SERIALIZED_NAME_TRANS_IN_TYPE = "trans_in_type";
@SerializedName(SERIALIZED_NAME_TRANS_IN_TYPE)
private String transInType;
public SettleDetailInfo() {
}
public SettleDetailInfo amount(String amount) {
this.amount = amount;
return this;
}
/**
* 结算的金额,单位为元。在创建订单和支付接口时必须和交易金额相同。在结算确认接口时必须等于交易金额减去已退款金额。
* @return amount
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "结算的金额,单位为元。在创建订单和支付接口时必须和交易金额相同。在结算确认接口时必须等于交易金额减去已退款金额。")
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
public SettleDetailInfo settleEntityId(String settleEntityId) {
this.settleEntityId = settleEntityId;
return this;
}
/**
* 结算主体标识。当结算主体类型为SecondMerchant时,为二级商户的SecondMerchantID;当结算主体类型为Store时,为门店的外标。
* @return settleEntityId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "结算主体标识。当结算主体类型为SecondMerchant时,为二级商户的SecondMerchantID;当结算主体类型为Store时,为门店的外标。")
public String getSettleEntityId() {
return settleEntityId;
}
public void setSettleEntityId(String settleEntityId) {
this.settleEntityId = settleEntityId;
}
public SettleDetailInfo settleEntityType(String settleEntityType) {
this.settleEntityType = settleEntityType;
return this;
}
/**
* 结算主体类型。 二级商户:SecondMerchant;商户或者直连商户门店:Store
* @return settleEntityType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "结算主体类型。 二级商户:SecondMerchant;商户或者直连商户门店:Store")
public String getSettleEntityType() {
return settleEntityType;
}
public void setSettleEntityType(String settleEntityType) {
this.settleEntityType = settleEntityType;
}
public SettleDetailInfo summaryDimension(String summaryDimension) {
this.summaryDimension = summaryDimension;
return this;
}
/**
* 结算汇总维度,按照这个维度汇总成批次结算,由商户指定。 目前需要和结算收款方账户类型为cardAliasNo配合使用
* @return summaryDimension
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "结算汇总维度,按照这个维度汇总成批次结算,由商户指定。 目前需要和结算收款方账户类型为cardAliasNo配合使用")
public String getSummaryDimension() {
return summaryDimension;
}
public void setSummaryDimension(String summaryDimension) {
this.summaryDimension = summaryDimension;
}
public SettleDetailInfo transIn(String transIn) {
this.transIn = transIn;
return this;
}
/**
* 结算收款方。当结算收款方类型是cardAliasNo时,本参数为用户在支付宝绑定的卡编号;结算收款方类型是userId时,本参数为用户的支付宝账号对应的支付宝唯一用户号,以2088开头的纯16位数字;当结算收款方类型是loginName时,本参数为用户的支付宝登录号;当结算收款方类型是defaultSettle时,本参数不能传值,保持为空。
* @return transIn
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "结算收款方。当结算收款方类型是cardAliasNo时,本参数为用户在支付宝绑定的卡编号;结算收款方类型是userId时,本参数为用户的支付宝账号对应的支付宝唯一用户号,以2088开头的纯16位数字;当结算收款方类型是loginName时,本参数为用户的支付宝登录号;当结算收款方类型是defaultSettle时,本参数不能传值,保持为空。")
public String getTransIn() {
return transIn;
}
public void setTransIn(String transIn) {
this.transIn = transIn;
}
public SettleDetailInfo transInType(String transInType) {
this.transInType = transInType;
return this;
}
/**
* 结算收款方的账户类型。 cardAliasNo:结算收款方的银行卡编号; userId:表示是支付宝账号对应的支付宝唯一用户号; loginName:表示是支付宝登录号; defaultSettle:表示结算到商户进件时设置的默认结算账号,结算主体为门店时不支持传defaultSettle;
* @return transInType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "结算收款方的账户类型。 cardAliasNo:结算收款方的银行卡编号; userId:表示是支付宝账号对应的支付宝唯一用户号; loginName:表示是支付宝登录号; defaultSettle:表示结算到商户进件时设置的默认结算账号,结算主体为门店时不支持传defaultSettle;")
public String getTransInType() {
return transInType;
}
public void setTransInType(String transInType) {
this.transInType = transInType;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SettleDetailInfo settleDetailInfo = (SettleDetailInfo) o;
return Objects.equals(this.amount, settleDetailInfo.amount) &&
Objects.equals(this.settleEntityId, settleDetailInfo.settleEntityId) &&
Objects.equals(this.settleEntityType, settleDetailInfo.settleEntityType) &&
Objects.equals(this.summaryDimension, settleDetailInfo.summaryDimension) &&
Objects.equals(this.transIn, settleDetailInfo.transIn) &&
Objects.equals(this.transInType, settleDetailInfo.transInType);
}
@Override
public int hashCode() {
return Objects.hash(amount, settleEntityId, settleEntityType, summaryDimension, transIn, transInType);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SettleDetailInfo {\n");
sb.append(" amount: ").append(toIndentedString(amount)).append("\n");
sb.append(" settleEntityId: ").append(toIndentedString(settleEntityId)).append("\n");
sb.append(" settleEntityType: ").append(toIndentedString(settleEntityType)).append("\n");
sb.append(" summaryDimension: ").append(toIndentedString(summaryDimension)).append("\n");
sb.append(" transIn: ").append(toIndentedString(transIn)).append("\n");
sb.append(" transInType: ").append(toIndentedString(transInType)).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("settle_entity_id");
openapiFields.add("settle_entity_type");
openapiFields.add("summary_dimension");
openapiFields.add("trans_in");
openapiFields.add("trans_in_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 SettleDetailInfo
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (SettleDetailInfo.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
throw new IllegalArgumentException(String.format("The required field(s) %s in SettleDetailInfo is not found in the empty JSON string", SettleDetailInfo.openapiRequiredFields.toString()));
}
}
Set> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry entry : entries) {
if (!SettleDetailInfo.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SettleDetailInfo` properties. JSON: %s", entry.getKey(), jsonObj.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("settle_entity_id") != null && !jsonObj.get("settle_entity_id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `settle_entity_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("settle_entity_id").toString()));
}
if (jsonObj.get("settle_entity_type") != null && !jsonObj.get("settle_entity_type").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `settle_entity_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("settle_entity_type").toString()));
}
if (jsonObj.get("summary_dimension") != null && !jsonObj.get("summary_dimension").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `summary_dimension` to be a primitive type in the JSON string but got `%s`", jsonObj.get("summary_dimension").toString()));
}
if (jsonObj.get("trans_in") != null && !jsonObj.get("trans_in").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `trans_in` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trans_in").toString()));
}
if (jsonObj.get("trans_in_type") != null && !jsonObj.get("trans_in_type").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `trans_in_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trans_in_type").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
if (!SettleDetailInfo.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'SettleDetailInfo' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(SettleDetailInfo.class));
return (TypeAdapter) new TypeAdapter() {
@Override
public void write(JsonWriter out, SettleDetailInfo value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public SettleDetailInfo read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of SettleDetailInfo given an JSON string
*
* @param jsonString JSON string
* @return An instance of SettleDetailInfo
* @throws IOException if the JSON string is invalid with respect to SettleDetailInfo
*/
public static SettleDetailInfo fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, SettleDetailInfo.class);
}
/**
* Convert an instance of SettleDetailInfo to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}