Skip to content

Commit ccc12df

Browse files
authored
Merge branch 'main' into patch-2
2 parents 48c3d57 + 9076071 commit ccc12df

2 files changed

Lines changed: 45 additions & 1 deletion

File tree

docs/v1/get-user-game-leaderboards.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,27 @@ const gameLeaderboards = await getUserGameLeaderboards(authorization, {
5454
});
5555
```
5656

57+
```kotlin [Kotlin]
58+
val credentials = RetroCredentials("<username>", "<web api key>")
59+
val api: RetroInterface = RetroClient(credentials).api
60+
61+
val response: NetworkResponse<GetUserGameLeaderboard.Response, ErrorResponse> = api.getUserGameLeaderboards(
62+
gameId = 14402,
63+
)
64+
65+
if (response is NetworkResponse.Success) {
66+
// handle the data
67+
val leaderboard: GetUserGameLeaderboard.Response = response.body
68+
69+
} else if (response is NetworkResponse.Error) {
70+
// if the server returns an error it be found here
71+
val errorResponse: ErrorResponse? = response.body
72+
73+
// if the api (locally) had an internal error, it'll be found here
74+
val internalError: Throwable? = response.error
75+
}
76+
```
77+
5778
:::
5879

5980
## Response

docs/v1/get-user-set-requests.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,30 @@ You must query the user by either their username or their ULID. Please note the
2828

2929
## Client Library
3030

31-
Not Yet Supported
31+
::: code-group
32+
33+
```kotlin [Kotlin]
34+
val credentials = RetroCredentials("<username>", "<web api key>")
35+
val api: RetroInterface = RetroClient(credentials).api
36+
37+
val response: NetworkResponse<GetUserSetRequests.Response, ErrorResponse> = api.getUserSetRequests(
38+
userId = "MaxMilyin"
39+
)
40+
41+
if (response is NetworkResponse.Success) {
42+
// handle the data
43+
val userSetRequests: GetUserSetRequests.Response = response.body
44+
45+
} else if (response is NetworkResponse.Error) {
46+
// if the server returns an error it be found here
47+
val errorResponse: ErrorResponse? = response.body
48+
49+
// if the api (locally) had an internal error, it'll be found here
50+
val internalError: Throwable? = response.error
51+
}
52+
```
53+
54+
:::
3255

3356
## Response
3457

0 commit comments

Comments
 (0)