/*
 * 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.CreativeCustomCreativeCreateV2CreativeListDerivePosterCid;
import com.bytedance.ads.model.CreativeCustomCreativeCreateV2CreativeListImageMode;
import com.bytedance.ads.model.CreativeCustomCreativeCreateV2RequestCreativeListInnerAbstractMaterialsInner;
import com.bytedance.ads.model.CreativeCustomCreativeCreateV2RequestCreativeListInnerComponentMaterialsInner;
import com.bytedance.ads.model.CreativeCustomCreativeCreateV2RequestCreativeListInnerDecorationMaterial;
import com.bytedance.ads.model.CreativeCustomCreativeCreateV2RequestCreativeListInnerImageMaterialsInner;
import com.bytedance.ads.model.CreativeCustomCreativeCreateV2RequestCreativeListInnerInteractiveMaterial;
import com.bytedance.ads.model.CreativeCustomCreativeCreateV2RequestCreativeListInnerPlayableMaterial;
import com.bytedance.ads.model.CreativeCustomCreativeCreateV2RequestCreativeListInnerSubTitleMaterial;
import com.bytedance.ads.model.CreativeCustomCreativeCreateV2RequestCreativeListInnerTitleMaterial;
import com.bytedance.ads.model.CreativeCustomCreativeCreateV2RequestCreativeListInnerVideoMaterial;
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 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;

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

  public static final String SERIALIZED_NAME_COMPONENT_MATERIALS = "component_materials";
  @SerializedName(SERIALIZED_NAME_COMPONENT_MATERIALS)
  private List<CreativeCustomCreativeCreateV2RequestCreativeListInnerComponentMaterialsInner> componentMaterials = null;

  public static final String SERIALIZED_NAME_CREATIVE_ID = "creative_id";
  @SerializedName(SERIALIZED_NAME_CREATIVE_ID)
  private Long creativeId = null;

  public static final String SERIALIZED_NAME_DECORATION_MATERIAL = "decoration_material";
  @SerializedName(SERIALIZED_NAME_DECORATION_MATERIAL)
  private CreativeCustomCreativeCreateV2RequestCreativeListInnerDecorationMaterial decorationMaterial = null;

  public static final String SERIALIZED_NAME_DERIVE_POSTER_CID = "derive_poster_cid";
  @SerializedName(SERIALIZED_NAME_DERIVE_POSTER_CID)
  private CreativeCustomCreativeCreateV2CreativeListDerivePosterCid derivePosterCid = null;

  public static final String SERIALIZED_NAME_IMAGE_MATERIALS = "image_materials";
  @SerializedName(SERIALIZED_NAME_IMAGE_MATERIALS)
  private List<CreativeCustomCreativeCreateV2RequestCreativeListInnerImageMaterialsInner> imageMaterials = null;

  public static final String SERIALIZED_NAME_IMAGE_MODE = "image_mode";
  @SerializedName(SERIALIZED_NAME_IMAGE_MODE)
  private CreativeCustomCreativeCreateV2CreativeListImageMode imageMode = null;

  public static final String SERIALIZED_NAME_INTERACTIVE_MATERIAL = "interactive_material";
  @SerializedName(SERIALIZED_NAME_INTERACTIVE_MATERIAL)
  private CreativeCustomCreativeCreateV2RequestCreativeListInnerInteractiveMaterial interactiveMaterial = null;

  public static final String SERIALIZED_NAME_PLAYABLE_MATERIAL = "playable_material";
  @SerializedName(SERIALIZED_NAME_PLAYABLE_MATERIAL)
  private CreativeCustomCreativeCreateV2RequestCreativeListInnerPlayableMaterial playableMaterial = null;

  public static final String SERIALIZED_NAME_SUB_TITLE_MATERIAL = "sub_title_material";
  @SerializedName(SERIALIZED_NAME_SUB_TITLE_MATERIAL)
  private CreativeCustomCreativeCreateV2RequestCreativeListInnerSubTitleMaterial subTitleMaterial = null;

  public static final String SERIALIZED_NAME_THIRD_PARTY_ID = "third_party_id";
  @SerializedName(SERIALIZED_NAME_THIRD_PARTY_ID)
  private String thirdPartyId = null;

  public static final String SERIALIZED_NAME_TITLE_MATERIAL = "title_material";
  @SerializedName(SERIALIZED_NAME_TITLE_MATERIAL)
  private CreativeCustomCreativeCreateV2RequestCreativeListInnerTitleMaterial titleMaterial = null;

  public static final String SERIALIZED_NAME_VIDEO_MATERIAL = "video_material";
  @SerializedName(SERIALIZED_NAME_VIDEO_MATERIAL)
  private CreativeCustomCreativeCreateV2RequestCreativeListInnerVideoMaterial videoMaterial = null;

  public CreativeCustomCreativeCreateV2RequestCreativeListInner() {
  }

  public CreativeCustomCreativeCreateV2RequestCreativeListInner abstractMaterials(List<CreativeCustomCreativeCreateV2RequestCreativeListInnerAbstractMaterialsInner> abstractMaterials) {
    
    this.abstractMaterials = abstractMaterials;
    return this;
  }

  public CreativeCustomCreativeCreateV2RequestCreativeListInner addAbstractMaterialsItem(CreativeCustomCreativeCreateV2RequestCreativeListInnerAbstractMaterialsInner abstractMaterialsItem) {
    if (this.abstractMaterials == null) {
      this.abstractMaterials = new ArrayList<>();
    }
    this.abstractMaterials.add(abstractMaterialsItem);
    return this;
  }

   /**
   * 
   * @return abstractMaterials
  **/
  @javax.annotation.Nullable
  public List<CreativeCustomCreativeCreateV2RequestCreativeListInnerAbstractMaterialsInner> getAbstractMaterials() {
    return abstractMaterials;
  }


  public void setAbstractMaterials(List<CreativeCustomCreativeCreateV2RequestCreativeListInnerAbstractMaterialsInner> abstractMaterials) {
    this.abstractMaterials = abstractMaterials;
  }


  public CreativeCustomCreativeCreateV2RequestCreativeListInner componentMaterials(List<CreativeCustomCreativeCreateV2RequestCreativeListInnerComponentMaterialsInner> componentMaterials) {
    
    this.componentMaterials = componentMaterials;
    return this;
  }

  public CreativeCustomCreativeCreateV2RequestCreativeListInner addComponentMaterialsItem(CreativeCustomCreativeCreateV2RequestCreativeListInnerComponentMaterialsInner componentMaterialsItem) {
    if (this.componentMaterials == null) {
      this.componentMaterials = new ArrayList<>();
    }
    this.componentMaterials.add(componentMaterialsItem);
    return this;
  }

   /**
   * 
   * @return componentMaterials
  **/
  @javax.annotation.Nullable
  public List<CreativeCustomCreativeCreateV2RequestCreativeListInnerComponentMaterialsInner> getComponentMaterials() {
    return componentMaterials;
  }


  public void setComponentMaterials(List<CreativeCustomCreativeCreateV2RequestCreativeListInnerComponentMaterialsInner> componentMaterials) {
    this.componentMaterials = componentMaterials;
  }


  public CreativeCustomCreativeCreateV2RequestCreativeListInner creativeId(Long creativeId) {
    
    this.creativeId = creativeId;
    return this;
  }

   /**
   * 
   * @return creativeId
  **/
  @javax.annotation.Nullable
  public Long getCreativeId() {
    return creativeId;
  }


  public void setCreativeId(Long creativeId) {
    this.creativeId = creativeId;
  }


  public CreativeCustomCreativeCreateV2RequestCreativeListInner decorationMaterial(CreativeCustomCreativeCreateV2RequestCreativeListInnerDecorationMaterial decorationMaterial) {
    
    this.decorationMaterial = decorationMaterial;
    return this;
  }

   /**
   * Get decorationMaterial
   * @return decorationMaterial
  **/
  @javax.annotation.Nullable
  public CreativeCustomCreativeCreateV2RequestCreativeListInnerDecorationMaterial getDecorationMaterial() {
    return decorationMaterial;
  }


  public void setDecorationMaterial(CreativeCustomCreativeCreateV2RequestCreativeListInnerDecorationMaterial decorationMaterial) {
    this.decorationMaterial = decorationMaterial;
  }


  public CreativeCustomCreativeCreateV2RequestCreativeListInner derivePosterCid(CreativeCustomCreativeCreateV2CreativeListDerivePosterCid derivePosterCid) {
    
    this.derivePosterCid = derivePosterCid;
    return this;
  }

   /**
   * Get derivePosterCid
   * @return derivePosterCid
  **/
  @javax.annotation.Nullable
  public CreativeCustomCreativeCreateV2CreativeListDerivePosterCid getDerivePosterCid() {
    return derivePosterCid;
  }


  public void setDerivePosterCid(CreativeCustomCreativeCreateV2CreativeListDerivePosterCid derivePosterCid) {
    this.derivePosterCid = derivePosterCid;
  }


  public CreativeCustomCreativeCreateV2RequestCreativeListInner imageMaterials(List<CreativeCustomCreativeCreateV2RequestCreativeListInnerImageMaterialsInner> imageMaterials) {
    
    this.imageMaterials = imageMaterials;
    return this;
  }

  public CreativeCustomCreativeCreateV2RequestCreativeListInner addImageMaterialsItem(CreativeCustomCreativeCreateV2RequestCreativeListInnerImageMaterialsInner imageMaterialsItem) {
    if (this.imageMaterials == null) {
      this.imageMaterials = new ArrayList<>();
    }
    this.imageMaterials.add(imageMaterialsItem);
    return this;
  }

   /**
   * 
   * @return imageMaterials
  **/
  @javax.annotation.Nullable
  public List<CreativeCustomCreativeCreateV2RequestCreativeListInnerImageMaterialsInner> getImageMaterials() {
    return imageMaterials;
  }


  public void setImageMaterials(List<CreativeCustomCreativeCreateV2RequestCreativeListInnerImageMaterialsInner> imageMaterials) {
    this.imageMaterials = imageMaterials;
  }


  public CreativeCustomCreativeCreateV2RequestCreativeListInner imageMode(CreativeCustomCreativeCreateV2CreativeListImageMode imageMode) {
    
    this.imageMode = imageMode;
    return this;
  }

   /**
   * Get imageMode
   * @return imageMode
  **/
  @javax.annotation.Nonnull
  public CreativeCustomCreativeCreateV2CreativeListImageMode getImageMode() {
    return imageMode;
  }


  public void setImageMode(CreativeCustomCreativeCreateV2CreativeListImageMode imageMode) {
    this.imageMode = imageMode;
  }


  public CreativeCustomCreativeCreateV2RequestCreativeListInner interactiveMaterial(CreativeCustomCreativeCreateV2RequestCreativeListInnerInteractiveMaterial interactiveMaterial) {
    
    this.interactiveMaterial = interactiveMaterial;
    return this;
  }

   /**
   * Get interactiveMaterial
   * @return interactiveMaterial
  **/
  @javax.annotation.Nullable
  public CreativeCustomCreativeCreateV2RequestCreativeListInnerInteractiveMaterial getInteractiveMaterial() {
    return interactiveMaterial;
  }


  public void setInteractiveMaterial(CreativeCustomCreativeCreateV2RequestCreativeListInnerInteractiveMaterial interactiveMaterial) {
    this.interactiveMaterial = interactiveMaterial;
  }


  public CreativeCustomCreativeCreateV2RequestCreativeListInner playableMaterial(CreativeCustomCreativeCreateV2RequestCreativeListInnerPlayableMaterial playableMaterial) {
    
    this.playableMaterial = playableMaterial;
    return this;
  }

   /**
   * Get playableMaterial
   * @return playableMaterial
  **/
  @javax.annotation.Nullable
  public CreativeCustomCreativeCreateV2RequestCreativeListInnerPlayableMaterial getPlayableMaterial() {
    return playableMaterial;
  }


  public void setPlayableMaterial(CreativeCustomCreativeCreateV2RequestCreativeListInnerPlayableMaterial playableMaterial) {
    this.playableMaterial = playableMaterial;
  }


  public CreativeCustomCreativeCreateV2RequestCreativeListInner subTitleMaterial(CreativeCustomCreativeCreateV2RequestCreativeListInnerSubTitleMaterial subTitleMaterial) {
    
    this.subTitleMaterial = subTitleMaterial;
    return this;
  }

   /**
   * Get subTitleMaterial
   * @return subTitleMaterial
  **/
  @javax.annotation.Nullable
  public CreativeCustomCreativeCreateV2RequestCreativeListInnerSubTitleMaterial getSubTitleMaterial() {
    return subTitleMaterial;
  }


  public void setSubTitleMaterial(CreativeCustomCreativeCreateV2RequestCreativeListInnerSubTitleMaterial subTitleMaterial) {
    this.subTitleMaterial = subTitleMaterial;
  }


  public CreativeCustomCreativeCreateV2RequestCreativeListInner thirdPartyId(String thirdPartyId) {
    
    this.thirdPartyId = thirdPartyId;
    return this;
  }

   /**
   * 
   * @return thirdPartyId
  **/
  @javax.annotation.Nullable
  public String getThirdPartyId() {
    return thirdPartyId;
  }


  public void setThirdPartyId(String thirdPartyId) {
    this.thirdPartyId = thirdPartyId;
  }


  public CreativeCustomCreativeCreateV2RequestCreativeListInner titleMaterial(CreativeCustomCreativeCreateV2RequestCreativeListInnerTitleMaterial titleMaterial) {
    
    this.titleMaterial = titleMaterial;
    return this;
  }

   /**
   * Get titleMaterial
   * @return titleMaterial
  **/
  @javax.annotation.Nullable
  public CreativeCustomCreativeCreateV2RequestCreativeListInnerTitleMaterial getTitleMaterial() {
    return titleMaterial;
  }


  public void setTitleMaterial(CreativeCustomCreativeCreateV2RequestCreativeListInnerTitleMaterial titleMaterial) {
    this.titleMaterial = titleMaterial;
  }


  public CreativeCustomCreativeCreateV2RequestCreativeListInner videoMaterial(CreativeCustomCreativeCreateV2RequestCreativeListInnerVideoMaterial videoMaterial) {
    
    this.videoMaterial = videoMaterial;
    return this;
  }

   /**
   * Get videoMaterial
   * @return videoMaterial
  **/
  @javax.annotation.Nullable
  public CreativeCustomCreativeCreateV2RequestCreativeListInnerVideoMaterial getVideoMaterial() {
    return videoMaterial;
  }


  public void setVideoMaterial(CreativeCustomCreativeCreateV2RequestCreativeListInnerVideoMaterial videoMaterial) {
    this.videoMaterial = videoMaterial;
  }



  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CreativeCustomCreativeCreateV2RequestCreativeListInner creativeCustomCreativeCreateV2RequestCreativeListInner = (CreativeCustomCreativeCreateV2RequestCreativeListInner) o;
    return Objects.equals(this.abstractMaterials, creativeCustomCreativeCreateV2RequestCreativeListInner.abstractMaterials) &&
        Objects.equals(this.componentMaterials, creativeCustomCreativeCreateV2RequestCreativeListInner.componentMaterials) &&
        Objects.equals(this.creativeId, creativeCustomCreativeCreateV2RequestCreativeListInner.creativeId) &&
        Objects.equals(this.decorationMaterial, creativeCustomCreativeCreateV2RequestCreativeListInner.decorationMaterial) &&
        Objects.equals(this.derivePosterCid, creativeCustomCreativeCreateV2RequestCreativeListInner.derivePosterCid) &&
        Objects.equals(this.imageMaterials, creativeCustomCreativeCreateV2RequestCreativeListInner.imageMaterials) &&
        Objects.equals(this.imageMode, creativeCustomCreativeCreateV2RequestCreativeListInner.imageMode) &&
        Objects.equals(this.interactiveMaterial, creativeCustomCreativeCreateV2RequestCreativeListInner.interactiveMaterial) &&
        Objects.equals(this.playableMaterial, creativeCustomCreativeCreateV2RequestCreativeListInner.playableMaterial) &&
        Objects.equals(this.subTitleMaterial, creativeCustomCreativeCreateV2RequestCreativeListInner.subTitleMaterial) &&
        Objects.equals(this.thirdPartyId, creativeCustomCreativeCreateV2RequestCreativeListInner.thirdPartyId) &&
        Objects.equals(this.titleMaterial, creativeCustomCreativeCreateV2RequestCreativeListInner.titleMaterial) &&
        Objects.equals(this.videoMaterial, creativeCustomCreativeCreateV2RequestCreativeListInner.videoMaterial);
  }

  @Override
  public int hashCode() {
    return Objects.hash(abstractMaterials, componentMaterials, creativeId, decorationMaterial, derivePosterCid, imageMaterials, imageMode, interactiveMaterial, playableMaterial, subTitleMaterial, thirdPartyId, titleMaterial, videoMaterial);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CreativeCustomCreativeCreateV2RequestCreativeListInner {\n");
    sb.append("    abstractMaterials: ").append(toIndentedString(abstractMaterials)).append("\n");
    sb.append("    componentMaterials: ").append(toIndentedString(componentMaterials)).append("\n");
    sb.append("    creativeId: ").append(toIndentedString(creativeId)).append("\n");
    sb.append("    decorationMaterial: ").append(toIndentedString(decorationMaterial)).append("\n");
    sb.append("    derivePosterCid: ").append(toIndentedString(derivePosterCid)).append("\n");
    sb.append("    imageMaterials: ").append(toIndentedString(imageMaterials)).append("\n");
    sb.append("    imageMode: ").append(toIndentedString(imageMode)).append("\n");
    sb.append("    interactiveMaterial: ").append(toIndentedString(interactiveMaterial)).append("\n");
    sb.append("    playableMaterial: ").append(toIndentedString(playableMaterial)).append("\n");
    sb.append("    subTitleMaterial: ").append(toIndentedString(subTitleMaterial)).append("\n");
    sb.append("    thirdPartyId: ").append(toIndentedString(thirdPartyId)).append("\n");
    sb.append("    titleMaterial: ").append(toIndentedString(titleMaterial)).append("\n");
    sb.append("    videoMaterial: ").append(toIndentedString(videoMaterial)).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("abstract_materials");
    openapiFields.add("component_materials");
    openapiFields.add("creative_id");
    openapiFields.add("decoration_material");
    openapiFields.add("derive_poster_cid");
    openapiFields.add("image_materials");
    openapiFields.add("image_mode");
    openapiFields.add("interactive_material");
    openapiFields.add("playable_material");
    openapiFields.add("sub_title_material");
    openapiFields.add("third_party_id");
    openapiFields.add("title_material");
    openapiFields.add("video_material");

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


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

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

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

       }.nullSafe();
    }
  }

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

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

