Skip to content

Commit cf21bd1

Browse files
Automatically update Java SDK
1 parent ad71781 commit cf21bd1

11 files changed

Lines changed: 333 additions & 240 deletions

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- General project information -->
99
<groupId>so.trophy</groupId>
1010
<artifactId>trophy-java</artifactId>
11-
<version>1.9.1</version>
11+
<version>1.10.0</version>
1212
<packaging>jar</packaging>
1313
<name>Trophy</name>
1414
<description>Java client library for the Trophy API</description>

‎src/main/java/so/trophy/core/ClientOptions.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private ClientOptions(Environment environment, Map<String, String> headers,
3030
this.environment = environment;
3131
this.headers = new HashMap<>();
3232
this.headers.putAll(headers);
33-
this.headers.putAll(new HashMap<String,String>() {{put("X-Fern-Language", "JAVA");put("X-Fern-SDK-Name", "com.trophy.fern:api-sdk");put("X-Fern-SDK-Version", "0.0.3336");}});
33+
this.headers.putAll(new HashMap<String,String>() {{put("X-Fern-Language", "JAVA");put("X-Fern-SDK-Name", "com.trophy.fern:api-sdk");put("X-Fern-SDK-Version", "0.0.3547");}});
3434
this.headerSuppliers = headerSuppliers;
3535
this.httpClient = httpClient;
3636
this.timeout = timeout;

‎src/main/java/so/trophy/resources/leaderboards/types/LeaderboardsAllResponseItem.java‎

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public final class LeaderboardsAllResponseItem implements ILeaderboardResponse {
5959

6060
private final Optional<String> end;
6161

62-
private final int maxParticipants;
62+
private final Optional<Integer> maxParticipants;
6363

6464
private final Optional<LeaderboardResponseRunUnit> runUnit;
6565

@@ -73,9 +73,10 @@ private LeaderboardsAllResponseItem(String id, String name, String key,
7373
LeaderboardResponseRankBy rankBy, Optional<String> breakdownAttribute,
7474
List<String> breakdownAttributes, Optional<String> metricKey, Optional<String> metricName,
7575
Optional<String> pointsSystemKey, Optional<String> pointsSystemName,
76-
Optional<String> description, String start, Optional<String> end, int maxParticipants,
77-
Optional<LeaderboardResponseRunUnit> runUnit, Optional<Integer> runInterval,
78-
LeaderboardsAllResponseItemStatus status, Map<String, Object> additionalProperties) {
76+
Optional<String> description, String start, Optional<String> end,
77+
Optional<Integer> maxParticipants, Optional<LeaderboardResponseRunUnit> runUnit,
78+
Optional<Integer> runInterval, LeaderboardsAllResponseItemStatus status,
79+
Map<String, Object> additionalProperties) {
7980
this.id = id;
8081
this.name = name;
8182
this.key = key;
@@ -217,7 +218,7 @@ public Optional<String> getEnd() {
217218
*/
218219
@JsonProperty("maxParticipants")
219220
@java.lang.Override
220-
public int getMaxParticipants() {
221+
public Optional<Integer> getMaxParticipants() {
221222
return maxParticipants;
222223
}
223224

@@ -258,7 +259,7 @@ public Map<String, Object> getAdditionalProperties() {
258259
}
259260

260261
private boolean equalTo(LeaderboardsAllResponseItem other) {
261-
return id.equals(other.id) && name.equals(other.name) && key.equals(other.key) && rankBy.equals(other.rankBy) && breakdownAttribute.equals(other.breakdownAttribute) && breakdownAttributes.equals(other.breakdownAttributes) && metricKey.equals(other.metricKey) && metricName.equals(other.metricName) && pointsSystemKey.equals(other.pointsSystemKey) && pointsSystemName.equals(other.pointsSystemName) && description.equals(other.description) && start.equals(other.start) && end.equals(other.end) && maxParticipants == other.maxParticipants && runUnit.equals(other.runUnit) && runInterval.equals(other.runInterval) && status.equals(other.status);
262+
return id.equals(other.id) && name.equals(other.name) && key.equals(other.key) && rankBy.equals(other.rankBy) && breakdownAttribute.equals(other.breakdownAttribute) && breakdownAttributes.equals(other.breakdownAttributes) && metricKey.equals(other.metricKey) && metricName.equals(other.metricName) && pointsSystemKey.equals(other.pointsSystemKey) && pointsSystemName.equals(other.pointsSystemName) && description.equals(other.description) && start.equals(other.start) && end.equals(other.end) && maxParticipants.equals(other.maxParticipants) && runUnit.equals(other.runUnit) && runInterval.equals(other.runInterval) && status.equals(other.status);
262263
}
263264

264265
@java.lang.Override
@@ -309,14 +310,7 @@ public interface StartStage {
309310
/**
310311
* <p>The start date of the leaderboard in YYYY-MM-DD format.</p>
311312
*/
312-
MaxParticipantsStage start(@NotNull String start);
313-
}
314-
315-
public interface MaxParticipantsStage {
316-
/**
317-
* <p>The maximum number of participants in the leaderboard.</p>
318-
*/
319-
StatusStage maxParticipants(int maxParticipants);
313+
StatusStage start(@NotNull String start);
320314
}
321315

322316
public interface StatusStage {
@@ -387,6 +381,13 @@ public interface _FinalStage {
387381

388382
_FinalStage end(String end);
389383

384+
/**
385+
* <p>The maximum number of participants in the leaderboard.</p>
386+
*/
387+
_FinalStage maxParticipants(Optional<Integer> maxParticipants);
388+
389+
_FinalStage maxParticipants(Integer maxParticipants);
390+
390391
/**
391392
* <p>The repetition type for recurring leaderboards, or null for one-time leaderboards.</p>
392393
*/
@@ -405,7 +406,7 @@ public interface _FinalStage {
405406
@JsonIgnoreProperties(
406407
ignoreUnknown = true
407408
)
408-
public static final class Builder implements IdStage, NameStage, KeyStage, RankByStage, StartStage, MaxParticipantsStage, StatusStage, _FinalStage {
409+
public static final class Builder implements IdStage, NameStage, KeyStage, RankByStage, StartStage, StatusStage, _FinalStage {
409410
private String id;
410411

411412
private String name;
@@ -416,14 +417,14 @@ public static final class Builder implements IdStage, NameStage, KeyStage, RankB
416417

417418
private String start;
418419

419-
private int maxParticipants;
420-
421420
private LeaderboardsAllResponseItemStatus status;
422421

423422
private Optional<Integer> runInterval = Optional.empty();
424423

425424
private Optional<LeaderboardResponseRunUnit> runUnit = Optional.empty();
426425

426+
private Optional<Integer> maxParticipants = Optional.empty();
427+
427428
private Optional<String> end = Optional.empty();
428429

429430
private Optional<String> description = Optional.empty();
@@ -523,23 +524,11 @@ public StartStage rankBy(@NotNull LeaderboardResponseRankBy rankBy) {
523524
*/
524525
@java.lang.Override
525526
@JsonSetter("start")
526-
public MaxParticipantsStage start(@NotNull String start) {
527+
public StatusStage start(@NotNull String start) {
527528
this.start = Objects.requireNonNull(start, "start must not be null");
528529
return this;
529530
}
530531

531-
/**
532-
* <p>The maximum number of participants in the leaderboard.</p>
533-
* <p>The maximum number of participants in the leaderboard.</p>
534-
* @return Reference to {@code this} so that method calls can be chained together.
535-
*/
536-
@java.lang.Override
537-
@JsonSetter("maxParticipants")
538-
public StatusStage maxParticipants(int maxParticipants) {
539-
this.maxParticipants = maxParticipants;
540-
return this;
541-
}
542-
543532
/**
544533
* <p>The status of the leaderboard.</p>
545534
* <p>The status of the leaderboard.</p>
@@ -598,6 +587,29 @@ public _FinalStage runUnit(Optional<LeaderboardResponseRunUnit> runUnit) {
598587
return this;
599588
}
600589

590+
/**
591+
* <p>The maximum number of participants in the leaderboard.</p>
592+
* @return Reference to {@code this} so that method calls can be chained together.
593+
*/
594+
@java.lang.Override
595+
public _FinalStage maxParticipants(Integer maxParticipants) {
596+
this.maxParticipants = Optional.ofNullable(maxParticipants);
597+
return this;
598+
}
599+
600+
/**
601+
* <p>The maximum number of participants in the leaderboard.</p>
602+
*/
603+
@java.lang.Override
604+
@JsonSetter(
605+
value = "maxParticipants",
606+
nulls = Nulls.SKIP
607+
)
608+
public _FinalStage maxParticipants(Optional<Integer> maxParticipants) {
609+
this.maxParticipants = maxParticipants;
610+
return this;
611+
}
612+
601613
/**
602614
* <p>The end date of the leaderboard in YYYY-MM-DD format, or null if it runs forever.</p>
603615
* @return Reference to {@code this} so that method calls can be chained together.

‎src/main/java/so/trophy/types/AdminLeaderboard.java‎

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public final class AdminLeaderboard {
4646

4747
private final Optional<String> pointsSystemId;
4848

49-
private final int maxParticipants;
49+
private final Optional<Integer> maxParticipants;
5050

5151
private final String start;
5252

@@ -62,9 +62,10 @@ public final class AdminLeaderboard {
6262

6363
private AdminLeaderboard(String id, String name, String key, Optional<String> description,
6464
AdminLeaderboardStatus status, AdminLeaderboardRankBy rankBy, Optional<String> metricId,
65-
Optional<String> pointsSystemId, int maxParticipants, String start, Optional<String> end,
66-
List<String> breakdownAttributes, Optional<AdminLeaderboardRunUnit> runUnit,
67-
Optional<Integer> runInterval, Map<String, Object> additionalProperties) {
65+
Optional<String> pointsSystemId, Optional<Integer> maxParticipants, String start,
66+
Optional<String> end, List<String> breakdownAttributes,
67+
Optional<AdminLeaderboardRunUnit> runUnit, Optional<Integer> runInterval,
68+
Map<String, Object> additionalProperties) {
6869
this.id = id;
6970
this.name = name;
7071
this.key = key;
@@ -150,7 +151,7 @@ public Optional<String> getPointsSystemId() {
150151
* @return The maximum number of participants.
151152
*/
152153
@JsonProperty("maxParticipants")
153-
public int getMaxParticipants() {
154+
public Optional<Integer> getMaxParticipants() {
154155
return maxParticipants;
155156
}
156157

@@ -206,7 +207,7 @@ public Map<String, Object> getAdditionalProperties() {
206207
}
207208

208209
private boolean equalTo(AdminLeaderboard other) {
209-
return id.equals(other.id) && name.equals(other.name) && key.equals(other.key) && description.equals(other.description) && status.equals(other.status) && rankBy.equals(other.rankBy) && metricId.equals(other.metricId) && pointsSystemId.equals(other.pointsSystemId) && maxParticipants == other.maxParticipants && start.equals(other.start) && end.equals(other.end) && breakdownAttributes.equals(other.breakdownAttributes) && runUnit.equals(other.runUnit) && runInterval.equals(other.runInterval);
210+
return id.equals(other.id) && name.equals(other.name) && key.equals(other.key) && description.equals(other.description) && status.equals(other.status) && rankBy.equals(other.rankBy) && metricId.equals(other.metricId) && pointsSystemId.equals(other.pointsSystemId) && maxParticipants.equals(other.maxParticipants) && start.equals(other.start) && end.equals(other.end) && breakdownAttributes.equals(other.breakdownAttributes) && runUnit.equals(other.runUnit) && runInterval.equals(other.runInterval);
210211
}
211212

212213
@java.lang.Override
@@ -257,14 +258,7 @@ public interface RankByStage {
257258
/**
258259
* <p>What the leaderboard ranks by.</p>
259260
*/
260-
MaxParticipantsStage rankBy(@NotNull AdminLeaderboardRankBy rankBy);
261-
}
262-
263-
public interface MaxParticipantsStage {
264-
/**
265-
* <p>The maximum number of participants.</p>
266-
*/
267-
StartStage maxParticipants(int maxParticipants);
261+
StartStage rankBy(@NotNull AdminLeaderboardRankBy rankBy);
268262
}
269263

270264
public interface StartStage {
@@ -298,6 +292,13 @@ public interface _FinalStage {
298292

299293
_FinalStage pointsSystemId(String pointsSystemId);
300294

295+
/**
296+
* <p>The maximum number of participants.</p>
297+
*/
298+
_FinalStage maxParticipants(Optional<Integer> maxParticipants);
299+
300+
_FinalStage maxParticipants(Integer maxParticipants);
301+
301302
/**
302303
* <p>The optional leaderboard end date in YYYY-MM-DD format.</p>
303304
*/
@@ -332,7 +333,7 @@ public interface _FinalStage {
332333
@JsonIgnoreProperties(
333334
ignoreUnknown = true
334335
)
335-
public static final class Builder implements IdStage, NameStage, KeyStage, StatusStage, RankByStage, MaxParticipantsStage, StartStage, _FinalStage {
336+
public static final class Builder implements IdStage, NameStage, KeyStage, StatusStage, RankByStage, StartStage, _FinalStage {
336337
private String id;
337338

338339
private String name;
@@ -343,8 +344,6 @@ public static final class Builder implements IdStage, NameStage, KeyStage, Statu
343344

344345
private AdminLeaderboardRankBy rankBy;
345346

346-
private int maxParticipants;
347-
348347
private String start;
349348

350349
private Optional<Integer> runInterval = Optional.empty();
@@ -355,6 +354,8 @@ public static final class Builder implements IdStage, NameStage, KeyStage, Statu
355354

356355
private Optional<String> end = Optional.empty();
357356

357+
private Optional<Integer> maxParticipants = Optional.empty();
358+
358359
private Optional<String> pointsSystemId = Optional.empty();
359360

360361
private Optional<String> metricId = Optional.empty();
@@ -441,23 +442,11 @@ public RankByStage status(@NotNull AdminLeaderboardStatus status) {
441442
*/
442443
@java.lang.Override
443444
@JsonSetter("rankBy")
444-
public MaxParticipantsStage rankBy(@NotNull AdminLeaderboardRankBy rankBy) {
445+
public StartStage rankBy(@NotNull AdminLeaderboardRankBy rankBy) {
445446
this.rankBy = Objects.requireNonNull(rankBy, "rankBy must not be null");
446447
return this;
447448
}
448449

449-
/**
450-
* <p>The maximum number of participants.</p>
451-
* <p>The maximum number of participants.</p>
452-
* @return Reference to {@code this} so that method calls can be chained together.
453-
*/
454-
@java.lang.Override
455-
@JsonSetter("maxParticipants")
456-
public StartStage maxParticipants(int maxParticipants) {
457-
this.maxParticipants = maxParticipants;
458-
return this;
459-
}
460-
461450
/**
462451
* <p>The leaderboard start date in YYYY-MM-DD format.</p>
463452
* <p>The leaderboard start date in YYYY-MM-DD format.</p>
@@ -575,6 +564,29 @@ public _FinalStage end(Optional<String> end) {
575564
return this;
576565
}
577566

567+
/**
568+
* <p>The maximum number of participants.</p>
569+
* @return Reference to {@code this} so that method calls can be chained together.
570+
*/
571+
@java.lang.Override
572+
public _FinalStage maxParticipants(Integer maxParticipants) {
573+
this.maxParticipants = Optional.ofNullable(maxParticipants);
574+
return this;
575+
}
576+
577+
/**
578+
* <p>The maximum number of participants.</p>
579+
*/
580+
@java.lang.Override
581+
@JsonSetter(
582+
value = "maxParticipants",
583+
nulls = Nulls.SKIP
584+
)
585+
public _FinalStage maxParticipants(Optional<Integer> maxParticipants) {
586+
this.maxParticipants = maxParticipants;
587+
return this;
588+
}
589+
578590
/**
579591
* <p>The points system ID used when <code>rankBy</code> is <code>points</code>.</p>
580592
* @return Reference to {@code this} so that method calls can be chained together.

‎src/main/java/so/trophy/types/ILeaderboardResponse.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public interface ILeaderboardResponse {
3737

3838
Optional<String> getEnd();
3939

40-
int getMaxParticipants();
40+
Optional<Integer> getMaxParticipants();
4141

4242
Optional<LeaderboardResponseRunUnit> getRunUnit();
4343

0 commit comments

Comments
 (0)