/*
 * 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.bytedance.ads.model.AdvertiserDeliveryPkgConfigV30DataIndustryConfigIndustryStatus;
import com.bytedance.ads.model.AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfigNecessariesInner;
import com.bytedance.ads.model.AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfigUnnecessariesInner;
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.List;
import org.openapitools.jackson.nullable.JsonNullable;

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 AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig {
  public static final String SERIALIZED_NAME_CONFIG_ID = "config_id";
  @SerializedName(SERIALIZED_NAME_CONFIG_ID)
  private Long configId = null;

  public static final String SERIALIZED_NAME_INDUSTRY_IDS = "industry_ids";
  @SerializedName(SERIALIZED_NAME_INDUSTRY_IDS)
  private List<Long> industryIds = null;

  public static final String SERIALIZED_NAME_INDUSTRY_NAMES = "industry_names";
  @SerializedName(SERIALIZED_NAME_INDUSTRY_NAMES)
  private List<String> industryNames = null;

  public static final String SERIALIZED_NAME_INDUSTRY_STATUS = "industry_status";
  @SerializedName(SERIALIZED_NAME_INDUSTRY_STATUS)
  private AdvertiserDeliveryPkgConfigV30DataIndustryConfigIndustryStatus industryStatus = null;

  public static final String SERIALIZED_NAME_NECESSARIES = "necessaries";
  @SerializedName(SERIALIZED_NAME_NECESSARIES)
  private List<AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfigNecessariesInner> necessaries = null;

  public static final String SERIALIZED_NAME_UNNECESSARIES = "unnecessaries";
  @SerializedName(SERIALIZED_NAME_UNNECESSARIES)
  private List<AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfigUnnecessariesInner> unnecessaries = null;

  public AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig() {
  }

  public AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig configId(Long configId) {
    
    this.configId = configId;
    return this;
  }

   /**
   * 资质规则id
   * @return configId
  **/
  @javax.annotation.Nullable
  public Long getConfigId() {
    return configId;
  }


  public void setConfigId(Long configId) {
    this.configId = configId;
  }


  public AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig industryIds(List<Long> industryIds) {
    
    this.industryIds = industryIds;
    return this;
  }

  public AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig addIndustryIdsItem(Long industryIdsItem) {
    if (this.industryIds == null) {
      this.industryIds = new ArrayList<>();
    }
    this.industryIds.add(industryIdsItem);
    return this;
  }

   /**
   * 第一级到第三级行业id
   * @return industryIds
  **/
  @javax.annotation.Nullable
  public List<Long> getIndustryIds() {
    return industryIds;
  }


  public void setIndustryIds(List<Long> industryIds) {
    this.industryIds = industryIds;
  }


  public AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig industryNames(List<String> industryNames) {
    
    this.industryNames = industryNames;
    return this;
  }

  public AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig addIndustryNamesItem(String industryNamesItem) {
    if (this.industryNames == null) {
      this.industryNames = new ArrayList<>();
    }
    this.industryNames.add(industryNamesItem);
    return this;
  }

   /**
   * 第一级到第三级行业名称
   * @return industryNames
  **/
  @javax.annotation.Nullable
  public List<String> getIndustryNames() {
    return industryNames;
  }


  public void setIndustryNames(List<String> industryNames) {
    this.industryNames = industryNames;
  }


  public AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig industryStatus(AdvertiserDeliveryPkgConfigV30DataIndustryConfigIndustryStatus industryStatus) {
    
    this.industryStatus = industryStatus;
    return this;
  }

   /**
   * Get industryStatus
   * @return industryStatus
  **/
  @javax.annotation.Nullable
  public AdvertiserDeliveryPkgConfigV30DataIndustryConfigIndustryStatus getIndustryStatus() {
    return industryStatus;
  }


  public void setIndustryStatus(AdvertiserDeliveryPkgConfigV30DataIndustryConfigIndustryStatus industryStatus) {
    this.industryStatus = industryStatus;
  }


  public AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig necessaries(List<AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfigNecessariesInner> necessaries) {
    
    this.necessaries = necessaries;
    return this;
  }

  public AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig addNecessariesItem(AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfigNecessariesInner necessariesItem) {
    if (this.necessaries == null) {
      this.necessaries = new ArrayList<>();
    }
    this.necessaries.add(necessariesItem);
    return this;
  }

   /**
   * 必填资质模块配置
   * @return necessaries
  **/
  @javax.annotation.Nullable
  public List<AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfigNecessariesInner> getNecessaries() {
    return necessaries;
  }


  public void setNecessaries(List<AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfigNecessariesInner> necessaries) {
    this.necessaries = necessaries;
  }


  public AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig unnecessaries(List<AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfigUnnecessariesInner> unnecessaries) {
    
    this.unnecessaries = unnecessaries;
    return this;
  }

  public AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig addUnnecessariesItem(AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfigUnnecessariesInner unnecessariesItem) {
    if (this.unnecessaries == null) {
      this.unnecessaries = new ArrayList<>();
    }
    this.unnecessaries.add(unnecessariesItem);
    return this;
  }

   /**
   * 选填资质模块配置
   * @return unnecessaries
  **/
  @javax.annotation.Nullable
  public List<AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfigUnnecessariesInner> getUnnecessaries() {
    return unnecessaries;
  }


  public void setUnnecessaries(List<AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfigUnnecessariesInner> unnecessaries) {
    this.unnecessaries = unnecessaries;
  }



  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig advertiserDeliveryPkgConfigV30ResponseDataIndustryConfig = (AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig) o;
    return Objects.equals(this.configId, advertiserDeliveryPkgConfigV30ResponseDataIndustryConfig.configId) &&
        Objects.equals(this.industryIds, advertiserDeliveryPkgConfigV30ResponseDataIndustryConfig.industryIds) &&
        Objects.equals(this.industryNames, advertiserDeliveryPkgConfigV30ResponseDataIndustryConfig.industryNames) &&
        Objects.equals(this.industryStatus, advertiserDeliveryPkgConfigV30ResponseDataIndustryConfig.industryStatus) &&
        Objects.equals(this.necessaries, advertiserDeliveryPkgConfigV30ResponseDataIndustryConfig.necessaries) &&
        Objects.equals(this.unnecessaries, advertiserDeliveryPkgConfigV30ResponseDataIndustryConfig.unnecessaries);
  }

  private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
    return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
  }

  @Override
  public int hashCode() {
    return Objects.hash(configId, industryIds, industryNames, industryStatus, necessaries, unnecessaries);
  }

  private static <T> int hashCodeNullable(JsonNullable<T> a) {
    if (a == null) {
      return 1;
    }
    return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class AdvertiserDeliveryPkgConfigV30ResponseDataIndustryConfig {\n");
    sb.append("    configId: ").append(toIndentedString(configId)).append("\n");
    sb.append("    industryIds: ").append(toIndentedString(industryIds)).append("\n");
    sb.append("    industryNames: ").append(toIndentedString(industryNames)).append("\n");
    sb.append("    industryStatus: ").append(toIndentedString(industryStatus)).append("\n");
    sb.append("    necessaries: ").append(toIndentedString(necessaries)).append("\n");
    sb.append("    unnecessaries: ").append(toIndentedString(unnecessaries)).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("config_id");
    openapiFields.add("industry_ids");
    openapiFields.add("industry_names");
    openapiFields.add("industry_status");
    openapiFields.add("necessaries");
    openapiFields.add("unnecessaries");

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


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

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

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

       }.nullSafe();
    }
  }

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

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

