Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 0 additions & 11 deletions .github/workflows/label-ai-generated-prs.yml

This file was deleted.

20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![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)

The Intercom Java library provides convenient access to the Intercom API from Java.
The Intercom Java library provides convenient access to the Intercom APIs from Java.

## Usage

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

import com.intercom.api.Intercom;
import com.intercom.api.resources.articles.requests.CreateArticleRequest;
import com.intercom.api.resources.articles.types.CreateArticleRequestState;
import com.intercom.api.resources.aicontent.requests.CreateContentImportSourceRequest;

public class Example {
public static void main(String[] args) {
Expand All @@ -22,14 +21,11 @@ public class Example {
.token("<token>")
.build();

client.articles().create(
CreateArticleRequest
client.aiContent().createContentImportSource(
CreateContentImportSourceRequest
.builder()
.title("Thanks for everything")
.authorId(1295)
.description("Description of the Article")
.body("Body of the Article")
.state(CreateArticleRequestState.PUBLISHED)
.syncBehavior("api")
.url("https://www.example.com")
.build()
);
}
Expand Down Expand Up @@ -71,7 +67,7 @@ When the API returns a non-success status code (4xx or 5xx response), an API exc
import com.intercom.api.core.IntercomApiApiException;

try {
client.articles().create(...);
client.aiContent().createContentImportSource(...);
} catch (IntercomApiApiException e) {
// Do something with the API exception...
}
Expand Down Expand Up @@ -134,7 +130,7 @@ Intercom client = Intercom
.build();

// Request level
client.articles().create(
client.aiContent().createContentImportSource(
...,
RequestOptions
.builder()
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ java {

group = 'io.intercom'

version = '3.0.0'
version = '4.0.0'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -77,7 +77,7 @@ publishing {
maven(MavenPublication) {
groupId = 'io.intercom'
artifactId = 'intercom-java'
version = '3.0.0'
version = '4.0.0'
from components.java
pom {
name = 'intercom'
Expand Down
80 changes: 76 additions & 4 deletions src/main/java/com/intercom/api/AsyncIntercom.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@
import com.intercom.api.core.ClientOptions;
import com.intercom.api.core.Suppliers;
import com.intercom.api.resources.admins.AsyncAdminsClient;
import com.intercom.api.resources.aicontent.AsyncAiContentClient;
import com.intercom.api.resources.articles.AsyncArticlesClient;
import com.intercom.api.resources.awaystatusreasons.AsyncAwayStatusReasonsClient;
import com.intercom.api.resources.calls.AsyncCallsClient;
import com.intercom.api.resources.companies.AsyncCompaniesClient;
import com.intercom.api.resources.contacts.AsyncContactsClient;
import com.intercom.api.resources.conversations.AsyncConversationsClient;
import com.intercom.api.resources.customchannelevents.AsyncCustomChannelEventsClient;
import com.intercom.api.resources.customobjectinstances.AsyncCustomObjectInstancesClient;
import com.intercom.api.resources.dataattributes.AsyncDataAttributesClient;
import com.intercom.api.resources.dataexport.AsyncDataExportClient;
import com.intercom.api.resources.events.AsyncEventsClient;
import com.intercom.api.resources.export.AsyncExportClient;
import com.intercom.api.resources.helpcenters.AsyncHelpCentersClient;
import com.intercom.api.resources.internalarticles.AsyncInternalArticlesClient;
import com.intercom.api.resources.jobs.AsyncJobsClient;
import com.intercom.api.resources.messages.AsyncMessagesClient;
import com.intercom.api.resources.news.AsyncNewsClient;
import com.intercom.api.resources.notes.AsyncNotesClient;
Expand All @@ -23,6 +31,7 @@
import com.intercom.api.resources.tags.AsyncTagsClient;
import com.intercom.api.resources.teams.AsyncTeamsClient;
import com.intercom.api.resources.tickets.AsyncTicketsClient;
import com.intercom.api.resources.ticketstates.AsyncTicketStatesClient;
import com.intercom.api.resources.tickettypes.AsyncTicketTypesClient;
import com.intercom.api.resources.unstable.AsyncUnstableClient;
import com.intercom.api.resources.visitors.AsyncVisitorsClient;
Expand All @@ -33,10 +42,20 @@ public class AsyncIntercom {

protected final Supplier<AsyncAdminsClient> adminsClient;

protected final Supplier<AsyncAiContentClient> aiContentClient;

protected final Supplier<AsyncArticlesClient> articlesClient;

protected final Supplier<AsyncAwayStatusReasonsClient> awayStatusReasonsClient;

protected final Supplier<AsyncExportClient> exportClient;

protected final Supplier<AsyncDataExportClient> dataExportClient;

protected final Supplier<AsyncHelpCentersClient> helpCentersClient;

protected final Supplier<AsyncInternalArticlesClient> internalArticlesClient;

protected final Supplier<AsyncCompaniesClient> companiesClient;

protected final Supplier<AsyncContactsClient> contactsClient;
Expand All @@ -47,11 +66,15 @@ public class AsyncIntercom {

protected final Supplier<AsyncConversationsClient> conversationsClient;

protected final Supplier<AsyncCustomChannelEventsClient> customChannelEventsClient;

protected final Supplier<AsyncCustomObjectInstancesClient> customObjectInstancesClient;

protected final Supplier<AsyncDataAttributesClient> dataAttributesClient;

protected final Supplier<AsyncEventsClient> eventsClient;

protected final Supplier<AsyncDataExportClient> dataExportClient;
protected final Supplier<AsyncJobsClient> jobsClient;

protected final Supplier<AsyncMessagesClient> messagesClient;

Expand All @@ -61,8 +84,12 @@ public class AsyncIntercom {

protected final Supplier<AsyncPhoneCallRedirectsClient> phoneCallRedirectsClient;

protected final Supplier<AsyncCallsClient> callsClient;

protected final Supplier<AsyncTeamsClient> teamsClient;

protected final Supplier<AsyncTicketStatesClient> ticketStatesClient;

protected final Supplier<AsyncTicketTypesClient> ticketTypesClient;

protected final Supplier<AsyncTicketsClient> ticketsClient;
Expand All @@ -76,21 +103,30 @@ public class AsyncIntercom {
public AsyncIntercom(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
this.adminsClient = Suppliers.memoize(() -> new AsyncAdminsClient(clientOptions));
this.aiContentClient = Suppliers.memoize(() -> new AsyncAiContentClient(clientOptions));
this.articlesClient = Suppliers.memoize(() -> new AsyncArticlesClient(clientOptions));
this.awayStatusReasonsClient = Suppliers.memoize(() -> new AsyncAwayStatusReasonsClient(clientOptions));
this.exportClient = Suppliers.memoize(() -> new AsyncExportClient(clientOptions));
this.dataExportClient = Suppliers.memoize(() -> new AsyncDataExportClient(clientOptions));
this.helpCentersClient = Suppliers.memoize(() -> new AsyncHelpCentersClient(clientOptions));
this.internalArticlesClient = Suppliers.memoize(() -> new AsyncInternalArticlesClient(clientOptions));
this.companiesClient = Suppliers.memoize(() -> new AsyncCompaniesClient(clientOptions));
this.contactsClient = Suppliers.memoize(() -> new AsyncContactsClient(clientOptions));
this.notesClient = Suppliers.memoize(() -> new AsyncNotesClient(clientOptions));
this.tagsClient = Suppliers.memoize(() -> new AsyncTagsClient(clientOptions));
this.conversationsClient = Suppliers.memoize(() -> new AsyncConversationsClient(clientOptions));
this.customChannelEventsClient = Suppliers.memoize(() -> new AsyncCustomChannelEventsClient(clientOptions));
this.customObjectInstancesClient = Suppliers.memoize(() -> new AsyncCustomObjectInstancesClient(clientOptions));
this.dataAttributesClient = Suppliers.memoize(() -> new AsyncDataAttributesClient(clientOptions));
this.eventsClient = Suppliers.memoize(() -> new AsyncEventsClient(clientOptions));
this.dataExportClient = Suppliers.memoize(() -> new AsyncDataExportClient(clientOptions));
this.jobsClient = Suppliers.memoize(() -> new AsyncJobsClient(clientOptions));
this.messagesClient = Suppliers.memoize(() -> new AsyncMessagesClient(clientOptions));
this.segmentsClient = Suppliers.memoize(() -> new AsyncSegmentsClient(clientOptions));
this.subscriptionTypesClient = Suppliers.memoize(() -> new AsyncSubscriptionTypesClient(clientOptions));
this.phoneCallRedirectsClient = Suppliers.memoize(() -> new AsyncPhoneCallRedirectsClient(clientOptions));
this.callsClient = Suppliers.memoize(() -> new AsyncCallsClient(clientOptions));
this.teamsClient = Suppliers.memoize(() -> new AsyncTeamsClient(clientOptions));
this.ticketStatesClient = Suppliers.memoize(() -> new AsyncTicketStatesClient(clientOptions));
this.ticketTypesClient = Suppliers.memoize(() -> new AsyncTicketTypesClient(clientOptions));
this.ticketsClient = Suppliers.memoize(() -> new AsyncTicketsClient(clientOptions));
this.visitorsClient = Suppliers.memoize(() -> new AsyncVisitorsClient(clientOptions));
Expand All @@ -102,14 +138,34 @@ public AsyncAdminsClient admins() {
return this.adminsClient.get();
}

public AsyncAiContentClient aiContent() {
return this.aiContentClient.get();
}

public AsyncArticlesClient articles() {
return this.articlesClient.get();
}

public AsyncAwayStatusReasonsClient awayStatusReasons() {
return this.awayStatusReasonsClient.get();
}

public AsyncExportClient export() {
return this.exportClient.get();
}

public AsyncDataExportClient dataExport() {
return this.dataExportClient.get();
}

public AsyncHelpCentersClient helpCenters() {
return this.helpCentersClient.get();
}

public AsyncInternalArticlesClient internalArticles() {
return this.internalArticlesClient.get();
}

public AsyncCompaniesClient companies() {
return this.companiesClient.get();
}
Expand All @@ -130,6 +186,14 @@ public AsyncConversationsClient conversations() {
return this.conversationsClient.get();
}

public AsyncCustomChannelEventsClient customChannelEvents() {
return this.customChannelEventsClient.get();
}

public AsyncCustomObjectInstancesClient customObjectInstances() {
return this.customObjectInstancesClient.get();
}

public AsyncDataAttributesClient dataAttributes() {
return this.dataAttributesClient.get();
}
Expand All @@ -138,8 +202,8 @@ public AsyncEventsClient events() {
return this.eventsClient.get();
}

public AsyncDataExportClient dataExport() {
return this.dataExportClient.get();
public AsyncJobsClient jobs() {
return this.jobsClient.get();
}

public AsyncMessagesClient messages() {
Expand All @@ -158,10 +222,18 @@ public AsyncPhoneCallRedirectsClient phoneCallRedirects() {
return this.phoneCallRedirectsClient.get();
}

public AsyncCallsClient calls() {
return this.callsClient.get();
}

public AsyncTeamsClient teams() {
return this.teamsClient.get();
}

public AsyncTicketStatesClient ticketStates() {
return this.ticketStatesClient.get();
}

public AsyncTicketTypesClient ticketTypes() {
return this.ticketTypesClient.get();
}
Expand Down
Loading
Loading