/*
 * Oceanengine Open Api
 * 巨量引擎开放平台 Open Api
 *
 * The version of the OpenAPI document: 1.1.19
 * 
 *
 * 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.bytedance.ads.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 java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

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 com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import com.bytedance.ads.JSON;

/**
 * 线索信息
 */
@javax.annotation.Generated(value = "com.org.bytedance.ad_open_sdk.JavacusGenerator", date = "2024-09-10T15:29:00.246104612+08:00[Asia/Shanghai]")
public class ToolsCluePrivateMessageCallbackV2RequestClueData {
  public static final String SERIALIZED_NAME_CREATE_TIMESTAMP = "create_timestamp";
  @SerializedName(SERIALIZED_NAME_CREATE_TIMESTAMP)
  private Long createTimestamp = null;

  public static final String SERIALIZED_NAME_EXT_INFO = "ext_info";
  @SerializedName(SERIALIZED_NAME_EXT_INFO)
  private Map<String, String> extInfo = null;

  public static final String SERIALIZED_NAME_EXTERNAL_ID = "external_id";
  @SerializedName(SERIALIZED_NAME_EXTERNAL_ID)
  private String externalId = null;

  public static final String SERIALIZED_NAME_NAME = "name";
  @SerializedName(SERIALIZED_NAME_NAME)
  private String name = null;

  public static final String SERIALIZED_NAME_PHONE = "phone";
  @SerializedName(SERIALIZED_NAME_PHONE)
  private String phone = null;

  public static final String SERIALIZED_NAME_REMARK = "remark";
  @SerializedName(SERIALIZED_NAME_REMARK)
  private String remark = null;

  public static final String SERIALIZED_NAME_TAGS = "tags";
  @SerializedName(SERIALIZED_NAME_TAGS)
  private List<String> tags = null;

  public static final String SERIALIZED_NAME_WEIXIN = "weixin";
  @SerializedName(SERIALIZED_NAME_WEIXIN)
  private String weixin = null;

  public ToolsCluePrivateMessageCallbackV2RequestClueData() {
  }

  public ToolsCluePrivateMessageCallbackV2RequestClueData createTimestamp(Long createTimestamp) {
    
    this.createTimestamp = createTimestamp;
    return this;
  }

   /**
   * 线索创建的秒级时间戳
   * minimum: 1704038400
   * @return createTimestamp
  **/
  @javax.annotation.Nonnull
  public Long getCreateTimestamp() {
    return createTimestamp;
  }


  public void setCreateTimestamp(Long createTimestamp) {
    this.createTimestamp = createTimestamp;
  }


  public ToolsCluePrivateMessageCallbackV2RequestClueData extInfo(Map<String, String> extInfo) {
    
    this.extInfo = extInfo;
    return this;
  }

  public ToolsCluePrivateMessageCallbackV2RequestClueData putExtInfoItem(String key, String extInfoItem) {
    if (this.extInfo == null) {
      this.extInfo = new HashMap<>();
    }
    this.extInfo.put(key, extInfoItem);
    return this;
  }

   /**
   * isv/广告主自定义字段，字典结构。如 {\&quot;ai_tag\&quot;: \&quot;有意向\&quot;}
   * @return extInfo
  **/
  @javax.annotation.Nullable
  public Map<String, String> getExtInfo() {
    return extInfo;
  }


  public void setExtInfo(Map<String, String> extInfo) {
    this.extInfo = extInfo;
  }


  public ToolsCluePrivateMessageCallbackV2RequestClueData externalId(String externalId) {
    
    this.externalId = externalId;
    return this;
  }

   /**
   * crm/isv中的标识线索唯一的id
   * @return externalId
  **/
  @javax.annotation.Nullable
  public String getExternalId() {
    return externalId;
  }


  public void setExternalId(String externalId) {
    this.externalId = externalId;
  }


  public ToolsCluePrivateMessageCallbackV2RequestClueData name(String name) {
    
    this.name = name;
    return this;
  }

   /**
   * 留资用户名
   * @return name
  **/
  @javax.annotation.Nullable
  public String getName() {
    return name;
  }


  public void setName(String name) {
    this.name = name;
  }


  public ToolsCluePrivateMessageCallbackV2RequestClueData phone(String phone) {
    
    this.phone = phone;
    return this;
  }

   /**
   * 电话
   * @return phone
  **/
  @javax.annotation.Nullable
  public String getPhone() {
    return phone;
  }


  public void setPhone(String phone) {
    this.phone = phone;
  }


  public ToolsCluePrivateMessageCallbackV2RequestClueData remark(String remark) {
    
    this.remark = remark;
    return this;
  }

   /**
   * 线索备注
   * @return remark
  **/
  @javax.annotation.Nullable
  public String getRemark() {
    return remark;
  }


  public void setRemark(String remark) {
    this.remark = remark;
  }


  public ToolsCluePrivateMessageCallbackV2RequestClueData tags(List<String> tags) {
    
    this.tags = tags;
    return this;
  }

