/*
 * Cloudera Manager API
 * <h1>Cloudera Manager API v57</h1>       <p>Introduced in Cloudera Manager 7.13.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>
 *
 * OpenAPI spec version: 7.13.1
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package com.cloudera.api.swagger.model;

import java.util.Objects;
import java.util.Arrays;
import com.cloudera.api.swagger.model.ApiEventAttribute;
import com.cloudera.api.swagger.model.ApiEventCategory;
import com.cloudera.api.swagger.model.ApiEventSeverity;
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 io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
 * Events model noteworthy incidents in Cloudera Manager or the managed Hadoop cluster. An event carries its event category, severity, and a string content. They also have generic attributes, which are free-form key value pairs. Important events may be promoted into alerts.
 */
@Schema(description = "Events model noteworthy incidents in Cloudera Manager or the managed Hadoop cluster. An event carries its event category, severity, and a string content. They also have generic attributes, which are free-form key value pairs. Important events may be promoted into alerts.")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

public class ApiEvent {
  @SerializedName("id")
  private String id = null;

  @SerializedName("content")
  private String content = null;

  @SerializedName("timeOccurred")
  private String timeOccurred = null;

  @SerializedName("timeReceived")
  private String timeReceived = null;

  @SerializedName("category")
  private ApiEventCategory category = null;

  @SerializedName("severity")
  private ApiEventSeverity severity = null;

  @SerializedName("alert")
  private Boolean alert = null;

  @SerializedName("attributes")
  private List<ApiEventAttribute> attributes = null;

  public ApiEvent id(String id) {
    this.id = id;
    return this;
  }

   /**
   * A unique ID for this event.
   * @return id
  **/
  @Schema(description = "A unique ID for this event.")
  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public ApiEvent content(String content) {
    this.content = content;
    return this;
  }

   /**
   * The content payload of this event.
   * @return content
  **/
  @Schema(description = "The content payload of this event.")
  public String getContent() {
    return content;
  }

  public void setContent(String content) {
    this.content = content;
  }

  public ApiEvent timeOccurred(String timeOccurred) {
    this.timeOccurred = timeOccurred;
    return this;
  }

   /**
   * When the event was generated.
   * @return timeOccurred
  **/
  @Schema(description = "When the event was generated.")
  public String getTimeOccurred() {
    return timeOccurred;
  }

  public void setTimeOccurred(String timeOccurred) {
    this.timeOccurred = timeOccurred;
  }

  public ApiEvent timeReceived(String timeReceived) {
    this.timeReceived = timeReceived;
    return this;
  }

   /**
   * When the event was stored by Cloudera Manager. Events do not arrive in the order that they are generated. If you are writing an event poller, this is a useful field to query.
   * @return timeReceived
  **/
  @Schema(description = "When the event was stored by Cloudera Manager. Events do not arrive in the order that they are generated. If you are writing an event poller, this is a useful field to query.")
  public String getTimeReceived() {
    return timeReceived;
  }

  public void setTimeReceived(String timeReceived) {
    this.timeReceived = timeReceived;
  }

  public ApiEvent category(ApiEventCategory category) {
    this.category = category;
    return this;
  }

   /**
   * Get category
   * @return category
  **/
  @Schema(description = "")
  public ApiEventCategory getCategory() {
    return category;
  }

  public void setCategory(ApiEventCategory category) {
    this.category = category;
  }

  public ApiEvent severity(ApiEventSeverity severity) {
    this.severity = severity;
    return this;
  }

   /**
   * Get severity
   * @return severity
  **/
  @Schema(description = "")
  public ApiEventSeverity getSeverity() {
    return severity;
  }

  public void setSeverity(ApiEventSeverity severity) {
    this.severity = severity;
  }

  public ApiEvent alert(Boolean alert) {
    this.alert = alert;
    return this;
  }

   /**
   * Whether the event is promoted to an alert according to configuration. Defaults to false
   * @return alert
  **/
  @Schema(description = "Whether the event is promoted to an alert according to configuration. Defaults to false")
  public Boolean isAlert() {
    return alert;
  }

  public void setAlert(Boolean alert) {
    this.alert = alert;
  }

  public ApiEvent attributes(List<ApiEventAttribute> attributes) {
    this.attributes = attributes;
    return this;
  }

  public ApiEvent addAttributesItem(ApiEventAttribute attributesItem) {
    if (this.attributes == null) {
      this.attributes = new ArrayList<>();
    }
    this.attributes.add(attributesItem);
    return this;
  }

   /**
   * A list of key-value attribute pairs.
   * @return attributes
  **/
  @Schema(description = "A list of key-value attribute pairs.")
  public List<ApiEventAttribute> getAttributes() {
    return attributes;
  }

  public void setAttributes(List<ApiEventAttribute> attributes) {
    this.attributes = attributes;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiEvent apiEvent = (ApiEvent) o;
    return Objects.equals(this.id, apiEvent.id) &&
        Objects.equals(this.content, apiEvent.content) &&
        Objects.equals(this.timeOccurred, apiEvent.timeOccurred) &&
        Objects.equals(this.timeReceived, apiEvent.timeReceived) &&
        Objects.equals(this.category, apiEvent.category) &&
        Objects.equals(this.severity, apiEvent.severity) &&
        Objects.equals(this.alert, apiEvent.alert) &&
        Objects.equals(this.attributes, apiEvent.attributes);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, content, timeOccurred, timeReceived, category, severity, alert, attributes);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiEvent {\n");
    
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    content: ").append(toIndentedString(content)).append("\n");
    sb.append("    timeOccurred: ").append(toIndentedString(timeOccurred)).append("\n");
    sb.append("    timeReceived: ").append(toIndentedString(timeReceived)).append("\n");
    sb.append("    category: ").append(toIndentedString(category)).append("\n");
    sb.append("    severity: ").append(toIndentedString(severity)).append("\n");
    sb.append("    alert: ").append(toIndentedString(alert)).append("\n");
    sb.append("    attributes: ").append(toIndentedString(attributes)).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(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}
