/*
 * 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.ApiHostRef;
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.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Represents an Impala Query.
 */
@Schema(description = "Represents an Impala Query.")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

public class ApiImpalaQuery {
  @SerializedName("queryId")
  private String queryId = null;

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

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

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

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

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

  @SerializedName("rowsProduced")
  private java.math.BigDecimal rowsProduced = null;

  @SerializedName("attributes")
  private Map<String, String> attributes = null;

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

  @SerializedName("coordinator")
  private ApiHostRef coordinator = null;

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

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

  @SerializedName("durationMillis")
  private java.math.BigDecimal durationMillis = null;

  public ApiImpalaQuery queryId(String queryId) {
    this.queryId = queryId;
    return this;
  }

   /**
   * The query id.
   * @return queryId
  **/
  @Schema(description = "The query id.")
  public String getQueryId() {
    return queryId;
  }

  public void setQueryId(String queryId) {
    this.queryId = queryId;
  }

  public ApiImpalaQuery statement(String statement) {
    this.statement = statement;
    return this;
  }

   /**
   * The SQL statement for the query.
   * @return statement
  **/
  @Schema(description = "The SQL statement for the query.")
  public String getStatement() {
    return statement;
  }

  public void setStatement(String statement) {
    this.statement = statement;
  }

  public ApiImpalaQuery queryType(String queryType) {
    this.queryType = queryType;
    return this;
  }

   /**
   * The query type. The possible values are: DML, DDL, QUERY and UNKNOWN. See the Impala documentation for more details.
   * @return queryType
  **/
  @Schema(description = "The query type. The possible values are: DML, DDL, QUERY and UNKNOWN. See the Impala documentation for more details.")
  public String getQueryType() {
    return queryType;
  }

  public void setQueryType(String queryType) {
    this.queryType = queryType;
  }

  public ApiImpalaQuery queryState(String queryState) {
    this.queryState = queryState;
    return this;
  }

   /**
   * The query state. The possible values are: CREATED, INITIALIZED, COMPILED, RUNNING, FINISHED, EXCEPTION, and UNKNOWN. See the Impala documentation for more details.
   * @return queryState
  **/
  @Schema(description = "The query state. The possible values are: CREATED, INITIALIZED, COMPILED, RUNNING, FINISHED, EXCEPTION, and UNKNOWN. See the Impala documentation for more details.")
  public String getQueryState() {
    return queryState;
  }

  public void setQueryState(String queryState) {
    this.queryState = queryState;
  }

  public ApiImpalaQuery startTime(String startTime) {
    this.startTime = startTime;
    return this;
  }

   /**
   * The time the query was issued.
   * @return startTime
  **/
  @Schema(description = "The time the query was issued.")
  public String getStartTime() {
    return startTime;
  }

  public void setStartTime(String startTime) {
    this.startTime = startTime;
  }

  public ApiImpalaQuery endTime(String endTime) {
    this.endTime = endTime;
    return this;
  }

   /**
   * The time the query finished. If the query hasn&#x27;t finished then this will return null.
   * @return endTime
  **/
  @Schema(description = "The time the query finished. If the query hasn't finished then this will return null.")
  public String getEndTime() {
    return endTime;
  }

  public void setEndTime(String endTime) {
    this.endTime = endTime;
  }

  public ApiImpalaQuery rowsProduced(java.math.BigDecimal rowsProduced) {
    this.rowsProduced = rowsProduced;
    return this;
  }

   /**
   * The number of rows produced by the query. If the query hasn&#x27;t completed this will return null.
   * @return rowsProduced
  **/
  @Schema(description = "The number of rows produced by the query. If the query hasn't completed this will return null.")
  public java.math.BigDecimal getRowsProduced() {
    return rowsProduced;
  }

  public void setRowsProduced(java.math.BigDecimal rowsProduced) {
    this.rowsProduced = rowsProduced;
  }

  public ApiImpalaQuery attributes(Map<String, String> attributes) {
    this.attributes = attributes;
    return this;
  }

  public ApiImpalaQuery putAttributesItem(String key, String attributesItem) {
    if (this.attributes == null) {
      this.attributes = new HashMap<>();
    }
    this.attributes.put(key, attributesItem);
    return this;
  }

   /**
   * A map of additional query attributes which is generated by Cloudera Manager.
   * @return attributes
  **/
  @Schema(description = "A map of additional query attributes which is generated by Cloudera Manager.")
  public Map<String, String> getAttributes() {
    return attributes;
  }

  public void setAttributes(Map<String, String> attributes) {
    this.attributes = attributes;
  }

  public ApiImpalaQuery user(String user) {
    this.user = user;
    return this;
  }