  public ToolsCluePrivateMessageCallbackV2RequestClueData addTagsItem(String tagsItem) {
    if (this.tags == null) {
      this.tags = new ArrayList<>();
    }
    this.tags.add(tagsItem);
    return this;
  }

   /**
   * 自定义的标签，一次最多传入20个
   * @return tags
  **/
  @javax.annotation.Nullable
  public List<String> getTags() {
    return tags;
  }


  public void setTags(List<String> tags) {
    this.tags = tags;
  }


  public ToolsCluePrivateMessageCallbackV2RequestClueData weixin(String weixin) {
    
    this.weixin = weixin;
    return this;
  }

   /**
   * 微信
   * @return weixin
  **/
  @javax.annotation.Nullable
  public String getWeixin() {
    return weixin;
  }


  public void setWeixin(String weixin) {
    this.weixin = weixin;
  }



  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ToolsCluePrivateMessageCallbackV2RequestClueData toolsCluePrivateMessageCallbackV2RequestClueData = (ToolsCluePrivateMessageCallbackV2RequestClueData) o;
    return Objects.equals(this.createTimestamp, toolsCluePrivateMessageCallbackV2RequestClueData.createTimestamp) &&
        Objects.equals(this.extInfo, toolsCluePrivateMessageCallbackV2RequestClueData.extInfo) &&
        Objects.equals(this.externalId, toolsCluePrivateMessageCallbackV2RequestClueData.externalId) &&
        Objects.equals(this.name, toolsCluePrivateMessageCallbackV2RequestClueData.name) &&
        Objects.equals(this.phone, toolsCluePrivateMessageCallbackV2RequestClueData.phone) &&
        Objects.equals(this.remark, toolsCluePrivateMessageCallbackV2RequestClueData.remark) &&
        Objects.equals(this.tags, toolsCluePrivateMessageCallbackV2RequestClueData.tags) &&
        Objects.equals(this.weixin, toolsCluePrivateMessageCallbackV2RequestClueData.weixin);
  }

  @Override
  public int hashCode() {
    return Objects.hash(createTimestamp, extInfo, externalId, name, phone, remark, tags, weixin);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ToolsCluePrivateMessageCallbackV2RequestClueData {\n");
    sb.append("    createTimestamp: ").append(toIndentedString(createTimestamp)).append("\n");
    sb.append("    extInfo: ").append(toIndentedString(extInfo)).append("\n");
    sb.append("    externalId: ").append(toIndentedString(externalId)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    phone: ").append(toIndentedString(phone)).append("\n");
    sb.append("    remark: ").append(toIndentedString(remark)).append("\n");
    sb.append("    tags: ").append(toIndentedString(tags)).append("\n");
    sb.append("    weixin: ").append(toIndentedString(weixin)).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("create_timestamp");
    openapiFields.add("ext_info");
    openapiFields.add("external_id");
    openapiFields.add("name");
    openapiFields.add("phone");
    openapiFields.add("remark");
    openapiFields.add("tags");
    openapiFields.add("weixin");

    // a set of required properties/fields (JSON key names)
    openapiRequiredFields = new HashSet<String>();
    openapiRequiredFields.add("create_timestamp");
  }


  public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
    @SuppressWarnings("unchecked")
    @Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
       if (!ToolsCluePrivateMessageCallbackV2RequestClueData.class.isAssignableFrom(type.getRawType())) {
         return null; // this class only serializes 'ToolsCluePrivateMessageCallbackV2RequestClueData' and its subtypes
       }
       final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
       final TypeAdapter<ToolsCluePrivateMessageCallbackV2RequestClueData> thisAdapter
                        = gson.getDelegateAdapter(this, TypeToken.get(ToolsCluePrivateMessageCallbackV2RequestClueData.class));

       return (TypeAdapter<T>) new TypeAdapter<ToolsCluePrivateMessageCallbackV2RequestClueData>() {
           @Override
           public void write(JsonWriter out, ToolsCluePrivateMessageCallbackV2RequestClueData value) throws IOException {
             JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
             elementAdapter.write(out, obj);
           }

           @Override
           public ToolsCluePrivateMessageCallbackV2RequestClueData read(JsonReader in) throws IOException {
             JsonElement jsonElement = elementAdapter.read(in);
             return thisAdapter.fromJsonTree(jsonElement);
           }

       }.nullSafe();
    }
  }

 /**
  * Create an instance of ToolsCluePrivateMessageCallbackV2RequestClueData given an JSON string
  *
  * @param jsonString JSON string
  * @return An instance of ToolsCluePrivateMessageCallbackV2RequestClueData
  * @throws IOException if the JSON string is invalid with respect to ToolsCluePrivateMessageCallbackV2RequestClueData
  */
  public static ToolsCluePrivateMessageCallbackV2RequestClueData fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, ToolsCluePrivateMessageCallbackV2RequestClueData.class);
  }

 /**
  * Convert an instance of ToolsCluePrivateMessageCallbackV2RequestClueData to an JSON string
  *
  * @return JSON string
  */
  public String toJson() {
    return JSON.getGson().toJson(this);
  }
}

