001package com.box.sdkgen.schemas.v2026r0.queryinsightentryv2026r0;
002
003import com.box.sdkgen.internal.SerializableObject;
004import com.box.sdkgen.schemas.v2026r0.queryinsightmetricresultv2026r0.QueryInsightMetricResultV2026R0;
005import com.box.sdkgen.serialization.json.EnumWrapper;
006import com.fasterxml.jackson.annotation.JsonFilter;
007import com.fasterxml.jackson.annotation.JsonProperty;
008import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
009import com.fasterxml.jackson.databind.annotation.JsonSerialize;
010import java.util.List;
011import java.util.Map;
012import java.util.Objects;
013
014/**
015 * A single computed insight entry, containing its grouping keys (if applicable) and the computed
016 * metrics.
017 */
018@JsonFilter("nullablePropertyFilter")
019public class QueryInsightEntryV2026R0 extends SerializableObject {
020
021  /**
022   * The grouping key values associated with the entry. Contains one value per `group_by` field for
023   * `group` entries, and is empty for `overall` and `other` entries.
024   */
025  protected final List<String> key;
026
027  /** The type of insight entry, indicating how the associated metrics are aggregated. */
028  @JsonDeserialize(
029      using = QueryInsightEntryV2026R0TypeField.QueryInsightEntryV2026R0TypeFieldDeserializer.class)
030  @JsonSerialize(
031      using = QueryInsightEntryV2026R0TypeField.QueryInsightEntryV2026R0TypeFieldSerializer.class)
032  protected final EnumWrapper<QueryInsightEntryV2026R0TypeField> type;
033
034  /**
035   * A map of metric aliases to their computed results. For `other` entries, the count is reported
036   * under the `totalCountBeyondTopGroups` key.
037   */
038  protected final Map<String, QueryInsightMetricResultV2026R0> metrics;
039
040  public QueryInsightEntryV2026R0(
041      List<String> key,
042      QueryInsightEntryV2026R0TypeField type,
043      Map<String, QueryInsightMetricResultV2026R0> metrics) {
044    super();
045    this.key = key;
046    this.type = new EnumWrapper<QueryInsightEntryV2026R0TypeField>(type);
047    this.metrics = metrics;
048  }
049
050  public QueryInsightEntryV2026R0(
051      @JsonProperty("key") List<String> key,
052      @JsonProperty("type") EnumWrapper<QueryInsightEntryV2026R0TypeField> type,
053      @JsonProperty("metrics") Map<String, QueryInsightMetricResultV2026R0> metrics) {
054    super();
055    this.key = key;
056    this.type = type;
057    this.metrics = metrics;
058  }
059
060  public List<String> getKey() {
061    return key;
062  }
063
064  public EnumWrapper<QueryInsightEntryV2026R0TypeField> getType() {
065    return type;
066  }
067
068  public Map<String, QueryInsightMetricResultV2026R0> getMetrics() {
069    return metrics;
070  }
071
072  @Override
073  public boolean equals(Object o) {
074    if (this == o) {
075      return true;
076    }
077    if (o == null || getClass() != o.getClass()) {
078      return false;
079    }
080    QueryInsightEntryV2026R0 casted = (QueryInsightEntryV2026R0) o;
081    return Objects.equals(key, casted.key)
082        && Objects.equals(type, casted.type)
083        && Objects.equals(metrics, casted.metrics);
084  }
085
086  @Override
087  public int hashCode() {
088    return Objects.hash(key, type, metrics);
089  }
090
091  @Override
092  public String toString() {
093    return "QueryInsightEntryV2026R0{"
094        + "key='"
095        + key
096        + '\''
097        + ", "
098        + "type='"
099        + type
100        + '\''
101        + ", "
102        + "metrics='"
103        + metrics
104        + '\''
105        + "}";
106  }
107}