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

box / box-java-sdk / #5076

07 Oct 2025 12:35PM UTC coverage: 37.132% (+0.007%) from 37.125%
#5076

push

github

web-flow
test: Change `Event.additionalDetails` field assertion in events test (box/box-codegen#858) (#1491)

18454 of 49699 relevant lines covered (37.13%)

0.37 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](e://get-retention-policy-assignments-id-files-under-retention) or [file versions under
26
 * retention](e://get-retention-policy-assignments-id-file-versions-under-retention) endpoints.
27
 */
28
@JsonFilter("nullablePropertyFilter")
29
public class FileVersionRetention extends SerializableObject {
30

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

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

41
  @JsonProperty("file_version")
42
  protected FileVersionMini fileVersion;
43

44
  protected FileMini file;
45

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

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

58
  @JsonProperty("winning_retention_policy")
59
  protected RetentionPolicyMini winningRetentionPolicy;
60

61
  public FileVersionRetention() {
62
    super();
×
63
  }
×
64

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

77
  public String getId() {
78
    return id;
×
79
  }
80

81
  public EnumWrapper<FileVersionRetentionTypeField> getType() {
82
    return type;
×
83
  }
84

85
  public FileVersionMini getFileVersion() {
86
    return fileVersion;
×
87
  }
88

89
  public FileMini getFile() {
90
    return file;
×
91
  }
92

93
  public OffsetDateTime getAppliedAt() {
94
    return appliedAt;
×
95
  }
96

97
  public OffsetDateTime getDispositionAt() {
98
    return dispositionAt;
×
99
  }
100

101
  public RetentionPolicyMini getWinningRetentionPolicy() {
102
    return winningRetentionPolicy;
×
103
  }
104

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

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

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

162
  public static class Builder extends NullableFieldTracker {
×
163

164
    protected String id;
165

166
    protected EnumWrapper<FileVersionRetentionTypeField> type;
167

168
    protected FileVersionMini fileVersion;
169

170
    protected FileMini file;
171

172
    protected OffsetDateTime appliedAt;
173

174
    protected OffsetDateTime dispositionAt;
175

176
    protected RetentionPolicyMini winningRetentionPolicy;
177

178
    public Builder id(String id) {
179
      this.id = id;
×
180
      return this;
×
181
    }
182

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

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

193
    public Builder fileVersion(FileVersionMini fileVersion) {
194
      this.fileVersion = fileVersion;
×
195
      return this;
×
196
    }
197

198
    public Builder file(FileMini file) {
199
      this.file = file;
×
200
      return this;
×
201
    }
202

203
    public Builder appliedAt(OffsetDateTime appliedAt) {
204
      this.appliedAt = appliedAt;
×
205
      return this;
×
206
    }
207

208
    public Builder dispositionAt(OffsetDateTime dispositionAt) {
209
      this.dispositionAt = dispositionAt;
×
210
      return this;
×
211
    }
212

213
    public Builder winningRetentionPolicy(RetentionPolicyMini winningRetentionPolicy) {
214
      this.winningRetentionPolicy = winningRetentionPolicy;
×
215
      return this;
×
216
    }
217

218
    public FileVersionRetention build() {
219
      return new FileVersionRetention(this);
×
220
    }
221
  }
222
}
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