/*
 * 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.BudgetGroupListV30DataBudgetGroupsAdType;
import com.bytedance.ads.model.BudgetGroupListV30DataBudgetGroupsBudgetGroupStatusFirst;
import com.bytedance.ads.model.BudgetGroupListV30DataBudgetGroupsBudgetGroupStatusSecond;
import com.bytedance.ads.model.BudgetGroupListV30DataBudgetGroupsDeliveryType;
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;

/**
 * BudgetGroupListV30ResponseDataBudgetGroupsInner
 */
@javax.annotation.Generated(value = "com.org.bytedance.ad_open_sdk.JavacusGenerator", date = "2024-09-10T15:29:00.246104612+08:00[Asia/Shanghai]")
public class BudgetGroupListV30ResponseDataBudgetGroupsInner {
  public static final String SERIALIZED_NAME_AD_TYPE = "ad_type";
  @SerializedName(SERIALIZED_NAME_AD_TYPE)
  private BudgetGroupListV30DataBudgetGroupsAdType adType = null;

  public static final String SERIALIZED_NAME_BUDGET_GROUP_BUDGET = "budget_group_budget";
  @SerializedName(SERIALIZED_NAME_BUDGET_GROUP_BUDGET)
  private Double budgetGroupBudget = null;

  public static final String SERIALIZED_NAME_BUDGET_GROUP_ID = "budget_group_id";
  @SerializedName(SERIALIZED_NAME_BUDGET_GROUP_ID)
  private Long budgetGroupId = null;

  public static final String SERIALIZED_NAME_BUDGET_GROUP_NAME = "budget_group_name";
  @SerializedName(SERIALIZED_NAME_BUDGET_GROUP_NAME)
  private String budgetGroupName = null;

  public static final String SERIALIZED_NAME_BUDGET_GROUP_STATUS_FIRST = "budget_group_status_first";
  @SerializedName(SERIALIZED_NAME_BUDGET_GROUP_STATUS_FIRST)
  private BudgetGroupListV30DataBudgetGroupsBudgetGroupStatusFirst budgetGroupStatusFirst = null;

  public static final String SERIALIZED_NAME_BUDGET_GROUP_STATUS_SECOND = "budget_group_status_second";
  @SerializedName(SERIALIZED_NAME_BUDGET_GROUP_STATUS_SECOND)
  private List<BudgetGroupListV30DataBudgetGroupsBudgetGroupStatusSecond> budgetGroupStatusSecond = null;

  public static final String SERIALIZED_NAME_COST = "cost";
  @SerializedName(SERIALIZED_NAME_COST)
  private Double cost = null;

  public static final String SERIALIZED_NAME_DELIVERY_TYPE = "delivery_type";
  @SerializedName(SERIALIZED_NAME_DELIVERY_TYPE)
  private BudgetGroupListV30DataBudgetGroupsDeliveryType deliveryType = null;

  public static final String SERIALIZED_NAME_NUM_PROJECTS = "num_projects";
  @SerializedName(SERIALIZED_NAME_NUM_PROJECTS)
  private Long numProjects = null;

  public BudgetGroupListV30ResponseDataBudgetGroupsInner() {
  }

  public BudgetGroupListV30ResponseDataBudgetGroupsInner adType(BudgetGroupListV30DataBudgetGroupsAdType adType) {
    
    this.adType = adType;
    return this;
  }

   /**
   * Get adType
   * @return adType
  **/
  @javax.annotation.Nullable
  public BudgetGroupListV30DataBudgetGroupsAdType getAdType() {
    return adType;
  }


  public void setAdType(BudgetGroupListV30DataBudgetGroupsAdType adType) {
    this.adType = adType;
  }


  public BudgetGroupListV30ResponseDataBudgetGroupsInner budgetGroupBudget(Double budgetGroupBudget) {
    
    this.budgetGroupBudget = budgetGroupBudget;
    return this;
  }

