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

box / box-java-sdk-gen / #301

26 Jun 2025 03:33PM UTC coverage: 35.681% (-0.04%) from 35.723%
#301

push

github

web-flow
feat: Add webhook validation(box/box-codegen#745) (#347)

Co-authored-by: box-sdk-build <box-sdk-build@box.com>

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

11818 existing lines in 631 files now uncovered.

16948 of 47499 relevant lines covered (35.68%)

0.36 hits per line

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

57.84
/src/main/java/com/box/sdkgen/schemas/postoauth2token/PostOAuth2Token.java
1
package com.box.sdkgen.schemas.postoauth2token;
2

3
import com.box.sdkgen.internal.NullableFieldTracker;
4
import com.box.sdkgen.internal.SerializableObject;
5
import com.box.sdkgen.serialization.json.EnumWrapper;
6
import com.fasterxml.jackson.annotation.JsonFilter;
7
import com.fasterxml.jackson.annotation.JsonProperty;
8
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
9
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
10
import java.util.Objects;
11

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

15
  @JsonDeserialize(
16
      using = PostOAuth2TokenGrantTypeField.PostOAuth2TokenGrantTypeFieldDeserializer.class)
17
  @JsonSerialize(
18
      using = PostOAuth2TokenGrantTypeField.PostOAuth2TokenGrantTypeFieldSerializer.class)
19
  @JsonProperty("grant_type")
20
  protected final EnumWrapper<PostOAuth2TokenGrantTypeField> grantType;
21

22
  @JsonProperty("client_id")
23
  protected String clientId;
24

25
  @JsonProperty("client_secret")
26
  protected String clientSecret;
27

28
  protected String code;
29

30
  @JsonProperty("refresh_token")
31
  protected String refreshToken;
32

33
  protected String assertion;
34

35
  @JsonProperty("subject_token")
36
  protected String subjectToken;
37

38
  @JsonDeserialize(
39
      using =
40
          PostOAuth2TokenSubjectTokenTypeField.PostOAuth2TokenSubjectTokenTypeFieldDeserializer
41
              .class)
42
  @JsonSerialize(
43
      using =
44
          PostOAuth2TokenSubjectTokenTypeField.PostOAuth2TokenSubjectTokenTypeFieldSerializer.class)
45
  @JsonProperty("subject_token_type")
46
  protected EnumWrapper<PostOAuth2TokenSubjectTokenTypeField> subjectTokenType;
47

48
  @JsonProperty("actor_token")
49
  protected String actorToken;
50

51
  @JsonDeserialize(
52
      using =
53
          PostOAuth2TokenActorTokenTypeField.PostOAuth2TokenActorTokenTypeFieldDeserializer.class)
54
  @JsonSerialize(
55
      using = PostOAuth2TokenActorTokenTypeField.PostOAuth2TokenActorTokenTypeFieldSerializer.class)
56
  @JsonProperty("actor_token_type")
57
  protected EnumWrapper<PostOAuth2TokenActorTokenTypeField> actorTokenType;
58

59
  protected String scope;
60

61
  protected String resource;
62

63
  @JsonDeserialize(
64
      using =
65
          PostOAuth2TokenBoxSubjectTypeField.PostOAuth2TokenBoxSubjectTypeFieldDeserializer.class)
66
  @JsonSerialize(
67
      using = PostOAuth2TokenBoxSubjectTypeField.PostOAuth2TokenBoxSubjectTypeFieldSerializer.class)
68
  @JsonProperty("box_subject_type")
69
  protected EnumWrapper<PostOAuth2TokenBoxSubjectTypeField> boxSubjectType;
70

71
  @JsonProperty("box_subject_id")
72
  protected String boxSubjectId;
73

74
  @JsonProperty("box_shared_link")
75
  protected String boxSharedLink;
76

77
  public PostOAuth2Token(
78
      @JsonProperty("grant_type") EnumWrapper<PostOAuth2TokenGrantTypeField> grantType) {
UNCOV
79
    super();
×
UNCOV
80
    this.grantType = grantType;
×
81
  }
×
82

83
  public PostOAuth2Token(PostOAuth2TokenGrantTypeField grantType) {
UNCOV
84
    super();
×
UNCOV
85
    this.grantType = new EnumWrapper<PostOAuth2TokenGrantTypeField>(grantType);
×
UNCOV
86
  }
×
87

88
  protected PostOAuth2Token(Builder builder) {
89
    super();
1✔
90
    this.grantType = builder.grantType;
1✔
91
    this.clientId = builder.clientId;
1✔
92
    this.clientSecret = builder.clientSecret;
1✔
93
    this.code = builder.code;
1✔
94
    this.refreshToken = builder.refreshToken;
1✔
95
    this.assertion = builder.assertion;
1✔
96
    this.subjectToken = builder.subjectToken;
1✔
97
    this.subjectTokenType = builder.subjectTokenType;
1✔
98
    this.actorToken = builder.actorToken;
1✔
99
    this.actorTokenType = builder.actorTokenType;
1✔
100
    this.scope = builder.scope;
1✔
101
    this.resource = builder.resource;
1✔
102
    this.boxSubjectType = builder.boxSubjectType;
1✔
103
    this.boxSubjectId = builder.boxSubjectId;
1✔
104
    this.boxSharedLink = builder.boxSharedLink;
1✔
105
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
1✔
106
  }
1✔
107

108
  public EnumWrapper<PostOAuth2TokenGrantTypeField> getGrantType() {
109
    return grantType;
1✔
110
  }
111

112
  public String getClientId() {
113
    return clientId;
1✔
114
  }
115

116
  public String getClientSecret() {
117
    return clientSecret;
1✔
118
  }
119

120
  public String getCode() {
121
    return code;
1✔
122
  }
123

124
  public String getRefreshToken() {
125
    return refreshToken;
1✔
126
  }
127

128
  public String getAssertion() {
129
    return assertion;
1✔
130
  }
131

132
  public String getSubjectToken() {
133
    return subjectToken;
1✔
134
  }
135

136
  public EnumWrapper<PostOAuth2TokenSubjectTokenTypeField> getSubjectTokenType() {
137
    return subjectTokenType;
1✔
138
  }
139

140
  public String getActorToken() {
141
    return actorToken;
1✔
142
  }
143

144
  public EnumWrapper<PostOAuth2TokenActorTokenTypeField> getActorTokenType() {
145
    return actorTokenType;
1✔
146
  }
147

148
  public String getScope() {
149
    return scope;
1✔
150
  }
151

152
  public String getResource() {
153
    return resource;
1✔
154
  }
155

156
  public EnumWrapper<PostOAuth2TokenBoxSubjectTypeField> getBoxSubjectType() {
157
    return boxSubjectType;
1✔
158
  }
159

160
  public String getBoxSubjectId() {
161
    return boxSubjectId;
1✔
162
  }
163

164
  public String getBoxSharedLink() {
165
    return boxSharedLink;
1✔
166
  }
167

168
  @Override
169
  public boolean equals(Object o) {
170
    if (this == o) {
×
UNCOV
171
      return true;
×
172
    }
173
    if (o == null || getClass() != o.getClass()) {
×
174
      return false;
×
175
    }
176
    PostOAuth2Token casted = (PostOAuth2Token) o;
×
177
    return Objects.equals(grantType, casted.grantType)
×
178
        && Objects.equals(clientId, casted.clientId)
×
179
        && Objects.equals(clientSecret, casted.clientSecret)
×
180
        && Objects.equals(code, casted.code)
×
181
        && Objects.equals(refreshToken, casted.refreshToken)
×
182
        && Objects.equals(assertion, casted.assertion)
×
183
        && Objects.equals(subjectToken, casted.subjectToken)
×
184
        && Objects.equals(subjectTokenType, casted.subjectTokenType)
×
185
        && Objects.equals(actorToken, casted.actorToken)
×
186
        && Objects.equals(actorTokenType, casted.actorTokenType)
×
187
        && Objects.equals(scope, casted.scope)
×
UNCOV
188
        && Objects.equals(resource, casted.resource)
×
UNCOV
189
        && Objects.equals(boxSubjectType, casted.boxSubjectType)
×
UNCOV
190
        && Objects.equals(boxSubjectId, casted.boxSubjectId)
×
UNCOV
191
        && Objects.equals(boxSharedLink, casted.boxSharedLink);
×
192
  }
193

194
  @Override
195
  public int hashCode() {
UNCOV
196
    return Objects.hash(
×
197
        grantType,
198
        clientId,
199
        clientSecret,
200
        code,
201
        refreshToken,
202
        assertion,
203
        subjectToken,
204
        subjectTokenType,
205
        actorToken,
206
        actorTokenType,
207
        scope,
208
        resource,
209
        boxSubjectType,
210
        boxSubjectId,
211
        boxSharedLink);
212
  }
213

214
  @Override
215
  public String toString() {
UNCOV
216
    return "PostOAuth2Token{"
×
217
        + "grantType='"
218
        + grantType
219
        + '\''
220
        + ", "
221
        + "clientId='"
222
        + clientId
223
        + '\''
224
        + ", "
225
        + "clientSecret='"
226
        + clientSecret
227
        + '\''
228
        + ", "
229
        + "code='"
230
        + code
231
        + '\''
232
        + ", "
233
        + "refreshToken='"
234
        + refreshToken
235
        + '\''
236
        + ", "
237
        + "assertion='"
238
        + assertion
239
        + '\''
240
        + ", "
241
        + "subjectToken='"
242
        + subjectToken
243
        + '\''
244
        + ", "
245
        + "subjectTokenType='"
246
        + subjectTokenType
247
        + '\''
248
        + ", "
249
        + "actorToken='"
250
        + actorToken
251
        + '\''
252
        + ", "
253
        + "actorTokenType='"
254
        + actorTokenType
255
        + '\''
256
        + ", "
257
        + "scope='"
258
        + scope
259
        + '\''
260
        + ", "
261
        + "resource='"
262
        + resource
263
        + '\''
264
        + ", "
265
        + "boxSubjectType='"
266
        + boxSubjectType
267
        + '\''
268
        + ", "
269
        + "boxSubjectId='"
270
        + boxSubjectId
271
        + '\''
272
        + ", "
273
        + "boxSharedLink='"
274
        + boxSharedLink
275
        + '\''
276
        + "}";
277
  }
278

279
  public static class Builder extends NullableFieldTracker {
280

281
    protected final EnumWrapper<PostOAuth2TokenGrantTypeField> grantType;
282

283
    protected String clientId;
284

285
    protected String clientSecret;
286

287
    protected String code;
288

289
    protected String refreshToken;
290

291
    protected String assertion;
292

293
    protected String subjectToken;
294

295
    protected EnumWrapper<PostOAuth2TokenSubjectTokenTypeField> subjectTokenType;
296

297
    protected String actorToken;
298

299
    protected EnumWrapper<PostOAuth2TokenActorTokenTypeField> actorTokenType;
300

301
    protected String scope;
302

303
    protected String resource;
304

305
    protected EnumWrapper<PostOAuth2TokenBoxSubjectTypeField> boxSubjectType;
306

307
    protected String boxSubjectId;
308

309
    protected String boxSharedLink;
310

311
    public Builder(EnumWrapper<PostOAuth2TokenGrantTypeField> grantType) {
UNCOV
312
      super();
×
UNCOV
313
      this.grantType = grantType;
×
UNCOV
314
    }
×
315

316
    public Builder(PostOAuth2TokenGrantTypeField grantType) {
317
      super();
1✔
318
      this.grantType = new EnumWrapper<PostOAuth2TokenGrantTypeField>(grantType);
1✔
319
    }
1✔
320

321
    public Builder clientId(String clientId) {
322
      this.clientId = clientId;
1✔
323
      return this;
1✔
324
    }
325

326
    public Builder clientSecret(String clientSecret) {
327
      this.clientSecret = clientSecret;
1✔
328
      return this;
1✔
329
    }
330

331
    public Builder code(String code) {
UNCOV
332
      this.code = code;
×
UNCOV
333
      return this;
×
334
    }
335

336
    public Builder refreshToken(String refreshToken) {
337
      this.refreshToken = refreshToken;
1✔
338
      return this;
1✔
339
    }
340

341
    public Builder assertion(String assertion) {
342
      this.assertion = assertion;
1✔
343
      return this;
1✔
344
    }
345

346
    public Builder subjectToken(String subjectToken) {
347
      this.subjectToken = subjectToken;
1✔
348
      return this;
1✔
349
    }
350

351
    public Builder subjectTokenType(PostOAuth2TokenSubjectTokenTypeField subjectTokenType) {
352
      this.subjectTokenType =
1✔
353
          new EnumWrapper<PostOAuth2TokenSubjectTokenTypeField>(subjectTokenType);
354
      return this;
1✔
355
    }
356

357
    public Builder subjectTokenType(
358
        EnumWrapper<PostOAuth2TokenSubjectTokenTypeField> subjectTokenType) {
359
      this.subjectTokenType = subjectTokenType;
×
UNCOV
360
      return this;
×
361
    }
362

363
    public Builder actorToken(String actorToken) {
364
      this.actorToken = actorToken;
×
UNCOV
365
      return this;
×
366
    }
367

368
    public Builder actorTokenType(PostOAuth2TokenActorTokenTypeField actorTokenType) {
369
      this.actorTokenType = new EnumWrapper<PostOAuth2TokenActorTokenTypeField>(actorTokenType);
×
UNCOV
370
      return this;
×
371
    }
372

373
    public Builder actorTokenType(EnumWrapper<PostOAuth2TokenActorTokenTypeField> actorTokenType) {
UNCOV
374
      this.actorTokenType = actorTokenType;
×
UNCOV
375
      return this;
×
376
    }
377

378
    public Builder scope(String scope) {
379
      this.scope = scope;
1✔
380
      return this;
1✔
381
    }
382

383
    public Builder resource(String resource) {
384
      this.resource = resource;
1✔
385
      return this;
1✔
386
    }
387

388
    public Builder boxSubjectType(PostOAuth2TokenBoxSubjectTypeField boxSubjectType) {
UNCOV
389
      this.boxSubjectType = new EnumWrapper<PostOAuth2TokenBoxSubjectTypeField>(boxSubjectType);
×
UNCOV
390
      return this;
×
391
    }
392

393
    public Builder boxSubjectType(EnumWrapper<PostOAuth2TokenBoxSubjectTypeField> boxSubjectType) {
394
      this.boxSubjectType = boxSubjectType;
1✔
395
      return this;
1✔
396
    }
397

398
    public Builder boxSubjectId(String boxSubjectId) {
399
      this.boxSubjectId = boxSubjectId;
1✔
400
      return this;
1✔
401
    }
402

403
    public Builder boxSharedLink(String boxSharedLink) {
404
      this.boxSharedLink = boxSharedLink;
1✔
405
      return this;
1✔
406
    }
407

408
    public PostOAuth2Token build() {
409
      return new PostOAuth2Token(this);
1✔
410
    }
411
  }
412
}
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