Skip to content

Commit f63345c

Browse files
Automatically update Java SDK
1 parent 6075536 commit f63345c

13 files changed

+574
-374
lines changed

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.0.34</version>
11+
<version>1.0.35</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.2165");}});
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.2322");}});
3434
this.headerSuppliers = headerSuppliers;
3535
this.httpClient = httpClient;
3636
this.timeout = timeout;

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

Lines changed: 78 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.fasterxml.jackson.annotation.Nulls;
1515
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
1616
import so.trophy.core.ObjectMappers;
17+
import java.lang.Integer;
1718
import java.lang.Object;
1819
import java.lang.String;
1920
import java.util.HashMap;
@@ -48,7 +49,7 @@ public final class LeaderboardsAllResponseItem implements ILeaderboardResponse {
4849

4950
private final Optional<String> pointsSystemName;
5051

51-
private final String description;
52+
private final Optional<String> description;
5253

5354
private final String start;
5455

@@ -58,7 +59,7 @@ public final class LeaderboardsAllResponseItem implements ILeaderboardResponse {
5859

5960
private final Optional<LeaderboardResponseRunUnit> runUnit;
6061

61-
private final int runInterval;
62+
private final Optional<Integer> runInterval;
6263

6364
private final LeaderboardsAllResponseItemStatus status;
6465

@@ -67,9 +68,10 @@ public final class LeaderboardsAllResponseItem implements ILeaderboardResponse {
6768
private LeaderboardsAllResponseItem(String id, String name, String key,
6869
LeaderboardResponseRankBy rankBy, Optional<String> breakdownAttribute,
6970
Optional<String> metricKey, Optional<String> metricName, Optional<String> pointsSystemKey,
70-
Optional<String> pointsSystemName, String description, String start, Optional<String> end,
71-
int maxParticipants, Optional<LeaderboardResponseRunUnit> runUnit, int runInterval,
72-
LeaderboardsAllResponseItemStatus status, Map<String, Object> additionalProperties) {
71+
Optional<String> pointsSystemName, Optional<String> description, String start,
72+
Optional<String> end, int maxParticipants, Optional<LeaderboardResponseRunUnit> runUnit,
73+
Optional<Integer> runInterval, LeaderboardsAllResponseItemStatus status,
74+
Map<String, Object> additionalProperties) {
7375
this.id = id;
7476
this.name = name;
7577
this.key = key;
@@ -174,7 +176,7 @@ public Optional<String> getPointsSystemName() {
174176
*/
175177
@JsonProperty("description")
176178
@java.lang.Override
177-
public String getDescription() {
179+
public Optional<String> getDescription() {
178180
return description;
179181
}
180182

@@ -214,11 +216,11 @@ public Optional<LeaderboardResponseRunUnit> getRunUnit() {
214216
}
215217

216218
/**
217-
* @return The interval between repetitions, relative to the start date and repetition type.
219+
* @return The interval between repetitions, relative to the start date and repetition type. Null for one-time leaderboards.
218220
*/
219221
@JsonProperty("runInterval")
220222
@java.lang.Override
221-
public int getRunInterval() {
223+
public Optional<Integer> getRunInterval() {
222224
return runInterval;
223225
}
224226

@@ -242,7 +244,7 @@ public Map<String, Object> getAdditionalProperties() {
242244
}
243245

244246
private boolean equalTo(LeaderboardsAllResponseItem other) {
245-
return id.equals(other.id) && name.equals(other.name) && key.equals(other.key) && rankBy.equals(other.rankBy) && breakdownAttribute.equals(other.breakdownAttribute) && 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 == other.runInterval && status.equals(other.status);
247+
return id.equals(other.id) && name.equals(other.name) && key.equals(other.key) && rankBy.equals(other.rankBy) && breakdownAttribute.equals(other.breakdownAttribute) && 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);
246248
}
247249

248250
@java.lang.Override
@@ -286,14 +288,7 @@ public interface RankByStage {
286288
/**
287289
* <p>What the leaderboard ranks by.</p>
288290
*/
289-
DescriptionStage rankBy(@NotNull LeaderboardResponseRankBy rankBy);
290-
}
291-
292-
public interface DescriptionStage {
293-
/**
294-
* <p>The user-facing description of the leaderboard.</p>
295-
*/
296-
StartStage description(@NotNull String description);
291+
StartStage rankBy(@NotNull LeaderboardResponseRankBy rankBy);
297292
}
298293

299294
public interface StartStage {
@@ -307,14 +302,7 @@ public interface MaxParticipantsStage {
307302
/**
308303
* <p>The maximum number of participants in the leaderboard.</p>
309304
*/
310-
RunIntervalStage maxParticipants(int maxParticipants);
311-
}
312-
313-
public interface RunIntervalStage {
314-
/**
315-
* <p>The interval between repetitions, relative to the start date and repetition type.</p>
316-
*/
317-
StatusStage runInterval(int runInterval);
305+
StatusStage maxParticipants(int maxParticipants);
318306
}
319307

320308
public interface StatusStage {
@@ -362,6 +350,13 @@ public interface _FinalStage {
362350

363351
_FinalStage pointsSystemName(String pointsSystemName);
364352

353+
/**
354+
* <p>The user-facing description of the leaderboard.</p>
355+
*/
356+
_FinalStage description(Optional<String> description);
357+
358+
_FinalStage description(String description);
359+
365360
/**
366361
* <p>The end date of the leaderboard in YYYY-MM-DD format, or null if it runs forever.</p>
367362
*/
@@ -375,12 +370,19 @@ public interface _FinalStage {
375370
_FinalStage runUnit(Optional<LeaderboardResponseRunUnit> runUnit);
376371

377372
_FinalStage runUnit(LeaderboardResponseRunUnit runUnit);
373+
374+
/**
375+
* <p>The interval between repetitions, relative to the start date and repetition type. Null for one-time leaderboards.</p>
376+
*/
377+
_FinalStage runInterval(Optional<Integer> runInterval);
378+
379+
_FinalStage runInterval(Integer runInterval);
378380
}
379381

380382
@JsonIgnoreProperties(
381383
ignoreUnknown = true
382384
)
383-
public static final class Builder implements IdStage, NameStage, KeyStage, RankByStage, DescriptionStage, StartStage, MaxParticipantsStage, RunIntervalStage, StatusStage, _FinalStage {
385+
public static final class Builder implements IdStage, NameStage, KeyStage, RankByStage, StartStage, MaxParticipantsStage, StatusStage, _FinalStage {
384386
private String id;
385387

386388
private String name;
@@ -389,20 +391,20 @@ public static final class Builder implements IdStage, NameStage, KeyStage, RankB
389391

390392
private LeaderboardResponseRankBy rankBy;
391393

392-
private String description;
393-
394394
private String start;
395395

396396
private int maxParticipants;
397397

398-
private int runInterval;
399-
400398
private LeaderboardsAllResponseItemStatus status;
401399

400+
private Optional<Integer> runInterval = Optional.empty();
401+
402402
private Optional<LeaderboardResponseRunUnit> runUnit = Optional.empty();
403403

404404
private Optional<String> end = Optional.empty();
405405

406+
private Optional<String> description = Optional.empty();
407+
406408
private Optional<String> pointsSystemName = Optional.empty();
407409

408410
private Optional<String> pointsSystemKey = Optional.empty();
@@ -483,23 +485,11 @@ public RankByStage key(@NotNull String key) {
483485
*/
484486
@java.lang.Override
485487
@JsonSetter("rankBy")
486-
public DescriptionStage rankBy(@NotNull LeaderboardResponseRankBy rankBy) {
488+
public StartStage rankBy(@NotNull LeaderboardResponseRankBy rankBy) {
487489
this.rankBy = Objects.requireNonNull(rankBy, "rankBy must not be null");
488490
return this;
489491
}
490492

491-
/**
492-
* <p>The user-facing description of the leaderboard.</p>
493-
* <p>The user-facing description of the leaderboard.</p>
494-
* @return Reference to {@code this} so that method calls can be chained together.
495-
*/
496-
@java.lang.Override
497-
@JsonSetter("description")
498-
public StartStage description(@NotNull String description) {
499-
this.description = Objects.requireNonNull(description, "description must not be null");
500-
return this;
501-
}
502-
503493
/**
504494
* <p>The start date of the leaderboard in YYYY-MM-DD format.</p>
505495
* <p>The start date of the leaderboard in YYYY-MM-DD format.</p>
@@ -519,32 +509,43 @@ public MaxParticipantsStage start(@NotNull String start) {
519509
*/
520510
@java.lang.Override
521511
@JsonSetter("maxParticipants")
522-
public RunIntervalStage maxParticipants(int maxParticipants) {
512+
public StatusStage maxParticipants(int maxParticipants) {
523513
this.maxParticipants = maxParticipants;
524514
return this;
525515
}
526516

527517
/**
528-
* <p>The interval between repetitions, relative to the start date and repetition type.</p>
529-
* <p>The interval between repetitions, relative to the start date and repetition type.</p>
518+
* <p>The status of the leaderboard.</p>
519+
* <p>The status of the leaderboard.</p>
530520
* @return Reference to {@code this} so that method calls can be chained together.
531521
*/
532522
@java.lang.Override
533-
@JsonSetter("runInterval")
534-
public StatusStage runInterval(int runInterval) {
535-
this.runInterval = runInterval;
523+
@JsonSetter("status")
524+
public _FinalStage status(@NotNull LeaderboardsAllResponseItemStatus status) {
525+
this.status = Objects.requireNonNull(status, "status must not be null");
536526
return this;
537527
}
538528

539529
/**
540-
* <p>The status of the leaderboard.</p>
541-
* <p>The status of the leaderboard.</p>
530+
* <p>The interval between repetitions, relative to the start date and repetition type. Null for one-time leaderboards.</p>
542531
* @return Reference to {@code this} so that method calls can be chained together.
543532
*/
544533
@java.lang.Override
545-
@JsonSetter("status")
546-
public _FinalStage status(@NotNull LeaderboardsAllResponseItemStatus status) {
547-
this.status = Objects.requireNonNull(status, "status must not be null");
534+
public _FinalStage runInterval(Integer runInterval) {
535+
this.runInterval = Optional.ofNullable(runInterval);
536+
return this;
537+
}
538+
539+
/**
540+
* <p>The interval between repetitions, relative to the start date and repetition type. Null for one-time leaderboards.</p>
541+
*/
542+
@java.lang.Override
543+
@JsonSetter(
544+
value = "runInterval",
545+
nulls = Nulls.SKIP
546+
)
547+
public _FinalStage runInterval(Optional<Integer> runInterval) {
548+
this.runInterval = runInterval;
548549
return this;
549550
}
550551

@@ -594,6 +595,29 @@ public _FinalStage end(Optional<String> end) {
594595
return this;
595596
}
596597

598+
/**
599+
* <p>The user-facing description of the leaderboard.</p>
600+
* @return Reference to {@code this} so that method calls can be chained together.
601+
*/
602+
@java.lang.Override
603+
public _FinalStage description(String description) {
604+
this.description = Optional.ofNullable(description);
605+
return this;
606+
}
607+
608+
/**
609+
* <p>The user-facing description of the leaderboard.</p>
610+
*/
611+
@java.lang.Override
612+
@JsonSetter(
613+
value = "description",
614+
nulls = Nulls.SKIP
615+
)
616+
public _FinalStage description(Optional<String> description) {
617+
this.description = description;
618+
return this;
619+
}
620+
597621
/**
598622
* <p>The name of the points system to rank by, if rankBy is 'points'.</p>
599623
* @return Reference to {@code this} so that method calls can be chained together.

src/main/java/so/trophy/resources/users/AsyncRawUsersClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,9 @@ public CompletableFuture<TrophyApiHttpResponse<UserLeaderboardResponseWithHistor
904904
.addPathSegment(key);if (request.getRun().isPresent()) {
905905
QueryStringMapper.addQueryParameter(httpUrl, "run", request.getRun().get(), false);
906906
}
907+
if (request.getNumEvents().isPresent()) {
908+
QueryStringMapper.addQueryParameter(httpUrl, "numEvents", request.getNumEvents().get(), false);
909+
}
907910
Request.Builder _requestBuilder = new Request.Builder()
908911
.url(httpUrl.build())
909912
.method("GET", null)

src/main/java/so/trophy/resources/users/RawUsersClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,9 @@ public TrophyApiHttpResponse<UserLeaderboardResponseWithHistory> leaderboard(Str
715715
.addPathSegment(key);if (request.getRun().isPresent()) {
716716
QueryStringMapper.addQueryParameter(httpUrl, "run", request.getRun().get(), false);
717717
}
718+
if (request.getNumEvents().isPresent()) {
719+
QueryStringMapper.addQueryParameter(httpUrl, "numEvents", request.getNumEvents().get(), false);
720+
}
718721
Request.Builder _requestBuilder = new Request.Builder()
719722
.url(httpUrl.build())
720723
.method("GET", null)

0 commit comments

Comments
 (0)