   /**
   * 预算组预算
   * @return budgetGroupBudget
  **/
  @javax.annotation.Nullable
  public Double getBudgetGroupBudget() {
    return budgetGroupBudget;
  }


  public void setBudgetGroupBudget(Double budgetGroupBudget) {
    this.budgetGroupBudget = budgetGroupBudget;
  }


  public BudgetGroupListV30ResponseDataBudgetGroupsInner budgetGroupId(Long budgetGroupId) {
    
    this.budgetGroupId = budgetGroupId;
    return this;
  }

   /**
   * 预算组id
   * @return budgetGroupId
  **/
  @javax.annotation.Nullable
  public Long getBudgetGroupId() {
    return budgetGroupId;
  }


  public void setBudgetGroupId(Long budgetGroupId) {
    this.budgetGroupId = budgetGroupId;
  }


  public BudgetGroupListV30ResponseDataBudgetGroupsInner budgetGroupName(String budgetGroupName) {
    
    this.budgetGroupName = budgetGroupName;
    return this;
  }

   /**
   * 预算组名称
   * @return budgetGroupName
  **/
  @javax.annotation.Nullable
  public String getBudgetGroupName() {
    return budgetGroupName;
  }


  public void setBudgetGroupName(String budgetGroupName) {
    this.budgetGroupName = budgetGroupName;
  }


  public BudgetGroupListV30ResponseDataBudgetGroupsInner budgetGroupStatusFirst(BudgetGroupListV30DataBudgetGroupsBudgetGroupStatusFirst budgetGroupStatusFirst) {
    
    this.budgetGroupStatusFirst = budgetGroupStatusFirst;
    return this;
  }

   /**
   * Get budgetGroupStatusFirst
   * @return budgetGroupStatusFirst
  **/
  @javax.annotation.Nullable
  public BudgetGroupListV30DataBudgetGroupsBudgetGroupStatusFirst getBudgetGroupStatusFirst() {
    return budgetGroupStatusFirst;
  }


  public void setBudgetGroupStatusFirst(BudgetGroupListV30DataBudgetGroupsBudgetGroupStatusFirst budgetGroupStatusFirst) {
    this.budgetGroupStatusFirst = budgetGroupStatusFirst;
  }


  public BudgetGroupListV30ResponseDataBudgetGroupsInner budgetGroupStatusSecond(List<BudgetGroupListV30DataBudgetGroupsBudgetGroupStatusSecond> budgetGroupStatusSecond) {
    
    this.budgetGroupStatusSecond = budgetGroupStatusSecond;
    return this;
  }

  public BudgetGroupListV30ResponseDataBudgetGroupsInner addBudgetGroupStatusSecondItem(BudgetGroupListV30DataBudgetGroupsBudgetGroupStatusSecond budgetGroupStatusSecondItem) {
    if (this.budgetGroupStatusSecond == null) {
      this.budgetGroupStatusSecond = new ArrayList<>();
    }
    this.budgetGroupStatusSecond.add(budgetGroupStatusSecondItem);
    return this;
  }

   /**
   * 二级状态
   * @return budgetGroupStatusSecond
  **/
  @javax.annotation.Nullable
  public List<BudgetGroupListV30DataBudgetGroupsBudgetGroupStatusSecond> getBudgetGroupStatusSecond() {
    return budgetGroupStatusSecond;
  }


  public void setBudgetGroupStatusSecond(List<BudgetGroupListV30DataBudgetGroupsBudgetGroupStatusSecond> budgetGroupStatusSecond) {
    this.budgetGroupStatusSecond = budgetGroupStatusSecond;
  }


  public BudgetGroupListV30ResponseDataBudgetGroupsInner cost(Double cost) {
    
    this.cost = cost;
    return this;
  }

   /**
   * 预算组消耗
   * @return cost
  **/
  @javax.annotation.Nullable
  public Double getCost() {
    return cost;
  }


  public void setCost(Double cost) {
    this.cost = cost;
  }


  public BudgetGroupListV30ResponseDataBudgetGroupsInner deliveryType(BudgetGroupListV30DataBudgetGroupsDeliveryType deliveryType) {
    
    this.deliveryType = deliveryType;
    return this;
  }

