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

box / box-java-sdk-gen / #294

24 Jun 2025 01:20PM UTC coverage: 35.662% (+0.03%) from 35.632%
#294

Pull #347

github

web-flow
Merge 2c100d09c into d8480ee6c
Pull Request #347: feat: Add Webhook Validation In Java (box/box-codegen#745)

68 of 82 new or added lines in 2 files covered. (82.93%)

11791 existing lines in 624 files now uncovered.

16939 of 47499 relevant lines covered (35.66%)

0.36 hits per line

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

51.39
/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.usermini.UserMini;
6
import com.box.sdkgen.serialization.json.EnumWrapper;
7
import com.fasterxml.jackson.annotation.JsonFilter;
8
import com.fasterxml.jackson.annotation.JsonProperty;
9
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
10
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
11
import java.util.List;
12
import java.util.Objects;
13

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

17
  @JsonProperty("policy_name")
18
  protected final String policyName;
19

20
  protected String description;
21

22
  @JsonDeserialize(
23
      using =
24
          CreateRetentionPolicyRequestBodyPolicyTypeField
25
              .CreateRetentionPolicyRequestBodyPolicyTypeFieldDeserializer.class)
26
  @JsonSerialize(
27
      using =
28
          CreateRetentionPolicyRequestBodyPolicyTypeField
29
              .CreateRetentionPolicyRequestBodyPolicyTypeFieldSerializer.class)
30
  @JsonProperty("policy_type")
31
  protected final EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField> policyType;
32

33
  @JsonDeserialize(
34
      using =
35
          CreateRetentionPolicyRequestBodyDispositionActionField
36
              .CreateRetentionPolicyRequestBodyDispositionActionFieldDeserializer.class)
37
  @JsonSerialize(
38
      using =
39
          CreateRetentionPolicyRequestBodyDispositionActionField
40
              .CreateRetentionPolicyRequestBodyDispositionActionFieldSerializer.class)
41
  @JsonProperty("disposition_action")
42
  protected final EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField>
43
      dispositionAction;
44

45
  @JsonProperty("retention_length")
46
  protected String retentionLength;
47

48
  @JsonDeserialize(
49
      using =
50
          CreateRetentionPolicyRequestBodyRetentionTypeField
51
              .CreateRetentionPolicyRequestBodyRetentionTypeFieldDeserializer.class)
52
  @JsonSerialize(
53
      using =
54
          CreateRetentionPolicyRequestBodyRetentionTypeField
55
              .CreateRetentionPolicyRequestBodyRetentionTypeFieldSerializer.class)
56
  @JsonProperty("retention_type")
57
  protected EnumWrapper<CreateRetentionPolicyRequestBodyRetentionTypeField> retentionType;
58

59
  @JsonProperty("can_owner_extend_retention")
60
  protected Boolean canOwnerExtendRetention;
61

62
  @JsonProperty("are_owners_notified")
63
  protected Boolean areOwnersNotified;
64

65
  @JsonProperty("custom_notification_recipients")
66
  protected List<UserMini> customNotificationRecipients;
67

68
  public CreateRetentionPolicyRequestBody(
69
      @JsonProperty("policy_name") String policyName,
70
      @JsonProperty("policy_type")
71
          EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField> policyType,
72
      @JsonProperty("disposition_action")
73
          EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField> dispositionAction) {
74
    super();
×
75
    this.policyName = policyName;
×
UNCOV
76
    this.policyType = policyType;
×
UNCOV
77
    this.dispositionAction = dispositionAction;
×
UNCOV
78
  }
×
79

80
  public CreateRetentionPolicyRequestBody(
81
      String policyName,
82
      CreateRetentionPolicyRequestBodyPolicyTypeField policyType,
83
      CreateRetentionPolicyRequestBodyDispositionActionField dispositionAction) {
84
    super();
×
UNCOV
85
    this.policyName = policyName;
×
86
    this.policyType = new EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField>(policyType);
×
UNCOV
87
    this.dispositionAction =
×
88
        new EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField>(dispositionAction);
UNCOV
89
  }
×
90

