com.alipay.v3.model.AlipayOpenFeeAdjustApplyModel 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.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 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;
/**
* AlipayOpenFeeAdjustApplyModel
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AlipayOpenFeeAdjustApplyModel {
public static final String SERIALIZED_NAME_ACCOUNT = "account";
@SerializedName(SERIALIZED_NAME_ACCOUNT)
private String account;
public static final String SERIALIZED_NAME_APPLICATION_FEE = "application_fee";
@SerializedName(SERIALIZED_NAME_APPLICATION_FEE)
private String applicationFee;
public static final String SERIALIZED_NAME_CERT_DATE_LIMITATION = "cert_date_limitation";
@SerializedName(SERIALIZED_NAME_CERT_DATE_LIMITATION)
private String certDateLimitation;
public static final String SERIALIZED_NAME_CERT_NO = "cert_no";
@SerializedName(SERIALIZED_NAME_CERT_NO)
private String certNo;
public static final String SERIALIZED_NAME_CERT_TYPE = "cert_type";
@SerializedName(SERIALIZED_NAME_CERT_TYPE)
private String certType;
public static final String SERIALIZED_NAME_CITY_CODE = "city_code";
@SerializedName(SERIALIZED_NAME_CITY_CODE)
private String cityCode;
public static final String SERIALIZED_NAME_DETAIL_ADDRESS = "detail_address";
@SerializedName(SERIALIZED_NAME_DETAIL_ADDRESS)
private String detailAddress;
public static final String SERIALIZED_NAME_DISTRICT_CODE = "district_code";
@SerializedName(SERIALIZED_NAME_DISTRICT_CODE)
private String districtCode;
public static final String SERIALIZED_NAME_PRODUCT_CODE = "product_code";
@SerializedName(SERIALIZED_NAME_PRODUCT_CODE)
private String productCode;
public static final String SERIALIZED_NAME_PROVINCE_CODE = "province_code";
@SerializedName(SERIALIZED_NAME_PROVINCE_CODE)
private String provinceCode;
public AlipayOpenFeeAdjustApplyModel() {
}
public AlipayOpenFeeAdjustApplyModel account(String account) {
this.account = account;
return this;
}
/**
* 服务商代申请特殊费率的商家支付宝账户
* @return account
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "[email protected]", value = "服务商代申请特殊费率的商家支付宝账户")
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public AlipayOpenFeeAdjustApplyModel applicationFee(String applicationFee) {
this.applicationFee = applicationFee;
return this;
}
/**
* 服务商代商家申请特殊费率的费率值(%),如0.38表示0.38%
* @return applicationFee
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "0.38", value = "服务商代商家申请特殊费率的费率值(%),如0.38表示0.38%")
public String getApplicationFee() {
return applicationFee;
}
public void setApplicationFee(String applicationFee) {
this.applicationFee = applicationFee;
}
public AlipayOpenFeeAdjustApplyModel certDateLimitation(String certDateLimitation) {
this.certDateLimitation = certDateLimitation;
return this;
}
/**
* 证件有效期,格式:yyyy-MM-dd,长期有效传入:9999-12-31
* @return certDateLimitation
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "2023-01-01", value = "证件有效期,格式:yyyy-MM-dd,长期有效传入:9999-12-31")
public String getCertDateLimitation() {
return certDateLimitation;
}
public void setCertDateLimitation(String certDateLimitation) {
this.certDateLimitation = certDateLimitation;
}
public AlipayOpenFeeAdjustApplyModel certNo(String certNo) {
this.certNo = certNo;
return this;
}
/**
* 对应证件类型(certType)的证件号,如营业执照为营业执照号
* @return certNo
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "1532501100006302", value = "对应证件类型(certType)的证件号,如营业执照为营业执照号")
public String getCertNo() {
return certNo;
}
public void setCertNo(String certNo) {
this.certNo = certNo;
}
public AlipayOpenFeeAdjustApplyModel certType(String certType) {
this.certType = certType;
return this;
}
/**
* 证件类型,枚举值为 餐饮服务许可证 FOOD_SERVICE_LICENSE, 食品卫生许可证 FOOD_HEALTH_LICENSE, 食品经营许可证 FOOD_BUSINESS_LICENSE, 食品流通许可证 FOOD_CIRCULATE_LICENSE, 食品生产许可证 FOOD_PRODUCTION_LICENS, 营业执照 DEFAULT_LICENSE, 烟草资质 TOBACCO_PRODUCTION_LICENSE
* @return certType
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "DEFAULT_LICENSE", value = "证件类型,枚举值为 餐饮服务许可证 FOOD_SERVICE_LICENSE, 食品卫生许可证 FOOD_HEALTH_LICENSE, 食品经营许可证 FOOD_BUSINESS_LICENSE, 食品流通许可证 FOOD_CIRCULATE_LICENSE, 食品生产许可证 FOOD_PRODUCTION_LICENS, 营业执照 DEFAULT_LICENSE, 烟草资质 TOBACCO_PRODUCTION_LICENSE")
public String getCertType() {
return certType;
}
public void setCertType(String certType) {
this.certType = certType;
}
public AlipayOpenFeeAdjustApplyModel cityCode(String cityCode) {
this.cityCode = cityCode;
return this;
}
/**
* 市
* @return cityCode
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "370900", value = "市")
public String getCityCode() {
return cityCode;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
public AlipayOpenFeeAdjustApplyModel detailAddress(String detailAddress) {
this.detailAddress = detailAddress;
return this;
}
/**
* 详细地址
* @return detailAddress
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "人民路10号", value = "详细地址")
public String getDetailAddress() {
return detailAddress;
}
public void setDetailAddress(String detailAddress) {
this.detailAddress = detailAddress;
}
public AlipayOpenFeeAdjustApplyModel districtCode(String districtCode) {
this.districtCode = districtCode;
return this;
}
/**
* 区/县
* @return districtCode
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "370902", value = "区/县")
public String getDistrictCode() {
return districtCode;
}
public void setDistrictCode(String districtCode) {
this.districtCode = districtCode;
}
public AlipayOpenFeeAdjustApplyModel productCode(String productCode) {
this.productCode = productCode;
return this;
}
/**
* 服务商代商家申请调整费率的产品码
* @return productCode
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "FACE_TO_FACE_PAYMENT", value = "服务商代商家申请调整费率的产品码")
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public AlipayOpenFeeAdjustApplyModel provinceCode(String provinceCode) {
this.provinceCode = provinceCode;
return this;
}
/**
* 省份
* @return provinceCode
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "370000", value = "省份")
public String getProvinceCode() {
return provinceCode;
}
public void setProvinceCode(String provinceCode) {
this.provinceCode = provinceCode;
}
/**
* 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 AlipayOpenFeeAdjustApplyModel instance itself
*/
public AlipayOpenFeeAdjustApplyModel 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;
}
AlipayOpenFeeAdjustApplyModel alipayOpenFeeAdjustApplyModel = (AlipayOpenFeeAdjustApplyModel) o;
return Objects.equals(this.account, alipayOpenFeeAdjustApplyModel.account) &&
Objects.equals(this.applicationFee, alipayOpenFeeAdjustApplyModel.applicationFee) &&
Objects.equals(this.certDateLimitation, alipayOpenFeeAdjustApplyModel.certDateLimitation) &&
Objects.equals(this.certNo, alipayOpenFeeAdjustApplyModel.certNo) &&
Objects.equals(this.certType, alipayOpenFeeAdjustApplyModel.certType) &&
Objects.equals(this.cityCode, alipayOpenFeeAdjustApplyModel.cityCode) &&
Objects.equals(this.detailAddress, alipayOpenFeeAdjustApplyModel.detailAddress) &&
Objects.equals(this.districtCode, alipayOpenFeeAdjustApplyModel.districtCode) &&
Objects.equals(this.productCode, alipayOpenFeeAdjustApplyModel.productCode) &&
Objects.equals(this.provinceCode, alipayOpenFeeAdjustApplyModel.provinceCode)&&
Objects.equals(this.additionalProperties, alipayOpenFeeAdjustApplyModel.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(account, applicationFee, certDateLimitation, certNo, certType, cityCode, detailAddress, districtCode, productCode, provinceCode, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AlipayOpenFeeAdjustApplyModel {\n");
sb.append(" account: ").append(toIndentedString(account)).append("\n");
sb.append(" applicationFee: ").append(toIndentedString(applicationFee)).append("\n");
sb.append(" certDateLimitation: ").append(toIndentedString(certDateLimitation)).append("\n");
sb.append(" certNo: ").append(toIndentedString(certNo)).append("\n");
sb.append(" certType: ").append(toIndentedString(certType)).append("\n");
sb.append(" cityCode: ").append(toIndentedString(cityCode)).append("\n");
sb.append(" detailAddress: ").append(toIndentedString(detailAddress)).append("\n");
sb.append(" districtCode: ").append(toIndentedString(districtCode)).append("\n");
sb.append(" productCode: ").append(toIndentedString(productCode)).append("\n");
sb.append(" provinceCode: ").append(toIndentedString(provinceCode)).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("account");
openapiFields.add("application_fee");
openapiFields.add("cert_date_limitation");
openapiFields.add("cert_no");
openapiFields.add("cert_type");
openapiFields.add("city_code");
openapiFields.add("detail_address");
openapiFields.add("district_code");
openapiFields.add("product_code");
openapiFields.add("province_code");
// 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 AlipayOpenFeeAdjustApplyModel
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (AlipayOpenFeeAdjustApplyModel.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
throw new IllegalArgumentException(String.format("The required field(s) %s in AlipayOpenFeeAdjustApplyModel is not found in the empty JSON string", AlipayOpenFeeAdjustApplyModel.openapiRequiredFields.toString()));
}
}
if (jsonObj.get("account") != null && !jsonObj.get("account").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `account` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account").toString()));
}
if (jsonObj.get("application_fee") != null && !jsonObj.get("application_fee").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `application_fee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("application_fee").toString()));
}
if (jsonObj.get("cert_date_limitation") != null && !jsonObj.get("cert_date_limitation").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `cert_date_limitation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cert_date_limitation").toString()));
}
if (jsonObj.get("cert_no") != null && !jsonObj.get("cert_no").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `cert_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cert_no").toString()));
}
if (jsonObj.get("cert_type") != null && !jsonObj.get("cert_type").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `cert_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cert_type").toString()));
}
if (jsonObj.get("city_code") != null && !jsonObj.get("city_code").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `city_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("city_code").toString()));
}
if (jsonObj.get("detail_address") != null && !jsonObj.get("detail_address").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `detail_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detail_address").toString()));
}
if (jsonObj.get("district_code") != null && !jsonObj.get("district_code").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `district_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("district_code").toString()));
}
if (jsonObj.get("product_code") != null && !jsonObj.get("product_code").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `product_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("product_code").toString()));
}
if (jsonObj.get("province_code") != null && !jsonObj.get("province_code").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `province_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("province_code").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
if (!AlipayOpenFeeAdjustApplyModel.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'AlipayOpenFeeAdjustApplyModel' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(AlipayOpenFeeAdjustApplyModel.class));
return (TypeAdapter) new TypeAdapter() {
@Override
public void write(JsonWriter out, AlipayOpenFeeAdjustApplyModel 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 AlipayOpenFeeAdjustApplyModel read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
// store additional fields in the deserialized instance
AlipayOpenFeeAdjustApplyModel 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 AlipayOpenFeeAdjustApplyModel given an JSON string
*
* @param jsonString JSON string
* @return An instance of AlipayOpenFeeAdjustApplyModel
* @throws IOException if the JSON string is invalid with respect to AlipayOpenFeeAdjustApplyModel
*/
public static AlipayOpenFeeAdjustApplyModel fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, AlipayOpenFeeAdjustApplyModel.class);
}
/**
* Convert an instance of AlipayOpenFeeAdjustApplyModel to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}