   /**
   * The user who issued this query.
   * @return user
  **/
  @Schema(description = "The user who issued this query.")
  public String getUser() {
    return user;
  }

  public void setUser(String user) {
    this.user = user;
  }

  public ApiImpalaQuery coordinator(ApiHostRef coordinator) {
    this.coordinator = coordinator;
    return this;
  }

   /**
   * Get coordinator
   * @return coordinator
  **/
  @Schema(description = "")
  public ApiHostRef getCoordinator() {
    return coordinator;
  }

  public void setCoordinator(ApiHostRef coordinator) {
    this.coordinator = coordinator;
  }

  public ApiImpalaQuery detailsAvailable(Boolean detailsAvailable) {
    this.detailsAvailable = detailsAvailable;
    return this;
  }

   /**
   * Whether we have a detailed runtime profile available for the query. This profile is available at the endpoint /queries/{QUERY_ID}.
   * @return detailsAvailable
  **/
  @Schema(description = "Whether we have a detailed runtime profile available for the query. This profile is available at the endpoint /queries/{QUERY_ID}.")
  public Boolean isDetailsAvailable() {
    return detailsAvailable;
  }

  public void setDetailsAvailable(Boolean detailsAvailable) {
    this.detailsAvailable = detailsAvailable;
  }

  public ApiImpalaQuery database(String database) {
    this.database = database;
    return this;
  }

   /**
   * The database on which this query was issued.
   * @return database
  **/
  @Schema(description = "The database on which this query was issued.")
  public String getDatabase() {
    return database;
  }

  public void setDatabase(String database) {
    this.database = database;
  }

  public ApiImpalaQuery durationMillis(java.math.BigDecimal durationMillis) {
    this.durationMillis = durationMillis;
    return this;
  }

   /**
   * The duration of the query in milliseconds. If the query hasn&#x27;t completed then this will return null.
   * @return durationMillis
  **/
  @Schema(description = "The duration of the query in milliseconds. If the query hasn't completed then this will return null.")
  public java.math.BigDecimal getDurationMillis() {
    return durationMillis;
  }

  public void setDurationMillis(java.math.BigDecimal durationMillis) {
    this.durationMillis = durationMillis;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiImpalaQuery apiImpalaQuery = (ApiImpalaQuery) o;
    return Objects.equals(this.queryId, apiImpalaQuery.queryId) &&
        Objects.equals(this.statement, apiImpalaQuery.statement) &&
        Objects.equals(this.queryType, apiImpalaQuery.queryType) &&
        Objects.equals(this.queryState, apiImpalaQuery.queryState) &&
        Objects.equals(this.startTime, apiImpalaQuery.startTime) &&
        Objects.equals(this.endTime, apiImpalaQuery.endTime) &&
        Objects.equals(this.rowsProduced, apiImpalaQuery.rowsProduced) &&
        Objects.equals(this.attributes, apiImpalaQuery.attributes) &&
        Objects.equals(this.user, apiImpalaQuery.user) &&
        Objects.equals(this.coordinator, apiImpalaQuery.coordinator) &&
        Objects.equals(this.detailsAvailable, apiImpalaQuery.detailsAvailable) &&
        Objects.equals(this.database, apiImpalaQuery.database) &&
        Objects.equals(this.durationMillis, apiImpalaQuery.durationMillis);
  }

  @Override
  public int hashCode() {
    return Objects.hash(queryId, statement, queryType, queryState, startTime, endTime, rowsProduced, attributes, user, coordinator, detailsAvailable, database, durationMillis);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiImpalaQuery {\n");
    
    sb.append("    queryId: ").append(toIndentedString(queryId)).append("\n");
    sb.append("    statement: ").append(toIndentedString(statement)).append("\n");
    sb.append("    queryType: ").append(toIndentedString(queryType)).append("\n");
    sb.append("    queryState: ").append(toIndentedString(queryState)).append("\n");
    sb.append("    startTime: ").append(toIndentedString(startTime)).append("\n");
    sb.append("    endTime: ").append(toIndentedString(endTime)).append("\n");
    sb.append("    rowsProduced: ").append(toIndentedString(rowsProduced)).append("\n");
    sb.append("    attributes: ").append(toIndentedString(attributes)).append("\n");
    sb.append("    user: ").append(toIndentedString(user)).append("\n");
    sb.append("    coordinator: ").append(toIndentedString(coordinator)).append("\n");
    sb.append("    detailsAvailable: ").append(toIndentedString(detailsAvailable)).append("\n");
    sb.append("    database: ").append(toIndentedString(database)).append("\n");
    sb.append("    durationMillis: ").append(toIndentedString(durationMillis)).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    ");
  }

}
