diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index aad60697..a49441f1 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 0359d4fe-2923-46fc-aaca-cf70b48dcfa1 management: - docChecksum: 5c7701aa515577cc32a4e41893fec554 + docChecksum: c8b0d00a2bb9d11c431bf4ac08c264a0 docVersion: 0.9.0 - speakeasyVersion: 1.789.0 - generationVersion: 2.916.2 - releaseVersion: 0.14.2 - configChecksum: 95aa076aa99f70f73eac7b1470402ba1 + speakeasyVersion: 1.789.1 + generationVersion: 2.916.4 + releaseVersion: 0.14.3 + configChecksum: be03d2f5afbc5351e940b5326128717f repoURL: https://github.com/gleanwork/api-client-java.git installationURL: https://github.com/gleanwork/api-client-java published: true persistentEdits: - generation_id: b1b33c25-68c9-48f2-97b5-7a40212ea1f0 - pristine_commit_hash: 273bdda7a2ca22b6223033a07c04758f0ac75218 - pristine_tree_hash: 1a364654830ea96f1e170d8d65674e507592750c + generation_id: 3791ac2a-d076-4d55-b967-2b48de8bdd9d + pristine_commit_hash: 7a058b9bbd97f1d6f90f3ded5de9083d430f99cb + pristine_tree_hash: 45261b65380297924b85383592ec5419e676696c features: java: acceptHeaders: 2.81.2 @@ -61,6 +61,10 @@ trackedFiles: id: b5696972f7a6 last_write_checksum: sha1:7b76b2bb7a02ae84166730ded8dd292d404bc60c pristine_git_object: 5a426c1439f86d97f00204e41db53de10276cdb0 + docs/models/components/ActionPreview.md: + id: 3ea085acc215 + last_write_checksum: sha1:a8f5f8c3fa48e20cec61b5fae04b698668dac402 + pristine_git_object: e44093cb0a9adc7f0fee751bbda6b7a6ac20a90a docs/models/components/ActionSummary.md: id: 300b48ceb953 last_write_checksum: sha1:ab39efc4383c1eb016849c7b98f3c2168afb2694 @@ -245,6 +249,10 @@ trackedFiles: id: fa927b2f2c8b last_write_checksum: sha1:978f0062236e30b3dae31b8d9e050a0c735300ea pristine_git_object: 40c6f9827ee5119b3be4e0edf0b3c7c9dba8fdbe + docs/models/components/AuthContext.md: + id: 64e4fb971b5c + last_write_checksum: sha1:72d85a592b2d7baa2a2d7b58d69f21983a4b6465 + pristine_git_object: d5be736ed8773611266a380621e0b54530edda97 docs/models/components/AuthStatus.md: id: 6ae04fe9bb48 last_write_checksum: sha1:73f64c4e6491cc913a3902e97daf579c0a62e56a @@ -403,8 +411,8 @@ trackedFiles: pristine_git_object: d87bcee5df0550dbcac033293ba4f1662723997c docs/models/components/ChatMessageFragment.md: id: 998e5c5b431f - last_write_checksum: sha1:9b4d789359e4ef9b2cb4aae25bbc6f1ffe1f3fa6 - pristine_git_object: 259567522e11b75496bb389489fb1834f5dc0218 + last_write_checksum: sha1:faf23b9edd3dc87c519210e4686dfe21f535f788 + pristine_git_object: 5a63122a95e107b0e56727757114e0bd08fe7d53 docs/models/components/ChatMetadata.md: id: cc43eff646ef last_write_checksum: sha1:f594ff1895ab08264e1029f275a3c9bfc1c9b748 @@ -1389,6 +1397,10 @@ trackedFiles: id: 85bb47b74049 last_write_checksum: sha1:7192b8a87a07a72c0fdee634468f650eac650826 pristine_git_object: e01d9e5935ba4be4ddcd73986e38648ace3c824d + docs/models/components/GrantScope.md: + id: 3a74910c59b3 + last_write_checksum: sha1:d520dd7eae101e676fc0ed1036d6159a630004b6 + pristine_git_object: 90c6a616088924e9cfb66b988a8c78d71c73f6c9 docs/models/components/GrantType.md: id: ff52f1ab2158 last_write_checksum: sha1:12f911d49ad20300c964086977a502cf77ee4e4b @@ -1579,8 +1591,8 @@ trackedFiles: pristine_git_object: 5419fabc10b3c662be9a77f5279a230421febca7 docs/models/components/ListEntitiesRequest.md: id: 1604db9ced90 - last_write_checksum: sha1:03c575a6f3b41cd72a32801865f0349b66123a07 - pristine_git_object: 288662a0f2e2ccdd03c1ff7d183c4cf36e83bfba + last_write_checksum: sha1:e055e504ba82ccfc1bbf74180ccf54e159e2d2ce + pristine_git_object: 9007c9b7789090f4e5a7745c7b6113de02152051 docs/models/components/ListEntitiesRequestEntityType.md: id: 27642e37a01f last_write_checksum: sha1:b014ecc6eb5e8691517f84c0509596539e871065 @@ -1589,6 +1601,10 @@ trackedFiles: id: 4822886fc507 last_write_checksum: sha1:b96809973cfb2775fdc8a0022a1bb34a6f46a955 pristine_git_object: 39573fd5ec1334760d6ce1baddb2ed2b32eec65c + docs/models/components/ListEntitiesRequestRequestType.md: + id: 1b8aeb1ddd59 + last_write_checksum: sha1:2c6b662f0ce51544cda0df9b949f782e0d38046c + pristine_git_object: 33661a966187314d9687a3c86ae4b3e14afc6eca docs/models/components/ListEntitiesResponse.md: id: 648e8a9ca604 last_write_checksum: sha1:2b1412061b677a0bef525e2053fa777a03cc1036 @@ -2025,10 +2041,6 @@ trackedFiles: id: d356c3e78d94 last_write_checksum: sha1:bffeb5f9283d6c94f03831177b862ea0a385d54c pristine_git_object: e0f93b057558eaeea6ae3adb4402784c78d72bcb - docs/models/components/RequestType.md: - id: b78cef984227 - last_write_checksum: sha1:9fd0af3c3adbc66ed17ad66e3b391643050a595d - pristine_git_object: dc399ef3333ce05f1914924b2694d6f6fcd9d78e docs/models/components/ResponseHint.md: id: 3e68544a68d0 last_write_checksum: sha1:84eed4a102a4817c054a65b37eb615eadcd2596c @@ -2157,6 +2169,22 @@ trackedFiles: id: ba77654a2089 last_write_checksum: sha1:875b76414c10a216f81946c05845e1d6ce0e2f9e pristine_git_object: c1e616d1f68e6c84d0204085e8d13af39afb6739 + docs/models/components/ServerToolRequest.md: + id: 611b771d2b40 + last_write_checksum: sha1:72176ef988f8dbc3e6f96dd548ffc4b9a2eada42 + pristine_git_object: ca9d9d2d2967e287cfc51bfd31253f9fce6b9800 + docs/models/components/ServerToolRequestRequestType.md: + id: e03c37fb8df1 + last_write_checksum: sha1:86a9d45016aee61f48b0f4152949a776603a0497 + pristine_git_object: fea3c7738cfc15d5c99a3146c8416c33c98f3c9a + docs/models/components/ServerToolResponse.md: + id: 321ae6bbc38c + last_write_checksum: sha1:dd318bdec66752c55cafb370053e38d3d10f313e + pristine_git_object: 3d365d8f117f8547ec1cf19c756e56656e5f31c7 + docs/models/components/ServerToolResponseRequestType.md: + id: 0758c2646390 + last_write_checksum: sha1:9307693e1fa90cdcdd84700129e00af145a56774 + pristine_git_object: 0e9b4702876be671623cc42ea140612244344a89 docs/models/components/SessionInfo.md: id: 39dc62adea74 last_write_checksum: sha1:8ea632cff00745aa3ef4746f798693b6a3bd6635 @@ -3639,8 +3667,8 @@ trackedFiles: pristine_git_object: 3decbce5bd40edbe278c1c5d2dbf585808e51d9a gradle.properties: id: 2afbb999f001 - last_write_checksum: sha1:d5b376a46a83c492608c39e1072e17b35101d80f - pristine_git_object: b45cd292930cc950c43d747a2bdb9c5c16ab6d27 + last_write_checksum: sha1:8379af9fa277a6752c1e33a237c83a9c494333db + pristine_git_object: 947c27d5aa59d385012bc2e657ef72db71c1959c gradle/wrapper/gradle-wrapper.jar: id: ec27dae6e852 last_write_checksum: sha1:f725fb1467084142d74fd7cd8eab691ab3442611 @@ -3947,8 +3975,8 @@ trackedFiles: pristine_git_object: ffae914775eb41ff311371f62504344a59d090fd src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java: id: d5fcc61f5992 - last_write_checksum: sha1:6c14ab75a60a510150d0b7da899615e32295a147 - pristine_git_object: 27ecdf5e058fc419269713f84ebaecd90a597905 + last_write_checksum: sha1:0425f25702347060031630a96596cd0a8c713edb + pristine_git_object: f24764cdd8070d3dd11fbfd5a0ef3ee8657a898e src/main/java/com/glean/api_client/glean_api_client/Search.java: id: f22d94b920b5 last_write_checksum: sha1:803fcb8e55cb4a76ec275ae45b83730fc7ed18c7 @@ -3981,6 +4009,10 @@ trackedFiles: id: 199db1b58d43 last_write_checksum: sha1:1c81c9b835eec152f5550b3bf33bf91d3904c41a pristine_git_object: a1dbbaa05db2e20d5a99f7ba61d11daee003bc80 + src/main/java/com/glean/api_client/glean_api_client/models/components/ActionPreview.java: + id: d675b61f6579 + last_write_checksum: sha1:d29c894759f514b464e648fbd83496635a7333b6 + pristine_git_object: b1a8c138b93fa7111b8c9d2292bc76fe815b107b src/main/java/com/glean/api_client/glean_api_client/models/components/ActionSummary.java: id: 9ed3dcd26676 last_write_checksum: sha1:a1c7b9aadfc2dc06c140e748b55e8cd2326bd58a @@ -4165,6 +4197,10 @@ trackedFiles: id: 827353c3e25a last_write_checksum: sha1:2b48a2f3f2d06e5b2a2ae97116901645e2fb1ddc pristine_git_object: c01f4c272ad7983cae2c6433ed9b4a21e70800c9 + src/main/java/com/glean/api_client/glean_api_client/models/components/AuthContext.java: + id: 6b1b30de8338 + last_write_checksum: sha1:2e915e1bd4e1a6cd0000af8b9e26ffd8051d19e2 + pristine_git_object: d88a8627ba14c74cce4bf75fdce0d912b3576de1 src/main/java/com/glean/api_client/glean_api_client/models/components/AuthStatus.java: id: 32f457fb3009 last_write_checksum: sha1:b4f9cb7e0102959f7094df14fe9c1fe59f91096c @@ -4323,8 +4359,8 @@ trackedFiles: pristine_git_object: d074d871e31881d51b24374d6c45bdb8046d0e1d src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessageFragment.java: id: c22528520aec - last_write_checksum: sha1:b129bfbd798039c162a300a0df7d40e619f61110 - pristine_git_object: bc467d53867e442ff2c4a355429e95fca7bc7a30 + last_write_checksum: sha1:c85711c365cbbfffbf3a57ae201a83c7def0f9b4 + pristine_git_object: d2653b525807e0772994134636ceccee0c8d498e src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMetadata.java: id: b6d2e9d21bd1 last_write_checksum: sha1:400c3443ecc621cf6e43f7e6855c7fcbdcd97e36 @@ -5309,6 +5345,10 @@ trackedFiles: id: 6383aabbbc1d last_write_checksum: sha1:5542e77d6cfe3f3b0d42bac6dd40e9ba311e703e pristine_git_object: 7aa43a16bed8b7f183886024bac6063064afc189 + src/main/java/com/glean/api_client/glean_api_client/models/components/GrantScope.java: + id: 4bb5fa4462da + last_write_checksum: sha1:96c87d7a223a551a62746c72fca66d3a7cadb911 + pristine_git_object: 37d870a58ec68723a58f62c28e7a8e4cf053401a src/main/java/com/glean/api_client/glean_api_client/models/components/GrantType.java: id: 9df8d4dc9a89 last_write_checksum: sha1:0ceb5695098b4dc00b6a18dac10ca5b4763543c3 @@ -5499,8 +5539,8 @@ trackedFiles: pristine_git_object: 11e7c9ea1f5a883f1301a2acfa4d4fc1e374c301 src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequest.java: id: 84f8bee3a23f - last_write_checksum: sha1:1ae5352e75769b1a9654c2b53159a2b3f31a43e1 - pristine_git_object: 0122559271174129e7ec725c8849296a385075b6 + last_write_checksum: sha1:1ddab4591c79c4939def85fa4aae2afc0cc59443 + pristine_git_object: 253809d5216aea7531ac58bb2f5ba1cb5149f1e2 src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequestEntityType.java: id: 246bd45c20c5 last_write_checksum: sha1:24a694b226beb3ea179644445573df076620478b @@ -5509,6 +5549,10 @@ trackedFiles: id: eb796fadbae6 last_write_checksum: sha1:275e0079a25cd338d41af143c130d90d07b2a16d pristine_git_object: 017e42f3f7960015c7d8a92737e908535dbf41b2 + src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequestRequestType.java: + id: bb8154c900da + last_write_checksum: sha1:ee5624ee9ba5bc08737938099bd2bda868e91066 + pristine_git_object: a5a33fd80d8b1352ad215b629f28b725763f56d2 src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesResponse.java: id: 45d8d046fb9e last_write_checksum: sha1:eb986fbf28e16c2ddad9e8f2c20fa203fb013645 @@ -5945,10 +5989,6 @@ trackedFiles: id: e0baa4ab8293 last_write_checksum: sha1:80856030fb570a162d5d4ee3b89dd5767e0d29c2 pristine_git_object: 1e6df8ee8ff7a4755c9db7500d00ba3f02377f2b - src/main/java/com/glean/api_client/glean_api_client/models/components/RequestType.java: - id: b82d8bdf4934 - last_write_checksum: sha1:ac392634ccbd16cfc4d1d04f664f06ead524081d - pristine_git_object: 56de9b1738b7e29c0102471edd81fbfe25c3e411 src/main/java/com/glean/api_client/glean_api_client/models/components/ResponseHint.java: id: 9a7151459ddf last_write_checksum: sha1:4d31eeb89501cf82e0a3bdc63442af56badb0523 @@ -6077,6 +6117,22 @@ trackedFiles: id: 85c29d92b872 last_write_checksum: sha1:300868d3aaeda81ef05e82a7f8a84957c8f115cd pristine_git_object: 468facf34e717502d427cd7f691e8ea4c59df5a1 + src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolRequest.java: + id: 10b8c65363dc + last_write_checksum: sha1:43998e022b9f26d3ccfbe47a82104b1b3464eeda + pristine_git_object: 9049008ca617ac2b7b0b8bae694f597bbf1a2bcf + src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolRequestRequestType.java: + id: 81b43757fd9f + last_write_checksum: sha1:e2ec7e57ea2e8e9cd7dac87c6bbfdea17beaaab9 + pristine_git_object: 919d6f6683f2c8fa2b92ed0dba7e526d1199eb51 + src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolResponse.java: + id: eaf5337ab5b0 + last_write_checksum: sha1:7b5ff6372620b3b928f17e2ff36506c7d466c826 + pristine_git_object: f99f596211293fb341759b7ddecc5c8124275e2e + src/main/java/com/glean/api_client/glean_api_client/models/components/ServerToolResponseRequestType.java: + id: 200aa88b7317 + last_write_checksum: sha1:28864f16fa852c3122a2fab6b1ac75384c700fda + pristine_git_object: ece0a53d2c8f4e3d51c2b2608f5c95caa8fe9f0c src/main/java/com/glean/api_client/glean_api_client/models/components/SessionInfo.java: id: ad7b0e031edf last_write_checksum: sha1:3d997e0f6931e66eebac4a8269640e7233299f47 @@ -11055,7 +11111,7 @@ generatedTests: get_/rest/api/v1/tools/list: "2025-06-09T18:03:44Z" post_/rest/api/v1/tools/call: "2025-06-09T18:03:44Z" listpolicies: "2025-06-09T18:03:44Z" -releaseNotes: "## Java SDK Changes:\n* `glean.client.tools.retrieveToolServerAuthStatus()`: **Added**\n* `glean.client.tools.authorizeToolServer()`: **Added**\n* `glean.client.search.retrieveFeed()`: \n * `request.feedRequest.categories[].enum(adminHealthCenter)` **Added**\n * `response.results[]` **Changed**\n" +releaseNotes: "## Java SDK Changes:\n* `glean.client.chat.create()`: \n * `request.chatRequest.messages[].fragments[]` **Changed**\n * `response.messages[].fragments[]` **Changed**\n* `glean.client.chat.retrieve()`: `response.chatResult.chat.messages[].fragments[]` **Changed**\n* `glean.client.chat.createStream()`: \n * `request.chatRequest.messages[].fragments[]` **Changed**\n" generatedFiles: - .gitattributes - USAGE.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2f5f5ab0..786fdb02 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -30,7 +30,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false java: - version: 0.14.2 + version: 0.14.3 additionalDependencies: [] additionalPlugins: [] artifactID: glean-api-client diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index ef457ebc..1d99b1bd 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -2,8 +2,8 @@ openapi: 3.0.0 info: version: "0.9.0" title: Glean API - x-source-commit-sha: 9bca005a03d53a6cd35c7439b108282c26317ff8 - x-open-api-commit-sha: 3e78c99c64ab425b90a0037362be06f26a91458b + x-source-commit-sha: fd51f322986505d36d473efdfbad36ea6d22ce4c + x-open-api-commit-sha: a2c64d9bc434d05f1cc0e0ae0522a9b968e99a20 description: | # Introduction In addition to the data sources that Glean has built-in support for, Glean also provides a REST API that enables customers to put arbitrary content in the search index. This is useful, for example, for doing permissions-aware search over content in internal tools that reside on-prem as well as for searching over applications that Glean does not currently support first class. In addition these APIs allow the customer to push organization data (people info, organization structure etc) into Glean. @@ -9713,6 +9713,127 @@ components: additionalProperties: $ref: '#/components/schemas/WriteActionParameter' description: Parameters supported by the tool. + ServerToolBase: + type: object + properties: + requestType: + type: string + enum: + - EXECUTION + - AUTHENTICATION_SUGGESTION + - VOTE_SUGGESTION + description: The type of request made to the user. + x-enumDescriptions: + EXECUTION: Request for approving execution of the tool. + AUTHENTICATION_SUGGESTION: Request for authenticating to a tool, provided as a (tool) suggestion. + VOTE_SUGGESTION: Suggestion to vote for enabling an available-but-not-enabled tool. + x-speakeasy-enum-descriptions: + EXECUTION: Request for approving execution of the tool. + AUTHENTICATION_SUGGESTION: Request for authenticating to a tool, provided as a (tool) suggestion. + VOTE_SUGGESTION: Suggestion to vote for enabling an available-but-not-enabled tool. + requestId: + type: string + description: Unique identifier for this request. + required: + - toolType + - requestType + - requestId + x-visibility: Preview + x-glean-experimental: + id: 4e3ee791-45e0-4125-845f-4b7701aa983c + introduced: "2026-07-02" + ActionPreview: + properties: + markdown: + type: string + description: Markdown preview describing what the action will do. + description: + type: string + description: Short summary of what this specific tool invocation will do. + description: Preview information for an action being executed. + ServerToolRequest: + allOf: + - $ref: '#/components/schemas/ServerToolBase' + - type: object + properties: + toolDisplayName: + type: string + description: Human-readable display name for the tool. + serverId: + type: string + description: | + Unique identifier of the tool server. Use with GET /tool-servers/{serverId}/auth + to resolve display information and authentication status. + toolCta: + type: string + description: Custom call-to-action (CTA) verb for the approval button (e.g., "Create", "Update", "Send"). + actionPreview: + $ref: '#/components/schemas/ActionPreview' + description: Preview information for this tool request. + required: + - toolName + x-visibility: Preview + x-glean-experimental: + id: 8544e887-4569-4b14-bde0-d1be9e90dbc3 + introduced: "2026-07-02" + AuthContext: + type: object + properties: + serverId: + type: string + description: ID of the MCP server (populated when toolType is MCP). + description: | + Context for authentication responses, containing identifiers for the entity being authenticated. + x-visibility: Preview + x-glean-experimental: + id: a7c1d3e5-9f42-4b8a-b6e0-2d4f8a1c3e5b + introduced: "2026-07-09" + ServerToolResponse: + allOf: + - $ref: '#/components/schemas/ServerToolBase' + - type: object + properties: + isGranted: + type: boolean + description: Whether tool request is granted (indicates approval for execution, or completion for auth). + grantScope: + type: string + enum: + - CURRENT_REQUEST + - CURRENT_SESSION + - ALWAYS + description: | + Scope of the approval grant. Only applicable when isGranted is true and requestType is EXECUTION. + default: CURRENT_REQUEST + x-enumDescriptions: + CURRENT_REQUEST: Approve only the current tool request. Future tool execution requests still require approval. + CURRENT_SESSION: Approve the current tool request and auto-approve all future same tool requests in this chat session. + ALWAYS: Approve the current tool request and auto-approve all future same tool requests across all chat sessions. + x-speakeasy-enum-descriptions: + CURRENT_REQUEST: Approve only the current tool request. Future tool execution requests still require approval. + CURRENT_SESSION: Approve the current tool request and auto-approve all future same tool requests in this chat session. + ALWAYS: Approve the current tool request and auto-approve all future same tool requests across all chat sessions. + authContext: + $ref: '#/components/schemas/AuthContext' + description: Context for AUTHENTICATION_SUGGESTION responses. Required when requestType is AUTHENTICATION_SUGGESTION. + description: | + 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 + x-visibility: Preview + x-glean-experimental: + id: 3eae3ee7-2c06-4027-be14-98260a3ce608 + introduced: "2026-07-02" ChatMessageFragment: allOf: - $ref: '#/components/schemas/Result' @@ -9732,6 +9853,12 @@ components: citation: $ref: '#/components/schemas/ChatMessageCitation' description: Inline citation. + serverToolRequest: + $ref: '#/components/schemas/ServerToolRequest' + description: request to run a tool on server. + serverToolResponse: + $ref: '#/components/schemas/ServerToolResponse' + description: response corresponding to the server tool request. description: Represents a part of a ChatMessage that originates from a single action/tool. It is designed to support rich data formats beyond simple text, allowing for a more dynamic and interactive chat experience. Each fragment can include various types of content, such as text, search queries, action information, and more. Also, each ChatMessageFragment should only have one of structuredResults, querySuggestion, writeAction, followupAction, agentRecommendation, followupRoutingSuggestion or file. ChatMessage: properties: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index f92c6f51..a835e563 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.789.0 +speakeasyVersion: 1.789.1 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:839e533953fafea59d265ca71200c49694d691be9d2e47d1847e7b71b826924f - sourceBlobDigest: sha256:c74b95bc3857693d978d52f69c270a7a07343bfb4f4c7e2dc5e1307f2050608d + sourceRevisionDigest: sha256:2f127189ab6d415266cc0873c7e4158b6a3c467bafae808f258c476396ef2e6e + sourceBlobDigest: sha256:27fd341b0356e9639e96d41be4241c84f546199a326345d9ae4e39b98600dae5 tags: - latest Glean-OAS: @@ -17,10 +17,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:839e533953fafea59d265ca71200c49694d691be9d2e47d1847e7b71b826924f - sourceBlobDigest: sha256:c74b95bc3857693d978d52f69c270a7a07343bfb4f4c7e2dc5e1307f2050608d + sourceRevisionDigest: sha256:2f127189ab6d415266cc0873c7e4158b6a3c467bafae808f258c476396ef2e6e + sourceBlobDigest: sha256:27fd341b0356e9639e96d41be4241c84f546199a326345d9ae4e39b98600dae5 codeSamplesNamespace: glean-api-specs-java-code-samples - codeSamplesRevisionDigest: sha256:8cbab7bee9110f35b7e85c591c78ee9963ca34c3d52ef5191d33a4d4caaf598d + codeSamplesRevisionDigest: sha256:36f66e6bdfa9420ca7d06fa1bb763115b1d913920fdbe79311d6e026ae0a1cb8 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index cf54e533..83329c00 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'com.glean.api-client:glean-api-client:0.14.2' +implementation 'com.glean.api-client:glean-api-client:0.14.3' ``` Maven: @@ -75,7 +75,7 @@ Maven: com.glean.api-client glean-api-client - 0.14.2 + 0.14.3 ``` diff --git a/RELEASES.md b/RELEASES.md index 5d68c45e..cf1a625c 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -788,4 +788,14 @@ Based on: ### Generated - [java v0.14.2] . ### Releases -- [Maven Central v0.14.2] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.14.2 - . \ No newline at end of file +- [Maven Central v0.14.2] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.14.2 - . + +## 2026-07-10 03:56:40 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.789.1 (2.916.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v0.14.3] . +### Releases +- [Maven Central v0.14.3] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.14.3 - . \ No newline at end of file diff --git a/docs/models/components/ActionPreview.md b/docs/models/components/ActionPreview.md new file mode 100644 index 00000000..e44093cb --- /dev/null +++ b/docs/models/components/ActionPreview.md @@ -0,0 +1,11 @@ +# ActionPreview + +Preview information for an action being executed. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `markdown` | *Optional\* | :heavy_minus_sign: | Markdown preview describing what the action will do. | +| `description` | *Optional\* | :heavy_minus_sign: | Short summary of what this specific tool invocation will do. | \ No newline at end of file diff --git a/docs/models/components/AuthContext.md b/docs/models/components/AuthContext.md new file mode 100644 index 00000000..d5be736e --- /dev/null +++ b/docs/models/components/AuthContext.md @@ -0,0 +1,11 @@ +# AuthContext + +Context for authentication responses, containing identifiers for the entity being authenticated. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `serverId` | *Optional\* | :heavy_minus_sign: | ID of the MCP server (populated when toolType is MCP). | \ No newline at end of file diff --git a/docs/models/components/ChatMessageFragment.md b/docs/models/components/ChatMessageFragment.md index 25956752..5a63122a 100644 --- a/docs/models/components/ChatMessageFragment.md +++ b/docs/models/components/ChatMessageFragment.md @@ -5,12 +5,14 @@ Represents a part of a ChatMessage that originates from a single action/tool. It ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `structuredResults` | List\<[StructuredResult](../../models/components/StructuredResult.md)> | :heavy_minus_sign: | An array of entities in the work graph retrieved via a data request. | | -| `trackingToken` | *Optional\* | :heavy_minus_sign: | An opaque token that represents this particular result in this particular query. To be used for /feedback reporting. | | -| `text` | *Optional\* | :heavy_minus_sign: | N/A | | -| `querySuggestion` | [Optional\](../../models/components/QuerySuggestion.md) | :heavy_minus_sign: | N/A | {
"query": "app:github type:pull author:mortimer",
"label": "Mortimer's PRs",
"datasource": "github"
} | -| `file` | [Optional\](../../models/components/ChatFile.md) | :heavy_minus_sign: | Structure for file uploaded by a user for Chat. | | -| `action` | [Optional\](../../models/components/ToolInfo.md) | :heavy_minus_sign: | N/A | | -| `citation` | [Optional\](../../models/components/ChatMessageCitation.md) | :heavy_minus_sign: | Information about the source for a ChatMessage. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `structuredResults` | List\<[StructuredResult](../../models/components/StructuredResult.md)> | :heavy_minus_sign: | An array of entities in the work graph retrieved via a data request. | | +| `trackingToken` | *Optional\* | :heavy_minus_sign: | An opaque token that represents this particular result in this particular query. To be used for /feedback reporting. | | +| `text` | *Optional\* | :heavy_minus_sign: | N/A | | +| `querySuggestion` | [Optional\](../../models/components/QuerySuggestion.md) | :heavy_minus_sign: | N/A | {
"query": "app:github type:pull author:mortimer",
"label": "Mortimer's PRs",
"datasource": "github"
} | +| `file` | [Optional\](../../models/components/ChatFile.md) | :heavy_minus_sign: | Structure for file uploaded by a user for Chat. | | +| `action` | [Optional\](../../models/components/ToolInfo.md) | :heavy_minus_sign: | N/A | | +| `citation` | [Optional\](../../models/components/ChatMessageCitation.md) | :heavy_minus_sign: | Information about the source for a ChatMessage. | | +| `serverToolRequest` | [Optional\](../../models/components/ServerToolRequest.md) | :heavy_minus_sign: | N/A | | +| `serverToolResponse` | [Optional\](../../models/components/ServerToolResponse.md) | :heavy_minus_sign: | 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
| | \ No newline at end of file diff --git a/docs/models/components/GrantScope.md b/docs/models/components/GrantScope.md new file mode 100644 index 00000000..90c6a616 --- /dev/null +++ b/docs/models/components/GrantScope.md @@ -0,0 +1,24 @@ +# GrantScope + +Scope of the approval grant. Only applicable when isGranted is true and requestType is EXECUTION. + + +## Example Usage + +```java +import com.glean.api_client.glean_api_client.models.components.GrantScope; + +GrantScope value = GrantScope.CURRENT_REQUEST; + +// Open enum: use .of() to create instances from custom string values +GrantScope custom = GrantScope.of("custom_value"); +``` + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `CURRENT_REQUEST` | CURRENT_REQUEST | +| `CURRENT_SESSION` | CURRENT_SESSION | +| `ALWAYS` | ALWAYS | \ No newline at end of file diff --git a/docs/models/components/ListEntitiesRequest.md b/docs/models/components/ListEntitiesRequest.md index 288662a0..9007c9b7 100644 --- a/docs/models/components/ListEntitiesRequest.md +++ b/docs/models/components/ListEntitiesRequest.md @@ -14,4 +14,4 @@ | `pageSize` | *Optional\* | :heavy_minus_sign: | Hint to the server about how many results to send back. Server may return less. | 100 | | `cursor` | *Optional\* | :heavy_minus_sign: | Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. | | | `source` | *Optional\* | :heavy_minus_sign: | A string denoting the search surface from which the endpoint is called. | | -| `requestType` | [Optional\](../../models/components/RequestType.md) | :heavy_minus_sign: | The type of request being made. | | \ No newline at end of file +| `requestType` | [Optional\](../../models/components/ListEntitiesRequestRequestType.md) | :heavy_minus_sign: | The type of request being made. | | \ No newline at end of file diff --git a/docs/models/components/RequestType.md b/docs/models/components/ListEntitiesRequestRequestType.md similarity index 53% rename from docs/models/components/RequestType.md rename to docs/models/components/ListEntitiesRequestRequestType.md index dc399ef3..33661a96 100644 --- a/docs/models/components/RequestType.md +++ b/docs/models/components/ListEntitiesRequestRequestType.md @@ -1,13 +1,13 @@ -# RequestType +# ListEntitiesRequestRequestType The type of request being made. ## Example Usage ```java -import com.glean.api_client.glean_api_client.models.components.RequestType; +import com.glean.api_client.glean_api_client.models.components.ListEntitiesRequestRequestType; -RequestType value = RequestType.STANDARD; +ListEntitiesRequestRequestType value = ListEntitiesRequestRequestType.STANDARD; ``` diff --git a/docs/models/components/ServerToolRequest.md b/docs/models/components/ServerToolRequest.md new file mode 100644 index 00000000..ca9d9d2d --- /dev/null +++ b/docs/models/components/ServerToolRequest.md @@ -0,0 +1,13 @@ +# ServerToolRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `requestType` | [ServerToolRequestRequestType](../../models/components/ServerToolRequestRequestType.md) | :heavy_check_mark: | The type of request made to the user. | +| `requestId` | *String* | :heavy_check_mark: | Unique identifier for this request. | +| `toolDisplayName` | *Optional\* | :heavy_minus_sign: | Human-readable display name for the tool. | +| `serverId` | *Optional\* | :heavy_minus_sign: | Unique identifier of the tool server. Use with GET /tool-servers/{serverId}/auth
to resolve display information and authentication status.
| +| `toolCta` | *Optional\* | :heavy_minus_sign: | Custom call-to-action (CTA) verb for the approval button (e.g., "Create", "Update", "Send"). | +| `actionPreview` | [Optional\](../../models/components/ActionPreview.md) | :heavy_minus_sign: | Preview information for an action being executed. | \ No newline at end of file diff --git a/docs/models/components/ServerToolRequestRequestType.md b/docs/models/components/ServerToolRequestRequestType.md new file mode 100644 index 00000000..fea3c773 --- /dev/null +++ b/docs/models/components/ServerToolRequestRequestType.md @@ -0,0 +1,23 @@ +# ServerToolRequestRequestType + +The type of request made to the user. + +## Example Usage + +```java +import com.glean.api_client.glean_api_client.models.components.ServerToolRequestRequestType; + +ServerToolRequestRequestType value = ServerToolRequestRequestType.EXECUTION; + +// Open enum: use .of() to create instances from custom string values +ServerToolRequestRequestType custom = ServerToolRequestRequestType.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/docs/models/components/ServerToolResponse.md b/docs/models/components/ServerToolResponse.md new file mode 100644 index 00000000..3d365d8f --- /dev/null +++ b/docs/models/components/ServerToolResponse.md @@ -0,0 +1,27 @@ +# 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 + + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `requestType` | [ServerToolResponseRequestType](../../models/components/ServerToolResponseRequestType.md) | :heavy_check_mark: | The type of request made to the user. | +| `requestId` | *String* | :heavy_check_mark: | Unique identifier for this request. | +| `isGranted` | *Optional\* | :heavy_minus_sign: | Whether tool request is granted (indicates approval for execution, or completion for auth). | +| `grantScope` | [Optional\](../../models/components/GrantScope.md) | :heavy_minus_sign: | Scope of the approval grant. Only applicable when isGranted is true and requestType is EXECUTION.
| +| `authContext` | [Optional\](../../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 citation; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("serverToolRequest") + private 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 + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("serverToolResponse") + private Optional serverToolResponse; + @JsonCreator public ChatMessageFragment( @JsonProperty("structuredResults") Optional> structuredResults, @@ -80,7 +104,9 @@ public ChatMessageFragment( @JsonProperty("querySuggestion") Optional querySuggestion, @JsonProperty("file") Optional file, @JsonProperty("action") Optional action, - @JsonProperty("citation") Optional citation) { + @JsonProperty("citation") Optional citation, + @JsonProperty("serverToolRequest") Optional serverToolRequest, + @JsonProperty("serverToolResponse") Optional 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 return this; } + public ChatMessageFragment withServerToolRequest(ServerToolRequest serverToolRequest) { + Utils.checkNotNull(serverToolRequest, "serverToolRequest"); + this.serverToolRequest = Optional.ofNullable(serverToolRequest); + return this; + } + + + public ChatMessageFragment withServerToolRequest(Optional 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 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 citation = Optional.empty(); + private Optional serverToolRequest = Optional.empty(); + + private Optional serverToolResponse = Optional.empty(); + private Builder() { // force use of static builder() method } @@ -455,12 +576,68 @@ public Builder citation(Optional citation) { return this; } + + public Builder serverToolRequest(ServerToolRequest serverToolRequest) { + Utils.checkNotNull(serverToolRequest, "serverToolRequest"); + this.serverToolRequest = Optional.ofNullable(serverToolRequest); + return this; + } + + public Builder serverToolRequest(Optional 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 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 requestType; + private Optional 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 requestType) { + @JsonProperty("requestType") Optional 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 requestType) { + public ListEntitiesRequest withRequestType(Optional 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 requestType; + private Optional 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 requestType) { + public Builder requestType(Optional 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 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 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 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 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 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 grantScope; + + /** + * Context for authentication responses, containing identifiers for the entity being authenticated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("authContext") + private Optional authContext; + + @JsonCreator + public ServerToolResponse( + @JsonProperty("requestType") ServerToolResponseRequestType requestType, + @JsonProperty("requestId") String requestId, + @JsonProperty("isGranted") Optional isGranted, + @JsonProperty("grantScope") Optional grantScope, + @JsonProperty("authContext") Optional 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 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 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 grantScope; + + private Optional 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 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 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; + } + } +} +