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

public class ApiTimeSeriesMetadata {
  @SerializedName("metricName")
  private String metricName = null;

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

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

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

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

  @SerializedName("unitNumerators")
  private List<String> unitNumerators = null;

  @SerializedName("unitDenominators")
  private List<String> unitDenominators = null;

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

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

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

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

  public ApiTimeSeriesMetadata metricName(String metricName) {
    this.metricName = metricName;
    return this;
  }

   /**
   * The metric name for the time series.
   * @return metricName
  **/
  @Schema(description = "The metric name for the time series.")
  public String getMetricName() {
    return metricName;
  }

  public void setMetricName(String metricName) {
    this.metricName = metricName;
  }

  public ApiTimeSeriesMetadata entityName(String entityName) {
    this.entityName = entityName;
    return this;
  }

   /**
   * The display name for the entity associated with this time series. For example, if this was a time series for an HDFS service the entity name might be something like \&quot;My HDFS Service\&quot;. If it was for a host it might be something like \&quot;myhost.mysite.com\&quot;.
   * @return entityName
  **/
  @Schema(description = "The display name for the entity associated with this time series. For example, if this was a time series for an HDFS service the entity name might be something like \"My HDFS Service\". If it was for a host it might be something like \"myhost.mysite.com\".")
  public String getEntityName() {
    return entityName;
  }

  public void setEntityName(String entityName) {
    this.entityName = entityName;
  }

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

   /**
   * The start time for the time series.
   * @return startTime
  **/
  @Schema(description = "The start time for the time series.")
  public String getStartTime() {
    return startTime;
  }

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

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

   /**
   * The end time for the time series.
   * @return endTime
  **/
  @Schema(description = "The end time for the time series.")
  public String getEndTime() {
    return endTime;
  }

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

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

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

   /**
   * The attributes for the time series. Note that the entityName entry in this map is not the same as the entityName field in this ApiTimeSeriesMetadata. The entityName entry in this map is a unique identifier for the entity and not the name displayed in the UI.  For example, if this was a time series for the YARN Job History Server the entityName entry in this map might be something like \&quot;yarn-JOBHISTORY-6bd17ceb1489aae93fef4c867350d0dd\&quot;
   * @return attributes
  **/
  @Schema(description = "The attributes for the time series. Note that the entityName entry in this map is not the same as the entityName field in this ApiTimeSeriesMetadata. The entityName entry in this map is a unique identifier for the entity and not the name displayed in the UI.  For example, if this was a time series for the YARN Job History Server the entityName entry in this map might be something like \"yarn-JOBHISTORY-6bd17ceb1489aae93fef4c867350d0dd\"")
  public Map<String, String> getAttributes() {
    return attributes;
  }

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

  public ApiTimeSeriesMetadata unitNumerators(List<String> unitNumerators) {
    this.unitNumerators = unitNumerators;
    return this;
  }

  public ApiTimeSeriesMetadata addUnitNumeratorsItem(String unitNumeratorsItem) {
    if (this.unitNumerators == null) {
      this.unitNumerators = new ArrayList<>();
    }
    this.unitNumerators.add(unitNumeratorsItem);
    return this;
  }

   /**
   * The numerators of the units for the time series.
   * @return unitNumerators
  **/
  @Schema(description = "The numerators of the units for the time series.")
  public List<String> getUnitNumerators() {
    return unitNumerators;
  }

  public void setUnitNumerators(List<String> unitNumerators) {
    this.unitNumerators = unitNumerators;
  }

  public ApiTimeSeriesMetadata unitDenominators(List<String> unitDenominators) {
    this.unitDenominators = unitDenominators;
    return this;
  }

  public ApiTimeSeriesMetadata addUnitDenominatorsItem(String unitDenominatorsItem) {
    if (this.unitDenominators == null) {
      this.unitDenominators = new ArrayList<>();
    }
    this.unitDenominators.add(unitDenominatorsItem);
    return this;
  }

   /**
   * The denominators of the units for the time series.
   * @return unitDenominators
  **/
  @Schema(description = "The denominators of the units for the time series.")
  public List<String> getUnitDenominators() {
    return unitDenominators;
  }

  public void setUnitDenominators(List<String> unitDenominators) {
    this.unitDenominators = unitDenominators;
  }

  public ApiTimeSeriesMetadata expression(String expression) {
    this.expression = expression;
    return this;
  }

   /**
   * The tsquery expression that could be used to extract just this stream.
   * @return expression
  **/
  @Schema(description = "The tsquery expression that could be used to extract just this stream.")
  public String getExpression() {
    return expression;
  }

