Skip to content

Commit 746fa33

Browse files
Automatically update Java SDK
1 parent 89cb1c3 commit 746fa33

File tree

8 files changed

+207
-23
lines changed

8 files changed

+207
-23
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.1.1</version>
11+
<version>1.1.2</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.162");}});
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.341");}});
3434
this.headerSuppliers = headerSuppliers;
3535
this.httpClient = httpClient;
3636
this.timeout = timeout;

src/main/java/so/trophy/types/AchievementResponse.java

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public final class AchievementResponse implements IAchievementResponse {
4444

4545
private final Optional<Integer> streakLength;
4646

47+
private final Optional<List<String>> achievementIds;
48+
4749
private final Optional<String> metricId;
4850

4951
private final Optional<Double> metricValue;
@@ -58,8 +60,8 @@ public final class AchievementResponse implements IAchievementResponse {
5860

5961
private AchievementResponse(String id, String name, AchievementResponseTrigger trigger,
6062
Optional<String> description, Optional<String> badgeUrl, Optional<String> key,
61-
Optional<Integer> streakLength, Optional<String> metricId, Optional<Double> metricValue,
62-
Optional<String> metricName,
63+
Optional<Integer> streakLength, Optional<List<String>> achievementIds,
64+
Optional<String> metricId, Optional<Double> metricValue, Optional<String> metricName,
6365
Optional<List<AchievementResponseUserAttributesItem>> userAttributes,
6466
Optional<AchievementResponseEventAttribute> eventAttribute,
6567
Map<String, Object> additionalProperties) {
@@ -70,6 +72,7 @@ private AchievementResponse(String id, String name, AchievementResponseTrigger t
7072
this.badgeUrl = badgeUrl;
7173
this.key = key;
7274
this.streakLength = streakLength;
75+
this.achievementIds = achievementIds;
7376
this.metricId = metricId;
7477
this.metricValue = metricValue;
7578
this.metricName = metricName;
@@ -140,6 +143,15 @@ public Optional<Integer> getStreakLength() {
140143
return streakLength;
141144
}
142145

146+
/**
147+
* @return The IDs of the prerequisite achievements that must be completed to earn this achievement (only applicable if trigger = 'achievement')
148+
*/
149+
@JsonProperty("achievementIds")
150+
@java.lang.Override
151+
public Optional<List<String>> getAchievementIds() {
152+
return achievementIds;
153+
}
154+
143155
/**
144156
* @return The ID of the metric associated with this achievement (only applicable if trigger = 'metric')
145157
*/
@@ -195,12 +207,12 @@ public Map<String, Object> getAdditionalProperties() {
195207
}
196208

197209
private boolean equalTo(AchievementResponse other) {
198-
return id.equals(other.id) && name.equals(other.name) && trigger.equals(other.trigger) && description.equals(other.description) && badgeUrl.equals(other.badgeUrl) && key.equals(other.key) && streakLength.equals(other.streakLength) && metricId.equals(other.metricId) && metricValue.equals(other.metricValue) && metricName.equals(other.metricName) && userAttributes.equals(other.userAttributes) && eventAttribute.equals(other.eventAttribute);
210+
return id.equals(other.id) && name.equals(other.name) && trigger.equals(other.trigger) && description.equals(other.description) && badgeUrl.equals(other.badgeUrl) && key.equals(other.key) && streakLength.equals(other.streakLength) && achievementIds.equals(other.achievementIds) && metricId.equals(other.metricId) && metricValue.equals(other.metricValue) && metricName.equals(other.metricName) && userAttributes.equals(other.userAttributes) && eventAttribute.equals(other.eventAttribute);
199211
}
200212

201213
@java.lang.Override
202214
public int hashCode() {
203-
return Objects.hash(this.id, this.name, this.trigger, this.description, this.badgeUrl, this.key, this.streakLength, this.metricId, this.metricValue, this.metricName, this.userAttributes, this.eventAttribute);
215+
return Objects.hash(this.id, this.name, this.trigger, this.description, this.badgeUrl, this.key, this.streakLength, this.achievementIds, this.metricId, this.metricValue, this.metricName, this.userAttributes, this.eventAttribute);
204216
}
205217

206218
@java.lang.Override
@@ -266,6 +278,13 @@ public interface _FinalStage {
266278

267279
_FinalStage streakLength(Integer streakLength);
268280

281+
/**
282+
* <p>The IDs of the prerequisite achievements that must be completed to earn this achievement (only applicable if trigger = 'achievement')</p>
283+
*/
284+
_FinalStage achievementIds(Optional<List<String>> achievementIds);
285+
286+
_FinalStage achievementIds(List<String> achievementIds);
287+
269288
/**
270289
* <p>The ID of the metric associated with this achievement (only applicable if trigger = 'metric')</p>
271290
*/
@@ -323,6 +342,8 @@ public static final class Builder implements IdStage, NameStage, TriggerStage, _
323342

324343
private Optional<String> metricId = Optional.empty();
325344

345+
private Optional<List<String>> achievementIds = Optional.empty();
346+
326347
private Optional<Integer> streakLength = Optional.empty();
327348

328349
private Optional<String> key = Optional.empty();
@@ -346,6 +367,7 @@ public Builder from(AchievementResponse other) {
346367
badgeUrl(other.getBadgeUrl());
347368
key(other.getKey());
348369
streakLength(other.getStreakLength());
370+
achievementIds(other.getAchievementIds());
349371
metricId(other.getMetricId());
350372
metricValue(other.getMetricValue());
351373
metricName(other.getMetricName());
@@ -506,6 +528,29 @@ public _FinalStage metricId(Optional<String> metricId) {
506528
return this;
507529
}
508530

531+
/**
532+
* <p>The IDs of the prerequisite achievements that must be completed to earn this achievement (only applicable if trigger = 'achievement')</p>
533+
* @return Reference to {@code this} so that method calls can be chained together.
534+
*/
535+
@java.lang.Override
536+
public _FinalStage achievementIds(List<String> achievementIds) {
537+
this.achievementIds = Optional.ofNullable(achievementIds);
538+
return this;
539+
}
540+
541+
/**
542+
* <p>The IDs of the prerequisite achievements that must be completed to earn this achievement (only applicable if trigger = 'achievement')</p>
543+
*/
544+
@java.lang.Override
545+
@JsonSetter(
546+
value = "achievementIds",
547+
nulls = Nulls.SKIP
548+
)
549+
public _FinalStage achievementIds(Optional<List<String>> achievementIds) {
550+
this.achievementIds = achievementIds;
551+
return this;
552+
}
553+
509554
/**
510555
* <p>The length of the streak required to complete the achievement (only applicable if trigger = 'streak')</p>
511556
* @return Reference to {@code this} so that method calls can be chained together.
@@ -600,7 +645,7 @@ public _FinalStage description(Optional<String> description) {
600645

601646
@java.lang.Override
602647
public AchievementResponse build() {
603-
return new AchievementResponse(id, name, trigger, description, badgeUrl, key, streakLength, metricId, metricValue, metricName, userAttributes, eventAttribute, additionalProperties);
648+
return new AchievementResponse(id, name, trigger, description, badgeUrl, key, streakLength, achievementIds, metricId, metricValue, metricName, userAttributes, eventAttribute, additionalProperties);
604649
}
605650
}
606651
}

src/main/java/so/trophy/types/AchievementResponseTrigger.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ public enum AchievementResponseTrigger {
1313

1414
STREAK("streak"),
1515

16-
API("api");
16+
API("api"),
17+
18+
ACHIEVEMENT("achievement");
1719

1820
private final String value;
1921

src/main/java/so/trophy/types/AchievementWithStatsResponse.java

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ public final class AchievementWithStatsResponse implements IAchievementWithStats
4848

4949
private final Optional<Integer> streakLength;
5050

51+
private final Optional<List<String>> achievementIds;
52+
5153
private final Optional<String> metricId;
5254

5355
private final Optional<Double> metricValue;
@@ -62,8 +64,8 @@ public final class AchievementWithStatsResponse implements IAchievementWithStats
6264

6365
private AchievementWithStatsResponse(int completions, double rarity, String id, String name,
6466
AchievementResponseTrigger trigger, Optional<String> description, Optional<String> badgeUrl,
65-
Optional<String> key, Optional<Integer> streakLength, Optional<String> metricId,
66-
Optional<Double> metricValue, Optional<String> metricName,
67+
Optional<String> key, Optional<Integer> streakLength, Optional<List<String>> achievementIds,
68+
Optional<String> metricId, Optional<Double> metricValue, Optional<String> metricName,
6769
Optional<List<AchievementResponseUserAttributesItem>> userAttributes,
6870
Optional<AchievementResponseEventAttribute> eventAttribute,
6971
Map<String, Object> additionalProperties) {
@@ -76,6 +78,7 @@ private AchievementWithStatsResponse(int completions, double rarity, String id,
7678
this.badgeUrl = badgeUrl;
7779
this.key = key;
7880
this.streakLength = streakLength;
81+
this.achievementIds = achievementIds;
7982
this.metricId = metricId;
8083
this.metricValue = metricValue;
8184
this.metricName = metricName;
@@ -164,6 +167,15 @@ public Optional<Integer> getStreakLength() {
164167
return streakLength;
165168
}
166169

170+
/**
171+
* @return The IDs of the prerequisite achievements that must be completed to earn this achievement (only applicable if trigger = 'achievement')
172+
*/
173+
@JsonProperty("achievementIds")
174+
@java.lang.Override
175+
public Optional<List<String>> getAchievementIds() {
176+
return achievementIds;
177+
}
178+
167179
/**
168180
* @return The ID of the metric associated with this achievement (only applicable if trigger = 'metric')
169181
*/
@@ -219,12 +231,12 @@ public Map<String, Object> getAdditionalProperties() {
219231
}
220232

221233
private boolean equalTo(AchievementWithStatsResponse other) {
222-
return completions == other.completions && rarity == other.rarity && id.equals(other.id) && name.equals(other.name) && trigger.equals(other.trigger) && description.equals(other.description) && badgeUrl.equals(other.badgeUrl) && key.equals(other.key) && streakLength.equals(other.streakLength) && metricId.equals(other.metricId) && metricValue.equals(other.metricValue) && metricName.equals(other.metricName) && userAttributes.equals(other.userAttributes) && eventAttribute.equals(other.eventAttribute);
234+
return completions == other.completions && rarity == other.rarity && id.equals(other.id) && name.equals(other.name) && trigger.equals(other.trigger) && description.equals(other.description) && badgeUrl.equals(other.badgeUrl) && key.equals(other.key) && streakLength.equals(other.streakLength) && achievementIds.equals(other.achievementIds) && metricId.equals(other.metricId) && metricValue.equals(other.metricValue) && metricName.equals(other.metricName) && userAttributes.equals(other.userAttributes) && eventAttribute.equals(other.eventAttribute);
223235
}
224236

225237
@java.lang.Override
226238
public int hashCode() {
227-
return Objects.hash(this.completions, this.rarity, this.id, this.name, this.trigger, this.description, this.badgeUrl, this.key, this.streakLength, this.metricId, this.metricValue, this.metricName, this.userAttributes, this.eventAttribute);
239+
return Objects.hash(this.completions, this.rarity, this.id, this.name, this.trigger, this.description, this.badgeUrl, this.key, this.streakLength, this.achievementIds, this.metricId, this.metricValue, this.metricName, this.userAttributes, this.eventAttribute);
228240
}
229241

230242
@java.lang.Override
@@ -304,6 +316,13 @@ public interface _FinalStage {
304316

305317
_FinalStage streakLength(Integer streakLength);
306318

319+
/**
320+
* <p>The IDs of the prerequisite achievements that must be completed to earn this achievement (only applicable if trigger = 'achievement')</p>
321+
*/
322+
_FinalStage achievementIds(Optional<List<String>> achievementIds);
323+
324+
_FinalStage achievementIds(List<String> achievementIds);
325+
307326
/**
308327
* <p>The ID of the metric associated with this achievement (only applicable if trigger = 'metric')</p>
309328
*/
@@ -365,6 +384,8 @@ public static final class Builder implements CompletionsStage, RarityStage, IdSt
365384

366385
private Optional<String> metricId = Optional.empty();
367386

387+
private Optional<List<String>> achievementIds = Optional.empty();
388+
368389
private Optional<Integer> streakLength = Optional.empty();
369390

370391
private Optional<String> key = Optional.empty();
@@ -390,6 +411,7 @@ public Builder from(AchievementWithStatsResponse other) {
390411
badgeUrl(other.getBadgeUrl());
391412
key(other.getKey());
392413
streakLength(other.getStreakLength());
414+
achievementIds(other.getAchievementIds());
393415
metricId(other.getMetricId());
394416
metricValue(other.getMetricValue());
395417
metricName(other.getMetricName());
@@ -574,6 +596,29 @@ public _FinalStage metricId(Optional<String> metricId) {
574596
return this;
575597
}
576598

599+
/**
600+
* <p>The IDs of the prerequisite achievements that must be completed to earn this achievement (only applicable if trigger = 'achievement')</p>
601+
* @return Reference to {@code this} so that method calls can be chained together.
602+
*/
603+
@java.lang.Override
604+
public _FinalStage achievementIds(List<String> achievementIds) {
605+
this.achievementIds = Optional.ofNullable(achievementIds);
606+
return this;
607+
}
608+
609+
/**
610+
* <p>The IDs of the prerequisite achievements that must be completed to earn this achievement (only applicable if trigger = 'achievement')</p>
611+
*/
612+
@java.lang.Override
613+
@JsonSetter(
614+
value = "achievementIds",
615+
nulls = Nulls.SKIP
616+
)
617+
public _FinalStage achievementIds(Optional<List<String>> achievementIds) {
618+
this.achievementIds = achievementIds;
619+
return this;
620+
}
621+
577622
/**
578623
* <p>The length of the streak required to complete the achievement (only applicable if trigger = 'streak')</p>
579624
* @return Reference to {@code this} so that method calls can be chained together.
@@ -668,7 +713,7 @@ public _FinalStage description(Optional<String> description) {
668713

669714
@java.lang.Override
670715
public AchievementWithStatsResponse build() {
671-
return new AchievementWithStatsResponse(completions, rarity, id, name, trigger, description, badgeUrl, key, streakLength, metricId, metricValue, metricName, userAttributes, eventAttribute, additionalProperties);
716+
return new AchievementWithStatsResponse(completions, rarity, id, name, trigger, description, badgeUrl, key, streakLength, achievementIds, metricId, metricValue, metricName, userAttributes, eventAttribute, additionalProperties);
672717
}
673718
}
674719
}

src/main/java/so/trophy/types/IAchievementResponse.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public interface IAchievementResponse {
2626

2727
Optional<Integer> getStreakLength();
2828

29+
Optional<List<String>> getAchievementIds();
30+
2931
Optional<String> getMetricId();
3032

3133
Optional<Double> getMetricValue();

0 commit comments

Comments
 (0)