• 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/CreateRetentionPolicyRequestBody.java
1
package com.box.sdkgen.managers.retentionpolicies;
2

3
import com.box.sdkgen.internal.NullableFieldTracker;
4
import com.box.sdkgen.internal.SerializableObject;
5
import com.box.sdkgen.schemas.retentionpolicymaxextensionlengthrequest.RetentionPolicyMaxExtensionLengthRequest;
6
import com.box.sdkgen.schemas.retentionpolicymaxextensionlengthrequest.RetentionPolicyMaxExtensionLengthRequestEnum;
7
import com.box.sdkgen.schemas.usermini.UserMini;
8
import com.box.sdkgen.serialization.json.EnumWrapper;
9
import com.fasterxml.jackson.annotation.JsonFilter;
10
import com.fasterxml.jackson.annotation.JsonProperty;
11
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
12
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
13
import java.util.List;
14
import java.util.Objects;
15

16
@JsonFilter("nullablePropertyFilter")
17
public class CreateRetentionPolicyRequestBody extends SerializableObject {
18

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

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

26
  /**
27
   * The type of the retention policy. A retention policy type can either be `finite`, where a
28
   * specific amount of time to retain the content is known upfront, or `indefinite`, where the
29
   * amount of time to retain the content is still unknown.
30
   */
31
  @JsonDeserialize(
32
      using =
33
          CreateRetentionPolicyRequestBodyPolicyTypeField
34
              .CreateRetentionPolicyRequestBodyPolicyTypeFieldDeserializer.class)
35
  @JsonSerialize(
36
      using =
37
          CreateRetentionPolicyRequestBodyPolicyTypeField
38
              .CreateRetentionPolicyRequestBodyPolicyTypeFieldSerializer.class)
39
  @JsonProperty("policy_type")
40
  protected final EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField> policyType;
41

42
  /**
43
   * The disposition action of the retention policy. `permanently_delete` deletes the content
44
   * retained by the policy permanently. `remove_retention` lifts retention policy from the content,
45
   * allowing it to be deleted by users once the retention policy has expired.
46
   */
47
  @JsonDeserialize(
48
      using =
49
          CreateRetentionPolicyRequestBodyDispositionActionField
50
              .CreateRetentionPolicyRequestBodyDispositionActionFieldDeserializer.class)
51
  @JsonSerialize(
52
      using =
53
          CreateRetentionPolicyRequestBodyDispositionActionField
54
              .CreateRetentionPolicyRequestBodyDispositionActionFieldSerializer.class)
55
  @JsonProperty("disposition_action")
56
  protected final EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField>
57
      dispositionAction;
58

59
  /**
60
   * The length of the retention policy. This value specifies the duration in days that the
61
   * retention policy will be active for after being assigned to content. If the policy has a
62
   * `policy_type` of `indefinite`, the `retention_length` will also be `indefinite`.
63
   */
64
  @JsonProperty("retention_length")
65
  protected CreateRetentionPolicyRequestBodyRetentionLengthField retentionLength;
66

67
  /**
68
   * Specifies the retention type:
69
   *
70
   * <p>* `modifiable`: You can modify the retention policy. For example, you can add or remove
71
   * folders, shorten or lengthen the policy duration, or delete the assignment. Use this type if
72
   * your retention policy is not related to any regulatory purposes.
73
   *
74
   * <p>* `non_modifiable`: You can modify the retention policy only in a limited way: add a folder,
75
   * lengthen the duration, retire the policy, change the disposition action or notification
76
   * settings. You cannot perform other actions, such as deleting the assignment or shortening the
77
   * policy duration. Use this type to ensure compliance with regulatory retention policies.
78
   */
79
  @JsonDeserialize(
80
      using =
81
          CreateRetentionPolicyRequestBodyRetentionTypeField
82
              .CreateRetentionPolicyRequestBodyRetentionTypeFieldDeserializer.class)
83
  @JsonSerialize(
84
      using =
85
          CreateRetentionPolicyRequestBodyRetentionTypeField
86
              .CreateRetentionPolicyRequestBodyRetentionTypeFieldSerializer.class)
87
  @JsonProperty("retention_type")
88
  protected EnumWrapper<CreateRetentionPolicyRequestBodyRetentionTypeField> retentionType;
89

90
  /** Whether the owner of a file will be allowed to extend the retention. */
91
  @JsonProperty("can_owner_extend_retention")
92
  protected Boolean canOwnerExtendRetention;
93

94
  @JsonProperty("max_extension_length")
95
  protected RetentionPolicyMaxExtensionLengthRequest maxExtensionLength;
96

97
  /** Whether owner and co-owners of a file are notified when the policy nears expiration. */
98
  @JsonProperty("are_owners_notified")
99
  protected Boolean areOwnersNotified;
100

101
  /** A list of users notified when the retention policy duration is about to end. */
102
  @JsonProperty("custom_notification_recipients")
103
  protected List<UserMini> customNotificationRecipients;
104

105
  public CreateRetentionPolicyRequestBody(
106
      String policyName,
107
      CreateRetentionPolicyRequestBodyPolicyTypeField policyType,
108
      CreateRetentionPolicyRequestBodyDispositionActionField dispositionAction) {
UNCOV
109
    super();
×
UNCOV
110
    this.policyName = policyName;
×
UNCOV
111
    this.policyType = new EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField>(policyType);
×
UNCOV
112
    this.dispositionAction =
×
113
        new EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField>(dispositionAction);
114
  }
×
115

116
  public CreateRetentionPolicyRequestBody(
117
      String policyName,
118
      CreateRetentionPolicyRequestBodyPolicyTypeField policyType,
119
      EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField> dispositionAction) {
UNCOV
120
    super();
×
UNCOV
121
    this.policyName = policyName;
×
UNCOV
122
    this.policyType = new EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField>(policyType);
×
UNCOV
123
    this.dispositionAction = dispositionAction;
×
UNCOV
124
  }
×
125

126
  public CreateRetentionPolicyRequestBody(
127
      String policyName,
128
      EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField> policyType,
129
      CreateRetentionPolicyRequestBodyDispositionActionField dispositionAction) {
UNCOV
130
    super();
×
UNCOV
131
    this.policyName = policyName;
×
UNCOV
132
    this.policyType = policyType;
×
UNCOV
133
    this.dispositionAction =
×
134
        new EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField>(dispositionAction);
135
  }
×
136

137
  public CreateRetentionPolicyRequestBody(
138
      @JsonProperty("policy_name") String policyName,
139
      @JsonProperty("policy_type")
140
          EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField> policyType,
141
      @JsonProperty("disposition_action")
142
          EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField> dispositionAction) {
UNCOV
143
    super();
×
UNCOV
144
    this.policyName = policyName;
×
UNCOV
145
    this.policyType = policyType;
×
UNCOV
146
    this.dispositionAction = dispositionAction;
×
UNCOV
147
  }
×
148

149
  protected CreateRetentionPolicyRequestBody(Builder builder) {
150
    super();
×
151
    this.policyName = builder.policyName;
×
152
    this.description = builder.description;
×
UNCOV
153
    this.policyType = builder.policyType;
×
UNCOV
154
    this.dispositionAction = builder.dispositionAction;
×
155
    this.retentionLength = builder.retentionLength;
×
156
    this.retentionType = builder.retentionType;
×
157
    this.canOwnerExtendRetention = builder.canOwnerExtendRetention;
×
NEW
158
    this.maxExtensionLength = builder.maxExtensionLength;
×
159
    this.areOwnersNotified = builder.areOwnersNotified;
×
160
    this.customNotificationRecipients = builder.customNotificationRecipients;
×
161
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
162
  }
×
163

164
  public String getPolicyName() {
165
    return policyName;
×
166
  }
167

168
  public String getDescription() {
UNCOV
169
    return description;
×
170
  }
171

172
  public EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField> getPolicyType() {
UNCOV
173
    return policyType;
×
174
  }
175

176
  public EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField>
177
      getDispositionAction() {
UNCOV
178
    return dispositionAction;
×
179
  }
180

181
  public CreateRetentionPolicyRequestBodyRetentionLengthField getRetentionLength() {
UNCOV
182
    return retentionLength;
×
183
  }
184

185
  public EnumWrapper<CreateRetentionPolicyRequestBodyRetentionTypeField> getRetentionType() {
UNCOV
186
    return retentionType;
×
187
  }
188

189
  public Boolean getCanOwnerExtendRetention() {
UNCOV
190
    return canOwnerExtendRetention;
×
191
  }
192

193
  public RetentionPolicyMaxExtensionLengthRequest getMaxExtensionLength() {
NEW
194
    return maxExtensionLength;
×
195
  }
196

197
  public Boolean getAreOwnersNotified() {
UNCOV
198
    return areOwnersNotified;
×
199
  }
200

201
  public List<UserMini> getCustomNotificationRecipients() {
UNCOV
202
    return customNotificationRecipients;
×
203
  }
204

205
  @Override
206
  public boolean equals(Object o) {
UNCOV
207
    if (this == o) {
×
208
      return true;
×
209
    }
UNCOV
210
    if (o == null || getClass() != o.getClass()) {
×
UNCOV
211
      return false;
×
212
    }
UNCOV
213
    CreateRetentionPolicyRequestBody casted = (CreateRetentionPolicyRequestBody) o;
×
UNCOV
214
    return Objects.equals(policyName, casted.policyName)
×
UNCOV
215
        && Objects.equals(description, casted.description)
×
UNCOV
216
        && Objects.equals(policyType, casted.policyType)
×
217
        && Objects.equals(dispositionAction, casted.dispositionAction)
×
218
        && Objects.equals(retentionLength, casted.retentionLength)
×
UNCOV
219
        && Objects.equals(retentionType, casted.retentionType)
×
220
        && Objects.equals(canOwnerExtendRetention, casted.canOwnerExtendRetention)
×
NEW
221
        && Objects.equals(maxExtensionLength, casted.maxExtensionLength)
×
UNCOV
222
        && Objects.equals(areOwnersNotified, casted.areOwnersNotified)
×
UNCOV
223
        && Objects.equals(customNotificationRecipients, casted.customNotificationRecipients);
×
224
  }
225

226
  @Override
227
  public int hashCode() {
228
    return Objects.hash(
×
229
        policyName,
230
        description,
231
        policyType,
232
        dispositionAction,
233
        retentionLength,
234
        retentionType,
235
        canOwnerExtendRetention,
236
        maxExtensionLength,
237
        areOwnersNotified,
238
        customNotificationRecipients);
239
  }
240

241
  @Override
242
  public String toString() {
UNCOV
243
    return "CreateRetentionPolicyRequestBody{"
×
244
        + "policyName='"
245
        + policyName
246
        + '\''
247
        + ", "
248
        + "description='"
249
        + description
250
        + '\''
251
        + ", "
252
        + "policyType='"
253
        + policyType
254
        + '\''
255
        + ", "
256
        + "dispositionAction='"
257
        + dispositionAction
258
        + '\''
259
        + ", "
260
        + "retentionLength='"
261
        + retentionLength
262
        + '\''
263
        + ", "
264
        + "retentionType='"
265
        + retentionType
266
        + '\''
267
        + ", "
268
        + "canOwnerExtendRetention='"
269
        + canOwnerExtendRetention
270
        + '\''
271
        + ", "
272
        + "maxExtensionLength='"
273
        + maxExtensionLength
274
        + '\''
275
        + ", "
276
        + "areOwnersNotified='"
277
        + areOwnersNotified
278
        + '\''
279
        + ", "
280
        + "customNotificationRecipients='"
281
        + customNotificationRecipients
282
        + '\''
283
        + "}";
284
  }
285

286
  public static class Builder extends NullableFieldTracker {
287

288
    protected final String policyName;
289

290
    protected String description;
291

292
    protected final EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField> policyType;
293

294
    protected final EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField>
295
        dispositionAction;
296

297
    protected CreateRetentionPolicyRequestBodyRetentionLengthField retentionLength;
298

299
    protected EnumWrapper<CreateRetentionPolicyRequestBodyRetentionTypeField> retentionType;
300

301
    protected Boolean canOwnerExtendRetention;
302

303
    protected RetentionPolicyMaxExtensionLengthRequest maxExtensionLength;
304

305
    protected Boolean areOwnersNotified;
306

307
    protected List<UserMini> customNotificationRecipients;
308

309
    public Builder(
310
        String policyName,
311
        CreateRetentionPolicyRequestBodyPolicyTypeField policyType,
312
        CreateRetentionPolicyRequestBodyDispositionActionField dispositionAction) {
UNCOV
313
      super();
×
UNCOV
314
      this.policyName = policyName;
×
UNCOV
315
      this.policyType =
×
316
          new EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField>(policyType);
UNCOV
317
      this.dispositionAction =
×
318
          new EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField>(
319
              dispositionAction);
UNCOV
320
    }
×
321

322
    public Builder(
323
        String policyName,
324
        CreateRetentionPolicyRequestBodyPolicyTypeField policyType,
325
        EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField> dispositionAction) {
UNCOV
326
      super();
×
UNCOV
327
      this.policyName = policyName;
×
UNCOV
328
      this.policyType =
×
329
          new EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField>(policyType);
UNCOV
330
      this.dispositionAction = dispositionAction;
×
331
    }
×
332

333
    public Builder(
334
        String policyName,
335
        EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField> policyType,
336
        CreateRetentionPolicyRequestBodyDispositionActionField dispositionAction) {
UNCOV
337
      super();
×
338
      this.policyName = policyName;
×
UNCOV
339
      this.policyType = policyType;
×
UNCOV
340
      this.dispositionAction =
×
341
          new EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField>(
342
              dispositionAction);
UNCOV
343
    }
×
344

345
    public Builder(
346
        String policyName,
347
        EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField> policyType,
348
        EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField> dispositionAction) {
349
      super();
×
UNCOV
350
      this.policyName = policyName;
×
UNCOV
351
      this.policyType = policyType;
×
UNCOV
352
      this.dispositionAction = dispositionAction;
×
UNCOV
353
    }
×
354

355
    public Builder description(String description) {
356
      this.description = description;
×
357
      return this;
×
358
    }
359

360
    public Builder retentionLength(String retentionLength) {
361
      this.retentionLength =
×
362
          new CreateRetentionPolicyRequestBodyRetentionLengthField(retentionLength);
UNCOV
363
      return this;
×
364
    }
365

366
    public Builder retentionLength(int retentionLength) {
367
      this.retentionLength =
×
368
          new CreateRetentionPolicyRequestBodyRetentionLengthField(retentionLength);
×
369
      return this;
×
370
    }
371

372
    public Builder retentionLength(
373
        CreateRetentionPolicyRequestBodyRetentionLengthField retentionLength) {
374
      this.retentionLength = retentionLength;
×
375
      return this;
×
376
    }
377

378
    public Builder retentionType(CreateRetentionPolicyRequestBodyRetentionTypeField retentionType) {
379
      this.retentionType =
×
380
          new EnumWrapper<CreateRetentionPolicyRequestBodyRetentionTypeField>(retentionType);
381
      return this;
×
382
    }
383

384
    public Builder retentionType(
385
        EnumWrapper<CreateRetentionPolicyRequestBodyRetentionTypeField> retentionType) {
386
      this.retentionType = retentionType;
×
387
      return this;
×
388
    }
389

390
    public Builder canOwnerExtendRetention(Boolean canOwnerExtendRetention) {
UNCOV
391
      this.canOwnerExtendRetention = canOwnerExtendRetention;
×
392
      return this;
×
393
    }
394

395
    public Builder maxExtensionLength(
396
        RetentionPolicyMaxExtensionLengthRequestEnum maxExtensionLength) {
NEW
397
      this.maxExtensionLength = new RetentionPolicyMaxExtensionLengthRequest(maxExtensionLength);
×
NEW
398
      return this;
×
399
    }
400

401
    public Builder maxExtensionLength(String maxExtensionLength) {
NEW
402
      this.maxExtensionLength = new RetentionPolicyMaxExtensionLengthRequest(maxExtensionLength);
×
NEW
403
      return this;
×
404
    }
405

406
    public Builder maxExtensionLength(int maxExtensionLength) {
NEW
407
      this.maxExtensionLength = new RetentionPolicyMaxExtensionLengthRequest(maxExtensionLength);
×
NEW
408
      return this;
×
409
    }
410

411
    public Builder maxExtensionLength(RetentionPolicyMaxExtensionLengthRequest maxExtensionLength) {
NEW
412
      this.maxExtensionLength = maxExtensionLength;
×
NEW
413
      return this;
×
414
    }
415

416
    public Builder areOwnersNotified(Boolean areOwnersNotified) {
UNCOV
417
      this.areOwnersNotified = areOwnersNotified;
×
418
      return this;
×
419
    }
420

421
    public Builder customNotificationRecipients(List<UserMini> customNotificationRecipients) {
UNCOV
422
      this.customNotificationRecipients = customNotificationRecipients;
×
UNCOV
423
      return this;
×
424
    }
425

426
    public CreateRetentionPolicyRequestBody build() {
UNCOV
427
      return new CreateRetentionPolicyRequestBody(this);
×
428
    }
429
  }
430
}
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