Skip to content

Commit 5e8d4f4

Browse files
Automatically update Java SDK
1 parent 8fa647e commit 5e8d4f4

File tree

12 files changed

+343
-365
lines changed

12 files changed

+343
-365
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.31</version>
11+
<version>1.0.32</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.2028");}});
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.2148");}});
3434
this.headerSuppliers = headerSuppliers;
3535
this.httpClient = httpClient;
3636
this.timeout = timeout;

src/main/java/so/trophy/resources/leaderboards/requests/LeaderboardsGetRequest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public Optional<Integer> getOffset() {
5959
}
6060

6161
/**
62-
* @return Maximum number of rankings to return.
62+
* @return Maximum number of rankings to return. Cannot be greater than the size of the leaderboard.
6363
*/
6464
@JsonProperty("limit")
6565
public Optional<Integer> getLimit() {
@@ -83,7 +83,7 @@ public Optional<String> getUserId() {
8383
}
8484

8585
/**
86-
* @return Attribute key and value to filter the rankings by, separated by a colon. This parameter is required, and only valid for leaderboards with a breakdown attribute.
86+
* @return Attribute key and value to filter the rankings by, separated by a colon. For example, <code>city:London</code>. This parameter is required, and only valid for leaderboards with a breakdown attribute.
8787
*/
8888
@JsonProperty("userAttributes")
8989
public Optional<String> getUserAttributes() {
@@ -166,7 +166,7 @@ public Builder offset(Integer offset) {
166166
}
167167

168168
/**
169-
* <p>Maximum number of rankings to return.</p>
169+
* <p>Maximum number of rankings to return. Cannot be greater than the size of the leaderboard.</p>
170170
*/
171171
@JsonSetter(
172172
value = "limit",
@@ -217,7 +217,7 @@ public Builder userId(String userId) {
217217
}
218218

219219
/**
220-
* <p>Attribute key and value to filter the rankings by, separated by a colon. This parameter is required, and only valid for leaderboards with a breakdown attribute.</p>
220+
* <p>Attribute key and value to filter the rankings by, separated by a colon. For example, <code>city:London</code>. This parameter is required, and only valid for leaderboards with a breakdown attribute.</p>
221221
*/
222222
@JsonSetter(
223223
value = "userAttributes",

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
199199
return future;
200200
}
201201

202+
/**
203+
* Identify a user.
204+
*/
205+
public CompletableFuture<TrophyApiHttpResponse<User>> identify(String id) {
206+
return identify(id,UpdatedUser.builder().build());
207+
}
208+
202209
/**
203210
* Identify a user.
204211
*/
@@ -273,6 +280,13 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
273280
return future;
274281
}
275282

283+
/**
284+
* Update a user.
285+
*/
286+
public CompletableFuture<TrophyApiHttpResponse<User>> update(String id) {
287+
return update(id,UpdatedUser.builder().build());
288+
}
289+
276290
/**
277291
* Update a user.
278292
*/

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ public CompletableFuture<User> get(String id, RequestOptions requestOptions) {
7272
return this.rawClient.get(id, requestOptions).thenApply(response -> response.body());
7373
}
7474

75+
/**
76+
* Identify a user.
77+
*/
78+
public CompletableFuture<User> identify(String id) {
79+
return this.rawClient.identify(id).thenApply(response -> response.body());
80+
}
81+
7582
/**
7683
* Identify a user.
7784
*/
@@ -87,6 +94,13 @@ public CompletableFuture<User> identify(String id, UpdatedUser request,
8794
return this.rawClient.identify(id, request, requestOptions).thenApply(response -> response.body());
8895
}
8996

97+
/**
98+
* Update a user.
99+
*/
100+
public CompletableFuture<User> update(String id) {
101+
return this.rawClient.update(id).thenApply(response -> response.body());
102+
}
103+
90104
/**
91105
* Update a user.
92106
*/

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ public TrophyApiHttpResponse<User> get(String id, RequestOptions requestOptions)
160160
}
161161
}
162162

163+
/**
164+
* Identify a user.
165+
*/
166+
public TrophyApiHttpResponse<User> identify(String id) {
167+
return identify(id,UpdatedUser.builder().build());
168+
}
169+
163170
/**
164171
* Identify a user.
165172
*/
@@ -218,6 +225,13 @@ public TrophyApiHttpResponse<User> identify(String id, UpdatedUser request,
218225
}
219226
}
220227

228+
/**
229+
* Update a user.
230+
*/
231+
public TrophyApiHttpResponse<User> update(String id) {
232+
return update(id,UpdatedUser.builder().build());
233+
}
234+
221235
/**
222236
* Update a user.
223237
*/

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ public User get(String id, RequestOptions requestOptions) {
7171
return this.rawClient.get(id, requestOptions).body();
7272
}
7373

74+
/**
75+
* Identify a user.
76+
*/
77+
public User identify(String id) {
78+
return this.rawClient.identify(id).body();
79+
}
80+
7481
/**
7582
* Identify a user.
7683
*/
@@ -85,6 +92,13 @@ public User identify(String id, UpdatedUser request, RequestOptions requestOptio
8592
return this.rawClient.identify(id, request, requestOptions).body();
8693
}
8794

95+
/**
96+
* Update a user.
97+
*/
98+
public User update(String id) {
99+
return this.rawClient.update(id).body();
100+
}
101+
88102
/**
89103
* Update a user.
90104
*/

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,22 @@
55
*/
66

77

8+
import java.lang.Boolean;
89
import java.lang.String;
910
import java.util.List;
1011
import java.util.Map;
1112
import java.util.Optional;
1213

1314
public interface IUpdatedUser {
14-
String getEmail();
15+
Optional<String> getEmail();
1516

16-
String getName();
17+
Optional<String> getName();
1718

1819
Optional<String> getTz();
1920

20-
List<String> getDeviceTokens();
21+
Optional<List<String>> getDeviceTokens();
2122

22-
boolean getSubscribeToEmails();
23+
Optional<Boolean> getSubscribeToEmails();
2324

24-
Map<String, String> getAttributes();
25+
Optional<Map<String, String>> getAttributes();
2526
}

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

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)