forked from intercom/intercom-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAsyncAiContentClient.java
More file actions
180 lines (155 loc) · 8.3 KB
/
Copy pathAsyncAiContentClient.java
File metadata and controls
180 lines (155 loc) · 8.3 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
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.intercom.api.resources.aicontent;
import com.intercom.api.core.ClientOptions;
import com.intercom.api.core.RequestOptions;
import com.intercom.api.resources.aicontent.requests.CreateContentImportSourceRequest;
import com.intercom.api.resources.aicontent.requests.CreateExternalPageRequest;
import com.intercom.api.resources.aicontent.requests.DeleteContentImportSourceRequest;
import com.intercom.api.resources.aicontent.requests.DeleteExternalPageRequest;
import com.intercom.api.resources.aicontent.requests.GetContentImportSourceRequest;
import com.intercom.api.resources.aicontent.requests.GetExternalPageRequest;
import com.intercom.api.resources.aicontent.requests.UpdateContentImportSourceRequest;
import com.intercom.api.resources.aicontent.requests.UpdateExternalPageRequest;
import com.intercom.api.resources.aicontent.types.ContentImportSource;
import com.intercom.api.resources.aicontent.types.ContentImportSourcesList;
import com.intercom.api.resources.aicontent.types.ExternalPage;
import com.intercom.api.resources.aicontent.types.ExternalPagesList;
import java.util.concurrent.CompletableFuture;
public class AsyncAiContentClient {
protected final ClientOptions clientOptions;
private final AsyncRawAiContentClient rawClient;
public AsyncAiContentClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
this.rawClient = new AsyncRawAiContentClient(clientOptions);
}
/**
* Get responses with HTTP metadata like headers
*/
public AsyncRawAiContentClient withRawResponse() {
return this.rawClient;
}
/**
* You can retrieve a list of all content import sources for a workspace.
*/
public CompletableFuture<ContentImportSourcesList> listContentImportSources() {
return this.rawClient.listContentImportSources().thenApply(response -> response.body());
}
/**
* You can retrieve a list of all content import sources for a workspace.
*/
public CompletableFuture<ContentImportSourcesList> listContentImportSources(RequestOptions requestOptions) {
return this.rawClient.listContentImportSources(requestOptions).thenApply(response -> response.body());
}
/**
* You can create a new content import source by sending a POST request to this endpoint.
*/
public CompletableFuture<ContentImportSource> createContentImportSource(CreateContentImportSourceRequest request) {
return this.rawClient.createContentImportSource(request).thenApply(response -> response.body());
}
/**
* You can create a new content import source by sending a POST request to this endpoint.
*/
public CompletableFuture<ContentImportSource> createContentImportSource(
CreateContentImportSourceRequest request, RequestOptions requestOptions) {
return this.rawClient.createContentImportSource(request, requestOptions).thenApply(response -> response.body());
}
public CompletableFuture<ContentImportSource> getContentImportSource(GetContentImportSourceRequest request) {
return this.rawClient.getContentImportSource(request).thenApply(response -> response.body());
}
public CompletableFuture<ContentImportSource> getContentImportSource(
GetContentImportSourceRequest request, RequestOptions requestOptions) {
return this.rawClient.getContentImportSource(request, requestOptions).thenApply(response -> response.body());
}
/**
* You can update an existing content import source.
*/
public CompletableFuture<ContentImportSource> updateContentImportSource(UpdateContentImportSourceRequest request) {
return this.rawClient.updateContentImportSource(request).thenApply(response -> response.body());
}
/**
* You can update an existing content import source.
*/
public CompletableFuture<ContentImportSource> updateContentImportSource(
UpdateContentImportSourceRequest request, RequestOptions requestOptions) {
return this.rawClient.updateContentImportSource(request, requestOptions).thenApply(response -> response.body());
}
/**
* You can delete a content import source by making a DELETE request this endpoint. This will also delete all external pages that were imported from this source.
*/
public CompletableFuture<Void> deleteContentImportSource(DeleteContentImportSourceRequest request) {
return this.rawClient.deleteContentImportSource(request).thenApply(response -> response.body());
}
/**
* You can delete a content import source by making a DELETE request this endpoint. This will also delete all external pages that were imported from this source.
*/
public CompletableFuture<Void> deleteContentImportSource(
DeleteContentImportSourceRequest request, RequestOptions requestOptions) {
return this.rawClient.deleteContentImportSource(request, requestOptions).thenApply(response -> response.body());
}
/**
* You can retrieve a list of all external pages for a workspace.
*/
public CompletableFuture<ExternalPagesList> listExternalPages() {
return this.rawClient.listExternalPages().thenApply(response -> response.body());
}
/**
* You can retrieve a list of all external pages for a workspace.
*/
public CompletableFuture<ExternalPagesList> listExternalPages(RequestOptions requestOptions) {
return this.rawClient.listExternalPages(requestOptions).thenApply(response -> response.body());
}
/**
* You can create a new external page by sending a POST request to this endpoint. If an external page already exists with the specified source_id and external_id, it will be updated instead.
*/
public CompletableFuture<ExternalPage> createExternalPage(CreateExternalPageRequest request) {
return this.rawClient.createExternalPage(request).thenApply(response -> response.body());
}
/**
* You can create a new external page by sending a POST request to this endpoint. If an external page already exists with the specified source_id and external_id, it will be updated instead.
*/
public CompletableFuture<ExternalPage> createExternalPage(
CreateExternalPageRequest request, RequestOptions requestOptions) {
return this.rawClient.createExternalPage(request, requestOptions).thenApply(response -> response.body());
}
/**
* You can retrieve an external page.
*/
public CompletableFuture<ExternalPage> getExternalPage(GetExternalPageRequest request) {
return this.rawClient.getExternalPage(request).thenApply(response -> response.body());
}
/**
* You can retrieve an external page.
*/
public CompletableFuture<ExternalPage> getExternalPage(
GetExternalPageRequest request, RequestOptions requestOptions) {
return this.rawClient.getExternalPage(request, requestOptions).thenApply(response -> response.body());
}
/**
* You can update an existing external page (if it was created via the API).
*/
public CompletableFuture<ExternalPage> updateExternalPage(UpdateExternalPageRequest request) {
return this.rawClient.updateExternalPage(request).thenApply(response -> response.body());
}
/**
* You can update an existing external page (if it was created via the API).
*/
public CompletableFuture<ExternalPage> updateExternalPage(
UpdateExternalPageRequest request, RequestOptions requestOptions) {
return this.rawClient.updateExternalPage(request, requestOptions).thenApply(response -> response.body());
}
/**
* Sending a DELETE request for an external page will remove it from the content library UI and from being used for AI answers.
*/
public CompletableFuture<ExternalPage> deleteExternalPage(DeleteExternalPageRequest request) {
return this.rawClient.deleteExternalPage(request).thenApply(response -> response.body());
}
/**
* Sending a DELETE request for an external page will remove it from the content library UI and from being used for AI answers.
*/
public CompletableFuture<ExternalPage> deleteExternalPage(
DeleteExternalPageRequest request, RequestOptions requestOptions) {
return this.rawClient.deleteExternalPage(request, requestOptions).thenApply(response -> response.body());
}
}