91
  protected CreateRetentionPolicyRequestBody(Builder builder) {
92
    super();
1✔
93
    this.policyName = builder.policyName;
1✔
94
    this.description = builder.description;
1✔
95
    this.policyType = builder.policyType;
1✔
96
    this.dispositionAction = builder.dispositionAction;
1✔
97
    this.retentionLength = builder.retentionLength;
1✔
98
    this.retentionType = builder.retentionType;
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 EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField> getPolicyType() {
114
    return policyType;
1✔
115
  }
116

117
  public EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField>
118
      getDispositionAction() {
119
    return dispositionAction;
1✔
120
  }
121

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

126
  public EnumWrapper<CreateRetentionPolicyRequestBodyRetentionTypeField> getRetentionType() {
127
    return retentionType;
1✔
128
  }
129

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

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

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

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

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

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

217
  public static class Builder extends NullableFieldTracker {
218

219
    protected final String policyName;
220

221
    protected String description;
222

223
    protected final EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField> policyType;
224

225
    protected final EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField>
226
        dispositionAction;
227

228
    protected String retentionLength;
229

230
    protected EnumWrapper<CreateRetentionPolicyRequestBodyRetentionTypeField> retentionType;
231

232
    protected Boolean canOwnerExtendRetention;
233

234
    protected Boolean areOwnersNotified;
235

236
    protected List<UserMini> customNotificationRecipients;
237

238
    public Builder(
239
        String policyName,
240
        EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField> policyType,
241
        EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField> dispositionAction) {
UNCOV
242
      super();
×
UNCOV
243
      this.policyName = policyName;
×
UNCOV
244
      this.policyType = policyType;
×
UNCOV
245
      this.dispositionAction = dispositionAction;
×
UNCOV
246
    }
×
247

248
    public Builder(
249
        String policyName,
250
        CreateRetentionPolicyRequestBodyPolicyTypeField policyType,
251
        CreateRetentionPolicyRequestBodyDispositionActionField dispositionAction) {
252
      super();
1✔
253
      this.policyName = policyName;
1✔
254
      this.policyType =
1✔
255
          new EnumWrapper<CreateRetentionPolicyRequestBodyPolicyTypeField>(policyType);
256
      this.dispositionAction =
1✔
257
          new EnumWrapper<CreateRetentionPolicyRequestBodyDispositionActionField>(
258
              dispositionAction);
259
    }
1✔
260

261
    public Builder description(String description) {
262
      this.description = description;
1✔
263
      return this;
1✔
264
    }
265

266
    public Builder retentionLength(String retentionLength) {
267
      this.retentionLength = retentionLength;
1✔
268
      return this;
1✔
269
    }
270

271
    public Builder retentionType(CreateRetentionPolicyRequestBodyRetentionTypeField retentionType) {
272
      this.retentionType =
1✔
273
          new EnumWrapper<CreateRetentionPolicyRequestBodyRetentionTypeField>(retentionType);
274
      return this;
1✔
275
    }
276

277
    public Builder retentionType(
278
        EnumWrapper<CreateRetentionPolicyRequestBodyRetentionTypeField> retentionType) {
UNCOV
279
      this.retentionType = retentionType;
×
UNCOV
280
      return this;
×
281
    }
282

283
    public Builder canOwnerExtendRetention(Boolean canOwnerExtendRetention) {
284
      this.canOwnerExtendRetention = canOwnerExtendRetention;
1✔
285
      return this;
1✔
286
    }
287

288
    public Builder areOwnersNotified(Boolean areOwnersNotified) {
289
      this.areOwnersNotified = areOwnersNotified;
1✔
290
      return this;
1✔
291
    }
292

293
    public Builder customNotificationRecipients(List<UserMini> customNotificationRecipients) {
UNCOV
294
      this.customNotificationRecipients = customNotificationRecipients;
×
UNCOV
295
      return this;
×
296
    }
297

298
    public CreateRetentionPolicyRequestBody build() {
299
      return new CreateRetentionPolicyRequestBody(this);
1✔
300
    }
301
  }
302
}
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