Skip to content

Commit 843b29b

Browse files
SDK regeneration
1 parent bac258a commit 843b29b

File tree

270 files changed

+27662
-7568
lines changed

Some content is hidden

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

270 files changed

+27662
-7568
lines changed

reference.md

Lines changed: 464 additions & 74 deletions
Large diffs are not rendered by default.

src/main/java/com/auth0/client/mgmt/AsyncEventStreamsClient.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@
66
import com.auth0.client.mgmt.core.ClientOptions;
77
import com.auth0.client.mgmt.core.RequestOptions;
88
import com.auth0.client.mgmt.core.Suppliers;
9+
import com.auth0.client.mgmt.core.SyncPagingIterable;
910
import com.auth0.client.mgmt.eventstreams.AsyncDeliveriesClient;
1011
import com.auth0.client.mgmt.eventstreams.AsyncRedeliveriesClient;
1112
import com.auth0.client.mgmt.types.CreateEventStreamResponseContent;
1213
import com.auth0.client.mgmt.types.CreateEventStreamTestEventRequestContent;
1314
import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent;
15+
import com.auth0.client.mgmt.types.EventStreamResponseContent;
1416
import com.auth0.client.mgmt.types.EventStreamsCreateRequest;
1517
import com.auth0.client.mgmt.types.GetEventStreamResponseContent;
1618
import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters;
17-
import com.auth0.client.mgmt.types.ListEventStreamsResponseContent;
1819
import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent;
1920
import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent;
2021
import java.util.concurrent.CompletableFuture;
@@ -43,15 +44,16 @@ public AsyncRawEventStreamsClient withRawResponse() {
4344
return this.rawClient;
4445
}
4546

