-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAsyncBaseClient.java
More file actions
139 lines (108 loc) · 5.29 KB
/
AsyncBaseClient.java
File metadata and controls
139 lines (108 loc) · 5.29 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
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.pipedream.api;
import com.pipedream.api.core.ClientOptions;
import com.pipedream.api.core.Suppliers;
import com.pipedream.api.resources.accounts.AsyncAccountsClient;
import com.pipedream.api.resources.actions.AsyncActionsClient;
import com.pipedream.api.resources.appcategories.AsyncAppCategoriesClient;
import com.pipedream.api.resources.apps.AsyncAppsClient;
import com.pipedream.api.resources.components.AsyncComponentsClient;
import com.pipedream.api.resources.deployedtriggers.AsyncDeployedTriggersClient;
import com.pipedream.api.resources.filestash.AsyncFileStashClient;
import com.pipedream.api.resources.oauthtokens.AsyncOauthTokensClient;
import com.pipedream.api.resources.projects.AsyncProjectsClient;
import com.pipedream.api.resources.proxy.AsyncProxyClient;
import com.pipedream.api.resources.tokens.AsyncTokensClient;
import com.pipedream.api.resources.triggers.AsyncTriggersClient;
import com.pipedream.api.resources.users.AsyncUsersClient;
import java.util.function.Supplier;
public class AsyncBaseClient {
protected final ClientOptions clientOptions;
protected final Supplier<AsyncAppCategoriesClient> appCategoriesClient;
protected final Supplier<AsyncAppsClient> appsClient;
protected final Supplier<AsyncAccountsClient> accountsClient;
protected final Supplier<AsyncUsersClient> usersClient;
protected final Supplier<AsyncComponentsClient> componentsClient;
protected final Supplier<AsyncActionsClient> actionsClient;
protected final Supplier<AsyncTriggersClient> triggersClient;
protected final Supplier<AsyncDeployedTriggersClient> deployedTriggersClient;
protected final Supplier<AsyncProjectsClient> projectsClient;
protected final Supplier<AsyncFileStashClient> fileStashClient;
protected final Supplier<AsyncProxyClient> proxyClient;
protected final Supplier<AsyncTokensClient> tokensClient;
protected final Supplier<AsyncOauthTokensClient> oauthTokensClient;
public AsyncBaseClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
this.appCategoriesClient = Suppliers.memoize(() -> new AsyncAppCategoriesClient(clientOptions));
this.appsClient = Suppliers.memoize(() -> new AsyncAppsClient(clientOptions));
this.accountsClient = Suppliers.memoize(() -> new AsyncAccountsClient(clientOptions));
this.usersClient = Suppliers.memoize(() -> new AsyncUsersClient(clientOptions));
this.componentsClient = Suppliers.memoize(() -> new AsyncComponentsClient(clientOptions));
this.actionsClient = Suppliers.memoize(() -> new AsyncActionsClient(clientOptions));
this.triggersClient = Suppliers.memoize(() -> new AsyncTriggersClient(clientOptions));
this.deployedTriggersClient = Suppliers.memoize(() -> new AsyncDeployedTriggersClient(clientOptions));
this.projectsClient = Suppliers.memoize(() -> new AsyncProjectsClient(clientOptions));
this.fileStashClient = Suppliers.memoize(() -> new AsyncFileStashClient(clientOptions));
this.proxyClient = Suppliers.memoize(() -> new AsyncProxyClient(clientOptions));
this.tokensClient = Suppliers.memoize(() -> new AsyncTokensClient(clientOptions));
this.oauthTokensClient = Suppliers.memoize(() -> new AsyncOauthTokensClient(clientOptions));
}
public AsyncAppCategoriesClient appCategories() {
return this.appCategoriesClient.get();
}
public AsyncAppsClient apps() {
return this.appsClient.get();
}
public AsyncAccountsClient accounts() {
return this.accountsClient.get();
}
public AsyncUsersClient users() {
return this.usersClient.get();
}
public AsyncComponentsClient components() {
return this.componentsClient.get();
}
public AsyncActionsClient actions() {
return this.actionsClient.get();
}
public AsyncTriggersClient triggers() {
return this.triggersClient.get();
}
public AsyncDeployedTriggersClient deployedTriggers() {
return this.deployedTriggersClient.get();
}
public AsyncProjectsClient projects() {
return this.projectsClient.get();
}
public AsyncFileStashClient fileStash() {
return this.fileStashClient.get();
}
public AsyncProxyClient proxy() {
return this.proxyClient.get();
}
public AsyncTokensClient tokens() {
return this.tokensClient.get();
}
public AsyncOauthTokensClient oauthTokens() {
return this.oauthTokensClient.get();
}
/**
* Creates a client builder using a pre-generated access token.
* @param token The access token to use for authentication
* @return A builder configured for token authentication
*/
public static AsyncBaseClientBuilder._TokenAuth withToken(String token) {
return AsyncBaseClientBuilder.withToken(token);
}
/**
* Creates a client builder using OAuth client credentials.
* @param clientId The OAuth client ID
* @param clientSecret The OAuth client secret
* @return A builder configured for OAuth authentication
*/
public static AsyncBaseClientBuilder._CredentialsAuth withCredentials(String clientId, String clientSecret) {
return AsyncBaseClientBuilder.withCredentials(clientId, clientSecret);
}
}