   /**
   * Get deliveryType
   * @return deliveryType
  **/
  @javax.annotation.Nullable
  public BudgetGroupListV30DataBudgetGroupsDeliveryType getDeliveryType() {
    return deliveryType;
  }


  public void setDeliveryType(BudgetGroupListV30DataBudgetGroupsDeliveryType deliveryType) {
    this.deliveryType = deliveryType;
  }


  public BudgetGroupListV30ResponseDataBudgetGroupsInner numProjects(Long numProjects) {
    
    this.numProjects = numProjects;
    return this;
  }

   /**
   * 关联的（非删除）项目个数
   * @return numProjects
  **/
  @javax.annotation.Nullable
  public Long getNumProjects() {
    return numProjects;
  }


  public void setNumProjects(Long numProjects) {
    this.numProjects = numProjects;
  }



  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    BudgetGroupListV30ResponseDataBudgetGroupsInner budgetGroupListV30ResponseDataBudgetGroupsInner = (BudgetGroupListV30ResponseDataBudgetGroupsInner) o;
    return Objects.equals(this.adType, budgetGroupListV30ResponseDataBudgetGroupsInner.adType) &&
        Objects.equals(this.budgetGroupBudget, budgetGroupListV30ResponseDataBudgetGroupsInner.budgetGroupBudget) &&
        Objects.equals(this.budgetGroupId, budgetGroupListV30ResponseDataBudgetGroupsInner.budgetGroupId) &&
        Objects.equals(this.budgetGroupName, budgetGroupListV30ResponseDataBudgetGroupsInner.budgetGroupName) &&
        Objects.equals(this.budgetGroupStatusFirst, budgetGroupListV30ResponseDataBudgetGroupsInner.budgetGroupStatusFirst) &&
        Objects.equals(this.budgetGroupStatusSecond, budgetGroupListV30ResponseDataBudgetGroupsInner.budgetGroupStatusSecond) &&
        Objects.equals(this.cost, budgetGroupListV30ResponseDataBudgetGroupsInner.cost) &&
        Objects.equals(this.deliveryType, budgetGroupListV30ResponseDataBudgetGroupsInner.deliveryType) &&
        Objects.equals(this.numProjects, budgetGroupListV30ResponseDataBudgetGroupsInner.numProjects);
  }

  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(adType, budgetGroupBudget, budgetGroupId, budgetGroupName, budgetGroupStatusFirst, budgetGroupStatusSecond, cost, deliveryType, numProjects);
  }

  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 BudgetGroupListV30ResponseDataBudgetGroupsInner {\n");
    sb.append("    adType: ").append(toIndentedString(adType)).append("\n");
    sb.append("    budgetGroupBudget: ").append(toIndentedString(budgetGroupBudget)).append("\n");
    sb.append("    budgetGroupId: ").append(toIndentedString(budgetGroupId)).append("\n");
    sb.append("    budgetGroupName: ").append(toIndentedString(budgetGroupName)).append("\n");
    sb.append("    budgetGroupStatusFirst: ").append(toIndentedString(budgetGroupStatusFirst)).append("\n");
    sb.append("    budgetGroupStatusSecond: ").append(toIndentedString(budgetGroupStatusSecond)).append("\n");
    sb.append("    cost: ").append(toIndentedString(cost)).append("\n");
    sb.append("    deliveryType: ").append(toIndentedString(deliveryType)).append("\n");
    sb.append("    numProjects: ").append(toIndentedString(numProjects)).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("ad_type");
    openapiFields.add("budget_group_budget");
    openapiFields.add("budget_group_id");
    openapiFields.add("budget_group_name");
    openapiFields.add("budget_group_status_first");
    openapiFields.add("budget_group_status_second");
    openapiFields.add("cost");
    openapiFields.add("delivery_type");
    openapiFields.add("num_projects");

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


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

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

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

       }.nullSafe();
    }
  }

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

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

