• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-java-sdk / #5922

17 Dec 2025 05:03PM UTC coverage: 35.498% (-0.4%) from 35.917%
#5922

push

github

web-flow
fix: add taxonomy to Metadata Field (read) definition (box/box-openapi#572) (#1644)

Co-authored-by: box-sdk-build <box-sdk-build@box.com>

2 of 2 new or added lines in 1 file covered. (100.0%)

535 existing lines in 31 files now uncovered.

18926 of 53316 relevant lines covered (35.5%)

0.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/box/sdkgen/schemas/fileversionretention/FileVersionRetention.java
1
package com.box.sdkgen.schemas.fileversionretention;
2

3
import com.box.sdkgen.internal.NullableFieldTracker;
4
import com.box.sdkgen.internal.SerializableObject;
5
import com.box.sdkgen.internal.utils.DateTimeUtils;
6
import com.box.sdkgen.schemas.filemini.FileMini;
7
import com.box.sdkgen.schemas.fileversionmini.FileVersionMini;
8
import com.box.sdkgen.schemas.retentionpolicymini.RetentionPolicyMini;
9
import com.box.sdkgen.serialization.json.EnumWrapper;
10
import com.fasterxml.jackson.annotation.JsonFilter;
11
import com.fasterxml.jackson.annotation.JsonProperty;
12
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
13
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
14
import java.time.OffsetDateTime;
15
import java.util.Objects;
16

17
/**
18
 * A retention policy blocks permanent deletion of content for a specified amount of time. Admins
19
 * can apply policies to specified folders, or an entire enterprise. A file version retention is a
20
 * record for a retained file version. To use this feature, you must have the manage retention
21
 * policies scope enabled for your API key in your application management console.
22
 *
23
 * <p>**Note**: File retention API is now **deprecated**. To get information about files and file
24
 * versions under retention, see [files under
25
 * retention](https://developer.box.com/reference/get-retention-policy-assignments-id-files-under-retention)
26
 * or [file versions under
27
 * retention](https://developer.box.com/reference/get-retention-policy-assignments-id-file-versions-under-retention)
28
 * endpoints.
29
 */
30
@JsonFilter("nullablePropertyFilter")
31
public class FileVersionRetention extends SerializableObject {
32

33
  /** The unique identifier for this file version retention. */
34
  protected String id;
35

36
  /** The value will always be `file_version_retention`. */
37
  @JsonDeserialize(
38
      using = FileVersionRetentionTypeField.FileVersionRetentionTypeFieldDeserializer.class)
39
  @JsonSerialize(
40
      using = FileVersionRetentionTypeField.FileVersionRetentionTypeFieldSerializer.class)
41
  protected EnumWrapper<FileVersionRetentionTypeField> type;
42

43
  @JsonProperty("file_version")
44
  protected FileVersionMini fileVersion;
45

46
  protected FileMini file;
47

48
  /** When this file version retention object was created. */
49
  @JsonProperty("applied_at")
50
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
51
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
52
  protected OffsetDateTime appliedAt;
53

54
  /** When the retention expires on this file version retention. */
55
  @JsonProperty("disposition_at")
56
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
57
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
58
  protected OffsetDateTime dispositionAt;
59

60
  @JsonProperty("winning_retention_policy")
61
  protected RetentionPolicyMini winningRetentionPolicy;
62

63
  public FileVersionRetention() {
UNCOV
64
    super();
×
UNCOV
65
  }
×
66

67
  protected FileVersionRetention(Builder builder) {
68
    super();
×
69
    this.id = builder.id;
×
70
    this.type = builder.type;
×
71
    this.fileVersion = builder.fileVersion;
×
72
    this.file = builder.file;
×
73
    this.appliedAt = builder.appliedAt;
×
74
    this.dispositionAt = builder.dispositionAt;
×
75
    this.winningRetentionPolicy = builder.winningRetentionPolicy;
×
UNCOV
76
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
UNCOV
77
  }
×
78

79
  public String getId() {
UNCOV
80
    return id;
×
81
  }
82

83
  public EnumWrapper<FileVersionRetentionTypeField> getType() {
UNCOV
84
    return type;
×
85
  }
86

87
  public FileVersionMini getFileVersion() {
UNCOV
88
    return fileVersion;
×
89
  }
90

91
  public FileMini getFile() {
UNCOV
92
    return file;
×
93
  }
94

95
  public OffsetDateTime getAppliedAt() {
UNCOV
96
    return appliedAt;
×
97
  }
98

99
  public OffsetDateTime getDispositionAt() {
UNCOV
100
    return dispositionAt;
×
101
  }
102

103
  public RetentionPolicyMini getWinningRetentionPolicy() {
UNCOV
104
    return winningRetentionPolicy;
×
105
  }
106

107
  @Override
108
  public boolean equals(Object o) {
UNCOV
109
    if (this == o) {
×
110
      return true;
×
111
    }
UNCOV
112
    if (o == null || getClass() != o.getClass()) {
×
113
      return false;
×
114
    }
115
    FileVersionRetention casted = (FileVersionRetention) o;
×
116
    return Objects.equals(id, casted.id)
×
117
        && Objects.equals(type, casted.type)
×
118
        && Objects.equals(fileVersion, casted.fileVersion)
×
119
        && Objects.equals(file, casted.file)
×
120
        && Objects.equals(appliedAt, casted.appliedAt)
×
UNCOV
121
        && Objects.equals(dispositionAt, casted.dispositionAt)
×
UNCOV
122
        && Objects.equals(winningRetentionPolicy, casted.winningRetentionPolicy);
×
123
  }
124

125
  @Override
126
  public int hashCode() {
UNCOV
127
    return Objects.hash(
×
128
        id, type, fileVersion, file, appliedAt, dispositionAt, winningRetentionPolicy);
129
  }
130

131
  @Override
132
  public String toString() {
UNCOV
133
    return "FileVersionRetention{"
×
134
        + "id='"
135
        + id
136
        + '\''
137
        + ", "
138
        + "type='"
139
        + type
140
        + '\''
141
        + ", "
142
        + "fileVersion='"
143
        + fileVersion
144
        + '\''
145
        + ", "
146
        + "file='"
147
        + file
148
        + '\''
149
        + ", "
150
        + "appliedAt='"
151
        + appliedAt
152
        + '\''
153
        + ", "
154
        + "dispositionAt='"
155
        + dispositionAt
156
        + '\''
157
        + ", "
158
        + "winningRetentionPolicy='"
159
        + winningRetentionPolicy
160
        + '\''
161
        + "}";
162
  }
163

UNCOV
164
  public static class Builder extends NullableFieldTracker {
×
165

166
    protected String id;
167

168
    protected EnumWrapper<FileVersionRetentionTypeField> type;
169

170
    protected FileVersionMini fileVersion;
171

172
    protected FileMini file;
173

174
    protected OffsetDateTime appliedAt;
175

176
    protected OffsetDateTime dispositionAt;
177

178
    protected RetentionPolicyMini winningRetentionPolicy;
179

180
    public Builder id(String id) {
UNCOV
181
      this.id = id;
×
UNCOV
182
      return this;
×
183
    }
184

185
    public Builder type(FileVersionRetentionTypeField type) {
UNCOV
186
      this.type = new EnumWrapper<FileVersionRetentionTypeField>(type);
×
UNCOV
187
      return this;
×
188
    }
189

190
    public Builder type(EnumWrapper<FileVersionRetentionTypeField> type) {
UNCOV
191
      this.type = type;
×
UNCOV
192
      return this;
×
193
    }
194

195
    public Builder fileVersion(FileVersionMini fileVersion) {
UNCOV
196
      this.fileVersion = fileVersion;
×
UNCOV
197
      return this;
×
198
    }
199

200
    public Builder file(FileMini file) {
UNCOV
201
      this.file = file;
×
UNCOV
202
      return this;
×
203
    }
204

205
    public Builder appliedAt(OffsetDateTime appliedAt) {
UNCOV
206
      this.appliedAt = appliedAt;
×
UNCOV
207
      return this;
×
208
    }
209

210
    public Builder dispositionAt(OffsetDateTime dispositionAt) {
UNCOV
211
      this.dispositionAt = dispositionAt;
×
UNCOV
212
      return this;
×
213
    }
214

215
    public Builder winningRetentionPolicy(RetentionPolicyMini winningRetentionPolicy) {
UNCOV
216
      this.winningRetentionPolicy = winningRetentionPolicy;
×
UNCOV
217
      return this;
×
218
    }
219

220
    public FileVersionRetention build() {
UNCOV
221
      return new FileVersionRetention(this);
×
222
    }
223
  }
224
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc