Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 支付宝开放平台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.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;
/**
* AlipayOpenAgentMobilepaySignModel
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AlipayOpenAgentMobilepaySignModel {
public static final String SERIALIZED_NAME_APP_MARKET = "app_market";
@SerializedName(SERIALIZED_NAME_APP_MARKET)
private List appMarket = null;
public static final String SERIALIZED_NAME_APP_NAME = "app_name";
@SerializedName(SERIALIZED_NAME_APP_NAME)
private String appName;
public static final String SERIALIZED_NAME_APP_STATUS = "app_status";
@SerializedName(SERIALIZED_NAME_APP_STATUS)
private String appStatus;
public static final String SERIALIZED_NAME_APP_TEST_ACCOUNT = "app_test_account";
@SerializedName(SERIALIZED_NAME_APP_TEST_ACCOUNT)
private String appTestAccount;
public static final String SERIALIZED_NAME_APP_TEST_ACCOUNT_PASSWORD = "app_test_account_password";
@SerializedName(SERIALIZED_NAME_APP_TEST_ACCOUNT_PASSWORD)
private String appTestAccountPassword;
public static final String SERIALIZED_NAME_APP_TYPE = "app_type";
@SerializedName(SERIALIZED_NAME_APP_TYPE)
private List appType = null;
public static final String SERIALIZED_NAME_BATCH_NO = "batch_no";
@SerializedName(SERIALIZED_NAME_BATCH_NO)
private String batchNo;
public static final String SERIALIZED_NAME_BUSINESS_LICENSE_MOBILE = "business_license_mobile";
@SerializedName(SERIALIZED_NAME_BUSINESS_LICENSE_MOBILE)
private String businessLicenseMobile;
public static final String SERIALIZED_NAME_BUSINESS_LICENSE_NO = "business_license_no";
@SerializedName(SERIALIZED_NAME_BUSINESS_LICENSE_NO)
private String businessLicenseNo;
public static final String SERIALIZED_NAME_DATE_LIMITATION = "date_limitation";
@SerializedName(SERIALIZED_NAME_DATE_LIMITATION)
private String dateLimitation;
public static final String SERIALIZED_NAME_DOWNLOAD_LINK = "download_link";
@SerializedName(SERIALIZED_NAME_DOWNLOAD_LINK)
private String downloadLink;
public static final String SERIALIZED_NAME_LONG_TERM = "long_term";
@SerializedName(SERIALIZED_NAME_LONG_TERM)
private Boolean longTerm;
public static final String SERIALIZED_NAME_MCC_CODE = "mcc_code";
@SerializedName(SERIALIZED_NAME_MCC_CODE)
private String mccCode;
public static final String SERIALIZED_NAME_MOBILE_TYPE = "mobile_type";
@SerializedName(SERIALIZED_NAME_MOBILE_TYPE)
private String mobileType;
public static final String SERIALIZED_NAME_TRADE_SCENE = "trade_scene";
@SerializedName(SERIALIZED_NAME_TRADE_SCENE)
private String tradeScene;
public AlipayOpenAgentMobilepaySignModel() {
}
public AlipayOpenAgentMobilepaySignModel appMarket(List appMarket) {
this.appMarket = appMarket;
return this;
}
public AlipayOpenAgentMobilepaySignModel addAppMarketItem(String appMarketItem) {
if (this.appMarket == null) {
this.appMarket = new ArrayList<>();
}
this.appMarket.add(appMarketItem);
return this;
}
/**
* 应用在哪些市场上架,枚举值为:苹果,应用宝,华为,360,小米,豌豆荚,其他
* @return appMarket
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "应用宝", value = "应用在哪些市场上架,枚举值为:苹果,应用宝,华为,360,小米,豌豆荚,其他")
public List getAppMarket() {
return appMarket;
}
public void setAppMarket(List appMarket) {
this.appMarket = appMarket;
}
public AlipayOpenAgentMobilepaySignModel appName(String appName) {
this.appName = appName;
return this;
}
/**
* 商户的APP应用名称
* @return appName
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "应用名称", value = "商户的APP应用名称")
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public AlipayOpenAgentMobilepaySignModel appStatus(String appStatus) {
this.appStatus = appStatus;
return this;
}
/**
* 应用上架状态,枚举值为 已上线,未上线
* @return appStatus
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "ONLINE", value = "应用上架状态,枚举值为 已上线,未上线")
public String getAppStatus() {
return appStatus;
}
public void setAppStatus(String appStatus) {
this.appStatus = appStatus;
}
public AlipayOpenAgentMobilepaySignModel appTestAccount(String appTestAccount) {
this.appTestAccount = appTestAccount;
return this;
}
/**
* 可以登录该应用的测试账户
* @return appTestAccount
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "testAccount", value = "可以登录该应用的测试账户")
public String getAppTestAccount() {
return appTestAccount;
}
public void setAppTestAccount(String appTestAccount) {
this.appTestAccount = appTestAccount;
}
public AlipayOpenAgentMobilepaySignModel appTestAccountPassword(String appTestAccountPassword) {
this.appTestAccountPassword = appTestAccountPassword;
return this;
}
/**
* 可以登录此应用的账户的密码。对应app_test_account的登录密码
* @return appTestAccountPassword
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "testPassword", value = "可以登录此应用的账户的密码。对应app_test_account的登录密码")
public String getAppTestAccountPassword() {
return appTestAccountPassword;
}
public void setAppTestAccountPassword(String appTestAccountPassword) {
this.appTestAccountPassword = appTestAccountPassword;
}
public AlipayOpenAgentMobilepaySignModel appType(List appType) {
this.appType = appType;
return this;
}
public AlipayOpenAgentMobilepaySignModel addAppTypeItem(String appTypeItem) {
if (this.appType == null) {
this.appType = new ArrayList<>();
}
this.appType.add(appTypeItem);
return this;
}
/**
* 应用类型,枚举值为:IOS,安卓
* @return appType
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "安卓", value = "应用类型,枚举值为:IOS,安卓")
public List getAppType() {
return appType;
}
public void setAppType(List appType) {
this.appType = appType;
}
public AlipayOpenAgentMobilepaySignModel batchNo(String batchNo) {
this.batchNo = batchNo;
return this;
}
/**
* 代商户操作事务编号,通过alipay.open.isv.agent.create接口进行创建。
* @return batchNo
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "2017110616474516400082883", value = "代商户操作事务编号,通过alipay.open.isv.agent.create接口进行创建。")
public String getBatchNo() {
return batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
public AlipayOpenAgentMobilepaySignModel businessLicenseMobile(String businessLicenseMobile) {
this.businessLicenseMobile = businessLicenseMobile;
return this;
}
/**
* 营业执照法人手机号码
* @return businessLicenseMobile
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "13189652239", value = "营业执照法人手机号码")
public String getBusinessLicenseMobile() {
return businessLicenseMobile;
}
public void setBusinessLicenseMobile(String businessLicenseMobile) {
this.businessLicenseMobile = businessLicenseMobile;
}
public AlipayOpenAgentMobilepaySignModel businessLicenseNo(String businessLicenseNo) {
this.businessLicenseNo = businessLicenseNo;
return this;
}
/**
* 营业执照号码。
* @return businessLicenseNo
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "1532501100006302", value = "营业执照号码。")
public String getBusinessLicenseNo() {
return businessLicenseNo;
}
public void setBusinessLicenseNo(String businessLicenseNo) {
this.businessLicenseNo = businessLicenseNo;
}
public AlipayOpenAgentMobilepaySignModel dateLimitation(String dateLimitation) {
this.dateLimitation = dateLimitation;
return this;
}
/**
* 营业期限
* @return dateLimitation
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "2017-11-11", value = "营业期限")
public String getDateLimitation() {
return dateLimitation;
}
public void setDateLimitation(String dateLimitation) {
this.dateLimitation = dateLimitation;
}
public AlipayOpenAgentMobilepaySignModel downloadLink(String downloadLink) {
this.downloadLink = downloadLink;
return this;
}
/**
* 应用下载链接
* @return downloadLink
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "http://demo.com/demo.apk", value = "应用下载链接")
public String getDownloadLink() {
return downloadLink;
}
public void setDownloadLink(String downloadLink) {
this.downloadLink = downloadLink;
}
public AlipayOpenAgentMobilepaySignModel longTerm(Boolean longTerm) {
this.longTerm = longTerm;
return this;
}
/**
* 营业期限是否长期有效
* @return longTerm
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "true", value = "营业期限是否长期有效")
public Boolean getLongTerm() {
return longTerm;
}
public void setLongTerm(Boolean longTerm) {
this.longTerm = longTerm;
}
public AlipayOpenAgentMobilepaySignModel mccCode(String mccCode) {
this.mccCode = mccCode;
return this;
}
/**
* 所属MCCCode,详情可参考 <a href=\"https://opendocs.alipay.com/open/01n22g#%E5%95%86%E5%AE%B6%E7%BB%8F%E8%90%A5%E7%B1%BB%E7%9B%AE\">商家经营类目</a> 中的“经营类目编码”
* @return mccCode
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "A_A03_4582", value = "所属MCCCode,详情可参考 商家经营类目 中的“经营类目编码”")
public String getMccCode() {
return mccCode;
}
public void setMccCode(String mccCode) {
this.mccCode = mccCode;
}
public AlipayOpenAgentMobilepaySignModel mobileType(String mobileType) {
this.mobileType = mobileType;
return this;
}
/**
* 传参:APP,代表设备类型是APP
* @return mobileType
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "APP", value = "传参:APP,代表设备类型是APP")
public String getMobileType() {
return mobileType;
}
public void setMobileType(String mobileType) {
this.mobileType = mobileType;
}
public AlipayOpenAgentMobilepaySignModel tradeScene(String tradeScene) {
this.tradeScene = tradeScene;
return this;
}
/**
* 传参:mobile,代表交易场景是移动设备
* @return tradeScene
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "mobile", value = "传参:mobile,代表交易场景是移动设备")
public String getTradeScene() {
return tradeScene;
}
public void setTradeScene(String tradeScene) {
this.tradeScene = tradeScene;
}
/**
* 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 AlipayOpenAgentMobilepaySignModel instance itself
*/
public AlipayOpenAgentMobilepaySignModel 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;
}
AlipayOpenAgentMobilepaySignModel alipayOpenAgentMobilepaySignModel = (AlipayOpenAgentMobilepaySignModel) o;
return Objects.equals(this.appMarket, alipayOpenAgentMobilepaySignModel.appMarket) &&
Objects.equals(this.appName, alipayOpenAgentMobilepaySignModel.appName) &&
Objects.equals(this.appStatus, alipayOpenAgentMobilepaySignModel.appStatus) &&
Objects.equals(this.appTestAccount, alipayOpenAgentMobilepaySignModel.appTestAccount) &&
Objects.equals(this.appTestAccountPassword, alipayOpenAgentMobilepaySignModel.appTestAccountPassword) &&
Objects.equals(this.appType, alipayOpenAgentMobilepaySignModel.appType) &&
Objects.equals(this.batchNo, alipayOpenAgentMobilepaySignModel.batchNo) &&
Objects.equals(this.businessLicenseMobile, alipayOpenAgentMobilepaySignModel.businessLicenseMobile) &&
Objects.equals(this.businessLicenseNo, alipayOpenAgentMobilepaySignModel.businessLicenseNo) &&
Objects.equals(this.dateLimitation, alipayOpenAgentMobilepaySignModel.dateLimitation) &&
Objects.equals(this.downloadLink, alipayOpenAgentMobilepaySignModel.downloadLink) &&
Objects.equals(this.longTerm, alipayOpenAgentMobilepaySignModel.longTerm) &&
Objects.equals(this.mccCode, alipayOpenAgentMobilepaySignModel.mccCode) &&
Objects.equals(this.mobileType, alipayOpenAgentMobilepaySignModel.mobileType) &&
Objects.equals(this.tradeScene, alipayOpenAgentMobilepaySignModel.tradeScene)&&
Objects.equals(this.additionalProperties, alipayOpenAgentMobilepaySignModel.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(appMarket, appName, appStatus, appTestAccount, appTestAccountPassword, appType, batchNo, businessLicenseMobile, businessLicenseNo, dateLimitation, downloadLink, longTerm, mccCode, mobileType, tradeScene, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AlipayOpenAgentMobilepaySignModel {\n");
sb.append(" appMarket: ").append(toIndentedString(appMarket)).append("\n");
sb.append(" appName: ").append(toIndentedString(appName)).append("\n");
sb.append(" appStatus: ").append(toIndentedString(appStatus)).append("\n");
sb.append(" appTestAccount: ").append(toIndentedString(appTestAccount)).append("\n");
sb.append(" appTestAccountPassword: ").append(toIndentedString(appTestAccountPassword)).append("\n");
sb.append(" appType: ").append(toIndentedString(appType)).append("\n");
sb.append(" batchNo: ").append(toIndentedString(batchNo)).append("\n");
sb.append(" businessLicenseMobile: ").append(toIndentedString(businessLicenseMobile)).append("\n");
sb.append(" businessLicenseNo: ").append(toIndentedString(businessLicenseNo)).append("\n");
sb.append(" dateLimitation: ").append(toIndentedString(dateLimitation)).append("\n");
sb.append(" downloadLink: ").append(toIndentedString(downloadLink)).append("\n");
sb.append(" longTerm: ").append(toIndentedString(longTerm)).append("\n");
sb.append(" mccCode: ").append(toIndentedString(mccCode)).append("\n");
sb.append(" mobileType: ").append(toIndentedString(mobileType)).append("\n");
sb.append(" tradeScene: ").append(toIndentedString(tradeScene)).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("app_market");
openapiFields.add("app_name");
openapiFields.add("app_status");
openapiFields.add("app_test_account");
openapiFields.add("app_test_account_password");
openapiFields.add("app_type");
openapiFields.add("batch_no");
openapiFields.add("business_license_mobile");
openapiFields.add("business_license_no");
openapiFields.add("date_limitation");
openapiFields.add("download_link");
openapiFields.add("long_term");
openapiFields.add("mcc_code");
openapiFields.add("mobile_type");
openapiFields.add("trade_scene");
// 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 AlipayOpenAgentMobilepaySignModel
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (AlipayOpenAgentMobilepaySignModel.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
throw new IllegalArgumentException(String.format("The required field(s) %s in AlipayOpenAgentMobilepaySignModel is not found in the empty JSON string", AlipayOpenAgentMobilepaySignModel.openapiRequiredFields.toString()));
}
}
// ensure the json data is an array
if (jsonObj.get("app_market") != null && !jsonObj.get("app_market").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `app_market` to be an array in the JSON string but got `%s`", jsonObj.get("app_market").toString()));
}
if (jsonObj.get("app_name") != null && !jsonObj.get("app_name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `app_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("app_name").toString()));
}
if (jsonObj.get("app_status") != null && !jsonObj.get("app_status").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `app_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("app_status").toString()));
}
if (jsonObj.get("app_test_account") != null && !jsonObj.get("app_test_account").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `app_test_account` to be a primitive type in the JSON string but got `%s`", jsonObj.get("app_test_account").toString()));
}
if (jsonObj.get("app_test_account_password") != null && !jsonObj.get("app_test_account_password").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `app_test_account_password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("app_test_account_password").toString()));
}
// ensure the json data is an array
if (jsonObj.get("app_type") != null && !jsonObj.get("app_type").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `app_type` to be an array in the JSON string but got `%s`", jsonObj.get("app_type").toString()));
}
if (jsonObj.get("batch_no") != null && !jsonObj.get("batch_no").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `batch_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("batch_no").toString()));
}
if (jsonObj.get("business_license_mobile") != null && !jsonObj.get("business_license_mobile").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `business_license_mobile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("business_license_mobile").toString()));
}
if (jsonObj.get("business_license_no") != null && !jsonObj.get("business_license_no").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `business_license_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("business_license_no").toString()));
}
if (jsonObj.get("date_limitation") != null && !jsonObj.get("date_limitation").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `date_limitation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("date_limitation").toString()));
}
if (jsonObj.get("download_link") != null && !jsonObj.get("download_link").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `download_link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("download_link").toString()));
}
if (jsonObj.get("mcc_code") != null && !jsonObj.get("mcc_code").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `mcc_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc_code").toString()));
}
if (jsonObj.get("mobile_type") != null && !jsonObj.get("mobile_type").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `mobile_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile_type").toString()));
}
if (jsonObj.get("trade_scene") != null && !jsonObj.get("trade_scene").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `trade_scene` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trade_scene").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
if (!AlipayOpenAgentMobilepaySignModel.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'AlipayOpenAgentMobilepaySignModel' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(AlipayOpenAgentMobilepaySignModel.class));
return (TypeAdapter) new TypeAdapter() {
@Override
public void write(JsonWriter out, AlipayOpenAgentMobilepaySignModel 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 AlipayOpenAgentMobilepaySignModel read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
// store additional fields in the deserialized instance
AlipayOpenAgentMobilepaySignModel 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 AlipayOpenAgentMobilepaySignModel given an JSON string
*
* @param jsonString JSON string
* @return An instance of AlipayOpenAgentMobilepaySignModel
* @throws IOException if the JSON string is invalid with respect to AlipayOpenAgentMobilepaySignModel
*/
public static AlipayOpenAgentMobilepaySignModel fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, AlipayOpenAgentMobilepaySignModel.class);
}
/**
* Convert an instance of AlipayOpenAgentMobilepaySignModel to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}