  public void setExpression(String expression) {
    this.expression = expression;
  }

  public ApiTimeSeriesMetadata alias(String alias) {
    this.alias = alias;
    return this;
  }

   /**
   * The alias for this stream&#x27;s metric. Aliases correspond to use of the &#x27;as&#x27; keyword in the tsquery.
   * @return alias
  **/
  @Schema(description = "The alias for this stream's metric. Aliases correspond to use of the 'as' keyword in the tsquery.")
  public String getAlias() {
    return alias;
  }

  public void setAlias(String alias) {
    this.alias = alias;
  }

  public ApiTimeSeriesMetadata metricCollectionFrequencyMs(java.math.BigDecimal metricCollectionFrequencyMs) {
    this.metricCollectionFrequencyMs = metricCollectionFrequencyMs;
    return this;
  }

   /**
   * The minimum frequency at which the underlying metric for this stream is collected. Note that this can be null if the stream returns irregularly sampled data.
   * @return metricCollectionFrequencyMs
  **/
  @Schema(description = "The minimum frequency at which the underlying metric for this stream is collected. Note that this can be null if the stream returns irregularly sampled data.")
  public java.math.BigDecimal getMetricCollectionFrequencyMs() {
    return metricCollectionFrequencyMs;
  }

  public void setMetricCollectionFrequencyMs(java.math.BigDecimal metricCollectionFrequencyMs) {
    this.metricCollectionFrequencyMs = metricCollectionFrequencyMs;
  }

  public ApiTimeSeriesMetadata rollupUsed(String rollupUsed) {
    this.rollupUsed = rollupUsed;
    return this;
  }

   /**
   * The aggregate rollup for the returned data. This can be TEN_MINUTELY, HOURLY, SIX_HOURLY, DAILY, or WEEKLY.
   * @return rollupUsed
  **/
  @Schema(description = "The aggregate rollup for the returned data. This can be TEN_MINUTELY, HOURLY, SIX_HOURLY, DAILY, or WEEKLY.")
  public String getRollupUsed() {
    return rollupUsed;
  }

  public void setRollupUsed(String rollupUsed) {
    this.rollupUsed = rollupUsed;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiTimeSeriesMetadata apiTimeSeriesMetadata = (ApiTimeSeriesMetadata) o;
    return Objects.equals(this.metricName, apiTimeSeriesMetadata.metricName) &&
        Objects.equals(this.entityName, apiTimeSeriesMetadata.entityName) &&
        Objects.equals(this.startTime, apiTimeSeriesMetadata.startTime) &&
        Objects.equals(this.endTime, apiTimeSeriesMetadata.endTime) &&
        Objects.equals(this.attributes, apiTimeSeriesMetadata.attributes) &&
        Objects.equals(this.unitNumerators, apiTimeSeriesMetadata.unitNumerators) &&
        Objects.equals(this.unitDenominators, apiTimeSeriesMetadata.unitDenominators) &&
        Objects.equals(this.expression, apiTimeSeriesMetadata.expression) &&
        Objects.equals(this.alias, apiTimeSeriesMetadata.alias) &&
        Objects.equals(this.metricCollectionFrequencyMs, apiTimeSeriesMetadata.metricCollectionFrequencyMs) &&
        Objects.equals(this.rollupUsed, apiTimeSeriesMetadata.rollupUsed);
  }

  @Override
  public int hashCode() {
    return Objects.hash(metricName, entityName, startTime, endTime, attributes, unitNumerators, unitDenominators, expression, alias, metricCollectionFrequencyMs, rollupUsed);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiTimeSeriesMetadata {\n");
    
    sb.append("    metricName: ").append(toIndentedString(metricName)).append("\n");
    sb.append("    entityName: ").append(toIndentedString(entityName)).append("\n");
    sb.append("    startTime: ").append(toIndentedString(startTime)).append("\n");
    sb.append("    endTime: ").append(toIndentedString(endTime)).append("\n");
    sb.append("    attributes: ").append(toIndentedString(attributes)).append("\n");
    sb.append("    unitNumerators: ").append(toIndentedString(unitNumerators)).append("\n");
    sb.append("    unitDenominators: ").append(toIndentedString(unitDenominators)).append("\n");
    sb.append("    expression: ").append(toIndentedString(expression)).append("\n");
    sb.append("    alias: ").append(toIndentedString(alias)).append("\n");
    sb.append("    metricCollectionFrequencyMs: ").append(toIndentedString(metricCollectionFrequencyMs)).append("\n");
    sb.append("    rollupUsed: ").append(toIndentedString(rollupUsed)).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    ");
  }

}
