](../../models/components/AuthContext.md) | :heavy_minus_sign: | Context for authentication responses, containing identifiers for the entity being authenticated.
|
\ No newline at end of file
diff --git a/docs/models/components/ServerToolResponseRequestType.md b/docs/models/components/ServerToolResponseRequestType.md
new file mode 100644
index 00000000..0e9b4702
--- /dev/null
+++ b/docs/models/components/ServerToolResponseRequestType.md
@@ -0,0 +1,23 @@
+# ServerToolResponseRequestType
+
+The type of request made to the user.
+
+## Example Usage
+
+```java
+import com.glean.api_client.glean_api_client.models.components.ServerToolResponseRequestType;
+
+ServerToolResponseRequestType value = ServerToolResponseRequestType.EXECUTION;
+
+// Open enum: use .of() to create instances from custom string values
+ServerToolResponseRequestType custom = ServerToolResponseRequestType.of("custom_value");
+```
+
+
+## Values
+
+| Name | Value |
+| --------------------------- | --------------------------- |
+| `EXECUTION` | EXECUTION |
+| `AUTHENTICATION_SUGGESTION` | AUTHENTICATION_SUGGESTION |
+| `VOTE_SUGGESTION` | VOTE_SUGGESTION |
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index b45cd292..947c27d5 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,4 +1,4 @@
groupId=com.glean.api-client
artifactId=glean-api-client
-version=0.14.2
+version=0.14.3
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g
diff --git a/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java b/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java
index 27ecdf5e..f24764cd 100644
--- a/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java
+++ b/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java
@@ -25,8 +25,8 @@ public class SDKConfiguration {
private static final String LANGUAGE = "java";
public static final String OPENAPI_DOC_VERSION = "0.9.0";
- public static final String SDK_VERSION = "0.14.2";
- public static final String GEN_VERSION = "2.916.2";
+ public static final String SDK_VERSION = "0.14.3";
+ public static final String GEN_VERSION = "2.916.4";
private static final String BASE_PACKAGE = "com.glean.api_client.glean_api_client";
public static final String USER_AGENT =
String.format("speakeasy-sdk/%s %s %s %s %s",
diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ActionPreview.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ActionPreview.java
new file mode 100644
index 00000000..b1a8c138
--- /dev/null
+++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ActionPreview.java
@@ -0,0 +1,193 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ * @generated-id: d675b61f6579
+ */
+package com.glean.api_client.glean_api_client.models.components;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.glean.api_client.glean_api_client.utils.Utils;
+import java.lang.Override;
+import java.lang.String;
+import java.util.Optional;
+
+/**
+ * ActionPreview
+ *
+ * Preview information for an action being executed.
+ */
+public class ActionPreview {
+ /**
+ * Markdown preview describing what the action will do.
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("markdown")
+ private Optional markdown;
+
+ /**
+ * Short summary of what this specific tool invocation will do.
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("description")
+ private Optional description;
+
+ @JsonCreator
+ public ActionPreview(
+ @JsonProperty("markdown") Optional markdown,
+ @JsonProperty("description") Optional description) {
+ Utils.checkNotNull(markdown, "markdown");
+ Utils.checkNotNull(description, "description");
+ this.markdown = markdown;
+ this.description = description;
+ }
+
+ public ActionPreview() {
+ this(Optional.empty(), Optional.empty());
+ }
+
+ /**
+ * Markdown preview describing what the action will do.
+ */
+ @JsonIgnore
+ public Optional markdown() {
+ return markdown;
+ }
+
+ /**
+ * Short summary of what this specific tool invocation will do.
+ */
+ @JsonIgnore
+ public Optional description() {
+ return description;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+
+ /**
+ * Markdown preview describing what the action will do.
+ */
+ public ActionPreview withMarkdown(String markdown) {
+ Utils.checkNotNull(markdown, "markdown");
+ this.markdown = Optional.ofNullable(markdown);
+ return this;
+ }
+
+
+ /**
+ * Markdown preview describing what the action will do.
+ */
+ public ActionPreview withMarkdown(Optional markdown) {
+ Utils.checkNotNull(markdown, "markdown");
+ this.markdown = markdown;
+ return this;
+ }
+
+ /**
+ * Short summary of what this specific tool invocation will do.
+ */
+ public ActionPreview withDescription(String description) {
+ Utils.checkNotNull(description, "description");
+ this.description = Optional.ofNullable(description);
+ return this;
+ }
+
+
+ /**
+ * Short summary of what this specific tool invocation will do.
+ */
+ public ActionPreview withDescription(Optional description) {
+ Utils.checkNotNull(description, "description");
+ this.description = description;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ActionPreview other = (ActionPreview) o;
+ return
+ Utils.enhancedDeepEquals(this.markdown, other.markdown) &&
+ Utils.enhancedDeepEquals(this.description, other.description);
+ }
+
+ @Override
+ public int hashCode() {
+ return Utils.enhancedHash(
+ markdown, description);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(ActionPreview.class,
+ "markdown", markdown,
+ "description", description);
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ public final static class Builder {
+
+ private Optional markdown = Optional.empty();
+
+ private Optional description = Optional.empty();
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+
+ /**
+ * Markdown preview describing what the action will do.
+ */
+ public Builder markdown(String markdown) {
+ Utils.checkNotNull(markdown, "markdown");
+ this.markdown = Optional.ofNullable(markdown);
+ return this;
+ }
+
+ /**
+ * Markdown preview describing what the action will do.
+ */
+ public Builder markdown(Optional markdown) {
+ Utils.checkNotNull(markdown, "markdown");
+ this.markdown = markdown;
+ return this;
+ }
+
+
+ /**
+ * Short summary of what this specific tool invocation will do.
+ */
+ public Builder description(String description) {
+ Utils.checkNotNull(description, "description");
+ this.description = Optional.ofNullable(description);
+ return this;
+ }
+
+ /**
+ * Short summary of what this specific tool invocation will do.
+ */
+ public Builder description(Optional description) {
+ Utils.checkNotNull(description, "description");
+ this.description = description;
+ return this;
+ }
+
+ public ActionPreview build() {
+
+ return new ActionPreview(
+ markdown, description);
+ }
+
+ }
+}
diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthContext.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthContext.java
new file mode 100644
index 00000000..d88a8627
--- /dev/null
+++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthContext.java
@@ -0,0 +1,133 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ * @generated-id: 6b1b30de8338
+ */
+package com.glean.api_client.glean_api_client.models.components;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.glean.api_client.glean_api_client.utils.Utils;
+import java.lang.Override;
+import java.lang.String;
+import java.util.Optional;
+
+/**
+ * AuthContext
+ *
+ * Context for authentication responses, containing identifiers for the entity being authenticated.
+ */
+public class AuthContext {
+ /**
+ * ID of the MCP server (populated when toolType is MCP).
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("serverId")
+ private Optional serverId;
+
+ @JsonCreator
+ public AuthContext(
+ @JsonProperty("serverId") Optional serverId) {
+ Utils.checkNotNull(serverId, "serverId");
+ this.serverId = serverId;
+ }
+
+ public AuthContext() {
+ this(Optional.empty());
+ }
+
+ /**
+ * ID of the MCP server (populated when toolType is MCP).
+ */
+ @JsonIgnore
+ public Optional serverId() {
+ return serverId;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+
+ /**
+ * ID of the MCP server (populated when toolType is MCP).
+ */
+ public AuthContext withServerId(String serverId) {
+ Utils.checkNotNull(serverId, "serverId");
+ this.serverId = Optional.ofNullable(serverId);
+ return this;
+ }
+
+
+ /**
+ * ID of the MCP server (populated when toolType is MCP).
+ */
+ public AuthContext withServerId(Optional serverId) {
+ Utils.checkNotNull(serverId, "serverId");
+ this.serverId = serverId;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ AuthContext other = (AuthContext) o;
+ return
+ Utils.enhancedDeepEquals(this.serverId, other.serverId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Utils.enhancedHash(
+ serverId);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(AuthContext.class,
+ "serverId", serverId);
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ public final static class Builder {
+
+ private Optional serverId = Optional.empty();
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+
+ /**
+ * ID of the MCP server (populated when toolType is MCP).
+ */
+ public Builder serverId(String serverId) {
+ Utils.checkNotNull(serverId, "serverId");
+ this.serverId = Optional.ofNullable(serverId);
+ return this;
+ }
+
+ /**
+ * ID of the MCP server (populated when toolType is MCP).
+ */
+ public Builder serverId(Optional serverId) {
+ Utils.checkNotNull(serverId, "serverId");
+ this.serverId = serverId;
+ return this;
+ }
+
+ public AuthContext build() {
+
+ return new AuthContext(
+ serverId);
+ }
+
+ }
+}
diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessageFragment.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessageFragment.java
index bc467d53..d2653b52 100644
--- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessageFragment.java
+++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessageFragment.java
@@ -72,6 +72,30 @@ public class ChatMessageFragment {
@JsonProperty("citation")
private Optional extends ChatMessageCitation> citation;
+
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("serverToolRequest")
+ private Optional extends ServerToolRequest> serverToolRequest;
+
+ /**
+ * Response to a server tool request. The applicable fields depend on requestType:
+ *
+ * For EXECUTION requests:
+ * - isGranted: whether tool execution is approved
+ * - reason: optional explanation
+ *
+ *
For AUTHENTICATION_SUGGESTION requests:
+ * - isGranted: whether auth completed successfully (true=connected, false=skipped)
+ * - authContext: contains serverId or actionPackId for identifying the authenticated entity
+ * - reason: optional explanation for skip
+ *
+ *
For VOTE_SUGGESTION requests:
+ * - voted: whether the user voted for this tool
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("serverToolResponse")
+ private Optional extends ServerToolResponse> serverToolResponse;
+
@JsonCreator
public ChatMessageFragment(
@JsonProperty("structuredResults") Optional extends List> structuredResults,
@@ -80,7 +104,9 @@ public ChatMessageFragment(
@JsonProperty("querySuggestion") Optional extends QuerySuggestion> querySuggestion,
@JsonProperty("file") Optional extends ChatFile> file,
@JsonProperty("action") Optional extends ToolInfo> action,
- @JsonProperty("citation") Optional extends ChatMessageCitation> citation) {
+ @JsonProperty("citation") Optional extends ChatMessageCitation> citation,
+ @JsonProperty("serverToolRequest") Optional extends ServerToolRequest> serverToolRequest,
+ @JsonProperty("serverToolResponse") Optional extends ServerToolResponse> serverToolResponse) {
Utils.checkNotNull(structuredResults, "structuredResults");
Utils.checkNotNull(trackingToken, "trackingToken");
Utils.checkNotNull(text, "text");
@@ -88,6 +114,8 @@ public ChatMessageFragment(
Utils.checkNotNull(file, "file");
Utils.checkNotNull(action, "action");
Utils.checkNotNull(citation, "citation");
+ Utils.checkNotNull(serverToolRequest, "serverToolRequest");
+ Utils.checkNotNull(serverToolResponse, "serverToolResponse");
this.structuredResults = structuredResults;
this.trackingToken = trackingToken;
this.text = text;
@@ -95,12 +123,14 @@ public ChatMessageFragment(
this.file = file;
this.action = action;
this.citation = citation;
+ this.serverToolRequest = serverToolRequest;
+ this.serverToolResponse = serverToolResponse;
}
public ChatMessageFragment() {
this(Optional.empty(), Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(), Optional.empty(),
- Optional.empty());
+ Optional.empty(), Optional.empty(), Optional.empty());
}
/**
@@ -156,6 +186,33 @@ public Optional citation() {
return (Optional) citation;
}
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Optional serverToolRequest() {
+ return (Optional) serverToolRequest;
+ }
+
+ /**
+ * Response to a server tool request. The applicable fields depend on requestType:
+ *
+ * For EXECUTION requests:
+ * - isGranted: whether tool execution is approved
+ * - reason: optional explanation
+ *
+ *
For AUTHENTICATION_SUGGESTION requests:
+ * - isGranted: whether auth completed successfully (true=connected, false=skipped)
+ * - authContext: contains serverId or actionPackId for identifying the authenticated entity
+ * - reason: optional explanation for skip
+ *
+ *
For VOTE_SUGGESTION requests:
+ * - voted: whether the user voted for this tool
+ */
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Optional serverToolResponse() {
+ return (Optional) serverToolResponse;
+ }
+
public static Builder builder() {
return new Builder();
}
@@ -278,6 +335,62 @@ public ChatMessageFragment withCitation(Optional extends ChatMessageCitation>
return this;
}
+ public ChatMessageFragment withServerToolRequest(ServerToolRequest serverToolRequest) {
+ Utils.checkNotNull(serverToolRequest, "serverToolRequest");
+ this.serverToolRequest = Optional.ofNullable(serverToolRequest);
+ return this;
+ }
+
+
+ public ChatMessageFragment withServerToolRequest(Optional extends ServerToolRequest> serverToolRequest) {
+ Utils.checkNotNull(serverToolRequest, "serverToolRequest");
+ this.serverToolRequest = serverToolRequest;
+ return this;
+ }
+
+ /**
+ * Response to a server tool request. The applicable fields depend on requestType:
+ *
+ * For EXECUTION requests:
+ * - isGranted: whether tool execution is approved
+ * - reason: optional explanation
+ *
+ *
For AUTHENTICATION_SUGGESTION requests:
+ * - isGranted: whether auth completed successfully (true=connected, false=skipped)
+ * - authContext: contains serverId or actionPackId for identifying the authenticated entity
+ * - reason: optional explanation for skip
+ *
+ *
For VOTE_SUGGESTION requests:
+ * - voted: whether the user voted for this tool
+ */
+ public ChatMessageFragment withServerToolResponse(ServerToolResponse serverToolResponse) {
+ Utils.checkNotNull(serverToolResponse, "serverToolResponse");
+ this.serverToolResponse = Optional.ofNullable(serverToolResponse);
+ return this;
+ }
+
+
+ /**
+ * Response to a server tool request. The applicable fields depend on requestType:
+ *
+ *
For EXECUTION requests:
+ * - isGranted: whether tool execution is approved
+ * - reason: optional explanation
+ *
+ *
For AUTHENTICATION_SUGGESTION requests:
+ * - isGranted: whether auth completed successfully (true=connected, false=skipped)
+ * - authContext: contains serverId or actionPackId for identifying the authenticated entity
+ * - reason: optional explanation for skip
+ *
+ *
For VOTE_SUGGESTION requests:
+ * - voted: whether the user voted for this tool
+ */
+ public ChatMessageFragment withServerToolResponse(Optional extends ServerToolResponse> serverToolResponse) {
+ Utils.checkNotNull(serverToolResponse, "serverToolResponse");
+ this.serverToolResponse = serverToolResponse;
+ return this;
+ }
+
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
@@ -294,7 +407,9 @@ public boolean equals(java.lang.Object o) {
Utils.enhancedDeepEquals(this.querySuggestion, other.querySuggestion) &&
Utils.enhancedDeepEquals(this.file, other.file) &&
Utils.enhancedDeepEquals(this.action, other.action) &&
- Utils.enhancedDeepEquals(this.citation, other.citation);
+ Utils.enhancedDeepEquals(this.citation, other.citation) &&
+ Utils.enhancedDeepEquals(this.serverToolRequest, other.serverToolRequest) &&
+ Utils.enhancedDeepEquals(this.serverToolResponse, other.serverToolResponse);
}
@Override
@@ -302,7 +417,7 @@ public int hashCode() {
return Utils.enhancedHash(
structuredResults, trackingToken, text,
querySuggestion, file, action,
- citation);
+ citation, serverToolRequest, serverToolResponse);
}
@Override
@@ -314,7 +429,9 @@ public String toString() {
"querySuggestion", querySuggestion,
"file", file,
"action", action,
- "citation", citation);
+ "citation", citation,
+ "serverToolRequest", serverToolRequest,
+ "serverToolResponse", serverToolResponse);
}
@SuppressWarnings("UnusedReturnValue")
@@ -334,6 +451,10 @@ public final static class Builder {
private Optional extends ChatMessageCitation> citation = Optional.empty();
+ private Optional extends ServerToolRequest> serverToolRequest = Optional.empty();
+
+ private Optional extends ServerToolResponse> serverToolResponse = Optional.empty();
+
private Builder() {
// force use of static builder() method
}
@@ -455,12 +576,68 @@ public Builder citation(Optional extends ChatMessageCitation> citation) {
return this;
}
+
+ public Builder serverToolRequest(ServerToolRequest serverToolRequest) {
+ Utils.checkNotNull(serverToolRequest, "serverToolRequest");
+ this.serverToolRequest = Optional.ofNullable(serverToolRequest);
+ return this;
+ }
+
+ public Builder serverToolRequest(Optional extends ServerToolRequest> serverToolRequest) {
+ Utils.checkNotNull(serverToolRequest, "serverToolRequest");
+ this.serverToolRequest = serverToolRequest;
+ return this;
+ }
+
+
+ /**
+ * Response to a server tool request. The applicable fields depend on requestType:
+ *
+ *
For EXECUTION requests:
+ * - isGranted: whether tool execution is approved
+ * - reason: optional explanation
+ *
+ *
For AUTHENTICATION_SUGGESTION requests:
+ * - isGranted: whether auth completed successfully (true=connected, false=skipped)
+ * - authContext: contains serverId or actionPackId for identifying the authenticated entity
+ * - reason: optional explanation for skip
+ *
+ *
For VOTE_SUGGESTION requests:
+ * - voted: whether the user voted for this tool
+ */
+ public Builder serverToolResponse(ServerToolResponse serverToolResponse) {
+ Utils.checkNotNull(serverToolResponse, "serverToolResponse");
+ this.serverToolResponse = Optional.ofNullable(serverToolResponse);
+ return this;
+ }
+
+ /**
+ * Response to a server tool request. The applicable fields depend on requestType:
+ *
+ *
For EXECUTION requests:
+ * - isGranted: whether tool execution is approved
+ * - reason: optional explanation
+ *
+ *
For AUTHENTICATION_SUGGESTION requests:
+ * - isGranted: whether auth completed successfully (true=connected, false=skipped)
+ * - authContext: contains serverId or actionPackId for identifying the authenticated entity
+ * - reason: optional explanation for skip
+ *
+ *
For VOTE_SUGGESTION requests:
+ * - voted: whether the user voted for this tool
+ */
+ public Builder serverToolResponse(Optional extends ServerToolResponse> serverToolResponse) {
+ Utils.checkNotNull(serverToolResponse, "serverToolResponse");
+ this.serverToolResponse = serverToolResponse;
+ return this;
+ }
+
public ChatMessageFragment build() {
return new ChatMessageFragment(
structuredResults, trackingToken, text,
querySuggestion, file, action,
- citation);
+ citation, serverToolRequest, serverToolResponse);
}
}
diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GrantScope.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GrantScope.java
new file mode 100644
index 00000000..37d870a5
--- /dev/null
+++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GrantScope.java
@@ -0,0 +1,137 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ * @generated-id: 4bb5fa4462da
+ */
+package com.glean.api_client.glean_api_client.models.components;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.lang.Override;
+import java.lang.String;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+/**
+ * Wrapper for an "open" enum that can handle unknown values from API responses
+ * without runtime errors. Instances are immutable singletons with reference equality.
+ * Use {@code asEnum()} for switch expressions.
+ */
+/**
+ * GrantScope
+ *
+ *
Scope of the approval grant. Only applicable when isGranted is true and requestType is EXECUTION.
+ */
+public class GrantScope {
+
+ public static final GrantScope CURRENT_REQUEST = new GrantScope("CURRENT_REQUEST");
+ public static final GrantScope CURRENT_SESSION = new GrantScope("CURRENT_SESSION");
+ public static final GrantScope ALWAYS = new GrantScope("ALWAYS");
+
+ // This map will grow whenever a Color gets created with a new
+ // unrecognized value (a potential memory leak if the user is not
+ // careful). Keep this field lower case to avoid clashing with
+ // generated member names which will always be upper cased (Java
+ // convention)
+ private static final Map values = createValuesMap();
+ private static final Map enums = createEnumsMap();
+
+ private final String value;
+
+ private GrantScope(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Returns a GrantScope with the given value. For a specific value the
+ * returned object will always be a singleton so reference equality
+ * is satisfied when the values are the same.
+ *
+ * @param value value to be wrapped as GrantScope
+ */
+ @JsonCreator
+ public static GrantScope of(String value) {
+ synchronized (GrantScope.class) {
+ return values.computeIfAbsent(value, v -> new GrantScope(v));
+ }
+ }
+
+ @JsonValue
+ public String value() {
+ return value;
+ }
+
+ public Optional asEnum() {
+ return Optional.ofNullable(enums.getOrDefault(value, null));
+ }
+
+ public boolean isKnown() {
+ return asEnum().isPresent();
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(value);
+ }
+
+ @Override
+ public boolean equals(java.lang.Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ GrantScope other = (GrantScope) obj;
+ return Objects.equals(value, other.value);
+ }
+
+ @Override
+ public String toString() {
+ return "GrantScope [value=" + value + "]";
+ }
+
+ // return an array just like an enum
+ public static GrantScope[] values() {
+ synchronized (GrantScope.class) {
+ return values.values().toArray(new GrantScope[] {});
+ }
+ }
+
+ private static final Map createValuesMap() {
+ Map map = new LinkedHashMap<>();
+ map.put("CURRENT_REQUEST", CURRENT_REQUEST);
+ map.put("CURRENT_SESSION", CURRENT_SESSION);
+ map.put("ALWAYS", ALWAYS);
+ return map;
+ }
+
+ private static final Map createEnumsMap() {
+ Map map = new HashMap<>();
+ map.put("CURRENT_REQUEST", GrantScopeEnum.CURRENT_REQUEST);
+ map.put("CURRENT_SESSION", GrantScopeEnum.CURRENT_SESSION);
+ map.put("ALWAYS", GrantScopeEnum.ALWAYS);
+ return map;
+ }
+
+
+ public enum GrantScopeEnum {
+
+ CURRENT_REQUEST("CURRENT_REQUEST"),
+ CURRENT_SESSION("CURRENT_SESSION"),
+ ALWAYS("ALWAYS"),;
+
+ private final String value;
+
+ private GrantScopeEnum(String value) {
+ this.value = value;
+ }
+
+ public String value() {
+ return value;
+ }
+ }
+}
+
diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequest.java
index 01225592..253809d5 100644
--- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequest.java
+++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequest.java
@@ -87,7 +87,7 @@ public class ListEntitiesRequest {
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("requestType")
- private Optional extends RequestType> requestType;
+ private Optional extends ListEntitiesRequestRequestType> requestType;
@JsonCreator
public ListEntitiesRequest(
@@ -100,7 +100,7 @@ public ListEntitiesRequest(
@JsonProperty("pageSize") Optional pageSize,
@JsonProperty("cursor") Optional cursor,
@JsonProperty("source") Optional source,
- @JsonProperty("requestType") Optional extends RequestType> requestType) {
+ @JsonProperty("requestType") Optional extends ListEntitiesRequestRequestType> requestType) {
Utils.checkNotNull(filter, "filter");
Utils.checkNotNull(sort, "sort");
Utils.checkNotNull(entityType, "entityType");
@@ -207,8 +207,8 @@ public Optional source() {
*/
@SuppressWarnings("unchecked")
@JsonIgnore
- public Optional requestType() {
- return (Optional) requestType;
+ public Optional requestType() {
+ return (Optional) requestType;
}
public static Builder builder() {
@@ -382,7 +382,7 @@ public ListEntitiesRequest withSource(Optional source) {
/**
* The type of request being made.
*/
- public ListEntitiesRequest withRequestType(RequestType requestType) {
+ public ListEntitiesRequest withRequestType(ListEntitiesRequestRequestType requestType) {
Utils.checkNotNull(requestType, "requestType");
this.requestType = Optional.ofNullable(requestType);
return this;
@@ -392,7 +392,7 @@ public ListEntitiesRequest withRequestType(RequestType requestType) {
/**
* The type of request being made.
*/
- public ListEntitiesRequest withRequestType(Optional extends RequestType> requestType) {
+ public ListEntitiesRequest withRequestType(Optional extends ListEntitiesRequestRequestType> requestType) {
Utils.checkNotNull(requestType, "requestType");
this.requestType = requestType;
return this;
@@ -465,7 +465,7 @@ public final static class Builder {
private Optional source = Optional.empty();
- private Optional extends RequestType> requestType;
+ private Optional extends ListEntitiesRequestRequestType> requestType;
private Builder() {
// force use of static builder() method
@@ -638,7 +638,7 @@ public Builder source(Optional source) {
/**
* The type of request being made.
*/
- public Builder requestType(RequestType requestType) {
+ public Builder requestType(ListEntitiesRequestRequestType requestType) {
Utils.checkNotNull(requestType, "requestType");
this.requestType = Optional.ofNullable(requestType);
return this;
@@ -647,7 +647,7 @@ public Builder requestType(RequestType requestType) {
/**
* The type of request being made.
*/
- public Builder requestType(Optional extends RequestType> requestType) {
+ public Builder requestType(Optional extends ListEntitiesRequestRequestType> requestType) {
Utils.checkNotNull(requestType, "requestType");
this.requestType = requestType;
return this;
@@ -675,10 +675,10 @@ public ListEntitiesRequest build() {
"\"PEOPLE\"",
new TypeReference>() {});
- private static final LazySingletonValue> _SINGLETON_VALUE_RequestType =
+ private static final LazySingletonValue> _SINGLETON_VALUE_RequestType =
new LazySingletonValue<>(
"requestType",
"\"STANDARD\"",
- new TypeReference>() {});
+ new TypeReference>() {});
}
}
diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/RequestType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequestRequestType.java
similarity index 76%
rename from src/main/java/com/glean/api_client/glean_api_client/models/components/RequestType.java
rename to src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequestRequestType.java
index 56de9b17..a5a33fd8 100644
--- a/src/main/java/com/glean/api_client/glean_api_client/models/components/RequestType.java
+++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequestRequestType.java
@@ -1,6 +1,6 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- * @generated-id: b82d8bdf4934
+ * @generated-id: bb8154c900da
*/
package com.glean.api_client.glean_api_client.models.components;
@@ -10,11 +10,11 @@
import java.util.Optional;
/**
- * RequestType
+ * ListEntitiesRequestRequestType
*
* The type of request being made.
*/
-public enum RequestType {
+public enum ListEntitiesRequestRequestType {
/**
* Used by default for all requests and satisfies all standard use cases for list requests. Limited to 10000 entities.
*/
@@ -27,7 +27,7 @@ public enum RequestType {
@JsonValue
private final String value;
- RequestType(String value) {
+ ListEntitiesRequestRequestType(String value) {
this.value = value;
}
@@ -35,8 +35,8 @@ public String value() {
return value;
}
- public static Optional fromValue(String value) {
- for (RequestType o: RequestType.values()) {
+ public static Optional fromValue(String value) {
+ for (ListEntitiesRequestRequestType o: ListEntitiesRequestRequestType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolRequest.java
new file mode 100644
index 00000000..9049008c
--- /dev/null
+++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolRequest.java
@@ -0,0 +1,402 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ * @generated-id: 10b8c65363dc
+ */
+package com.glean.api_client.glean_api_client.models.components;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.glean.api_client.glean_api_client.utils.Utils;
+import java.lang.Override;
+import java.lang.String;
+import java.lang.SuppressWarnings;
+import java.util.Optional;
+
+
+public class ServerToolRequest {
+ /**
+ * The type of request made to the user.
+ */
+ @JsonProperty("requestType")
+ private ServerToolRequestRequestType requestType;
+
+ /**
+ * Unique identifier for this request.
+ */
+ @JsonProperty("requestId")
+ private String requestId;
+
+ /**
+ * Human-readable display name for the tool.
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("toolDisplayName")
+ private Optional toolDisplayName;
+
+ /**
+ * Unique identifier of the tool server. Use with GET /tool-servers/{serverId}/auth
+ * to resolve display information and authentication status.
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("serverId")
+ private Optional serverId;
+
+ /**
+ * Custom call-to-action (CTA) verb for the approval button (e.g., "Create", "Update", "Send").
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("toolCta")
+ private Optional toolCta;
+
+ /**
+ * Preview information for an action being executed.
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("actionPreview")
+ private Optional extends ActionPreview> actionPreview;
+
+ @JsonCreator
+ public ServerToolRequest(
+ @JsonProperty("requestType") ServerToolRequestRequestType requestType,
+ @JsonProperty("requestId") String requestId,
+ @JsonProperty("toolDisplayName") Optional toolDisplayName,
+ @JsonProperty("serverId") Optional serverId,
+ @JsonProperty("toolCta") Optional toolCta,
+ @JsonProperty("actionPreview") Optional extends ActionPreview> actionPreview) {
+ Utils.checkNotNull(requestType, "requestType");
+ Utils.checkNotNull(requestId, "requestId");
+ Utils.checkNotNull(toolDisplayName, "toolDisplayName");
+ Utils.checkNotNull(serverId, "serverId");
+ Utils.checkNotNull(toolCta, "toolCta");
+ Utils.checkNotNull(actionPreview, "actionPreview");
+ this.requestType = requestType;
+ this.requestId = requestId;
+ this.toolDisplayName = toolDisplayName;
+ this.serverId = serverId;
+ this.toolCta = toolCta;
+ this.actionPreview = actionPreview;
+ }
+
+ public ServerToolRequest(
+ ServerToolRequestRequestType requestType,
+ String requestId) {
+ this(requestType, requestId, Optional.empty(),
+ Optional.empty(), Optional.empty(), Optional.empty());
+ }
+
+ /**
+ * The type of request made to the user.
+ */
+ @JsonIgnore
+ public ServerToolRequestRequestType requestType() {
+ return requestType;
+ }
+
+ /**
+ * Unique identifier for this request.
+ */
+ @JsonIgnore
+ public String requestId() {
+ return requestId;
+ }
+
+ /**
+ * Human-readable display name for the tool.
+ */
+ @JsonIgnore
+ public Optional toolDisplayName() {
+ return toolDisplayName;
+ }
+
+ /**
+ * Unique identifier of the tool server. Use with GET /tool-servers/{serverId}/auth
+ * to resolve display information and authentication status.
+ */
+ @JsonIgnore
+ public Optional serverId() {
+ return serverId;
+ }
+
+ /**
+ * Custom call-to-action (CTA) verb for the approval button (e.g., "Create", "Update", "Send").
+ */
+ @JsonIgnore
+ public Optional toolCta() {
+ return toolCta;
+ }
+
+ /**
+ * Preview information for an action being executed.
+ */
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Optional actionPreview() {
+ return (Optional) actionPreview;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+
+ /**
+ * The type of request made to the user.
+ */
+ public ServerToolRequest withRequestType(ServerToolRequestRequestType requestType) {
+ Utils.checkNotNull(requestType, "requestType");
+ this.requestType = requestType;
+ return this;
+ }
+
+ /**
+ * Unique identifier for this request.
+ */
+ public ServerToolRequest withRequestId(String requestId) {
+ Utils.checkNotNull(requestId, "requestId");
+ this.requestId = requestId;
+ return this;
+ }
+
+ /**
+ * Human-readable display name for the tool.
+ */
+ public ServerToolRequest withToolDisplayName(String toolDisplayName) {
+ Utils.checkNotNull(toolDisplayName, "toolDisplayName");
+ this.toolDisplayName = Optional.ofNullable(toolDisplayName);
+ return this;
+ }
+
+
+ /**
+ * Human-readable display name for the tool.
+ */
+ public ServerToolRequest withToolDisplayName(Optional toolDisplayName) {
+ Utils.checkNotNull(toolDisplayName, "toolDisplayName");
+ this.toolDisplayName = toolDisplayName;
+ return this;
+ }
+
+ /**
+ * Unique identifier of the tool server. Use with GET /tool-servers/{serverId}/auth
+ * to resolve display information and authentication status.
+ */
+ public ServerToolRequest withServerId(String serverId) {
+ Utils.checkNotNull(serverId, "serverId");
+ this.serverId = Optional.ofNullable(serverId);
+ return this;
+ }
+
+
+ /**
+ * Unique identifier of the tool server. Use with GET /tool-servers/{serverId}/auth
+ * to resolve display information and authentication status.
+ */
+ public ServerToolRequest withServerId(Optional serverId) {
+ Utils.checkNotNull(serverId, "serverId");
+ this.serverId = serverId;
+ return this;
+ }
+
+ /**
+ * Custom call-to-action (CTA) verb for the approval button (e.g., "Create", "Update", "Send").
+ */
+ public ServerToolRequest withToolCta(String toolCta) {
+ Utils.checkNotNull(toolCta, "toolCta");
+ this.toolCta = Optional.ofNullable(toolCta);
+ return this;
+ }
+
+
+ /**
+ * Custom call-to-action (CTA) verb for the approval button (e.g., "Create", "Update", "Send").
+ */
+ public ServerToolRequest withToolCta(Optional toolCta) {
+ Utils.checkNotNull(toolCta, "toolCta");
+ this.toolCta = toolCta;
+ return this;
+ }
+
+ /**
+ * Preview information for an action being executed.
+ */
+ public ServerToolRequest withActionPreview(ActionPreview actionPreview) {
+ Utils.checkNotNull(actionPreview, "actionPreview");
+ this.actionPreview = Optional.ofNullable(actionPreview);
+ return this;
+ }
+
+
+ /**
+ * Preview information for an action being executed.
+ */
+ public ServerToolRequest withActionPreview(Optional extends ActionPreview> actionPreview) {
+ Utils.checkNotNull(actionPreview, "actionPreview");
+ this.actionPreview = actionPreview;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ServerToolRequest other = (ServerToolRequest) o;
+ return
+ Utils.enhancedDeepEquals(this.requestType, other.requestType) &&
+ Utils.enhancedDeepEquals(this.requestId, other.requestId) &&
+ Utils.enhancedDeepEquals(this.toolDisplayName, other.toolDisplayName) &&
+ Utils.enhancedDeepEquals(this.serverId, other.serverId) &&
+ Utils.enhancedDeepEquals(this.toolCta, other.toolCta) &&
+ Utils.enhancedDeepEquals(this.actionPreview, other.actionPreview);
+ }
+
+ @Override
+ public int hashCode() {
+ return Utils.enhancedHash(
+ requestType, requestId, toolDisplayName,
+ serverId, toolCta, actionPreview);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(ServerToolRequest.class,
+ "requestType", requestType,
+ "requestId", requestId,
+ "toolDisplayName", toolDisplayName,
+ "serverId", serverId,
+ "toolCta", toolCta,
+ "actionPreview", actionPreview);
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ public final static class Builder {
+
+ private ServerToolRequestRequestType requestType;
+
+ private String requestId;
+
+ private Optional toolDisplayName = Optional.empty();
+
+ private Optional serverId = Optional.empty();
+
+ private Optional toolCta = Optional.empty();
+
+ private Optional extends ActionPreview> actionPreview = Optional.empty();
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+
+ /**
+ * The type of request made to the user.
+ */
+ public Builder requestType(ServerToolRequestRequestType requestType) {
+ Utils.checkNotNull(requestType, "requestType");
+ this.requestType = requestType;
+ return this;
+ }
+
+
+ /**
+ * Unique identifier for this request.
+ */
+ public Builder requestId(String requestId) {
+ Utils.checkNotNull(requestId, "requestId");
+ this.requestId = requestId;
+ return this;
+ }
+
+
+ /**
+ * Human-readable display name for the tool.
+ */
+ public Builder toolDisplayName(String toolDisplayName) {
+ Utils.checkNotNull(toolDisplayName, "toolDisplayName");
+ this.toolDisplayName = Optional.ofNullable(toolDisplayName);
+ return this;
+ }
+
+ /**
+ * Human-readable display name for the tool.
+ */
+ public Builder toolDisplayName(Optional toolDisplayName) {
+ Utils.checkNotNull(toolDisplayName, "toolDisplayName");
+ this.toolDisplayName = toolDisplayName;
+ return this;
+ }
+
+
+ /**
+ * Unique identifier of the tool server. Use with GET /tool-servers/{serverId}/auth
+ * to resolve display information and authentication status.
+ */
+ public Builder serverId(String serverId) {
+ Utils.checkNotNull(serverId, "serverId");
+ this.serverId = Optional.ofNullable(serverId);
+ return this;
+ }
+
+ /**
+ * Unique identifier of the tool server. Use with GET /tool-servers/{serverId}/auth
+ * to resolve display information and authentication status.
+ */
+ public Builder serverId(Optional serverId) {
+ Utils.checkNotNull(serverId, "serverId");
+ this.serverId = serverId;
+ return this;
+ }
+
+
+ /**
+ * Custom call-to-action (CTA) verb for the approval button (e.g., "Create", "Update", "Send").
+ */
+ public Builder toolCta(String toolCta) {
+ Utils.checkNotNull(toolCta, "toolCta");
+ this.toolCta = Optional.ofNullable(toolCta);
+ return this;
+ }
+
+ /**
+ * Custom call-to-action (CTA) verb for the approval button (e.g., "Create", "Update", "Send").
+ */
+ public Builder toolCta(Optional toolCta) {
+ Utils.checkNotNull(toolCta, "toolCta");
+ this.toolCta = toolCta;
+ return this;
+ }
+
+
+ /**
+ * Preview information for an action being executed.
+ */
+ public Builder actionPreview(ActionPreview actionPreview) {
+ Utils.checkNotNull(actionPreview, "actionPreview");
+ this.actionPreview = Optional.ofNullable(actionPreview);
+ return this;
+ }
+
+ /**
+ * Preview information for an action being executed.
+ */
+ public Builder actionPreview(Optional extends ActionPreview> actionPreview) {
+ Utils.checkNotNull(actionPreview, "actionPreview");
+ this.actionPreview = actionPreview;
+ return this;
+ }
+
+ public ServerToolRequest build() {
+
+ return new ServerToolRequest(
+ requestType, requestId, toolDisplayName,
+ serverId, toolCta, actionPreview);
+ }
+
+ }
+}
diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolRequestRequestType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolRequestRequestType.java
new file mode 100644
index 00000000..919d6f66
--- /dev/null
+++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolRequestRequestType.java
@@ -0,0 +1,137 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ * @generated-id: 81b43757fd9f
+ */
+package com.glean.api_client.glean_api_client.models.components;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.lang.Override;
+import java.lang.String;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+/**
+ * Wrapper for an "open" enum that can handle unknown values from API responses
+ * without runtime errors. Instances are immutable singletons with reference equality.
+ * Use {@code asEnum()} for switch expressions.
+ */
+/**
+ * ServerToolRequestRequestType
+ *
+ * The type of request made to the user.
+ */
+public class ServerToolRequestRequestType {
+
+ public static final ServerToolRequestRequestType EXECUTION = new ServerToolRequestRequestType("EXECUTION");
+ public static final ServerToolRequestRequestType AUTHENTICATION_SUGGESTION = new ServerToolRequestRequestType("AUTHENTICATION_SUGGESTION");
+ public static final ServerToolRequestRequestType VOTE_SUGGESTION = new ServerToolRequestRequestType("VOTE_SUGGESTION");
+
+ // This map will grow whenever a Color gets created with a new
+ // unrecognized value (a potential memory leak if the user is not
+ // careful). Keep this field lower case to avoid clashing with
+ // generated member names which will always be upper cased (Java
+ // convention)
+ private static final Map values = createValuesMap();
+ private static final Map enums = createEnumsMap();
+
+ private final String value;
+
+ private ServerToolRequestRequestType(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Returns a ServerToolRequestRequestType with the given value. For a specific value the
+ * returned object will always be a singleton so reference equality
+ * is satisfied when the values are the same.
+ *
+ * @param value value to be wrapped as ServerToolRequestRequestType
+ */
+ @JsonCreator
+ public static ServerToolRequestRequestType of(String value) {
+ synchronized (ServerToolRequestRequestType.class) {
+ return values.computeIfAbsent(value, v -> new ServerToolRequestRequestType(v));
+ }
+ }
+
+ @JsonValue
+ public String value() {
+ return value;
+ }
+
+ public Optional asEnum() {
+ return Optional.ofNullable(enums.getOrDefault(value, null));
+ }
+
+ public boolean isKnown() {
+ return asEnum().isPresent();
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(value);
+ }
+
+ @Override
+ public boolean equals(java.lang.Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ServerToolRequestRequestType other = (ServerToolRequestRequestType) obj;
+ return Objects.equals(value, other.value);
+ }
+
+ @Override
+ public String toString() {
+ return "ServerToolRequestRequestType [value=" + value + "]";
+ }
+
+ // return an array just like an enum
+ public static ServerToolRequestRequestType[] values() {
+ synchronized (ServerToolRequestRequestType.class) {
+ return values.values().toArray(new ServerToolRequestRequestType[] {});
+ }
+ }
+
+ private static final Map createValuesMap() {
+ Map map = new LinkedHashMap<>();
+ map.put("EXECUTION", EXECUTION);
+ map.put("AUTHENTICATION_SUGGESTION", AUTHENTICATION_SUGGESTION);
+ map.put("VOTE_SUGGESTION", VOTE_SUGGESTION);
+ return map;
+ }
+
+ private static final Map createEnumsMap() {
+ Map map = new HashMap<>();
+ map.put("EXECUTION", ServerToolRequestRequestTypeEnum.EXECUTION);
+ map.put("AUTHENTICATION_SUGGESTION", ServerToolRequestRequestTypeEnum.AUTHENTICATION_SUGGESTION);
+ map.put("VOTE_SUGGESTION", ServerToolRequestRequestTypeEnum.VOTE_SUGGESTION);
+ return map;
+ }
+
+
+ public enum ServerToolRequestRequestTypeEnum {
+
+ EXECUTION("EXECUTION"),
+ AUTHENTICATION_SUGGESTION("AUTHENTICATION_SUGGESTION"),
+ VOTE_SUGGESTION("VOTE_SUGGESTION"),;
+
+ private final String value;
+
+ private ServerToolRequestRequestTypeEnum(String value) {
+ this.value = value;
+ }
+
+ public String value() {
+ return value;
+ }
+ }
+}
+
diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolResponse.java
new file mode 100644
index 00000000..f99f5962
--- /dev/null
+++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolResponse.java
@@ -0,0 +1,365 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ * @generated-id: eaf5337ab5b0
+ */
+package com.glean.api_client.glean_api_client.models.components;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.glean.api_client.glean_api_client.utils.LazySingletonValue;
+import com.glean.api_client.glean_api_client.utils.Utils;
+import java.lang.Boolean;
+import java.lang.Override;
+import java.lang.String;
+import java.lang.SuppressWarnings;
+import java.util.Optional;
+
+/**
+ * ServerToolResponse
+ *
+ * Response to a server tool request. The applicable fields depend on requestType:
+ *
+ *
For EXECUTION requests:
+ * - isGranted: whether tool execution is approved
+ * - reason: optional explanation
+ *
+ *
For AUTHENTICATION_SUGGESTION requests:
+ * - isGranted: whether auth completed successfully (true=connected, false=skipped)
+ * - authContext: contains serverId or actionPackId for identifying the authenticated entity
+ * - reason: optional explanation for skip
+ *
+ *
For VOTE_SUGGESTION requests:
+ * - voted: whether the user voted for this tool
+ */
+public class ServerToolResponse {
+ /**
+ * The type of request made to the user.
+ */
+ @JsonProperty("requestType")
+ private ServerToolResponseRequestType requestType;
+
+ /**
+ * Unique identifier for this request.
+ */
+ @JsonProperty("requestId")
+ private String requestId;
+
+ /**
+ * Whether tool request is granted (indicates approval for execution, or completion for auth).
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("isGranted")
+ private Optional isGranted;
+
+ /**
+ * Scope of the approval grant. Only applicable when isGranted is true and requestType is EXECUTION.
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("grantScope")
+ private Optional extends GrantScope> grantScope;
+
+ /**
+ * Context for authentication responses, containing identifiers for the entity being authenticated.
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("authContext")
+ private Optional extends AuthContext> authContext;
+
+ @JsonCreator
+ public ServerToolResponse(
+ @JsonProperty("requestType") ServerToolResponseRequestType requestType,
+ @JsonProperty("requestId") String requestId,
+ @JsonProperty("isGranted") Optional isGranted,
+ @JsonProperty("grantScope") Optional extends GrantScope> grantScope,
+ @JsonProperty("authContext") Optional extends AuthContext> authContext) {
+ Utils.checkNotNull(requestType, "requestType");
+ Utils.checkNotNull(requestId, "requestId");
+ Utils.checkNotNull(isGranted, "isGranted");
+ Utils.checkNotNull(grantScope, "grantScope");
+ Utils.checkNotNull(authContext, "authContext");
+ this.requestType = requestType;
+ this.requestId = requestId;
+ this.isGranted = isGranted;
+ this.grantScope = grantScope;
+ this.authContext = authContext;
+ }
+
+ public ServerToolResponse(
+ ServerToolResponseRequestType requestType,
+ String requestId) {
+ this(requestType, requestId, Optional.empty(),
+ Optional.empty(), Optional.empty());
+ }
+
+ /**
+ * The type of request made to the user.
+ */
+ @JsonIgnore
+ public ServerToolResponseRequestType requestType() {
+ return requestType;
+ }
+
+ /**
+ * Unique identifier for this request.
+ */
+ @JsonIgnore
+ public String requestId() {
+ return requestId;
+ }
+
+ /**
+ * Whether tool request is granted (indicates approval for execution, or completion for auth).
+ */
+ @JsonIgnore
+ public Optional isGranted() {
+ return isGranted;
+ }
+
+ /**
+ * Scope of the approval grant. Only applicable when isGranted is true and requestType is EXECUTION.
+ */
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Optional grantScope() {
+ return (Optional) grantScope;
+ }
+
+ /**
+ * Context for authentication responses, containing identifiers for the entity being authenticated.
+ */
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Optional authContext() {
+ return (Optional) authContext;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+
+ /**
+ * The type of request made to the user.
+ */
+ public ServerToolResponse withRequestType(ServerToolResponseRequestType requestType) {
+ Utils.checkNotNull(requestType, "requestType");
+ this.requestType = requestType;
+ return this;
+ }
+
+ /**
+ * Unique identifier for this request.
+ */
+ public ServerToolResponse withRequestId(String requestId) {
+ Utils.checkNotNull(requestId, "requestId");
+ this.requestId = requestId;
+ return this;
+ }
+
+ /**
+ * Whether tool request is granted (indicates approval for execution, or completion for auth).
+ */
+ public ServerToolResponse withIsGranted(boolean isGranted) {
+ Utils.checkNotNull(isGranted, "isGranted");
+ this.isGranted = Optional.ofNullable(isGranted);
+ return this;
+ }
+
+
+ /**
+ * Whether tool request is granted (indicates approval for execution, or completion for auth).
+ */
+ public ServerToolResponse withIsGranted(Optional isGranted) {
+ Utils.checkNotNull(isGranted, "isGranted");
+ this.isGranted = isGranted;
+ return this;
+ }
+
+ /**
+ * Scope of the approval grant. Only applicable when isGranted is true and requestType is EXECUTION.
+ */
+ public ServerToolResponse withGrantScope(GrantScope grantScope) {
+ Utils.checkNotNull(grantScope, "grantScope");
+ this.grantScope = Optional.ofNullable(grantScope);
+ return this;
+ }
+
+
+ /**
+ * Scope of the approval grant. Only applicable when isGranted is true and requestType is EXECUTION.
+ */
+ public ServerToolResponse withGrantScope(Optional extends GrantScope> grantScope) {
+ Utils.checkNotNull(grantScope, "grantScope");
+ this.grantScope = grantScope;
+ return this;
+ }
+
+ /**
+ * Context for authentication responses, containing identifiers for the entity being authenticated.
+ */
+ public ServerToolResponse withAuthContext(AuthContext authContext) {
+ Utils.checkNotNull(authContext, "authContext");
+ this.authContext = Optional.ofNullable(authContext);
+ return this;
+ }
+
+
+ /**
+ * Context for authentication responses, containing identifiers for the entity being authenticated.
+ */
+ public ServerToolResponse withAuthContext(Optional extends AuthContext> authContext) {
+ Utils.checkNotNull(authContext, "authContext");
+ this.authContext = authContext;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ServerToolResponse other = (ServerToolResponse) o;
+ return
+ Utils.enhancedDeepEquals(this.requestType, other.requestType) &&
+ Utils.enhancedDeepEquals(this.requestId, other.requestId) &&
+ Utils.enhancedDeepEquals(this.isGranted, other.isGranted) &&
+ Utils.enhancedDeepEquals(this.grantScope, other.grantScope) &&
+ Utils.enhancedDeepEquals(this.authContext, other.authContext);
+ }
+
+ @Override
+ public int hashCode() {
+ return Utils.enhancedHash(
+ requestType, requestId, isGranted,
+ grantScope, authContext);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(ServerToolResponse.class,
+ "requestType", requestType,
+ "requestId", requestId,
+ "isGranted", isGranted,
+ "grantScope", grantScope,
+ "authContext", authContext);
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ public final static class Builder {
+
+ private ServerToolResponseRequestType requestType;
+
+ private String requestId;
+
+ private Optional isGranted = Optional.empty();
+
+ private Optional extends GrantScope> grantScope;
+
+ private Optional extends AuthContext> authContext = Optional.empty();
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+
+ /**
+ * The type of request made to the user.
+ */
+ public Builder requestType(ServerToolResponseRequestType requestType) {
+ Utils.checkNotNull(requestType, "requestType");
+ this.requestType = requestType;
+ return this;
+ }
+
+
+ /**
+ * Unique identifier for this request.
+ */
+ public Builder requestId(String requestId) {
+ Utils.checkNotNull(requestId, "requestId");
+ this.requestId = requestId;
+ return this;
+ }
+
+
+ /**
+ * Whether tool request is granted (indicates approval for execution, or completion for auth).
+ */
+ public Builder isGranted(boolean isGranted) {
+ Utils.checkNotNull(isGranted, "isGranted");
+ this.isGranted = Optional.ofNullable(isGranted);
+ return this;
+ }
+
+ /**
+ * Whether tool request is granted (indicates approval for execution, or completion for auth).
+ */
+ public Builder isGranted(Optional isGranted) {
+ Utils.checkNotNull(isGranted, "isGranted");
+ this.isGranted = isGranted;
+ return this;
+ }
+
+
+ /**
+ * Scope of the approval grant. Only applicable when isGranted is true and requestType is EXECUTION.
+ */
+ public Builder grantScope(GrantScope grantScope) {
+ Utils.checkNotNull(grantScope, "grantScope");
+ this.grantScope = Optional.ofNullable(grantScope);
+ return this;
+ }
+
+ /**
+ * Scope of the approval grant. Only applicable when isGranted is true and requestType is EXECUTION.
+ */
+ public Builder grantScope(Optional extends GrantScope> grantScope) {
+ Utils.checkNotNull(grantScope, "grantScope");
+ this.grantScope = grantScope;
+ return this;
+ }
+
+
+ /**
+ * Context for authentication responses, containing identifiers for the entity being authenticated.
+ */
+ public Builder authContext(AuthContext authContext) {
+ Utils.checkNotNull(authContext, "authContext");
+ this.authContext = Optional.ofNullable(authContext);
+ return this;
+ }
+
+ /**
+ * Context for authentication responses, containing identifiers for the entity being authenticated.
+ */
+ public Builder authContext(Optional extends AuthContext> authContext) {
+ Utils.checkNotNull(authContext, "authContext");
+ this.authContext = authContext;
+ return this;
+ }
+
+ public ServerToolResponse build() {
+ if (grantScope == null) {
+ grantScope = _SINGLETON_VALUE_GrantScope.value();
+ }
+
+ return new ServerToolResponse(
+ requestType, requestId, isGranted,
+ grantScope, authContext);
+ }
+
+
+ private static final LazySingletonValue> _SINGLETON_VALUE_GrantScope =
+ new LazySingletonValue<>(
+ "grantScope",
+ "\"CURRENT_REQUEST\"",
+ new TypeReference>() {});
+ }
+}
diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolResponseRequestType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolResponseRequestType.java
new file mode 100644
index 00000000..ece0a53d
--- /dev/null
+++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolResponseRequestType.java
@@ -0,0 +1,137 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ * @generated-id: 200aa88b7317
+ */
+package com.glean.api_client.glean_api_client.models.components;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.lang.Override;
+import java.lang.String;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+/**
+ * Wrapper for an "open" enum that can handle unknown values from API responses
+ * without runtime errors. Instances are immutable singletons with reference equality.
+ * Use {@code asEnum()} for switch expressions.
+ */
+/**
+ * ServerToolResponseRequestType
+ *
+ * The type of request made to the user.
+ */
+public class ServerToolResponseRequestType {
+
+ public static final ServerToolResponseRequestType EXECUTION = new ServerToolResponseRequestType("EXECUTION");
+ public static final ServerToolResponseRequestType AUTHENTICATION_SUGGESTION = new ServerToolResponseRequestType("AUTHENTICATION_SUGGESTION");
+ public static final ServerToolResponseRequestType VOTE_SUGGESTION = new ServerToolResponseRequestType("VOTE_SUGGESTION");
+
+ // This map will grow whenever a Color gets created with a new
+ // unrecognized value (a potential memory leak if the user is not
+ // careful). Keep this field lower case to avoid clashing with
+ // generated member names which will always be upper cased (Java
+ // convention)
+ private static final Map values = createValuesMap();
+ private static final Map enums = createEnumsMap();
+
+ private final String value;
+
+ private ServerToolResponseRequestType(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Returns a ServerToolResponseRequestType with the given value. For a specific value the
+ * returned object will always be a singleton so reference equality
+ * is satisfied when the values are the same.
+ *
+ * @param value value to be wrapped as ServerToolResponseRequestType
+ */
+ @JsonCreator
+ public static ServerToolResponseRequestType of(String value) {
+ synchronized (ServerToolResponseRequestType.class) {
+ return values.computeIfAbsent(value, v -> new ServerToolResponseRequestType(v));
+ }
+ }
+
+ @JsonValue
+ public String value() {
+ return value;
+ }
+
+ public Optional asEnum() {
+ return Optional.ofNullable(enums.getOrDefault(value, null));
+ }
+
+ public boolean isKnown() {
+ return asEnum().isPresent();
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(value);
+ }
+
+ @Override
+ public boolean equals(java.lang.Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ServerToolResponseRequestType other = (ServerToolResponseRequestType) obj;
+ return Objects.equals(value, other.value);
+ }
+
+ @Override
+ public String toString() {
+ return "ServerToolResponseRequestType [value=" + value + "]";
+ }
+
+ // return an array just like an enum
+ public static ServerToolResponseRequestType[] values() {
+ synchronized (ServerToolResponseRequestType.class) {
+ return values.values().toArray(new ServerToolResponseRequestType[] {});
+ }
+ }
+
+ private static final Map createValuesMap() {
+ Map map = new LinkedHashMap<>();
+ map.put("EXECUTION", EXECUTION);
+ map.put("AUTHENTICATION_SUGGESTION", AUTHENTICATION_SUGGESTION);
+ map.put("VOTE_SUGGESTION", VOTE_SUGGESTION);
+ return map;
+ }
+
+ private static final Map createEnumsMap() {
+ Map map = new HashMap<>();
+ map.put("EXECUTION", ServerToolResponseRequestTypeEnum.EXECUTION);
+ map.put("AUTHENTICATION_SUGGESTION", ServerToolResponseRequestTypeEnum.AUTHENTICATION_SUGGESTION);
+ map.put("VOTE_SUGGESTION", ServerToolResponseRequestTypeEnum.VOTE_SUGGESTION);
+ return map;
+ }
+
+
+ public enum ServerToolResponseRequestTypeEnum {
+
+ EXECUTION("EXECUTION"),
+ AUTHENTICATION_SUGGESTION("AUTHENTICATION_SUGGESTION"),
+ VOTE_SUGGESTION("VOTE_SUGGESTION"),;
+
+ private final String value;
+
+ private ServerToolResponseRequestTypeEnum(String value) {
+ this.value = value;
+ }
+
+ public String value() {
+ return value;
+ }
+ }
+}
+