/*
 * 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.ApiTimeSeriesData;
import com.cloudera.api.swagger.model.ApiTimeSeriesMetadata;
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;
/**
 * A time series represents a stream of data points. Each data point contains a time and a value. Time series are returned by executing a tsquery.
 */
@Schema(description = "A time series represents a stream of data points. Each data point contains a time and a value. Time series are returned by executing a tsquery.")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

public class ApiTimeSeries {
  @SerializedName("metadata")
  private ApiTimeSeriesMetadata metadata = null;

  @SerializedName("data")
  private List<ApiTimeSeriesData> data = null;

  public ApiTimeSeries metadata(ApiTimeSeriesMetadata metadata) {
    this.metadata = metadata;
    return this;
  }

   /**
   * Get metadata
   * @return metadata
  **/
  @Schema(description = "")
  public ApiTimeSeriesMetadata getMetadata() {
    return metadata;
  }

  public void setMetadata(ApiTimeSeriesMetadata metadata) {
    this.metadata = metadata;
  }

  public ApiTimeSeries data(List<ApiTimeSeriesData> data) {
    this.data = data;
    return this;
  }

  public ApiTimeSeries addDataItem(ApiTimeSeriesData dataItem) {
    if (this.data == null) {
      this.data = new ArrayList<>();
    }
    this.data.add(dataItem);
    return this;
  }

   /**
   * List of metric data points.
   * @return data
  **/
  @Schema(description = "List of metric data points.")
  public List<ApiTimeSeriesData> getData() {
    return data;
  }

  public void setData(List<ApiTimeSeriesData> data) {
    this.data = data;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiTimeSeries apiTimeSeries = (ApiTimeSeries) o;
    return Objects.equals(this.metadata, apiTimeSeries.metadata) &&
        Objects.equals(this.data, apiTimeSeries.data);
  }

  @Override
  public int hashCode() {
    return Objects.hash(metadata, data);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiTimeSeries {\n");
    
    sb.append("    metadata: ").append(toIndentedString(metadata)).append("\n");
    sb.append("    data: ").append(toIndentedString(data)).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    ");
  }

}
