> future = new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ if (response.isSuccessful()) {
+ future.complete(new IntercomHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, HandlingEventList.class),
+ response));
+ return;
+ }
+ try {
+ switch (response.code()) {
+ case 401:
+ future.completeExceptionally(new UnauthorizedError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class),
+ response));
+ return;
+ case 404:
+ future.completeExceptionally(new NotFoundError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
+ response));
+ return;
+ }
+ } catch (JsonProcessingException ignored) {
+ // unable to map error response, throwing generic error
+ }
+ Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
+ future.completeExceptionally(new IntercomApiException(
+ "Error with status code " + response.code(), response.code(), errorBody, response));
+ return;
+ } catch (IOException e) {
+ future.completeExceptionally(new IntercomException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(new IntercomException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
+
/**
* You can redact a conversation part or the source message of a conversation (as seen in the source object).
* {% admonition type="info" name="Redacting parts and messages" %}
diff --git a/src/main/java/com/intercom/api/resources/unstable/conversations/ConversationsClient.java b/src/main/java/com/intercom/api/resources/unstable/conversations/ConversationsClient.java
index 46374f0d..49f79a0e 100644
--- a/src/main/java/com/intercom/api/resources/unstable/conversations/ConversationsClient.java
+++ b/src/main/java/com/intercom/api/resources/unstable/conversations/ConversationsClient.java
@@ -11,6 +11,7 @@
import com.intercom.api.resources.unstable.conversations.requests.DeleteConversationRequest;
import com.intercom.api.resources.unstable.conversations.requests.DetachContactFromConversationRequest;
import com.intercom.api.resources.unstable.conversations.requests.ListConversationsRequest;
+import com.intercom.api.resources.unstable.conversations.requests.ListHandlingEventsRequest;
import com.intercom.api.resources.unstable.conversations.requests.ManageConversationRequest;
import com.intercom.api.resources.unstable.conversations.requests.ReplyConversationRequest;
import com.intercom.api.resources.unstable.conversations.requests.RetrieveConversationRequest;
@@ -20,6 +21,7 @@
import com.intercom.api.resources.unstable.tickets.types.Ticket;
import com.intercom.api.resources.unstable.types.ConversationDeleted;
import com.intercom.api.resources.unstable.types.ConversationList;
+import com.intercom.api.resources.unstable.types.HandlingEventList;
import com.intercom.api.resources.unstable.types.RedactConversationRequest;
import com.intercom.api.resources.unstable.types.SearchRequest;
import java.util.Optional;
@@ -449,6 +451,22 @@ public Conversation detachContactFromConversation(
.body();
}
+ /**
+ * List all pause/resume events for a conversation. These events track when teammates paused or resumed handling a conversation.
+ *
Requires the read_conversations OAuth scope.
+ */
+ public HandlingEventList listHandlingEvents(ListHandlingEventsRequest request) {
+ return this.rawClient.listHandlingEvents(request).body();
+ }
+
+ /**
+ * List all pause/resume events for a conversation. These events track when teammates paused or resumed handling a conversation.
+ * Requires the read_conversations OAuth scope.
+ */
+ public HandlingEventList listHandlingEvents(ListHandlingEventsRequest request, RequestOptions requestOptions) {
+ return this.rawClient.listHandlingEvents(request, requestOptions).body();
+ }
+
/**
* You can redact a conversation part or the source message of a conversation (as seen in the source object).
* {% admonition type="info" name="Redacting parts and messages" %}
diff --git a/src/main/java/com/intercom/api/resources/unstable/conversations/RawConversationsClient.java b/src/main/java/com/intercom/api/resources/unstable/conversations/RawConversationsClient.java
index d276b0c2..137194a7 100644
--- a/src/main/java/com/intercom/api/resources/unstable/conversations/RawConversationsClient.java
+++ b/src/main/java/com/intercom/api/resources/unstable/conversations/RawConversationsClient.java
@@ -19,6 +19,7 @@
import com.intercom.api.resources.unstable.conversations.requests.DeleteConversationRequest;
import com.intercom.api.resources.unstable.conversations.requests.DetachContactFromConversationRequest;
import com.intercom.api.resources.unstable.conversations.requests.ListConversationsRequest;
+import com.intercom.api.resources.unstable.conversations.requests.ListHandlingEventsRequest;
import com.intercom.api.resources.unstable.conversations.requests.ManageConversationRequest;
import com.intercom.api.resources.unstable.conversations.requests.ReplyConversationRequest;
import com.intercom.api.resources.unstable.conversations.requests.RetrieveConversationRequest;
@@ -34,6 +35,7 @@
import com.intercom.api.resources.unstable.types.ConversationDeleted;
import com.intercom.api.resources.unstable.types.ConversationList;
import com.intercom.api.resources.unstable.types.Error;
+import com.intercom.api.resources.unstable.types.HandlingEventList;
import com.intercom.api.resources.unstable.types.RedactConversationRequest;
import com.intercom.api.resources.unstable.types.SearchRequest;
import java.io.IOException;
@@ -946,6 +948,63 @@ public IntercomHttpResponse detachContactFromConversation(
}
}
+ /**
+ * List all pause/resume events for a conversation. These events track when teammates paused or resumed handling a conversation.
+ * Requires the read_conversations OAuth scope.
+ */
+ public IntercomHttpResponse listHandlingEvents(ListHandlingEventsRequest request) {
+ return listHandlingEvents(request, null);
+ }
+
+ /**
+ * List all pause/resume events for a conversation. These events track when teammates paused or resumed handling a conversation.
+ * Requires the read_conversations OAuth scope.
+ */
+ public IntercomHttpResponse listHandlingEvents(
+ ListHandlingEventsRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("conversations")
+ .addPathSegment(request.getId())
+ .addPathSegments("handling_events")
+ .build();
+ Request.Builder _requestBuilder = new Request.Builder()
+ .url(httpUrl)
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json");
+ Request okhttpRequest = _requestBuilder.build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ try (Response response = client.newCall(okhttpRequest).execute()) {
+ ResponseBody responseBody = response.body();
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ if (response.isSuccessful()) {
+ return new IntercomHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, HandlingEventList.class), response);
+ }
+ try {
+ switch (response.code()) {
+ case 401:
+ throw new UnauthorizedError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response);
+ case 404:
+ throw new NotFoundError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response);
+ }
+ } catch (JsonProcessingException ignored) {
+ // unable to map error response, throwing generic error
+ }
+ Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
+ throw new IntercomApiException(
+ "Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (IOException e) {
+ throw new IntercomException("Network error executing HTTP request", e);
+ }
+ }
+
/**
* You can redact a conversation part or the source message of a conversation (as seen in the source object).
* {% admonition type="info" name="Redacting parts and messages" %}
diff --git a/src/main/java/com/intercom/api/resources/unstable/conversations/requests/ListHandlingEventsRequest.java b/src/main/java/com/intercom/api/resources/unstable/conversations/requests/ListHandlingEventsRequest.java
new file mode 100644
index 00000000..c07b82a8
--- /dev/null
+++ b/src/main/java/com/intercom/api/resources/unstable/conversations/requests/ListHandlingEventsRequest.java
@@ -0,0 +1,113 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.intercom.api.resources.unstable.conversations.requests;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.intercom.api.core.ObjectMappers;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import org.jetbrains.annotations.NotNull;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = ListHandlingEventsRequest.Builder.class)
+public final class ListHandlingEventsRequest {
+ private final String id;
+
+ private final Map additionalProperties;
+
+ private ListHandlingEventsRequest(String id, Map additionalProperties) {
+ this.id = id;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return The identifier for the conversation as given by Intercom.
+ */
+ @JsonProperty("id")
+ public String getId() {
+ return id;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof ListHandlingEventsRequest && equalTo((ListHandlingEventsRequest) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(ListHandlingEventsRequest other) {
+ return id.equals(other.id);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.id);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static IdStage builder() {
+ return new Builder();
+ }
+
+ public interface IdStage {
+ /**
+ * The identifier for the conversation as given by Intercom.
+ */
+ _FinalStage id(@NotNull String id);
+
+ Builder from(ListHandlingEventsRequest other);
+ }
+
+ public interface _FinalStage {
+ ListHandlingEventsRequest build();
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder implements IdStage, _FinalStage {
+ private String id;
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(ListHandlingEventsRequest other) {
+ id(other.getId());
+ return this;
+ }
+
+ /**
+ * The identifier for the conversation as given by Intercom.
+ * The identifier for the conversation as given by Intercom.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ @JsonSetter("id")
+ public _FinalStage id(@NotNull String id) {
+ this.id = Objects.requireNonNull(id, "id must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ public ListHandlingEventsRequest build() {
+ return new ListHandlingEventsRequest(id, additionalProperties);
+ }
+ }
+}
diff --git a/src/main/java/com/intercom/api/resources/unstable/conversations/types/Conversation.java b/src/main/java/com/intercom/api/resources/unstable/conversations/types/Conversation.java
index 6b370381..5a806339 100644
--- a/src/main/java/com/intercom/api/resources/unstable/conversations/types/Conversation.java
+++ b/src/main/java/com/intercom/api/resources/unstable/conversations/types/Conversation.java
@@ -19,6 +19,7 @@
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.intercom.api.core.ObjectMappers;
import com.intercom.api.resources.unstable.aiagent.types.AiAgent;
+import com.intercom.api.resources.unstable.companies.types.Company;
import com.intercom.api.resources.unstable.types.ConversationContacts;
import com.intercom.api.resources.unstable.types.ConversationFirstContactReply;
import com.intercom.api.resources.unstable.types.ConversationParts;
@@ -68,6 +69,8 @@ public final class Conversation {
private final Optional companyId;
+ private final Optional company;
+
private final Optional tags;
private final Optional conversationRating;
@@ -111,6 +114,7 @@ private Conversation(
Optional adminAssigneeId,
Optional teamAssigneeId,
Optional companyId,
+ Optional company,
Optional tags,
Optional conversationRating,
Optional source,
@@ -139,6 +143,7 @@ private Conversation(
this.adminAssigneeId = adminAssigneeId;
this.teamAssigneeId = teamAssigneeId;
this.companyId = companyId;
+ this.company = company;
this.tags = tags;
this.conversationRating = conversationRating;
this.source = source;
@@ -267,6 +272,14 @@ public Optional getCompanyId() {
return companyId;
}
+ /**
+ * @return The company associated with the conversation.
+ */
+ @JsonProperty("company")
+ public Optional getCompany() {
+ return company;
+ }
+
@JsonProperty("tags")
public Optional getTags() {
return tags;
@@ -361,6 +374,7 @@ private boolean equalTo(Conversation other) {
&& adminAssigneeId.equals(other.adminAssigneeId)
&& teamAssigneeId.equals(other.teamAssigneeId)
&& companyId.equals(other.companyId)
+ && company.equals(other.company)
&& tags.equals(other.tags)
&& conversationRating.equals(other.conversationRating)
&& source.equals(other.source)
@@ -393,6 +407,7 @@ public int hashCode() {
this.adminAssigneeId,
this.teamAssigneeId,
this.companyId,
+ this.company,
this.tags,
this.conversationRating,
this.source,
@@ -447,6 +462,8 @@ public static final class Builder {
private Optional companyId = Optional.empty();
+ private Optional company = Optional.empty();
+
private Optional tags = Optional.empty();
private Optional conversationRating = Optional.empty();
@@ -493,6 +510,7 @@ public Builder from(Conversation other) {
adminAssigneeId(other.getAdminAssigneeId());
teamAssigneeId(other.getTeamAssigneeId());
companyId(other.getCompanyId());
+ company(other.getCompany());
tags(other.getTags());
conversationRating(other.getConversationRating());
source(other.getSource());
@@ -705,6 +723,20 @@ public Builder companyId(String companyId) {
return this;
}
+ /**
+ * The company associated with the conversation.
+ */
+ @JsonSetter(value = "company", nulls = Nulls.SKIP)
+ public Builder company(Optional company) {
+ this.company = company;
+ return this;
+ }
+
+ public Builder company(Company company) {
+ this.company = Optional.ofNullable(company);
+ return this;
+ }
+
@JsonSetter(value = "tags", nulls = Nulls.SKIP)
public Builder tags(Optional tags) {
this.tags = tags;
@@ -867,6 +899,7 @@ public Conversation build() {
adminAssigneeId,
teamAssigneeId,
companyId,
+ company,
tags,
conversationRating,
source,
diff --git a/src/main/java/com/intercom/api/resources/unstable/types/ConversationAttributeUpdatedByAdmin.java b/src/main/java/com/intercom/api/resources/unstable/types/ConversationAttributeUpdatedByAdmin.java
index 9ba0249a..06c1488c 100644
--- a/src/main/java/com/intercom/api/resources/unstable/types/ConversationAttributeUpdatedByAdmin.java
+++ b/src/main/java/com/intercom/api/resources/unstable/types/ConversationAttributeUpdatedByAdmin.java
@@ -205,21 +205,32 @@ public Attribute build() {
public static final class Value {
private final Optional name;
+ private final Optional previous;
+
private final Map additionalProperties;
- private Value(Optional name, Map additionalProperties) {
+ private Value(Optional name, Optional previous, Map additionalProperties) {
this.name = name;
+ this.previous = previous;
this.additionalProperties = additionalProperties;
}
/**
- * @return Value of the CDA updated
+ * @return Current value of the CDA updated
*/
@JsonProperty("name")
public Optional getName() {
return name;
}
+ /**
+ * @return Previous value of the CDA
+ */
+ @JsonProperty("previous")
+ public Optional getPrevious() {
+ return previous;
+ }
+
@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
@@ -232,12 +243,12 @@ public Map getAdditionalProperties() {
}
private boolean equalTo(Value other) {
- return name.equals(other.name);
+ return name.equals(other.name) && previous.equals(other.previous);
}
@java.lang.Override
public int hashCode() {
- return Objects.hash(this.name);
+ return Objects.hash(this.name, this.previous);
}
@java.lang.Override
@@ -253,6 +264,8 @@ public static Builder builder() {
public static final class Builder {
private Optional name = Optional.empty();
+ private Optional previous = Optional.empty();
+
@JsonAnySetter
private Map additionalProperties = new HashMap<>();
@@ -260,11 +273,12 @@ private Builder() {}
public Builder from(Value other) {
name(other.getName());
+ previous(other.getPrevious());
return this;
}
/**
- * Value of the CDA updated
+ * Current value of the CDA updated
*/
@JsonSetter(value = "name", nulls = Nulls.SKIP)
public Builder name(Optional name) {
@@ -277,8 +291,22 @@ public Builder name(String name) {
return this;
}
+ /**
+ * Previous value of the CDA
+ */
+ @JsonSetter(value = "previous", nulls = Nulls.SKIP)
+ public Builder previous(Optional previous) {
+ this.previous = previous;
+ return this;
+ }
+
+ public Builder previous(String previous) {
+ this.previous = Optional.ofNullable(previous);
+ return this;
+ }
+
public Value build() {
- return new Value(name, additionalProperties);
+ return new Value(name, previous, additionalProperties);
}
}
}
diff --git a/src/main/java/com/intercom/api/resources/unstable/types/ConversationAttributeUpdatedByUser.java b/src/main/java/com/intercom/api/resources/unstable/types/ConversationAttributeUpdatedByUser.java
new file mode 100644
index 00000000..f7a9fe48
--- /dev/null
+++ b/src/main/java/com/intercom/api/resources/unstable/types/ConversationAttributeUpdatedByUser.java
@@ -0,0 +1,313 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.intercom.api.resources.unstable.types;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.intercom.api.core.ObjectMappers;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = ConversationAttributeUpdatedByUser.Builder.class)
+public final class ConversationAttributeUpdatedByUser {
+ private final Optional attribute;
+
+ private final Optional value;
+
+ private final Map additionalProperties;
+
+ private ConversationAttributeUpdatedByUser(
+ Optional attribute, Optional value, Map additionalProperties) {
+ this.attribute = attribute;
+ this.value = value;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("attribute")
+ public Optional getAttribute() {
+ return attribute;
+ }
+
+ @JsonProperty("value")
+ public Optional getValue() {
+ return value;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof ConversationAttributeUpdatedByUser
+ && equalTo((ConversationAttributeUpdatedByUser) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(ConversationAttributeUpdatedByUser other) {
+ return attribute.equals(other.attribute) && value.equals(other.value);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.attribute, this.value);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder {
+ private Optional attribute = Optional.empty();
+
+ private Optional value = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ public Builder from(ConversationAttributeUpdatedByUser other) {
+ attribute(other.getAttribute());
+ value(other.getValue());
+ return this;
+ }
+
+ @JsonSetter(value = "attribute", nulls = Nulls.SKIP)
+ public Builder attribute(Optional attribute) {
+ this.attribute = attribute;
+ return this;
+ }
+
+ public Builder attribute(Attribute attribute) {
+ this.attribute = Optional.ofNullable(attribute);
+ return this;
+ }
+
+ @JsonSetter(value = "value", nulls = Nulls.SKIP)
+ public Builder value(Optional value) {
+ this.value = value;
+ return this;
+ }
+
+ public Builder value(Value value) {
+ this.value = Optional.ofNullable(value);
+ return this;
+ }
+
+ public ConversationAttributeUpdatedByUser build() {
+ return new ConversationAttributeUpdatedByUser(attribute, value, additionalProperties);
+ }
+ }
+
+ @JsonInclude(JsonInclude.Include.NON_ABSENT)
+ @JsonDeserialize(builder = Value.Builder.class)
+ public static final class Value {
+ private final Optional name;
+
+ private final Optional previous;
+
+ private final Map additionalProperties;
+
+ private Value(Optional name, Optional previous, Map additionalProperties) {
+ this.name = name;
+ this.previous = previous;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return Current value of the CDA updated
+ */
+ @JsonProperty("name")
+ public Optional getName() {
+ return name;
+ }
+
+ /**
+ * @return Previous value of the CDA (null for older events)
+ */
+ @JsonProperty("previous")
+ public Optional getPrevious() {
+ return previous;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof Value && equalTo((Value) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(Value other) {
+ return name.equals(other.name) && previous.equals(other.previous);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.name, this.previous);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder {
+ private Optional name = Optional.empty();
+
+ private Optional previous = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ public Builder from(Value other) {
+ name(other.getName());
+ previous(other.getPrevious());
+ return this;
+ }
+
+ /**
+ * Current value of the CDA updated
+ */
+ @JsonSetter(value = "name", nulls = Nulls.SKIP)
+ public Builder name(Optional name) {
+ this.name = name;
+ return this;
+ }
+
+ public Builder name(String name) {
+ this.name = Optional.ofNullable(name);
+ return this;
+ }
+
+ /**
+ * Previous value of the CDA (null for older events)
+ */
+ @JsonSetter(value = "previous", nulls = Nulls.SKIP)
+ public Builder previous(Optional previous) {
+ this.previous = previous;
+ return this;
+ }
+
+ public Builder previous(String previous) {
+ this.previous = Optional.ofNullable(previous);
+ return this;
+ }
+
+ public Value build() {
+ return new Value(name, previous, additionalProperties);
+ }
+ }
+ }
+
+ @JsonInclude(JsonInclude.Include.NON_ABSENT)
+ @JsonDeserialize(builder = Attribute.Builder.class)
+ public static final class Attribute {
+ private final Optional name;
+
+ private final Map additionalProperties;
+
+ private Attribute(Optional name, Map additionalProperties) {
+ this.name = name;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return Name of the CDA updated
+ */
+ @JsonProperty("name")
+ public Optional getName() {
+ return name;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof Attribute && equalTo((Attribute) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(Attribute other) {
+ return name.equals(other.name);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.name);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder {
+ private Optional name = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ public Builder from(Attribute other) {
+ name(other.getName());
+ return this;
+ }
+
+ /**
+ * Name of the CDA updated
+ */
+ @JsonSetter(value = "name", nulls = Nulls.SKIP)
+ public Builder name(Optional name) {
+ this.name = name;
+ return this;
+ }
+
+ public Builder name(String name) {
+ this.name = Optional.ofNullable(name);
+ return this;
+ }
+
+ public Attribute build() {
+ return new Attribute(name, additionalProperties);
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/intercom/api/resources/unstable/types/ConversationSlaAppliedByRule.java b/src/main/java/com/intercom/api/resources/unstable/types/ConversationSlaAppliedByRule.java
new file mode 100644
index 00000000..0b83393a
--- /dev/null
+++ b/src/main/java/com/intercom/api/resources/unstable/types/ConversationSlaAppliedByRule.java
@@ -0,0 +1,306 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.intercom.api.resources.unstable.types;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.intercom.api.core.ObjectMappers;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = ConversationSlaAppliedByRule.Builder.class)
+public final class ConversationSlaAppliedByRule {
+ private final Optional slaName;
+
+ private final Optional slaDefinition;
+
+ private final Map additionalProperties;
+
+ private ConversationSlaAppliedByRule(
+ Optional slaName, Optional slaDefinition, Map additionalProperties) {
+ this.slaName = slaName;
+ this.slaDefinition = slaDefinition;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return Name of the SLA that was applied
+ */
+ @JsonProperty("sla_name")
+ public Optional getSlaName() {
+ return slaName;
+ }
+
+ /**
+ * @return Target times configured for the SLA (in seconds)
+ */
+ @JsonProperty("sla_definition")
+ public Optional getSlaDefinition() {
+ return slaDefinition;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof ConversationSlaAppliedByRule && equalTo((ConversationSlaAppliedByRule) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(ConversationSlaAppliedByRule other) {
+ return slaName.equals(other.slaName) && slaDefinition.equals(other.slaDefinition);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.slaName, this.slaDefinition);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder {
+ private Optional slaName = Optional.empty();
+
+ private Optional slaDefinition = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ public Builder from(ConversationSlaAppliedByRule other) {
+ slaName(other.getSlaName());
+ slaDefinition(other.getSlaDefinition());
+ return this;
+ }
+
+ /**
+ * Name of the SLA that was applied
+ */
+ @JsonSetter(value = "sla_name", nulls = Nulls.SKIP)
+ public Builder slaName(Optional slaName) {
+ this.slaName = slaName;
+ return this;
+ }
+
+ public Builder slaName(String slaName) {
+ this.slaName = Optional.ofNullable(slaName);
+ return this;
+ }
+
+ /**
+ * Target times configured for the SLA (in seconds)
+ */
+ @JsonSetter(value = "sla_definition", nulls = Nulls.SKIP)
+ public Builder slaDefinition(Optional slaDefinition) {
+ this.slaDefinition = slaDefinition;
+ return this;
+ }
+
+ public Builder slaDefinition(SlaDefinition slaDefinition) {
+ this.slaDefinition = Optional.ofNullable(slaDefinition);
+ return this;
+ }
+
+ public ConversationSlaAppliedByRule build() {
+ return new ConversationSlaAppliedByRule(slaName, slaDefinition, additionalProperties);
+ }
+ }
+
+ @JsonInclude(JsonInclude.Include.NON_ABSENT)
+ @JsonDeserialize(builder = SlaDefinition.Builder.class)
+ public static final class SlaDefinition {
+ private final Optional firstReplyTime;
+
+ private final Optional nextReplyTime;
+
+ private final Optional resolutionTime;
+
+ private final Optional timeToClose;
+
+ private final Map additionalProperties;
+
+ private SlaDefinition(
+ Optional firstReplyTime,
+ Optional nextReplyTime,
+ Optional resolutionTime,
+ Optional timeToClose,
+ Map additionalProperties) {
+ this.firstReplyTime = firstReplyTime;
+ this.nextReplyTime = nextReplyTime;
+ this.resolutionTime = resolutionTime;
+ this.timeToClose = timeToClose;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return First response time target in seconds
+ */
+ @JsonProperty("first_reply_time")
+ public Optional getFirstReplyTime() {
+ return firstReplyTime;
+ }
+
+ /**
+ * @return Next reply time target in seconds
+ */
+ @JsonProperty("next_reply_time")
+ public Optional getNextReplyTime() {
+ return nextReplyTime;
+ }
+
+ /**
+ * @return Resolution time target in seconds
+ */
+ @JsonProperty("resolution_time")
+ public Optional getResolutionTime() {
+ return resolutionTime;
+ }
+
+ /**
+ * @return Time to close target in seconds
+ */
+ @JsonProperty("time_to_close")
+ public Optional getTimeToClose() {
+ return timeToClose;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof SlaDefinition && equalTo((SlaDefinition) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(SlaDefinition other) {
+ return firstReplyTime.equals(other.firstReplyTime)
+ && nextReplyTime.equals(other.nextReplyTime)
+ && resolutionTime.equals(other.resolutionTime)
+ && timeToClose.equals(other.timeToClose);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.firstReplyTime, this.nextReplyTime, this.resolutionTime, this.timeToClose);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder {
+ private Optional firstReplyTime = Optional.empty();
+
+ private Optional nextReplyTime = Optional.empty();
+
+ private Optional resolutionTime = Optional.empty();
+
+ private Optional timeToClose = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ public Builder from(SlaDefinition other) {
+ firstReplyTime(other.getFirstReplyTime());
+ nextReplyTime(other.getNextReplyTime());
+ resolutionTime(other.getResolutionTime());
+ timeToClose(other.getTimeToClose());
+ return this;
+ }
+
+ /**
+ * First response time target in seconds
+ */
+ @JsonSetter(value = "first_reply_time", nulls = Nulls.SKIP)
+ public Builder firstReplyTime(Optional firstReplyTime) {
+ this.firstReplyTime = firstReplyTime;
+ return this;
+ }
+
+ public Builder firstReplyTime(Integer firstReplyTime) {
+ this.firstReplyTime = Optional.ofNullable(firstReplyTime);
+ return this;
+ }
+
+ /**
+ * Next reply time target in seconds
+ */
+ @JsonSetter(value = "next_reply_time", nulls = Nulls.SKIP)
+ public Builder nextReplyTime(Optional nextReplyTime) {
+ this.nextReplyTime = nextReplyTime;
+ return this;
+ }
+
+ public Builder nextReplyTime(Integer nextReplyTime) {
+ this.nextReplyTime = Optional.ofNullable(nextReplyTime);
+ return this;
+ }
+
+ /**
+ * Resolution time target in seconds
+ */
+ @JsonSetter(value = "resolution_time", nulls = Nulls.SKIP)
+ public Builder resolutionTime(Optional resolutionTime) {
+ this.resolutionTime = resolutionTime;
+ return this;
+ }
+
+ public Builder resolutionTime(Integer resolutionTime) {
+ this.resolutionTime = Optional.ofNullable(resolutionTime);
+ return this;
+ }
+
+ /**
+ * Time to close target in seconds
+ */
+ @JsonSetter(value = "time_to_close", nulls = Nulls.SKIP)
+ public Builder timeToClose(Optional timeToClose) {
+ this.timeToClose = timeToClose;
+ return this;
+ }
+
+ public Builder timeToClose(Integer timeToClose) {
+ this.timeToClose = Optional.ofNullable(timeToClose);
+ return this;
+ }
+
+ public SlaDefinition build() {
+ return new SlaDefinition(
+ firstReplyTime, nextReplyTime, resolutionTime, timeToClose, additionalProperties);
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/intercom/api/resources/unstable/types/ConversationSlaAppliedByWorkflow.java b/src/main/java/com/intercom/api/resources/unstable/types/ConversationSlaAppliedByWorkflow.java
new file mode 100644
index 00000000..09dea1b3
--- /dev/null
+++ b/src/main/java/com/intercom/api/resources/unstable/types/ConversationSlaAppliedByWorkflow.java
@@ -0,0 +1,306 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.intercom.api.resources.unstable.types;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.intercom.api.core.ObjectMappers;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = ConversationSlaAppliedByWorkflow.Builder.class)
+public final class ConversationSlaAppliedByWorkflow {
+ private final Optional slaName;
+
+ private final Optional slaDefinition;
+
+ private final Map additionalProperties;
+
+ private ConversationSlaAppliedByWorkflow(
+ Optional slaName, Optional