001package com.box.sdkgen.schemas.v2026r0.queryrequestbodyv2026r0;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.box.sdkgen.schemas.v2026r0.queryancestorreferencev2026r0.QueryAncestorReferenceV2026R0;
006import com.fasterxml.jackson.annotation.JsonFilter;
007import com.fasterxml.jackson.annotation.JsonProperty;
008import java.util.List;
009import java.util.Map;
010import java.util.Objects;
011
012@JsonFilter("nullablePropertyFilter")
013public class QueryRequestBodyV2026R0QueryField extends SerializableObject {
014
015  /**
016   * A logical expression used to filter the dataset, similar to an SQL `WHERE` clause. May include
017   * named parameters referenced as `:placeholder`.
018   */
019  protected final String predicate;
020
021  /**
022   * A map of placeholder names (without the `:` prefix) to their values. Required only when the
023   * predicate contains parameter placeholders. The type of each value must match the type of the
024   * field it is compared to.
025   */
026  protected Map<String, Object> params;
027
028  /**
029   * Restricts results to the specified ancestor entities and their recursive descendants. The user
030   * must have read access to every listed ancestor.
031   */
032  protected List<QueryAncestorReferenceV2026R0> ancestors;
033
034  public QueryRequestBodyV2026R0QueryField(@JsonProperty("predicate") String predicate) {
035    super();
036    this.predicate = predicate;
037  }
038
039  protected QueryRequestBodyV2026R0QueryField(Builder builder) {
040    super();
041    this.predicate = builder.predicate;
042    this.params = builder.params;
043    this.ancestors = builder.ancestors;
044    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
045  }
046
047  public String getPredicate() {
048    return predicate;
049  }
050
051  public Map<String, Object> getParams() {
052    return params;
053  }
054
055  public List<QueryAncestorReferenceV2026R0> getAncestors() {
056    return ancestors;
057  }
058
059  @Override
060  public boolean equals(Object o) {
061    if (this == o) {
062      return true;
063    }
064    if (o == null || getClass() != o.getClass()) {
065      return false;
066    }
067    QueryRequestBodyV2026R0QueryField casted = (QueryRequestBodyV2026R0QueryField) o;
068    return Objects.equals(predicate, casted.predicate)
069        && Objects.equals(params, casted.params)
070        && Objects.equals(ancestors, casted.ancestors);
071  }
072
073  @Override
074  public int hashCode() {
075    return Objects.hash(predicate, params, ancestors);
076  }
077
078  @Override
079  public String toString() {
080    return "QueryRequestBodyV2026R0QueryField{"
081        + "predicate='"
082        + predicate
083        + '\''
084        + ", "
085        + "params='"
086        + params
087        + '\''
088        + ", "
089        + "ancestors='"
090        + ancestors
091        + '\''
092        + "}";
093  }
094
095  public static class Builder extends NullableFieldTracker {
096
097    protected final String predicate;
098
099    protected Map<String, Object> params;
100
101    protected List<QueryAncestorReferenceV2026R0> ancestors;
102
103    public Builder(String predicate) {
104      super();
105      this.predicate = predicate;
106    }
107
108    public Builder params(Map<String, Object> params) {
109      this.params = params;
110      return this;
111    }
112
113    public Builder ancestors(List<QueryAncestorReferenceV2026R0> ancestors) {
114      this.ancestors = ancestors;
115      return this;
116    }
117
118    public QueryRequestBodyV2026R0QueryField build() {
119      return new QueryRequestBodyV2026R0QueryField(this);
120    }
121  }
122}