-
Notifications
You must be signed in to change notification settings - Fork 145
Expand file tree
/
Copy pathAsyncVersionsClient.java
More file actions
97 lines (84 loc) · 4.86 KB
/
AsyncVersionsClient.java
File metadata and controls
97 lines (84 loc) · 4.86 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
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.auth0.client.mgmt.actions;
import com.auth0.client.mgmt.actions.types.ListActionVersionsRequestParameters;
import com.auth0.client.mgmt.core.ClientOptions;
import com.auth0.client.mgmt.core.OptionalNullable;
import com.auth0.client.mgmt.core.RequestOptions;
import com.auth0.client.mgmt.core.SyncPagingIterable;
import com.auth0.client.mgmt.types.ActionVersion;
import com.auth0.client.mgmt.types.DeployActionVersionRequestContent;
import com.auth0.client.mgmt.types.DeployActionVersionResponseContent;
import com.auth0.client.mgmt.types.GetActionVersionResponseContent;
import java.util.concurrent.CompletableFuture;
public class AsyncVersionsClient {
protected final ClientOptions clientOptions;
private final AsyncRawVersionsClient rawClient;
public AsyncVersionsClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
this.rawClient = new AsyncRawVersionsClient(clientOptions);
}
/**
* Get responses with HTTP metadata like headers
*/
public AsyncRawVersionsClient withRawResponse() {
return this.rawClient;
}
/**
* Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created.
*/
public CompletableFuture<SyncPagingIterable<ActionVersion>> list(String actionId) {
return this.rawClient.list(actionId).thenApply(response -> response.body());
}
/**
* Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created.
*/
public CompletableFuture<SyncPagingIterable<ActionVersion>> list(
String actionId, ListActionVersionsRequestParameters request) {
return this.rawClient.list(actionId, request).thenApply(response -> response.body());
}
/**
* Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created.
*/
public CompletableFuture<SyncPagingIterable<ActionVersion>> list(
String actionId, ListActionVersionsRequestParameters request, RequestOptions requestOptions) {
return this.rawClient.list(actionId, request, requestOptions).thenApply(response -> response.body());
}
/**
* Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created.
*/
public CompletableFuture<GetActionVersionResponseContent> get(String actionId, String id) {
return this.rawClient.get(actionId, id).thenApply(response -> response.body());
}
/**
* Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created.
*/
public CompletableFuture<GetActionVersionResponseContent> get(
String actionId, String id, RequestOptions requestOptions) {
return this.rawClient.get(actionId, id, requestOptions).thenApply(response -> response.body());
}
/**
* Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately.
*/
public CompletableFuture<DeployActionVersionResponseContent> deploy(String actionId, String id) {
return this.rawClient.deploy(actionId, id).thenApply(response -> response.body());
}
/**
* Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately.
*/
public CompletableFuture<DeployActionVersionResponseContent> deploy(
String actionId, String id, OptionalNullable<DeployActionVersionRequestContent> request) {
return this.rawClient.deploy(actionId, id, request).thenApply(response -> response.body());
}
/**
* Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately.
*/
public CompletableFuture<DeployActionVersionResponseContent> deploy(
String actionId,
String id,
OptionalNullable<DeployActionVersionRequestContent> request,
RequestOptions requestOptions) {
return this.rawClient.deploy(actionId, id, request, requestOptions).thenApply(response -> response.body());
}
}