001package com.box.sdkgen.schemas.groups;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.box.sdkgen.schemas.groupfull.GroupFull;
006import com.fasterxml.jackson.annotation.JsonFilter;
007import com.fasterxml.jackson.annotation.JsonProperty;
008import java.util.List;
009import java.util.Objects;
010
011/** A list of groups. */
012@JsonFilter("nullablePropertyFilter")
013public class Groups extends SerializableObject {
014
015  /**
016   * One greater than the offset of the last entry in the entire collection. The total number of
017   * entries in the collection may be less than `total_count`.
018   *
019   * <p>This field is only returned for calls that use offset-based pagination. For marker-based
020   * paginated APIs, this field will be omitted.
021   */
022  @JsonProperty("total_count")
023  protected Long totalCount;
024
025  /**
026   * The limit that was used for these entries. This will be the same as the `limit` query parameter
027   * unless that value exceeded the maximum value allowed. The maximum value varies by API.
028   */
029  protected Long limit;
030
031  /**
032   * The 0-based offset of the first entry in this set. This will be the same as the `offset` query
033   * parameter.
034   *
035   * <p>This field is only returned for calls that use offset-based pagination. For marker-based
036   * paginated APIs, this field will be omitted.
037   */
038  protected Long offset;
039
040  /**
041   * The order by which items are returned.
042   *
043   * <p>This field is only returned for calls that use offset-based pagination. For marker-based
044   * paginated APIs, this field will be omitted.
045   */
046  protected List<GroupsOrderField> order;
047
048  /** A list of groups. */
049  protected List<GroupFull> entries;
050
051  public Groups() {
052    super();
053  }
054
055  protected Groups(Builder builder) {
056    super();
057    this.totalCount = builder.totalCount;
058    this.limit = builder.limit;
059    this.offset = builder.offset;
060    this.order = builder.order;
061    this.entries = builder.entries;
062    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
063  }
064
065  public Long getTotalCount() {
066    return totalCount;
067  }
068
069  public Long getLimit() {
070    return limit;
071  }
072
073  public Long getOffset() {
074    return offset;
075  }
076
077  public List<GroupsOrderField> getOrder() {
078    return order;
079  }
080
081  public List<GroupFull> getEntries() {
082    return entries;
083  }
084
085  @Override
086  public boolean equals(Object o) {
087    if (this == o) {
088      return true;
089    }
090    if (o == null || getClass() != o.getClass()) {
091      return false;
092    }
093    Groups casted = (Groups) o;
094    return Objects.equals(totalCount, casted.totalCount)
095        && Objects.equals(limit, casted.limit)
096        && Objects.equals(offset, casted.offset)
097        && Objects.equals(order, casted.order)
098        && Objects.equals(entries, casted.entries);
099  }
100
101  @Override
102  public int hashCode() {
103    return Objects.hash(totalCount, limit, offset, order, entries);
104  }
105
106  @Override
107  public String toString() {
108    return "Groups{"
109        + "totalCount='"
110        + totalCount
111        + '\''
112        + ", "
113        + "limit='"
114        + limit
115        + '\''
116        + ", "
117        + "offset='"
118        + offset
119        + '\''
120        + ", "
121        + "order='"
122        + order
123        + '\''
124        + ", "
125        + "entries='"
126        + entries
127        + '\''
128        + "}";
129  }
130
131  public static class Builder extends NullableFieldTracker {
132
133    protected Long totalCount;
134
135    protected Long limit;
136
137    protected Long offset;
138
139    protected List<GroupsOrderField> order;
140
141    protected List<GroupFull> entries;
142
143    public Builder totalCount(Long totalCount) {
144      this.totalCount = totalCount;
145      return this;
146    }
147
148    public Builder limit(Long limit) {
149      this.limit = limit;
150      return this;
151    }
152
153    public Builder offset(Long offset) {
154      this.offset = offset;
155      return this;
156    }
157
158    public Builder order(List<GroupsOrderField> order) {
159      this.order = order;
160      return this;
161    }
162
163    public Builder entries(List<GroupFull> entries) {
164      this.entries = entries;
165      return this;
166    }
167
168    public Groups build() {
169      return new Groups(this);
170    }
171  }
172}