Skip to content

Commit c68d0bd

Browse files
Automatically update Java SDK
1 parent 3150588 commit c68d0bd

3 files changed

Lines changed: 45 additions & 6 deletions

File tree

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.19</version>
11+
<version>1.0.20</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
@@ -28,7 +28,7 @@ private ClientOptions(Environment environment, Map<String, String> headers,
2828
this.environment = environment;
2929
this.headers = new HashMap<>();
3030
this.headers.putAll(headers);
31-
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.1445");}});
31+
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.1485");}});
3232
this.headerSuppliers = headerSuppliers;
3333
this.httpClient = httpClient;
3434
this.timeout = timeout;

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

Lines changed: 43 additions & 4 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;
@@ -42,11 +43,13 @@ public final class StreakResponse implements IBaseStreakResponse {
4243

4344
private final Optional<List<StreakResponseStreakHistoryItem>> streakHistory;
4445

46+
private final Optional<Integer> rank;
47+
4548
private final Map<String, Object> additionalProperties;
4649

4750
private StreakResponse(int length, StreakFrequency frequency, Optional<String> started,
4851
Optional<String> periodStart, Optional<String> periodEnd, Optional<String> expires,
49-
Optional<List<StreakResponseStreakHistoryItem>> streakHistory,
52+
Optional<List<StreakResponseStreakHistoryItem>> streakHistory, Optional<Integer> rank,
5053
Map<String, Object> additionalProperties) {
5154
this.length = length;
5255
this.frequency = frequency;
@@ -55,6 +58,7 @@ private StreakResponse(int length, StreakFrequency frequency, Optional<String> s
5558
this.periodEnd = periodEnd;
5659
this.expires = expires;
5760
this.streakHistory = streakHistory;
61+
this.rank = rank;
5862
this.additionalProperties = additionalProperties;
5963
}
6064

@@ -120,6 +124,14 @@ public Optional<List<StreakResponseStreakHistoryItem>> getStreakHistory() {
120124
return streakHistory;
121125
}
122126

127+
/**
128+
* @return The user's rank across all users. Null if the user has no active streak.
129+
*/
130+
@JsonProperty("rank")
131+
public Optional<Integer> getRank() {
132+
return rank;
133+
}
134+
123135
@java.lang.Override
124136
public boolean equals(Object other) {
125137
if (this == other) return true;
@@ -132,12 +144,12 @@ public Map<String, Object> getAdditionalProperties() {
132144
}
133145

134146
private boolean equalTo(StreakResponse other) {
135-
return length == other.length && frequency.equals(other.frequency) && started.equals(other.started) && periodStart.equals(other.periodStart) && periodEnd.equals(other.periodEnd) && expires.equals(other.expires) && streakHistory.equals(other.streakHistory);
147+
return length == other.length && frequency.equals(other.frequency) && started.equals(other.started) && periodStart.equals(other.periodStart) && periodEnd.equals(other.periodEnd) && expires.equals(other.expires) && streakHistory.equals(other.streakHistory) && rank.equals(other.rank);
136148
}
137149

138150
@java.lang.Override
139151
public int hashCode() {
140-
return Objects.hash(this.length, this.frequency, this.started, this.periodStart, this.periodEnd, this.expires, this.streakHistory);
152+
return Objects.hash(this.length, this.frequency, this.started, this.periodStart, this.periodEnd, this.expires, this.streakHistory, this.rank);
141153
}
142154

143155
@java.lang.Override
@@ -181,6 +193,10 @@ public interface _FinalStage {
181193
_FinalStage streakHistory(Optional<List<StreakResponseStreakHistoryItem>> streakHistory);
182194

183195
_FinalStage streakHistory(List<StreakResponseStreakHistoryItem> streakHistory);
196+
197+
_FinalStage rank(Optional<Integer> rank);
198+
199+
_FinalStage rank(Integer rank);
184200
}
185201

186202
@JsonIgnoreProperties(
@@ -191,6 +207,8 @@ public static final class Builder implements LengthStage, FrequencyStage, _Final
191207

192208
private StreakFrequency frequency;
193209

210+
private Optional<Integer> rank = Optional.empty();
211+
194212
private Optional<List<StreakResponseStreakHistoryItem>> streakHistory = Optional.empty();
195213

196214
private Optional<String> expires = Optional.empty();
@@ -216,6 +234,7 @@ public Builder from(StreakResponse other) {
216234
periodEnd(other.getPeriodEnd());
217235
expires(other.getExpires());
218236
streakHistory(other.getStreakHistory());
237+
rank(other.getRank());
219238
return this;
220239
}
221240

@@ -241,6 +260,26 @@ public _FinalStage frequency(@NotNull StreakFrequency frequency) {
241260
return this;
242261
}
243262

263+
/**
264+
* <p>The user's rank across all users. Null if the user has no active streak.</p>
265+
* @return Reference to {@code this} so that method calls can be chained together.
266+
*/
267+
@java.lang.Override
268+
public _FinalStage rank(Integer rank) {
269+
this.rank = Optional.ofNullable(rank);
270+
return this;
271+
}
272+
273+
@java.lang.Override
274+
@JsonSetter(
275+
value = "rank",
276+
nulls = Nulls.SKIP
277+
)
278+
public _FinalStage rank(Optional<Integer> rank) {
279+
this.rank = rank;
280+
return this;
281+
}
282+
244283
/**
245284
* <p>A list of the user's past streak periods up through the current period. Each period includes the start and end dates and the length of the streak.</p>
246285
* @return Reference to {@code this} so that method calls can be chained together.
@@ -344,7 +383,7 @@ public _FinalStage started(Optional<String> started) {
344383

345384
@java.lang.Override
346385
public StreakResponse build() {
347-
return new StreakResponse(length, frequency, started, periodStart, periodEnd, expires, streakHistory, additionalProperties);
386+
return new StreakResponse(length, frequency, started, periodStart, periodEnd, expires, streakHistory, rank, additionalProperties);
348387
}
349388
}
350389
}

0 commit comments

Comments
 (0)