/*
 * 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.DouplusOrderListV30ResponseDataOrderListInnerAdListInner;
import com.bytedance.ads.model.DouplusOrderListV30ResponseDataOrderListInnerItemInfoListInner;
import com.bytedance.ads.model.DouplusOrderListV30ResponseDataOrderListInnerLiveRoomInfo;
import com.bytedance.ads.model.DouplusOrderListV30ResponseDataOrderListInnerOrder;
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;

/**
 * DouplusOrderListV30ResponseDataOrderListInner
 */
@javax.annotation.Generated(value = "com.org.bytedance.ad_open_sdk.JavacusGenerator", date = "2024-09-10T15:29:00.246104612+08:00[Asia/Shanghai]")
public class DouplusOrderListV30ResponseDataOrderListInner {
  public static final String SERIALIZED_NAME_AD_LIST = "ad_list";
  @SerializedName(SERIALIZED_NAME_AD_LIST)
  private List<DouplusOrderListV30ResponseDataOrderListInnerAdListInner> adList = null;

  public static final String SERIALIZED_NAME_ITEM_INFO_LIST = "item_info_list";
  @SerializedName(SERIALIZED_NAME_ITEM_INFO_LIST)
  private List<DouplusOrderListV30ResponseDataOrderListInnerItemInfoListInner> itemInfoList = null;

  public static final String SERIALIZED_NAME_LIVE_ROOM_INFO = "live_room_info";
  @SerializedName(SERIALIZED_NAME_LIVE_ROOM_INFO)
  private DouplusOrderListV30ResponseDataOrderListInnerLiveRoomInfo liveRoomInfo = null;

  public static final String SERIALIZED_NAME_ORDER = "order";
  @SerializedName(SERIALIZED_NAME_ORDER)
  private DouplusOrderListV30ResponseDataOrderListInnerOrder order = null;

  public DouplusOrderListV30ResponseDataOrderListInner() {
  }

  public DouplusOrderListV30ResponseDataOrderListInner adList(List<DouplusOrderListV30ResponseDataOrderListInnerAdListInner> adList) {
    
    this.adList = adList;
    return this;
  }

  public DouplusOrderListV30ResponseDataOrderListInner addAdListItem(DouplusOrderListV30ResponseDataOrderListInnerAdListInner adListItem) {
    if (this.adList == null) {
      this.adList = new ArrayList<>();
    }
    this.adList.add(adListItem);
    return this;
  }

   /**
   * 
   * @return adList
  **/
  @javax.annotation.Nullable
  public List<DouplusOrderListV30ResponseDataOrderListInnerAdListInner> getAdList() {
    return adList;
  }


  public void setAdList(List<DouplusOrderListV30ResponseDataOrderListInnerAdListInner> adList) {
    this.adList = adList;
  }


  public DouplusOrderListV30ResponseDataOrderListInner itemInfoList(List<DouplusOrderListV30ResponseDataOrderListInnerItemInfoListInner> itemInfoList) {
    
    this.itemInfoList = itemInfoList;
    return this;
  }

  public DouplusOrderListV30ResponseDataOrderListInner addItemInfoListItem(DouplusOrderListV30ResponseDataOrderListInnerItemInfoListInner itemInfoListItem) {
    if (this.itemInfoList == null) {
      this.itemInfoList = new ArrayList<>();
    }
    this.itemInfoList.add(itemInfoListItem);
    return this;
  }

   /**
   * 
   * @return itemInfoList
  **/
  @javax.annotation.Nullable
  public List<DouplusOrderListV30ResponseDataOrderListInnerItemInfoListInner> getItemInfoList() {
    return itemInfoList;
  }


  public void setItemInfoList(List<DouplusOrderListV30ResponseDataOrderListInnerItemInfoListInner> itemInfoList) {
    this.itemInfoList = itemInfoList;
  }


  public DouplusOrderListV30ResponseDataOrderListInner liveRoomInfo(DouplusOrderListV30ResponseDataOrderListInnerLiveRoomInfo liveRoomInfo) {
    
    this.liveRoomInfo = liveRoomInfo;
    return this;
  }

   /**
   * Get liveRoomInfo
   * @return liveRoomInfo
  **/
  @javax.annotation.Nullable
  public DouplusOrderListV30ResponseDataOrderListInnerLiveRoomInfo getLiveRoomInfo() {
    return liveRoomInfo;
  }


  public void setLiveRoomInfo(DouplusOrderListV30ResponseDataOrderListInnerLiveRoomInfo liveRoomInfo) {
    this.liveRoomInfo = liveRoomInfo;
  }


  public DouplusOrderListV30ResponseDataOrderListInner order(DouplusOrderListV30ResponseDataOrderListInnerOrder order) {
    
    this.order = order;
    return this;
  }

   /**
   * Get order
   * @return order
  **/
  @javax.annotation.Nullable
  public DouplusOrderListV30ResponseDataOrderListInnerOrder getOrder() {
    return order;
  }


  public void setOrder(DouplusOrderListV30ResponseDataOrderListInnerOrder order) {
    this.order = order;
  }



  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DouplusOrderListV30ResponseDataOrderListInner douplusOrderListV30ResponseDataOrderListInner = (DouplusOrderListV30ResponseDataOrderListInner) o;
    return Objects.equals(this.adList, douplusOrderListV30ResponseDataOrderListInner.adList) &&
        Objects.equals(this.itemInfoList, douplusOrderListV30ResponseDataOrderListInner.itemInfoList) &&
        Objects.equals(this.liveRoomInfo, douplusOrderListV30ResponseDataOrderListInner.liveRoomInfo) &&
        Objects.equals(this.order, douplusOrderListV30ResponseDataOrderListInner.order);
  }

  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(adList, itemInfoList, liveRoomInfo, order);
  }

  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 DouplusOrderListV30ResponseDataOrderListInner {\n");
    sb.append("    adList: ").append(toIndentedString(adList)).append("\n");
    sb.append("    itemInfoList: ").append(toIndentedString(itemInfoList)).append("\n");
    sb.append("    liveRoomInfo: ").append(toIndentedString(liveRoomInfo)).append("\n");
    sb.append("    order: ").append(toIndentedString(order)).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_list");
    openapiFields.add("item_info_list");
    openapiFields.add("live_room_info");
    openapiFields.add("order");

    // 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 (!DouplusOrderListV30ResponseDataOrderListInner.class.isAssignableFrom(type.getRawType())) {
         return null; // this class only serializes 'DouplusOrderListV30ResponseDataOrderListInner' and its subtypes
       }
       final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
       final TypeAdapter<DouplusOrderListV30ResponseDataOrderListInner> thisAdapter
                        = gson.getDelegateAdapter(this, TypeToken.get(DouplusOrderListV30ResponseDataOrderListInner.class));

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

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

       }.nullSafe();
    }
  }

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

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

