content: /*
   * 支付宝开放平台API
   * 支付宝开放平台v3协议文档
   *
   * The version of the OpenAPI document: 2024-01-10
   * 
   *
   * 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;
  
  /**
   * OpenidComplex
   */
  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
  public class OpenidComplex {
    public static final String SERIALIZED_NAME_APPID_ONE = "appid_one";
    @SerializedName(SERIALIZED_NAME_APPID_ONE)
    private String appidOne;
  
    public static final String SERIALIZED_NAME_JSON_STRING = "json_string";
    @SerializedName(SERIALIZED_NAME_JSON_STRING)
    private String jsonString;
  
    public static final String SERIALIZED_NAME_OPEN_ID_LIST = "open_id_list";
    @SerializedName(SERIALIZED_NAME_OPEN_ID_LIST)
    private List<String> openIdList = null;
  
    public static final String SERIALIZED_NAME_OPENID = "openid";
    @SerializedName(SERIALIZED_NAME_OPENID)
    private String openid;
  
    public static final String SERIALIZED_NAME_UID = "uid";
    @SerializedName(SERIALIZED_NAME_UID)
    private String uid;
  
    public static final String SERIALIZED_NAME_UID_LIST = "uid_list";
    @SerializedName(SERIALIZED_NAME_UID_LIST)
    private List<String> uidList = null;
  
    public OpenidComplex() { 
    }
  
    public OpenidComplex appidOne(String appidOne) {
      
      this.appidOne = appidOne;
      return this;
    }
  
     /**
     * 1
     * @return appidOne
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "1", value = "1")
  
    public String getAppidOne() {
      return appidOne;
    }
  
  
    public void setAppidOne(String appidOne) {
      this.appidOne = appidOne;
    }
  
  
    public OpenidComplex jsonString(String jsonString) {
      
      this.jsonString = jsonString;
      return this;
    }
  
     /**
     * 11
     * @return jsonString
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "{}", value = "11")
  
    public String getJsonString() {
      return jsonString;
    }
  
  
    public void setJsonString(String jsonString) {
      this.jsonString = jsonString;
    }
  
  
    public OpenidComplex openIdList(List<String> openIdList) {
      
      this.openIdList = openIdList;
      return this;
    }
  
    public OpenidComplex addOpenIdListItem(String openIdListItem) {
      if (this.openIdList == null) {
        this.openIdList = new ArrayList<>();
      }
      this.openIdList.add(openIdListItem);
      return this;
    }
  
     /**
     * 1
     * @return openIdList
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "[\"074a1CcTG1LelxKe4xQC0zgNdId0nxi95b5lsNpazWYoCo5\"]", value = "1")
  
    public List<String> getOpenIdList() {
      return openIdList;
    }
  
  
    public void setOpenIdList(List<String> openIdList) {
      this.openIdList = openIdList;
    }
  
  
    public OpenidComplex openid(String openid) {
      
      this.openid = openid;
      return this;
    }
  
     /**
     * 11
     * @return openid
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "074a1CcTG1LelxKe4xQC0zgNdId0nxi95b5lsNpazWYoCo5", value = "11")
  
    public String getOpenid() {
      return openid;
    }
  
  
    public void setOpenid(String openid) {
      this.openid = openid;
    }
  
  
    public OpenidComplex uid(String uid) {
      
      this.uid = uid;
      return this;
    }
  
     /**
     * 11
     * @return uid
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "2088502241306951", value = "11")
  
    public String getUid() {
      return uid;
    }
  
  
    public void setUid(String uid) {
      this.uid = uid;
    }
  
  
    public OpenidComplex uidList(List<String> uidList) {
      
      this.uidList = uidList;
      return this;
    }
  
    public OpenidComplex addUidListItem(String uidListItem) {
      if (this.uidList == null) {
        this.uidList = new ArrayList<>();
      }
      this.uidList.add(uidListItem);
      return this;
    }
  
     /**
     * 1
     * @return uidList
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "[\"2088502241306951\"]", value = "1")
  
    public List<String> getUidList() {
      return uidList;
    }
  
  
    public void setUidList(List<String> uidList) {
      this.uidList = uidList;
    }
  
  
  
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      OpenidComplex openidComplex = (OpenidComplex) o;
      return Objects.equals(this.appidOne, openidComplex.appidOne) &&
          Objects.equals(this.jsonString, openidComplex.jsonString) &&
          Objects.equals(this.openIdList, openidComplex.openIdList) &&
          Objects.equals(this.openid, openidComplex.openid) &&
          Objects.equals(this.uid, openidComplex.uid) &&
          Objects.equals(this.uidList, openidComplex.uidList);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(appidOne, jsonString, openIdList, openid, uid, uidList);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class OpenidComplex {\n");
      sb.append("    appidOne: ").append(toIndentedString(appidOne)).append("\n");
      sb.append("    jsonString: ").append(toIndentedString(jsonString)).append("\n");
      sb.append("    openIdList: ").append(toIndentedString(openIdList)).append("\n");
      sb.append("    openid: ").append(toIndentedString(openid)).append("\n");
      sb.append("    uid: ").append(toIndentedString(uid)).append("\n");
      sb.append("    uidList: ").append(toIndentedString(uidList)).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("appid_one");
      openapiFields.add("json_string");
      openapiFields.add("open_id_list");
      openapiFields.add("openid");
      openapiFields.add("uid");
      openapiFields.add("uid_list");
  
      // 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 OpenidComplex
    */
    public static void validateJsonObject(JsonObject jsonObj) throws IOException {
        if (jsonObj == null) {
          if (OpenidComplex.openapiRequiredFields.isEmpty()) {
            return;
          } else { // has required fields
            throw new IllegalArgumentException(String.format("The required field(s) %s in OpenidComplex is not found in the empty JSON string", OpenidComplex.openapiRequiredFields.toString()));
          }
        }
  
        Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
        // check to see if the JSON string contains additional fields
        for (Entry<String, JsonElement> entry : entries) {
          if (!OpenidComplex.openapiFields.contains(entry.getKey())) {
            throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenidComplex` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
          }
        }
        if (jsonObj.get("appid_one") != null && !jsonObj.get("appid_one").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `appid_one` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appid_one").toString()));
        }
        if (jsonObj.get("json_string") != null && !jsonObj.get("json_string").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `json_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("json_string").toString()));
        }
        // ensure the json data is an array
        if (jsonObj.get("open_id_list") != null && !jsonObj.get("open_id_list").isJsonArray()) {
          throw new IllegalArgumentException(String.format("Expected the field `open_id_list` to be an array in the JSON string but got `%s`", jsonObj.get("open_id_list").toString()));
        }
        if (jsonObj.get("openid") != null && !jsonObj.get("openid").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `openid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openid").toString()));
        }
        if (jsonObj.get("uid") != null && !jsonObj.get("uid").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uid").toString()));
        }
        // ensure the json data is an array
        if (jsonObj.get("uid_list") != null && !jsonObj.get("uid_list").isJsonArray()) {
          throw new IllegalArgumentException(String.format("Expected the field `uid_list` to be an array in the JSON string but got `%s`", jsonObj.get("uid_list").toString()));
        }
    }
  
    public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
      @SuppressWarnings("unchecked")
      @Override
      public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
         if (!OpenidComplex.class.isAssignableFrom(type.getRawType())) {
           return null; // this class only serializes 'OpenidComplex' and its subtypes
         }
         final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
         final TypeAdapter<OpenidComplex> thisAdapter
                          = gson.getDelegateAdapter(this, TypeToken.get(OpenidComplex.class));
  
         return (TypeAdapter<T>) new TypeAdapter<OpenidComplex>() {
             @Override
             public void write(JsonWriter out, OpenidComplex value) throws IOException {
               JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
               elementAdapter.write(out, obj);
             }
  
             @Override
             public OpenidComplex read(JsonReader in) throws IOException {
               JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
               validateJsonObject(jsonObj);
               return thisAdapter.fromJsonTree(jsonObj);
             }
  
         }.nullSafe();
      }
    }
  
   /**
    * Create an instance of OpenidComplex given an JSON string
    *
    * @param jsonString JSON string
    * @return An instance of OpenidComplex
    * @throws IOException if the JSON string is invalid with respect to OpenidComplex
    */
    public static OpenidComplex fromJson(String jsonString) throws IOException {
      return JSON.getGson().fromJson(jsonString, OpenidComplex.class);
    }
  
   /**
    * Convert an instance of OpenidComplex to an JSON string
    *
    * @return JSON string
    */
    public String toJson() {
      return JSON.getGson().toJson(this);
    }
  }
  
  