Skip to content

Commit 7c011ea

Browse files
committed
SDK regeneration
1 parent 52ff817 commit 7c011ea

File tree

8 files changed

+517
-4
lines changed

8 files changed

+517
-4
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ java {
4646

4747
group = 'io.intercom'
4848

49-
version = '3.0.0-alpha5'
49+
version = '3.0.0-alpha7'
5050

5151
jar {
5252
dependsOn(":generatePomFileForMavenPublication")
@@ -77,7 +77,7 @@ publishing {
7777
maven(MavenPublication) {
7878
groupId = 'io.intercom'
7979
artifactId = 'intercom-java'
80-
version = '3.0.0-alpha5'
80+
version = '3.0.0-alpha7'
8181
from components.java
8282
pom {
8383
name = 'intercom'

src/main/java/com/intercom/api/AsyncIntercom.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.intercom.api.resources.companies.AsyncCompaniesClient;
1111
import com.intercom.api.resources.contacts.AsyncContactsClient;
1212
import com.intercom.api.resources.conversations.AsyncConversationsClient;
13+
import com.intercom.api.resources.customchannelevents.AsyncCustomChannelEventsClient;
1314
import com.intercom.api.resources.dataattributes.AsyncDataAttributesClient;
1415
import com.intercom.api.resources.dataexport.AsyncDataExportClient;
1516
import com.intercom.api.resources.events.AsyncEventsClient;
@@ -68,6 +69,8 @@ public class AsyncIntercom {
6869

6970
protected final Supplier<AsyncVisitorsClient> visitorsClient;
7071

72+
protected final Supplier<AsyncCustomChannelEventsClient> customChannelEventsClient;
73+
7174
protected final Supplier<AsyncNewsClient> newsClient;
7275

7376
public AsyncIntercom(ClientOptions clientOptions) {
@@ -91,6 +94,7 @@ public AsyncIntercom(ClientOptions clientOptions) {
9194
this.ticketTypesClient = Suppliers.memoize(() -> new AsyncTicketTypesClient(clientOptions));
9295
this.ticketsClient = Suppliers.memoize(() -> new AsyncTicketsClient(clientOptions));
9396
this.visitorsClient = Suppliers.memoize(() -> new AsyncVisitorsClient(clientOptions));
97+
this.customChannelEventsClient = Suppliers.memoize(() -> new AsyncCustomChannelEventsClient(clientOptions));
9498
this.newsClient = Suppliers.memoize(() -> new AsyncNewsClient(clientOptions));
9599
}
96100

@@ -170,6 +174,10 @@ public AsyncVisitorsClient visitors() {
170174
return this.visitorsClient.get();
171175
}
172176

177+
public AsyncCustomChannelEventsClient customChannelEvents() {
178+
return this.customChannelEventsClient.get();
179+
}
180+
173181
public AsyncNewsClient news() {
174182
return this.newsClient.get();
175183
}

src/main/java/com/intercom/api/Intercom.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.intercom.api.resources.companies.CompaniesClient;
1111
import com.intercom.api.resources.contacts.ContactsClient;
1212
import com.intercom.api.resources.conversations.ConversationsClient;
13+
import com.intercom.api.resources.customchannelevents.CustomChannelEventsClient;
1314
import com.intercom.api.resources.dataattributes.DataAttributesClient;
1415
import com.intercom.api.resources.dataexport.DataExportClient;
1516
import com.intercom.api.resources.events.EventsClient;
@@ -68,6 +69,8 @@ public class Intercom {
6869

6970
protected final Supplier<VisitorsClient> visitorsClient;
7071

72+
protected final Supplier<CustomChannelEventsClient> customChannelEventsClient;
73+
7174
protected final Supplier<NewsClient> newsClient;
7275

7376
public Intercom(ClientOptions clientOptions) {
@@ -91,6 +94,7 @@ public Intercom(ClientOptions clientOptions) {
9194
this.ticketTypesClient = Suppliers.memoize(() -> new TicketTypesClient(clientOptions));
9295
this.ticketsClient = Suppliers.memoize(() -> new TicketsClient(clientOptions));
9396
this.visitorsClient = Suppliers.memoize(() -> new VisitorsClient(clientOptions));
97+
this.customChannelEventsClient = Suppliers.memoize(() -> new CustomChannelEventsClient(clientOptions));
9498
this.newsClient = Suppliers.memoize(() -> new NewsClient(clientOptions));
9599
}
96100

@@ -170,6 +174,10 @@ public VisitorsClient visitors() {
170174
return this.visitorsClient.get();
171175
}
172176

177+
public CustomChannelEventsClient customChannelEvents() {
178+
return this.customChannelEventsClient.get();
179+
}
180+
173181
public NewsClient news() {
174182
return this.newsClient.get();
175183
}

src/main/java/com/intercom/api/core/ClientOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ private ClientOptions(
4141
this.headers.putAll(headers);
4242
this.headers.putAll(new HashMap<String, String>() {
4343
{
44-
put("User-Agent", "io.intercom:intercom-java/3.0.0-alpha5");
44+
put("User-Agent", "io.intercom:intercom-java/3.0.0-alpha7");
4545
put("X-Fern-Language", "JAVA");
4646
put("X-Fern-SDK-Name", "com.intercom.fern:api-sdk");
47-
put("X-Fern-SDK-Version", "3.0.0-alpha5");
47+
put("X-Fern-SDK-Version", "3.0.0-alpha7");
4848
}
4949
});
5050
this.headerSuppliers = headerSuppliers;
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
package com.intercom.api.resources.customchannelevents;
5+
6+
import com.intercom.api.core.ClientOptions;
7+
import com.intercom.api.core.RequestOptions;
8+
import java.util.concurrent.CompletableFuture;
9+
10+
public class AsyncCustomChannelEventsClient {
11+
protected final ClientOptions clientOptions;
12+
13+
private final AsyncRawCustomChannelEventsClient rawClient;
14+
15+
public AsyncCustomChannelEventsClient(ClientOptions clientOptions) {
16+
this.clientOptions = clientOptions;
17+
this.rawClient = new AsyncRawCustomChannelEventsClient(clientOptions);
18+
}
19+
20+
/**
21+
* Get responses with HTTP metadata like headers
22+
*/
23+
public AsyncRawCustomChannelEventsClient withRawResponse() {
24+
return this.rawClient;
25+
}
26+
27+
public CompletableFuture<Void> notifyAttributeCollected() {
28+
return this.rawClient.notifyAttributeCollected().thenApply(response -> response.body());
29+
}
30+
31+
public CompletableFuture<Void> notifyAttributeCollected(RequestOptions requestOptions) {
32+
return this.rawClient.notifyAttributeCollected(requestOptions).thenApply(response -> response.body());
33+
}
34+
35+
public CompletableFuture<Void> notifyNewMessage() {
36+
return this.rawClient.notifyNewMessage().thenApply(response -> response.body());
37+
}
38+
39+
public CompletableFuture<Void> notifyNewMessage(RequestOptions requestOptions) {
40+
return this.rawClient.notifyNewMessage(requestOptions).thenApply(response -> response.body());
41+
}
42+
43+
public CompletableFuture<Void> notifyNewConversation() {
44+
return this.rawClient.notifyNewConversation().thenApply(response -> response.body());
45+
}
46+
47+
public CompletableFuture<Void> notifyNewConversation(RequestOptions requestOptions) {
48+
return this.rawClient.notifyNewConversation(requestOptions).thenApply(response -> response.body());
49+
}
50+
51+
public CompletableFuture<Void> notifyQuickReplySelected() {
52+
return this.rawClient.notifyQuickReplySelected().thenApply(response -> response.body());
53+
}
54+
55+
public CompletableFuture<Void> notifyQuickReplySelected(RequestOptions requestOptions) {
56+
return this.rawClient.notifyQuickReplySelected(requestOptions).thenApply(response -> response.body());
57+
}
58+
}
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
package com.intercom.api.resources.customchannelevents;
5+
6+
import com.intercom.api.core.ClientOptions;
7+
import com.intercom.api.core.IntercomApiException;
8+
import com.intercom.api.core.IntercomException;
9+
import com.intercom.api.core.IntercomHttpResponse;
10+
import com.intercom.api.core.ObjectMappers;
11+
import com.intercom.api.core.RequestOptions;
12+
import java.io.IOException;
13+
import java.util.concurrent.CompletableFuture;
14+
import okhttp3.Call;
15+
import okhttp3.Callback;
16+
import okhttp3.Headers;
17+
import okhttp3.HttpUrl;
18+
import okhttp3.OkHttpClient;
19+
import okhttp3.Request;
20+
import okhttp3.RequestBody;
21+
import okhttp3.Response;
22+
import okhttp3.ResponseBody;
23+
import org.jetbrains.annotations.NotNull;
24+
25+
public class AsyncRawCustomChannelEventsClient {
26+
protected final ClientOptions clientOptions;
27+
28+
public AsyncRawCustomChannelEventsClient(ClientOptions clientOptions) {
29+
this.clientOptions = clientOptions;
30+
}
31+
32+
public CompletableFuture<IntercomHttpResponse<Void>> notifyAttributeCollected() {
33+
return notifyAttributeCollected(null);
34+
}
35+
36+
public CompletableFuture<IntercomHttpResponse<Void>> notifyAttributeCollected(RequestOptions requestOptions) {
37+
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
38+
.newBuilder()
39+
.addPathSegments("custom_channel_events/notify_attribute_collected")
40+
.build();
41+
Request okhttpRequest = new Request.Builder()
42+
.url(httpUrl)
43+
.method("POST", RequestBody.create("", null))
44+
.headers(Headers.of(clientOptions.headers(requestOptions)))
45+
.build();
46+
OkHttpClient client = clientOptions.httpClient();
47+
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
48+
client = clientOptions.httpClientWithTimeout(requestOptions);
49+
}
50+
CompletableFuture<IntercomHttpResponse<Void>> future = new CompletableFuture<>();
51+
client.newCall(okhttpRequest).enqueue(new Callback() {
52+
@Override
53+
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
54+
try (ResponseBody responseBody = response.body()) {
55+
if (response.isSuccessful()) {
56+
future.complete(new IntercomHttpResponse<>(null, response));
57+
return;
58+
}
59+
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
60+
future.completeExceptionally(new IntercomApiException(
61+
"Error with status code " + response.code(),
62+
response.code(),
63+
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
64+
response));
65+
return;
66+
} catch (IOException e) {
67+
future.completeExceptionally(new IntercomException("Network error executing HTTP request", e));
68+
}
69+
}
70+
71+
@Override
72+
public void onFailure(@NotNull Call call, @NotNull IOException e) {
73+
future.completeExceptionally(new IntercomException("Network error executing HTTP request", e));
74+
}
75+
});
76+
return future;
77+
}
78+
79+
public CompletableFuture<IntercomHttpResponse<Void>> notifyNewMessage() {
80+
return notifyNewMessage(null);
81+
}
82+
83+
public CompletableFuture<IntercomHttpResponse<Void>> notifyNewMessage(RequestOptions requestOptions) {
84+
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
85+
.newBuilder()
86+
.addPathSegments("custom_channel_events/notify_new_message")
87+
.build();
88+
Request okhttpRequest = new Request.Builder()
89+
.url(httpUrl)
90+
.method("POST", RequestBody.create("", null))
91+
.headers(Headers.of(clientOptions.headers(requestOptions)))
92+
.build();
93+
OkHttpClient client = clientOptions.httpClient();
94+
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
95+
client = clientOptions.httpClientWithTimeout(requestOptions);
96+
}
97+
CompletableFuture<IntercomHttpResponse<Void>> future = new CompletableFuture<>();
98+
client.newCall(okhttpRequest).enqueue(new Callback() {
99+
@Override
100+
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
101+
try (ResponseBody responseBody = response.body()) {
102+
if (response.isSuccessful()) {
103+
future.complete(new IntercomHttpResponse<>(null, response));
104+
return;
105+
}
106+
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
107+
future.completeExceptionally(new IntercomApiException(
108+
"Error with status code " + response.code(),
109+
response.code(),
110+
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
111+
response));
112+
return;
113+
} catch (IOException e) {
114+
future.completeExceptionally(new IntercomException("Network error executing HTTP request", e));
115+
}
116+
}
117+
118+
@Override
119+
public void onFailure(@NotNull Call call, @NotNull IOException e) {
120+
future.completeExceptionally(new IntercomException("Network error executing HTTP request", e));
121+
}
122+
});
123+
return future;
124+
}
125+
126+
public CompletableFuture<IntercomHttpResponse<Void>> notifyNewConversation() {
127+
return notifyNewConversation(null);
128+
}
129+
130+
public CompletableFuture<IntercomHttpResponse<Void>> notifyNewConversation(RequestOptions requestOptions) {
131+
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
132+
.newBuilder()
133+
.addPathSegments("custom_channel_events/notify_new_conversation")
134+
.build();
135+
Request okhttpRequest = new Request.Builder()
136+
.url(httpUrl)
137+
.method("POST", RequestBody.create("", null))
138+
.headers(Headers.of(clientOptions.headers(requestOptions)))
139+
.build();
140+
OkHttpClient client = clientOptions.httpClient();
141+
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
142+
client = clientOptions.httpClientWithTimeout(requestOptions);
143+
}
144+
CompletableFuture<IntercomHttpResponse<Void>> future = new CompletableFuture<>();
145+
client.newCall(okhttpRequest).enqueue(new Callback() {
146+
@Override
147+
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
148+
try (ResponseBody responseBody = response.body()) {
149+
if (response.isSuccessful()) {
150+
future.complete(new IntercomHttpResponse<>(null, response));
151+
return;
152+
}
153+
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
154+
future.completeExceptionally(new IntercomApiException(
155+
"Error with status code " + response.code(),
156+
response.code(),
157+
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
158+
response));
159+
return;
160+
} catch (IOException e) {
161+
future.completeExceptionally(new IntercomException("Network error executing HTTP request", e));
162+
}
163+
}
164+
165+
@Override
166+
public void onFailure(@NotNull Call call, @NotNull IOException e) {
167+
future.completeExceptionally(new IntercomException("Network error executing HTTP request", e));
168+
}
169+
});
170+
return future;
171+
}
172+
173+
public CompletableFuture<IntercomHttpResponse<Void>> notifyQuickReplySelected() {
174+
return notifyQuickReplySelected(null);
175+
}
176+
177+
public CompletableFuture<IntercomHttpResponse<Void>> notifyQuickReplySelected(RequestOptions requestOptions) {
178+
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
179+
.newBuilder()
180+
.addPathSegments("custom_channel_events/notify_quick_reply_selected")
181+
.build();
182+
Request okhttpRequest = new Request.Builder()
183+
.url(httpUrl)
184+
.method("POST", RequestBody.create("", null))
185+
.headers(Headers.of(clientOptions.headers(requestOptions)))
186+
.build();
187+
OkHttpClient client = clientOptions.httpClient();
188+
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
189+
client = clientOptions.httpClientWithTimeout(requestOptions);
190+
}
191+
CompletableFuture<IntercomHttpResponse<Void>> future = new CompletableFuture<>();
192+
client.newCall(okhttpRequest).enqueue(new Callback() {
193+
@Override
194+
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
195+
try (ResponseBody responseBody = response.body()) {
196+
if (response.isSuccessful()) {
197+
future.complete(new IntercomHttpResponse<>(null, response));
198+
return;
199+
}
200+
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
201+
future.completeExceptionally(new IntercomApiException(
202+
"Error with status code " + response.code(),
203+
response.code(),
204+
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
205+
response));
206+
return;
207+
} catch (IOException e) {
208+
future.completeExceptionally(new IntercomException("Network error executing HTTP request", e));
209+
}
210+
}
211+
212+
@Override
213+
public void onFailure(@NotNull Call call, @NotNull IOException e) {
214+
future.completeExceptionally(new IntercomException("Network error executing HTTP request", e));
215+
}
216+
});
217+
return future;
218+
}
219+
}

0 commit comments

Comments
 (0)