Skip to content

Commit 04723f7

Browse files
SDK regeneration
1 parent fec6735 commit 04723f7

File tree

776 files changed

+94004
-29304
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

776 files changed

+94004
-29304
lines changed

.fern/metadata.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"cliVersion": "3.0.2",
3+
"generatorName": "fernapi/fern-java-sdk",
4+
"generatorVersion": "3.21.0",
5+
"generatorConfig": {
6+
"enable-inline-types": true,
7+
"client-class-name": "Intercom",
8+
"inline-path-parameters": true,
9+
"enable-forward-compatible-enums": true,
10+
"enable-wire-tests": false
11+
}
12+
}

.github/workflows/label-ai-generated-prs.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

README.md

Lines changed: 97 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,53 @@
11
# Intercom Java Library
22

33
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fintercom%2Fintercom-java)
4+
[![Maven Central](https://img.shields.io/maven-central/v/io.intercom/intercom-java)](https://central.sonatype.com/artifact/io.intercom/intercom-java)
45

5-
The Intercom Java library provides convenient access to the Intercom API from Java.
6+
The Intercom Java library provides convenient access to the Intercom APIs from Java.
7+
8+
## Table of Contents
9+
10+
- [Installation](#installation)
11+
- [Reference](#reference)
12+
- [Usage](#usage)
13+
- [Environments](#environments)
14+
- [Base Url](#base-url)
15+
- [Exception Handling](#exception-handling)
16+
- [Advanced](#advanced)
17+
- [Custom Client](#custom-client)
18+
- [Retries](#retries)
19+
- [Timeouts](#timeouts)
20+
- [Custom Headers](#custom-headers)
21+
- [Access Raw Response Data](#access-raw-response-data)
22+
- [Contributing](#contributing)
23+
24+
## Installation
25+
26+
### Gradle
27+
28+
Add the dependency in your `build.gradle` file:
29+
30+
```groovy
31+
dependencies {
32+
implementation 'io.intercom:intercom-java'
33+
}
34+
```
35+
36+
### Maven
37+
38+
Add the dependency in your `pom.xml` file:
39+
40+
```xml
41+
<dependency>
42+
<groupId>io.intercom</groupId>
43+
<artifactId>intercom-java</artifactId>
44+
<version>4.0.0</version>
45+
</dependency>
46+
```
47+
48+
## Reference
49+
50+
A full reference for this library is available [here](https://github.com/intercom/intercom-java/blob/HEAD/./reference.md).
651

752
## Usage
853

@@ -12,8 +57,7 @@ Instantiate and use the client with the following:
1257
package com.example.usage;
1358

1459
import com.intercom.api.Intercom;
15-
import com.intercom.api.resources.articles.requests.CreateArticleRequest;
16-
import com.intercom.api.resources.articles.types.CreateArticleRequestState;
60+
import com.intercom.api.resources.aicontent.requests.CreateContentImportSourceRequest;
1761

1862
public class Example {
1963
public static void main(String[] args) {
@@ -22,14 +66,10 @@ public class Example {
2266
.token("<token>")
2367
.build();
2468

25-
client.articles().create(
26-
CreateArticleRequest
69+
client.aiContent().createContentImportSource(
70+
CreateContentImportSourceRequest
2771
.builder()
28-
.title("Thanks for everything")
29-
.authorId(1295)
30-
.description("Description of the Article")
31-
.body("Body of the Article")
32-
.state(CreateArticleRequestState.PUBLISHED)
72+
.url("https://www.example.com")
3373
.build()
3474
);
3575
}
@@ -70,9 +110,9 @@ When the API returns a non-success status code (4xx or 5xx response), an API exc
70110
```java
71111
import com.intercom.api.core.IntercomApiApiException;
72112

73-
try {
74-
client.articles().create(...);
75-
} catch (IntercomApiApiException e) {
113+
try{
114+
client.aiContent().createContentImportSource(...);
115+
} catch (IntercomApiApiException e){
76116
// Do something with the API exception...
77117
}
78118
```
@@ -81,7 +121,7 @@ try {
81121

82122
### Custom Client
83123

84-
This SDK is built to work with any instance of `OkHttpClient`. By default, if no client is provided, the SDK will construct one.
124+
This SDK is built to work with any instance of `OkHttpClient`. By default, if no client is provided, the SDK will construct one.
85125
However, you can pass your own client like so:
86126

87127
```java
@@ -100,7 +140,9 @@ Intercom client = Intercom
100140

101141
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
102142
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
103-
retry limit (default: 2).
143+
retry limit (default: 2). Before defaulting to exponential backoff, the SDK will first attempt to respect
144+
the `Retry-After` header (as either in seconds or as an HTTP date), and then the `X-RateLimit-Reset` header
145+
(as a Unix timestamp in epoch seconds); failing both of those, it will fall back to exponential backoff.
104146

105147
A request is deemed retryable when any of the following HTTP status codes is returned:
106148

@@ -134,7 +176,7 @@ Intercom client = Intercom
134176
.build();
135177

136178
// Request level
137-
client.articles().create(
179+
client.aiContent().createContentImportSource(
138180
...,
139181
RequestOptions
140182
.builder()
@@ -143,6 +185,45 @@ client.articles().create(
143185
);
144186
```
145187

188+
### Custom Headers
189+
190+
The SDK allows you to add custom headers to requests. You can configure headers at the client level or at the request level.
191+
192+
```java
193+
import com.intercom.api.Intercom;
194+
import com.intercom.api.core.RequestOptions;
195+
196+
// Client level
197+
Intercom client = Intercom
198+
.builder()
199+
.addHeader("X-Custom-Header", "custom-value")
200+
.addHeader("X-Request-Id", "abc-123")
201+
.build();
202+
;
203+
204+
// Request level
205+
client.aiContent().createContentImportSource(
206+
...,
207+
RequestOptions
208+
.builder()
209+
.addHeader("X-Request-Header", "request-value")
210+
.build()
211+
);
212+
```
213+
214+
### Access Raw Response Data
215+
216+
The SDK provides access to raw response data, including headers, through the `withRawResponse()` method.
217+
The `withRawResponse()` method returns a raw client that wraps all responses with `body()` and `headers()` methods.
218+
(A normal client's `response` is identical to a raw client's `response.body()`.)
219+
220+
```java
221+
CreateContentImportSourceHttpResponse response = client.aiContent().withRawResponse().createContentImportSource(...);
222+
223+
System.out.println(response.body());
224+
System.out.println(response.headers().get("X-My-Header"));
225+
```
226+
146227
## Contributing
147228

148229
While we value open-source contributions to this SDK, this library is generated programmatically.

build.gradle

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ repositories {
1414
}
1515

1616
dependencies {
17-
api 'com.squareup.okhttp3:okhttp:4.12.0'
18-
api 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
19-
api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2'
20-
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2'
17+
api 'com.squareup.okhttp3:okhttp:5.2.1'
18+
api 'com.fasterxml.jackson.core:jackson-databind:2.18.2'
19+
api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2'
20+
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2'
2121
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
2222
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
23+
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
2324
}
2425

2526

@@ -46,7 +47,7 @@ java {
4647

4748
group = 'io.intercom'
4849

49-
version = '3.0.0'
50+
version = '4.0.0'
5051

5152
jar {
5253
dependsOn(":generatePomFileForMavenPublication")
@@ -77,7 +78,7 @@ publishing {
7778
maven(MavenPublication) {
7879
groupId = 'io.intercom'
7980
artifactId = 'intercom-java'
80-
version = '3.0.0'
81+
version = '4.0.0'
8182
from components.java
8283
pom {
8384
name = 'intercom'
@@ -121,9 +122,10 @@ sonatypeCentralUpload {
121122
}
122123

123124
signing {
124-
def signingKeyId = "$System.env.MAVEN_SIGNATURE_SECRET_KEY"
125+
def signingKeyId = "$System.env.MAVEN_SIGNATURE_KID"
126+
def signingKey = "$System.env.MAVEN_SIGNATURE_SECRET_KEY"
125127
def signingPassword = "$System.env.MAVEN_SIGNATURE_PASSWORD"
126-
useInMemoryPgpKeys(signingKeyId, signingPassword)
128+
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
127129
sign publishing.publications.maven
128130
}
129131

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)