001package com.box.sdkgen.schemas.fileversionretentions;
002
003import com.box.sdkgen.internal.Nullable;
004import com.box.sdkgen.internal.NullableFieldTracker;
005import com.box.sdkgen.internal.SerializableObject;
006import com.box.sdkgen.schemas.fileversionretention.FileVersionRetention;
007import com.fasterxml.jackson.annotation.JsonFilter;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import java.util.List;
010import java.util.Objects;
011
012/**
013 * A list of file version retentions.
014 *
015 * <p>**Note**: File retention API is now **deprecated**. To get information about files and file
016 * versions under retention, see [files under
017 * retention](https://developer.box.com/reference/get-retention-policy-assignments-id-files-under-retention)
018 * or [file versions under
019 * retention](https://developer.box.com/reference/get-retention-policy-assignments-id-file-versions-under-retention)
020 * endpoints.
021 */
022@JsonFilter("nullablePropertyFilter")
023public class FileVersionRetentions extends SerializableObject {
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  /** The marker for the start of the next page of results. */
032  @JsonProperty("next_marker")
033  @Nullable
034  protected String nextMarker;
035
036  /** The marker for the start of the previous page of results. */
037  @JsonProperty("prev_marker")
038  @Nullable
039  protected String prevMarker;
040
041  /** A list of file version retentions. */
042  protected List<FileVersionRetention> entries;
043
044  public FileVersionRetentions() {
045    super();
046  }
047
048  protected FileVersionRetentions(Builder builder) {
049    super();
050    this.limit = builder.limit;
051    this.nextMarker = builder.nextMarker;
052    this.prevMarker = builder.prevMarker;
053    this.entries = builder.entries;
054    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
055  }
056
057  public Long getLimit() {
058    return limit;
059  }
060
061  public String getNextMarker() {
062    return nextMarker;
063  }
064
065  public String getPrevMarker() {
066    return prevMarker;
067  }
068
069  public List<FileVersionRetention> getEntries() {
070    return entries;
071  }
072
073  @Override
074  public boolean equals(Object o) {
075    if (this == o) {
076      return true;
077    }
078    if (o == null || getClass() != o.getClass()) {
079      return false;
080    }
081    FileVersionRetentions casted = (FileVersionRetentions) o;
082    return Objects.equals(limit, casted.limit)
083        && Objects.equals(nextMarker, casted.nextMarker)
084        && Objects.equals(prevMarker, casted.prevMarker)
085        && Objects.equals(entries, casted.entries);
086  }
087
088  @Override
089  public int hashCode() {
090    return Objects.hash(limit, nextMarker, prevMarker, entries);
091  }
092
093  @Override
094  public String toString() {
095    return "FileVersionRetentions{"
096        + "limit='"
097        + limit
098        + '\''
099        + ", "
100        + "nextMarker='"
101        + nextMarker
102        + '\''
103        + ", "
104        + "prevMarker='"
105        + prevMarker
106        + '\''
107        + ", "
108        + "entries='"
109        + entries
110        + '\''
111        + "}";
112  }
113
114  public static class Builder extends NullableFieldTracker {
115
116    protected Long limit;
117
118    protected String nextMarker;
119
120    protected String prevMarker;
121
122    protected List<FileVersionRetention> entries;
123
124    public Builder limit(Long limit) {
125      this.limit = limit;
126      return this;
127    }
128
129    public Builder nextMarker(String nextMarker) {
130      this.nextMarker = nextMarker;
131      this.markNullableFieldAsSet("next_marker");
132      return this;
133    }
134
135    public Builder prevMarker(String prevMarker) {
136      this.prevMarker = prevMarker;
137      this.markNullableFieldAsSet("prev_marker");
138      return this;
139    }
140
141    public Builder entries(List<FileVersionRetention> entries) {
142      this.entries = entries;
143      return this;
144    }
145
146    public FileVersionRetentions build() {
147      return new FileVersionRetentions(this);
148    }
149  }
150}