-
Notifications
You must be signed in to change notification settings - Fork 145
Expand file tree
/
Copy pathAsyncFlowsClient.java
More file actions
109 lines (87 loc) · 4.48 KB
/
AsyncFlowsClient.java
File metadata and controls
109 lines (87 loc) · 4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.auth0.client.mgmt;
import com.auth0.client.mgmt.core.ClientOptions;
import com.auth0.client.mgmt.core.RequestOptions;
import com.auth0.client.mgmt.core.Suppliers;
import com.auth0.client.mgmt.core.SyncPagingIterable;
import com.auth0.client.mgmt.flows.AsyncExecutionsClient;
import com.auth0.client.mgmt.flows.vault.AsyncVaultClient;
import com.auth0.client.mgmt.types.CreateFlowRequestContent;
import com.auth0.client.mgmt.types.CreateFlowResponseContent;
import com.auth0.client.mgmt.types.FlowSummary;
import com.auth0.client.mgmt.types.GetFlowRequestParameters;
import com.auth0.client.mgmt.types.GetFlowResponseContent;
import com.auth0.client.mgmt.types.ListFlowsRequestParameters;
import com.auth0.client.mgmt.types.UpdateFlowRequestContent;
import com.auth0.client.mgmt.types.UpdateFlowResponseContent;
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;
public class AsyncFlowsClient {
protected final ClientOptions clientOptions;
private final AsyncRawFlowsClient rawClient;
protected final Supplier<AsyncExecutionsClient> executionsClient;
protected final Supplier<AsyncVaultClient> vaultClient;
public AsyncFlowsClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
this.rawClient = new AsyncRawFlowsClient(clientOptions);
this.executionsClient = Suppliers.memoize(() -> new AsyncExecutionsClient(clientOptions));
this.vaultClient = Suppliers.memoize(() -> new AsyncVaultClient(clientOptions));
}
/**
* Get responses with HTTP metadata like headers
*/
public AsyncRawFlowsClient withRawResponse() {
return this.rawClient;
}
public CompletableFuture<SyncPagingIterable<FlowSummary>> list() {
return this.rawClient.list().thenApply(response -> response.body());
}
public CompletableFuture<SyncPagingIterable<FlowSummary>> list(ListFlowsRequestParameters request) {
return this.rawClient.list(request).thenApply(response -> response.body());
}
public CompletableFuture<SyncPagingIterable<FlowSummary>> list(
ListFlowsRequestParameters request, RequestOptions requestOptions) {
return this.rawClient.list(request, requestOptions).thenApply(response -> response.body());
}
public CompletableFuture<CreateFlowResponseContent> create(CreateFlowRequestContent request) {
return this.rawClient.create(request).thenApply(response -> response.body());
}
public CompletableFuture<CreateFlowResponseContent> create(
CreateFlowRequestContent request, RequestOptions requestOptions) {
return this.rawClient.create(request, requestOptions).thenApply(response -> response.body());
}
public CompletableFuture<GetFlowResponseContent> get(String id) {
return this.rawClient.get(id).thenApply(response -> response.body());
}
public CompletableFuture<GetFlowResponseContent> get(String id, GetFlowRequestParameters request) {
return this.rawClient.get(id, request).thenApply(response -> response.body());
}
public CompletableFuture<GetFlowResponseContent> get(
String id, GetFlowRequestParameters request, RequestOptions requestOptions) {
return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body());
}
public CompletableFuture<Void> delete(String id) {
return this.rawClient.delete(id).thenApply(response -> response.body());
}
public CompletableFuture<Void> delete(String id, RequestOptions requestOptions) {
return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body());
}
public CompletableFuture<UpdateFlowResponseContent> update(String id) {
return this.rawClient.update(id).thenApply(response -> response.body());
}
public CompletableFuture<UpdateFlowResponseContent> update(String id, UpdateFlowRequestContent request) {
return this.rawClient.update(id, request).thenApply(response -> response.body());
}
public CompletableFuture<UpdateFlowResponseContent> update(
String id, UpdateFlowRequestContent request, RequestOptions requestOptions) {
return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body());
}
public AsyncExecutionsClient executions() {
return this.executionsClient.get();
}
public AsyncVaultClient vault() {
return this.vaultClient.get();
}
}