content: /*
   * 支付宝开放平台API
   * 支付宝开放平台v3协议文档
   *
   * The version of the OpenAPI document: 2025-08-26
   * 
   *
   * 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;
  
  /**
   * AlipayUserAgreementUnsignModel
   */
  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
  public class AlipayUserAgreementUnsignModel {
    public static final String SERIALIZED_NAME_AGREEMENT_NO = "agreement_no";
    @SerializedName(SERIALIZED_NAME_AGREEMENT_NO)
    private String agreementNo;
  
    public static final String SERIALIZED_NAME_ALIPAY_LOGON_ID = "alipay_logon_id";
    @SerializedName(SERIALIZED_NAME_ALIPAY_LOGON_ID)
    private String alipayLogonId;
  
    public static final String SERIALIZED_NAME_ALIPAY_OPEN_ID = "alipay_open_id";
    @SerializedName(SERIALIZED_NAME_ALIPAY_OPEN_ID)
    private String alipayOpenId;
  
    public static final String SERIALIZED_NAME_ALIPAY_USER_ID = "alipay_user_id";
    @SerializedName(SERIALIZED_NAME_ALIPAY_USER_ID)
    private String alipayUserId;
  
    public static final String SERIALIZED_NAME_EXTEND_PARAMS = "extend_params";
    @SerializedName(SERIALIZED_NAME_EXTEND_PARAMS)
    private String extendParams;
  
    public static final String SERIALIZED_NAME_EXTERNAL_AGREEMENT_NO = "external_agreement_no";
    @SerializedName(SERIALIZED_NAME_EXTERNAL_AGREEMENT_NO)
    private String externalAgreementNo;
  
    public static final String SERIALIZED_NAME_NOTIFY_URL = "notify_url";
    @SerializedName(SERIALIZED_NAME_NOTIFY_URL)
    private String notifyUrl;
  
    public static final String SERIALIZED_NAME_OPERATE_TYPE = "operate_type";
    @SerializedName(SERIALIZED_NAME_OPERATE_TYPE)
    private String operateType;
  
    public static final String SERIALIZED_NAME_PERSONAL_PRODUCT_CODE = "personal_product_code";
    @SerializedName(SERIALIZED_NAME_PERSONAL_PRODUCT_CODE)
    private String personalProductCode;
  
    public static final String SERIALIZED_NAME_SIGN_SCENE = "sign_scene";
    @SerializedName(SERIALIZED_NAME_SIGN_SCENE)
    private String signScene;
  
    public static final String SERIALIZED_NAME_THIRD_PARTY_TYPE = "third_party_type";
    @SerializedName(SERIALIZED_NAME_THIRD_PARTY_TYPE)
    private String thirdPartyType;
  
    public AlipayUserAgreementUnsignModel() { 
    }
  
    public AlipayUserAgreementUnsignModel agreementNo(String agreementNo) {
      
      this.agreementNo = agreementNo;
      return this;
    }
  
     /**
     * 支付宝系统中用以唯一标识用户签约记录的编号（用户签约成功后的协议号 ），如果传了该参数，其他参数会被忽略 。 本参数与 external_agreement_no 不可同时为空。
     * @return agreementNo
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "20170322450983769228", value = "支付宝系统中用以唯一标识用户签约记录的编号（用户签约成功后的协议号 ），如果传了该参数，其他参数会被忽略 。 本参数与 external_agreement_no 不可同时为空。")
  
    public String getAgreementNo() {
      return agreementNo;
    }
  
  
    public void setAgreementNo(String agreementNo) {
      this.agreementNo = agreementNo;
    }
  
  
    public AlipayUserAgreementUnsignModel alipayLogonId(String alipayLogonId) {
      
      this.alipayLogonId = alipayLogonId;
      return this;
    }
  
     /**
     * 用户的支付宝登录账号，支持邮箱或手机号码格式。本参数与alipay_user_id 不可同时为空，若都填写，则以alipay_user_id 为准。
     * @return alipayLogonId
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "abx@alitest.com", value = "用户的支付宝登录账号，支持邮箱或手机号码格式。本参数与alipay_user_id 不可同时为空，若都填写，则以alipay_user_id 为准。")
  
    public String getAlipayLogonId() {
      return alipayLogonId;
    }
  
  
    public void setAlipayLogonId(String alipayLogonId) {
      this.alipayLogonId = alipayLogonId;
    }
  
  
    public AlipayUserAgreementUnsignModel alipayOpenId(String alipayOpenId) {
      
      this.alipayOpenId = alipayOpenId;
      return this;
    }
  
     /**
     * 用户的支付宝账号对应的支付宝唯一用户号， 本参数与alipay_logon_id 不可同时为空，若都填写，则以本参数为准，优先级高于alipay_logon_id。
     * @return alipayOpenId
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "074a1CcTG1LelxKe4xQC0zgNdId0nxi95b5lsNpazWYoCo5", value = "用户的支付宝账号对应的支付宝唯一用户号， 本参数与alipay_logon_id 不可同时为空，若都填写，则以本参数为准，优先级高于alipay_logon_id。")
  
    public String getAlipayOpenId() {
      return alipayOpenId;
    }
  
  
    public void setAlipayOpenId(String alipayOpenId) {
      this.alipayOpenId = alipayOpenId;
    }
  
  
    public AlipayUserAgreementUnsignModel alipayUserId(String alipayUserId) {
      
      this.alipayUserId = alipayUserId;
      return this;
    }
  
     /**
     * 用户的支付宝账号对应的支付宝唯一用户号，以2088 开头的 16 位纯数字 组成;  本参数与alipay_logon_id 不可同时为空，若都填写，则以本参数为准，优先级高于alipay_logon_id。
     * @return alipayUserId
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "2088101143488930", value = "用户的支付宝账号对应的支付宝唯一用户号，以2088 开头的 16 位纯数字 组成;  本参数与alipay_logon_id 不可同时为空，若都填写，则以本参数为准，优先级高于alipay_logon_id。")
  
    public String getAlipayUserId() {
      return alipayUserId;
    }
  
  
    public void setAlipayUserId(String alipayUserId) {
      this.alipayUserId = alipayUserId;
    }
  
  
    public AlipayUserAgreementUnsignModel extendParams(String extendParams) {
      
      this.extendParams = extendParams;
      return this;
    }
  
     /**
     * 扩展参数
     * @return extendParams
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "{\"UNSIGN_ERROR_CODE\": \"USER_OWE_MONEY\",\"UNSIGN_ERROR_INFO\":\"10.00\"}", value = "扩展参数")
  
    public String getExtendParams() {
      return extendParams;
    }
  
  
    public void setExtendParams(String extendParams) {
      this.extendParams = extendParams;
    }
  
  
    public AlipayUserAgreementUnsignModel externalAgreementNo(String externalAgreementNo) {
      
      this.externalAgreementNo = externalAgreementNo;
      return this;
    }
  
     /**
     * 代扣协议中标示用户的唯一签约号(确保在商户系统中 唯一)。 格式规则:支持大写小写字母和数字，最长 32 位。 注意：若调用 alipay.user.agreement.page.sign(支付宝个人协议页面签约接口) 签约时传入 external_agreement_no 则该值必填且需与签约接口传入值相同。
     * @return externalAgreementNo
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "test", value = "代扣协议中标示用户的唯一签约号(确保在商户系统中 唯一)。 格式规则:支持大写小写字母和数字，最长 32 位。 注意：若调用 alipay.user.agreement.page.sign(支付宝个人协议页面签约接口) 签约时传入 external_agreement_no 则该值必填且需与签约接口传入值相同。")
  
    public String getExternalAgreementNo() {
      return externalAgreementNo;
    }
  
  
    public void setExternalAgreementNo(String externalAgreementNo) {
      this.externalAgreementNo = externalAgreementNo;
    }
  
  
    public AlipayUserAgreementUnsignModel notifyUrl(String notifyUrl) {
      
      this.notifyUrl = notifyUrl;
      return this;
    }
  
     /**
     * 通知地址
     * @return notifyUrl
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "通知地址")
  
    public String getNotifyUrl() {
      return notifyUrl;
    }
  
  
    public void setNotifyUrl(String notifyUrl) {
      this.notifyUrl = notifyUrl;
    }
  
  
    public AlipayUserAgreementUnsignModel operateType(String operateType) {
      
      this.operateType = operateType;
      return this;
    }
  
     /**
     * 注意：仅异步解约需传入，其余情况无需传递本参数。
     * @return operateType
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "confirm", value = "注意：仅异步解约需传入，其余情况无需传递本参数。")
  
    public String getOperateType() {
      return operateType;
    }
  
  
    public void setOperateType(String operateType) {
      this.operateType = operateType;
    }
  
  
    public AlipayUserAgreementUnsignModel personalProductCode(String personalProductCode) {
      
      this.personalProductCode = personalProductCode;
      return this;
    }
  
     /**
     * 协议产品码，商户和支付宝签约时确定，不同业务场景对应不同的签约产品码。
     * @return personalProductCode
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "GENERAL_WITHHOLDING_P", value = "协议产品码，商户和支付宝签约时确定，不同业务场景对应不同的签约产品码。")
  
    public String getPersonalProductCode() {
      return personalProductCode;
    }
  
  
    public void setPersonalProductCode(String personalProductCode) {
      this.personalProductCode = personalProductCode;
    }
  
  
    public AlipayUserAgreementUnsignModel signScene(String signScene) {
      
      this.signScene = signScene;
      return this;
    }
  
     /**
     * 签约协议场景，该值需要与系统/页面签约接口调用时传入的值保持一 致。如：周期扣款场景，需与调用 alipay.user.agreement.page.sign(支付宝个人协议页面签约接口) 签约时的 sign_scene 相同。 当传入商户签约号 external_agreement_no时，场景不能为空或默认值 DEFAULT|DEFAULT。 
     * @return signScene
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "INDUSTRY|MEDICA", value = "签约协议场景，该值需要与系统/页面签约接口调用时传入的值保持一 致。如：周期扣款场景，需与调用 alipay.user.agreement.page.sign(支付宝个人协议页面签约接口) 签约时的 sign_scene 相同。 当传入商户签约号 external_agreement_no时，场景不能为空或默认值 DEFAULT|DEFAULT。 ")
  
    public String getSignScene() {
      return signScene;
    }
  
  
    public void setSignScene(String signScene) {
      this.signScene = signScene;
    }
  
  
    public AlipayUserAgreementUnsignModel thirdPartyType(String thirdPartyType) {
      
      this.thirdPartyType = thirdPartyType;
      return this;
    }
  
     /**
     * 签约第三方主体类型。对于三方协议，表示当前用户和哪一类的第三方主体进行签约。
     * @return thirdPartyType
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "PARTNER", value = "签约第三方主体类型。对于三方协议，表示当前用户和哪一类的第三方主体进行签约。")
  
    public String getThirdPartyType() {
      return thirdPartyType;
    }
  
  
    public void setThirdPartyType(String thirdPartyType) {
      this.thirdPartyType = thirdPartyType;
    }
  
    /**
     * 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<String, Object> 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 AlipayUserAgreementUnsignModel instance itself
     */
    public AlipayUserAgreementUnsignModel putAdditionalProperty(String key, Object value) {
      if (this.additionalProperties == null) {
          this.additionalProperties = new HashMap<String, Object>();
      }
      this.additionalProperties.put(key, value);
      return this;
    }
  
    /**
     * Return the additional (undeclared) property.
     *
     * @return a map of objects
     */
    public Map<String, Object> 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;
      }
      AlipayUserAgreementUnsignModel alipayUserAgreementUnsignModel = (AlipayUserAgreementUnsignModel) o;
      return Objects.equals(this.agreementNo, alipayUserAgreementUnsignModel.agreementNo) &&
          Objects.equals(this.alipayLogonId, alipayUserAgreementUnsignModel.alipayLogonId) &&
          Objects.equals(this.alipayOpenId, alipayUserAgreementUnsignModel.alipayOpenId) &&
          Objects.equals(this.alipayUserId, alipayUserAgreementUnsignModel.alipayUserId) &&
          Objects.equals(this.extendParams, alipayUserAgreementUnsignModel.extendParams) &&
          Objects.equals(this.externalAgreementNo, alipayUserAgreementUnsignModel.externalAgreementNo) &&
          Objects.equals(this.notifyUrl, alipayUserAgreementUnsignModel.notifyUrl) &&
          Objects.equals(this.operateType, alipayUserAgreementUnsignModel.operateType) &&
          Objects.equals(this.personalProductCode, alipayUserAgreementUnsignModel.personalProductCode) &&
          Objects.equals(this.signScene, alipayUserAgreementUnsignModel.signScene) &&
          Objects.equals(this.thirdPartyType, alipayUserAgreementUnsignModel.thirdPartyType)&&
          Objects.equals(this.additionalProperties, alipayUserAgreementUnsignModel.additionalProperties);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(agreementNo, alipayLogonId, alipayOpenId, alipayUserId, extendParams, externalAgreementNo, notifyUrl, operateType, personalProductCode, signScene, thirdPartyType, additionalProperties);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class AlipayUserAgreementUnsignModel {\n");
      sb.append("    agreementNo: ").append(toIndentedString(agreementNo)).append("\n");
      sb.append("    alipayLogonId: ").append(toIndentedString(alipayLogonId)).append("\n");
      sb.append("    alipayOpenId: ").append(toIndentedString(alipayOpenId)).append("\n");
      sb.append("    alipayUserId: ").append(toIndentedString(alipayUserId)).append("\n");
      sb.append("    extendParams: ").append(toIndentedString(extendParams)).append("\n");
      sb.append("    externalAgreementNo: ").append(toIndentedString(externalAgreementNo)).append("\n");
      sb.append("    notifyUrl: ").append(toIndentedString(notifyUrl)).append("\n");
      sb.append("    operateType: ").append(toIndentedString(operateType)).append("\n");
      sb.append("    personalProductCode: ").append(toIndentedString(personalProductCode)).append("\n");
      sb.append("    signScene: ").append(toIndentedString(signScene)).append("\n");
      sb.append("    thirdPartyType: ").append(toIndentedString(thirdPartyType)).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<String> openapiFields;
    public static HashSet<String> openapiRequiredFields;
  
    static {
      // a set of all properties/fields (JSON key names)
      openapiFields = new HashSet<String>();
      openapiFields.add("agreement_no");
      openapiFields.add("alipay_logon_id");
      openapiFields.add("alipay_open_id");
      openapiFields.add("alipay_user_id");
      openapiFields.add("extend_params");
      openapiFields.add("external_agreement_no");
      openapiFields.add("notify_url");
      openapiFields.add("operate_type");
      openapiFields.add("personal_product_code");
      openapiFields.add("sign_scene");
      openapiFields.add("third_party_type");
  
      // a set of required properties/fields (JSON key names)
      openapiRequiredFields = new HashSet<String>();
    }
  
   /**
    * 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 AlipayUserAgreementUnsignModel
    */
    public static void validateJsonObject(JsonObject jsonObj) throws IOException {
        if (jsonObj == null) {
          if (AlipayUserAgreementUnsignModel.openapiRequiredFields.isEmpty()) {
            return;
          } else { // has required fields
            throw new IllegalArgumentException(String.format("The required field(s) %s in AlipayUserAgreementUnsignModel is not found in the empty JSON string", AlipayUserAgreementUnsignModel.openapiRequiredFields.toString()));
          }
        }
        if (jsonObj.get("agreement_no") != null && !jsonObj.get("agreement_no").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `agreement_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("agreement_no").toString()));
        }
        if (jsonObj.get("alipay_logon_id") != null && !jsonObj.get("alipay_logon_id").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `alipay_logon_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alipay_logon_id").toString()));
        }
        if (jsonObj.get("alipay_open_id") != null && !jsonObj.get("alipay_open_id").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `alipay_open_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alipay_open_id").toString()));
        }
        if (jsonObj.get("alipay_user_id") != null && !jsonObj.get("alipay_user_id").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `alipay_user_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alipay_user_id").toString()));
        }
        if (jsonObj.get("extend_params") != null && !jsonObj.get("extend_params").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `extend_params` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extend_params").toString()));
        }
        if (jsonObj.get("external_agreement_no") != null && !jsonObj.get("external_agreement_no").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `external_agreement_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("external_agreement_no").toString()));
        }
        if (jsonObj.get("notify_url") != null && !jsonObj.get("notify_url").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `notify_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notify_url").toString()));
        }
        if (jsonObj.get("operate_type") != null && !jsonObj.get("operate_type").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `operate_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operate_type").toString()));
        }
        if (jsonObj.get("personal_product_code") != null && !jsonObj.get("personal_product_code").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `personal_product_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("personal_product_code").toString()));
        }
        if (jsonObj.get("sign_scene") != null && !jsonObj.get("sign_scene").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `sign_scene` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sign_scene").toString()));
        }
        if (jsonObj.get("third_party_type") != null && !jsonObj.get("third_party_type").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `third_party_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("third_party_type").toString()));
        }
    }
  
    public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
      @SuppressWarnings("unchecked")
      @Override
      public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
         if (!AlipayUserAgreementUnsignModel.class.isAssignableFrom(type.getRawType())) {
           return null; // this class only serializes 'AlipayUserAgreementUnsignModel' and its subtypes
         }
         final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
         final TypeAdapter<AlipayUserAgreementUnsignModel> thisAdapter
                          = gson.getDelegateAdapter(this, TypeToken.get(AlipayUserAgreementUnsignModel.class));
  
         return (TypeAdapter<T>) new TypeAdapter<AlipayUserAgreementUnsignModel>() {
             @Override
             public void write(JsonWriter out, AlipayUserAgreementUnsignModel value) throws IOException {
               JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
               obj.remove("additionalProperties");
               // serialize additonal properties
               if (value.getAdditionalProperties() != null) {
                 for (Map.Entry<String, Object> 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 AlipayUserAgreementUnsignModel read(JsonReader in) throws IOException {
               JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
               validateJsonObject(jsonObj);
               // store additional fields in the deserialized instance
               AlipayUserAgreementUnsignModel instance = thisAdapter.fromJsonTree(jsonObj);
               for (Map.Entry<String, JsonElement> 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 AlipayUserAgreementUnsignModel given an JSON string
    *
    * @param jsonString JSON string
    * @return An instance of AlipayUserAgreementUnsignModel
    * @throws IOException if the JSON string is invalid with respect to AlipayUserAgreementUnsignModel
    */
    public static AlipayUserAgreementUnsignModel fromJson(String jsonString) throws IOException {
      return JSON.getGson().fromJson(jsonString, AlipayUserAgreementUnsignModel.class);
    }
  
   /**
    * Convert an instance of AlipayUserAgreementUnsignModel to an JSON string
    *
    * @return JSON string
    */
    public String toJson() {
      return JSON.getGson().toJson(this);
    }
  }
  
  