Skip to content

Commit 8645c27

Browse files
Automatically update Java SDK
1 parent 79a76d2 commit 8645c27

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+4182
-262
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.42</version>
11+
<version>1.1.0-beta.4</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.3057");}});
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.3474");}});
3434
this.headerSuppliers = headerSuppliers;
3535
this.httpClient = httpClient;
3636
this.timeout = timeout;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,27 @@
88
import so.trophy.core.ClientOptions;
99
import so.trophy.core.Suppliers;
1010
import java.util.function.Supplier;
11+
import so.trophy.resources.admin.points.PointsClient;
1112
import so.trophy.resources.admin.streaks.StreaksClient;
1213

1314
public class AdminClient {
1415
protected final ClientOptions clientOptions;
1516

1617
protected final Supplier<StreaksClient> streaksClient;
1718

19+
protected final Supplier<PointsClient> pointsClient;
20+
1821
public AdminClient(ClientOptions clientOptions) {
1922
this.clientOptions = clientOptions;
2023
this.streaksClient = Suppliers.memoize(() -> new StreaksClient(clientOptions));
24+
this.pointsClient = Suppliers.memoize(() -> new PointsClient(clientOptions));
2125
}
2226

2327
public StreaksClient streaks() {
2428
return this.streaksClient.get();
2529
}
30+
31+
public PointsClient points() {
32+
return this.pointsClient.get();
33+
}
2634
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,27 @@
88
import so.trophy.core.ClientOptions;
99
import so.trophy.core.Suppliers;
1010
import java.util.function.Supplier;
11+
import so.trophy.resources.admin.points.AsyncPointsClient;
1112
import so.trophy.resources.admin.streaks.AsyncStreaksClient;
1213

1314
public class AsyncAdminClient {
1415
protected final ClientOptions clientOptions;
1516

1617
protected final Supplier<AsyncStreaksClient> streaksClient;
1718

19+
protected final Supplier<AsyncPointsClient> pointsClient;
20+
1821
public AsyncAdminClient(ClientOptions clientOptions) {
1922
this.clientOptions = clientOptions;
2023
this.streaksClient = Suppliers.memoize(() -> new AsyncStreaksClient(clientOptions));
24+
this.pointsClient = Suppliers.memoize(() -> new AsyncPointsClient(clientOptions));
2125
}
2226

2327
public AsyncStreaksClient streaks() {
2428
return this.streaksClient.get();
2529
}
30+
31+
public AsyncPointsClient points() {
32+
return this.pointsClient.get();
33+
}
2634
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package so.trophy.resources.admin.points;
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.Suppliers;
10+
import java.util.function.Supplier;
11+
import so.trophy.resources.admin.points.boosts.AsyncBoostsClient;
12+
13+
public class AsyncPointsClient {
14+
protected final ClientOptions clientOptions;
15+
16+
protected final Supplier<AsyncBoostsClient> boostsClient;
17+
18+
public AsyncPointsClient(ClientOptions clientOptions) {
19+
this.clientOptions = clientOptions;
20+
this.boostsClient = Suppliers.memoize(() -> new AsyncBoostsClient(clientOptions));
21+
}
22+
23+
public AsyncBoostsClient boosts() {
24+
return this.boostsClient.get();
25+
}
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package so.trophy.resources.admin.points;
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.Suppliers;
10+
import java.util.function.Supplier;
11+
import so.trophy.resources.admin.points.boosts.BoostsClient;
12+
13+
public class PointsClient {
14+
protected final ClientOptions clientOptions;
15+
16+
protected final Supplier<BoostsClient> boostsClient;
17+
18+
public PointsClient(ClientOptions clientOptions) {
19+
this.clientOptions = clientOptions;
20+
this.boostsClient = Suppliers.memoize(() -> new BoostsClient(clientOptions));
21+
}
22+
23+
public BoostsClient boosts() {
24+
return this.boostsClient.get();
25+
}
26+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
package so.trophy.resources.admin.points.boosts;
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.lang.String;
11+
import java.lang.Void;
12+
import java.util.concurrent.CompletableFuture;
13+
import so.trophy.resources.admin.points.boosts.requests.BoostsBatchArchiveRequest;
14+
import so.trophy.resources.admin.points.boosts.requests.CreatePointsBoostsRequest;
15+
import so.trophy.types.ArchivePointsBoostsResponse;
16+
import so.trophy.types.CreatePointsBoostsResponse;
17+
18+
public class AsyncBoostsClient {
19+
protected final ClientOptions clientOptions;
20+
21+
private final AsyncRawBoostsClient rawClient;
22+
23+
public AsyncBoostsClient(ClientOptions clientOptions) {
24+
this.clientOptions = clientOptions;
25+
this.rawClient = new AsyncRawBoostsClient(clientOptions);
26+
}
27+
28+
/**
29+
* Get responses with HTTP metadata like headers
30+
*/
31+
public AsyncRawBoostsClient withRawResponse() {
32+
return this.rawClient;
33+
}
34+
35+
/**
36+
* Create points boosts for multiple users.
37+
*/
38+
public CompletableFuture<CreatePointsBoostsResponse> create(CreatePointsBoostsRequest request) {
39+
return this.rawClient.create(request).thenApply(response -> response.body());
40+
}
41+
42+
/**
43+
* Create points boosts for multiple users.
44+
*/
45+
public CompletableFuture<CreatePointsBoostsResponse> create(CreatePointsBoostsRequest request,
46+
RequestOptions requestOptions) {
47+
return this.rawClient.create(request, requestOptions).thenApply(response -> response.body());
48+
}
49+
50+
/**
51+
* Archive multiple points boosts by ID.
52+
*/
53+
public CompletableFuture<ArchivePointsBoostsResponse> batchArchive() {
54+
return this.rawClient.batchArchive().thenApply(response -> response.body());
55+
}
56+
57+
/**
58+
* Archive multiple points boosts by ID.
59+
*/
60+
public CompletableFuture<ArchivePointsBoostsResponse> batchArchive(
61+
BoostsBatchArchiveRequest request) {
62+
return this.rawClient.batchArchive(request).thenApply(response -> response.body());
63+
}
64+
65+
/**
66+
* Archive multiple points boosts by ID.
67+
*/
68+
public CompletableFuture<ArchivePointsBoostsResponse> batchArchive(
69+
BoostsBatchArchiveRequest request, RequestOptions requestOptions) {
70+
return this.rawClient.batchArchive(request, requestOptions).thenApply(response -> response.body());
71+
}
72+
73+
/**
74+
* Archive a points boost by ID.
75+
*/
76+
public CompletableFuture<Void> archive(String id) {
77+
return this.rawClient.archive(id).thenApply(response -> response.body());
78+
}
79+
80+
/**
81+
* Archive a points boost by ID.
82+
*/
83+
public CompletableFuture<Void> archive(String id, RequestOptions requestOptions) {
84+
return this.rawClient.archive(id, requestOptions).thenApply(response -> response.body());
85+
}
86+
}

0 commit comments

Comments
 (0)