Skip to content

Commit cfafe0c

Browse files
Automatically update Java SDK
1 parent 162dffc commit cfafe0c

19 files changed

Lines changed: 1492 additions & 21 deletions

‎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.17.0</version>
11+
<version>1.18.0</version>
1212
<packaging>jar</packaging>
1313
<name>Trophy</name>
1414
<description>Java client library for the Trophy API</description>

‎src/main/java/so/trophy/.fern/metadata.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"enable-forward-compatible-enums": false,
77
"retry-status-codes": "legacy"
88
},
9-
"originGitCommit": "885d82705d6aef1477e8e3db3c503783d437a659",
9+
"originGitCommit": "fc9c2289d356522ad24b9464747364dd97f31a15",
1010
"originGitCommitIsDirty": false,
1111
"invokedBy": "ci",
1212
"ciProvider": "github"

‎src/main/java/so/trophy/src/main/java/core/ClientOptions.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private ClientOptions(Environment environment, Map<String, String> headers,
3535
this.environment = environment;
3636
this.headers = new HashMap<>();
3737
this.headers.putAll(headers);
38-
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.5557");}});
38+
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.5790");}});
3939
this.headerSuppliers = headerSuppliers;
4040
this.httpClient = httpClient;
4141
this.timeout = timeout;

‎src/main/java/so/trophy/src/main/java/errors/ForbiddenError.java‎

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

77

88
import so.trophy.core.TrophyApiApiException;
9+
import java.lang.Object;
910
import okhttp3.Response;
10-
import so.trophy.types.ErrorBody;
1111

1212
public final class ForbiddenError extends TrophyApiApiException {
1313
/**
1414
* The body of the response that triggered the exception.
1515
*/
16-
private final ErrorBody body;
16+
private final Object body;
1717

18-
public ForbiddenError(ErrorBody body) {
18+
public ForbiddenError(Object body) {
1919
super("ForbiddenError", 403, body);
2020
this.body = body;
2121
}
2222

23-
public ForbiddenError(ErrorBody body, Response rawResponse) {
23+
public ForbiddenError(Object body, Response rawResponse) {
2424
super("ForbiddenError", 403, body, rawResponse);
2525
this.body = body;
2626
}
@@ -29,7 +29,7 @@ public ForbiddenError(ErrorBody body, Response rawResponse) {
2929
* @return the body
3030
*/
3131
@java.lang.Override
32-
public ErrorBody body() {
32+
public Object body() {
3333
return this.body;
3434
}
3535
}

‎src/main/java/so/trophy/src/main/java/resources/admin/AdminClient.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import so.trophy.core.ClientOptions;
99
import so.trophy.core.Suppliers;
1010
import java.util.function.Supplier;
11+
import so.trophy.resources.admin.applicationapikeys.ApplicationApiKeysClient;
1112
import so.trophy.resources.admin.attributes.AttributesClient;
1213
import so.trophy.resources.admin.leaderboards.LeaderboardsClient;
1314
import so.trophy.resources.admin.metrics.MetricsClient;
@@ -26,6 +27,8 @@ public class AdminClient {
2627

2728
protected final Supplier<StreaksClient> streaksClient;
2829

30+
protected final Supplier<ApplicationApiKeysClient> applicationApiKeysClient;
31+
2932
protected final Supplier<TenantsClient> tenantsClient;
3033

3134
protected final Supplier<PointsClient> pointsClient;
@@ -36,6 +39,7 @@ public AdminClient(ClientOptions clientOptions) {
3639
this.metricsClient = Suppliers.memoize(() -> new MetricsClient(clientOptions));
3740
this.leaderboardsClient = Suppliers.memoize(() -> new LeaderboardsClient(clientOptions));
3841
this.streaksClient = Suppliers.memoize(() -> new StreaksClient(clientOptions));
42+
this.applicationApiKeysClient = Suppliers.memoize(() -> new ApplicationApiKeysClient(clientOptions));
3943
this.tenantsClient = Suppliers.memoize(() -> new TenantsClient(clientOptions));
4044
this.pointsClient = Suppliers.memoize(() -> new PointsClient(clientOptions));
4145
}
@@ -56,6 +60,10 @@ public StreaksClient streaks() {
5660
return this.streaksClient.get();
5761
}
5862

63+
public ApplicationApiKeysClient applicationApiKeys() {
64+
return this.applicationApiKeysClient.get();
65+
}
66+
5967
public TenantsClient tenants() {
6068
return this.tenantsClient.get();
6169
}

‎src/main/java/so/trophy/src/main/java/resources/admin/AsyncAdminClient.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import so.trophy.core.ClientOptions;
99
import so.trophy.core.Suppliers;
1010
import java.util.function.Supplier;
11+
import so.trophy.resources.admin.applicationapikeys.AsyncApplicationApiKeysClient;
1112
import so.trophy.resources.admin.attributes.AsyncAttributesClient;
1213
import so.trophy.resources.admin.leaderboards.AsyncLeaderboardsClient;
1314
import so.trophy.resources.admin.metrics.AsyncMetricsClient;
@@ -26,6 +27,8 @@ public class AsyncAdminClient {
2627

2728
protected final Supplier<AsyncStreaksClient> streaksClient;
2829

30+
protected final Supplier<AsyncApplicationApiKeysClient> applicationApiKeysClient;
31+
2932
protected final Supplier<AsyncTenantsClient> tenantsClient;
3033

3134
protected final Supplier<AsyncPointsClient> pointsClient;
@@ -36,6 +39,7 @@ public AsyncAdminClient(ClientOptions clientOptions) {
3639
this.metricsClient = Suppliers.memoize(() -> new AsyncMetricsClient(clientOptions));
3740
this.leaderboardsClient = Suppliers.memoize(() -> new AsyncLeaderboardsClient(clientOptions));
3841
this.streaksClient = Suppliers.memoize(() -> new AsyncStreaksClient(clientOptions));
42+
this.applicationApiKeysClient = Suppliers.memoize(() -> new AsyncApplicationApiKeysClient(clientOptions));
3943
this.tenantsClient = Suppliers.memoize(() -> new AsyncTenantsClient(clientOptions));
4044
this.pointsClient = Suppliers.memoize(() -> new AsyncPointsClient(clientOptions));
4145
}
@@ -56,6 +60,10 @@ public AsyncStreaksClient streaks() {
5660
return this.streaksClient.get();
5761
}
5862

63+
public AsyncApplicationApiKeysClient applicationApiKeys() {
64+
return this.applicationApiKeysClient.get();
65+
}
66+
5967
public AsyncTenantsClient tenants() {
6068
return this.tenantsClient.get();
6169
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package so.trophy.src.main.java.resources.admin.applicationapikeys;
2+
3+
/**
4+
* This file was auto-generated by Fern from our API Definition.
5+
*/
6+
7+
8+
import so.trophy.core.ClientOptions;
9+
import so.trophy.core.RequestOptions;
10+
import java.util.List;
11+
import so.trophy.resources.admin.applicationapikeys.requests.ApplicationApiKeysDeleteRequest;
12+
import so.trophy.types.CreateApplicationKeyRequestItem;
13+
import so.trophy.types.CreateApplicationKeysResponse;
14+
import so.trophy.types.DeleteApplicationKeysResponse;
15+
16+
public class ApplicationApiKeysClient {
17+
protected final ClientOptions clientOptions;
18+
19+
private final RawApplicationApiKeysClient rawClient;
20+
21+
public ApplicationApiKeysClient(ClientOptions clientOptions) {
22+
this.clientOptions = clientOptions;
23+
this.rawClient = new RawApplicationApiKeysClient(clientOptions);
24+
}
25+
26+
/**
27+
* Get responses with HTTP metadata like headers
28+
*/
29+
public RawApplicationApiKeysClient withRawResponse() {
30+
return this.rawClient;
31+
}
32+
33+
/**
34+
* Create application API keys scoped to specific users. Each key can only perform operations on behalf of the user it was created for.
35+
*/
36+
public CreateApplicationKeysResponse create(List<CreateApplicationKeyRequestItem> request) {
37+
return this.rawClient.create(request).body();
38+
}
39+
40+
/**
41+
* Create application API keys scoped to specific users. Each key can only perform operations on behalf of the user it was created for.
42+
*/
43+
public CreateApplicationKeysResponse create(List<CreateApplicationKeyRequestItem> request,
44+
RequestOptions requestOptions) {
45+
return this.rawClient.create(request, requestOptions).body();
46+
}
47+
48+
/**
49+
* Delete application API keys by ID.
50+
*/
51+
public DeleteApplicationKeysResponse delete() {
52+
return this.rawClient.delete().body();
53+
}
54+
55+
/**
56+
* Delete application API keys by ID.
57+
*/
58+
public DeleteApplicationKeysResponse delete(RequestOptions requestOptions) {
59+
return this.rawClient.delete(requestOptions).body();
60+
}
61+
62+
/**
63+
* Delete application API keys by ID.
64+
*/
65+
public DeleteApplicationKeysResponse delete(ApplicationApiKeysDeleteRequest request) {
66+
return this.rawClient.delete(request).body();
67+
}
68+
69+
/**
70+
* Delete application API keys by ID.
71+
*/
72+
public DeleteApplicationKeysResponse delete(ApplicationApiKeysDeleteRequest request,
73+
RequestOptions requestOptions) {
74+
return this.rawClient.delete(request, requestOptions).body();
75+
}
76+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package so.trophy.src.main.java.resources.admin.applicationapikeys;
2+
3+
/**
4+
* This file was auto-generated by Fern from our API Definition.
5+
*/
6+
7+
8+
import so.trophy.core.ClientOptions;
9+
import so.trophy.core.RequestOptions;
10+
import java.util.List;
11+
import java.util.concurrent.CompletableFuture;
12+
import so.trophy.resources.admin.applicationapikeys.requests.ApplicationApiKeysDeleteRequest;
13+
import so.trophy.types.CreateApplicationKeyRequestItem;
14+
import so.trophy.types.CreateApplicationKeysResponse;
15+
import so.trophy.types.DeleteApplicationKeysResponse;
16+
17+
public class AsyncApplicationApiKeysClient {
18+
protected final ClientOptions clientOptions;
19+
20+
private final AsyncRawApplicationApiKeysClient rawClient;
21+
22+
public AsyncApplicationApiKeysClient(ClientOptions clientOptions) {
23+
this.clientOptions = clientOptions;
24+
this.rawClient = new AsyncRawApplicationApiKeysClient(clientOptions);
25+
}
26+
27+
/**
28+
* Get responses with HTTP metadata like headers
29+
*/
30+
public AsyncRawApplicationApiKeysClient withRawResponse() {
31+
return this.rawClient;
32+
}
33+
34+
/**
35+
* Create application API keys scoped to specific users. Each key can only perform operations on behalf of the user it was created for.
36+
*/
37+
public CompletableFuture<CreateApplicationKeysResponse> create(
38+
List<CreateApplicationKeyRequestItem> request) {
39+
return this.rawClient.create(request).thenApply(response -> response.body());
40+
}
41+
42+
/**
43+
* Create application API keys scoped to specific users. Each key can only perform operations on behalf of the user it was created for.
44+
*/
45+
public CompletableFuture<CreateApplicationKeysResponse> create(
46+
List<CreateApplicationKeyRequestItem> request, RequestOptions requestOptions) {
47+
return this.rawClient.create(request, requestOptions).thenApply(response -> response.body());
48+
}
49+
50+
/**
51+
* Delete application API keys by ID.
52+
*/
53+
public CompletableFuture<DeleteApplicationKeysResponse> delete() {
54+
return this.rawClient.delete().thenApply(response -> response.body());
55+
}
56+
57+
/**
58+
* Delete application API keys by ID.
59+
*/
60+
public CompletableFuture<DeleteApplicationKeysResponse> delete(RequestOptions requestOptions) {
61+
return this.rawClient.delete(requestOptions).thenApply(response -> response.body());
62+
}
63+
64+
/**
65+
* Delete application API keys by ID.
66+
*/
67+
public CompletableFuture<DeleteApplicationKeysResponse> delete(
68+
ApplicationApiKeysDeleteRequest request) {
69+
return this.rawClient.delete(request).thenApply(response -> response.body());
70+
}
71+
72+
/**
73+
* Delete application API keys by ID.
74+
*/
75+
public CompletableFuture<DeleteApplicationKeysResponse> delete(
76+
ApplicationApiKeysDeleteRequest request, RequestOptions requestOptions) {
77+
return this.rawClient.delete(request, requestOptions).thenApply(response -> response.body());
78+
}
79+
}

0 commit comments

Comments
 (0)