46-
public CompletableFuture<ListEventStreamsResponseContent> list() {
47+
public CompletableFuture<SyncPagingIterable<EventStreamResponseContent>> list() {
4748
return this.rawClient.list().thenApply(response -> response.body());
4849
}
4950

50-
public CompletableFuture<ListEventStreamsResponseContent> list(ListEventStreamsRequestParameters request) {
51+
public CompletableFuture<SyncPagingIterable<EventStreamResponseContent>> list(
52+
ListEventStreamsRequestParameters request) {
5153
return this.rawClient.list(request).thenApply(response -> response.body());
5254
}
5355

54-
public CompletableFuture<ListEventStreamsResponseContent> list(
56+
public CompletableFuture<SyncPagingIterable<EventStreamResponseContent>> list(
5557
ListEventStreamsRequestParameters request, RequestOptions requestOptions) {
5658
return this.rawClient.list(request, requestOptions).thenApply(response -> response.body());
5759
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
package com.auth0.client.mgmt;
5+
6+
import com.auth0.client.mgmt.core.ClientOptions;
7+
import com.auth0.client.mgmt.core.RequestOptions;
8+
import com.auth0.client.mgmt.core.Suppliers;
9+
import com.auth0.client.mgmt.core.SyncPagingIterable;
10+
import com.auth0.client.mgmt.groups.AsyncMembersClient;
11+
import com.auth0.client.mgmt.types.GetGroupResponseContent;
12+
import com.auth0.client.mgmt.types.Group;
13+
import com.auth0.client.mgmt.types.ListGroupsRequestParameters;
14+
import java.util.concurrent.CompletableFuture;
15+
import java.util.function.Supplier;
16+
17+
public class AsyncGroupsClient {
18+
protected final ClientOptions clientOptions;
19+
20+
private final AsyncRawGroupsClient rawClient;
21+
22+
protected final Supplier<AsyncMembersClient> membersClient;
23+
24+
public AsyncGroupsClient(ClientOptions clientOptions) {
25+
this.clientOptions = clientOptions;
26+
this.rawClient = new AsyncRawGroupsClient(clientOptions);
27+
this.membersClient = Suppliers.memoize(() -> new AsyncMembersClient(clientOptions));
28+
}
29+
30+
/**
31+
* Get responses with HTTP metadata like headers
32+
*/
33+
public AsyncRawGroupsClient withRawResponse() {
34+
return this.rawClient;
35+
}
36+
37+
/**
38+
* List all groups in your tenant.
39+
*/
40+
public CompletableFuture<SyncPagingIterable<Group>> list() {
41+
return this.rawClient.list().thenApply(response -> response.body());
42+
}
43+
44+
/**
45+
* List all groups in your tenant.
46+
*/
47+
public CompletableFuture<SyncPagingIterable<Group>> list(ListGroupsRequestParameters request) {
48+
return this.rawClient.list(request).thenApply(response -> response.body());
49+
}
50+
51+
/**
52+
* List all groups in your tenant.
53+
*/
54+
public CompletableFuture<SyncPagingIterable<Group>> list(
55+
ListGroupsRequestParameters request, RequestOptions requestOptions) {
56+
return this.rawClient.list(request, requestOptions).thenApply(response -> response.body());
57+
}
58+
59+
/**
60+
* Retrieve a group by its ID.
61+
*/
62+
public CompletableFuture<GetGroupResponseContent> get(String id) {
63+
return this.rawClient.get(id).thenApply(response -> response.body());
64+
}
65+
66+
/**
67+
* Retrieve a group by its ID.
68+
*/
69+
public CompletableFuture<GetGroupResponseContent> get(String id, RequestOptions requestOptions) {
70+
return this.rawClient.get(id, requestOptions).thenApply(response -> response.body());
71+
}
72+
73+
public AsyncMembersClient members() {
74+
return this.membersClient.get();
75+
}
76+
}

src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public class AsyncManagementApi {
4444

4545
protected final Supplier<AsyncUserGrantsClient> userGrantsClient;
4646

47+
protected final Supplier<AsyncGroupsClient> groupsClient;
48+
4749
protected final Supplier<AsyncHooksClient> hooksClient;
4850

4951
protected final Supplier<AsyncJobsClient> jobsClient;
@@ -117,6 +119,7 @@ public AsyncManagementApi(ClientOptions clientOptions) {
117119
this.flowsClient = Suppliers.memoize(() -> new AsyncFlowsClient(clientOptions));
118120
this.formsClient = Suppliers.memoize(() -> new AsyncFormsClient(clientOptions));
119121
this.userGrantsClient = Suppliers.memoize(() -> new AsyncUserGrantsClient(clientOptions));
122+
this.groupsClient = Suppliers.memoize(() -> new AsyncGroupsClient(clientOptions));
120123
this.hooksClient = Suppliers.memoize(() -> new AsyncHooksClient(clientOptions));
121124
this.jobsClient = Suppliers.memoize(() -> new AsyncJobsClient(clientOptions));
122125
this.logStreamsClient = Suppliers.memoize(() -> new AsyncLogStreamsClient(clientOptions));
@@ -200,6 +203,10 @@ public AsyncUserGrantsClient userGrants() {
200203
return this.userGrantsClient.get();
201204
}
202205

206+
public AsyncGroupsClient groups() {
207+
return this.groupsClient.get();
208+
}
209+
203210
public AsyncHooksClient hooks() {
204211
return this.hooksClient.get();
205212
}

src/main/java/com/auth0/client/mgmt/AsyncRawEventStreamsClient.java

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.auth0.client.mgmt.core.ObjectMappers;
1212
import com.auth0.client.mgmt.core.QueryStringMapper;
1313
import com.auth0.client.mgmt.core.RequestOptions;
14+
import com.auth0.client.mgmt.core.SyncPagingIterable;
1415
import com.auth0.client.mgmt.errors.BadRequestError;
1516
import com.auth0.client.mgmt.errors.ConflictError;
1617
import com.auth0.client.mgmt.errors.ForbiddenError;
@@ -20,6 +21,7 @@
2021
import com.auth0.client.mgmt.types.CreateEventStreamResponseContent;
2122
import com.auth0.client.mgmt.types.CreateEventStreamTestEventRequestContent;
2223
import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent;
24+
import com.auth0.client.mgmt.types.EventStreamResponseContent;
2325
import com.auth0.client.mgmt.types.EventStreamsCreateRequest;
2426
import com.auth0.client.mgmt.types.GetEventStreamResponseContent;
2527
import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters;
@@ -28,7 +30,11 @@
2830
import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent;
2931
import com.fasterxml.jackson.core.JsonProcessingException;
3032
import java.io.IOException;
33+
import java.util.Collections;
34+
import java.util.List;
35+
import java.util.Optional;
3136
import java.util.concurrent.CompletableFuture;
37+
import java.util.concurrent.ExecutionException;
3238
import okhttp3.Call;
3339
import okhttp3.Callback;
3440
import okhttp3.Headers;
@@ -47,16 +53,16 @@ public AsyncRawEventStreamsClient(ClientOptions clientOptions) {
4753
this.clientOptions = clientOptions;
4854
}
4955

50-
public CompletableFuture<ManagementApiHttpResponse<ListEventStreamsResponseContent>> list() {
56+
public CompletableFuture<ManagementApiHttpResponse<SyncPagingIterable<EventStreamResponseContent>>> list() {
5157
return list(ListEventStreamsRequestParameters.builder().build());
5258
}
5359

54-
public CompletableFuture<ManagementApiHttpResponse<ListEventStreamsResponseContent>> list(
60+
public CompletableFuture<ManagementApiHttpResponse<SyncPagingIterable<EventStreamResponseContent>>> list(
5561
ListEventStreamsRequestParameters request) {
5662
return list(request, null);
5763
}
5864

59-
public CompletableFuture<ManagementApiHttpResponse<ListEventStreamsResponseContent>> list(
65+
public CompletableFuture<ManagementApiHttpResponse<SyncPagingIterable<EventStreamResponseContent>>> list(
6066
ListEventStreamsRequestParameters request, RequestOptions requestOptions) {
6167
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
6268
.newBuilder()
@@ -76,17 +82,34 @@ public CompletableFuture<ManagementApiHttpResponse<ListEventStreamsResponseConte
7682
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
7783
client = clientOptions.httpClientWithTimeout(requestOptions);
7884
}
79-
CompletableFuture<ManagementApiHttpResponse<ListEventStreamsResponseContent>> future =
85+
CompletableFuture<ManagementApiHttpResponse<SyncPagingIterable<EventStreamResponseContent>>> future =
8086
new CompletableFuture<>();
8187
client.newCall(okhttpRequest).enqueue(new Callback() {
8288
@Override
8389
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
8490
try (ResponseBody responseBody = response.body()) {
8591
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
8692
if (response.isSuccessful()) {
93+
ListEventStreamsResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
94+
responseBodyString, ListEventStreamsResponseContent.class);
95+
Optional<String> startingAfter = parsedResponse.getNext();
96+
ListEventStreamsRequestParameters nextRequest = ListEventStreamsRequestParameters.builder()
97+
.from(request)
98+
.from(startingAfter)
99+
.build();
100+
List<EventStreamResponseContent> result =
101+
parsedResponse.getEventStreams().orElse(Collections.emptyList());
87102
future.complete(new ManagementApiHttpResponse<>(
88-
ObjectMappers.JSON_MAPPER.readValue(
89-
responseBodyString, ListEventStreamsResponseContent.class),
103+
new SyncPagingIterable<EventStreamResponseContent>(
104+
startingAfter.isPresent(), result, parsedResponse, () -> {
105+
try {
106+
return list(nextRequest, requestOptions)
107+
.get()
108+
.body();
109+
} catch (InterruptedException | ExecutionException e) {
110+
throw new RuntimeException(e);
111+
}
112+
}),
90113
response));
91114
return;
92115
}

0 commit comments

Comments
 (0)