-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathAsyncConnectionsClient.java
More file actions
268 lines (235 loc) · 16.7 KB
/
AsyncConnectionsClient.java
File metadata and controls
268 lines (235 loc) · 16.7 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.auth0.client.mgmt;
import com.auth0.client.mgmt.connections.AsyncClientsClient;
import com.auth0.client.mgmt.connections.AsyncDirectoryProvisioningClient;
import com.auth0.client.mgmt.connections.AsyncKeysClient;
import com.auth0.client.mgmt.connections.AsyncScimConfigurationClient;
import com.auth0.client.mgmt.connections.AsyncUsersClient;
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.types.ConnectionForList;
import com.auth0.client.mgmt.types.CreateConnectionRequestContent;
import com.auth0.client.mgmt.types.CreateConnectionResponseContent;
import com.auth0.client.mgmt.types.GetConnectionRequestParameters;
import com.auth0.client.mgmt.types.GetConnectionResponseContent;
import com.auth0.client.mgmt.types.ListConnectionsQueryParameters;
import com.auth0.client.mgmt.types.UpdateConnectionRequestContent;
import com.auth0.client.mgmt.types.UpdateConnectionResponseContent;
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;
public class AsyncConnectionsClient {
protected final ClientOptions clientOptions;
private final AsyncRawConnectionsClient rawClient;
protected final Supplier<AsyncDirectoryProvisioningClient> directoryProvisioningClient;
protected final Supplier<AsyncScimConfigurationClient> scimConfigurationClient;
protected final Supplier<AsyncClientsClient> clientsClient;
protected final Supplier<AsyncKeysClient> keysClient;
protected final Supplier<AsyncUsersClient> usersClient;
public AsyncConnectionsClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
this.rawClient = new AsyncRawConnectionsClient(clientOptions);
this.directoryProvisioningClient = Suppliers.memoize(() -> new AsyncDirectoryProvisioningClient(clientOptions));
this.scimConfigurationClient = Suppliers.memoize(() -> new AsyncScimConfigurationClient(clientOptions));
this.clientsClient = Suppliers.memoize(() -> new AsyncClientsClient(clientOptions));
this.keysClient = Suppliers.memoize(() -> new AsyncKeysClient(clientOptions));
this.usersClient = Suppliers.memoize(() -> new AsyncUsersClient(clientOptions));
}
/**
* Get responses with HTTP metadata like headers
*/
public AsyncRawConnectionsClient withRawResponse() {
return this.rawClient;
}
/**
* Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections.
* <p>This endpoint supports two types of pagination:</p>
* <p><ul>
* <li>Offset pagination</li>
* <li>Checkpoint pagination</li>
* </ul></p>
* <p>Checkpoint pagination must be used if you need to retrieve more than 1000 connections.</p>
* <p><h2>Checkpoint Pagination</h2></p>
* <p>To search by checkpoint, use the following parameters:</p>
* <p><ul>
* <li><code>from</code>: Optional id from which to start selection.</li>
* <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li>
* </ul></p>
* <p><b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.</p>
*/
public CompletableFuture<SyncPagingIterable<ConnectionForList>> list() {
return this.rawClient.list().thenApply(response -> response.body());
}
/**
* Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections.
* <p>This endpoint supports two types of pagination:</p>
* <p><ul>
* <li>Offset pagination</li>
* <li>Checkpoint pagination</li>
* </ul></p>
* <p>Checkpoint pagination must be used if you need to retrieve more than 1000 connections.</p>
* <p><h2>Checkpoint Pagination</h2></p>
* <p>To search by checkpoint, use the following parameters:</p>
* <p><ul>
* <li><code>from</code>: Optional id from which to start selection.</li>
* <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li>
* </ul></p>
* <p><b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.</p>
*/
public CompletableFuture<SyncPagingIterable<ConnectionForList>> list(RequestOptions requestOptions) {
return this.rawClient.list(requestOptions).thenApply(response -> response.body());
}
/**
* Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections.
* <p>This endpoint supports two types of pagination:</p>
* <p><ul>
* <li>Offset pagination</li>
* <li>Checkpoint pagination</li>
* </ul></p>
* <p>Checkpoint pagination must be used if you need to retrieve more than 1000 connections.</p>
* <p><h2>Checkpoint Pagination</h2></p>
* <p>To search by checkpoint, use the following parameters:</p>
* <p><ul>
* <li><code>from</code>: Optional id from which to start selection.</li>
* <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li>
* </ul></p>
* <p><b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.</p>
*/
public CompletableFuture<SyncPagingIterable<ConnectionForList>> list(ListConnectionsQueryParameters request) {
return this.rawClient.list(request).thenApply(response -> response.body());
}
/**
* Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections.
* <p>This endpoint supports two types of pagination:</p>
* <p><ul>
* <li>Offset pagination</li>
* <li>Checkpoint pagination</li>
* </ul></p>
* <p>Checkpoint pagination must be used if you need to retrieve more than 1000 connections.</p>
* <p><h2>Checkpoint Pagination</h2></p>
* <p>To search by checkpoint, use the following parameters:</p>
* <p><ul>
* <li><code>from</code>: Optional id from which to start selection.</li>
* <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li>
* </ul></p>
* <p><b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.</p>
*/
public CompletableFuture<SyncPagingIterable<ConnectionForList>> list(
ListConnectionsQueryParameters request, RequestOptions requestOptions) {
return this.rawClient.list(request, requestOptions).thenApply(response -> response.body());
}
/**
* Creates a new connection according to the JSON object received in <code>body</code>.
* <p><b>Note:</b> If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.</p>
*/
public CompletableFuture<CreateConnectionResponseContent> create(CreateConnectionRequestContent request) {
return this.rawClient.create(request).thenApply(response -> response.body());
}
/**
* Creates a new connection according to the JSON object received in <code>body</code>.
* <p><b>Note:</b> If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.</p>
*/
public CompletableFuture<CreateConnectionResponseContent> create(
CreateConnectionRequestContent request, RequestOptions requestOptions) {
return this.rawClient.create(request, requestOptions).thenApply(response -> response.body());
}
/**
* Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration.
*/
public CompletableFuture<GetConnectionResponseContent> get(String id) {
return this.rawClient.get(id).thenApply(response -> response.body());
}
/**
* Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration.
*/
public CompletableFuture<GetConnectionResponseContent> get(String id, RequestOptions requestOptions) {
return this.rawClient.get(id, requestOptions).thenApply(response -> response.body());
}
/**
* Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration.
*/
public CompletableFuture<GetConnectionResponseContent> get(String id, GetConnectionRequestParameters request) {
return this.rawClient.get(id, request).thenApply(response -> response.body());
}
/**
* Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration.
*/
public CompletableFuture<GetConnectionResponseContent> get(
String id, GetConnectionRequestParameters request, RequestOptions requestOptions) {
return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body());
}
/**
* Removes a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate.
* <p><b>Note:</b> If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent <a href="https://auth0.com/docs/api/management/v2/connections/post-connections">create connection</a> requests, if they use an identical connection name.</p>
*/
public CompletableFuture<Void> delete(String id) {
return this.rawClient.delete(id).thenApply(response -> response.body());
}
/**
* Removes a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate.
* <p><b>Note:</b> If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent <a href="https://auth0.com/docs/api/management/v2/connections/post-connections">create connection</a> requests, if they use an identical connection name.</p>
*/
public CompletableFuture<Void> delete(String id, RequestOptions requestOptions) {
return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body());
}
/**
* Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration.
* <p><b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.</p>
*/
public CompletableFuture<UpdateConnectionResponseContent> update(String id) {
return this.rawClient.update(id).thenApply(response -> response.body());
}
/**
* Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration.
* <p><b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.</p>
*/
public CompletableFuture<UpdateConnectionResponseContent> update(String id, RequestOptions requestOptions) {
return this.rawClient.update(id, requestOptions).thenApply(response -> response.body());
}
/**
* Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration.
* <p><b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.</p>
*/
public CompletableFuture<UpdateConnectionResponseContent> update(
String id, UpdateConnectionRequestContent request) {
return this.rawClient.update(id, request).thenApply(response -> response.body());
}
/**
* Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration.
* <p><b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.</p>
*/
public CompletableFuture<UpdateConnectionResponseContent> update(
String id, UpdateConnectionRequestContent request, RequestOptions requestOptions) {
return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body());
}
/**
* Retrieves the status of an ad/ldap connection referenced by its <code>ID</code>. <code>200 OK</code> http status code response is returned when the connection is online, otherwise a <code>404</code> status code is returned along with an error message
*/
public CompletableFuture<Void> checkStatus(String id) {
return this.rawClient.checkStatus(id).thenApply(response -> response.body());
}
/**
* Retrieves the status of an ad/ldap connection referenced by its <code>ID</code>. <code>200 OK</code> http status code response is returned when the connection is online, otherwise a <code>404</code> status code is returned along with an error message
*/
public CompletableFuture<Void> checkStatus(String id, RequestOptions requestOptions) {
return this.rawClient.checkStatus(id, requestOptions).thenApply(response -> response.body());
}
public AsyncDirectoryProvisioningClient directoryProvisioning() {
return this.directoryProvisioningClient.get();
}
public AsyncScimConfigurationClient scimConfiguration() {
return this.scimConfigurationClient.get();
}
public AsyncClientsClient clients() {
return this.clientsClient.get();
}
public AsyncKeysClient keys() {
return this.keysClient.get();
}
public AsyncUsersClient users() {
return this.usersClient.get();
}
}