• 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

39.39
/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.userbase.UserBase;
7
import com.fasterxml.jackson.annotation.JsonFilter;
8
import com.fasterxml.jackson.annotation.JsonProperty;
9
import java.util.List;
10
import java.util.Objects;
11

12
@JsonFilter("nullablePropertyFilter")
13
public class UpdateRetentionPolicyByIdRequestBody extends SerializableObject {
14

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

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

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

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

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

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

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

74
  /**
75
   * Determines if owners and co-owners of items under the policy are notified when the retention
76
   * duration is about to end.
77
   */
78
  @JsonProperty("are_owners_notified")
79
  @Nullable
80
  protected Boolean areOwnersNotified;
81

82
  /** A list of users notified when the retention duration is about to end. */
83
  @JsonProperty("custom_notification_recipients")
84
  @Nullable
85
  protected List<UserBase> customNotificationRecipients;
86

87
  public UpdateRetentionPolicyByIdRequestBody() {
88
    super();
×
89
  }
×
90

91
  protected UpdateRetentionPolicyByIdRequestBody(Builder builder) {
92
    super();
1✔
93
    this.policyName = builder.policyName;
1✔
94
    this.description = builder.description;
1✔
95
    this.dispositionAction = builder.dispositionAction;
1✔
96
    this.retentionType = builder.retentionType;
1✔
97
    this.retentionLength = builder.retentionLength;
1✔
98
    this.status = builder.status;
1✔
99
    this.canOwnerExtendRetention = builder.canOwnerExtendRetention;
1✔
100
    this.areOwnersNotified = builder.areOwnersNotified;
1✔
101
    this.customNotificationRecipients = builder.customNotificationRecipients;
1✔
102
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
1✔
103
  }
1✔
104

105
  public String getPolicyName() {
106
    return policyName;
1✔
107
  }
108

109
  public String getDescription() {
110
    return description;
1✔
111
  }
112

113
  public String getDispositionAction() {
114
    return dispositionAction;
1✔
115
  }
116

117
  public String getRetentionType() {
118
    return retentionType;
1✔
119
  }
120

121
  public String getRetentionLength() {
122
    return retentionLength;
1✔
123
  }
124

125
  public String getStatus() {
126
    return status;
1✔
127
  }
128

129
  public Boolean getCanOwnerExtendRetention() {
130
    return canOwnerExtendRetention;
1✔
131
  }
132

133
  public Boolean getAreOwnersNotified() {
134
    return areOwnersNotified;
1✔
135
  }
136

137
  public List<UserBase> getCustomNotificationRecipients() {
138
    return customNotificationRecipients;
1✔
139
  }
140

141
  @Override
142
  public boolean equals(Object o) {
143
    if (this == o) {
×
144
      return true;
×
145
    }
146
    if (o == null || getClass() != o.getClass()) {
×
147
      return false;
×
148
    }
149
    UpdateRetentionPolicyByIdRequestBody casted = (UpdateRetentionPolicyByIdRequestBody) o;
×
150
    return Objects.equals(policyName, casted.policyName)
×
151
        && Objects.equals(description, casted.description)
×
152
        && Objects.equals(dispositionAction, casted.dispositionAction)
×
153
        && Objects.equals(retentionType, casted.retentionType)
×
154
        && Objects.equals(retentionLength, casted.retentionLength)
×
155
        && Objects.equals(status, casted.status)
×
156
        && Objects.equals(canOwnerExtendRetention, casted.canOwnerExtendRetention)
×
157
        && Objects.equals(areOwnersNotified, casted.areOwnersNotified)
×
158
        && Objects.equals(customNotificationRecipients, casted.customNotificationRecipients);
×
159
  }
160

161
  @Override
162
  public int hashCode() {
163
    return Objects.hash(
×
164
        policyName,
165
        description,
166
        dispositionAction,
167
        retentionType,
168
        retentionLength,
169
        status,
170
        canOwnerExtendRetention,
171
        areOwnersNotified,
172
        customNotificationRecipients);
173
  }
174

175
  @Override
176
  public String toString() {
177
    return "UpdateRetentionPolicyByIdRequestBody{"
×
178
        + "policyName='"
179
        + policyName
180
        + '\''
181
        + ", "
182
        + "description='"
183
        + description
184
        + '\''
185
        + ", "
186
        + "dispositionAction='"
187
        + dispositionAction
188
        + '\''
189
        + ", "
190
        + "retentionType='"
191
        + retentionType
192
        + '\''
193
        + ", "
194
        + "retentionLength='"
195
        + retentionLength
196
        + '\''
197
        + ", "
198
        + "status='"
199
        + status
200
        + '\''
201
        + ", "
202
        + "canOwnerExtendRetention='"
203
        + canOwnerExtendRetention
204
        + '\''
205
        + ", "
206
        + "areOwnersNotified='"
207
        + areOwnersNotified
208
        + '\''
209
        + ", "
210
        + "customNotificationRecipients='"
211
        + customNotificationRecipients
212
        + '\''
213
        + "}";
214
  }
215

216
  public static class Builder extends NullableFieldTracker {
1✔
217

218
    protected String policyName;
219

220
    protected String description;
221

222
    protected String dispositionAction;
223

224
    protected String retentionType;
225

226
    protected String retentionLength;
227

228
    protected String status;
229

230
    protected Boolean canOwnerExtendRetention;
231

232
    protected Boolean areOwnersNotified;
233

234
    protected List<UserBase> customNotificationRecipients;
235

236
    public Builder policyName(String policyName) {
237
      this.policyName = policyName;
1✔
238
      this.markNullableFieldAsSet("policy_name");
1✔
239
      return this;
1✔
240
    }
241

242
    public Builder description(String description) {
243
      this.description = description;
×
244
      this.markNullableFieldAsSet("description");
×
245
      return this;
×
246
    }
247

248
    public Builder dispositionAction(String dispositionAction) {
249
      this.dispositionAction = dispositionAction;
×
250
      return this;
×
251
    }
252

253
    public Builder retentionType(String retentionType) {
254
      this.retentionType = retentionType;
×
255
      this.markNullableFieldAsSet("retention_type");
×
256
      return this;
×
257
    }
258

259
    public Builder retentionLength(String retentionLength) {
260
      this.retentionLength = retentionLength;
×
261
      return this;
×
262
    }
263

264
    public Builder status(String status) {
265
      this.status = status;
×
266
      this.markNullableFieldAsSet("status");
×
267
      return this;
×
268
    }
269

270
    public Builder canOwnerExtendRetention(Boolean canOwnerExtendRetention) {
271
      this.canOwnerExtendRetention = canOwnerExtendRetention;
×
272
      this.markNullableFieldAsSet("can_owner_extend_retention");
×
273
      return this;
×
274
    }
275

276
    public Builder areOwnersNotified(Boolean areOwnersNotified) {
277
      this.areOwnersNotified = areOwnersNotified;
×
278
      this.markNullableFieldAsSet("are_owners_notified");
×
279
      return this;
×
280
    }
281

282
    public Builder customNotificationRecipients(List<UserBase> customNotificationRecipients) {
283
      this.customNotificationRecipients = customNotificationRecipients;
×
284
      this.markNullableFieldAsSet("custom_notification_recipients");
×
285
      return this;
×
286
    }
287

288
    public UpdateRetentionPolicyByIdRequestBody build() {
289
      return new UpdateRetentionPolicyByIdRequestBody(this);
1✔
290
    }
291
  }
292
}
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