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

box / box-java-sdk / #6714

22 Apr 2026 11:25AM UTC coverage: 12.66%. Remained the same
#6714

push

github

web-flow
feat(boxsdkgen): Add `max_extension_length` field to Retention Policies (box/box-openapi#593) (#1798)

0 of 127 new or added lines in 9 files covered. (0.0%)

199 existing lines in 6 files now uncovered.

8374 of 66147 relevant lines covered (12.66%)

0.13 hits per line

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

0.0
/src/main/java/com/box/sdkgen/managers/retentionpolicies/UpdateRetentionPolicyByIdRequestBody.java
1
package com.box.sdkgen.managers.retentionpolicies;
2

3
import com.box.sdkgen.internal.Nullable;
4
import com.box.sdkgen.internal.NullableFieldTracker;
5
import com.box.sdkgen.internal.SerializableObject;
6
import com.box.sdkgen.schemas.retentionpolicymaxextensionlengthrequest.RetentionPolicyMaxExtensionLengthRequest;
7
import com.box.sdkgen.schemas.retentionpolicymaxextensionlengthrequest.RetentionPolicyMaxExtensionLengthRequestEnum;
8
import com.box.sdkgen.schemas.userbase.UserBase;
9
import com.fasterxml.jackson.annotation.JsonFilter;
10
import com.fasterxml.jackson.annotation.JsonProperty;
11
import java.util.List;
12
import java.util.Objects;
13

14
@JsonFilter("nullablePropertyFilter")
15
public class UpdateRetentionPolicyByIdRequestBody extends SerializableObject {
16

17
  /** The name for the retention policy. */
18
  @JsonProperty("policy_name")
19
  @Nullable
20
  protected String policyName;
21

22
  /** The additional text description of the retention policy. */
23
  @Nullable protected String description;
24

25
  /**
26
   * The disposition action of the retention policy. This action can be `permanently_delete`, which
27
   * will cause the content retained by the policy to be permanently deleted, or `remove_retention`,
28
   * which will lift the retention policy from the content, allowing it to be deleted by users, once
29
   * the retention policy has expired. You can use `null` if you don't want to change
30
   * `disposition_action`.
31
   */
32
  @JsonProperty("disposition_action")
33
  protected String dispositionAction;
34

35
  /**
36
   * Specifies the retention type:
37
   *
38
   * <p>* `modifiable`: You can modify the retention policy. For example, you can add or remove
39
   * folders, shorten or lengthen the policy duration, or delete the assignment. Use this type if
40
   * your retention policy is not related to any regulatory purposes. * `non-modifiable`: You can
41
   * modify the retention policy only in a limited way: add a folder, lengthen the duration, retire
42
   * the policy, change the disposition action or notification settings. You cannot perform other
43
   * actions, such as deleting the assignment or shortening the policy duration. Use this type to
44
   * ensure compliance with regulatory retention policies.
45
   *
46
   * <p>When updating a retention policy, you can use `non-modifiable` type only. You can convert a
47
   * `modifiable` policy to `non-modifiable`, but not the other way around.
48
   */
49
  @JsonProperty("retention_type")
50
  @Nullable
51
  protected String retentionType;
52

53
  /**
54
   * The length of the retention policy. This value specifies the duration in days that the
55
   * retention policy will be active for after being assigned to content. If the policy has a
56
   * `policy_type` of `indefinite`, the `retention_length` will also be `indefinite`.
57
   */
58
  @JsonProperty("retention_length")
59
  protected UpdateRetentionPolicyByIdRequestBodyRetentionLengthField retentionLength;
60

61
  /**
62
   * Used to retire a retention policy.
63
   *
64
   * <p>If not retiring a policy, do not include this parameter or set it to `null`.
65
   */
66
  @Nullable protected String status;
67

68
  /**
69
   * Determines if the owner of items under the policy can extend the retention when the original
70
   * retention duration is about to end.
71
   */
72
  @JsonProperty("can_owner_extend_retention")
73
  @Nullable
74
  protected Boolean canOwnerExtendRetention;
75

76
  @JsonProperty("max_extension_length")
77
  protected RetentionPolicyMaxExtensionLengthRequest maxExtensionLength;
78

79
  /**
80
   * Determines if owners and co-owners of items under the policy are notified when the retention
81
   * duration is about to end.
82
   */
83
  @JsonProperty("are_owners_notified")
84
  @Nullable
85
  protected Boolean areOwnersNotified;
86

87
  /** A list of users notified when the retention duration is about to end. */
88
  @JsonProperty("custom_notification_recipients")
89
  @Nullable
90
  protected List<UserBase> customNotificationRecipients;
91

92
  public UpdateRetentionPolicyByIdRequestBody() {
UNCOV
93
    super();
×
UNCOV
94
  }
×
95

96
  protected UpdateRetentionPolicyByIdRequestBody(Builder builder) {
UNCOV
97
    super();
×
98
    this.policyName = builder.policyName;
×
99
    this.description = builder.description;
×
UNCOV
100
    this.dispositionAction = builder.dispositionAction;
×
UNCOV
101
    this.retentionType = builder.retentionType;
×
102
    this.retentionLength = builder.retentionLength;
×
103
    this.status = builder.status;
×
104
    this.canOwnerExtendRetention = builder.canOwnerExtendRetention;
×
NEW
105
    this.maxExtensionLength = builder.maxExtensionLength;
×
106
    this.areOwnersNotified = builder.areOwnersNotified;
×
107
    this.customNotificationRecipients = builder.customNotificationRecipients;
×
108
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
109
  }
×
110

111
  public String getPolicyName() {
112
    return policyName;
×
113
  }
114

115
  public String getDescription() {
UNCOV
116
    return description;
×
117
  }
118

119
  public String getDispositionAction() {
UNCOV
120
    return dispositionAction;
×
121
  }
122

123
  public String getRetentionType() {
UNCOV
124
    return retentionType;
×
125
  }
126

127
  public UpdateRetentionPolicyByIdRequestBodyRetentionLengthField getRetentionLength() {
UNCOV
128
    return retentionLength;
×
129
  }
130

131
  public String getStatus() {
UNCOV
132
    return status;
×
133
  }
134

135
  public Boolean getCanOwnerExtendRetention() {
UNCOV
136
    return canOwnerExtendRetention;
×
137
  }
138

139
  public RetentionPolicyMaxExtensionLengthRequest getMaxExtensionLength() {
NEW
140
    return maxExtensionLength;
×
141
  }
142

143
  public Boolean getAreOwnersNotified() {
UNCOV
144
    return areOwnersNotified;
×
145
  }
146

147
  public List<UserBase> getCustomNotificationRecipients() {
UNCOV
148
    return customNotificationRecipients;
×
149
  }
150

151
  @Override
152
  public boolean equals(Object o) {
UNCOV
153
    if (this == o) {
×
154
      return true;
×
155
    }
UNCOV
156
    if (o == null || getClass() != o.getClass()) {
×
UNCOV
157
      return false;
×
158
    }
UNCOV
159
    UpdateRetentionPolicyByIdRequestBody casted = (UpdateRetentionPolicyByIdRequestBody) o;
×
UNCOV
160
    return Objects.equals(policyName, casted.policyName)
×
UNCOV
161
        && Objects.equals(description, casted.description)
×
UNCOV
162
        && Objects.equals(dispositionAction, casted.dispositionAction)
×
163
        && Objects.equals(retentionType, casted.retentionType)
×
164
        && Objects.equals(retentionLength, casted.retentionLength)
×
UNCOV
165
        && Objects.equals(status, casted.status)
×
166
        && Objects.equals(canOwnerExtendRetention, casted.canOwnerExtendRetention)
×
NEW
167
        && Objects.equals(maxExtensionLength, casted.maxExtensionLength)
×
UNCOV
168
        && Objects.equals(areOwnersNotified, casted.areOwnersNotified)
×
UNCOV
169
        && Objects.equals(customNotificationRecipients, casted.customNotificationRecipients);
×
170
  }
171

172
  @Override
173
  public int hashCode() {
174
    return Objects.hash(
×
175
        policyName,
176
        description,
177
        dispositionAction,
178
        retentionType,
179
        retentionLength,
180
        status,
181
        canOwnerExtendRetention,
182
        maxExtensionLength,
183
        areOwnersNotified,
184
        customNotificationRecipients);
185
  }
186

187
  @Override
188
  public String toString() {
UNCOV
189
    return "UpdateRetentionPolicyByIdRequestBody{"
×
190
        + "policyName='"
191
        + policyName
192
        + '\''
193
        + ", "
194
        + "description='"
195
        + description
196
        + '\''
197
        + ", "
198
        + "dispositionAction='"
199
        + dispositionAction
200
        + '\''
201
        + ", "
202
        + "retentionType='"
203
        + retentionType
204
        + '\''
205
        + ", "
206
        + "retentionLength='"
207
        + retentionLength
208
        + '\''
209
        + ", "
210
        + "status='"
211
        + status
212
        + '\''
213
        + ", "
214
        + "canOwnerExtendRetention='"
215
        + canOwnerExtendRetention
216
        + '\''
217
        + ", "
218
        + "maxExtensionLength='"
219
        + maxExtensionLength
220
        + '\''
221
        + ", "
222
        + "areOwnersNotified='"
223
        + areOwnersNotified
224
        + '\''
225
        + ", "
226
        + "customNotificationRecipients='"
227
        + customNotificationRecipients
228
        + '\''
229
        + "}";
230
  }
231

UNCOV
232
  public static class Builder extends NullableFieldTracker {
×
233

234
    protected String policyName;
235

236
    protected String description;
237

238
    protected String dispositionAction;
239

240
    protected String retentionType;
241

242
    protected UpdateRetentionPolicyByIdRequestBodyRetentionLengthField retentionLength;
243

244
    protected String status;
245

246
    protected Boolean canOwnerExtendRetention;
247

248
    protected RetentionPolicyMaxExtensionLengthRequest maxExtensionLength;
249

250
    protected Boolean areOwnersNotified;
251

252
    protected List<UserBase> customNotificationRecipients;
253

254
    public Builder policyName(String policyName) {
UNCOV
255
      this.policyName = policyName;
×
UNCOV
256
      this.markNullableFieldAsSet("policy_name");
×
UNCOV
257
      return this;
×
258
    }
259

260
    public Builder description(String description) {
UNCOV
261
      this.description = description;
×
UNCOV
262
      this.markNullableFieldAsSet("description");
×
UNCOV
263
      return this;
×
264
    }
265

266
    public Builder dispositionAction(String dispositionAction) {
UNCOV
267
      this.dispositionAction = dispositionAction;
×
UNCOV
268
      return this;
×
269
    }
270

271
    public Builder retentionType(String retentionType) {
UNCOV
272
      this.retentionType = retentionType;
×
273
      this.markNullableFieldAsSet("retention_type");
×
274
      return this;
×
275
    }
276

277
    public Builder retentionLength(String retentionLength) {
UNCOV
278
      this.retentionLength =
×
279
          new UpdateRetentionPolicyByIdRequestBodyRetentionLengthField(retentionLength);
280
      return this;
×
281
    }
282

283
    public Builder retentionLength(int retentionLength) {
UNCOV
284
      this.retentionLength =
×
285
          new UpdateRetentionPolicyByIdRequestBodyRetentionLengthField(retentionLength);
×
286
      return this;
×
287
    }
288

289
    public Builder retentionLength(
290
        UpdateRetentionPolicyByIdRequestBodyRetentionLengthField retentionLength) {
291
      this.retentionLength = retentionLength;
×
292
      return this;
×
293
    }
294

295
    public Builder status(String status) {
296
      this.status = status;
×
UNCOV
297
      this.markNullableFieldAsSet("status");
×
298
      return this;
×
299
    }
300

301
    public Builder canOwnerExtendRetention(Boolean canOwnerExtendRetention) {
302
      this.canOwnerExtendRetention = canOwnerExtendRetention;
×
303
      this.markNullableFieldAsSet("can_owner_extend_retention");
×
304
      return this;
×
305
    }
306

307
    public Builder maxExtensionLength(
308
        RetentionPolicyMaxExtensionLengthRequestEnum maxExtensionLength) {
NEW
309
      this.maxExtensionLength = new RetentionPolicyMaxExtensionLengthRequest(maxExtensionLength);
×
NEW
310
      return this;
×
311
    }
312

313
    public Builder maxExtensionLength(String maxExtensionLength) {
NEW
314
      this.maxExtensionLength = new RetentionPolicyMaxExtensionLengthRequest(maxExtensionLength);
×
NEW
315
      return this;
×
316
    }
317

318
    public Builder maxExtensionLength(int maxExtensionLength) {
NEW
319
      this.maxExtensionLength = new RetentionPolicyMaxExtensionLengthRequest(maxExtensionLength);
×
NEW
320
      return this;
×
321
    }
322

323
    public Builder maxExtensionLength(RetentionPolicyMaxExtensionLengthRequest maxExtensionLength) {
NEW
324
      this.maxExtensionLength = maxExtensionLength;
×
NEW
325
      return this;
×
326
    }
327

328
    public Builder areOwnersNotified(Boolean areOwnersNotified) {
UNCOV
329
      this.areOwnersNotified = areOwnersNotified;
×
330
      this.markNullableFieldAsSet("are_owners_notified");
×
331
      return this;
×
332
    }
333

334
    public Builder customNotificationRecipients(List<UserBase> customNotificationRecipients) {
335
      this.customNotificationRecipients = customNotificationRecipients;
×
336
      this.markNullableFieldAsSet("custom_notification_recipients");
×
337
      return this;
×
338
    }
339

340
    public UpdateRetentionPolicyByIdRequestBody build() {
341
      return new UpdateRetentionPolicyByIdRequestBody(this);
×
342
    }
343
  }
344
}
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