-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAccountsClient.java
More file actions
130 lines (111 loc) · 4.2 KB
/
AccountsClient.java
File metadata and controls
130 lines (111 loc) · 4.2 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
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.pipedream.api.resources.accounts;
import com.pipedream.api.core.ClientOptions;
import com.pipedream.api.core.RequestOptions;
import com.pipedream.api.core.pagination.SyncPagingIterable;
import com.pipedream.api.resources.accounts.requests.CreateAccountOpts;
import com.pipedream.api.resources.accounts.requests.DeleteAccountsRequest;
import com.pipedream.api.resources.accounts.requests.DeleteByAppAccountsRequest;
import com.pipedream.api.resources.accounts.requests.ListAccountsRequest;
import com.pipedream.api.resources.accounts.requests.RetrieveAccountsRequest;
import com.pipedream.api.types.Account;
public class AccountsClient {
protected final ClientOptions clientOptions;
private final RawAccountsClient rawClient;
public AccountsClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
this.rawClient = new RawAccountsClient(clientOptions);
}
/**
* Get responses with HTTP metadata like headers
*/
public RawAccountsClient withRawResponse() {
return this.rawClient;
}
/**
* Retrieve all connected accounts for the project with optional filtering
*/
public SyncPagingIterable<Account> list() {
return this.rawClient.list().body();
}
/**
* Retrieve all connected accounts for the project with optional filtering
*/
public SyncPagingIterable<Account> list(ListAccountsRequest request) {
return this.rawClient.list(request).body();
}
/**
* Retrieve all connected accounts for the project with optional filtering
*/
public SyncPagingIterable<Account> list(ListAccountsRequest request, RequestOptions requestOptions) {
return this.rawClient.list(request, requestOptions).body();
}
/**
* Connect a new account for an external user in the project
*/
public Account create(CreateAccountOpts request) {
return this.rawClient.create(request).body();
}
/**
* Connect a new account for an external user in the project
*/
public Account create(CreateAccountOpts request, RequestOptions requestOptions) {
return this.rawClient.create(request, requestOptions).body();
}
/**
* Get the details for a specific connected account
*/
public Account retrieve(String accountId) {
return this.rawClient.retrieve(accountId).body();
}
/**
* Get the details for a specific connected account
*/
public Account retrieve(String accountId, RetrieveAccountsRequest request) {
return this.rawClient.retrieve(accountId, request).body();
}
/**
* Get the details for a specific connected account
*/
public Account retrieve(String accountId, RetrieveAccountsRequest request, RequestOptions requestOptions) {
return this.rawClient.retrieve(accountId, request, requestOptions).body();
}
/**
* Remove a connected account and its associated credentials
*/
public void delete(String accountId) {
this.rawClient.delete(accountId).body();
}
/**
* Remove a connected account and its associated credentials
*/
public void delete(String accountId, DeleteAccountsRequest request) {
this.rawClient.delete(accountId, request).body();
}
/**
* Remove a connected account and its associated credentials
*/
public void delete(String accountId, DeleteAccountsRequest request, RequestOptions requestOptions) {
this.rawClient.delete(accountId, request, requestOptions).body();
}
/**
* Remove all connected accounts for a specific app
*/
public void deleteByApp(String appId) {
this.rawClient.deleteByApp(appId).body();
}
/**
* Remove all connected accounts for a specific app
*/
public void deleteByApp(String appId, DeleteByAppAccountsRequest request) {
this.rawClient.deleteByApp(appId, request).body();
}
/**
* Remove all connected accounts for a specific app
*/
public void deleteByApp(String appId, DeleteByAppAccountsRequest request, RequestOptions requestOptions) {
this.rawClient.deleteByApp(appId, request, requestOptions).body();
}
}