From bae65a2956c29ea9a9134b541e08dd82a21556d1 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 2 Jul 2026 17:50:20 +0000 Subject: [PATCH 1/2] =?UTF-8?q?##=20Python=20SDK=20Changes:=20*=20`glean.a?= =?UTF-8?q?gents.search()`:=20**Added**=20*=20`glean.agents.get()`:=20**Ad?= =?UTF-8?q?ded**=20*=20`glean.agents.get=5Fschemas()`:=20**Added**=20*=20`?= =?UTF-8?q?glean.agents.create=5Frun()`:=20**Added**=20*=20`glean.search.q?= =?UTF-8?q?uery()`:=20**Added**=20*=20`glean.client.authentication.check?= =?UTF-8?q?=5Fdatasource=5Fauth()`:=20**Added**=20*=20`glean.client.chat.r?= =?UTF-8?q?etrieve=5Ffile()`:=20**Added**=20*=20`glean.client.agents.creat?= =?UTF-8?q?e()`:=20**Added**=20*=20`glean.client.agents.update()`:=20**Add?= =?UTF-8?q?ed**=20*=20`glean.client.entities.retrieve=5Fperson=5Fphoto()`:?= =?UTF-8?q?=20**Added**=20*=20`glean.client.tools.retrieve=5Faction=5Fpack?= =?UTF-8?q?=5Fauth=5Fstatus()`:=20**Added**=20*=20`glean.client.tools.auth?= =?UTF-8?q?orize=5Faction=5Fpack()`:=20**Added**=20*=20`glean.client.gover?= =?UTF-8?q?nance.data.findings.create()`:=20**Added**=20*=20`glean.client.?= =?UTF-8?q?governance.data.findings.list()`:=20**Added**=20*=20`glean.clie?= =?UTF-8?q?nt.governance.data.findings.download()`:=20**Added**=20*=20`gle?= =?UTF-8?q?an.client.governance.data.findings.delete()`:=20**Added**=20*?= =?UTF-8?q?=20`glean.client.datasources.retrieve=5Fconfiguration()`:=20**A?= =?UTF-8?q?dded**=20*=20`glean.client.datasources.update=5Fconfiguration()?= =?UTF-8?q?`:=20**Added**=20*=20`glean.client.datasources.retrieve=5Fcrede?= =?UTF-8?q?ntial=5Fstatus()`:=20**Added**=20*=20`glean.client.datasources.?= =?UTF-8?q?rotate=5Fcredentials()`:=20**Added**=20*=20`glean.indexing.docu?= =?UTF-8?q?ments.debug=5Fevents()`:=20**Added**=20*=20`glean.authenticatio?= =?UTF-8?q?n.checkdatasourceauth()`:=20**Removed**=20(Breaking=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F)=20*=20`glean.chat.get=5Fchat=5Ffile()`:=20**Removed*?= =?UTF-8?q?*=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`glean.agents.create?= =?UTF-8?q?=5Fagent()`:=20**Removed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20?= =?UTF-8?q?*=20`glean.agents.edit=5Fagent()`:=20**Removed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20*=20`glean.entities.get=5Fperson=5Fphoto(?= =?UTF-8?q?)`:=20**Removed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`glea?= =?UTF-8?q?n.tools.get=5Faction=5Fpack=5Fauth=5Fstatus()`:=20**Removed**?= =?UTF-8?q?=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`glean.tools.authorize?= =?UTF-8?q?=5Faction=5Fpack()`:=20**Removed**=20(Breaking=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F)=20*=20`glean.troubleshooting.post=5F/api/index/v1/de?= =?UTF-8?q?bug/{datasource}/document/events()`:=20**Removed**=20(Breaking?= =?UTF-8?q?=20=E2=9A=A0=EF=B8=8F)=20*=20`glean.governance.createfindingsex?= =?UTF-8?q?port()`:=20**Removed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20?= =?UTF-8?q?`glean.governance.listfindingsexports()`:=20**Removed**=20(Brea?= =?UTF-8?q?king=20=E2=9A=A0=EF=B8=8F)=20*=20`glean.governance.downloadfind?= =?UTF-8?q?ingsexport()`:=20**Removed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)?= =?UTF-8?q?=20*=20`glean.governance.deletefindingsexport()`:=20**Removed**?= =?UTF-8?q?=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`glean.datasources.get?= =?UTF-8?q?=5Fdatasource=5Finstance=5Fconfiguration()`:=20**Removed**=20(B?= =?UTF-8?q?reaking=20=E2=9A=A0=EF=B8=8F)=20*=20`glean.datasources.update?= =?UTF-8?q?=5Fdatasource=5Finstance=5Fconfiguration()`:=20**Removed**=20(B?= =?UTF-8?q?reaking=20=E2=9A=A0=EF=B8=8F)=20*=20`glean.datasources.get=5Fda?= =?UTF-8?q?tasource=5Fcredential=5Fstatus()`:=20**Removed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20*=20`glean.datasources.rotate=5Fdatasourc?= =?UTF-8?q?e=5Fcredentials()`:=20**Removed**=20(Breaking=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .speakeasy/gen.lock | 735 ++- .speakeasy/gen.yaml | 2 +- .speakeasy/glean-merged-spec.yaml | 4958 ++++++++++------- .speakeasy/tests.arazzo.yaml | 131 +- .speakeasy/workflow.lock | 12 +- README.md | 246 +- RELEASES.md | 12 +- docs/errors/platformproblemdetailerror.md | 18 + docs/models/platformactionsummary.md | 14 + docs/models/platformagent.md | 12 + docs/models/platformagentcapabilities.md | 10 + docs/models/platformagentexecutionstatus.md | 21 + docs/models/platformagentgetresponse.md | 9 + docs/models/platformagentrun.md | 12 + docs/models/platformagentruncreaterequest.md | 14 + docs/models/platformagentrunwaitresponse.md | 10 + docs/models/platformagentschemasresponse.md | 13 + docs/models/platformagentscreaterunrequest.md | 9 + .../models/platformagentscreaterunresponse.md | 17 + docs/models/platformagentsgetrequest.md | 8 + .../models/platformagentsgetschemasrequest.md | 9 + docs/models/platformagentssearchrequest.md | 8 + docs/models/platformagentssearchresponse.md | 9 + docs/models/platformcontenttype.md | 16 + docs/models/platformfilter.md | 13 + docs/models/platformfilteroperator.md | 23 + docs/models/platformmessage.md | 9 + docs/models/platformmessagerole.md | 21 + docs/models/platformmessagetextblock.md | 9 + docs/models/platformpersonreference.md | 11 + docs/models/platformproblemdetailcode.md | 38 + docs/models/platformproblemdetailerror.md | 12 + docs/models/platformresult.md | 17 + .../platformsearchrequest.md} | 129 +- docs/models/platformsearchresponse.md | 11 + docs/models/platformtimerange.md | 11 + docs/sdks/agents/README.md | 170 +- docs/sdks/authentication/README.md | 55 - docs/sdks/chatsdk/README.md | 49 - docs/sdks/clientagents/README.md | 86 + docs/sdks/clientauthentication/README.md | 47 + docs/sdks/clientchat/README.md | 43 + .../README.md | 28 +- docs/sdks/clientsearch/README.md | 633 +++ docs/sdks/clienttools/README.md | 91 - docs/sdks/entities/README.md | 123 +- docs/sdks/{governance => findings}/README.md | 26 +- docs/sdks/indexingdocuments/README.md | 47 + docs/sdks/search/README.md | 627 +-- docs/sdks/tools/README.md | 95 +- docs/sdks/troubleshooting/README.md | 53 - poetry.lock | 14 +- pyproject.toml | 4 +- src/glean/api_client/_version.py | 6 +- src/glean/api_client/agents.py | 790 ++- src/glean/api_client/authentication.py | 185 - src/glean/api_client/chat_sdk.py | 197 - src/glean/api_client/client.py | 29 +- src/glean/api_client/client_agents.py | 436 ++ src/glean/api_client/client_authentication.py | 172 + src/glean/api_client/client_chat.py | 187 + .../{datasources.py => client_datasources.py} | 20 +- src/glean/api_client/client_entities.py | 525 -- src/glean/api_client/client_governance.py | 25 - src/glean/api_client/client_search.py | 1424 +++++ src/glean/api_client/client_tools.py | 377 -- src/glean/api_client/data.py | 3 + src/glean/api_client/entities.py | 527 +- src/glean/api_client/errors/__init__.py | 8 + .../errors/platformproblemdetail_error.py | 50 + src/glean/api_client/findings.py | 741 +++ src/glean/api_client/governance.py | 748 +-- src/glean/api_client/indexing_documents.py | 220 + src/glean/api_client/models/__init__.py | 179 + .../models/platform_agents_create_runop.py | 44 + .../models/platform_agents_get_schemasop.py | 44 + .../models/platform_agents_getop.py | 18 + .../models/platformactionsummary.py | 71 + src/glean/api_client/models/platformagent.py | 55 + .../models/platformagentcapabilities.py | 65 + .../models/platformagentexecutionstatus.py | 12 + .../models/platformagentgetresponse.py | 19 + .../api_client/models/platformagentrun.py | 65 + .../models/platformagentruncreaterequest.py | 57 + .../models/platformagentrunwaitresponse.py | 43 + .../models/platformagentschemasresponse.py | 59 + .../models/platformagentssearchrequest.py | 33 + .../models/platformagentssearchresponse.py | 22 + .../api_client/models/platformcontenttype.py | 8 + src/glean/api_client/models/platformfilter.py | 56 + .../models/platformfilteroperator.py | 15 + .../api_client/models/platformmessage.py | 37 + .../api_client/models/platformmessagerole.py | 12 + .../models/platformmessagetextblock.py | 19 + .../models/platformpersonreference.py | 42 + .../models/platformproblemdetailcode.py | 29 + .../models/platformproblemdetailerror.py | 58 + src/glean/api_client/models/platformresult.py | 110 + .../models/platformsearchrequest.py | 109 + .../models/platformsearchresponse.py | 47 + .../api_client/models/platformtimerange.py | 43 + src/glean/api_client/sdk.py | 30 +- src/glean/api_client/search.py | 1349 +---- src/glean/api_client/tools.py | 372 +- src/glean/api_client/troubleshooting.py | 231 - .../internal/handler/generated_handlers.go | 5 + .../handler/pathgetapiagentsagentid.go | 69 + .../handler/pathgetapiagentsagentidschemas.go | 71 + .../handler/pathpostapiagentsagentidruns.go | 85 + .../handler/pathpostapiagentssearch.go | 70 + .../internal/handler/pathpostapisearch.go | 73 + .../components/platformactionsummary.go | 69 + .../sdk/models/components/platformagent.go | 50 + .../components/platformagentcapabilities.go | 47 + .../platformagentexecutionstatus.go | 35 + .../components/platformagentgetresponse.go | 23 + .../sdk/models/components/platformagentrun.go | 51 + .../platformagentruncreaterequest.go | 59 + .../platformagentrunwaitresponse.go | 32 + .../platformagentschemasresponse.go | 60 + .../components/platformagentssearchrequest.go | 15 + .../platformagentssearchresponse.go | 24 + .../models/components/platformcontenttype.go | 31 + .../sdk/models/components/platformfilter.go | 36 + .../components/platformfilteroperator.go | 47 + .../sdk/models/components/platformmessage.go | 24 + .../models/components/platformmessagerole.go | 35 + .../components/platformmessagetextblock.go | 23 + .../components/platformpersonreference.go | 25 + .../components/platformproblemdetailcode.go | 86 + .../components/platformproblemdetailerror.go | 34 + .../sdk/models/components/platformresult.go | 113 + .../components/platformsearchrequest.go | 90 + .../components/platformsearchresponse.go | 42 + .../models/components/platformtimerange.go | 41 + .../operations/platformagentscreaterun.go | 56 + .../models/operations/platformagentsget.go | 39 + .../operations/platformagentsgetschemas.go | 60 + .../models/operations/platformagentssearch.go | 27 + .../sdk/models/operations/platformsearch.go | 27 + .../sdkerrors/platformproblemdetailerror.go | 36 + tests/test_agents.py | 59 +- tests/test_authentication.py | 19 - ...test_chat_sdk.py => test_client_agents.py} | 6 +- tests/test_client_authentication.py | 14 + tests/test_client_chat.py | 14 + tests/test_client_datasources.py | 78 + tests/test_datasources.py | 73 - tests/test_entities.py | 7 +- .../{test_governance.py => test_findings.py} | 6 +- tests/test_messages.py | 2 +- tests/test_search.py | 34 + tests/test_summarize.py | 6 +- tests/test_tools.py | 4 +- 154 files changed, 13604 insertions(+), 7251 deletions(-) create mode 100644 docs/errors/platformproblemdetailerror.md create mode 100644 docs/models/platformactionsummary.md create mode 100644 docs/models/platformagent.md create mode 100644 docs/models/platformagentcapabilities.md create mode 100644 docs/models/platformagentexecutionstatus.md create mode 100644 docs/models/platformagentgetresponse.md create mode 100644 docs/models/platformagentrun.md create mode 100644 docs/models/platformagentruncreaterequest.md create mode 100644 docs/models/platformagentrunwaitresponse.md create mode 100644 docs/models/platformagentschemasresponse.md create mode 100644 docs/models/platformagentscreaterunrequest.md create mode 100644 docs/models/platformagentscreaterunresponse.md create mode 100644 docs/models/platformagentsgetrequest.md create mode 100644 docs/models/platformagentsgetschemasrequest.md create mode 100644 docs/models/platformagentssearchrequest.md create mode 100644 docs/models/platformagentssearchresponse.md create mode 100644 docs/models/platformcontenttype.md create mode 100644 docs/models/platformfilter.md create mode 100644 docs/models/platformfilteroperator.md create mode 100644 docs/models/platformmessage.md create mode 100644 docs/models/platformmessagerole.md create mode 100644 docs/models/platformmessagetextblock.md create mode 100644 docs/models/platformpersonreference.md create mode 100644 docs/models/platformproblemdetailcode.md create mode 100644 docs/models/platformproblemdetailerror.md create mode 100644 docs/models/platformresult.md rename docs/{sdks/cliententities/README.md => models/platformsearchrequest.md} (52%) create mode 100644 docs/models/platformsearchresponse.md create mode 100644 docs/models/platformtimerange.md delete mode 100644 docs/sdks/authentication/README.md delete mode 100644 docs/sdks/chatsdk/README.md rename docs/sdks/{datasources => clientdatasources}/README.md (91%) create mode 100644 docs/sdks/clientsearch/README.md delete mode 100644 docs/sdks/clienttools/README.md rename docs/sdks/{governance => findings}/README.md (93%) delete mode 100644 docs/sdks/troubleshooting/README.md delete mode 100644 src/glean/api_client/authentication.py delete mode 100644 src/glean/api_client/chat_sdk.py rename src/glean/api_client/{datasources.py => client_datasources.py} (98%) delete mode 100644 src/glean/api_client/client_entities.py delete mode 100644 src/glean/api_client/client_governance.py create mode 100644 src/glean/api_client/client_search.py delete mode 100644 src/glean/api_client/client_tools.py create mode 100644 src/glean/api_client/errors/platformproblemdetail_error.py create mode 100644 src/glean/api_client/findings.py create mode 100644 src/glean/api_client/models/platform_agents_create_runop.py create mode 100644 src/glean/api_client/models/platform_agents_get_schemasop.py create mode 100644 src/glean/api_client/models/platform_agents_getop.py create mode 100644 src/glean/api_client/models/platformactionsummary.py create mode 100644 src/glean/api_client/models/platformagent.py create mode 100644 src/glean/api_client/models/platformagentcapabilities.py create mode 100644 src/glean/api_client/models/platformagentexecutionstatus.py create mode 100644 src/glean/api_client/models/platformagentgetresponse.py create mode 100644 src/glean/api_client/models/platformagentrun.py create mode 100644 src/glean/api_client/models/platformagentruncreaterequest.py create mode 100644 src/glean/api_client/models/platformagentrunwaitresponse.py create mode 100644 src/glean/api_client/models/platformagentschemasresponse.py create mode 100644 src/glean/api_client/models/platformagentssearchrequest.py create mode 100644 src/glean/api_client/models/platformagentssearchresponse.py create mode 100644 src/glean/api_client/models/platformcontenttype.py create mode 100644 src/glean/api_client/models/platformfilter.py create mode 100644 src/glean/api_client/models/platformfilteroperator.py create mode 100644 src/glean/api_client/models/platformmessage.py create mode 100644 src/glean/api_client/models/platformmessagerole.py create mode 100644 src/glean/api_client/models/platformmessagetextblock.py create mode 100644 src/glean/api_client/models/platformpersonreference.py create mode 100644 src/glean/api_client/models/platformproblemdetailcode.py create mode 100644 src/glean/api_client/models/platformproblemdetailerror.py create mode 100644 src/glean/api_client/models/platformresult.py create mode 100644 src/glean/api_client/models/platformsearchrequest.py create mode 100644 src/glean/api_client/models/platformsearchresponse.py create mode 100644 src/glean/api_client/models/platformtimerange.py delete mode 100644 src/glean/api_client/troubleshooting.py create mode 100644 tests/mockserver/internal/handler/pathgetapiagentsagentid.go create mode 100644 tests/mockserver/internal/handler/pathgetapiagentsagentidschemas.go create mode 100644 tests/mockserver/internal/handler/pathpostapiagentsagentidruns.go create mode 100644 tests/mockserver/internal/handler/pathpostapiagentssearch.go create mode 100644 tests/mockserver/internal/handler/pathpostapisearch.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformactionsummary.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagent.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentcapabilities.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentexecutionstatus.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentgetresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentrun.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentrunwaitresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentschemasresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentssearchrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentssearchresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformcontenttype.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformfilter.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformfilteroperator.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformmessage.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformmessagerole.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformmessagetextblock.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformpersonreference.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformproblemdetailcode.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformproblemdetailerror.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformresult.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformsearchrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformsearchresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformtimerange.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformagentscreaterun.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformagentsget.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformagentsgetschemas.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformagentssearch.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformsearch.go create mode 100644 tests/mockserver/internal/sdk/models/sdkerrors/platformproblemdetailerror.go delete mode 100644 tests/test_authentication.py rename tests/{test_chat_sdk.py => test_client_agents.py} (74%) create mode 100644 tests/test_client_datasources.py rename tests/{test_governance.py => test_findings.py} (85%) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index a97da0c8..22196e9f 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 3e3290ca-0ee8-4981-b1bc-14536048fa63 management: - docChecksum: 939d2f12fecf92a82326fb98be3b67dc + docChecksum: 5cbe9973b042165f2c62f32620c4fb67 docVersion: 0.9.0 - speakeasyVersion: 1.786.1 - generationVersion: 2.913.3 - releaseVersion: 0.14.0 - configChecksum: 60e53eb0ca10fee04991259a07040203 + speakeasyVersion: 1.788.0 + generationVersion: 2.915.0 + releaseVersion: 0.15.0 + configChecksum: 5afef354a3b5d8340657c7fb2ec56677 repoURL: https://github.com/gleanwork/api-client-python.git installationURL: https://github.com/gleanwork/api-client-python.git published: true persistentEdits: - generation_id: 879a43c5-1ec9-4966-9fb4-3c8c35da8c0e - pristine_commit_hash: c77ddef9b3991400c71d0914f156dbb3ea876f68 - pristine_tree_hash: 735647ed5cc9075117d2aa21892e56cd943cdbe4 + generation_id: 78a078f1-bab6-46ec-87a2-022fb43a1a5b + pristine_commit_hash: 167508d5f46499764166cbb490a60ee4160bb168 + pristine_tree_hash: 4c9542fde4ff0fd0a3ac344bc2c2b1ab668927be features: python: acceptHeaders: 3.0.0 @@ -21,7 +21,7 @@ features: additionalProperties: 1.0.1 configurableModuleName: 0.2.0 constsAndDefaults: 1.0.7 - core: 6.0.32 + core: 6.0.34 defaultEnabledRetries: 0.2.0 deprecations: 3.0.2 devContainers: 3.0.0 @@ -41,6 +41,7 @@ features: mockServer: 0.1.4 multipartFileContentType: 1.0.0 nameOverrides: 3.0.3 + nullables: 1.0.2 responseFormat: 1.1.0 retries: 3.0.7 sdkHooks: 1.3.0 @@ -88,6 +89,10 @@ trackedFiles: id: d8679ae13234 last_write_checksum: sha1:a6567c83c6c0bf8eaed55f50af08001869d6a5de pristine_git_object: 7c4c0d90fd0a2de3e48b99ce691c1e9a6ab03041 + docs/errors/platformproblemdetailerror.md: + id: e92c15ace3bc + last_write_checksum: sha1:2c438a675ff111a84e2781a56952f53a1bfd0d3b + pristine_git_object: 68870011d1db67faa97b25d43461d2981ad29562 docs/models/actionauthtype.md: id: f6c3ce39f190 last_write_checksum: sha1:6fe1004cc273d5e15dff5ba82f42bd218774a83b @@ -2112,6 +2117,118 @@ trackedFiles: id: e3d1cdfcf2b5 last_write_checksum: sha1:f4720f3ce89ed29c92e2bd0aa15169ccc428bafd pristine_git_object: 515cd010b7035e35f410e715d18da9c175d18e89 + docs/models/platformactionsummary.md: + id: 66630faec49a + last_write_checksum: sha1:918357358bb6dd6840b6ef69e9bbfc05620f3eda + pristine_git_object: 4a911ee3b51a89c0a847cc6984af2b01448edc73 + docs/models/platformagent.md: + id: 6d684a308415 + last_write_checksum: sha1:0f0c8b393957aebe795e3a7a142dffa1c65354a0 + pristine_git_object: dd4be2232ea15ab2219ea0d704e126a810e679ca + docs/models/platformagentcapabilities.md: + id: 7d0c164cb136 + last_write_checksum: sha1:70a0ba43c0c1fce847913b5e6c801b8ff9b17e77 + pristine_git_object: 052dd7bb60b1553c4135a36c018c2dd39d7751dc + docs/models/platformagentexecutionstatus.md: + id: 71cf171473c1 + last_write_checksum: sha1:1be45f91909f2a787a52fd947b2d1992a0634ed1 + pristine_git_object: c5b5164ab922f175f5216bb0b33a3d8fc5dbd79f + docs/models/platformagentgetresponse.md: + id: 18c7f4c9c735 + last_write_checksum: sha1:44a241668a240ee78a4c7bb6a85daf8cb4624121 + pristine_git_object: be79ecee30d70d591903bd9a89e3708a670b5e20 + docs/models/platformagentrun.md: + id: 2b8087b0fcda + last_write_checksum: sha1:a34783d31877e4a81505588767aa6e5eccf96fda + pristine_git_object: d6dffe1463ba8b77cdbfb57994a8b2bb886d07c2 + docs/models/platformagentruncreaterequest.md: + id: c1b58ab047ae + last_write_checksum: sha1:9653da975cf65f0552fbd11801d4a98e7c2eb25d + pristine_git_object: 072a5ce90d39b9f1ec6a274757364efbe77d5a7f + docs/models/platformagentrunwaitresponse.md: + id: 216b0600404e + last_write_checksum: sha1:af98dfbf6f900d7fa891640a5ad5259919062f55 + pristine_git_object: f41e4044dc63ccca2b8e1cae5ab576d810f495ea + docs/models/platformagentschemasresponse.md: + id: a9f2476c738d + last_write_checksum: sha1:91bc217f67657540aba343504479320ef577cf64 + pristine_git_object: 6ba12306df49a4d5a78a1c53269fc78d2672b7b7 + docs/models/platformagentscreaterunrequest.md: + id: c9a4aa1f28b2 + last_write_checksum: sha1:34bcec4aebfc10fa3633b22838cca8370e56496b + pristine_git_object: df93145879eef0a308f74b9241ac16c9b6acacb9 + docs/models/platformagentscreaterunresponse.md: + id: 24710130cfb1 + last_write_checksum: sha1:7060b94ca4737945356ac99814fe4cebec042bfe + pristine_git_object: 8282996d41c67596131337d85e86d52c65cd642e + docs/models/platformagentsgetrequest.md: + id: a51f3665418a + last_write_checksum: sha1:2d3c227d75b3719fdb592cfd1498e9d2fcf53956 + pristine_git_object: 5cdd73d2b039205f28b4953ce4ed6ab45d886ffb + docs/models/platformagentsgetschemasrequest.md: + id: 3591800143f3 + last_write_checksum: sha1:de1890eab4e530405f87e999f680afc39d362d72 + pristine_git_object: dfb7f4df8370052ab9b90252a509eee0e9c1b725 + docs/models/platformagentssearchrequest.md: + id: 863c7f027d45 + last_write_checksum: sha1:7e2501648e5c73a9615222c88d00f5d83ac42a61 + pristine_git_object: 381dc6be51c9a4d008f63c94b04fff7ea7bd1887 + docs/models/platformagentssearchresponse.md: + id: e2656d1b178b + last_write_checksum: sha1:11cfb0f78ed223bdc13cb93b7ec8fded52db7f99 + pristine_git_object: 1c961815688a6cbd9b0e3a298ea0641fcff045fe + docs/models/platformcontenttype.md: + id: a9175ad4799d + last_write_checksum: sha1:abb012a639cead86824ed11e596bda3632e2fddb + pristine_git_object: 1b46526d54ef25a1d018d2cfd3bbafde48fba72a + docs/models/platformfilter.md: + id: 4e97760ae8b9 + last_write_checksum: sha1:d78122b73a8014e7103935402b9167728bcaec34 + pristine_git_object: b3e8b651de43912c7092a7cb624cda0b3f9ea48a + docs/models/platformfilteroperator.md: + id: 459d8f60cd58 + last_write_checksum: sha1:909a73760255616436ed2c71e3aeb5895e03dd68 + pristine_git_object: f814671e353534b461511918a4b553733635b691 + docs/models/platformmessage.md: + id: ea30c4fdad14 + last_write_checksum: sha1:890468283cb6b47c68edf4b7b241dec096699d95 + pristine_git_object: 626f1c36f215081121802a84c05a3a43b32bf4cd + docs/models/platformmessagerole.md: + id: e6a2fe6fb4fd + last_write_checksum: sha1:1c30e8005e9bf57a970710a3c29ab2351a55fc79 + pristine_git_object: 3646a0b786e69c448b0ef452354bd107cda591b7 + docs/models/platformmessagetextblock.md: + id: 3a2015852905 + last_write_checksum: sha1:76d7640c454b990eb346994555ddbab280d5eb28 + pristine_git_object: 68ac42502d86f948d0f9cc6c57f170bc681295c6 + docs/models/platformpersonreference.md: + id: 8e0eb24c7ab0 + last_write_checksum: sha1:b7e91a102caa171583e0033985345592eded3a47 + pristine_git_object: 9602adac9af14a6a401eaf90a16cdc7e7a96c954 + docs/models/platformproblemdetailcode.md: + id: fd61a3fb0333 + last_write_checksum: sha1:3056f64490f8bfe49ba1f0189aad31f9c90b2b33 + pristine_git_object: 21fd0b4cc99461b979f0ebd2680097ef4a3e0a10 + docs/models/platformproblemdetailerror.md: + id: 2e752ca0f45d + last_write_checksum: sha1:250c20189f7d3163d46e0036b2a7d8867f12f788 + pristine_git_object: 169944d5c3ce0c14a23f82a9c5ac30efdec24533 + docs/models/platformresult.md: + id: 0fe3fed8d508 + last_write_checksum: sha1:3a4ba99a8923e7504e9f1606eca7a2ab7277e746 + pristine_git_object: e9b2cd6a291372feb2023cc2896f9aad75c400a6 + docs/models/platformsearchrequest.md: + id: 9f3be4029289 + last_write_checksum: sha1:a1a8aed36a18bdaee8e115d80f09f9100e39ba09 + pristine_git_object: 1acc3f70ce920146b58f5aff4bdc70fed6fdf045 + docs/models/platformsearchresponse.md: + id: b20c8f7128fc + last_write_checksum: sha1:958639d5fa5b446156df39fd5f69b6c57265f13a + pristine_git_object: 219a923e48c2a8cb9333d211f51a87df045a8002 + docs/models/platformtimerange.md: + id: c37b2e815a8d + last_write_checksum: sha1:31db2f83dba4ccb6d0a5e7b80edbeff356529101 + pristine_git_object: ff19123b19a2dd81301974a38d793afff935e9aa docs/models/possiblevalue.md: id: 630387aebbc5 last_write_checksum: sha1:490f03fc39621ae0f816bb16d2922e1a8042cdb1 @@ -2850,8 +2967,8 @@ trackedFiles: pristine_git_object: 61dd41f0319201cc105e29174ab1cc0018cecbce docs/sdks/agents/README.md: id: 5965d8232fd8 - last_write_checksum: sha1:48c7b15dfcda891f9a1a2e5ad4bd6eac6f1ca056 - pristine_git_object: 00789fbf58096090a54c254a0f112588042626cb + last_write_checksum: sha1:4f2dad282a1e9d280046c66b1938347a0590a92c + pristine_git_object: 293302de505f71a109e1fd397c5d76ef2f4fd09b docs/sdks/announcements/README.md: id: 3d2e130a217c last_write_checksum: sha1:ecfa655bb27dee6890656542cfafda0aa6ed1ab9 @@ -2860,46 +2977,38 @@ trackedFiles: id: d1b7559999eb last_write_checksum: sha1:9bb496400435a160bbef383369eb1c2ae233b671 pristine_git_object: 85153af7ec594c2dbd1e4a8c2eba5ce713796265 - docs/sdks/authentication/README.md: - id: 45be241adfc3 - last_write_checksum: sha1:00dd796467da75767a02a401a28f0c4e282e0579 - pristine_git_object: d7fef01020971bbf42365f7218d9bb530f4347e1 - docs/sdks/chatsdk/README.md: - id: 83b4ee321663 - last_write_checksum: sha1:4e587ad3ecaec2f074df8232845407d4079aee74 - pristine_git_object: 27dea5744fd3191c52f0d5faee23ac6c8cf736ae docs/sdks/clientactivity/README.md: id: a309613986a5 last_write_checksum: sha1:d9737458d891593ba2fb3372ab6e60ea728fe9a5 pristine_git_object: 456e90e3a787c1e62f09a17d297f1cf756c94d49 docs/sdks/clientagents/README.md: id: 8e00e6d6b64e - last_write_checksum: sha1:f4fd02ccef64c791d216a40e1c9fcd4dfa43bd2e - pristine_git_object: 2856eeeb88599fe960b4060271977966c0650d39 + last_write_checksum: sha1:feba3228c12652e3bb4891ef4ff530d425161d74 + pristine_git_object: 78fe4036b016feef99db7e52ea5362c2159ba03c docs/sdks/clientauthentication/README.md: id: 463bffe80b61 - last_write_checksum: sha1:24f8785b3ba9eae2d84617403789c00a250e2835 - pristine_git_object: b9a4856d52e9c48fb4917c0052bf86be2ad9cd0e + last_write_checksum: sha1:406e18430be9d365f6427c804b3992c880c39498 + pristine_git_object: 7d4827b24625995a7f7a98ae5e4c8342f3b91737 docs/sdks/clientchat/README.md: id: baf998e3d238 - last_write_checksum: sha1:7d9f149eab77f7899dc1bd478066922f2cfe6ac3 - pristine_git_object: 09a859f98f62b2d16516f5792c5afc1ca60f9fe6 + last_write_checksum: sha1:e4105497a9f842b7610c3b3672745333232ebfb7 + pristine_git_object: df2c74eccab2a69d9a0aa97af07e73af0c303859 + docs/sdks/clientdatasources/README.md: + id: 0d629dc3ac5b + last_write_checksum: sha1:05eb42287569bb139f48e0908139d6cde0c04dad + pristine_git_object: 83d845c004a80375e53ad2e2db956728ed261611 docs/sdks/clientdocuments/README.md: id: e0c074acef4e last_write_checksum: sha1:ef34fa1517c866b9ae0fdb50847031421f26ea0b pristine_git_object: 8b6d7b29eae189fd1b74792cbba6265840487b61 - docs/sdks/cliententities/README.md: - id: d087d30c9006 - last_write_checksum: sha1:c5955573d5570bc98bb911311860abf4c85d19ac - pristine_git_object: 0ac68e93afbd65e5cff4a3c8cd5a91527446a41c + docs/sdks/clientsearch/README.md: + id: 0a2a3cf68489 + last_write_checksum: sha1:b26db4e2c274af856d3c7c601edabd6d61b697e3 + pristine_git_object: 7e640dd65cd3039f7f10640480b9f23097cf13b0 docs/sdks/clientshortcuts/README.md: id: d5a9d841b61c last_write_checksum: sha1:e6bd4eb4d27ae7b07f9488113b782c4aa8fa40e7 pristine_git_object: 9d7f63e9d3f13055deba1775689fa797701858b5 - docs/sdks/clienttools/README.md: - id: 6c303a9741bd - last_write_checksum: sha1:34a5cb54ce4f6836462bea95bd5a3ce3d8080395 - pristine_git_object: 5dd8efc1387c74693e62d8af1394cbc698785a15 docs/sdks/clientverification/README.md: id: e8d533f9d15b last_write_checksum: sha1:7daee0f15f8ef38b45bf6209d24edf237a7ef281 @@ -2912,18 +3021,14 @@ trackedFiles: id: b95d224c9f1d last_write_checksum: sha1:44527b6677330e2c517e290497b8dbe037826c83 pristine_git_object: adac51700d9683a41dffb2f5c20ee18008a9e135 - docs/sdks/datasources/README.md: - id: 024d3ed36945 - last_write_checksum: sha1:b5a9941e97b277f44d9dadbc615fabe0a3ecd750 - pristine_git_object: 15b97d59f6166a84e986bbd7466e40c665612424 docs/sdks/entities/README.md: id: a140ac5181b9 - last_write_checksum: sha1:b52a97b059e94d3f522a429c9d64ce0a2f7d8b64 - pristine_git_object: dce02213bdb60ae95a2a5c845ac2e0f7952367f6 - docs/sdks/governance/README.md: - id: 87817eb7bf48 - last_write_checksum: sha1:43e1f885a19db073f545980c51b23c82d3ec0389 - pristine_git_object: 8708b51c2c40d9f2d5556b71b2d5af8ff6c3f463 + last_write_checksum: sha1:816f2f81490ae04c99bc47a13b73f3123172b5b8 + pristine_git_object: 50f8adc450e41c936106eff16a8270de5f2599ab + docs/sdks/findings/README.md: + id: 7f7356eb9e9c + last_write_checksum: sha1:31cec287b2a5668e3f3bcf54173669c8a15aa292 + pristine_git_object: df7c4ee4211fe62148fd7a243580779e3b99930d docs/sdks/indexingauthentication/README.md: id: 3d8b5fccff24 last_write_checksum: sha1:db7a93bc9a6bad6ef56063825b85e78a032df1f5 @@ -2938,8 +3043,8 @@ trackedFiles: pristine_git_object: c9f66bdb622b4684f9f8d14a8ba8720b2809f463 docs/sdks/indexingdocuments/README.md: id: 7ca38da53414 - last_write_checksum: sha1:497e12866259c8c648985afd3f610d0ec1cf53ac - pristine_git_object: 184a39035ab589e6cecab631f18eca2521a5fd47 + last_write_checksum: sha1:8d884174307528b84439db59c969ff3b8641d70f + pristine_git_object: 87baf153c3b1712c9527bf1b92c9b5cec04e5d14 docs/sdks/indexingpermissions/README.md: id: f13d7f2a062c last_write_checksum: sha1:06ef4e2ff054e62867b2c6add2e90abcc7d0ea5e @@ -2974,16 +3079,12 @@ trackedFiles: pristine_git_object: 5dd26e03b79389a3e71e90f9a3ce29b7fa384dd9 docs/sdks/search/README.md: id: 5c534716244c - last_write_checksum: sha1:b26db4e2c274af856d3c7c601edabd6d61b697e3 - pristine_git_object: 7e640dd65cd3039f7f10640480b9f23097cf13b0 + last_write_checksum: sha1:205dfc0229af272713315bd6f3a1bccd495ef906 + pristine_git_object: 0596beead8d2e002de4389bd87ded3977b197897 docs/sdks/tools/README.md: id: 044286549bac - last_write_checksum: sha1:3bed19adb923aaf72f16e374527211f38a93fc74 - pristine_git_object: efef9a0f224746f0adf08ffa9f6cd568baef9114 - docs/sdks/troubleshooting/README.md: - id: 0c78de25ee92 - last_write_checksum: sha1:7f0b57600ca78c3071f0f542aa8229d37c30f4f5 - pristine_git_object: 528524fcc5c80d5bfe863fbc13fef117f448146e + last_write_checksum: sha1:da531d872e83e3a0245228a6b99e9d1fd33daca6 + pristine_git_object: 9d515f2409214c35ce374f396b022a78a297e434 docs/sdks/visibilityoverrides/README.md: id: c7d003d6a68f last_write_checksum: sha1:738c52c3b0964cfb441542710e10c51ca226f177 @@ -3002,8 +3103,8 @@ trackedFiles: pristine_git_object: 79e388be87446ab6a4064b372bad0e8376d0cb5e pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:efdc32478817512b528f8b11d32db9d78763bc54 - pristine_git_object: be2c723b48708ddcddafb34c2ec28a06e5d57905 + last_write_checksum: sha1:79359af81f2194fc0f175ec63adadb41ea4942bd + pristine_git_object: a11f0b607e67de1574fae29cb7f4f48b5a13534a scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:c2c83f71dea61eb50c9e05da83b16d18b4da8794 @@ -3030,12 +3131,12 @@ trackedFiles: pristine_git_object: 55f23c1feabfedeb7e8cd5bea8b910f0ae0b77d9 src/glean/api_client/_version.py: id: 0ce22b26136b - last_write_checksum: sha1:087799bcef8f585de1092bf8648f7ece62e4d81e - pristine_git_object: 4ef4e9f56746a5e9a5f430fa3240d6c3fb08dc83 + last_write_checksum: sha1:181fa4149f2f50d3734b9abf2a9867cadbfbbfab + pristine_git_object: 4a974591c0feef27939e20df742e506c2ad7df87 src/glean/api_client/agents.py: id: b925701a9217 - last_write_checksum: sha1:a7382154f0a1f14b79ad8677b51f38b4de34bba8 - pristine_git_object: cfd615e4ac871193f44940dc9de437b698d00be3 + last_write_checksum: sha1:962a6c5c95a065e688f40679baba92d7c21af337 + pristine_git_object: ea960e0a4d36c400ef750a3c44624efbc75688cd src/glean/api_client/announcements.py: id: 452f3d593912 last_write_checksum: sha1:4b9f4ff97fb9754b5da3a36c1cc8edb02318ed7a @@ -3044,58 +3145,46 @@ trackedFiles: id: 184a18f8be7e last_write_checksum: sha1:00537bf7bc477465a9ef695fa26bfb4600154b21 pristine_git_object: 5824d6a30b98361faaba6ae11740c23d98b9084e - src/glean/api_client/authentication.py: - id: 84ebb3cfd339 - last_write_checksum: sha1:c32181cd970a63cbdf8589f65a8fa0d352714f5f - pristine_git_object: 66854e5c9dbd68af6084ac06b842f86eb54bbd00 src/glean/api_client/basesdk.py: id: a9eeecf7fa49 last_write_checksum: sha1:fb3d2fafa4944b79b38e8ba30e92e0d42079688c pristine_git_object: bf7b1b3b25ce6530403b0dd9f60599d236c780ce - src/glean/api_client/chat_sdk.py: - id: f2f30e13ca42 - last_write_checksum: sha1:fa88967f959eb08a5e6131a577d28c9b0cb2826f - pristine_git_object: b40d3a255c6c7b68b19b2fd780ed9a7c01a39655 src/glean/api_client/client.py: id: c0c188098f10 - last_write_checksum: sha1:86fca49d07766b3c5e387256a0a308044632ee77 - pristine_git_object: 122be2b984e54e47078c9b37e5722f1aa78b6e28 + last_write_checksum: sha1:bfadba5dfdc64280fd9c7bdbf96a0651e5db429f + pristine_git_object: e64a90a54ea914e9b77d3ee61620fc5c4c55c45a src/glean/api_client/client_activity.py: id: 8227dd95d034 last_write_checksum: sha1:36b369a3a1175902a326f27e6679ffaefb4979ec pristine_git_object: 42aa2ffce8105a293a0a02353f41f083136fdc5f src/glean/api_client/client_agents.py: id: 61b53ccd2b3b - last_write_checksum: sha1:1323363d313d33718def1b1e24917f486cedc1c9 - pristine_git_object: 5f25ddecd021376dcf57a018185eca1faf33d98a + last_write_checksum: sha1:86717590a1f791c70c3ecc6fe4d5ff18b8f15e93 + pristine_git_object: 0d5dc4229d7dcb364c42457e9e4c51973cad184b src/glean/api_client/client_authentication.py: id: 0b237b7c1b11 - last_write_checksum: sha1:ba849a26bea87ee2097e58833a81d755891114a7 - pristine_git_object: 27679b5b2f69a540c371bf6aaaa2c095ab703779 + last_write_checksum: sha1:4217581430cfa2131471291a6ce36854af64dcb7 + pristine_git_object: 9cd4f878de6dc1a2e29fe9456824cb66fc6a3c4b src/glean/api_client/client_chat.py: id: 42cbb9b5acf3 - last_write_checksum: sha1:56e8989d8052154a151277d3aed762705d270ab6 - pristine_git_object: d504d06363bd65167eb12e4d2ac66cf97739117b + last_write_checksum: sha1:da24232c0b108e26ea9ca71d9cbda722643df484 + pristine_git_object: 9067145d36465c8738419f97a55a0e7152f92066 + src/glean/api_client/client_datasources.py: + id: 75635d40099f + last_write_checksum: sha1:c07b4e9aecede3c49184b2929475c05d675430ea + pristine_git_object: 0cfdfc1b672dc3f63780df6d462c3595cb4af38d src/glean/api_client/client_documents.py: id: dac599de515c last_write_checksum: sha1:67a32fc2e80bf0ce181037aed0edbd66cc75e074 pristine_git_object: d93ffbbf0b761e7a84e54f152f2a528f61e792a8 - src/glean/api_client/client_entities.py: - id: 5a17ae87ac6c - last_write_checksum: sha1:8321ae00a63b608df29cd5a73d545f4725941c9a - pristine_git_object: 819e58a2654a4f9dad345dcebc9d1ad7d104d319 - src/glean/api_client/client_governance.py: - id: 106860f10ce0 - last_write_checksum: sha1:ebe769873505002b9f00342174c7fd2508af52b6 - pristine_git_object: 6011411d2ab08645047358a30c0a87aec61555bc + src/glean/api_client/client_search.py: + id: 49ce2de81382 + last_write_checksum: sha1:34c9a481c4b806824c3929c5f35b1ba39345fa5c + pristine_git_object: 53d4e1667b1b67f6c7ba979bfb032387095cf81b src/glean/api_client/client_shortcuts.py: id: 5ef5dacbcba9 last_write_checksum: sha1:94f35f0be652742f2f6d6912df01e133ec1247e2 pristine_git_object: 4241e6176c34be8bc4b51a7ac8719866777c2920 - src/glean/api_client/client_tools.py: - id: df600583b558 - last_write_checksum: sha1:14da983c729685966b1854148fa3e0b034dabf1f - pristine_git_object: 143bb03729a126e0cd628a32aaf3e93d0bca9b95 src/glean/api_client/client_verification.py: id: 211199afa506 last_write_checksum: sha1:c0b76b8f9f6bd3051c0396b0dc080f5ed41fd890 @@ -3110,20 +3199,16 @@ trackedFiles: pristine_git_object: 1e933c1c94bc93d31cd2dd343984abf821287d7d src/glean/api_client/data.py: id: 21cf13413429 - last_write_checksum: sha1:f03b31e07a912efca080d9298fbb45e16590702c - pristine_git_object: 756e122c3e258805290344aa6d978b351bcbfbf5 - src/glean/api_client/datasources.py: - id: 22aad0060f38 - last_write_checksum: sha1:8da37cf91ce0d7f3868e5053c2486cf242acb4f6 - pristine_git_object: eb6593e336958b28b02b47165ab970ba5ad414d5 + last_write_checksum: sha1:e0f862b1128436220cc79ad37d977ee83c92a261 + pristine_git_object: 1187e013fddc68f46bf0601237a4d8d6ba878e41 src/glean/api_client/entities.py: id: 38ebbab2f8a0 - last_write_checksum: sha1:63222ae61584458ecde514054fdf1f1daaffc610 - pristine_git_object: dbf83344af4627c1dc89f2bb47f9d16961005a1a + last_write_checksum: sha1:1989da79fa5ffe440188a6fc3138324369f4000f + pristine_git_object: f90b9ae8d55a5bd44aab1e05c49bb66423523cb4 src/glean/api_client/errors/__init__.py: id: 88bbd5450191 - last_write_checksum: sha1:d5663156287bccab87e321f0a3b9b1ae802adaa9 - pristine_git_object: 2a3a78db7ee32645930973d16d09fa5aa4fc1806 + last_write_checksum: sha1:14e809dc56f3433b9234d42efe82ade97f2b59de + pristine_git_object: 56e241a90910d510b0f3e6723840d5b27af43f2d src/glean/api_client/errors/collectionerror.py: id: c0932ce3ae9f last_write_checksum: sha1:0b5f08e5372726fe70cd721719c386d0e21d0dcc @@ -3152,14 +3237,22 @@ trackedFiles: id: 3983f72729a9 last_write_checksum: sha1:7f326424a7d5ae1bcd5c89a0d6b3dbda9138942f pristine_git_object: 1deab64bc43e1e65bf3c412d326a4032ce342366 + src/glean/api_client/errors/platformproblemdetail_error.py: + id: 63827377850c + last_write_checksum: sha1:20529aaf172850e5451660610daf7a7ee92e82ee + pristine_git_object: 2bd60f32a150ba565402966f54d93e2929a1f153 src/glean/api_client/errors/responsevalidationerror.py: id: 70cd17f93ab7 last_write_checksum: sha1:56b679b1845b634fad48074398e87e164af0fd70 pristine_git_object: 3e029c12197bb87be06e01323afbc495968a6eaa + src/glean/api_client/findings.py: + id: 50243a1bf5e8 + last_write_checksum: sha1:7a092ae43055ff81b49ec86df36d5b8e11b7c618 + pristine_git_object: 6dce13bd4ec8a708b2c7a701344b9772b95cdb5a src/glean/api_client/governance.py: id: e30db8f06e58 - last_write_checksum: sha1:7ecff241705dbef3556dca3e783c68aad8de5550 - pristine_git_object: c8e2256e46864adda67f2b56e0c919aaee57b663 + last_write_checksum: sha1:5c9a2e9b1d899493281974b9e9c70637d224572c + pristine_git_object: 0917cce6722a17c7e45c47e2080ede37da7d37e9 src/glean/api_client/governance_documents.py: id: e5ab033181fd last_write_checksum: sha1:761beada29ea72f570c55e6377706671d3b8fcbd @@ -3186,8 +3279,8 @@ trackedFiles: pristine_git_object: 7438ab955cb052b205dc8415af7731cbaa5edd08 src/glean/api_client/indexing_documents.py: id: b5c2b64ee1fa - last_write_checksum: sha1:937d9b20cd7285b05eb717e330a2abcb597e2c78 - pristine_git_object: 8677ab51b27fb7c291a12d1bfb72cb3aa8ab4eb6 + last_write_checksum: sha1:a65d60eba819c2ffc4b3661479c0dd493df55358 + pristine_git_object: e296949fcd94f3e8d538b44b4557ebcefe953f3d src/glean/api_client/indexing_permissions.py: id: 86fd3f14396c last_write_checksum: sha1:1562435993344c7a69c49e3beb36634486f2f2c7 @@ -3206,8 +3299,8 @@ trackedFiles: pristine_git_object: 77016bfff6209866592fd8b42f2f3527f900992b src/glean/api_client/models/__init__.py: id: d5f6ea5efcbe - last_write_checksum: sha1:879cdb855fcd2f4219941ba570a69e46f127216e - pristine_git_object: 6292b5752f5b13f8c222147c83c259909213de12 + last_write_checksum: sha1:d487b121fba5e00278c93d324fa64f332265304b + pristine_git_object: 4338fc863abbfe9d877962e4e3bdb619b30505c9 src/glean/api_client/models/actionauthtype.py: id: c7402f35092d last_write_checksum: sha1:7aaa5d1c11b105d0d7265e2a83cb005aafa89645 @@ -4824,6 +4917,114 @@ trackedFiles: id: 5b14b683421a last_write_checksum: sha1:73484002a7a37df4baaf05fd282bf904acf54cc9 pristine_git_object: 1e291af2ba4ec81b33d9b03faad6cb8365c8ab55 + src/glean/api_client/models/platform_agents_create_runop.py: + id: f17d1b61b15b + last_write_checksum: sha1:6792547db343d9d6f264962866cadb1ae3338d52 + pristine_git_object: e99e8d10f23df59ac1a044369784acf521c747ab + src/glean/api_client/models/platform_agents_get_schemasop.py: + id: 54795e674f69 + last_write_checksum: sha1:2179f25a466baab76de315e6e736876ba97b60f1 + pristine_git_object: dbe9a0361971bfec84cba04e3c44ba7e72cd1a22 + src/glean/api_client/models/platform_agents_getop.py: + id: 606568a4c8fc + last_write_checksum: sha1:58370e345df87a242670e2cfdb26800caa6a00ce + pristine_git_object: 880c65c1e74dd49543d650516f29141c6cdd486d + src/glean/api_client/models/platformactionsummary.py: + id: 00069b22d246 + last_write_checksum: sha1:f714e076c3e0c86ded17dd732ba304dfc7d5526e + pristine_git_object: 66c767a0e78c47a85c72fbf6ee8b13d2183cefdb + src/glean/api_client/models/platformagent.py: + id: edd82e5a258f + last_write_checksum: sha1:328c481368021207acf8a57a2193415e2afd4f9c + pristine_git_object: 84a399b6340586d32288c770d5a586668c16f9b5 + src/glean/api_client/models/platformagentcapabilities.py: + id: 16d4984052e6 + last_write_checksum: sha1:69717c61750d0ce8bbc07832053a06b59f17eab9 + pristine_git_object: 099c35b707245056fc4fff0b297dc8c8c894318c + src/glean/api_client/models/platformagentexecutionstatus.py: + id: 2c3e0bdc97dd + last_write_checksum: sha1:26f14b0b81c18b0aaca73f4ac27c6fcc657d90a6 + pristine_git_object: cab8cafce2525a2626220db78c8f023a36c98df5 + src/glean/api_client/models/platformagentgetresponse.py: + id: de08c9cd1f7e + last_write_checksum: sha1:4b5e5e9fd0a8016e12954e78c56db177af5ab002 + pristine_git_object: dff409304169026967f63b216afa4cad4e72d215 + src/glean/api_client/models/platformagentrun.py: + id: 6a27f28ec4bf + last_write_checksum: sha1:04e126eefa9aa91ff20eae6156e1737fb9210774 + pristine_git_object: 26bf40035054db162a6577ff5ca9354a56bcea84 + src/glean/api_client/models/platformagentruncreaterequest.py: + id: fc8dc50abaee + last_write_checksum: sha1:3b693d6de688989dd8039d22220f21ddb277b809 + pristine_git_object: 8d669029c5a70527554b398446c7ebf444ec3258 + src/glean/api_client/models/platformagentrunwaitresponse.py: + id: 3498df9c1961 + last_write_checksum: sha1:3f8f7707d02ded94a0021b99c00e3df4223b772b + pristine_git_object: f2454eb001143fcfd5e47276ec7f9a5d7211a411 + src/glean/api_client/models/platformagentschemasresponse.py: + id: bc725034e9b9 + last_write_checksum: sha1:2f5f83536b604f36b3042b59725615a03432ef5e + pristine_git_object: 9bd08605cf43b2414f8ddd0f6cb444cf1c72df8a + src/glean/api_client/models/platformagentssearchrequest.py: + id: eb40369d333e + last_write_checksum: sha1:e3995ce3be21d708199fe323356e2d9a1d8ad716 + pristine_git_object: 0ddc45d29a02c82a54f12ef6ceec8f19761c36c7 + src/glean/api_client/models/platformagentssearchresponse.py: + id: 2c3bddef7679 + last_write_checksum: sha1:23dd758cffab6db76a051eb029776a64613a38f6 + pristine_git_object: c9f820b8a8edc25853156cf3f9a6c0b43feb1865 + src/glean/api_client/models/platformcontenttype.py: + id: 87e6bc168e08 + last_write_checksum: sha1:97548628abf68b0b2727ba126ce363000e8d2882 + pristine_git_object: c327d0ce5243c8fce910468c09d681a8d254ae1a + src/glean/api_client/models/platformfilter.py: + id: e0719ea40cc5 + last_write_checksum: sha1:cdedb8731ce215c98444464e4e852b60e519e669 + pristine_git_object: 40c1e357d26b23063b2d1d71062c5c67eb12a330 + src/glean/api_client/models/platformfilteroperator.py: + id: f7d7bf136596 + last_write_checksum: sha1:843173c8116781c6b5eba46db3896f3cd55126ce + pristine_git_object: 1ac40ef8de6ff847c54ade940beb6ea97704999c + src/glean/api_client/models/platformmessage.py: + id: 5124dae40c5d + last_write_checksum: sha1:e86beb4e210ed500ab72011ef90bb97b909a39e8 + pristine_git_object: 7be2c4dcb18341cfe572b18ff9f78655fb7064db + src/glean/api_client/models/platformmessagerole.py: + id: 23b3de16c716 + last_write_checksum: sha1:1c40eefcf4055e49b037d066fb1f2c9daf9afe84 + pristine_git_object: 9d7939bdf32bd515ba72c0271a3c89ece1dcb429 + src/glean/api_client/models/platformmessagetextblock.py: + id: e631f7c5ce6b + last_write_checksum: sha1:fd5a2100de1d3c81a1b455d417995da5cacdd606 + pristine_git_object: 35266bb62875116cdc79897dcf1ebb7ab600d2fe + src/glean/api_client/models/platformpersonreference.py: + id: 2ff9ab749423 + last_write_checksum: sha1:a366e67090ccf5a9754576467db2043a33e8a8e2 + pristine_git_object: 3f68797935412add6a9cbe28335641064352c8c5 + src/glean/api_client/models/platformproblemdetailcode.py: + id: 3aa0b8193255 + last_write_checksum: sha1:8817c3143bb4371517c87a04c1066f42594ecc66 + pristine_git_object: fab2cc2399bb11e6e80ae819e138a94912cff1d0 + src/glean/api_client/models/platformproblemdetailerror.py: + id: ea67cf68f170 + last_write_checksum: sha1:c2f31d78abfaf8e63bd7ab62ff9e0fb281caa5a6 + pristine_git_object: 336efdc33bfb762c3b0ddfc706b8d089da3cc23f + src/glean/api_client/models/platformresult.py: + id: 65de4ed5c1b3 + last_write_checksum: sha1:d4635567744c3c488806d4a1ba5235d2d9e6ca40 + pristine_git_object: 08c36e88c8f88d7b63173530501d35326bd32de1 + src/glean/api_client/models/platformsearchrequest.py: + id: f2376466383f + last_write_checksum: sha1:30d48da0462fead00d34a7ad3cb5687b4fbeb8ba + pristine_git_object: 8f37fa7d2d319a465a977c83718f6e7e10fab908 + src/glean/api_client/models/platformsearchresponse.py: + id: 7ee9ec06e00c + last_write_checksum: sha1:9ed8c951be31629e50f797c8e4bd59a1ef494eef + pristine_git_object: d98c78d622564a3fc35ed6d5d543866f64f76704 + src/glean/api_client/models/platformtimerange.py: + id: bf2b03e84949 + last_write_checksum: sha1:645217a3827cd2a7455b88277f1ba2dcd4a5daf1 + pristine_git_object: 0a5acb2a9110e33b96db4e36aa09c1bf36ab1cbf src/glean/api_client/models/possiblevalue.py: id: 6046129b9c7d last_write_checksum: sha1:4495a1288f312de877f9bcaa547f35178119ca59 @@ -5422,24 +5623,20 @@ trackedFiles: pristine_git_object: 3a4c3e6eee14c25616dbc8cbec206d9a74070d80 src/glean/api_client/sdk.py: id: e2de37b3ce92 - last_write_checksum: sha1:c65cc4e430c4ae9413a32c5feabd21b4bd54bc78 - pristine_git_object: 7f06495060eff52aa801307514beaad5fbc2bf38 + last_write_checksum: sha1:8e7c616048b12e24e0da6ec1e3933858e03cd3d3 + pristine_git_object: 4d65c6df343753745eeb3cc070b7b6d86bbed5d2 src/glean/api_client/sdkconfiguration.py: id: f356ce00b5b7 last_write_checksum: sha1:1ae43e08ae57ae277b3ab5e66b52d020149ebe00 pristine_git_object: 22e0a4eab0ef8e54dcfd986084d01c14a56f47a6 src/glean/api_client/search.py: id: a3b404a8b402 - last_write_checksum: sha1:74ed1a856099831956bf54882af433fd5a3efb43 - pristine_git_object: b48e621203e5be34d8b08de1eddbda5f6f1055aa + last_write_checksum: sha1:2189c3157ef96864f00744bc97d8d2fede5a4ecb + pristine_git_object: d1279cafad228ac0d4dd51c8ad9de668c75c9cff src/glean/api_client/tools.py: id: 3ea40147c1cc - last_write_checksum: sha1:8087146ca0ec7a234cb61e4b2c93dc5aee37bc22 - pristine_git_object: 9ac9f2a06dd4f6c72545f646e91f1a8a6580c168 - src/glean/api_client/troubleshooting.py: - id: 39ea2644e031 - last_write_checksum: sha1:c5742accacc43b0ed900fa4f157c132f94434754 - pristine_git_object: a713f2abb347828b7b0e8b992e37cab3f00fb4f6 + last_write_checksum: sha1:8d802229c822e4945e5de8198a137588ae4b363a + pristine_git_object: 7751bb5027c3a9003cd12dfd35569ef652e32e75 src/glean/api_client/types/__init__.py: id: f63c790831ee last_write_checksum: sha1:f9ad14217f832e74f594285960125add50324be9 @@ -5590,8 +5787,8 @@ trackedFiles: pristine_git_object: 929558ef2e1165f7e09da6d0a64f016c90971655 tests/mockserver/internal/handler/generated_handlers.go: id: 61ac4f7cce9e - last_write_checksum: sha1:c68c837c6af8f55eb8172dbc62ba472d5dde04a8 - pristine_git_object: a8a0a7558361f126dcbf7f995c52b33e660daa37 + last_write_checksum: sha1:6496589b844c61d821b877b856e26635ffaad66d + pristine_git_object: 67af751e8eacdf3eda5028f67e51509df4315c20 tests/mockserver/internal/handler/pathdeleterestapiindexcustommetadataschemagroupname.go: id: 979e4583765b last_write_checksum: sha1:b1d4edb259d907c7a88b634bf16f0cf152321693 @@ -5600,6 +5797,14 @@ trackedFiles: id: 502db61f4b70 last_write_checksum: sha1:4ac03fda8cf26645eda1638b75f8c187ae7cf500 pristine_git_object: ff7097f855b75a46f88c437dfba247c1a1c17e52 + tests/mockserver/internal/handler/pathgetapiagentsagentid.go: + id: 118e0c46ba00 + last_write_checksum: sha1:8ad0cc0ad413e34c3d950ee07ccd13ce861a261b + pristine_git_object: 821cdaf9e7e105e44baf2fb6c2352df5c5bd20f7 + tests/mockserver/internal/handler/pathgetapiagentsagentidschemas.go: + id: a3a921765081 + last_write_checksum: sha1:41dfbc3d70153e24cc2a898336d7d2a9c6e3d3df + pristine_git_object: a9212f1d5de9d8b40e73ea4b410feb26921c35cb tests/mockserver/internal/handler/pathgetrestapiindexcustommetadataschemagroupname.go: id: a14a30d0e377 last_write_checksum: sha1:83a992c70c3b7d010928d89a52f70db1042dd186 @@ -5652,6 +5857,14 @@ trackedFiles: id: 24dd79d2c474 last_write_checksum: sha1:14d3e93a3f37b61145188a9e6544398fcfc200e4 pristine_git_object: 40105d8daeb4ec2dd77c36244a4db0e63b847ee1 + tests/mockserver/internal/handler/pathpostapiagentsagentidruns.go: + id: b038130eb997 + last_write_checksum: sha1:badf21e13cd2f0afdc5fd5f325c1a34de39d0107 + pristine_git_object: 93595d14fd8eaa0af01a52bc6ce2cbfccaa479fb + tests/mockserver/internal/handler/pathpostapiagentssearch.go: + id: 7e4a6cf9ab84 + last_write_checksum: sha1:e0dffbdb295b7d71a0c9b405839947fabb50b9d6 + pristine_git_object: da7d08b0de7af705b535b8c40d172a3db3ba05cf tests/mockserver/internal/handler/pathpostapiindexv1adddatasource.go: id: 549adf61c832 last_write_checksum: sha1:f1c92a8b8e4db16ee9334d7e28f8abec8c52d50e @@ -5752,6 +5965,10 @@ trackedFiles: id: 3a513f7feb0f last_write_checksum: sha1:30d3d3c8d634fa56d0510224f26e4538ba76dc89 pristine_git_object: 9bb5d5769dfb3a4e78676950e8a2706f119bfc5c + tests/mockserver/internal/handler/pathpostapisearch.go: + id: 53e6a34b5b4b + last_write_checksum: sha1:503df322e00b6cb1cb9cc80d7aa30d63c96df86f + pristine_git_object: 1575aab3ac4539db059de358acc56ecc7f90ff07 tests/mockserver/internal/handler/pathpostrestapiv1actionsactionpackactionpackidauth.go: id: 9aaa5b8c2f43 last_write_checksum: sha1:6e74488c94c9f19f95861e6b5940457c55078190 @@ -7380,6 +7597,102 @@ trackedFiles: id: bae26829f4cc last_write_checksum: sha1:b73fc92fa94ae8b4b090e9df2102b921e7634bd2 pristine_git_object: 7ef8d8e65bd75fe35f59d6858df07c1f970c991c + tests/mockserver/internal/sdk/models/components/platformactionsummary.go: + id: 696bcfeed832 + last_write_checksum: sha1:4284aa5cd97b0516fd7b19e9ffc69231a1dd61de + pristine_git_object: 5a56a4c8b3d833211df4fbd7864ec581310ed2e1 + tests/mockserver/internal/sdk/models/components/platformagent.go: + id: dcdd9a7bc9de + last_write_checksum: sha1:b55d4b147d41e3732e54372b8f1fc4c69a6a2426 + pristine_git_object: 79049da4483e06ef116e58df66ecff3551a849ab + tests/mockserver/internal/sdk/models/components/platformagentcapabilities.go: + id: 2807a52a8b1a + last_write_checksum: sha1:eed1084087dd93ae61c145598628546d819fe45b + pristine_git_object: 562c8682df3bb923ffa1cc3fdc86b8a9048b6e1f + tests/mockserver/internal/sdk/models/components/platformagentexecutionstatus.go: + id: c9db767e876c + last_write_checksum: sha1:c8f646aff8df619e61b6f55a22b8ca836e40ce9d + pristine_git_object: c8c2bfb9613140654f527aed41518769e10ff152 + tests/mockserver/internal/sdk/models/components/platformagentgetresponse.go: + id: 531e55c09141 + last_write_checksum: sha1:b36aba6678be9f8a1b18e6e901f1671dcdebd0a3 + pristine_git_object: 3df4f65db7b472cc1bb0fec6603e80830ddd938d + tests/mockserver/internal/sdk/models/components/platformagentrun.go: + id: d12a92c365e5 + last_write_checksum: sha1:c39a6b74fe9c30850bf5bedd6827577bf4b56566 + pristine_git_object: a3139f71ea2e70673649a36519c072d817d45969 + tests/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go: + id: 77a686bb0b6e + last_write_checksum: sha1:470b1f19968f3aea31ae965922ecfd8a659855fb + pristine_git_object: d653f4bc7ce64623cacfb1c1a48ba3451dbf0d12 + tests/mockserver/internal/sdk/models/components/platformagentrunwaitresponse.go: + id: 368b82c238d0 + last_write_checksum: sha1:77ffebf146f2f6f671f10a8ad893f672ee8c67a5 + pristine_git_object: b157f036a87b980e584e542010411e4ac69a36f2 + tests/mockserver/internal/sdk/models/components/platformagentschemasresponse.go: + id: 68274dd0a3df + last_write_checksum: sha1:a7e32651fe39006126fc80176910047ac84c9893 + pristine_git_object: 6f9aa5d088b6d5d8b6e3490b15ee4c0ad45749b1 + tests/mockserver/internal/sdk/models/components/platformagentssearchrequest.go: + id: 7eaeaea3b941 + last_write_checksum: sha1:7c1f9eb5a6433e664b9ce9e5dd111d3408ff910e + pristine_git_object: a74eaf650388df24696257f96f58ba715b82f5ab + tests/mockserver/internal/sdk/models/components/platformagentssearchresponse.go: + id: f299b36c97da + last_write_checksum: sha1:2e0f29320158b7f1b204af2adbc462bdefa34c1f + pristine_git_object: ba08e943e4a74ac111304125d6085f642a522085 + tests/mockserver/internal/sdk/models/components/platformcontenttype.go: + id: d1a02baa3621 + last_write_checksum: sha1:b552f26421544664b54a4423c8335c90b09480c6 + pristine_git_object: e96a7c7850d7a0c456dd61d706232dd7c06cd0db + tests/mockserver/internal/sdk/models/components/platformfilter.go: + id: 1762bf95c464 + last_write_checksum: sha1:4dc71d2576cddd00f93dfda6c2f584f9bff9ebcb + pristine_git_object: b8a9ea1a0663c345fd2a4bc04f3343c17409b868 + tests/mockserver/internal/sdk/models/components/platformfilteroperator.go: + id: 7daac12f5ae7 + last_write_checksum: sha1:49fd1240cf9eb9d2259465f79e0c481d711ec37d + pristine_git_object: 7515a2832f306164806fae459e9a995d37b70b78 + tests/mockserver/internal/sdk/models/components/platformmessage.go: + id: 5eb3e8c3fd80 + last_write_checksum: sha1:3051abc1ef3e40cd0385bd9846c987d3ebfbcbbf + pristine_git_object: c8062f03d7a576e59acdca705b62c2be08cd9770 + tests/mockserver/internal/sdk/models/components/platformmessagerole.go: + id: 09fd90afdd78 + last_write_checksum: sha1:9249342777230262261267ff0a32ba1b4248db5d + pristine_git_object: bece7dac13fb6fe5bad631a67b835abf18833015 + tests/mockserver/internal/sdk/models/components/platformmessagetextblock.go: + id: de473d461198 + last_write_checksum: sha1:a36d13b1d29fb55a08134ebf88f3971079b14fbb + pristine_git_object: 0432f13a4feb9922a9d36f79a6f83c78224f9a27 + tests/mockserver/internal/sdk/models/components/platformpersonreference.go: + id: ebc5c183c98b + last_write_checksum: sha1:91afcf6171cafdd18d638818711fe0f3a0ba1021 + pristine_git_object: dca6a6f855816c3598a9a1fa69c72f131eefa1c6 + tests/mockserver/internal/sdk/models/components/platformproblemdetailcode.go: + id: bc7ce56d1a6c + last_write_checksum: sha1:8329a6b865a18ed1a1613a60ddea98a308d33652 + pristine_git_object: cc0f716239c9ff676b430b3f2a5d37b275c7e09b + tests/mockserver/internal/sdk/models/components/platformproblemdetailerror.go: + id: 045ae4dc7a98 + last_write_checksum: sha1:4d135d9e4dc5967a64bab866df79f2fd689caae5 + pristine_git_object: 058f5e62bda5173fed3b24fff078d7540a1378f7 + tests/mockserver/internal/sdk/models/components/platformresult.go: + id: dd777258615b + last_write_checksum: sha1:d3e76064cc9fa1c7431e3ecb6bb07b47b08a08c7 + pristine_git_object: 441ea968bfe1ee6d8c9eecac245f9ad48621f02c + tests/mockserver/internal/sdk/models/components/platformsearchrequest.go: + id: 4da7625f1c35 + last_write_checksum: sha1:33a8686e5aa62e2e090685ba89dae0bd0d4af5b9 + pristine_git_object: 108bab415b41d89047fba91239b362d2abba960d + tests/mockserver/internal/sdk/models/components/platformsearchresponse.go: + id: a58f32052764 + last_write_checksum: sha1:6db9bd73c6fd7cc1c8bf28c2b1ee96cc77d7236a + pristine_git_object: e8243de2c4e8582ed42736e75e4aa715a6a376bc + tests/mockserver/internal/sdk/models/components/platformtimerange.go: + id: cf2540151ce1 + last_write_checksum: sha1:3a0ec2ca473681b89ff97606f648fc15fcdae38e + pristine_git_object: b88a152d5940b3e49fb73807c476607374d9d01e tests/mockserver/internal/sdk/models/components/possiblevalue.go: id: bf71542de5f4 last_write_checksum: sha1:5c25db519b896499621e67c6245893d26afa30e4 @@ -8188,6 +8501,26 @@ trackedFiles: id: b553eb9bdb35 last_write_checksum: sha1:5248f738207e7e99637a538c31c57d93394a588c pristine_git_object: d6f74b3f76e41314e5e33934c50f5bd0bda958de + tests/mockserver/internal/sdk/models/operations/platformagentscreaterun.go: + id: eb220c44e3e3 + last_write_checksum: sha1:4f2318a6152e1b1d3e4ddf1654202580c600cadc + pristine_git_object: a677b6c1a99819e1ff2ed687039a833c3bc1bead + tests/mockserver/internal/sdk/models/operations/platformagentsget.go: + id: e74910e78a17 + last_write_checksum: sha1:56851bbd3fbefcf411fff643accc8124be24b7d2 + pristine_git_object: 9b2282ad03704136d35901a9d908e7f554310534 + tests/mockserver/internal/sdk/models/operations/platformagentsgetschemas.go: + id: bf409518e189 + last_write_checksum: sha1:767ce5c40fc319d756445283490a4a043213ef84 + pristine_git_object: 117158eff717169b07505ddd717d92c04b45f66c + tests/mockserver/internal/sdk/models/operations/platformagentssearch.go: + id: 1bfa86240c50 + last_write_checksum: sha1:3851c6668a7c007efe9ff4ccbd038cb5d2429713 + pristine_git_object: cdbc9f550e7d2339b0946fe4783a3b79a851f39d + tests/mockserver/internal/sdk/models/operations/platformsearch.go: + id: d990791ac101 + last_write_checksum: sha1:995d47533ef63c7518c50398593671059d6ccc07 + pristine_git_object: 16b6e86fe62e1e0ec43293439e9fba7995a72a80 tests/mockserver/internal/sdk/models/operations/postapiindexv1adddatasource.go: id: 85e7185113c5 last_write_checksum: sha1:2f82dc427027cdb45f8fcf8fa6454e28599233aa @@ -8420,6 +8753,10 @@ trackedFiles: id: 6162be7fca7f last_write_checksum: sha1:ee697c8e2807f2b86c3de73bcbc013bbaf4ee2e9 pristine_git_object: 05af2574a03e26abac55345798ac1e965376ecd4 + tests/mockserver/internal/sdk/models/sdkerrors/platformproblemdetailerror.go: + id: cdcf3c6fd1e3 + last_write_checksum: sha1:277bd1fcc00faa488f46f2bd2f40cf4360c3fa7c + pristine_git_object: 2910d0bd964e88e265060c18c4e99a1f5f45dc62 tests/mockserver/internal/sdk/optionalnullable/optionalnullable.go: id: 49a8c2638f49 last_write_checksum: sha1:aa5ff815f31a3657487ad5e0c3f023f573b1fcab @@ -8510,8 +8847,8 @@ trackedFiles: pristine_git_object: db4221c9f5953adc8f8219979060f1248ae5c342 tests/test_agents.py: id: 2eb70a860f3a - last_write_checksum: sha1:18a474b39a964820ec42a6d5552ab7961871d286 - pristine_git_object: 46852ff43f1fdbc1c65619cccb7a22f51509104b + last_write_checksum: sha1:6e1b73ba0d82b9ea9bfa33819b2293f35d344dae + pristine_git_object: 8b75a0e000414b7fb57a82ac2523251ca40fc12e tests/test_announcements.py: id: 720cc07fca06 last_write_checksum: sha1:1d0dcab6446633bc6809bc67e14b6cc1755aa319 @@ -8520,18 +8857,10 @@ trackedFiles: id: 2a6f19947b0a last_write_checksum: sha1:5d35f3a66ce3b29bbeae63214bdb11dce23e30de pristine_git_object: 3b4390d4615a656819f3457afdffb823aac56cab - tests/test_authentication.py: - id: dc4a998a8261 - last_write_checksum: sha1:ce73311cbee01b7b6612a34c45daeb477eaf8e27 - pristine_git_object: 438848aa8e7cfbb61811d4b65a16af10b0a2e97e tests/test_calendar.py: id: 255e2a2c77ee last_write_checksum: sha1:933ca9c7da1cfab204f0acc1005c29118b08162a pristine_git_object: d2b02f269ac418b9a9240772f28ab1bd3cfa4997 - tests/test_chat_sdk.py: - id: d6e6d5c5a1b2 - last_write_checksum: sha1:ac54eafad3be7b69b51f8b1c2ef8d13235fe517b - pristine_git_object: f82975aab21af768fe9b39b6b85e0ec816d4a688 tests/test_client.py: id: 6b61d4b06ccc last_write_checksum: sha1:df970d19cdb9f9e057722699dc73965b6f9b1758 @@ -8540,14 +8869,22 @@ trackedFiles: id: 3754879096ea last_write_checksum: sha1:657e6ccc2cc0d4b92b3feb1681d39796fa0e5889 pristine_git_object: 200e3ceebf0fb52248b717e6cb20b105611c41ec + tests/test_client_agents.py: + id: 5ac5a5b220c8 + last_write_checksum: sha1:f73280ce1b3f1d67f05346912cc0d1ced2381ee8 + pristine_git_object: 93354a8429a52463d2e65822a45300f424ccf61d tests/test_client_authentication.py: id: 7cf5a14528ec - last_write_checksum: sha1:0f967704460d2f4160f4afbfcb864a8524b83106 - pristine_git_object: 1ea7ec892d316489240c82ed6e3b5b99f8d657fd + last_write_checksum: sha1:3ac1ca0753590620676a8bcc6a06e2aa6375ab71 + pristine_git_object: 8e770a8520907d0cdba6928e7e6681b9de6de880 tests/test_client_chat.py: id: 6eb71db2a62a - last_write_checksum: sha1:9826e7ec5c3a757af9dfe000f879f5a105aa1939 - pristine_git_object: 6be5e6a77a5918ec1c069bd0b89b76c08ad7dfad + last_write_checksum: sha1:2db740c4c12b792ff04b44159fb379893f124bb1 + pristine_git_object: e6df2edf75407c06b0433d8d1fb5231ea785c83c + tests/test_client_datasources.py: + id: 451a8b0f5e13 + last_write_checksum: sha1:f0fe510f036c9a717a255344c005eea66420ce3c + pristine_git_object: c931870814144f8c83ebf567759ee1ceb0d1331d tests/test_client_documents.py: id: e41c035a85b3 last_write_checksum: sha1:d29128c0414195ef128ee8a28f192332ebccd46f @@ -8574,20 +8911,20 @@ trackedFiles: pristine_git_object: bf13266784d196fcb7420c35655f5e8c63a433ff tests/test_datasources.py: id: 0a9c5268286f - last_write_checksum: sha1:702248b4aa6fec68310d64b779af389bb98db4a2 - pristine_git_object: b36dd4080937a774fab1a14daf628e73b2e6d9df + last_write_checksum: sha1:a762f2d7867ba2516772bc38f230660fd4f4c847 + pristine_git_object: 8aaeb530d87bce0eeaf8c1ee7b55d04b4871bde6 tests/test_displayablelists.py: id: aa656a7efeb2 last_write_checksum: sha1:ad6e518e489b98d4f21c7e0ebab2f085f49be421 pristine_git_object: acec822d761f40906a287eee92200d1223caec4d tests/test_entities.py: id: 9bdc6c717c71 - last_write_checksum: sha1:4887a1e7145a50e9fe1277fee1ecda181831c7ac - pristine_git_object: c6b986f4f1a1e6202a012ebb349a3af76c9c4f05 - tests/test_governance.py: - id: d9680b75ffff - last_write_checksum: sha1:c1eb83dbb3867d3c43fd55377c05039853af49e5 - pristine_git_object: 16b5840bb501d1ad7753aaf846630c0a34bdc119 + last_write_checksum: sha1:18e7cd0747cfa504295b4fa7faa303379c6df060 + pristine_git_object: 6479bed7014476c3cb9dd326e5f6d5164a7ef4b5 + tests/test_findings.py: + id: f4c91dfb4975 + last_write_checksum: sha1:8c377b73f379ee056474bdc6a19e3d7d5d323ef4 + pristine_git_object: bc9f6357001f21bb93f48c0d74b72219b0819fe2 tests/test_indexing_authentication.py: id: 466ee13c3372 last_write_checksum: sha1:c96c8f13a7cca3cade8ca389857541596ee01fc5 @@ -8606,8 +8943,8 @@ trackedFiles: pristine_git_object: 6cc8aeec3c52329d389081db0a27f10f53f214b9 tests/test_messages.py: id: be23089b1f8b - last_write_checksum: sha1:a91c985cd1d11560059dc448b10e0c7b75ed60e5 - pristine_git_object: dfdc18641f0d6c38d84b4603ad2da71f75f2e13c + last_write_checksum: sha1:bef200db8e7fff0aa33ef17846f5054a2d035a88 + pristine_git_object: 36643db35a2d2a3cf9d327379ee7a6cb30da51d0 tests/test_people.py: id: 37c243940039 last_write_checksum: sha1:7c7268ffeebe48d81ed25e9b1cfc3a395abf5c1f @@ -8626,16 +8963,16 @@ trackedFiles: pristine_git_object: 3fa82f944c8693f534f71d96c489225c3f65cb5d tests/test_search.py: id: dd86606b335f - last_write_checksum: sha1:313c3950c21ccf57f4569a4ca9eeeaefc8e7af91 - pristine_git_object: df2944ebda36db652b2770dd1c23be83df90fc99 + last_write_checksum: sha1:b6af23349a18b4e0ef1795c729fc04560060ee76 + pristine_git_object: e8c5284c48f176453cea23043502af55cac7df1a tests/test_summarize.py: id: a255d8a6f627 - last_write_checksum: sha1:884caf9e9ba6ac6d6577682c45419d3fd6312dd9 - pristine_git_object: df71d57de672c7e6967ba36b3671d957ef075d55 + last_write_checksum: sha1:9b6bed0e9e9963542cfa0f6b4eedd1f9d76c7b81 + pristine_git_object: a3e490874f72bc8173895d2fd87831462b5f2573 tests/test_tools.py: id: 70889bdf7321 - last_write_checksum: sha1:293cea8c046c30086e5d57cb48aa59ab8da308f1 - pristine_git_object: e9c3dac5f1aa45a5cd9f20f7664be5133f486765 + last_write_checksum: sha1:3dbc1795fdf4aa1c013a9684535e7e46bd4cd031 + pristine_git_object: 6dfee17cd10500fded4803aaf37d812a63c74beb tests/test_troubleshooting.py: id: 784c409f631e last_write_checksum: sha1:5af30befb8fffd54210e313bf98c24a64a685c50 @@ -9559,6 +9896,69 @@ examples: responses: "200": application/json: {"workflow": {"author": {"name": "George Clooney", "obfuscatedId": "abc123"}, "lastDraftSavedBy": {"name": "George Clooney", "obfuscatedId": "abc123"}, "lastUpdatedBy": {"name": "George Clooney", "obfuscatedId": "abc123"}}} + platform-agents-search: + speakeasy-default-platform-agents-search: + requestBody: + application/json: {"name": "HR Policy Agent"} + responses: + "200": + application/json: {"agents": [], "request_id": ""} + "400": + application/problem+json: {"type": "https://developer.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developer.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developer.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developer.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-agents-get: + speakeasy-default-platform-agents-get: + parameters: + path: + agent_id: "" + responses: + "200": + application/json: {"agent": {"agent_id": "mho4lwzylcozgoc2", "name": "HR Policy Agent", "capabilities": {}}, "request_id": ""} + "400": + application/problem+json: {"type": "https://developer.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developer.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developer.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developer.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-agents-get-schemas: + speakeasy-default-platform-agents-get-schemas: + parameters: + path: + agent_id: "" + query: + include_tools: false + responses: + "200": + application/json: {"agent_id": "", "input_schema": {}, "output_schema": {"key": "", "key1": "", "key2": ""}, "request_id": ""} + "400": + application/problem+json: {"type": "https://developer.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developer.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developer.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developer.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-agents-create-run: + speakeasy-default-platform-agents-create-run: + parameters: + path: + agent_id: "" + requestBody: + application/json: {"messages": [{"role": "USER", "content": []}], "stream": false} + responses: + "200": + application/json: {"run": {"agent_id": "", "messages": [{"role": "USER", "content": []}], "status": "error"}, "messages": [{"role": "USER", "content": []}], "request_id": ""} + text/event-stream: "" + "400": + application/problem+json: {"type": "https://developer.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developer.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developer.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developer.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-search: + speakeasy-default-platform-search: + requestBody: + application/json: {"query": "quarterly planning 2026", "page_size": 10, "datasources": ["confluence", "google_drive"], "datasource_instances": ["slack_acme", "slack_eu"], "filters": [{"field": "type", "values": ["spreadsheet", "presentation"]}]} + responses: + "200": + application/json: {"results": [], "has_more": false, "next_cursor": "", "request_id": ""} + "400": + application/problem+json: {"type": "https://developer.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developer.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developer.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developer.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} examplesVersion: 1.0.2 generatedTests: activity: "2025-04-28T22:05:12+01:00" @@ -9721,7 +10121,50 @@ generatedTests: getDatasourceCredentialStatus: "2026-06-05T03:54:47Z" rotateDatasourceCredentials: "2026-06-05T03:54:47Z" createAgent: "2026-06-29T04:02:25Z" -releaseNotes: "## Python SDK Changes:\n* `glean.client.chat.create()`: \n * `request.messages[].citations[].source_document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added**\n * `response` **Changed** (Breaking ⚠️)\n* `glean.client.pins.update()`: `response.attribution.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.announcements.update()`: \n * `request.body.structured_list[].document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added**\n * `response.body.structured_list[].document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.answers.create()`: \n * `request.data.added_roles[].group.type.enum(collection_audience)` **Added**\n * `response.added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.answers.update()`: \n * `request.added_roles[].group.type.enum(collection_audience)` **Added**\n * `response.added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.answers.retrieve()`: `response.answer_result.answer.added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.answers.list()`: `response.answer_results[].answer.added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.announcements.create()`: \n * `request.body.structured_list[].document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added**\n * `response.body.structured_list[].document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.chat.retrieve()`: `response.chat_result.chat.created_by.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.chat.list()`: `response.chat_results[].chat.created_by.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.chat.create_stream()`: \n * `request.messages[].citations[].source_document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.collections.add_items()`: `response.collection.added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.collections.create()`: \n * `request.added_roles[].group.type.enum(collection_audience)` **Added**\n * `response.union(class (0)).collection.added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.collections.delete_item()`: `response.collection.added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.collections.update()`: \n * `request.added_roles[].group.type.enum(collection_audience)` **Added**\n * `response.added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.collections.update_item()`: `response.collection.added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.collections.retrieve()`: `response.collection.added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.collections.list()`: `response.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.documents.retrieve()`: `response.documents.Map.union(Document).metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.documents.retrieve_by_facets()`: `response.documents[].metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.insights.retrieve()`: `response.glean_assist.activity_insights[].user.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.pins.retrieve()`: `response.pin.attribution.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.messages.retrieve()`: `response.search_response.results[].structured_results[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.agents.create_agent()`: **Added**\n* `glean.client.pins.list()`: `response.pins[].attribution.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.pins.create()`: `response.attribution.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.search.query_as_admin()`: \n * `request.source_document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added**\n * `response.results[].structured_results[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.search.autocomplete()`: `response.results[].document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.search.retrieve_feed()`: \n * `request.categories[].enum(card_stack_promo)` **Added**\n * `response.results[]` **Changed**\n* `glean.client.search.recommendations()`: \n * `request.source_document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added**\n * `response.results[].structured_results[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.search.query()`: \n * `request.source_document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added**\n * `response.results[].structured_results[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.entities.list()`: `response.results[].related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.entities.read_people()`: `response.results[].related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.shortcuts.create()`: \n * `request.data.added_roles[].group.type.enum(collection_audience)` **Added**\n * `response.shortcut.added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.shortcuts.retrieve()`: `response.shortcut.added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.shortcuts.list()`: `response.shortcuts[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.shortcuts.update()`: \n * `request.added_roles[].group.type.enum(collection_audience)` **Added**\n * `response.shortcut.added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.verification.add_reminder()`: `response.metadata.last_verifier.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.verification.list()`: `response.documents[].metadata.last_verifier.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.verification.verify()`: `response.metadata.last_verifier.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added**\n* `glean.client.governance.data.policies.retrieve()`: `response.report.config.allowlist_options.regexes` **Added**\n* `glean.client.governance.data.policies.update()`: \n * `request.config.allowlist_options.regexes` **Added**\n* `glean.client.governance.data.policies.list()`: `response.reports[].config.allowlist_options.regexes` **Added**\n* `glean.client.governance.data.policies.create()`: \n * `request.config.allowlist_options.regexes` **Added**\n * `response.report.config.allowlist_options.regexes` **Added**\n* `glean.client.governance.data.reports.create()`: \n * `request.config.allowlist_options.regexes` **Added**\n" + platform-agents-search: "2026-07-02T17:48:17Z" + platform-agents-get: "2026-07-02T17:48:17Z" + platform-agents-get-schemas: "2026-07-02T17:48:17Z" + platform-agents-create-run: "2026-07-02T17:48:17Z" + platform-search: "2026-07-02T17:48:17Z" +releaseNotes: | + ## Python SDK Changes: + * `glean.agents.search()`: **Added** + * `glean.agents.get()`: **Added** + * `glean.agents.get_schemas()`: **Added** + * `glean.agents.create_run()`: **Added** + * `glean.search.query()`: **Added** + * `glean.client.authentication.check_datasource_auth()`: **Added** + * `glean.client.chat.retrieve_file()`: **Added** + * `glean.client.agents.create()`: **Added** + * `glean.client.agents.update()`: **Added** + * `glean.client.entities.retrieve_person_photo()`: **Added** + * `glean.client.tools.retrieve_action_pack_auth_status()`: **Added** + * `glean.client.tools.authorize_action_pack()`: **Added** + * `glean.client.governance.data.findings.create()`: **Added** + * `glean.client.governance.data.findings.list()`: **Added** + * `glean.client.governance.data.findings.download()`: **Added** + * `glean.client.governance.data.findings.delete()`: **Added** + * `glean.client.datasources.retrieve_configuration()`: **Added** + * `glean.client.datasources.update_configuration()`: **Added** + * `glean.client.datasources.retrieve_credential_status()`: **Added** + * `glean.client.datasources.rotate_credentials()`: **Added** + * `glean.indexing.documents.debug_events()`: **Added** + * `glean.authentication.checkdatasourceauth()`: **Removed** (Breaking ⚠️) + * `glean.chat.get_chat_file()`: **Removed** (Breaking ⚠️) + * `glean.agents.create_agent()`: **Removed** (Breaking ⚠️) + * `glean.agents.edit_agent()`: **Removed** (Breaking ⚠️) + * `glean.entities.get_person_photo()`: **Removed** (Breaking ⚠️) + * `glean.tools.get_action_pack_auth_status()`: **Removed** (Breaking ⚠️) + * `glean.tools.authorize_action_pack()`: **Removed** (Breaking ⚠️) + * `glean.troubleshooting.post_/api/index/v1/debug/{datasource}/document/events()`: **Removed** (Breaking ⚠️) + * `glean.governance.createfindingsexport()`: **Removed** (Breaking ⚠️) + * `glean.governance.listfindingsexports()`: **Removed** (Breaking ⚠️) + * `glean.governance.downloadfindingsexport()`: **Removed** (Breaking ⚠️) + * `glean.governance.deletefindingsexport()`: **Removed** (Breaking ⚠️) + * `glean.datasources.get_datasource_instance_configuration()`: **Removed** (Breaking ⚠️) + * `glean.datasources.update_datasource_instance_configuration()`: **Removed** (Breaking ⚠️) + * `glean.datasources.get_datasource_credential_status()`: **Removed** (Breaking ⚠️) + * `glean.datasources.rotate_datasource_credentials()`: **Removed** (Breaking ⚠️) generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 29861fe3..e0ee43ea 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -34,7 +34,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true python: - version: 0.14.0 + version: 0.15.0 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index feaa39be..870a17e1 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -1,8 +1,9 @@ openapi: 3.0.0 info: - version: 0.9.0 + version: "0.9.0" title: Glean API - x-source-commit-sha: 52a3263df71e58b10c98865e6b4a6f9a29f293db + x-source-commit-sha: 750ec3e4db6f2877f191460b47bff807273c68d8 + x-open-api-commit-sha: 5130487252df59e5fe21a96c4e758609933045da 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. @@ -22,7 +23,6 @@ info: These API clients provide type-safe, idiomatic interfaces for working with Glean IndexingAPIs in your language of choice. x-logo: url: https://app.glean.com/images/glean-text2.svg - x-open-api-commit-sha: d3cdeccde1b5f13944a9e3958f651e8f61c667d6 x-speakeasy-name: 'Glean API' servers: - url: https://{instance}-be.glean.com @@ -31,20 +31,281 @@ servers: default: instance-name description: The instance name (typically the email domain without the TLD) that determines the deployment backend. paths: - /rest/api/v1/activity: + /api/agents/search: post: tags: - - Activity - summary: Report document activity - description: Report user activity that occurs on indexed documents such as viewing or editing. This signal improves search quality. - operationId: activity + - Agents + summary: Search agents + description: | + Search agents available to the authenticated user by agent name. + operationId: platform-agents-search x-visibility: Public + x-glean-experimental: + id: 4abc1e17-8e06-490b-99a7-e8f97592405a + introduced: "2026-05-12" x-codegen-request-body-name: payload requestBody: + required: true content: application/json: schema: - $ref: "#/components/schemas/Activity" + $ref: "#/components/schemas/PlatformAgentsSearchRequest" + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentsSearchResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: agents + x-speakeasy-name-override: search + security: + - APIToken: [] + /api/agents/{agent_id}: + get: + tags: + - Agents + summary: Get agent + description: | + Retrieve details for an agent available to the authenticated user. + operationId: platform-agents-get + x-visibility: Public + x-glean-experimental: + id: 009b3e94-694b-4deb-b80a-c67011173715 + introduced: "2026-05-12" + parameters: + - in: path + name: agent_id + description: ID of the agent to retrieve. + required: true + schema: + type: string + minLength: 1 + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentGetResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: agents + x-speakeasy-name-override: get + security: + - APIToken: [] + /api/agents/{agent_id}/schemas: + get: + tags: + - Agents + summary: Get agent schemas + description: | + Retrieve an agent's input and output JSON schemas. + operationId: platform-agents-get-schemas + x-visibility: Public + x-glean-experimental: + id: b40b4dd3-3839-48e6-9e45-7e63e8148b49 + introduced: "2026-05-12" + parameters: + - in: path + name: agent_id + description: ID of the agent whose schemas should be retrieved. + required: true + schema: + type: string + minLength: 1 + - in: query + name: include_tools + description: Whether to include tool metadata in the response. + required: false + schema: + type: boolean + default: false + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentSchemasResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: agents + x-speakeasy-name-override: getSchemas + security: + - APIToken: [] + /api/agents/{agent_id}/runs: + post: + tags: + - Agents + summary: Create agent run + description: | + Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. + operationId: platform-agents-create-run + x-visibility: Public + x-glean-experimental: + id: 26bba669-2e92-4e5d-9798-6a532fae4e9f + introduced: "2026-05-12" + x-codegen-request-body-name: payload + parameters: + - in: path + name: agent_id + description: ID of the agent to run. + required: true + schema: + type: string + minLength: 1 + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentRunCreateRequest" + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentRunWaitResponse" + text/event-stream: + schema: + type: string + description: Server-sent events emitted by the running agent. + example: | + id: 1 + event: message + data: {"messages":[{"role":"GLEAN_AI","content":[{"text":"Hello","type":"text"}]}]} + + id: 2 + event: message + data: {"messages":[{"role":"GLEAN_AI","content":[{"text":", I can help with HR policy questions.","type":"text"}]}]} + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "409": + $ref: "#/components/responses/PlatformConflict" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: agents + x-speakeasy-name-override: createRun + security: + - APIToken: [] + /api/search: + post: + tags: + - Search + summary: Search + description: | + Execute a search query and retrieve ranked results. This is the data retrieval variant of the search API and returns only results and pagination state. + operationId: platform-search + x-visibility: Public + x-glean-experimental: + id: 5ab612fc-ed50-4419-bec3-e5fe83934653 + introduced: "2026-04-08" + x-codegen-request-body-name: payload + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformSearchRequest" + responses: + "200": + description: Successful search. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformSearchResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: search + x-speakeasy-name-override: query + security: + - APIToken: [] + /rest/api/v1/activity: + post: + operationId: activity + summary: Report document activity + description: Report user activity that occurs on indexed documents such as viewing or editing. This signal improves search quality. + tags: + - Activity + security: + - APIToken: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Activity' required: true x-exportParamName: Activity responses: @@ -56,19 +317,19 @@ paths: description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: report x-speakeasy-group: client.activity /rest/api/v1/feedback: post: - tags: - - Activity + operationId: feedback summary: Report client activity description: Report events that happen to results within a Glean client UI, such as search result views and clicks. This signal improves search quality. - operationId: feedback - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Activity + security: + - APIToken: [] parameters: - name: feedback in: query @@ -80,7 +341,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Feedback" + $ref: '#/components/schemas/Feedback' x-exportParamName: Feedback responses: "200": @@ -91,26 +352,26 @@ paths: description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-group: client.activity /rest/api/v1/createannouncement: post: - tags: - - Announcements + operationId: createannouncement summary: Create Announcement description: Create a textual announcement visible to some set of users based on department and location. - operationId: createannouncement - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Announcements + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Announcement content content: application/json: schema: - $ref: "#/components/schemas/CreateAnnouncementRequest" - description: Announcement content + $ref: '#/components/schemas/CreateAnnouncementRequest' required: true x-exportParamName: Request responses: @@ -119,34 +380,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Announcement" + $ref: '#/components/schemas/Announcement' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: create x-speakeasy-group: client.announcements /rest/api/v1/deleteannouncement: post: - tags: - - Announcements + operationId: deleteannouncement summary: Delete Announcement description: Delete an existing user-generated announcement. - operationId: deleteannouncement - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Announcements + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Delete announcement request content: application/json: schema: - $ref: "#/components/schemas/DeleteAnnouncementRequest" - description: Delete announcement request + $ref: '#/components/schemas/DeleteAnnouncementRequest' required: true x-exportParamName: Request responses: @@ -158,27 +419,27 @@ paths: description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: delete x-speakeasy-group: client.announcements /rest/api/v1/updateannouncement: post: - tags: - - Announcements + operationId: updateannouncement summary: Update Announcement description: Update a textual announcement visible to some set of users based on department and location. - operationId: updateannouncement - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Announcements + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Announcement content. Id need to be specified for the announcement. content: application/json: schema: - $ref: "#/components/schemas/UpdateAnnouncementRequest" - description: Announcement content. Id need to be specified for the announcement. + $ref: '#/components/schemas/UpdateAnnouncementRequest' required: true x-exportParamName: Request responses: @@ -187,34 +448,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Announcement" + $ref: '#/components/schemas/Announcement' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: update x-speakeasy-group: client.announcements /rest/api/v1/createanswer: post: - tags: - - Answers + operationId: createanswer summary: Create Answer description: Create a user-generated Answer that contains a question and answer. - operationId: createanswer - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Answers + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: CreateAnswer request content: application/json: schema: - $ref: "#/components/schemas/CreateAnswerRequest" - description: CreateAnswer request + $ref: '#/components/schemas/CreateAnswerRequest' required: true x-exportParamName: Request responses: @@ -223,34 +484,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Answer" + $ref: '#/components/schemas/Answer' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: create x-speakeasy-group: client.answers /rest/api/v1/deleteanswer: post: - tags: - - Answers + operationId: deleteanswer summary: Delete Answer description: Delete an existing user-generated Answer. - operationId: deleteanswer - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Answers + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: DeleteAnswer request content: application/json: schema: - $ref: "#/components/schemas/DeleteAnswerRequest" - description: DeleteAnswer request + $ref: '#/components/schemas/DeleteAnswerRequest' required: true x-exportParamName: Request responses: @@ -262,27 +523,27 @@ paths: description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: delete x-speakeasy-group: client.answers /rest/api/v1/editanswer: post: - tags: - - Answers + operationId: editanswer summary: Update Answer description: Update an existing user-generated Answer. - operationId: editanswer - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Answers + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: EditAnswer request content: application/json: schema: - $ref: "#/components/schemas/EditAnswerRequest" - description: EditAnswer request + $ref: '#/components/schemas/EditAnswerRequest' required: true x-exportParamName: Request responses: @@ -291,34 +552,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Answer" + $ref: '#/components/schemas/Answer' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: update x-speakeasy-group: client.answers /rest/api/v1/getanswer: post: - tags: - - Answers + operationId: getanswer summary: Read Answer description: Read the details of a particular Answer given its ID. - operationId: getanswer - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Answers + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: GetAnswer request content: application/json: schema: - $ref: "#/components/schemas/GetAnswerRequest" - description: GetAnswer request + $ref: '#/components/schemas/GetAnswerRequest' required: true x-exportParamName: Request responses: @@ -327,35 +588,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/GetAnswerResponse" + $ref: '#/components/schemas/GetAnswerResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: retrieve x-speakeasy-group: client.answers /rest/api/v1/listanswers: post: - tags: - - Answers + operationId: listanswers summary: List Answers description: List Answers created by the current user. - operationId: listanswers - deprecated: true - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Answers + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: ListAnswers request content: application/json: schema: - $ref: "#/components/schemas/ListAnswersRequest" - description: ListAnswers request + $ref: '#/components/schemas/ListAnswersRequest' required: true x-exportParamName: Request responses: @@ -364,27 +624,27 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ListAnswersResponse" + $ref: '#/components/schemas/ListAnswersResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests + deprecated: true + x-visibility: Public + x-codegen-request-body-name: payload x-glean-deprecated: id: 4c0923bd-64c7-45b9-99a5-b36f2705e618 introduced: "2026-01-21" message: Answer boards have been removed and this endpoint no longer serves a purpose removal: "2026-10-15" x-speakeasy-deprecation-message: "Deprecated on 2026-01-21, removal scheduled for 2026-10-15: Answer boards have been removed and this endpoint no longer serves a purpose" - security: - - APIToken: [] x-speakeasy-name-override: list x-speakeasy-group: client.answers /rest/api/v1/checkdatasourceauth: post: - tags: - - Authentication + operationId: checkdatasourceauth summary: Check datasource authorization description: | Returns all datasource instances that require per-user OAuth authorization @@ -394,8 +654,10 @@ paths: Clients construct the full OAuth URL by combining the backend base URL, the `authUrlRelativePath` from each instance, and the transient auth token: `/?transient_auth_token=`. - operationId: checkdatasourceauth - x-visibility: Public + tags: + - Authentication + security: + - APIToken: [] parameters: [] responses: "200": @@ -403,17 +665,17 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CheckDatasourceAuthResponse" + $ref: '#/components/schemas/CheckDatasourceAuthResponse' "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-speakeasy-name-override: checkDatasourceAuth + x-speakeasy-group: client.authentication /rest/api/v1/createauthtoken: post: - tags: - - Authentication + operationId: createauthtoken summary: Create authentication token description: | Creates an authentication token for the authenticated user. These are @@ -421,8 +683,10 @@ paths: Note: The tokens generated from this endpoint are **not** valid tokens for use with the Client API (e.g. `/rest/api/v1/*`). - operationId: createauthtoken - x-visibility: Public + tags: + - Authentication + security: + - APIToken: [] parameters: [] responses: "200": @@ -430,34 +694,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CreateAuthTokenResponse" + $ref: '#/components/schemas/CreateAuthTokenResponse' "400": description: Invalid Request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public x-speakeasy-name-override: createToken x-speakeasy-group: client.authentication /rest/api/v1/chat: post: - tags: - - Chat + operationId: chat summary: Chat description: Have a conversation with Glean AI. - operationId: chat - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Chat + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" - - $ref: "#/components/parameters/timezoneOffset" + - $ref: '#/components/parameters/locale' + - $ref: '#/components/parameters/timezoneOffset' requestBody: + description: Includes chat history for Glean AI to respond to. content: application/json: schema: - $ref: "#/components/schemas/ChatRequest" + $ref: '#/components/schemas/ChatRequest' examples: defaultExample: value: @@ -475,7 +739,6 @@ paths: messageType: CONTENT fragments: - text: Who was the first person to land on the moon? - description: Includes chat history for Glean AI to respond to. required: true x-exportParamName: Request responses: @@ -579,7 +842,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ChatResponse" + $ref: '#/components/schemas/ChatResponse' examples: queuedExample: value: @@ -594,23 +857,23 @@ paths: description: Request Timeout "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-group: client.chat x-speakeasy-name-override: create x-speakeasy-usage-example: true /rest/api/v1/deleteallchats: post: - tags: - - Chat + operationId: deleteallchats summary: Deletes all saved Chats owned by a user description: Deletes all saved Chats a user has had and all their contained conversational content. - operationId: deleteallchats - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Chat + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" - - $ref: "#/components/parameters/timezoneOffset" + - $ref: '#/components/parameters/locale' + - $ref: '#/components/parameters/timezoneOffset' responses: "200": description: OK @@ -620,27 +883,27 @@ paths: description: Not Authorized "403": description: Forbidden - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: deleteAll x-speakeasy-group: client.chat /rest/api/v1/deletechats: post: - tags: - - Chat + operationId: deletechats summary: Deletes saved Chats description: Deletes saved Chats and all their contained conversational content. - operationId: deletechats - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Chat + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" - - $ref: "#/components/parameters/timezoneOffset" + - $ref: '#/components/parameters/locale' + - $ref: '#/components/parameters/timezoneOffset' requestBody: content: application/json: schema: - $ref: "#/components/schemas/DeleteChatsRequest" + $ref: '#/components/schemas/DeleteChatsRequest' required: true x-exportParamName: Request responses: @@ -654,27 +917,27 @@ paths: description: Forbidden "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: delete x-speakeasy-group: client.chat /rest/api/v1/getchat: post: - tags: - - Chat + operationId: getchat summary: Retrieves a Chat description: Retrieves the chat history between Glean Assistant and the user for a given Chat. - operationId: getchat - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Chat + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" - - $ref: "#/components/parameters/timezoneOffset" + - $ref: '#/components/parameters/locale' + - $ref: '#/components/parameters/timezoneOffset' requestBody: content: application/json: schema: - $ref: "#/components/schemas/GetChatRequest" + $ref: '#/components/schemas/GetChatRequest' required: true x-exportParamName: Request responses: @@ -683,7 +946,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/GetChatResponse" + $ref: '#/components/schemas/GetChatResponse' "400": description: Invalid request "401": @@ -692,56 +955,56 @@ paths: description: Forbidden "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: retrieve x-speakeasy-group: client.chat /rest/api/v1/listchats: post: - tags: - - Chat + operationId: listchats summary: Retrieves all saved Chats description: Retrieves all the saved Chats between Glean Assistant and the user. The returned Chats contain only metadata and no conversational content. - operationId: listchats - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Chat + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" - - $ref: "#/components/parameters/timezoneOffset" + - $ref: '#/components/parameters/locale' + - $ref: '#/components/parameters/timezoneOffset' responses: "200": description: OK content: application/json: schema: - $ref: "#/components/schemas/ListChatsResponse" + $ref: '#/components/schemas/ListChatsResponse' "401": description: Not Authorized "403": description: Forbidden "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: list x-speakeasy-group: client.chat /rest/api/v1/getchatapplication: post: - tags: - - Chat + operationId: getchatapplication summary: Gets the metadata for a custom Chat application description: Gets the Chat application details for the specified application ID. - operationId: getchatapplication - x-visibility: Preview - x-codegen-request-body-name: payload + tags: + - Chat + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" - - $ref: "#/components/parameters/timezoneOffset" + - $ref: '#/components/parameters/locale' + - $ref: '#/components/parameters/timezoneOffset' requestBody: content: application/json: schema: - $ref: "#/components/schemas/GetChatApplicationRequest" + $ref: '#/components/schemas/GetChatApplicationRequest' required: true x-exportParamName: Request responses: @@ -750,34 +1013,35 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/GetChatApplicationResponse" + $ref: '#/components/schemas/GetChatApplicationResponse' "400": description: Invalid request "401": description: Not Authorized "403": description: Forbidden - security: - - APIToken: [] + x-visibility: Preview + x-codegen-request-body-name: payload x-speakeasy-name-override: retrieveApplication x-speakeasy-group: client.chat /rest/api/v1/uploadchatfiles: post: - tags: - - Chat + operationId: uploadchatfiles summary: Upload files for Chat description: Upload files for Chat. - operationId: uploadchatfiles - x-visibility: Public + tags: + - Chat + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" - - $ref: "#/components/parameters/timezoneOffset" + - $ref: '#/components/parameters/locale' + - $ref: '#/components/parameters/timezoneOffset' requestBody: - required: true content: multipart/form-data: schema: - $ref: "#/components/schemas/UploadChatFilesRequest" + $ref: '#/components/schemas/UploadChatFilesRequest' + required: true x-exportParamName: Request responses: "200": @@ -785,7 +1049,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/UploadChatFilesResponse" + $ref: '#/components/schemas/UploadChatFilesResponse' "400": description: Invalid request "401": @@ -794,27 +1058,27 @@ paths: description: Forbidden "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public x-speakeasy-name-override: uploadFiles x-speakeasy-group: client.chat /rest/api/v1/getchatfiles: post: - tags: - - Chat + operationId: getchatfiles summary: Get files uploaded by a user for Chat description: Get files uploaded by a user for Chat. - operationId: getchatfiles - x-visibility: Public + tags: + - Chat + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" - - $ref: "#/components/parameters/timezoneOffset" + - $ref: '#/components/parameters/locale' + - $ref: '#/components/parameters/timezoneOffset' requestBody: - required: true content: application/json: schema: - $ref: "#/components/schemas/GetChatFilesRequest" + $ref: '#/components/schemas/GetChatFilesRequest' + required: true x-exportParamName: Request responses: "200": @@ -822,7 +1086,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/GetChatFilesResponse" + $ref: '#/components/schemas/GetChatFilesResponse' "400": description: Invalid request "401": @@ -831,27 +1095,27 @@ paths: description: Forbidden "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public x-speakeasy-name-override: retrieveFiles x-speakeasy-group: client.chat /rest/api/v1/deletechatfiles: post: - tags: - - Chat + operationId: deletechatfiles summary: Delete files uploaded by a user for chat description: Delete files uploaded by a user for Chat. - operationId: deletechatfiles - x-visibility: Public + tags: + - Chat + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" - - $ref: "#/components/parameters/timezoneOffset" + - $ref: '#/components/parameters/locale' + - $ref: '#/components/parameters/timezoneOffset' requestBody: - required: true content: application/json: schema: - $ref: "#/components/schemas/DeleteChatFilesRequest" + $ref: '#/components/schemas/DeleteChatFilesRequest' + required: true responses: "200": description: OK @@ -863,31 +1127,31 @@ paths: description: Forbidden "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public x-speakeasy-name-override: deleteFiles x-speakeasy-group: client.chat /rest/api/v1/chat-files/{fileId}: get: - tags: - - Chat + operationId: getChatFile summary: Download a chat file description: | Download the raw content of a file generated or uploaded during a chat session (for example, an image produced by the assistant). Returns the file bytes with a Content-Type header matching the file's MIME type. - operationId: getChatFile - x-visibility: Public + tags: + - Chat + security: + - APIToken: [] parameters: - name: fileId in: path - required: true description: Identifier of the chat file to download. + required: true schema: type: string - name: preview in: query - required: false description: | When true and the file is a PDF, the response is served inline (Content-Disposition: inline) instead of as an attachment. + required: false schema: type: boolean responses: @@ -908,32 +1172,34 @@ paths: description: File not found. "500": description: Internal server error. - security: - - APIToken: [] + x-visibility: Public + x-speakeasy-name-override: retrieveFile + x-speakeasy-group: client.chat /rest/api/v1/agents: post: - tags: - - Agents + operationId: createAgent summary: Create an agent description: Create an agent. - operationId: createAgent - x-visibility: Preview + tags: + - Agents + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" - - $ref: "#/components/parameters/timezoneOffset" + - $ref: '#/components/parameters/locale' + - $ref: '#/components/parameters/timezoneOffset' requestBody: - required: true content: application/json: schema: - $ref: "#/components/schemas/CreateWorkflowRequest" + $ref: '#/components/schemas/CreateWorkflowRequest' + required: true responses: "200": description: Success content: application/json: schema: - $ref: "#/components/schemas/CreateWorkflowResponse" + $ref: '#/components/schemas/CreateWorkflowResponse' "400": description: Bad request "401": @@ -942,34 +1208,36 @@ paths: description: Forbidden "500": description: Internal server error - security: - - APIToken: [] + x-visibility: Preview + x-speakeasy-group: client.agents + x-speakeasy-name-override: create /rest/api/v1/agents/{agent_id}: get: - tags: - - Agents + operationId: getAgent summary: Retrieve an agent description: Returns details of an [agent](https://developers.glean.com/agents/agents-api) created in the Agent Builder. - operationId: getAgent - x-visibility: Preview + tags: + - Agents + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" - - $ref: "#/components/parameters/timezoneOffset" - - description: The ID of the agent. + - $ref: '#/components/parameters/locale' + - $ref: '#/components/parameters/timezoneOffset' + - name: agent_id + in: path + description: The ID of the agent. required: true schema: type: string title: Agent ID description: The ID of the agent. - name: agent_id - in: path responses: "200": description: Success content: application/json: schema: - $ref: "#/components/schemas/Agent" + $ref: '#/components/schemas/Agent' "400": description: Bad request "403": @@ -979,37 +1247,37 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ErrorResponse" + $ref: '#/components/schemas/ErrorResponse' "500": description: Internal server error - security: - - APIToken: [] + x-visibility: Preview x-speakeasy-group: client.agents x-speakeasy-name-override: retrieve post: - tags: - - Agents + operationId: editAgent summary: Edit an agent description: Creates a draft or publishes an [agent](https://developers.glean.com/agents/agents-api). Use `isDraft=true` to save a draft, or `isDraft=false` (or omit) to publish immediately. Only draft and publish modes are supported. - operationId: editAgent - x-visibility: Preview + tags: + - Agents + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" - - $ref: "#/components/parameters/timezoneOffset" - - description: The ID of the agent. + - $ref: '#/components/parameters/locale' + - $ref: '#/components/parameters/timezoneOffset' + - name: agent_id + in: path + description: The ID of the agent. required: true schema: type: string title: Agent ID description: The ID of the agent. - name: agent_id - in: path requestBody: - required: true content: application/json: schema: - $ref: "#/components/schemas/EditWorkflowRequest" + $ref: '#/components/schemas/EditWorkflowRequest' + required: true responses: "200": description: Success @@ -1024,37 +1292,39 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ErrorResponse" + $ref: '#/components/schemas/ErrorResponse' "500": description: Internal server error - security: - - APIToken: [] + x-visibility: Preview + x-speakeasy-group: client.agents + x-speakeasy-name-override: update /rest/api/v1/agents/{agent_id}/schemas: get: - tags: - - Agents + operationId: getAgentSchemas summary: List an agent's schemas description: Return [agent](https://developers.glean.com/agents/agents-api)'s input and output schemas. You can use these schemas to detect changes to an agent's input or output structure. - operationId: getAgentSchemas - x-visibility: Preview + tags: + - Agents + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" - - $ref: "#/components/parameters/timezoneOffset" - - description: The ID of the agent. + - $ref: '#/components/parameters/locale' + - $ref: '#/components/parameters/timezoneOffset' + - name: agent_id + in: path + description: The ID of the agent. required: true schema: type: string title: Agent Id description: The ID of the agent. - name: agent_id - in: path responses: "200": description: Success content: application/json: schema: - $ref: "#/components/schemas/AgentSchemas" + $ref: '#/components/schemas/AgentSchemas' "400": description: Bad request "403": @@ -1064,40 +1334,40 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ErrorResponse" + $ref: '#/components/schemas/ErrorResponse' "422": description: Validation Error content: application/json: schema: - $ref: "#/components/schemas/ErrorResponse" + $ref: '#/components/schemas/ErrorResponse' "500": description: Internal server error - security: - - APIToken: [] + x-visibility: Preview x-speakeasy-group: client.agents x-speakeasy-name-override: retrieveSchemas /rest/api/v1/agents/search: post: - tags: - - Agents + operationId: searchAgents summary: Search agents description: Search for [agents](https://developers.glean.com/agents/agents-api) by agent name. - operationId: searchAgents - x-visibility: Preview + tags: + - Agents + security: + - APIToken: [] requestBody: - required: true content: application/json: schema: - $ref: "#/components/schemas/SearchAgentsRequest" + $ref: '#/components/schemas/SearchAgentsRequest' + required: true responses: "200": description: Success content: application/json: schema: - $ref: "#/components/schemas/SearchAgentsResponse" + $ref: '#/components/schemas/SearchAgentsResponse' "400": description: Bad request "403": @@ -1107,32 +1377,32 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ErrorResponse" + $ref: '#/components/schemas/ErrorResponse' "422": description: Validation Error content: application/json: schema: - $ref: "#/components/schemas/ErrorResponse" + $ref: '#/components/schemas/ErrorResponse' "500": description: Internal server error - security: - - APIToken: [] + x-visibility: Preview x-speakeasy-group: client.agents x-speakeasy-name-override: list /rest/api/v1/agents/runs/stream: post: + operationId: createAndStreamRun + summary: Create an agent run and stream the response + description: 'Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the result as a stream of server-sent events (SSE). **Note**: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the `input` object.' tags: - Agents - summary: Create an agent run and stream the response - description: "Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the result as a stream of server-sent events (SSE). **Note**: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the `input` object." - operationId: createAndStreamRun - x-visibility: Preview + security: + - APIToken: [] requestBody: content: application/json: schema: - $ref: "#/components/schemas/AgentRunCreate" + $ref: '#/components/schemas/AgentRunCreate' required: true responses: "200": @@ -1167,38 +1437,38 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ErrorResponse" + $ref: '#/components/schemas/ErrorResponse' "409": description: Conflict content: application/json: schema: - $ref: "#/components/schemas/ErrorResponse" + $ref: '#/components/schemas/ErrorResponse' "422": description: Validation Error content: application/json: schema: - $ref: "#/components/schemas/ErrorResponse" + $ref: '#/components/schemas/ErrorResponse' "500": description: Internal server error - security: - - APIToken: [] + x-visibility: Preview x-speakeasy-group: client.agents x-speakeasy-name-override: runStream /rest/api/v1/agents/runs/wait: post: + operationId: createAndWaitRun + summary: Create an agent run and wait for the response + description: 'Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the final response. **Note**: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the `input` object.' tags: - Agents - summary: Create an agent run and wait for the response - description: "Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the final response. **Note**: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the `input` object." - operationId: createAndWaitRun - x-visibility: Preview + security: + - APIToken: [] requestBody: content: application/json: schema: - $ref: "#/components/schemas/AgentRunCreate" + $ref: '#/components/schemas/AgentRunCreate' required: true responses: "200": @@ -1206,7 +1476,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/AgentRunWaitResponse" + $ref: '#/components/schemas/AgentRunWaitResponse' "400": description: Bad request "403": @@ -1219,27 +1489,26 @@ paths: description: Validation Error "500": description: Internal server error - security: - - APIToken: [] + x-visibility: Preview x-speakeasy-group: client.agents x-speakeasy-name-override: run /rest/api/v1/addcollectionitems: post: - tags: - - Collections + operationId: addcollectionitems summary: Add Collection item description: Add items to a Collection. - operationId: addcollectionitems - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Collections + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Data describing the add operation. content: application/json: schema: - $ref: "#/components/schemas/AddCollectionItemsRequest" - description: Data describing the add operation. + $ref: '#/components/schemas/AddCollectionItemsRequest' required: true x-exportParamName: Request responses: @@ -1248,34 +1517,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/AddCollectionItemsResponse" + $ref: '#/components/schemas/AddCollectionItemsResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: addItems x-speakeasy-group: client.collections /rest/api/v1/createcollection: post: - tags: - - Collections + operationId: createcollection summary: Create Collection description: Create a publicly visible (empty) Collection of documents. - operationId: createcollection - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Collections + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Collection content plus any additional metadata for the request. content: application/json: schema: - $ref: "#/components/schemas/CreateCollectionRequest" - description: Collection content plus any additional metadata for the request. + $ref: '#/components/schemas/CreateCollectionRequest' required: true x-exportParamName: Request responses: @@ -1284,7 +1553,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CreateCollectionResponse" + $ref: '#/components/schemas/CreateCollectionResponse' "400": description: Invalid request "401": @@ -1294,30 +1563,30 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CollectionError" + $ref: '#/components/schemas/CollectionError' "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-group: client.collections x-speakeasy-name-override: create /rest/api/v1/deletecollection: post: - tags: - - Collections + operationId: deletecollection summary: Delete Collection description: Delete a Collection given the Collection's ID. - operationId: deletecollection - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Collections + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: DeleteCollection request content: application/json: schema: - $ref: "#/components/schemas/DeleteCollectionRequest" - description: DeleteCollection request + $ref: '#/components/schemas/DeleteCollectionRequest' required: true x-exportParamName: Request responses: @@ -1332,30 +1601,30 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CollectionError" + $ref: '#/components/schemas/CollectionError' "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: delete x-speakeasy-group: client.collections /rest/api/v1/deletecollectionitem: post: - tags: - - Collections + operationId: deletecollectionitem summary: Delete Collection item description: Delete a single item from a Collection. - operationId: deletecollectionitem - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Collections + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Data describing the delete operation. content: application/json: schema: - $ref: "#/components/schemas/DeleteCollectionItemRequest" - description: Data describing the delete operation. + $ref: '#/components/schemas/DeleteCollectionItemRequest' required: true x-exportParamName: Request responses: @@ -1364,7 +1633,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/DeleteCollectionItemResponse" + $ref: '#/components/schemas/DeleteCollectionItemResponse' "400": description: Invalid request "401": @@ -1373,27 +1642,27 @@ paths: description: Failed to save deletion "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: deleteItem x-speakeasy-group: client.collections /rest/api/v1/editcollection: post: - tags: - - Collections + operationId: editcollection summary: Update Collection description: Update the properties of an existing Collection. - operationId: editcollection - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Collections + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Collection content plus any additional metadata for the request. content: application/json: schema: - $ref: "#/components/schemas/EditCollectionRequest" - description: Collection content plus any additional metadata for the request. + $ref: '#/components/schemas/EditCollectionRequest' required: true x-exportParamName: Request responses: @@ -1402,7 +1671,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/EditCollectionResponse" + $ref: '#/components/schemas/EditCollectionResponse' "400": description: Invalid request "401": @@ -1412,30 +1681,30 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CollectionError" + $ref: '#/components/schemas/CollectionError' "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: update x-speakeasy-group: client.collections /rest/api/v1/editcollectionitem: post: - tags: - - Collections + operationId: editcollectionitem summary: Update Collection item description: Update the URL, Glean Document ID, description of an item within a Collection given its ID. - operationId: editcollectionitem - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Collections + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Edit Collection Items request content: application/json: schema: - $ref: "#/components/schemas/EditCollectionItemRequest" - description: Edit Collection Items request + $ref: '#/components/schemas/EditCollectionItemRequest' required: true x-exportParamName: Request responses: @@ -1444,34 +1713,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/EditCollectionItemResponse" + $ref: '#/components/schemas/EditCollectionItemResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: updateItem x-speakeasy-group: client.collections /rest/api/v1/getcollection: post: - tags: - - Collections + operationId: getcollection summary: Read Collection description: Read the details of a Collection given its ID. Does not fetch items in this Collection. - operationId: getcollection - x-visibility: Preview - x-codegen-request-body-name: payload + tags: + - Collections + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: GetCollection request content: application/json: schema: - $ref: "#/components/schemas/GetCollectionRequest" - description: GetCollection request + $ref: '#/components/schemas/GetCollectionRequest' required: true x-exportParamName: Request responses: @@ -1480,34 +1749,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/GetCollectionResponse" + $ref: '#/components/schemas/GetCollectionResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Preview + x-codegen-request-body-name: payload x-speakeasy-name-override: retrieve x-speakeasy-group: client.collections /rest/api/v1/listcollections: post: - tags: - - Collections + operationId: listcollections summary: List Collections description: List all existing Collections. - operationId: listcollections - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Collections + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: ListCollections request content: application/json: schema: - $ref: "#/components/schemas/ListCollectionsRequest" - description: ListCollections request + $ref: '#/components/schemas/ListCollectionsRequest' required: true x-exportParamName: Request responses: @@ -1516,34 +1785,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ListCollectionsResponse" + $ref: '#/components/schemas/ListCollectionsResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: list x-speakeasy-group: client.collections /rest/api/v1/getdocpermissions: post: - tags: - - Documents + operationId: getdocpermissions summary: Read document permissions description: Read the emails of all users who have access to the given document. - operationId: getdocpermissions - x-visibility: Preview - x-codegen-request-body-name: payload + tags: + - Documents + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Document permissions request content: application/json: schema: - $ref: "#/components/schemas/GetDocPermissionsRequest" - description: Document permissions request + $ref: '#/components/schemas/GetDocPermissionsRequest' required: true x-exportParamName: Request responses: @@ -1552,7 +1821,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/GetDocPermissionsResponse" + $ref: '#/components/schemas/GetDocPermissionsResponse' "400": description: Invalid request "401": @@ -1561,34 +1830,34 @@ paths: description: Forbidden "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Preview + x-codegen-request-body-name: payload x-speakeasy-name-override: retrievePermissions x-speakeasy-group: client.documents /rest/api/v1/getdocuments: post: - tags: - - Documents + operationId: getdocuments summary: Read documents description: Read the documents including metadata (does not include enhanced metadata via `/documentmetadata`) for the given list of Glean Document IDs or URLs specified in the request. - operationId: getdocuments - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Documents + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Information about documents requested. content: application/json: schema: - $ref: "#/components/schemas/GetDocumentsRequest" - description: Information about documents requested. + $ref: '#/components/schemas/GetDocumentsRequest' responses: "200": description: OK content: application/json: schema: - $ref: "#/components/schemas/GetDocumentsResponse" + $ref: '#/components/schemas/GetDocumentsResponse' "400": description: Invalid request "401": @@ -1597,34 +1866,34 @@ paths: description: Documents does not exist, or user cannot access documents. "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: retrieve x-speakeasy-group: client.documents /rest/api/v1/getdocumentsbyfacets: post: - tags: - - Documents + operationId: getdocumentsbyfacets summary: Read documents by facets description: Read the documents including metadata (does not include enhanced metadata via `/documentmetadata`) macthing the given facet conditions. - operationId: getdocumentsbyfacets - x-visibility: Preview - x-codegen-request-body-name: payload + tags: + - Documents + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Information about facet conditions for documents to be retrieved. content: application/json: schema: - $ref: "#/components/schemas/GetDocumentsByFacetsRequest" - description: Information about facet conditions for documents to be retrieved. + $ref: '#/components/schemas/GetDocumentsByFacetsRequest' responses: "200": description: OK content: application/json: schema: - $ref: "#/components/schemas/GetDocumentsByFacetsResponse" + $ref: '#/components/schemas/GetDocumentsByFacetsResponse' "400": description: Invalid request "401": @@ -1633,27 +1902,27 @@ paths: description: Not Found "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Preview + x-codegen-request-body-name: payload x-speakeasy-name-override: retrieveByFacets x-speakeasy-group: client.documents /rest/api/v1/insights: post: - tags: - - Insights + operationId: insights summary: Get insights description: Gets the aggregate usage insights data displayed in the Insights Dashboards. - operationId: insights - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Insights + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Includes request parameters for insights requests. content: application/json: schema: - $ref: "#/components/schemas/InsightsRequest" - description: Includes request parameters for insights requests. + $ref: '#/components/schemas/InsightsRequest' required: true x-exportParamName: InsightsRequest responses: @@ -1662,34 +1931,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/InsightsResponse" + $ref: '#/components/schemas/InsightsResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: retrieve x-speakeasy-group: client.insights /rest/api/v1/messages: post: - tags: - - Messages + operationId: messages summary: Read messages description: Retrieves list of messages from messaging/chat datasources (e.g. Slack, Teams). - operationId: messages - x-visibility: Preview - x-codegen-request-body-name: payload + tags: + - Messages + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Includes request params such as the id for channel/message and direction. content: application/json: schema: - $ref: "#/components/schemas/MessagesRequest" - description: Includes request params such as the id for channel/message and direction. + $ref: '#/components/schemas/MessagesRequest' required: true x-exportParamName: MessagesRequest responses: @@ -1698,34 +1967,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/MessagesResponse" + $ref: '#/components/schemas/MessagesResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Preview + x-codegen-request-body-name: payload x-speakeasy-name-override: retrieve x-speakeasy-group: client.messages /rest/api/v1/editpin: post: - tags: - - Pins + operationId: editpin summary: Update pin description: Update an existing user-generated pin. - operationId: editpin - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Pins + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Edit pins request content: application/json: schema: - $ref: "#/components/schemas/EditPinRequest" - description: Edit pins request + $ref: '#/components/schemas/EditPinRequest' required: true x-exportParamName: Request responses: @@ -1734,34 +2003,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/PinDocument" + $ref: '#/components/schemas/PinDocument' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: update x-speakeasy-group: client.pins /rest/api/v1/getpin: post: - tags: - - Pins + operationId: getpin summary: Read pin description: Read pin details given its ID. - operationId: getpin - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Pins + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Get pin request content: application/json: schema: - $ref: "#/components/schemas/GetPinRequest" - description: Get pin request + $ref: '#/components/schemas/GetPinRequest' required: true x-exportParamName: Request responses: @@ -1770,34 +2039,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/GetPinResponse" + $ref: '#/components/schemas/GetPinResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: retrieve x-speakeasy-group: client.pins /rest/api/v1/listpins: post: - tags: - - Pins + operationId: listpins summary: List pins description: Lists all pins. - operationId: listpins - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Pins + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: List pins request content: application/json: schema: type: object - description: List pins request required: true x-exportParamName: Request responses: @@ -1806,34 +2075,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ListPinsResponse" + $ref: '#/components/schemas/ListPinsResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: list x-speakeasy-group: client.pins /rest/api/v1/pin: post: - tags: - - Pins + operationId: pin summary: Create pin description: Pin a document as a result for a given search query.Pin results that are known to be a good match. - operationId: pin - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Pins + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Details about the document and query for the pin. content: application/json: schema: - $ref: "#/components/schemas/PinRequest" - description: Details about the document and query for the pin. + $ref: '#/components/schemas/PinRequest' required: true x-exportParamName: PinDocument responses: @@ -1842,34 +2111,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/PinDocument" + $ref: '#/components/schemas/PinDocument' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: create x-speakeasy-group: client.pins /rest/api/v1/unpin: post: - tags: - - Pins + operationId: unpin summary: Delete pin description: Unpin a previously pinned result. - operationId: unpin - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Pins + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Details about the pin being unpinned. content: application/json: schema: - $ref: "#/components/schemas/Unpin" - description: Details about the pin being unpinned. + $ref: '#/components/schemas/Unpin' required: true x-exportParamName: Unpin responses: @@ -1883,27 +2152,27 @@ paths: description: Forbidden from unpinning someone else's pin "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: remove x-speakeasy-group: client.pins /rest/api/v1/adminsearch: post: - tags: - - Search + operationId: adminsearch summary: Search the index (admin) description: Retrieves results for search query without respect for permissions. This is available only to privileged users. - operationId: adminsearch - x-visibility: Preview - x-codegen-request-body-name: payload + tags: + - Search + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Admin search request content: application/json: schema: - $ref: "#/components/schemas/SearchRequest" - description: Admin search request + $ref: '#/components/schemas/SearchRequest' required: true x-exportParamName: Request responses: @@ -1912,7 +2181,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/SearchResponse" + $ref: '#/components/schemas/SearchResponse' "400": description: Invalid request "401": @@ -1922,36 +2191,36 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ErrorInfo" + $ref: '#/components/schemas/ErrorInfo' "422": description: Invalid Query content: application/json: schema: - $ref: "#/components/schemas/ErrorInfo" + $ref: '#/components/schemas/ErrorInfo' "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Preview + x-codegen-request-body-name: payload x-speakeasy-group: client.search x-speakeasy-name-override: queryAsAdmin /rest/api/v1/autocomplete: post: - tags: - - Search + operationId: autocomplete summary: Autocomplete description: Retrieve query suggestions, operators and documents for the given partially typed query. - operationId: autocomplete - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Search + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Autocomplete request content: application/json: schema: - $ref: "#/components/schemas/AutocompleteRequest" - description: Autocomplete request + $ref: '#/components/schemas/AutocompleteRequest' required: true x-exportParamName: Request responses: @@ -1960,34 +2229,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/AutocompleteResponse" + $ref: '#/components/schemas/AutocompleteResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-group: client.search x-speakeasy-name-override: autocomplete /rest/api/v1/feed: post: - tags: - - Search + operationId: feed summary: Feed of documents and events description: The personalized feed/home includes different types of contents including suggestions, recents, calendar events and many more. - operationId: feed - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Search + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Includes request params, client data and more for making user's feed. content: application/json: schema: - $ref: "#/components/schemas/FeedRequest" - description: Includes request params, client data and more for making user's feed. + $ref: '#/components/schemas/FeedRequest' required: true x-exportParamName: FeedRequest responses: @@ -1996,7 +2265,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/FeedResponse" + $ref: '#/components/schemas/FeedResponse' "400": description: Invalid request "401": @@ -2005,27 +2274,27 @@ paths: description: Request Timeout "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: retrieveFeed x-speakeasy-group: client.search /rest/api/v1/recommendations: post: - tags: - - Search + operationId: recommendations summary: Recommend documents description: Retrieve recommended documents for the given URL or Glean Document ID. - operationId: recommendations - x-visibility: Preview - x-codegen-request-body-name: payload + tags: + - Search + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Recommendations request content: application/json: schema: - $ref: "#/components/schemas/RecommendationsRequest" - description: Recommendations request + $ref: '#/components/schemas/RecommendationsRequest' required: true x-exportParamName: Request responses: @@ -2034,7 +2303,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/RecommendationsResponse" + $ref: '#/components/schemas/RecommendationsResponse' "202": description: Accepted. The Retry-After header has a hint about when the response will be available "204": @@ -2047,27 +2316,27 @@ paths: description: Document does not exist or user cannot access document "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Preview + x-codegen-request-body-name: payload x-speakeasy-group: client.search x-speakeasy-name-override: recommendations /rest/api/v1/search: post: - tags: - - Search + operationId: search summary: Search description: Retrieve results from the index for the given query and filters. - operationId: search - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Search + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Search request content: application/json: schema: - $ref: "#/components/schemas/SearchRequest" - description: Search request + $ref: '#/components/schemas/SearchRequest' required: true x-exportParamName: Request responses: @@ -2076,7 +2345,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/SearchResponse" + $ref: '#/components/schemas/SearchResponse' "400": description: Invalid request "401": @@ -2086,7 +2355,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ErrorInfo" + $ref: '#/components/schemas/ErrorInfo' "408": description: Request Timeout "422": @@ -2094,30 +2363,30 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ErrorInfo" + $ref: '#/components/schemas/ErrorInfo' "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-group: client.search x-speakeasy-name-override: query /rest/api/v1/listentities: post: - tags: - - Entities + operationId: listentities summary: List entities description: List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint, except when using FULL_DIRECTORY request type for people entities. - operationId: listentities - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Entities + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: List people request content: application/json: schema: - $ref: "#/components/schemas/ListEntitiesRequest" - description: List people request + $ref: '#/components/schemas/ListEntitiesRequest' required: true x-exportParamName: Request responses: @@ -2126,34 +2395,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ListEntitiesResponse" + $ref: '#/components/schemas/ListEntitiesResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-group: client.entities x-speakeasy-name-override: list /rest/api/v1/people: post: - tags: - - Entities + operationId: people summary: Read people description: Read people details for the given IDs. - operationId: people - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Entities + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: People request content: application/json: schema: - $ref: "#/components/schemas/PeopleRequest" - description: People request + $ref: '#/components/schemas/PeopleRequest' required: true x-exportParamName: Request responses: @@ -2162,38 +2431,39 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/PeopleResponse" + $ref: '#/components/schemas/PeopleResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: readPeople x-speakeasy-group: client.entities /rest/api/v1/people/{person_id}/photo: get: - tags: - - Entities + operationId: getPersonPhoto summary: Get person photo description: | Returns the profile photo bytes for a person whose photo is stored in Glean (crawled from an identity source or user-uploaded via admin console). Photos hosted externally (e.g. Slack CDN) are not served by this endpoint; callers should follow the photoUrl from /people or /listentities directly. Responses include a Cache-Control header (max-age=3600) to reduce redundant fetches. - operationId: getPersonPhoto - x-visibility: Public + tags: + - Entities + security: + - APIToken: [] parameters: - name: person_id in: path - required: true description: The obfuscated ID of the person whose photo to retrieve. + required: true schema: type: string - name: ds in: query - required: false description: | Optional datasource override for crawled photos (e.g. AZURE, GDRIVE, OKTA). When omitted, the datasource is derived from the person's stored photo URL or the deployment's primary person datasource. + required: false schema: type: string responses: @@ -2223,25 +2493,26 @@ paths: Person not found, person has no photo, or photo is not hosted by Glean (follow photoUrl from /people or /listentities directly). "429": description: Too Many Requests. - security: - - APIToken: [] + x-visibility: Public + x-speakeasy-name-override: retrievePersonPhoto + x-speakeasy-group: client.entities /rest/api/v1/createshortcut: post: - tags: - - Shortcuts + operationId: createshortcut summary: Create shortcut description: Create a user-generated shortcut that contains an alias and destination URL. - operationId: createshortcut - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Shortcuts + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: CreateShortcut request content: application/json: schema: - $ref: "#/components/schemas/CreateShortcutRequest" - description: CreateShortcut request + $ref: '#/components/schemas/CreateShortcutRequest' required: true x-exportParamName: Request responses: @@ -2250,34 +2521,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CreateShortcutResponse" + $ref: '#/components/schemas/CreateShortcutResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: create x-speakeasy-group: client.shortcuts /rest/api/v1/deleteshortcut: post: - tags: - - Shortcuts + operationId: deleteshortcut summary: Delete shortcut description: Delete an existing user-generated shortcut. - operationId: deleteshortcut - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Shortcuts + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: DeleteShortcut request content: application/json: schema: - $ref: "#/components/schemas/DeleteShortcutRequest" - description: DeleteShortcut request + $ref: '#/components/schemas/DeleteShortcutRequest' required: true x-exportParamName: Request responses: @@ -2289,27 +2560,27 @@ paths: description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: delete x-speakeasy-group: client.shortcuts /rest/api/v1/getshortcut: post: - tags: - - Shortcuts + operationId: getshortcut summary: Read shortcut description: Read a particular shortcut's details given its ID. - operationId: getshortcut - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Shortcuts + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: GetShortcut request content: application/json: schema: - $ref: "#/components/schemas/GetShortcutRequest" - description: GetShortcut request + $ref: '#/components/schemas/GetShortcutRequest' required: true x-exportParamName: Request responses: @@ -2318,34 +2589,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/GetShortcutResponse" + $ref: '#/components/schemas/GetShortcutResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-group: client.shortcuts x-speakeasy-name-override: retrieve /rest/api/v1/listshortcuts: post: - tags: - - Shortcuts + operationId: listshortcuts summary: List shortcuts description: List shortcuts editable/owned by the currently authenticated user. - operationId: listshortcuts - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Shortcuts + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Filters, sorters, paging params required for pagination content: application/json: schema: - $ref: "#/components/schemas/ListShortcutsPaginatedRequest" - description: Filters, sorters, paging params required for pagination + $ref: '#/components/schemas/ListShortcutsPaginatedRequest' required: true x-exportParamName: Request responses: @@ -2354,34 +2625,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ListShortcutsPaginatedResponse" + $ref: '#/components/schemas/ListShortcutsPaginatedResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-group: client.shortcuts x-speakeasy-name-override: list /rest/api/v1/updateshortcut: post: - tags: - - Shortcuts + operationId: updateshortcut summary: Update shortcut description: Updates the shortcut with the given ID. - operationId: updateshortcut - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Shortcuts + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Shortcut content. Id need to be specified for the shortcut. content: application/json: schema: - $ref: "#/components/schemas/UpdateShortcutRequest" - description: Shortcut content. Id need to be specified for the shortcut. + $ref: '#/components/schemas/UpdateShortcutRequest' required: true x-exportParamName: Request responses: @@ -2390,34 +2661,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/UpdateShortcutResponse" + $ref: '#/components/schemas/UpdateShortcutResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-group: client.shortcuts x-speakeasy-name-override: update /rest/api/v1/summarize: post: - tags: - - Summarize + operationId: summarize summary: Summarize documents description: Generate an AI summary of the requested documents. - operationId: summarize - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Summarize + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Includes request params such as the query and specs of the documents to summarize. content: application/json: schema: - $ref: "#/components/schemas/SummarizeRequest" - description: Includes request params such as the query and specs of the documents to summarize. + $ref: '#/components/schemas/SummarizeRequest' required: true x-exportParamName: Request responses: @@ -2426,34 +2697,34 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/SummarizeResponse" + $ref: '#/components/schemas/SummarizeResponse' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: summarize x-speakeasy-group: client.documents /rest/api/v1/addverificationreminder: post: - tags: - - Verification + operationId: addverificationreminder summary: Create verification description: Creates a verification reminder for the document. Users can create verification reminders from different product surfaces. - operationId: addverificationreminder - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Verification + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Details about the reminder. content: application/json: schema: - $ref: "#/components/schemas/ReminderRequest" - description: Details about the reminder. + $ref: '#/components/schemas/ReminderRequest' required: true x-exportParamName: ReminderRequest responses: @@ -2462,7 +2733,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Verification" + $ref: '#/components/schemas/Verification' "400": description: Invalid request "401": @@ -2471,61 +2742,61 @@ paths: description: Document does not exist, does not support verification or user cannot access document "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: addReminder x-speakeasy-group: client.verification /rest/api/v1/listverifications: post: - tags: - - Verification + operationId: listverifications summary: List verifications description: Returns the information to be rendered in verification dashboard. Includes information for each document owned by user regarding their verifications. - operationId: listverifications - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Verification + security: + - APIToken: [] parameters: - - in: query - name: count + - name: count + in: query description: Maximum number of documents to return required: false schema: type: integer - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' responses: "200": description: OK content: application/json: schema: - $ref: "#/components/schemas/VerificationFeed" + $ref: '#/components/schemas/VerificationFeed' "400": description: Invalid request "401": description: Not Authorized "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: list x-speakeasy-group: client.verification /rest/api/v1/verify: post: - tags: - - Verification + operationId: verify summary: Update verification description: Verify documents to keep the knowledge up to date within customer corpus. - operationId: verify - x-visibility: Public - x-codegen-request-body-name: payload + tags: + - Verification + security: + - APIToken: [] parameters: - - $ref: "#/components/parameters/locale" + - $ref: '#/components/parameters/locale' requestBody: + description: Details about the verification request. content: application/json: schema: - $ref: "#/components/schemas/VerifyRequest" - description: Details about the verification request. + $ref: '#/components/schemas/VerifyRequest' required: true x-exportParamName: VerifyRequest responses: @@ -2534,7 +2805,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Verification" + $ref: '#/components/schemas/Verification' "400": description: Invalid request "401": @@ -2543,36 +2814,37 @@ paths: description: Document does not exist, does not support verification or user cannot access document "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Public + x-codegen-request-body-name: payload x-speakeasy-name-override: verify x-speakeasy-group: client.verification /rest/api/v1/tools/list: get: + summary: List available tools + description: Returns a filtered set of available tools based on optional tool name parameters. If no filters are provided, all available tools are returned. tags: - Tools - Tools - summary: List available tools - description: Returns a filtered set of available tools based on optional tool name parameters. If no filters are provided, all available tools are returned. - x-visibility: Preview + security: + - APIToken: [] parameters: - - in: query - name: toolNames + - name: toolNames + in: query description: Optional array of tool names to filter by required: false + style: form + explode: false schema: type: array items: type: string - style: form - explode: false responses: "200": description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/ToolsListResponse" + $ref: '#/components/schemas/ToolsListResponse' "400": description: Bad Request "401": @@ -2581,31 +2853,31 @@ paths: description: Not Found "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Preview x-speakeasy-name-override: list x-speakeasy-group: client.tools /rest/api/v1/tools/call: post: + summary: Execute the specified tool + description: Execute the specified tool with provided parameters tags: - Tools - Tools - summary: Execute the specified tool - description: Execute the specified tool with provided parameters - x-visibility: Preview + security: + - APIToken: [] requestBody: - required: true content: application/json: schema: - $ref: "#/components/schemas/ToolsCallRequest" + $ref: '#/components/schemas/ToolsCallRequest' + required: true responses: "200": description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/ToolsCallResponse" + $ref: '#/components/schemas/ToolsCallResponse' "400": description: Bad Request "401": @@ -2614,35 +2886,28 @@ paths: description: Not Found "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Preview x-speakeasy-name-override: run x-speakeasy-group: client.tools /rest/api/v1/actions/actionpack/{actionPackId}/auth: - parameters: - - in: path - name: actionPackId - required: true - description: ID of the action pack to query or authorize. - schema: - type: string get: - tags: - - Tools + operationId: getActionPackAuthStatus summary: Get end-user authentication status for an action pack. description: | Reports whether the calling user is already authenticated against the third-party tool backing the specified action pack. Intended for headless / server-driven clients that render an "Authorize" prompt when the user has not yet consented to the tool. - operationId: getActionPackAuthStatus - x-visibility: Preview + tags: + - Tools + security: + - APIToken: [] responses: "200": description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/ActionPackAuthStatusResponse" + $ref: '#/components/schemas/ActionPackAuthStatusResponse' "400": description: Bad Request "401": @@ -2651,11 +2916,11 @@ paths: description: Action pack not found "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Preview + x-speakeasy-name-override: retrieveActionPackAuthStatus + x-speakeasy-group: client.tools post: - tags: - - Tools + operationId: authorizeActionPack summary: Start the OAuth authorization flow for an action pack. description: | Starts the third-party OAuth flow for the specified action pack and returns the @@ -2665,21 +2930,23 @@ paths: `returnUrl` must match the tenant's configured return URL allowlist; otherwise the request is rejected with 400. - operationId: authorizeActionPack - x-visibility: Preview + tags: + - Tools + security: + - APIToken: [] requestBody: - required: true content: application/json: schema: - $ref: "#/components/schemas/AuthorizeActionPackRequest" + $ref: '#/components/schemas/AuthorizeActionPackRequest' + required: true responses: "200": description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/AuthorizeActionPackResponse" + $ref: '#/components/schemas/AuthorizeActionPackResponse' "400": description: Invalid request (e.g. returnUrl not in allowlist, unsupported auth type) "401": @@ -2690,8 +2957,16 @@ paths: description: Action pack not found "429": description: Too Many Requests - security: - - APIToken: [] + x-visibility: Preview + x-speakeasy-name-override: authorizeActionPack + x-speakeasy-group: client.tools + parameters: + - name: actionPackId + in: path + description: ID of the action pack to query or authorize. + required: true + schema: + type: string /api/index/v1/indexdocument: post: summary: Index document @@ -3811,6 +4086,8 @@ paths: "429": description: Too Many Requests x-beta: true + x-speakeasy-group: indexing.documents + x-speakeasy-name-override: debugEvents /rest/api/index/document/{docId}/custom-metadata/{groupName}: put: summary: Add or update custom metadata @@ -4319,6 +4596,8 @@ paths: "500": description: Internal error x-visibility: Public + x-speakeasy-group: client.governance.data.findings + x-speakeasy-name-override: create get: operationId: listfindingsexports summary: Lists findings exports @@ -4339,6 +4618,8 @@ paths: "500": description: Internal error x-visibility: Public + x-speakeasy-group: client.governance.data.findings + x-speakeasy-name-override: list /rest/api/v1/governance/data/findings/exports/{id}: get: operationId: downloadfindingsexport @@ -4368,6 +4649,8 @@ paths: "500": description: Internal error x-visibility: Public + x-speakeasy-group: client.governance.data.findings + x-speakeasy-name-override: download delete: operationId: deletefindingsexport summary: Deletes findings export @@ -4392,6 +4675,8 @@ paths: "500": description: Internal error x-visibility: Public + x-speakeasy-group: client.governance.data.findings + x-speakeasy-name-override: delete /rest/api/v1/configure/datasources/{datasourceId}/instances/{instanceId}: get: operationId: getDatasourceInstanceConfiguration @@ -4433,6 +4718,8 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' x-visibility: Preview + x-speakeasy-group: client.datasources + x-speakeasy-name-override: retrieveConfiguration patch: operationId: updateDatasourceInstanceConfiguration summary: Update datasource instance configuration @@ -4479,6 +4766,8 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' x-visibility: Preview + x-speakeasy-group: client.datasources + x-speakeasy-name-override: updateConfiguration /rest/api/v1/datasource/{datasourceInstanceId}/credentialstatus: get: operationId: getDatasourceCredentialStatus @@ -4519,6 +4808,8 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' x-visibility: Preview + x-speakeasy-group: client.datasources + x-speakeasy-name-override: retrieveCredentialStatus /rest/api/v1/datasource/{datasourceInstanceId}/credentials: post: operationId: rotateDatasourceCredentials @@ -4566,6 +4857,8 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' x-visibility: Preview + x-speakeasy-group: client.datasources + x-speakeasy-name-override: rotateCredentials /rest/api/v1/chat#stream: post: tags: @@ -4707,16 +5000,521 @@ paths: components: securitySchemes: APIToken: - scheme: bearer type: http + scheme: bearer description: >- HTTP bearer token. Accepts a Glean-issued API token, an OAuth access token from the Glean OAuth Authorization Server (including Dynamic Client Registration clients), or an OAuth access token issued by an external identity provider. External-IdP OAuth tokens must also include the `X-Glean-Auth-Type: OAUTH` request header. OAuth is supported on the Client API only; the Indexing API requires a Glean-issued token. schemas: + PlatformAgentsSearchRequest: + type: object + additionalProperties: false + properties: + name: + type: string + description: Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied. + example: HR Policy Agent + PlatformAgentCapabilities: + type: object + additionalProperties: true + properties: + ap.io.messages: + type: boolean + description: Whether the agent supports messages as input. + ap.io.streaming: + type: boolean + description: Whether the agent supports streaming output. + PlatformAgent: + type: object + required: + - agent_id + - name + - capabilities + properties: + agent_id: + type: string + description: ID of the agent. + example: mho4lwzylcozgoc2 + name: + type: string + description: Name of the agent. + example: HR Policy Agent + description: + type: string + description: Description of the agent. + metadata: + type: object + description: Agent metadata. + additionalProperties: true + capabilities: + $ref: "#/components/schemas/PlatformAgentCapabilities" + PlatformAgentsSearchResponse: + type: object + required: + - agents + - request_id + properties: + agents: + type: array + description: Agents matching the search request. + items: + $ref: "#/components/schemas/PlatformAgent" + request_id: + type: string + description: Platform-generated request ID for support correlation. + PlatformProblemDetailCode: + type: string + description: Stable machine-readable error code. + enum: + - invalid_request + - missing_required_field + - invalid_parameter + - invalid_cursor + - expired_cursor + - invalid_filter + - invalid_datasource + - authentication_required + - token_expired + - insufficient_permissions + - resource_not_found + - method_not_allowed + - request_timeout + - conflict + - gone + - unprocessable_query + - rate_limit_exceeded + - internal_error + - service_unavailable + example: invalid_cursor + PlatformProblemDetailError: + type: object + required: + - pointer + - detail + description: Field-level validation problem for a single offending field. + properties: + pointer: + type: string + description: RFC 6901 JSON Pointer to the offending field. + example: /messages/0/role + detail: + type: string + description: Human-readable explanation for this field. + example: "Must be one of: USER, GLEAN_AI." + code: + $ref: "#/components/schemas/PlatformProblemDetailCode" + PlatformProblemDetail: + type: object + required: + - type + - title + - status + - detail + - code + - request_id + description: | + Error response following RFC 9457, extended with `code` and `documentation_url` for machine-readable classification and self-service remediation. + properties: + type: + type: string + format: uri + description: URI identifying the error type. + example: https://developer.glean.com/errors/invalid-cursor + title: + type: string + description: Short, human-readable summary of the error. + example: Invalid Pagination Cursor + status: + type: integer + description: HTTP status code mirrored from the response. + example: 400 + detail: + type: string + description: Human-readable explanation specific to this occurrence. + example: | + The provided cursor has expired. Start a new search to get a fresh cursor. + code: + $ref: "#/components/schemas/PlatformProblemDetailCode" + documentation_url: + type: string + format: uri + description: Direct URL to documentation for this error code. + example: https://developer.glean.com/errors/invalid-cursor + request_id: + type: string + description: Platform-generated request ID for support correlation. + example: req_7f8a9b0c1d2e + errors: + type: array + description: Field-level validation problems, one entry per offending field. + items: + $ref: "#/components/schemas/PlatformProblemDetailError" + PlatformAgentGetResponse: + type: object + required: + - agent + - request_id + properties: + agent: + $ref: "#/components/schemas/PlatformAgent" + request_id: + type: string + description: Platform-generated request ID for support correlation. + PlatformActionSummary: + type: object + required: + - tool_id + - display_name + properties: + tool_id: + type: string + description: Unique identifier of the action. + display_name: + type: string + description: Display name of the action. + type: + type: string + description: Tool type. + auth_type: + type: string + description: Authentication type required by the action. + write_action_type: + type: string + description: Write-action execution type. + is_setup_finished: + type: boolean + description: Whether this action has been fully configured. + data_source: + type: string + description: Kind of knowledge the action accesses or modifies. + PlatformAgentSchemasResponse: + type: object + required: + - agent_id + - input_schema + - output_schema + - request_id + properties: + agent_id: + type: string + description: ID of the agent. + name: + type: string + description: Name of the agent. + input_schema: + type: object + description: Agent input schema in JSON Schema format. + additionalProperties: true + output_schema: + type: object + description: Agent output schema in JSON Schema format. + additionalProperties: true + tools: + type: array + description: Tools that the agent can invoke, when requested. + items: + $ref: "#/components/schemas/PlatformActionSummary" + request_id: + type: string + description: Platform-generated request ID for support correlation. + PlatformMessageRole: + type: string + description: Role of the message author. + example: USER + enum: + - USER + - GLEAN_AI + PlatformContentType: + type: string + enum: + - text + PlatformMessageTextBlock: + type: object + required: + - text + - type + properties: + text: + type: string + description: Text content. + type: + $ref: "#/components/schemas/PlatformContentType" + PlatformMessage: + type: object + required: + - role + - content + properties: + role: + $ref: "#/components/schemas/PlatformMessageRole" + content: + type: array + description: Content blocks in the message. + items: + $ref: "#/components/schemas/PlatformMessageTextBlock" + PlatformAgentRunCreateRequest: + type: object + additionalProperties: false + description: | + Request to run an agent. A request MUST supply either `messages` (a non-empty conversation) or `input` (for input-form triggered agents). + properties: + input: + type: object + description: Input fields for an input-form triggered agent. + additionalProperties: true + messages: + type: array + minItems: 1 + description: | + Messages to pass to the agent. When provided, the array MUST contain at least one message and each message MUST specify a valid `role` and non-empty `content`. + items: + $ref: "#/components/schemas/PlatformMessage" + metadata: + type: object + description: Metadata to pass to the agent. + additionalProperties: true + stream: + type: boolean + description: Whether to stream the run response as server-sent events. + default: false + PlatformAgentRunCreate: + type: object + required: + - agent_id + properties: + agent_id: + type: string + description: ID of the agent being run. + input: + type: object + description: Input fields for an input-form triggered agent. + additionalProperties: true + messages: + type: array + description: Messages passed to the agent. + items: + $ref: "#/components/schemas/PlatformMessage" + metadata: + type: object + description: Metadata passed to the agent. + additionalProperties: true + PlatformAgentExecutionStatus: + type: string + description: Status of the agent run. + enum: + - error + - success + PlatformAgentRun: + allOf: + - $ref: "#/components/schemas/PlatformAgentRunCreate" + - type: object + required: + - status + properties: + status: + $ref: "#/components/schemas/PlatformAgentExecutionStatus" + PlatformAgentRunWaitResponse: + type: object + required: + - request_id + properties: + run: + $ref: "#/components/schemas/PlatformAgentRun" + messages: + type: array + description: Messages returned by the completed run. + items: + $ref: "#/components/schemas/PlatformMessage" + request_id: + type: string + description: Platform-generated request ID for support correlation. + PlatformFilterOperator: + type: string + description: Supported filter operator. + enum: + - EQUALS + - NOT_EQUALS + - GT + - GTE + - LT + - LTE + PlatformFilter: + type: object + required: + - field + - values + description: | + A single filter criterion. For `EQUALS`, multiple values within a filter are OR'd. For `NOT_EQUALS`, multiple values exclude all listed values. Filters are AND'd with each other and with any inline query operators. + properties: + field: + type: string + description: | + The field to filter on. Accepts built-in filter field names such as `type`, `owner`, `from`, `author`, `channel`, `status`, `assignee`, `reporter`, `component`, `mentions`, and `collection`, plus custom datasource property names. + example: type + values: + type: array + minItems: 1 + items: + type: string + description: One or more values to match. + example: + - spreadsheet + - presentation + operator: + allOf: + - $ref: "#/components/schemas/PlatformFilterOperator" + description: | + Comparison operator to apply to this filter. Defaults to `EQUALS`. `GT`, `GTE`, `LT`, and `LTE` range operators require exactly one value; express bounded ranges with multiple filters on the same field. + PlatformTimeRange: + type: object + description: Filter results to those last updated within this range. + properties: + start: + type: string + format: date-time + description: Inclusive lower bound in ISO 8601 format. + end: + type: string + format: date-time + description: Exclusive upper bound in ISO 8601 format. + PlatformSearchRequest: + type: object + additionalProperties: false + required: + - query + properties: + query: + type: string + description: | + The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. + example: quarterly planning 2026 + page_size: + type: integer + minimum: 1 + maximum: 100 + default: 10 + description: Number of results to return per page. + cursor: + type: string + nullable: true + description: | + Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. + datasources: + type: array + items: + type: string + description: | + Restrict results to specific datasources. Requests must not specify both `datasources` and `datasource_instances`. + example: + - confluence + - google_drive + datasource_instances: + type: array + items: + type: string + description: | + Restrict results to specific datasource instances. Values are datasource instance identifiers returned by `GET /api/search/filters`. Requests must not specify both `datasources` and `datasource_instances`. + example: + - slack_acme + - slack_eu + filters: + type: array + items: + $ref: "#/components/schemas/PlatformFilter" + description: | + Structured filters applied to search results. Equality operators OR multiple values within a filter. Multiple filters are AND'd together, including range filters on the same field. Filters are AND'd with any inline operators in `query`. Note that conflicting constraints on the same field (e.g., `type:document` in the query and `type: spreadsheet` in a filter) produce an empty result set. + time_range: + $ref: "#/components/schemas/PlatformTimeRange" + PlatformPersonReference: + type: object + description: A lightweight reference to a person, used where a payload merely points at someone. + required: + - name + properties: + id: + type: string + description: Opaque Glean person ID. + name: + type: string + description: Display name. + PlatformResult: + type: object + required: + - url + - title + - datasource + properties: + url: + type: string + format: uri + description: Canonical URL of the result. + example: https://company.atlassian.net/wiki/spaces/ENG/pages/12345 + title: + type: string + description: Result title. + example: Q2 2026 Platform Roadmap + snippets: + type: array + items: + type: string + description: Query-relevant plain-text excerpts from the result body. + example: + - The platform team will focus on API stability and... + datasource: + type: string + description: The datasource this result originates from. + example: confluence + datasource_instance: + type: string + nullable: true + description: The datasource instance this result originates from, if known. + example: confluence_acme + document_type: + type: string + nullable: true + description: The document type within the datasource. + example: page + creator: + $ref: "#/components/schemas/PlatformPersonReference" + owner: + $ref: "#/components/schemas/PlatformPersonReference" + updated_at: + type: string + format: date-time + nullable: true + description: When the result was last modified. + created_at: + type: string + format: date-time + nullable: true + description: When the result was created. + PlatformSearchResponse: + type: object + required: + - results + - has_more + - next_cursor + - request_id + properties: + results: + type: array + items: + $ref: "#/components/schemas/PlatformResult" + description: Ordered list of search results. + has_more: + type: boolean + description: Indicates whether additional pages of results are available. + next_cursor: + type: string + nullable: true + description: Opaque token to pass as `cursor` in the next request. + request_id: + type: string + description: Platform-generated request ID for support correlation. ActivityEventParams: properties: bodyContent: - description: The HTML content of the page body. type: string + description: The HTML content of the page body. datasourceInstance: type: string description: The full datasource instance name inferred from the URL of the event @@ -4727,32 +5525,35 @@ components: type: string description: The instance only name of the datasource instance, e.g. 1 for jira_1, inferred from the URL of the event duration: - description: Length in seconds of the activity. For VIEWS, this represents the amount the page was visible in the foreground. type: integer + description: Length in seconds of the activity. For VIEWS, this represents the amount the page was visible in the foreground. query: - description: The user's search query associated with a SEARCH. type: string + description: The user's search query associated with a SEARCH. referrer: - description: The referring URL of the VIEW or SEARCH. type: string + description: The referring URL of the VIEW or SEARCH. title: - description: The page title associated with the URL of the event type: string + description: The page title associated with the URL of the event truncated: - description: Indicates that the parameters are incomplete and more parameters may be sent with the same action+timestamp+URL in the future. This is used for sending the duration when a `VIEW` is finished. type: boolean + description: Indicates that the parameters are incomplete and more parameters may be sent with the same action+timestamp+URL in the future. This is used for sending the duration when a `VIEW` is finished. ActivityEvent: - required: - - action - - source - - timestamp - - url properties: id: type: string description: Universally unique identifier of the event. To allow for reliable retransmission, only the earliest received event of a given UUID is considered valid by the server and subsequent are ignored. action: type: string + enum: + - VIEW + - EDIT + - SEARCH + - COMMENT + - CRAWL + - HISTORICAL_SEARCH + - HISTORICAL_VIEW description: The type of activity this represents. x-enumDescriptions: VIEW: Represents a visit to the given `url`. @@ -4762,14 +5563,6 @@ components: CRAWL: Represents an explicit request to index the given `url` along with associated attributes in this payload. HISTORICAL_SEARCH: Represents a search performed at the given `url` as indicated by the user's history. HISTORICAL_VIEW: Represents a visit to the given `url` as indicated by the user's history. - enum: - - VIEW - - EDIT - - SEARCH - - COMMENT - - CRAWL - - HISTORICAL_SEARCH - - HISTORICAL_VIEW x-speakeasy-enum-descriptions: VIEW: Represents a visit to the given `url`. EDIT: Represents an edit of the document represented by the `url`. @@ -4779,22 +5572,27 @@ components: HISTORICAL_SEARCH: Represents a search performed at the given `url` as indicated by the user's history. HISTORICAL_VIEW: Represents a visit to the given `url` as indicated by the user's history. params: - $ref: "#/components/schemas/ActivityEventParams" + $ref: '#/components/schemas/ActivityEventParams' timestamp: type: string - description: The ISO 8601 timestamp when the activity began. format: date-time + description: The ISO 8601 timestamp when the activity began. url: - description: The URL of the activity. type: string - Activity: + description: The URL of the activity. required: - - events + - action + - source + - timestamp + - url + Activity: properties: events: type: array items: - $ref: "#/components/schemas/ActivityEvent" + $ref: '#/components/schemas/ActivityEvent' + required: + - events example: events: - url: https://example.com/ @@ -4829,11 +5627,11 @@ components: User: properties: userID: - description: An opaque user ID for the claimed authority (i.e., the actas param, or the origid if actas is not specified). type: string + description: An opaque user ID for the claimed authority (i.e., the actas param, or the origid if actas is not specified). origID: - description: An opaque user ID for the authenticated user (ignores actas). type: string + description: An opaque user ID for the authenticated user (ignores actas). FeedbackChatExchange: properties: timestamp: @@ -4851,13 +5649,13 @@ components: description: Search query performed by the agent. resultDocuments: type: array - description: List of documents read by the agent. items: properties: title: type: string url: type: string + description: List of documents read by the agent. response: type: string ManualFeedbackInfo: @@ -4868,7 +5666,6 @@ components: deprecated: true source: type: string - description: The source associated with the Feedback.event.MANUAL_FEEDBACK event. enum: - AUTOCOMPLETE - CALENDAR @@ -4892,13 +5689,13 @@ components: - SUMMARY - TASKS - TASK_EXECUTION + description: The source associated with the Feedback.event.MANUAL_FEEDBACK event. issue: type: string description: The issue the user indicated in the feedback. deprecated: true issues: type: array - description: The issue(s) the user indicated in the feedback. items: type: string enum: @@ -4917,6 +5714,7 @@ components: - RESULTS_HELPFUL - RESULTS_POOR_ORDER - TOO_MUCH_ONE_KIND + description: The issue(s) the user indicated in the feedback. imageUrls: type: array items: @@ -4947,17 +5745,17 @@ components: chatTranscript: type: array items: - $ref: "#/components/schemas/FeedbackChatExchange" + $ref: '#/components/schemas/FeedbackChatExchange' description: Array of previous request/response exchanges, ordered by oldest to newest. numQueriesFromFirstRun: type: integer description: How many times this query has been run in the past. vote: type: string - description: The vote associated with the Feedback.event.MANUAL_FEEDBACK event. enum: - UPVOTE - DOWNVOTE + description: The vote associated with the Feedback.event.MANUAL_FEEDBACK event. rating: type: integer description: A rating associated with the user feedback. The value will be between one and the maximum given by ratingScale, inclusive. @@ -4977,15 +5775,14 @@ components: description: Human-readable name for this implementation (e.g., "Variant A", "GPT-4", "Claude"). searchParams: type: object - description: The search/chat parameters used for this implementation. additionalProperties: type: string + description: The search/chat parameters used for this implementation. response: type: string description: The full response generated by this implementation. responseMetadata: type: object - description: Metadata about the response (e.g., latency, token count). properties: latencyMs: type: integer @@ -4996,6 +5793,7 @@ components: modelUsed: type: string description: The specific model version used. + description: Metadata about the response (e.g., latency, token count). ManualFeedbackSideBySideInfo: properties: email: @@ -5003,19 +5801,19 @@ components: description: The email address of the user who submitted the side-by-side feedback. source: type: string - description: The source associated with the side-by-side feedback event. enum: - LIVE_EVAL - CHAT - SEARCH + description: The source associated with the side-by-side feedback event. query: type: string description: The query or prompt that was evaluated across multiple implementations. implementations: type: array - description: Array of implementations that were compared side-by-side. items: - $ref: "#/components/schemas/SideBySideImplementation" + $ref: '#/components/schemas/SideBySideImplementation' + description: Array of implementations that were compared side-by-side. evaluationSessionId: type: string description: Unique identifier for this evaluation session to group related feedback events. @@ -5024,11 +5822,11 @@ components: description: The ID of the implementation this specific feedback event is for. vote: type: string - description: The vote for this specific implementation. enum: - UPVOTE - DOWNVOTE - NEUTRAL + description: The vote for this specific implementation. comments: type: string description: Specific feedback comments for this implementation. @@ -5058,16 +5856,12 @@ components: - HOMEPAGE description: Where the feedback of the workflow originated from Feedback: - required: - - event - - trackingTokens properties: id: type: string description: Universally unique identifier of the event. To allow for reliable retransmission, only the earliest received event of a given UUID is considered valid by the server and subsequent are ignored. category: type: string - description: The feature category to which the feedback applies. These should be broad product areas such as Announcements, Answers, Search, etc. rather than specific components or UI treatments within those areas. enum: - ANNOUNCEMENT - ANSWERS @@ -5083,46 +5877,14 @@ components: - GENERAL - PRISM - PROMPTS + description: The feature category to which the feedback applies. These should be broad product areas such as Announcements, Answers, Search, etc. rather than specific components or UI treatments within those areas. trackingTokens: type: array - description: A list of server-generated trackingTokens to which this event applies. items: type: string + description: A list of server-generated trackingTokens to which this event applies. event: type: string - description: The action the user took within a Glean client with respect to the object referred to by the given `trackingToken`. - x-enumDescriptions: - CLICK: The object's primary link was clicked with the intent to view its full representation. Depending on the object type, this may imply an external navigation or navigating to a new page or view within the Glean app. - CONTAINER_CLICK: A link to the object's parent container (e.g. the folder in which it's located) was clicked. - COPY_LINK: The user copied a link to the primary link. - CREATE: The user creates a document. - DISMISS: The user dismissed the object such that it was hidden from view. - DOWNVOTE: The user gave feedback that the object was not useful. - EMAIL: The user attempted to send an email. - EXECUTE: The user executed the object (e.g. ran a workflow). - FILTER: The user applied a filter. - FIRST_TOKEN: The first token of a streaming response is received. - FOCUS_IN: The user clicked into an interactive element, e.g. the search box. - LAST_TOKEN: The final token of a streaming response is received. - MANUAL_FEEDBACK: The user submitted textual manual feedback regarding the object. - MANUAL_FEEDBACK_SIDE_BY_SIDE: The user submitted comparative feedback for multiple side-by-side implementations. - FEEDBACK_TIME_SAVED: The user submitted feedback about time saved by an agent or workflow. - MARK_AS_READ: The user explicitly marked the content as read. - MESSAGE: The user attempted to send a message using their default messaing app. - MIDDLE_CLICK: The user middle clicked the object's primary link with the intent to open its full representation in a new tab. - PAGE_BLUR: The user puts a page out of focus but keeps it in the background. - PAGE_FOCUS: The user puts a page in focus, meaning it is the first to receive keyboard events. - PAGE_LEAVE: The user leaves a page and it is unloaded (by clicking a link, closing the tab/window, etc). - PREVIEW: The user clicked the object's inline preview affordance. - RIGHT_CLICK: The user right clicked the object's primary link. This may indicate an intent to open it in a new tab or copy it. - SECTION_CLICK: The user clicked a link to a subsection of the primary object. - SEEN: The user has likely seen the object (e.g. took action to make the object visible within the user's viewport). - SELECT: The user explicitly selected something, eg. a chat response variant they prefer. - SHARE: The user shared the object with another user. - SHOW_MORE: The user clicked the object's show more affordance. - UPVOTE: The user gave feedback that the object was useful. - VIEW: The object was visible within the user's viewport. - VISIBLE: The object was visible within the user's viewport. enum: - CLICK - CONTAINER_CLICK @@ -5156,6 +5918,39 @@ components: - UPVOTE - VIEW - VISIBLE + description: The action the user took within a Glean client with respect to the object referred to by the given `trackingToken`. + x-enumDescriptions: + CLICK: The object's primary link was clicked with the intent to view its full representation. Depending on the object type, this may imply an external navigation or navigating to a new page or view within the Glean app. + CONTAINER_CLICK: A link to the object's parent container (e.g. the folder in which it's located) was clicked. + COPY_LINK: The user copied a link to the primary link. + CREATE: The user creates a document. + DISMISS: The user dismissed the object such that it was hidden from view. + DOWNVOTE: The user gave feedback that the object was not useful. + EMAIL: The user attempted to send an email. + EXECUTE: The user executed the object (e.g. ran a workflow). + FILTER: The user applied a filter. + FIRST_TOKEN: The first token of a streaming response is received. + FOCUS_IN: The user clicked into an interactive element, e.g. the search box. + LAST_TOKEN: The final token of a streaming response is received. + MANUAL_FEEDBACK: The user submitted textual manual feedback regarding the object. + MANUAL_FEEDBACK_SIDE_BY_SIDE: The user submitted comparative feedback for multiple side-by-side implementations. + FEEDBACK_TIME_SAVED: The user submitted feedback about time saved by an agent or workflow. + MARK_AS_READ: The user explicitly marked the content as read. + MESSAGE: The user attempted to send a message using their default messaing app. + MIDDLE_CLICK: The user middle clicked the object's primary link with the intent to open its full representation in a new tab. + PAGE_BLUR: The user puts a page out of focus but keeps it in the background. + PAGE_FOCUS: The user puts a page in focus, meaning it is the first to receive keyboard events. + PAGE_LEAVE: The user leaves a page and it is unloaded (by clicking a link, closing the tab/window, etc). + PREVIEW: The user clicked the object's inline preview affordance. + RIGHT_CLICK: The user right clicked the object's primary link. This may indicate an intent to open it in a new tab or copy it. + SECTION_CLICK: The user clicked a link to a subsection of the primary object. + SEEN: The user has likely seen the object (e.g. took action to make the object visible within the user's viewport). + SELECT: The user explicitly selected something, eg. a chat response variant they prefer. + SHARE: The user shared the object with another user. + SHOW_MORE: The user clicked the object's show more affordance. + UPVOTE: The user gave feedback that the object was useful. + VIEW: The object was visible within the user's viewport. + VISIBLE: The object was visible within the user's viewport. x-speakeasy-enum-descriptions: CLICK: The object's primary link was clicked with the intent to view its full representation. Depending on the object type, this may imply an external navigation or navigating to a new page or view within the Glean app. CONTAINER_CLICK: A link to the object's parent container (e.g. the folder in which it's located) was clicked. @@ -5195,65 +5990,67 @@ components: type: string description: For type MANUAL_FEEDBACK, contains string of user feedback. For autocomplete, partial query string. For feed, string of user feedback in addition to manual feedback signals extracted from all suggested content. sessionInfo: - $ref: "#/components/schemas/SessionInfo" + $ref: '#/components/schemas/SessionInfo' timestamp: type: string - description: The ISO 8601 timestamp when the event occured. format: date-time + description: The ISO 8601 timestamp when the event occured. user: - $ref: "#/components/schemas/User" + $ref: '#/components/schemas/User' pathname: type: string description: The path the client was at when the feedback event triggered. channels: type: array - description: Where the feedback will be sent, e.g. to Glean, the user's company, or both. If no channels are specified, feedback will go only to Glean. items: type: string enum: - COMPANY - GLEAN + description: Where the feedback will be sent, e.g. to Glean, the user's company, or both. If no channels are specified, feedback will go only to Glean. url: type: string description: The URL the client was at when the feedback event triggered. uiTree: - description: The UI element tree associated with the event, if any. + type: array items: type: string - type: array + description: The UI element tree associated with the event, if any. uiElement: type: string description: The UI element associated with the event, if any. manualFeedbackInfo: - $ref: "#/components/schemas/ManualFeedbackInfo" + $ref: '#/components/schemas/ManualFeedbackInfo' manualFeedbackSideBySideInfo: - $ref: "#/components/schemas/ManualFeedbackSideBySideInfo" + $ref: '#/components/schemas/ManualFeedbackSideBySideInfo' seenFeedbackInfo: - $ref: "#/components/schemas/SeenFeedbackInfo" + $ref: '#/components/schemas/SeenFeedbackInfo' userViewInfo: - $ref: "#/components/schemas/UserViewInfo" + $ref: '#/components/schemas/UserViewInfo' workflowFeedbackInfo: - $ref: "#/components/schemas/WorkflowFeedbackInfo" + $ref: '#/components/schemas/WorkflowFeedbackInfo' applicationId: type: string description: The application ID of the client that sent the feedback event. agentId: type: string description: The agent ID of the client that sent the feedback event. + required: + - event + - trackingTokens example: trackingTokens: - trackingTokens event: VIEW StructuredTextMutableProperties: - required: - - text properties: text: type: string example: From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light. + required: + - text ConnectorType: type: string - description: The source from which document content was pulled, e.g. an API crawl or browser history enum: - API_CRAWL - BROWSER_CRAWL @@ -5263,6 +6060,7 @@ components: - PUSH_API - WEB_CRAWL - NATIVE_HISTORY + description: The source from which document content was pulled, e.g. an API crawl or browser history DocumentContent: properties: fullTextList: @@ -5279,16 +6077,16 @@ components: type: string description: The app or other repository type from which the document was extracted connectorType: - $ref: "#/components/schemas/ConnectorType" + $ref: '#/components/schemas/ConnectorType' docType: type: string description: The datasource-specific type of the document (e.g. for Jira issues, this is the issue type such as Bug or Feature Request). content: - $ref: "#/components/schemas/DocumentContent" + $ref: '#/components/schemas/DocumentContent' containerDocument: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' parentDocument: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' title: type: string description: The title of the document. @@ -5296,12 +6094,12 @@ components: type: string description: A permalink for the document. metadata: - $ref: "#/components/schemas/DocumentMetadata" + $ref: '#/components/schemas/DocumentMetadata' sections: type: array - description: A list of content sub-sections in the document, e.g. text blocks with different headings in a Drive doc or Confluence page. items: - $ref: "#/components/schemas/DocumentSection" + $ref: '#/components/schemas/DocumentSection' + description: A list of content sub-sections in the document, e.g. text blocks with different headings in a Drive doc or Confluence page. SearchProviderInfo: properties: name: @@ -5344,13 +6142,13 @@ components: - LT - GT - NOT_EQUALS + example: EQUALS x-enumDescriptions: EQUALS: The value is equal to the specified value. ID_EQUALS: The value is equal to the specified ID. LT: The value is less than the specified value. GT: The value is greater than the specified value. NOT_EQUALS: The value is not equal to the specified value. - example: EQUALS x-speakeasy-enum-descriptions: EQUALS: The value is equal to the specified value. ID_EQUALS: The value is equal to the specified ID. @@ -5359,8 +6157,8 @@ components: NOT_EQUALS: The value is not equal to the specified value. isNegated: type: boolean - deprecated: true description: DEPRECATED - please use relationType instead + deprecated: true x-glean-deprecated: id: 75a48c79-b36a-4171-a0a0-4af7189da66e introduced: "2026-02-05" @@ -5375,12 +6173,12 @@ components: values: type: array items: - $ref: "#/components/schemas/FacetFilterValue" + $ref: '#/components/schemas/FacetFilterValue' description: Within a single FacetFilter, the values are to be treated like an OR. For example, fieldName type with values [EQUALS Presentation, EQUALS Spreadsheet] means we want to show a document if it's a Presentation OR a Spreadsheet. groupName: type: string - example: Spreadsheet description: Indicates the value of a facet, if any, that the given facet is grouped under. This is only used for nested facets, for example, fieldName could be owner and groupName would be Spreadsheet if showing all owners for spreadsheets as a nested facet. + example: Spreadsheet example: fieldName: type values: @@ -5393,7 +6191,7 @@ components: filters: type: array items: - $ref: "#/components/schemas/FacetFilter" + $ref: '#/components/schemas/FacetFilter' description: Within a single FacetFilterSet, the filters are treated as AND. For example, owner Sumeet and type Spreadsheet shows documents that are by Sumeet AND are Spreadsheets. FacetBucketFilter: properties: @@ -5404,9 +6202,6 @@ components: type: string description: The per-term prefix that facet buckets should be filtered on. AuthToken: - required: - - accessToken - - datasource properties: accessToken: type: string @@ -5417,12 +6212,15 @@ components: tokenType: type: string authUser: - description: Used by Google to indicate the index of the logged in user. Useful for generating hyperlinks that support multilogin. type: string + description: Used by Google to indicate the index of the logged in user. Useful for generating hyperlinks that support multilogin. expiration: - description: Unix timestamp when this token expires (in seconds since epoch UTC). type: integer format: int64 + description: Unix timestamp when this token expires (in seconds since epoch UTC). + required: + - accessToken + - datasource example: accessToken: 123abc datasource: gmail @@ -5430,28 +6228,24 @@ components: tokenType: Bearer authUser: "1" DocumentSpec: - x-multiple-discriminators: true oneOf: - type: object - required: - - url properties: url: type: string - x-discriminator: true description: The URL of the document. - - type: object + x-discriminator: true required: - - id + - url + - type: object properties: id: type: string - x-discriminator: true description: The ID of the document. - - type: object + x-discriminator: true required: - - contentId - - ugcType + - id + - type: object properties: ugcType: type: string @@ -5464,15 +6258,15 @@ components: description: The type of the user generated content (UGC datasource). contentId: type: integer - x-discriminator: true description: The numeric id for user generated content. Used for ANNOUNCEMENTS, ANSWERS, COLLECTIONS, SHORTCUTS. + x-discriminator: true docType: type: string description: The specific type of the user generated content type. - - type: object required: + - contentId - ugcType - - ugcId + - type: object properties: ugcType: type: string @@ -5486,21 +6280,23 @@ components: description: The type of the user generated content (UGC datasource). ugcId: type: string - x-discriminator: true description: The string id for user generated content. Used for CHATS. + x-discriminator: true docType: type: string description: The specific type of the user generated content type. + required: + - ugcType + - ugcId + x-multiple-discriminators: true RestrictionFilters: properties: containerSpecs: - description: "Specifications for containers that should be used as part of the restriction (include/exclude). Memberships are recursively defined for a subset of datasources (currently: SharePoint, OneDrive, Google Drive, and Confluence). Please contact the Glean team to enable this for more datasources. Recursive memberships do not apply for Collections." type: array items: - $ref: "#/components/schemas/DocumentSpec" + $ref: '#/components/schemas/DocumentSpec' + description: 'Specifications for containers that should be used as part of the restriction (include/exclude). Memberships are recursively defined for a subset of datasources (currently: SharePoint, OneDrive, Google Drive, and Confluence). Please contact the Glean team to enable this for more datasources. Recursive memberships do not apply for Collections.' SearchRequestOptions: - required: - - facetBucketSize properties: datasourceFilter: type: string @@ -5516,15 +6312,15 @@ components: facetFilters: type: array items: - $ref: "#/components/schemas/FacetFilter" + $ref: '#/components/schemas/FacetFilter' description: A list of filters for the query. An AND is assumed between different facetFilters. For example, owner Sumeet and type Spreadsheet shows documents that are by Sumeet AND are Spreadsheets. facetFilterSets: type: array items: - $ref: "#/components/schemas/FacetFilterSet" + $ref: '#/components/schemas/FacetFilterSet' description: A list of facet filter sets that will be OR'ed together. SearchRequestOptions where both facetFilterSets and facetFilters set are considered as bad request. Callers should set only one of these fields. facetBucketFilter: - $ref: "#/components/schemas/FacetBucketFilter" + $ref: '#/components/schemas/FacetBucketFilter' facetBucketSize: type: integer description: The maximum number of FacetBuckets to return in each FacetResult. @@ -5535,17 +6331,22 @@ components: description: Facets for which FacetResults should be fetched and that don't apply to a particular datasource. If specified, these values will replace the standard default facets (last_updated_at, from, etc.). The requested facets will be returned alongside datasource-specific facets if searching a single datasource. authTokens: type: array - description: Auth tokens which may be used for non-indexed, federated results (e.g. Gmail). items: - $ref: "#/components/schemas/AuthToken" + $ref: '#/components/schemas/AuthToken' + description: Auth tokens which may be used for non-indexed, federated results (e.g. Gmail). fetchAllDatasourceCounts: type: boolean description: Hints that the QE should return result counts (via the datasource facet result) for all supported datasources, rather than just those specified in the datasource[s]Filter responseHints: type: array - description: Array of hints containing which fields should be populated in the response. items: type: string + enum: + - ALL_RESULT_COUNTS + - FACET_RESULTS + - QUERY_METADATA + - RESULTS + - SPELLCHECK_METADATA description: Hints for the response content. x-enumDescriptions: ALL_RESULT_COUNTS: Return result counts for each result set which has non-zero results, even when the request itself is limited to a subset. @@ -5553,18 +6354,13 @@ components: QUERY_METADATA: Returns result counts for each result set which has non-zero results, as well as other information about the search such as suggested spelling corrections. RESULTS: Return search result documents. SPELLCHECK_METADATA: Return metadata pertaining to spellcheck results. - enum: - - ALL_RESULT_COUNTS - - FACET_RESULTS - - QUERY_METADATA - - RESULTS - - SPELLCHECK_METADATA x-speakeasy-enum-descriptions: ALL_RESULT_COUNTS: Return result counts for each result set which has non-zero results, even when the request itself is limited to a subset. FACET_RESULTS: Return only facet results. QUERY_METADATA: Returns result counts for each result set which has non-zero results, as well as other information about the search such as suggested spelling corrections. RESULTS: Return search result documents. SPELLCHECK_METADATA: Return metadata pertaining to spellcheck results. + description: Array of hints containing which fields should be populated in the response. timezoneOffset: type: integer description: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. @@ -5578,11 +6374,13 @@ components: type: boolean description: Enables expanded content to be returned for LLM usage. The size of content per result returned should be modified using maxSnippetSize. Server may return less or more than what is specified in maxSnippetSize. For more details, see https://developers.glean.com/guides/search/llm-content. inclusions: - $ref: "#/components/schemas/RestrictionFilters" + $ref: '#/components/schemas/RestrictionFilters' description: A list of filters which restrict the search results to only the specified content. exclusions: - $ref: "#/components/schemas/RestrictionFilters" + $ref: '#/components/schemas/RestrictionFilters' description: A list of filters specifying content to avoid getting search results from. Exclusions take precendence over inclusions and other query parameters, such as search operators and search facets. + required: + - facetBucketSize example: datasourceFilter: JIRA datasourcesFilter: @@ -5598,9 +6396,6 @@ components: - fieldValues - fieldValues TextRange: - required: - - startIndex - description: A subsection of a given string to which some special formatting should be applied. properties: startIndex: type: integer @@ -5619,8 +6414,11 @@ components: type: string description: The URL associated with the range, if applicable. For example, the linked URL for a LINK range. document: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' description: A document corresponding to the range, if applicable. For example, the cited document for a CITATION range. + required: + - startIndex + description: A subsection of a given string to which some special formatting should be applied. SearchRequestInputDetails: properties: hasCopyPaste: @@ -5629,8 +6427,6 @@ components: example: hasCopyPaste: true QuerySuggestion: - required: - - query properties: missingTerm: type: string @@ -5639,7 +6435,7 @@ components: type: string description: The query being suggested (e.g. enforcing the missing term from the original query). searchProviderInfo: - $ref: "#/components/schemas/SearchProviderInfo" + $ref: '#/components/schemas/SearchProviderInfo' description: Information about the search provider that generated this suggestion. label: type: string @@ -5648,25 +6444,24 @@ components: type: string description: The datasource associated with the suggestion. resultTab: - $ref: "#/components/schemas/ResultTab" + $ref: '#/components/schemas/ResultTab' description: The result tab associated with the suggestion. requestOptions: - $ref: "#/components/schemas/SearchRequestOptions" + $ref: '#/components/schemas/SearchRequestOptions' ranges: type: array items: - $ref: "#/components/schemas/TextRange" + $ref: '#/components/schemas/TextRange' description: The bolded ranges within the query of the QuerySuggestion. inputDetails: - $ref: "#/components/schemas/SearchRequestInputDetails" + $ref: '#/components/schemas/SearchRequestInputDetails' + required: + - query example: query: app:github type:pull author:mortimer label: Mortimer's PRs datasource: github Person: - required: - - name - - obfuscatedId properties: name: type: string @@ -5677,16 +6472,17 @@ components: relatedDocuments: type: array items: - $ref: "#/components/schemas/RelatedDocuments" + $ref: '#/components/schemas/RelatedDocuments' description: A list of documents related to this person. metadata: - $ref: "#/components/schemas/PersonMetadata" + $ref: '#/components/schemas/PersonMetadata' + required: + - name + - obfuscatedId example: name: George Clooney obfuscatedId: abc123 Company: - required: - - name properties: name: type: string @@ -5696,9 +6492,9 @@ components: description: Link to internal company company profile. websiteUrls: type: array - description: Link to company's associated websites. items: type: string + description: Link to company's associated websites. logoUrl: type: string description: The URL of the company's logo. Public, Glean-authenticated and Base64 encoded data URLs are all valid (but not third-party-authenticated URLs). @@ -5735,11 +6531,13 @@ components: type: string description: User facing description of company. example: Financial, software, data, and media company headquartered in Midtown Manhattan, New York City + required: + - name DocumentCounts: type: object - description: A map of {string, int} pairs representing counts of each document type associated with this customer. additionalProperties: type: integer + description: A map of {string, int} pairs representing counts of each document type associated with this customer. CustomDataValue: properties: displayLabel: @@ -5748,54 +6546,51 @@ components: type: string stringListValue: type: array - description: list of strings for multi-value properties items: type: string + description: list of strings for multi-value properties numberValue: type: number booleanValue: type: boolean CustomData: type: object - description: Custom fields specific to individual datasources additionalProperties: - $ref: "#/components/schemas/CustomDataValue" + $ref: '#/components/schemas/CustomDataValue' + description: Custom fields specific to individual datasources CustomerMetadata: properties: datasourceId: type: string description: The user visible id of the salesforce customer account. customData: - $ref: "#/components/schemas/CustomData" + $ref: '#/components/schemas/CustomData' Customer: - required: - - id - - company properties: id: type: string description: Unique identifier. domains: type: array - description: Link to company's associated website domains. items: type: string + description: Link to company's associated website domains. company: - $ref: "#/components/schemas/Company" + $ref: '#/components/schemas/Company' documentCounts: - $ref: "#/components/schemas/DocumentCounts" + $ref: '#/components/schemas/DocumentCounts' poc: type: array - description: A list of POC for company. items: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' + description: A list of POC for company. metadata: - $ref: "#/components/schemas/CustomerMetadata" + $ref: '#/components/schemas/CustomerMetadata' mergedCustomers: type: array - description: A list of Customers. items: - $ref: "#/components/schemas/Customer" + $ref: '#/components/schemas/Customer' + description: A list of Customers. startDate: type: string format: date @@ -5808,44 +6603,46 @@ components: type: string description: User facing (potentially generated) notes about company. example: CIO is interested in trying out the product. - RelatedObject: required: - id + - company + RelatedObject: properties: id: type: string description: The ID of the related object metadata: type: object - description: Some metadata of the object which can be displayed, while not having the actual object. properties: name: type: string description: Placeholder name of the object, not the relationship. + description: Some metadata of the object which can be displayed, while not having the actual object. + required: + - id RelatedObjectEdge: properties: objects: type: array items: - $ref: "#/components/schemas/RelatedObject" + $ref: '#/components/schemas/RelatedObject' RelatedObjects: properties: relatedObjects: type: object - description: A list of objects related to a source object. additionalProperties: - $ref: "#/components/schemas/RelatedObjectEdge" + $ref: '#/components/schemas/RelatedObjectEdge' + description: A list of objects related to a source object. ScopeType: type: string - description: Describes the scope for a ReadPermission, WritePermission, or GrantPermission object enum: - GLOBAL - OWN + description: Describes the scope for a ReadPermission, WritePermission, or GrantPermission object WritePermission: - description: Describes the write permissions levels that a user has for a specific feature properties: scopeType: - $ref: "#/components/schemas/ScopeType" + $ref: '#/components/schemas/ScopeType' create: type: boolean description: True if user has create permission for this feature and scope @@ -5855,33 +6652,31 @@ components: delete: type: boolean description: True if user has delete permission for this feature and scope + description: Describes the write permissions levels that a user has for a specific feature ObjectPermissions: properties: write: - $ref: "#/components/schemas/WritePermission" + $ref: '#/components/schemas/WritePermission' PermissionedObject: properties: permissions: - $ref: "#/components/schemas/ObjectPermissions" + $ref: '#/components/schemas/ObjectPermissions' description: The permissions the current viewer has with respect to a particular object. PersonToTeamRelationship: - required: - - person type: object - description: Metadata about the relationship of a person to a team. properties: person: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' relationship: type: string - description: The team member's relationship to the team. This defaults to MEMBER if not set. - default: MEMBER enum: - MEMBER - MANAGER - LEAD - POINT_OF_CONTACT - OTHER + description: The team member's relationship to the team. This defaults to MEMBER if not set. + default: MEMBER customRelationshipStr: type: string description: Displayed name for the relationship if relationship is set to `OTHER`. @@ -5889,7 +6684,11 @@ components: type: string format: date-time description: The team member's start date + required: + - person + description: Metadata about the relationship of a person to a team. TeamEmail: + type: object properties: email: type: string @@ -5897,9 +6696,8 @@ components: description: An email address type: type: string - default: OTHER description: An enum of `PRIMARY`, `SECONDARY`, `ONCALL`, `OTHER` - type: object + default: OTHER required: - email - type @@ -5920,17 +6718,13 @@ components: CustomFieldValuePerson: properties: person: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' CustomFieldValue: oneOf: - - $ref: "#/components/schemas/CustomFieldValueStr" - - $ref: "#/components/schemas/CustomFieldValueHyperlink" - - $ref: "#/components/schemas/CustomFieldValuePerson" + - $ref: '#/components/schemas/CustomFieldValueStr' + - $ref: '#/components/schemas/CustomFieldValueHyperlink' + - $ref: '#/components/schemas/CustomFieldValuePerson' CustomFieldData: - required: - - label - - values - - displayable properties: label: type: string @@ -5938,20 +6732,21 @@ components: values: type: array items: - $ref: "#/components/schemas/CustomFieldValue" + $ref: '#/components/schemas/CustomFieldValue' displayable: type: boolean description: Determines whether the client should display this custom field default: true - DatasourceProfile: required: - - datasource - - handle + - label + - values + - displayable + DatasourceProfile: properties: datasource: type: string - example: github description: The datasource the profile is of. + example: github handle: type: string description: The display name of the entity in the given datasource. @@ -5964,14 +6759,14 @@ components: isUserGenerated: type: boolean description: For internal use only. True iff the data source profile was manually added by a user from within Glean (aka not from the original data source) + required: + - datasource + - handle Team: allOf: - - $ref: "#/components/schemas/RelatedObjects" - - $ref: "#/components/schemas/PermissionedObject" + - $ref: '#/components/schemas/RelatedObjects' + - $ref: '#/components/schemas/PermissionedObject' - type: object - required: - - id - - name properties: id: type: string @@ -6002,27 +6797,27 @@ components: description: Link to a team page on the internet or your company's intranet members: type: array - description: The members on this team items: - $ref: "#/components/schemas/PersonToTeamRelationship" + $ref: '#/components/schemas/PersonToTeamRelationship' + description: The members on this team memberCount: type: integer description: Number of members on this team (recursive; includes all individuals that belong to this team, and all individuals that belong to a subteam within this team) emails: type: array - description: The emails for this team items: - $ref: "#/components/schemas/TeamEmail" + $ref: '#/components/schemas/TeamEmail' + description: The emails for this team customFields: type: array - description: Customizable fields for additional team information. items: - $ref: "#/components/schemas/CustomFieldData" + $ref: '#/components/schemas/CustomFieldData' + description: Customizable fields for additional team information. datasourceProfiles: type: array - description: The datasource profiles of the team items: - $ref: "#/components/schemas/DatasourceProfile" + $ref: '#/components/schemas/DatasourceProfile' + description: The datasource profiles of the team datasource: type: string description: the data source of the team, e.g. GDRIVE @@ -6035,12 +6830,12 @@ components: description: when this team was last updated. status: type: string - description: whether this team is fully processed or there are still unprocessed operations that'll affect it - default: PROCESSED enum: - PROCESSED - QUEUED_FOR_CREATION - QUEUED_FOR_DELETION + description: whether this team is fully processed or there are still unprocessed operations that'll affect it + default: PROCESSED canBeDeleted: type: boolean description: can this team be deleted. Some manually ingested teams like GCS_CSV or PUSH_API cannot @@ -6048,15 +6843,15 @@ components: loggingId: type: string description: The logging id of the team used in scrubbed logs, client analytics, and metrics. + required: + - id + - name CustomEntityMetadata: properties: customData: - $ref: "#/components/schemas/CustomData" + $ref: '#/components/schemas/CustomData' GroupType: type: string - description: The type of user group - x-enumDescriptions: - COLLECTION_AUDIENCE: Refers to any viewers of the Collection. enum: - DEPARTMENT - ALL @@ -6067,15 +6862,15 @@ components: - REGION - EXTERNAL_GROUP - COLLECTION_AUDIENCE + description: The type of user group + x-enumDescriptions: + COLLECTION_AUDIENCE: Refers to any viewers of the Collection. x-speakeasy-enum-descriptions: COLLECTION_AUDIENCE: Refers to any viewers of the Collection. Group: - required: - - type - - id properties: type: - $ref: "#/components/schemas/GroupType" + $ref: '#/components/schemas/GroupType' id: type: string description: A unique identifier for the group. May be the same as name. @@ -6088,31 +6883,34 @@ components: provisioningId: type: string description: identifier for greenlist provisioning, aka sciokey + required: + - type + - id UserRole: type: string - description: A user's role with respect to a specific document. enum: - OWNER - VIEWER - ANSWER_MODERATOR - EDITOR - VERIFIER + description: A user's role with respect to a specific document. UserRoleSpecification: - required: - - role properties: sourceDocumentSpec: - $ref: "#/components/schemas/DocumentSpec" + $ref: '#/components/schemas/DocumentSpec' description: The document spec of the object this role originates from. The object this role is included with will usually have the same information as this document spec, but if the role is inherited, then the document spec refers to the parent document that the role came from. person: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' group: - $ref: "#/components/schemas/Group" + $ref: '#/components/schemas/Group' role: - $ref: "#/components/schemas/UserRole" + $ref: '#/components/schemas/UserRole' + required: + - role CustomEntity: allOf: - - $ref: "#/components/schemas/PermissionedObject" + - $ref: '#/components/schemas/PermissionedObject' - type: object properties: id: @@ -6128,12 +6926,12 @@ components: type: string description: The type of the entity. Interpretation is specific to each datasource metadata: - $ref: "#/components/schemas/CustomEntityMetadata" + $ref: '#/components/schemas/CustomEntityMetadata' roles: type: array - description: A list of user roles for the custom entity explicitly granted by the owner. items: - $ref: "#/components/schemas/UserRoleSpecification" + $ref: '#/components/schemas/UserRoleSpecification' + description: A list of user roles for the custom entity explicitly granted by the owner. AnswerId: properties: id: @@ -6153,9 +6951,9 @@ components: example: Why is the sky blue? questionVariations: type: array - description: Additional ways of phrasing this question. items: type: string + description: Additional ways of phrasing this question. bodyText: type: string description: The plain text answer to the question. @@ -6172,26 +6970,26 @@ components: x-speakeasy-deprecation-message: "Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Answer Boards no longer supported" audienceFilters: type: array - description: Filters which restrict who should see the answer. Values are taken from the corresponding filters in people search. items: - $ref: "#/components/schemas/FacetFilter" + $ref: '#/components/schemas/FacetFilter' + description: Filters which restrict who should see the answer. Values are taken from the corresponding filters in people search. addedRoles: type: array - description: A list of user roles for the answer added by the owner. items: - $ref: "#/components/schemas/UserRoleSpecification" + $ref: '#/components/schemas/UserRoleSpecification' + description: A list of user roles for the answer added by the owner. removedRoles: type: array - description: A list of user roles for the answer removed by the owner. items: - $ref: "#/components/schemas/UserRoleSpecification" + $ref: '#/components/schemas/UserRoleSpecification' + description: A list of user roles for the answer removed by the owner. roles: type: array - description: A list of roles for this answer explicitly granted by an owner, editor, or admin. items: - $ref: "#/components/schemas/UserRoleSpecification" + $ref: '#/components/schemas/UserRoleSpecification' + description: A list of roles for this answer explicitly granted by an owner, editor, or admin. sourceDocumentSpec: - $ref: "#/components/schemas/DocumentSpec" + $ref: '#/components/schemas/DocumentSpec' sourceType: type: string enum: @@ -6205,47 +7003,44 @@ components: description: An opaque token that represents this particular UGC. To be used for `/feedback` reporting. StructuredText: allOf: - - $ref: "#/components/schemas/StructuredTextMutableProperties" + - $ref: '#/components/schemas/StructuredTextMutableProperties' - type: object properties: structuredList: type: array items: - $ref: "#/components/schemas/StructuredTextItem" + $ref: '#/components/schemas/StructuredTextItem' description: An array of objects each of which contains either a string or a link which optionally corresponds to a document. AnswerLike: properties: user: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' createTime: type: string format: date-time description: The time the user liked the answer in ISO format (ISO 8601). AnswerLikes: - required: - - likedBy - - likedByUser - - numLikes properties: likedBy: type: array items: - $ref: "#/components/schemas/AnswerLike" + $ref: '#/components/schemas/AnswerLike' likedByUser: type: boolean description: Whether the user in context liked the answer. numLikes: type: integer description: The total number of likes for the answer. - Reminder: required: - - assignee - - remindAt + - likedBy + - likedByUser + - numLikes + Reminder: properties: assignee: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' requestor: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' remindAt: type: integer description: Unix timestamp for when the reminder should trigger (in seconds since epoch UTC). @@ -6255,6 +7050,9 @@ components: reason: type: string description: An optional free-text reason for the reminder. This is particularly useful when a reminder is used to ask for verification from another user (for example, "Duplicate", "Incomplete", "Incorrect"). + required: + - assignee + - remindAt TimePoint: properties: epochSeconds: @@ -6274,27 +7072,25 @@ components: description: DEPRECATED - The number of days from now in the past to define lower boundary of time period. deprecated: true start: - $ref: "#/components/schemas/TimePoint" + $ref: '#/components/schemas/TimePoint' end: - $ref: "#/components/schemas/TimePoint" + $ref: '#/components/schemas/TimePoint' CountInfo: - required: - - count properties: count: type: integer description: The counter value period: - $ref: "#/components/schemas/Period" + $ref: '#/components/schemas/Period' org: type: string description: The unit of organization over which we did the count aggregation, e.g. org (department) or company - VerificationMetadata: required: - - documentId + - count + VerificationMetadata: properties: lastVerifier: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' lastVerificationTs: type: integer description: The unix timestamp of the verification (in seconds since epoch UTC). @@ -6302,27 +7098,27 @@ components: type: integer description: The unix timestamp of the verification expiration if applicable (in seconds since epoch UTC). document: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' reminders: type: array items: - $ref: "#/components/schemas/Reminder" + $ref: '#/components/schemas/Reminder' description: Info about all outstanding verification reminders for the document if exists. lastReminder: - $ref: "#/components/schemas/Reminder" + $ref: '#/components/schemas/Reminder' visitorCount: type: array items: - $ref: "#/components/schemas/CountInfo" + $ref: '#/components/schemas/CountInfo' description: Number of visitors to the document during included time periods. candidateVerifiers: type: array items: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' description: List of potential verifiers for the document e.g. old verifiers and/or users with view/edit permissions. - Verification: required: - - state + - documentId + Verification: properties: state: type: string @@ -6332,10 +7128,10 @@ components: - DEPRECATED description: The verification state for the document. metadata: - $ref: "#/components/schemas/VerificationMetadata" - CollectionBaseMutableProperties: + $ref: '#/components/schemas/VerificationMetadata' required: - - name + - state + CollectionBaseMutableProperties: properties: name: type: string @@ -6345,19 +7141,21 @@ components: description: A brief summary of the Collection's contents. addedRoles: type: array - description: A list of added user roles for the Collection. items: - $ref: "#/components/schemas/UserRoleSpecification" + $ref: '#/components/schemas/UserRoleSpecification' + description: A list of added user roles for the Collection. removedRoles: type: array - description: A list of removed user roles for the Collection. items: - $ref: "#/components/schemas/UserRoleSpecification" + $ref: '#/components/schemas/UserRoleSpecification' + description: A list of removed user roles for the Collection. audienceFilters: type: array items: - $ref: "#/components/schemas/FacetFilter" + $ref: '#/components/schemas/FacetFilter' description: Filters which restrict who should see this Collection. Values are taken from the corresponding filters in people search. + required: + - name Thumbnail: properties: photoId: @@ -6368,10 +7166,8 @@ components: description: Thumbnail URL. This can be user provided image and/or from downloaded images hosted by Glean. CollectionMutableProperties: allOf: - - $ref: "#/components/schemas/CollectionBaseMutableProperties" + - $ref: '#/components/schemas/CollectionBaseMutableProperties' - type: object - required: - - name properties: icon: type: string @@ -6383,10 +7179,12 @@ components: type: integer description: The parent of this Collection, or 0 if it's a top-level Collection. thumbnail: - $ref: "#/components/schemas/Thumbnail" + $ref: '#/components/schemas/Thumbnail' allowedDatasource: type: string description: The datasource type this Collection can hold. + required: + - name CollectionItemMutableProperties: properties: name: @@ -6425,30 +7223,30 @@ components: description: For variable shortcuts, contains the URL template; note, `destinationUrl` contains default URL. addedRoles: type: array - description: A list of user roles added for the Shortcut. items: - $ref: "#/components/schemas/UserRoleSpecification" + $ref: '#/components/schemas/UserRoleSpecification' + description: A list of user roles added for the Shortcut. removedRoles: type: array - description: A list of user roles removed for the Shortcut. items: - $ref: "#/components/schemas/UserRoleSpecification" + $ref: '#/components/schemas/UserRoleSpecification' + description: A list of user roles removed for the Shortcut. ShortcutMetadata: properties: createdBy: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' createTime: type: string format: date-time description: The time the shortcut was created in ISO format (ISO 8601). updatedBy: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' updateTime: type: string format: date-time description: The time the shortcut was updated in ISO format (ISO 8601). destinationDocument: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' description: Document that corresponds to the destination URL, if applicable. intermediateUrl: type: string @@ -6464,13 +7262,11 @@ components: description: The URL using which the user can access the edit page of the shortcut. Shortcut: allOf: - - $ref: "#/components/schemas/UserGeneratedContentId" - - $ref: "#/components/schemas/ShortcutMutableProperties" - - $ref: "#/components/schemas/PermissionedObject" - - $ref: "#/components/schemas/ShortcutMetadata" + - $ref: '#/components/schemas/UserGeneratedContentId' + - $ref: '#/components/schemas/ShortcutMutableProperties' + - $ref: '#/components/schemas/PermissionedObject' + - $ref: '#/components/schemas/ShortcutMetadata' - type: object - required: - - inputAlias properties: alias: type: string @@ -6480,18 +7276,17 @@ components: description: Title for the Go Link roles: type: array - description: A list of user roles for the Go Link. items: - $ref: "#/components/schemas/UserRoleSpecification" + $ref: '#/components/schemas/UserRoleSpecification' + description: A list of user roles for the Go Link. + required: + - inputAlias Collection: allOf: - - $ref: "#/components/schemas/CollectionMutableProperties" - - $ref: "#/components/schemas/PermissionedObject" - - $ref: "#/components/schemas/UgcTrackingSignals" + - $ref: '#/components/schemas/CollectionMutableProperties' + - $ref: '#/components/schemas/PermissionedObject' + - $ref: '#/components/schemas/UgcTrackingSignals' - type: object - required: - - id - - description properties: id: type: integer @@ -6503,9 +7298,9 @@ components: type: string format: date-time creator: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' updatedBy: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' itemCount: type: integer description: The number of items currently in the Collection. Separated from the actual items so we can grab the count without items. @@ -6515,10 +7310,10 @@ components: items: type: array items: - $ref: "#/components/schemas/CollectionItem" + $ref: '#/components/schemas/CollectionItem' description: The items in this Collection. pinMetadata: - $ref: "#/components/schemas/CollectionPinnedMetadata" + $ref: '#/components/schemas/CollectionPinnedMetadata' description: Metadata having what categories this Collection is pinned to and the eligible categories to pin to shortcuts: type: array @@ -6528,20 +7323,20 @@ components: children: type: array items: - $ref: "#/components/schemas/Collection" + $ref: '#/components/schemas/Collection' description: The children Collections of this Collection. roles: type: array - description: A list of user roles for the Collection. items: - $ref: "#/components/schemas/UserRoleSpecification" + $ref: '#/components/schemas/UserRoleSpecification' + description: A list of user roles for the Collection. + required: + - id + - description CollectionItem: allOf: - - $ref: "#/components/schemas/CollectionItemMutableProperties" + - $ref: '#/components/schemas/CollectionItemMutableProperties' - type: object - required: - - collectionId - - itemType properties: collectionId: type: integer @@ -6556,20 +7351,20 @@ components: type: string description: Unique identifier for the item within the Collection it belongs to. createdBy: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' description: The person who added this Collection item. createdAt: type: string format: date-time description: Unix timestamp for when the item was first added (in seconds since epoch UTC). document: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' description: The Document this CollectionItem corresponds to (omitted if item is a non-indexed URL). shortcut: - $ref: "#/components/schemas/Shortcut" + $ref: '#/components/schemas/Shortcut' description: The Shortcut this CollectionItem corresponds to (only included if item URL is for a Go Link). collection: - $ref: "#/components/schemas/Collection" + $ref: '#/components/schemas/Collection' description: The Collection this CollectionItem corresponds to (only included if item type is COLLECTION). itemType: type: string @@ -6578,69 +7373,70 @@ components: - TEXT - URL - COLLECTION + required: + - collectionId + - itemType CollectionPinnableCategories: type: string - description: Categories a Collection can be pinned to. enum: - COMPANY_RESOURCE - DEPARTMENT_RESOURCE - TEAM_RESOURCE + description: Categories a Collection can be pinned to. CollectionPinnableTargets: type: string - description: What targets can a Collection be pinned to. enum: - RESOURCE_CARD - TEAM_PROFILE_PAGE + description: What targets can a Collection be pinned to. CollectionPinTarget: - required: - - category properties: category: - $ref: "#/components/schemas/CollectionPinnableCategories" + $ref: '#/components/schemas/CollectionPinnableCategories' value: type: string description: Optional. If category supports values, then the additional value for the category e.g. department name for DEPARTMENT_RESOURCE, team name/id for TEAM_RESOURCE and so on. target: - $ref: "#/components/schemas/CollectionPinnableTargets" - CollectionPinMetadata: + $ref: '#/components/schemas/CollectionPinnableTargets' required: - - id - - target + - category + CollectionPinMetadata: properties: id: type: integer description: The ID of the Collection. target: - $ref: "#/components/schemas/CollectionPinTarget" + $ref: '#/components/schemas/CollectionPinTarget' + required: + - id + - target CollectionPinnedMetadata: properties: existingPins: type: array items: - $ref: "#/components/schemas/CollectionPinTarget" + $ref: '#/components/schemas/CollectionPinTarget' description: List of targets this Collection is pinned to. eligiblePins: type: array items: - $ref: "#/components/schemas/CollectionPinMetadata" + $ref: '#/components/schemas/CollectionPinMetadata' description: List of targets this Collection can be pinned to, excluding the targets this Collection is already pinned to. We also include Collection ID already is pinned to each eligible target, which will be 0 if the target has no pinned Collection. Answer: allOf: - - $ref: "#/components/schemas/AnswerId" - - $ref: "#/components/schemas/AnswerDocId" - - $ref: "#/components/schemas/AnswerMutableProperties" - - $ref: "#/components/schemas/PermissionedObject" - - $ref: "#/components/schemas/UgcTrackingSignals" + - $ref: '#/components/schemas/AnswerId' + - $ref: '#/components/schemas/AnswerDocId' + - $ref: '#/components/schemas/AnswerMutableProperties' + - $ref: '#/components/schemas/PermissionedObject' + - $ref: '#/components/schemas/UgcTrackingSignals' - type: object - required: - - id properties: combinedAnswerText: - $ref: "#/components/schemas/StructuredText" + $ref: '#/components/schemas/StructuredText' likes: - $ref: "#/components/schemas/AnswerLikes" + $ref: '#/components/schemas/AnswerLikes' author: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' createTime: type: string format: date-time @@ -6650,21 +7446,22 @@ components: format: date-time description: The time the answer was last updated in ISO format (ISO 8601). updatedBy: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' verification: - $ref: "#/components/schemas/Verification" + $ref: '#/components/schemas/Verification' collections: type: array - description: The collections to which the answer belongs. items: - $ref: "#/components/schemas/Collection" + $ref: '#/components/schemas/Collection' + description: The collections to which the answer belongs. documentCategory: type: string description: The document's document_category(.proto). sourceDocument: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' + required: + - id FollowupAction: - description: A follow-up action that can be invoked by the user after a response. The action parameters are not included and need to be predicted/filled separately. properties: actionRunId: type: string @@ -6677,9 +7474,9 @@ components: description: The ID of the associated action. parameters: type: object - description: Map of assistant predicted parameters and their corresponding values. additionalProperties: type: string + description: Map of assistant predicted parameters and their corresponding values. recommendationText: type: string description: Text to be displayed to the user when recommending the action instance. @@ -6689,6 +7486,7 @@ components: userConfirmationRequired: type: boolean description: Whether user confirmation is needed before executing this action instance. + description: A follow-up action that can be invoked by the user after a response. The action parameters are not included and need to be predicted/filled separately. GeneratedQna: properties: question: @@ -6703,14 +7501,14 @@ components: type: string description: List of all follow-up prompts generated for the given query or the generated question. followupActions: - description: List of follow-up actions generated for the given query or the generated question. type: array items: - $ref: "#/components/schemas/FollowupAction" + $ref: '#/components/schemas/FollowupAction' + description: List of follow-up actions generated for the given query or the generated question. ranges: type: array items: - $ref: "#/components/schemas/TextRange" + $ref: '#/components/schemas/TextRange' description: Answer subsections to mark with special formatting (citations, bolding etc) status: type: string @@ -6731,14 +7529,12 @@ components: type: string description: An opaque token that represents this particular result in this particular query. To be used for /feedback reporting. SearchResult: - required: - - url allOf: - - $ref: "#/components/schemas/Result" + - $ref: '#/components/schemas/Result' - type: object properties: document: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' title: type: string url: @@ -6749,60 +7545,62 @@ components: snippets: type: array items: - $ref: "#/components/schemas/SearchResultSnippet" + $ref: '#/components/schemas/SearchResultSnippet' description: Text content from the result document which contains search query terms, if available. fullText: type: string description: The full body text of the result if not already contained in the snippets. Only populated for conversation results (e.g. results from a messaging app such as Slack). fullTextList: type: array - description: The full body text of the result if not already contained in the snippets; each item in the array represents a separate line in the original text. Only populated for conversation results (e.g. results from a messaging app such as Slack). items: type: string + description: The full body text of the result if not already contained in the snippets; each item in the array represents a separate line in the original text. Only populated for conversation results (e.g. results from a messaging app such as Slack). relatedResults: type: array items: - $ref: "#/components/schemas/RelatedDocuments" + $ref: '#/components/schemas/RelatedDocuments' description: A list of results related to this search result. Eg. for conversation results it contains individual messages from the conversation document which will be shown on SERP. clusteredResults: type: array - description: A list of results that should be displayed as associated with this result. items: - $ref: "#/components/schemas/SearchResult" + $ref: '#/components/schemas/SearchResult' + description: A list of results that should be displayed as associated with this result. allClusteredResults: type: array - description: A list of results that should be displayed as associated with this result. items: - $ref: "#/components/schemas/ClusterGroup" + $ref: '#/components/schemas/ClusterGroup' + description: A list of results that should be displayed as associated with this result. attachmentCount: type: integer description: The total number of attachments. attachments: type: array - description: A (potentially partial) list of results representing documents attached to the main result document. items: - $ref: "#/components/schemas/SearchResult" + $ref: '#/components/schemas/SearchResult' + description: A (potentially partial) list of results representing documents attached to the main result document. backlinkResults: type: array - description: A list of results that should be displayed as backlinks of this result in reverse chronological order. items: - $ref: "#/components/schemas/SearchResult" + $ref: '#/components/schemas/SearchResult' + description: A list of results that should be displayed as backlinks of this result in reverse chronological order. clusterType: - $ref: "#/components/schemas/ClusterTypeEnum" + $ref: '#/components/schemas/ClusterTypeEnum' mustIncludeSuggestions: - $ref: "#/components/schemas/QuerySuggestionList" + $ref: '#/components/schemas/QuerySuggestionList' querySuggestion: - $ref: "#/components/schemas/QuerySuggestion" + $ref: '#/components/schemas/QuerySuggestion' prominence: - $ref: "#/components/schemas/SearchResultProminenceEnum" + $ref: '#/components/schemas/SearchResultProminenceEnum' attachmentContext: type: string description: Additional context for the relationship between the result and the document it's attached to. pins: type: array - description: A list of pins associated with this search result. items: - $ref: "#/components/schemas/PinDocument" + $ref: '#/components/schemas/PinDocument' + description: A list of pins associated with this search result. + required: + - url example: snippets: - snippet: snippet @@ -6832,10 +7630,8 @@ components: type: string description: Question text that was matched to produce this result. questionResult: - $ref: "#/components/schemas/SearchResult" + $ref: '#/components/schemas/SearchResult' CalendarAttendee: - required: - - person properties: isOrganizer: type: boolean @@ -6844,12 +7640,12 @@ components: type: boolean description: Whether or not this attendee is in a group. Needed temporarily at least to support both flat attendees and tree for compatibility. person: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' groupAttendees: type: array - description: If this attendee is a group, represents the list of individual attendees in the group. items: - $ref: "#/components/schemas/CalendarAttendee" + $ref: '#/components/schemas/CalendarAttendee' + description: If this attendee is a group, represents the list of individual attendees in the group. responseStatus: type: string enum: @@ -6857,12 +7653,14 @@ components: - DECLINED - NO_RESPONSE - TENTATIVE + required: + - person CalendarAttendees: properties: people: type: array items: - $ref: "#/components/schemas/CalendarAttendee" + $ref: '#/components/schemas/CalendarAttendee' description: Full details of some of the attendees of this event isLimit: type: boolean @@ -6899,7 +7697,7 @@ components: type: string format: date-time attendees: - $ref: "#/components/schemas/CalendarAttendees" + $ref: '#/components/schemas/CalendarAttendees' description: The attendee list, including their response status isCancelled: type: boolean @@ -6917,8 +7715,6 @@ components: type: string description: The conference provider (e.g., "Microsoft Teams", "Zoom") AppResult: - required: - - datasource properties: datasource: type: string @@ -6932,6 +7728,8 @@ components: iconUrl: type: string description: If there is available icon URL. + required: + - datasource CodeLine: properties: lineNumber: @@ -6941,7 +7739,7 @@ components: ranges: type: array items: - $ref: "#/components/schemas/TextRange" + $ref: '#/components/schemas/TextRange' description: Index ranges depicting matched sections of the line Code: properties: @@ -6954,7 +7752,7 @@ components: lines: type: array items: - $ref: "#/components/schemas/CodeLine" + $ref: '#/components/schemas/CodeLine' isLastMatch: type: boolean description: Last file match for a repo @@ -6980,11 +7778,10 @@ components: suggestions: type: array items: - $ref: "#/components/schemas/QuerySuggestion" + $ref: '#/components/schemas/QuerySuggestion' person: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' IconConfig: - description: Defines how to render an icon properties: generatedBackgroundColorKey: type: string @@ -7018,13 +7815,13 @@ components: url: type: string description: The URL to an image to be displayed if applicable, e.g. the URL for `iconType.URL` icons. + description: Defines how to render an icon example: color: "#343CED" key: person_icon iconType: GLYPH name: user ChatMetadata: - description: Metadata of a Chat a user had with Glean Assistant. This contains no actual conversational content. properties: id: type: string @@ -7033,7 +7830,7 @@ components: type: integer description: Server Unix timestamp of the creation time (in seconds since epoch UTC). createdBy: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' description: The user who created this Chat. updateTime: type: integer @@ -7048,12 +7845,12 @@ components: type: string description: The display name of the AI App that this Chat is associated to. icon: - $ref: "#/components/schemas/IconConfig" + $ref: '#/components/schemas/IconConfig' + description: Metadata of a Chat a user had with Glean Assistant. This contains no actual conversational content. RelatedDocuments: properties: relation: type: string - description: How this document relates to the including entity. enum: - ATTACHMENT - CANONICAL @@ -7071,6 +7868,7 @@ components: - TICKET - TRANSCRIPT - WITH + description: How this document relates to the including entity. x-enum-varnames: - ATTACHMENT - CANONICAL @@ -7096,11 +7894,11 @@ components: type: string description: Which entity in the response that this entity relates to. Relevant when there are multiple entities associated with the response (such as merged customers) querySuggestion: - $ref: "#/components/schemas/QuerySuggestion" + $ref: '#/components/schemas/QuerySuggestion' documents: type: array items: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' description: A truncated list of documents with this relation. TO BE DEPRECATED. deprecated: true x-glean-deprecated: @@ -7112,7 +7910,7 @@ components: results: type: array items: - $ref: "#/components/schemas/SearchResult" + $ref: '#/components/schemas/SearchResult' description: A truncated list of documents associated with this relation. To be used in favor of `documents` because it contains a trackingToken. RelatedQuestion: properties: @@ -7125,19 +7923,18 @@ components: ranges: type: array items: - $ref: "#/components/schemas/TextRange" + $ref: '#/components/schemas/TextRange' description: Subsections of the answer string to which some special formatting should be applied (eg. bold) EntityType: type: string - description: The type of entity. - x-include-enum-class-prefix: true enum: - PERSON - PROJECT - CUSTOMER + description: The type of entity. + x-include-enum-class-prefix: true Disambiguation: type: object - description: A disambiguation between multiple entities with the same name properties: name: type: string @@ -7146,7 +7943,8 @@ components: type: string description: The unique id of the entity in the knowledge graph type: - $ref: "#/components/schemas/EntityType" + $ref: '#/components/schemas/EntityType' + description: A disambiguation between multiple entities with the same name SearchResultSnippet: properties: mimeType: @@ -7161,15 +7959,15 @@ components: ranges: type: array items: - $ref: "#/components/schemas/TextRange" + $ref: '#/components/schemas/TextRange' description: The bolded ranges within text. url: type: string description: A URL, generated based on availability, that links to the position of the snippet text or to the nearest header above the snippet text. snippet: type: string - deprecated: true description: A matching snippet from the document. Query term matches are marked by the unicode characters uE006 and uE007. Use 'text' field instead. + deprecated: true x-glean-deprecated: id: e55ddf30-7c47-43a5-b775-d78f8b29411a introduced: "2026-02-05" @@ -7181,91 +7979,90 @@ components: snippet: snippet mimeType: mimeType StructuredResult: - description: A single object that can support any object in the work graph. Only a single object will be populated. properties: document: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' person: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' customer: - $ref: "#/components/schemas/Customer" + $ref: '#/components/schemas/Customer' team: - $ref: "#/components/schemas/Team" + $ref: '#/components/schemas/Team' customEntity: - $ref: "#/components/schemas/CustomEntity" + $ref: '#/components/schemas/CustomEntity' answer: - $ref: "#/components/schemas/Answer" + $ref: '#/components/schemas/Answer' generatedQna: - $ref: "#/components/schemas/GeneratedQna" + $ref: '#/components/schemas/GeneratedQna' extractedQnA: - $ref: "#/components/schemas/ExtractedQnA" + $ref: '#/components/schemas/ExtractedQnA' meeting: - $ref: "#/components/schemas/Meeting" + $ref: '#/components/schemas/Meeting' app: - $ref: "#/components/schemas/AppResult" + $ref: '#/components/schemas/AppResult' collection: - $ref: "#/components/schemas/Collection" + $ref: '#/components/schemas/Collection' code: - $ref: "#/components/schemas/Code" + $ref: '#/components/schemas/Code' shortcut: - $ref: "#/components/schemas/Shortcut" + $ref: '#/components/schemas/Shortcut' querySuggestions: - $ref: "#/components/schemas/QuerySuggestionList" + $ref: '#/components/schemas/QuerySuggestionList' chat: - $ref: "#/components/schemas/ChatMetadata" + $ref: '#/components/schemas/ChatMetadata' relatedDocuments: type: array items: - $ref: "#/components/schemas/RelatedDocuments" + $ref: '#/components/schemas/RelatedDocuments' description: A list of documents related to this structured result. relatedQuestion: - $ref: "#/components/schemas/RelatedQuestion" + $ref: '#/components/schemas/RelatedQuestion' disambiguation: - $ref: "#/components/schemas/Disambiguation" + $ref: '#/components/schemas/Disambiguation' snippets: - description: Any snippets associated to the populated object. type: array items: - $ref: "#/components/schemas/SearchResultSnippet" + $ref: '#/components/schemas/SearchResultSnippet' + description: Any snippets associated to the populated object. trackingToken: type: string description: An opaque token that represents this particular result in this particular query. To be used for /feedback reporting. prominence: type: string + enum: + - HERO + - PROMOTED + - STANDARD description: The level of visual distinction that should be given to a result. x-enumDescriptions: HERO: A high-confidence result that should feature prominently on the page. PROMOTED: May not be the best result but should be given additional visual distinction. STANDARD: Should not be distinct from any other results. - enum: - - HERO - - PROMOTED - - STANDARD x-speakeasy-enum-descriptions: HERO: A high-confidence result that should feature prominently on the page. PROMOTED: May not be the best result but should be given additional visual distinction. STANDARD: Should not be distinct from any other results. source: type: string - description: Source context for this result. Possible values depend on the result type. enum: - EXPERT_DETECTION - ENTITY_NLQ - CALENDAR_EVENT - AGENT + description: Source context for this result. Possible values depend on the result type. + description: A single object that can support any object in the work graph. Only a single object will be populated. Result: properties: structuredResults: type: array - description: An array of entities in the work graph retrieved via a data request. items: - $ref: "#/components/schemas/StructuredResult" + $ref: '#/components/schemas/StructuredResult' + description: An array of entities in the work graph retrieved via a data request. trackingToken: type: string description: An opaque token that represents this particular result in this particular query. To be used for /feedback reporting. ClusterTypeEnum: type: string - description: The reason for inclusion of clusteredResults. enum: - SIMILAR - FRESHNESS @@ -7278,32 +8075,33 @@ components: - SUFFIX - AUTHOR_PREFIX - AUTHOR_SUFFIX + description: The reason for inclusion of clusteredResults. ClusterGroup: - required: - - visibleCountHint properties: clusteredResults: type: array - description: A list of results that should be displayed as associated with this result. items: - $ref: "#/components/schemas/SearchResult" + $ref: '#/components/schemas/SearchResult' + description: A list of results that should be displayed as associated with this result. clusterType: - $ref: "#/components/schemas/ClusterTypeEnum" + $ref: '#/components/schemas/ClusterTypeEnum' visibleCountHint: type: integer description: The default number of results to display before truncating and showing a "see more" link + required: + - visibleCountHint SearchResultProminenceEnum: type: string + enum: + - HERO + - PROMOTED + - STANDARD description: | The level of visual distinction that should be given to a result. x-enumDescriptions: HERO: A high-confidence result that should feature prominently on the page. PROMOTED: May not be the best result but should be given additional visual distinction. STANDARD: Should not be distinct from any other results. - enum: - - HERO - - PROMOTED - - STANDARD x-speakeasy-enum-descriptions: HERO: A high-confidence result that should feature prominently on the page. PROMOTED: May not be the best result but should be given additional visual distinction. @@ -7312,20 +8110,18 @@ components: properties: queries: type: array - description: The query strings for which the pinned result will show. items: type: string + description: The query strings for which the pinned result will show. audienceFilters: type: array - description: Filters which restrict who should see the pinned document. Values are taken from the corresponding filters in people search. items: - $ref: "#/components/schemas/FacetFilter" + $ref: '#/components/schemas/FacetFilter' + description: Filters which restrict who should see the pinned document. Values are taken from the corresponding filters in people search. PinDocument: allOf: - - $ref: "#/components/schemas/PinDocumentMutableProperties" + - $ref: '#/components/schemas/PinDocumentMutableProperties' - type: object - required: - - documentId properties: id: type: string @@ -7335,21 +8131,22 @@ components: description: The document which should be a pinned result. audienceFilters: type: array - description: Filters which restrict who should see the pinned document. Values are taken from the corresponding filters in people search. items: - $ref: "#/components/schemas/FacetFilter" + $ref: '#/components/schemas/FacetFilter' + description: Filters which restrict who should see the pinned document. Values are taken from the corresponding filters in people search. attribution: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' updatedBy: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' createTime: type: string format: date-time updateTime: type: string format: date-time + required: + - documentId PersonTeam: - description: Use `id` if you index teams via Glean, and use `name` and `externalLink` if you want to use your own team pages properties: id: type: string @@ -7363,21 +8160,21 @@ components: description: Link to a team page on the internet or your company's intranet relationship: type: string - description: The team member's relationship to the team. This defaults to MEMBER if not set. - default: MEMBER enum: - MEMBER - MANAGER - LEAD - POINT_OF_CONTACT - OTHER + description: The team member's relationship to the team. This defaults to MEMBER if not set. + default: MEMBER joinDate: type: string format: date-time description: The team member's start date + description: Use `id` if you index teams via Glean, and use `name` and `externalLink` if you want to use your own team pages StructuredLocation: type: object - description: Detailed location with information about country, state, city etc. properties: deskLocation: type: string @@ -7406,10 +8203,8 @@ components: countryCode: type: string description: Alpha-2 or Alpha-3 ISO 3166 country code, e.g. US or USA. + description: Detailed location with information about country, state, city etc. SocialNetwork: - required: - - name - - profileUrl properties: name: type: string @@ -7421,11 +8216,10 @@ components: type: string format: url description: Link to profile. - PersonDistance: required: - name - - obfuscatedId - - distance + - profileUrl + PersonDistance: properties: name: type: string @@ -7437,23 +8231,26 @@ components: type: number format: float description: Distance to person, refer to PeopleDistance pipeline on interpretation of the value. + required: + - name + - obfuscatedId + - distance CommunicationChannel: type: string enum: - COMMUNICATION_CHANNEL_EMAIL - COMMUNICATION_CHANNEL_SLACK ChannelInviteInfo: - description: Information regarding the invite status of a person for a particular channel. properties: channel: + $ref: '#/components/schemas/CommunicationChannel' description: Channel through which the invite was sent - $ref: "#/components/schemas/CommunicationChannel" isAutoInvite: - description: Bit that tracks if this invite was automatically sent or user-sent type: boolean + description: Bit that tracks if this invite was automatically sent or user-sent inviter: + $ref: '#/components/schemas/Person' description: The person that invited this person. - $ref: "#/components/schemas/Person" inviteTime: type: string format: date-time @@ -7462,8 +8259,8 @@ components: type: string format: date-time description: The time this person was reminded in ISO format (ISO 8601) if a reminder was sent. + description: Information regarding the invite status of a person for a particular channel. InviteInfo: - description: Information regarding the invite status of a person. properties: signUpTime: type: string @@ -7472,12 +8269,12 @@ components: invites: type: array items: - $ref: "#/components/schemas/ChannelInviteInfo" + $ref: '#/components/schemas/ChannelInviteInfo' description: Latest invites received by the user for each channel inviter: - deprecated: true + $ref: '#/components/schemas/Person' description: The person that invited this person. - $ref: "#/components/schemas/Person" + deprecated: true x-glean-deprecated: id: 1d3cd23f-9085-4378-b466-9bdc2e344a71 introduced: "2026-02-05" @@ -7485,10 +8282,10 @@ components: removal: "2026-10-15" x-speakeasy-deprecation-message: "Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Use ChannelInviteInfo instead" inviteTime: - deprecated: true type: string format: date-time description: The time this person was invited in ISO format (ISO 8601). + deprecated: true x-glean-deprecated: id: 2dc3f572-cded-483d-af07-fc9fc7fd0ae4 introduced: "2026-02-05" @@ -7496,51 +8293,49 @@ components: removal: "2026-10-15" x-speakeasy-deprecation-message: "Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Use ChannelInviteInfo instead" reminderTime: - deprecated: true type: string format: date-time description: The time this person was reminded in ISO format (ISO 8601) if a reminder was sent. + deprecated: true x-glean-deprecated: id: d02d58cf-eb90-45d0-ab90-f7a9d707ae3c introduced: "2026-02-05" message: Use ChannelInviteInfo instead removal: "2026-10-15" x-speakeasy-deprecation-message: "Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Use ChannelInviteInfo instead" + description: Information regarding the invite status of a person. ReadPermission: - description: Describes the read permission level that a user has for a specific feature properties: scopeType: - $ref: "#/components/schemas/ScopeType" + $ref: '#/components/schemas/ScopeType' + description: Describes the read permission level that a user has for a specific feature ReadPermissions: - description: Describes the read permission levels that a user has for permissioned features. Key must be PermissionedFeatureOrObject additionalProperties: type: array - description: List of read permissions (for different scopes but same feature) items: - $ref: "#/components/schemas/ReadPermission" + $ref: '#/components/schemas/ReadPermission' + description: List of read permissions (for different scopes but same feature) + description: Describes the read permission levels that a user has for permissioned features. Key must be PermissionedFeatureOrObject WritePermissions: - description: Describes the write permissions levels that a user has for permissioned features. Key must be PermissionedFeatureOrObject additionalProperties: type: array - description: List of write permissions (for different scopes but same feature) items: - $ref: "#/components/schemas/WritePermission" + $ref: '#/components/schemas/WritePermission' + description: List of write permissions (for different scopes but same feature) + description: Describes the write permissions levels that a user has for permissioned features. Key must be PermissionedFeatureOrObject GrantPermission: - description: Describes the grant permission level that a user has for a specific feature properties: scopeType: - $ref: "#/components/schemas/ScopeType" + $ref: '#/components/schemas/ScopeType' + description: Describes the grant permission level that a user has for a specific feature GrantPermissions: - description: Describes the grant permission levels that a user has for permissioned features. Key must be PermissionedFeatureOrObject additionalProperties: type: array - description: List of grant permissions (for different scopes but same feature) items: - $ref: "#/components/schemas/GrantPermission" + $ref: '#/components/schemas/GrantPermission' + description: List of grant permissions (for different scopes but same feature) + description: Describes the grant permission levels that a user has for permissioned features. Key must be PermissionedFeatureOrObject Permissions: - description: |- - Describes the permissions levels that a user has for permissioned features. When the client sends this, Permissions.read and Permissions.write are the additional permissions granted to a user on top of what they have via their roles. - When the server sends this, Permissions.read and Permissions.write are the complete (merged) set of permissions the user has, and Permissions.roles is just for display purposes. properties: canAdminSearch: type: boolean @@ -7552,23 +8347,23 @@ components: type: boolean description: TODO--deprecate in favor of the read and write properties. True if the user has access to data loss prevention (DLP) features read: - $ref: "#/components/schemas/ReadPermissions" + $ref: '#/components/schemas/ReadPermissions' write: - $ref: "#/components/schemas/WritePermissions" + $ref: '#/components/schemas/WritePermissions' grant: - $ref: "#/components/schemas/GrantPermissions" + $ref: '#/components/schemas/GrantPermissions' role: type: string description: The roleId of the canonical role a user has. The displayName is equal to the roleId. roles: type: array - description: The roleIds of the roles a user has. items: type: string + description: The roleIds of the roles a user has. + description: |- + Describes the permissions levels that a user has for permissioned features. When the client sends this, Permissions.read and Permissions.write are the additional permissions granted to a user on top of what they have via their roles. + When the server sends this, Permissions.read and Permissions.write are the complete (merged) set of permissions the user has, and Permissions.roles is just for display purposes. TimeInterval: - required: - - start - - end properties: start: type: string @@ -7576,21 +8371,23 @@ components: end: type: string description: The RFC3339 timestamp formatted end time of this event. + required: + - start + - end AnonymousEvent: - description: A generic, light-weight calendar event. type: object properties: time: - $ref: "#/components/schemas/TimeInterval" + $ref: '#/components/schemas/TimeInterval' eventType: - description: The nature of the event, for example "out of office". type: string enum: - DEFAULT - OUT_OF_OFFICE + description: The nature of the event, for example "out of office". + description: A generic, light-weight calendar event. Badge: type: object - description: Displays a user's accomplishment or milestone properties: key: type: string @@ -7599,10 +8396,11 @@ components: type: string description: The badge name displayed to users iconConfig: - $ref: "#/components/schemas/IconConfig" + $ref: '#/components/schemas/IconConfig' pinned: type: boolean description: The badge should be shown on the PersonAttribution + description: Displays a user's accomplishment or milestone example: key: deployment_name_new_hire displayName: New hire @@ -7615,17 +8413,17 @@ components: properties: type: type: string - x-enumDescriptions: - FULL_TIME: The person is a current full-time employee of the company. - CONTRACTOR: The person is a current contractor of the company. - NON_EMPLOYEE: The person object represents a non-human actor such as a service or admin account. - FORMER_EMPLOYEE: The person is a previous employee of the company. enum: - FULL_TIME - CONTRACTOR - NON_EMPLOYEE - FORMER_EMPLOYEE example: FULL_TIME + x-enumDescriptions: + FULL_TIME: The person is a current full-time employee of the company. + CONTRACTOR: The person is a current contractor of the company. + NON_EMPLOYEE: The person object represents a non-human actor such as a service or admin account. + FORMER_EMPLOYEE: The person is a previous employee of the company. x-speakeasy-enum-descriptions: FULL_TIME: The person is a current full-time employee of the company. CONTRACTOR: The person is a current contractor of the company. @@ -7647,10 +8445,10 @@ components: type: string description: An organizational unit where everyone has a similar task, e.g. `Engineering`. teams: - description: Info about the employee's team(s). type: array items: - $ref: "#/components/schemas/PersonTeam" + $ref: '#/components/schemas/PersonTeam' + description: Info about the employee's team(s). departmentCount: type: integer description: The number of people in this person's department. @@ -7659,24 +8457,24 @@ components: description: The user's primary email address aliasEmails: type: array - description: Additional email addresses of this user beyond the primary, if any. items: type: string + description: Additional email addresses of this user beyond the primary, if any. location: type: string description: User facing string representing the person's location. structuredLocation: - $ref: "#/components/schemas/StructuredLocation" + $ref: '#/components/schemas/StructuredLocation' externalProfileLink: type: string description: Link to a customer's internal profile page. This is set to '#' when no link is desired. manager: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' managementChain: - description: The chain of reporting in the company as far up as it goes. The last entry is this person's direct manager. type: array items: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' + description: The chain of reporting in the company as far up as it goes. The last entry is this person's direct manager. phone: type: string description: Phone number as a number string. @@ -7705,11 +8503,11 @@ components: reports: type: array items: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' startDate: type: string - description: The date when the employee started. format: date + description: The date when the employee started. endDate: type: string format: date @@ -7730,24 +8528,24 @@ components: type: string description: The preferred name of the person, or a nickname. socialNetwork: - description: List of social network profiles. type: array items: - $ref: "#/components/schemas/SocialNetwork" + $ref: '#/components/schemas/SocialNetwork' + description: List of social network profiles. datasourceProfile: type: array - description: List of profiles this user has in different datasources / tools that they use. items: - $ref: "#/components/schemas/DatasourceProfile" + $ref: '#/components/schemas/DatasourceProfile' + description: List of profiles this user has in different datasources / tools that they use. querySuggestions: - $ref: "#/components/schemas/QuerySuggestionList" + $ref: '#/components/schemas/QuerySuggestionList' peopleDistance: type: array items: - $ref: "#/components/schemas/PersonDistance" + $ref: '#/components/schemas/PersonDistance' description: List of people and distances to those people from this person. Optionally with metadata. inviteInfo: - $ref: "#/components/schemas/InviteInfo" + $ref: '#/components/schemas/InviteInfo' isSignedUp: type: boolean description: Whether the user has signed into Glean at least once. @@ -7756,12 +8554,12 @@ components: format: date-time description: The last time the user has used the Glean extension in ISO 8601 format. permissions: - $ref: "#/components/schemas/Permissions" + $ref: '#/components/schemas/Permissions' customFields: type: array - description: User customizable fields for additional people information. items: - $ref: "#/components/schemas/CustomFieldData" + $ref: '#/components/schemas/CustomFieldData' + description: User customizable fields for additional people information. loggingId: type: string description: The logging id of the person used in scrubbed logs, tracking GA metrics. @@ -7772,7 +8570,7 @@ components: busyEvents: type: array items: - $ref: "#/components/schemas/AnonymousEvent" + $ref: '#/components/schemas/AnonymousEvent' description: Intervals of busy time for this person, along with the type of event they're busy with. profileBoolSettings: type: object @@ -7782,7 +8580,7 @@ components: badges: type: array items: - $ref: "#/components/schemas/Badge" + $ref: '#/components/schemas/Badge' description: The badges that a user has earned over their lifetime. isOrgRoot: type: boolean @@ -7797,6 +8595,13 @@ components: title: Actor DocumentVisibility: type: string + enum: + - PRIVATE + - SPECIFIC_PEOPLE_AND_GROUPS + - DOMAIN_LINK + - DOMAIN_VISIBLE + - PUBLIC_LINK + - PUBLIC_VISIBLE description: The level of visibility of the document as understood by our system. x-enumDescriptions: PRIVATE: Only one person is able to see the document. @@ -7805,13 +8610,6 @@ components: DOMAIN_VISIBLE: Anyone in the domain can search for the document. PUBLIC_LINK: Anyone with the link can see the document. PUBLIC_VISIBLE: Anyone on the internet can search for the document. - enum: - - PRIVATE - - SPECIFIC_PEOPLE_AND_GROUPS - - DOMAIN_LINK - - DOMAIN_VISIBLE - - PUBLIC_LINK - - PUBLIC_VISIBLE x-speakeasy-enum-descriptions: PRIVATE: Only one person is able to see the document. SPECIFIC_PEOPLE_AND_GROUPS: Only specific people and/or groups can see the document. @@ -7829,22 +8627,22 @@ components: reactors: type: array items: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' reactedByViewer: type: boolean description: Whether the user in context reacted with this type to the document. Share: - description: Search endpoint will only fill out numDays ago since that's all we need to display shared badge; docmetadata endpoint will fill out all the fields so that we can display shared badge tooltip - required: - - numDaysAgo properties: numDaysAgo: type: integer description: The number of days that has passed since the share happened sharer: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' sharingDocument: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' + required: + - numDaysAgo + description: Search endpoint will only fill out numDays ago since that's all we need to display shared badge; docmetadata endpoint will fill out all the fields so that we can display shared badge tooltip DocumentInteractions: properties: numComments: @@ -7855,10 +8653,10 @@ components: description: The count of reactions on the document. reactions: type: array - description: To be deprecated in favor of reacts. A (potentially non-exhaustive) list of reactions for the document. - deprecated: true items: type: string + description: To be deprecated in favor of reacts. A (potentially non-exhaustive) list of reactions for the document. + deprecated: true x-glean-deprecated: id: cd754845-6eec-480f-b395-c93478aff563 introduced: "2026-02-05" @@ -7868,14 +8666,14 @@ components: reacts: type: array items: - $ref: "#/components/schemas/Reaction" + $ref: '#/components/schemas/Reaction' shares: type: array items: - $ref: "#/components/schemas/Share" + $ref: '#/components/schemas/Share' description: Describes instances of someone posting a link to this document in one of our indexed datasources. visitorCount: - $ref: "#/components/schemas/CountInfo" + $ref: '#/components/schemas/CountInfo' ViewerInfo: properties: role: @@ -7899,13 +8697,13 @@ components: IndexStatus: properties: lastCrawledTime: - description: When the document was last crawled type: string format: date-time + description: When the document was last crawled lastIndexedTime: - description: When the document was last indexed type: string format: date-time + description: When the document was last indexed DocumentMetadata: properties: datasource: @@ -7946,21 +8744,21 @@ components: type: string format: date-time author: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' owner: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' mentionedPeople: type: array items: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' description: A list of people mentioned in the document. visibility: - $ref: "#/components/schemas/DocumentVisibility" + $ref: '#/components/schemas/DocumentVisibility' components: type: array - description: A list of components this result is associated with. Interpretation is specific to each datasource. (e.g. for Jira issues, these are [components](https://confluence.atlassian.com/jirasoftwarecloud/organizing-work-with-components-764478279.html).) items: type: string + description: A list of components this result is associated with. Interpretation is specific to each datasource. (e.g. for Jira issues, these are [components](https://confluence.atlassian.com/jirasoftwarecloud/organizing-work-with-components-764478279.html).) status: type: string description: The status or disposition of the result. Interpretation is specific to each datasource. (e.g. for Jira issues, this is the issue status such as Done, In Progress or Will Not Fix). @@ -7969,64 +8767,64 @@ components: description: The status category of the result. Meant to be more general than status. Interpretation is specific to each datasource. pins: type: array - description: A list of stars associated with this result. "Pin" is an older name. items: - $ref: "#/components/schemas/PinDocument" + $ref: '#/components/schemas/PinDocument' + description: A list of stars associated with this result. "Pin" is an older name. priority: type: string description: The document priority. Interpretation is datasource specific. assignedTo: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' updatedBy: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' labels: type: array - description: A list of tags for the document. Interpretation is datasource specific. items: type: string + description: A list of tags for the document. Interpretation is datasource specific. collections: type: array - description: A list of collections that the document belongs to. items: - $ref: "#/components/schemas/Collection" + $ref: '#/components/schemas/Collection' + description: A list of collections that the document belongs to. datasourceId: type: string description: The user-visible datasource specific id (e.g. Salesforce case number for example, GitHub PR number). interactions: - $ref: "#/components/schemas/DocumentInteractions" + $ref: '#/components/schemas/DocumentInteractions' verification: - $ref: "#/components/schemas/Verification" + $ref: '#/components/schemas/Verification' viewerInfo: - $ref: "#/components/schemas/ViewerInfo" + $ref: '#/components/schemas/ViewerInfo' permissions: - $ref: "#/components/schemas/ObjectPermissions" + $ref: '#/components/schemas/ObjectPermissions' visitCount: - $ref: "#/components/schemas/CountInfo" + $ref: '#/components/schemas/CountInfo' shortcuts: type: array - description: A list of shortcuts of which destination URL is for the document. items: - $ref: "#/components/schemas/Shortcut" + $ref: '#/components/schemas/Shortcut' + description: A list of shortcuts of which destination URL is for the document. path: type: string description: For file datasources like onedrive/github etc this has the path to the file customData: - $ref: "#/components/schemas/CustomData" + $ref: '#/components/schemas/CustomData' documentCategory: type: string description: The document's document_category(.proto). contactPerson: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' thumbnail: - $ref: "#/components/schemas/Thumbnail" + $ref: '#/components/schemas/Thumbnail' description: A thumbnail image representing this document. indexStatus: - $ref: "#/components/schemas/IndexStatus" + $ref: '#/components/schemas/IndexStatus' ancestors: type: array - description: A list of documents that are ancestors of this document in the hierarchy of the document's datasource, for example parent folders or containers. Ancestors can be of different types and some may not be indexed. Higher level ancestors appear earlier in the list. items: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' + description: A list of documents that are ancestors of this document in the hierarchy of the document's datasource, for example parent folders or containers. Ancestors can be of different types and some may not be indexed. Higher level ancestors appear earlier in the list. example: container: container parentId: JIRA_EN-1337 @@ -8060,14 +8858,14 @@ components: type: string example: https://en.wikipedia.org/wiki/Diffuse_sky_radiation document: - deprecated: true + $ref: '#/components/schemas/Document' description: Deprecated. To be gradually migrated to structuredResult. - $ref: "#/components/schemas/Document" + deprecated: true text: type: string example: Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue. structuredResult: - $ref: "#/components/schemas/StructuredResult" + $ref: '#/components/schemas/StructuredResult' AnnouncementMutableProperties: properties: startTime: @@ -8082,20 +8880,20 @@ components: type: string description: The headline of the announcement. body: - $ref: "#/components/schemas/StructuredText" + $ref: '#/components/schemas/StructuredText' emoji: type: string description: An emoji used to indicate the nature of the announcement. thumbnail: - $ref: "#/components/schemas/Thumbnail" + $ref: '#/components/schemas/Thumbnail' banner: - $ref: "#/components/schemas/Thumbnail" + $ref: '#/components/schemas/Thumbnail' description: Optional variant of thumbnail cropped for header background. audienceFilters: type: array - description: Filters which restrict who should see the announcement. Values are taken from the corresponding filters in people search. items: - $ref: "#/components/schemas/FacetFilter" + $ref: '#/components/schemas/FacetFilter' + description: Filters which restrict who should see the announcement. Values are taken from the corresponding filters in people search. sourceDocumentId: type: string description: The Glean Document ID of the source document this Announcement was created from (e.g. Slack thread). @@ -8122,7 +8920,7 @@ components: description: URL for viewing the announcement. It will be set to document URL for announcements from other datasources e.g. simpplr. Can only be written when channel="SOCIAL_FEED". CreateAnnouncementRequest: allOf: - - $ref: "#/components/schemas/AnnouncementMutableProperties" + - $ref: '#/components/schemas/AnnouncementMutableProperties' - type: object required: - title @@ -8137,17 +8935,17 @@ components: draftId: 342 Announcement: allOf: - - $ref: "#/components/schemas/AnnouncementMutableProperties" - - $ref: "#/components/schemas/DraftProperties" - - $ref: "#/components/schemas/PermissionedObject" - - $ref: "#/components/schemas/UgcTrackingSignals" + - $ref: '#/components/schemas/AnnouncementMutableProperties' + - $ref: '#/components/schemas/DraftProperties' + - $ref: '#/components/schemas/PermissionedObject' + - $ref: '#/components/schemas/UgcTrackingSignals' - type: object properties: id: type: integer description: The opaque id of the announcement. author: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' createTimestamp: type: integer description: Server Unix timestamp of the creation time (in seconds since epoch UTC). @@ -8155,7 +8953,7 @@ components: type: integer description: Server Unix timestamp of the last update time (in seconds since epoch UTC). updatedBy: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' viewerInfo: type: object properties: @@ -8166,31 +8964,31 @@ components: type: boolean description: Whether the viewer has read the announcement. sourceDocument: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' description: The source document if the announcement is created from one. isPublished: type: boolean description: Whether or not the announcement is published. DeleteAnnouncementRequest: - required: - - id properties: id: type: integer description: The opaque id of the announcement to be deleted. + required: + - id UpdateAnnouncementRequest: allOf: - - $ref: "#/components/schemas/AnnouncementMutableProperties" + - $ref: '#/components/schemas/AnnouncementMutableProperties' - type: object + properties: + id: + type: integer + description: The opaque id of the announcement. required: - id - title - startTime - endTime - properties: - id: - type: integer - description: The opaque id of the announcement. AddedCollections: properties: addedCollections: @@ -8200,22 +8998,22 @@ components: description: IDs of Collections to which a document is added. AnswerCreationData: allOf: - - $ref: "#/components/schemas/AnswerMutableProperties" - - $ref: "#/components/schemas/AddedCollections" + - $ref: '#/components/schemas/AnswerMutableProperties' + - $ref: '#/components/schemas/AddedCollections' - type: object properties: combinedAnswerText: - $ref: "#/components/schemas/StructuredTextMutableProperties" + $ref: '#/components/schemas/StructuredTextMutableProperties' CreateAnswerRequest: - required: - - data properties: data: - $ref: "#/components/schemas/AnswerCreationData" + $ref: '#/components/schemas/AnswerCreationData' + required: + - data DeleteAnswerRequest: allOf: - - $ref: "#/components/schemas/AnswerId" - - $ref: "#/components/schemas/AnswerDocId" + - $ref: '#/components/schemas/AnswerId' + - $ref: '#/components/schemas/AnswerDocId' - type: object required: - id @@ -8228,27 +9026,25 @@ components: description: IDs of Collections from which a document is removed. EditAnswerRequest: allOf: - - $ref: "#/components/schemas/AnswerId" - - $ref: "#/components/schemas/AnswerDocId" - - $ref: "#/components/schemas/AnswerMutableProperties" - - $ref: "#/components/schemas/AddedCollections" - - $ref: "#/components/schemas/RemovedCollections" + - $ref: '#/components/schemas/AnswerId' + - $ref: '#/components/schemas/AnswerDocId' + - $ref: '#/components/schemas/AnswerMutableProperties' + - $ref: '#/components/schemas/AddedCollections' + - $ref: '#/components/schemas/RemovedCollections' - type: object - required: - - id properties: combinedAnswerText: - $ref: "#/components/schemas/StructuredTextMutableProperties" + $ref: '#/components/schemas/StructuredTextMutableProperties' + required: + - id GetAnswerRequest: allOf: - - $ref: "#/components/schemas/AnswerId" - - $ref: "#/components/schemas/AnswerDocId" + - $ref: '#/components/schemas/AnswerId' + - $ref: '#/components/schemas/AnswerDocId' AnswerResult: - required: - - answer properties: answer: - $ref: "#/components/schemas/Answer" + $ref: '#/components/schemas/Answer' trackingToken: type: string description: Use `answer.trackingToken` instead. @@ -8259,6 +9055,8 @@ components: message: Use `answer.trackingToken` instead. removal: "2027-01-15" x-speakeasy-deprecation-message: "Deprecated on 2026-05-07, removal scheduled for 2027-01-15: Use `answer.trackingToken` instead." + required: + - answer GetAnswerError: properties: errorType: @@ -8267,37 +9065,37 @@ components: - NO_PERMISSION - INVALID_ID answerAuthor: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' GetAnswerResponse: properties: answerResult: - $ref: "#/components/schemas/AnswerResult" + $ref: '#/components/schemas/AnswerResult' error: - $ref: "#/components/schemas/GetAnswerError" + $ref: '#/components/schemas/GetAnswerError' ListAnswersRequest: properties: boardId: type: integer description: The Answer Board Id to list answers on. ListAnswersResponse: - required: - - answers - - answerResults properties: answerResults: type: array items: - $ref: "#/components/schemas/AnswerResult" + $ref: '#/components/schemas/AnswerResult' description: List of answers with tracking tokens. + required: + - answers + - answerResults AuthStatus: type: string - description: The per-user authorization status for a datasource. enum: - DISABLED - AWAITING_AUTH - AUTHORIZED - STALE_OAUTH - SEG_MIGRATION + description: The per-user authorization status for a datasource. x-enum-varnames: - AUTH_STATUS_DISABLED - AUTH_STATUS_AWAITING_AUTH @@ -8305,8 +9103,6 @@ components: - AUTH_STATUS_STALE_OAUTH - AUTH_STATUS_SEG_MIGRATION UnauthorizedDatasourceInstance: - description: | - A datasource instance that could not return results for this request because the user has not completed or has expired per-user OAuth. properties: datasourceInstance: type: string @@ -8318,48 +9114,56 @@ components: description: Human-readable name of the datasource instance for display. example: Slack authStatus: - $ref: "#/components/schemas/AuthStatus" + $ref: '#/components/schemas/AuthStatus' authUrlRelativePath: type: string description: | Relative path to initiate or resume OAuth for the current user and instance, including a one-time authentication token as a query parameter. Clients should prepend their configured Glean backend base URL. + description: | + A datasource instance that could not return results for this request because the user has not completed or has expired per-user OAuth. CheckDatasourceAuthResponse: - required: - - unauthorizedDatasourceInstances properties: unauthorizedDatasourceInstances: type: array + items: + $ref: '#/components/schemas/UnauthorizedDatasourceInstance' description: | Datasource instances that require per-user OAuth authorization. Empty when all datasources are authorized. - items: - $ref: "#/components/schemas/UnauthorizedDatasourceInstance" - CreateAuthTokenResponse: required: - - token - - expirationTime + - unauthorizedDatasourceInstances + CreateAuthTokenResponse: properties: token: type: string description: An authentication token that can be passed to any endpoint via Bearer Authentication expirationTime: - description: Unix timestamp for when this token expires (in seconds since epoch UTC). type: integer format: int64 + description: Unix timestamp for when this token expires (in seconds since epoch UTC). + required: + - token + - expirationTime ToolSets: type: object - description: The types of tools that the agent is allowed to use. Only works with FAST and ADVANCED `agent` values properties: enableWebSearch: type: boolean - description: "Whether the agent is allowed to use web search (default: true)." + description: 'Whether the agent is allowed to use web search (default: true).' enableCompanyTools: type: boolean - description: "Whether the agent is allowed to search internal company resources (default: true)." + description: 'Whether the agent is allowed to search internal company resources (default: true).' + description: The types of tools that the agent is allowed to use. Only works with FAST and ADVANCED `agent` values AgentConfig: - description: Describes the agent that executes the request. properties: agent: type: string + enum: + - DEFAULT + - GPT + - UNIVERSAL + - FAST + - ADVANCED + - AUTO description: Name of the agent. x-enumDescriptions: DEFAULT: Integrates with your company's knowledge. This will soon be deprecated in favor of the FAST and ADVANCED `agent` values @@ -8368,13 +9172,6 @@ components: FAST: Uses an agent powered by the agentic engine that responds faster but may have lower quality results. Requires the agentic engine to be enabled in the deployment. ADVANCED: Uses an agent powered by the agentic engine that thinks for longer and potentially makes more LLM calls to return higher quality results. Requires the agentic engine to be enabled in the deployment. AUTO: Uses an agent powered by the agentic engine that routes between reasoning efforts based on the question and context. - enum: - - DEFAULT - - GPT - - UNIVERSAL - - FAST - - ADVANCED - - AUTO x-speakeasy-enum-descriptions: DEFAULT: Integrates with your company's knowledge. This will soon be deprecated in favor of the FAST and ADVANCED `agent` values GPT: Communicates directly with the LLM. This will soon be deprecated in favor of the FAST and ADVANCED `agent` values @@ -8383,36 +9180,35 @@ components: ADVANCED: Uses an agent powered by the agentic engine that thinks for longer and potentially makes more LLM calls to return higher quality results. Requires the agentic engine to be enabled in the deployment. AUTO: Uses an agent powered by the agentic engine that routes between reasoning efforts based on the question and context. toolSets: - $ref: "#/components/schemas/ToolSets" + $ref: '#/components/schemas/ToolSets' mode: type: string + enum: + - DEFAULT + - QUICK description: Top level modes to run GleanChat in. x-enumDescriptions: DEFAULT: Used if no mode supplied. QUICK: Deprecated. - enum: - - DEFAULT - - QUICK x-speakeasy-enum-descriptions: DEFAULT: Used if no mode supplied. QUICK: Deprecated. useImageGeneration: type: boolean description: Whether the agent should create an image. + description: Describes the agent that executes the request. ChatFileStatus: type: string - description: Current status of the file. - x-include-enum-class-prefix: true enum: - PROCESSING - PROCESSED - PARTIALLY_PROCESSED - FAILED - DELETED + description: Current status of the file. + x-include-enum-class-prefix: true ChatFileFailureReason: type: string - description: Reason for failed status. - x-include-enum-class-prefix: true enum: - PARSE_FAILED - AV_SCAN_FAILED @@ -8425,12 +9221,13 @@ components: - URL_FETCH_FAILED - EMPTY_CONTENT - AUTH_REQUIRED + description: Reason for failed status. + x-include-enum-class-prefix: true ChatFileMetadata: type: object - description: Metadata of a file uploaded by a user for Chat. properties: status: - $ref: "#/components/schemas/ChatFileStatus" + $ref: '#/components/schemas/ChatFileStatus' uploadTime: type: integer format: int64 @@ -8440,13 +9237,13 @@ components: format: int64 description: Size of the processed file in bytes. failureReason: - $ref: "#/components/schemas/ChatFileFailureReason" + $ref: '#/components/schemas/ChatFileFailureReason' mimeType: - description: MIME type of the file. type: string + description: MIME type of the file. + description: Metadata of a file uploaded by a user for Chat. ChatFile: type: object - description: Structure for file uploaded by a user for Chat. properties: id: type: string @@ -8461,38 +9258,39 @@ components: description: Name of the uploaded file. example: sample.pdf metadata: - $ref: "#/components/schemas/ChatFileMetadata" + $ref: '#/components/schemas/ChatFileMetadata' + description: Structure for file uploaded by a user for Chat. ReferenceRange: - description: Each text range from the response can correspond to an array of snippets from the citation source. properties: textRange: - $ref: "#/components/schemas/TextRange" + $ref: '#/components/schemas/TextRange' snippets: type: array items: - $ref: "#/components/schemas/SearchResultSnippet" + $ref: '#/components/schemas/SearchResultSnippet' + description: Each text range from the response can correspond to an array of snippets from the citation source. ChatMessageCitation: - description: Information about the source for a ChatMessage. properties: trackingToken: type: string description: An opaque token that represents this particular result in this particular ChatMessage. To be used for /feedback reporting. sourceDocument: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' sourceFile: - $ref: "#/components/schemas/ChatFile" + $ref: '#/components/schemas/ChatFile' sourcePerson: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' sourceCustomEntity: - $ref: "#/components/schemas/CustomEntity" + $ref: '#/components/schemas/CustomEntity' referenceRanges: - description: Each reference range and its corresponding snippets type: array items: - $ref: "#/components/schemas/ReferenceRange" + $ref: '#/components/schemas/ReferenceRange' + description: Each reference range and its corresponding snippets + description: Information about the source for a ChatMessage. displayName: - description: Human understandable name of the tool. Max 50 characters. type: string + description: Human understandable name of the tool. Max 50 characters. logoUrl: type: string description: URL used to fetch the logo. @@ -8504,9 +9302,6 @@ components: - Email - Chat message PersonObject: - required: - - name - - obfuscatedId properties: name: type: string @@ -8514,8 +9309,10 @@ components: obfuscatedId: type: string description: An opaque identifier that can be used to request metadata for a Person. + required: + - name + - obfuscatedId AuthConfig: - description: Config for tool's authentication method. type: object properties: isOnPrem: @@ -8547,11 +9344,11 @@ components: description: The type of grant type being used. status: type: string - description: Auth status of the tool. enum: - AWAITING_AUTH - AUTHORIZED - AUTH_DISABLED + description: Auth status of the tool. client_url: type: string format: url @@ -8585,46 +9382,41 @@ components: type: string format: date-time description: The time the tool was last authorized in ISO format (ISO 8601). + description: Config for tool's authentication method. ToolMetadata: - description: The manifest for a tool that can be used to augment Glean Assistant. - required: - - type - - name - - displayName - - displayDescription properties: type: - description: The type of tool. type: string enum: - RETRIEVAL - ACTION + description: The type of tool. name: - description: Unique identifier for the tool. Name should be understandable by the LLM, and will be used to invoke a tool. type: string + description: Unique identifier for the tool. Name should be understandable by the LLM, and will be used to invoke a tool. displayName: - $ref: "#/components/schemas/displayName" + $ref: '#/components/schemas/displayName' toolId: type: string description: An opaque id which is unique identifier for the tool. displayDescription: - description: Description of the tool meant for a human. type: string + description: Description of the tool meant for a human. logoUrl: - $ref: "#/components/schemas/logoUrl" + $ref: '#/components/schemas/logoUrl' objectName: - $ref: "#/components/schemas/objectName" + $ref: '#/components/schemas/objectName' knowledgeType: type: string - description: Indicates the kind of knowledge a tool would access or modify. enum: - NEUTRAL_KNOWLEDGE - COMPANY_KNOWLEDGE - WORLD_KNOWLEDGE + description: Indicates the kind of knowledge a tool would access or modify. createdBy: - $ref: "#/components/schemas/PersonObject" + $ref: '#/components/schemas/PersonObject' lastUpdatedBy: - $ref: "#/components/schemas/PersonObject" + $ref: '#/components/schemas/PersonObject' createdAt: type: string format: date-time @@ -8635,11 +9427,11 @@ components: description: The time the tool was last updated in ISO format (ISO 8601) writeActionType: type: string - description: Valid only for write actions. Represents the type of write action. REDIRECT - The client renders the URL which contains information for carrying out the action. EXECUTION - Send a request to an external server and execute the action. MCP - Send a tools/call request to an MCP server to execute the action. enum: - REDIRECT - EXECUTION - MCP + description: Valid only for write actions. Represents the type of write action. REDIRECT - The client renders the URL which contains information for carrying out the action. EXECUTION - Send a request to an external server and execute the action. MCP - Send a tools/call request to an MCP server to execute the action. authType: type: string enum: @@ -8656,20 +9448,25 @@ components: 'OAUTH_USER' uses individual user tokens for external API calls. 'DWD' refers to domain wide delegation. auth: + $ref: '#/components/schemas/AuthConfig' deprecated: true - $ref: "#/components/schemas/AuthConfig" permissions: + $ref: '#/components/schemas/ObjectPermissions' deprecated: true - $ref: "#/components/schemas/ObjectPermissions" usageInstructions: - description: Usage instructions for the LLM to use this action. type: string + description: Usage instructions for the LLM to use this action. isSetupFinished: type: boolean description: Whether this action has been fully configured and validated. + required: + - type + - name + - displayName + - displayDescription + description: The manifest for a tool that can be used to augment Glean Assistant. PossibleValue: type: object - description: Possible value of a specific parameter properties: value: type: string @@ -8677,17 +9474,18 @@ components: label: type: string description: User-friendly label associated with the value + description: Possible value of a specific parameter WriteActionParameter: type: object properties: type: type: string - description: The type of the value (e.g., integer, string, boolean, etc.) enum: - UNKNOWN - INTEGER - STRING - BOOLEAN + description: The type of the value (e.g., integer, string, boolean, etc.) displayName: type: string description: Human readable display name for the key. @@ -8703,54 +9501,53 @@ components: possibleValues: type: array items: - $ref: "#/components/schemas/PossibleValue" + $ref: '#/components/schemas/PossibleValue' description: Possible values that the parameter can take. ToolInfo: type: object properties: metadata: - $ref: "#/components/schemas/ToolMetadata" + $ref: '#/components/schemas/ToolMetadata' parameters: type: object - description: Parameters supported by the tool. additionalProperties: - $ref: "#/components/schemas/WriteActionParameter" + $ref: '#/components/schemas/WriteActionParameter' + description: Parameters supported by the tool. ChatMessageFragment: - 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. allOf: - - $ref: "#/components/schemas/Result" + - $ref: '#/components/schemas/Result' - type: object properties: text: type: string querySuggestion: + $ref: '#/components/schemas/QuerySuggestion' description: The search queries issued while responding. - $ref: "#/components/schemas/QuerySuggestion" file: + $ref: '#/components/schemas/ChatFile' description: Files referenced in the message fragment. This is used to construct rich-text messages with file references. - $ref: "#/components/schemas/ChatFile" action: + $ref: '#/components/schemas/ToolInfo' description: Basic information about an action. This can be used to construct rich-text messages with action references. - $ref: "#/components/schemas/ToolInfo" citation: + $ref: '#/components/schemas/ChatMessageCitation' description: Inline citation. - $ref: "#/components/schemas/ChatMessageCitation" + 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: - description: A message that is rendered as one coherent unit with one given sender. properties: agentConfig: - $ref: "#/components/schemas/AgentConfig" + $ref: '#/components/schemas/AgentConfig' description: Describes the agent config that generated this message. Populated on responses and not required on requests. author: - default: USER enum: - USER - GLEAN_AI + default: USER citations: type: array items: - $ref: "#/components/schemas/ChatMessageCitation" - description: "Deprecated: Use inline citations via ChatMessageFragment.citation instead. For detailed reference information, use ChatMessageCitation.referenceRanges. This field is still populated for backward compatibility." + $ref: '#/components/schemas/ChatMessageCitation' + description: 'Deprecated: Use inline citations via ChatMessageFragment.citation instead. For detailed reference information, use ChatMessageCitation.referenceRanges. This field is still populated for backward compatibility.' deprecated: true x-glean-deprecated: id: 6446f85e-c90e-4c00-9717-796f9db3dc61 @@ -8765,9 +9562,9 @@ components: description: IDs of files uploaded in the message that are referenced to generate the answer. fragments: type: array - description: A list of rich data used to represent the response or formulate a request. These are linearly stitched together to support richer data formats beyond simple text. items: - $ref: "#/components/schemas/ChatMessageFragment" + $ref: '#/components/schemas/ChatMessageFragment' + description: A list of rich data used to represent the response or formulate a request. These are linearly stitched together to support richer data formats beyond simple text. ts: type: string description: Response timestamp of the message. @@ -8779,8 +9576,24 @@ components: description: Opaque tracking token generated server-side. messageType: type: string - default: CONTENT + enum: + - UPDATE + - CONTENT + - CONTEXT + - CONTROL + - CONTROL_START + - CONTROL_FINISH + - CONTROL_CANCEL + - CONTROL_RETRY + - CONTROL_UNKNOWN + - DEBUG + - DEBUG_EXTERNAL + - ERROR + - HEADING + - WARNING + - SERVER_TOOL description: Semantically groups content of a certain type. It can be used for purposes such as differential UI treatment. USER authored messages should be of type CONTENT and do not need `messageType` specified. + default: CONTENT x-enumDescriptions: UPDATE: An intermediate state message for progress updates. CONTENT: A user query or response message. @@ -8797,22 +9610,6 @@ components: HEADING: A heading message used to distinguish different sections of the holistic response. WARNING: A warning message to be shown to the user. SERVER_TOOL: A message used to for server-side tool auth/use, for request and response. - enum: - - UPDATE - - CONTENT - - CONTEXT - - CONTROL - - CONTROL_START - - CONTROL_FINISH - - CONTROL_CANCEL - - CONTROL_RETRY - - CONTROL_UNKNOWN - - DEBUG - - DEBUG_EXTERNAL - - ERROR - - HEADING - - WARNING - - SERVER_TOOL x-speakeasy-enum-descriptions: UPDATE: An intermediate state message for progress updates. CONTENT: A user query or response message. @@ -8830,22 +9627,20 @@ components: WARNING: A warning message to be shown to the user. SERVER_TOOL: A message used to for server-side tool auth/use, for request and response. hasMoreFragments: - deprecated: true type: boolean description: Signals there are additional response fragments incoming. + deprecated: true + description: A message that is rendered as one coherent unit with one given sender. ChatRequestBase: - required: - - messages - description: The minimal set of fields that form a chat request. properties: messages: type: array - description: A list of chat messages, from most recent to least recent. At least one message must specify a USER author. items: - $ref: "#/components/schemas/ChatMessage" + $ref: '#/components/schemas/ChatMessage' + description: A list of chat messages, from most recent to least recent. At least one message must specify a USER author. sessionInfo: + $ref: '#/components/schemas/SessionInfo' description: Optional object for tracking the session used by the client and for debugging purposes. - $ref: "#/components/schemas/SessionInfo" saveChat: type: boolean description: Save the current interaction as a Chat for the user to access and potentially continue later. @@ -8853,31 +9648,34 @@ components: type: string description: The id of the Chat that context should be retrieved from and messages added to. An empty id starts a new Chat, and the Chat is saved if saveChat is true. agentConfig: - $ref: "#/components/schemas/AgentConfig" + $ref: '#/components/schemas/AgentConfig' description: Describes the agent that will execute the request. + required: + - messages + description: The minimal set of fields that form a chat request. ChatRestrictionFilters: allOf: - - $ref: "#/components/schemas/RestrictionFilters" + - $ref: '#/components/schemas/RestrictionFilters' - type: object properties: documentSpecs: type: array items: - $ref: "#/components/schemas/DocumentSpec" + $ref: '#/components/schemas/DocumentSpec' datasourceInstances: type: array items: type: string ChatRequest: allOf: - - $ref: "#/components/schemas/ChatRequestBase" + - $ref: '#/components/schemas/ChatRequestBase' - type: object properties: inclusions: - $ref: "#/components/schemas/ChatRestrictionFilters" + $ref: '#/components/schemas/ChatRestrictionFilters' description: A list of filters which only allows chat to access certain content. exclusions: - $ref: "#/components/schemas/ChatRestrictionFilters" + $ref: '#/components/schemas/ChatRestrictionFilters' description: A list of filters which disallows chat from accessing certain content. If content is in both inclusions and exclusions, it'll be excluded. timeoutMillis: type: integer @@ -8893,17 +9691,16 @@ components: type: boolean description: If set, response lines will be streamed one-by-one as they become available. Each will be a ChatResponse, formatted as JSON, and separated by a new line. If false, the entire response will be returned at once. Note that if this is set and the model being used does not support streaming, the model's response will not be streamed, but other messages from the endpoint still will be. ChatResponse: - description: A single response from the /chat backend. properties: messages: type: array items: - $ref: "#/components/schemas/ChatMessage" + $ref: '#/components/schemas/ChatMessage' chatId: type: string description: The id of the associated Chat the messages belong to, if one exists. chat: - $ref: "#/components/schemas/ChatMetadata" + $ref: '#/components/schemas/ChatMetadata' followUpPrompts: type: array items: @@ -8917,53 +9714,54 @@ components: chatSessionTrackingToken: type: string description: A token that is used to track the session. + description: A single response from the /chat backend. DeleteChatsRequest: - required: - - ids properties: ids: type: array items: type: string description: A non-empty list of ids of the Chats to be deleted. - GetChatRequest: required: - - id + - ids + GetChatRequest: properties: id: type: string description: The id of the Chat to be retrieved. + required: + - id Chat: - description: A historical representation of a series of chat messages a user had with Glean Assistant. allOf: - - $ref: "#/components/schemas/ChatMetadata" - - $ref: "#/components/schemas/PermissionedObject" + - $ref: '#/components/schemas/ChatMetadata' + - $ref: '#/components/schemas/PermissionedObject' properties: messages: type: array items: - $ref: "#/components/schemas/ChatMessage" + $ref: '#/components/schemas/ChatMessage' description: The chat messages within a Chat. roles: type: array items: - $ref: "#/components/schemas/UserRoleSpecification" + $ref: '#/components/schemas/UserRoleSpecification' description: A list of roles for this Chat. + description: A historical representation of a series of chat messages a user had with Glean Assistant. ChatResult: properties: chat: - $ref: "#/components/schemas/Chat" + $ref: '#/components/schemas/Chat' trackingToken: type: string description: An opaque token that represents this particular Chat. To be used for `/feedback` reporting. GetChatResponse: properties: chatResult: - $ref: "#/components/schemas/ChatResult" + $ref: '#/components/schemas/ChatResult' ChatMetadataResult: properties: chat: - $ref: "#/components/schemas/ChatMetadata" + $ref: '#/components/schemas/ChatMetadata' trackingToken: type: string description: An opaque token that represents this particular Chat. To be used for `/feedback` reporting. @@ -8972,26 +9770,24 @@ components: chatResults: type: array items: - $ref: "#/components/schemas/ChatMetadataResult" + $ref: '#/components/schemas/ChatMetadataResult' x-includeEmpty: true cursor: type: string description: An opaque cursor for fetching the next page of results. If empty, there are no more results. GetChatApplicationRequest: - required: - - id properties: id: type: string description: The id of the Chat application to be retrieved. + required: + - id ChatApplicationDetails: {} GetChatApplicationResponse: properties: application: - $ref: "#/components/schemas/ChatApplicationDetails" + $ref: '#/components/schemas/ChatApplicationDetails' UploadChatFilesRequest: - required: - - files properties: files: type: array @@ -8999,38 +9795,40 @@ components: type: string format: binary description: Raw files to be uploaded for chat in binary format. + required: + - files UploadChatFilesResponse: properties: files: type: array items: - $ref: "#/components/schemas/ChatFile" + $ref: '#/components/schemas/ChatFile' description: Files uploaded for chat. GetChatFilesRequest: - required: - - fileIds properties: fileIds: type: array items: type: string description: IDs of files to fetch. + required: + - fileIds GetChatFilesResponse: properties: files: - description: A map of file IDs to ChatFile structs. type: object additionalProperties: - $ref: "#/components/schemas/ChatFile" + $ref: '#/components/schemas/ChatFile' + description: A map of file IDs to ChatFile structs. DeleteChatFilesRequest: - required: - - fileIds properties: fileIds: type: array items: type: string description: IDs of files to delete. + required: + - fileIds WorkflowDraftableProperties: properties: name: @@ -9039,11 +9837,11 @@ components: WorkflowMutableProperties: type: object allOf: - - $ref: "#/components/schemas/WorkflowDraftableProperties" + - $ref: '#/components/schemas/WorkflowDraftableProperties' - type: object CreateWorkflowRequest: allOf: - - $ref: "#/components/schemas/WorkflowMutableProperties" + - $ref: '#/components/schemas/WorkflowMutableProperties' - type: object properties: transient: @@ -9057,7 +9855,7 @@ components: - type: object properties: author: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' createTimestamp: type: integer description: Server Unix timestamp of the creation time. @@ -9068,20 +9866,20 @@ components: type: integer description: Server Unix timestamp of the last time the draft was saved. lastDraftSavedBy: + $ref: '#/components/schemas/Person' description: The person who last saved the draft. - $ref: "#/components/schemas/Person" lastDraftGitAuthorId: type: string description: ID of the VCS user (e.g. GitHub username) who last saved the draft. Set only by the draft save path via the external Git integration API. lastUpdatedBy: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' AttributionProperties: {} Workflow: allOf: - - $ref: "#/components/schemas/PermissionedObject" - - $ref: "#/components/schemas/WorkflowMutableProperties" - - $ref: "#/components/schemas/WorkflowMetadata" - - $ref: "#/components/schemas/AttributionProperties" + - $ref: '#/components/schemas/PermissionedObject' + - $ref: '#/components/schemas/WorkflowMutableProperties' + - $ref: '#/components/schemas/WorkflowMetadata' + - $ref: '#/components/schemas/AttributionProperties' - type: object properties: id: @@ -9089,29 +9887,24 @@ components: description: The ID of the workflow. verified: type: boolean - readOnly: true description: When present, indicates this workflow is admin-verified. Set via the dedicated admin settings endpoint, not by regular edits. + readOnly: true showOrganizationAsAuthor: type: boolean - readOnly: true description: When true, displays organization name instead of author name in agent card. Set via the dedicated admin settings endpoint, not by regular edits. + readOnly: true WorkflowResult: type: object - required: - - workflow properties: workflow: - $ref: "#/components/schemas/Workflow" + $ref: '#/components/schemas/Workflow' + required: + - workflow CreateWorkflowResponse: allOf: - - $ref: "#/components/schemas/WorkflowResult" + - $ref: '#/components/schemas/WorkflowResult' Agent: - title: Agent type: object - required: - - agent_id - - name - - capabilities properties: agent_id: type: string @@ -9134,12 +9927,6 @@ components: description: The agent metadata. Currently not implemented. capabilities: type: object - title: Agent Capabilities - description: |- - Describes features that the agent supports. example: { - "ap.io.messages": true, - "ap.io.streaming": true - } properties: ap.io.messages: type: boolean @@ -9149,17 +9936,28 @@ components: type: boolean title: Streaming description: Whether the agent supports streaming output. If true, you you can stream agent ouput. All agents currently support streaming. + title: Agent Capabilities additionalProperties: true + description: |- + Describes features that the agent supports. example: { + "ap.io.messages": true, + "ap.io.streaming": true + } + title: Agent + required: + - agent_id + - name + - capabilities ErrorResponse: type: object - description: Error response returned for failed requests properties: message: type: string description: Client-facing error message describing what went wrong + description: Error response returned for failed requests EditWorkflowRequest: allOf: - - $ref: "#/components/schemas/WorkflowMutableProperties" + - $ref: '#/components/schemas/WorkflowMutableProperties' - type: object properties: id: @@ -9167,10 +9965,6 @@ components: description: The workflow ID we want to update. ActionSummary: type: object - description: Represents a minimal summary of an action. - required: - - tool_id - - display_name properties: tool_id: type: string @@ -9203,7 +9997,12 @@ components: Neutral knowledge: - Native tools that don't access or modify content via APIs (e.g., file analyst, think) - Platform read or write tools (creator has to determine their knowledge implications) + required: + - tool_id + - display_name + description: Represents a minimal summary of an action. AgentSchemas: + type: object properties: agent_id: type: string @@ -9225,16 +10024,15 @@ components: description: The schema for the agent output. In JSON Schema format. tools: type: array + items: + $ref: '#/components/schemas/ActionSummary' title: Tools description: List of tools that the agent can invoke. Only included when include_tools query parameter is set to true. - items: - $ref: "#/components/schemas/ActionSummary" - type: object + title: AgentSchemas required: - agent_id - input_schema - output_schema - title: AgentSchemas description: Defines the structure and properties of an agent. SearchAgentsRequest: type: object @@ -9245,12 +10043,12 @@ components: example: HR Policy Agent SearchAgentsResponse: type: object - title: Response Search Agents properties: agents: type: array items: - $ref: "#/components/schemas/Agent" + $ref: '#/components/schemas/Agent' + title: Response Search Agents ContentType: type: string enum: @@ -9264,8 +10062,6 @@ components: description: The role of the message. example: USER content: - title: Content - description: The content of the message. type: array items: type: object @@ -9273,16 +10069,15 @@ components: text: type: string type: - $ref: "#/components/schemas/ContentType" + $ref: '#/components/schemas/ContentType' + title: MessageTextBlock required: - text - type - title: MessageTextBlock + title: Content + description: The content of the message. AgentRunCreate: - description: "Payload for creating a run. **Important**: If the agent uses an input form trigger, the `input` field is required and must include all fields defined in the form schema. Even fields marked as optional in the UI must be included in the request—use an empty string (`\"\"`) for optional fields without values. Omitting required form fields will result in a 500 error." type: object - required: - - agent_id properties: agent_id: type: string @@ -9291,49 +10086,52 @@ components: input: type: object title: Input - description: The input to the agent. Required when the agent uses an input form trigger. additionalProperties: true + description: The input to the agent. Required when the agent uses an input form trigger. messages: type: array items: - $ref: "#/components/schemas/Message" + $ref: '#/components/schemas/Message' title: Messages description: The messages to pass an input to the agent. metadata: type: object title: Metadata - description: The metadata to pass to the agent. additionalProperties: true + description: The metadata to pass to the agent. + required: + - agent_id + description: 'Payload for creating a run. **Important**: If the agent uses an input form trigger, the `input` field is required and must include all fields defined in the form schema. Even fields marked as optional in the UI must be included in the request—use an empty string (`""`) for optional fields without values. Omitting required form fields will result in a 500 error.' AgentExecutionStatus: - description: The status of the run. One of 'error', 'success'. type: string + title: AgentExecutionStatus enum: - error - success - title: AgentExecutionStatus + description: The status of the run. One of 'error', 'success'. AgentRun: allOf: - - $ref: "#/components/schemas/AgentRunCreate" + - $ref: '#/components/schemas/AgentRunCreate' - type: object properties: status: - $ref: "#/components/schemas/AgentExecutionStatus" + $ref: '#/components/schemas/AgentExecutionStatus' AgentRunWaitResponse: type: object properties: run: - $ref: "#/components/schemas/AgentRun" + $ref: '#/components/schemas/AgentRun' title: Run description: The run information. messages: type: array items: - $ref: "#/components/schemas/Message" + $ref: '#/components/schemas/Message' title: Messages description: The messages returned by the run. CollectionItemDescriptor: allOf: - - $ref: "#/components/schemas/CollectionItemMutableProperties" + - $ref: '#/components/schemas/CollectionItemMutableProperties' properties: url: type: string @@ -9351,8 +10149,6 @@ components: - TEXT - URL AddCollectionItemsRequest: - required: - - collectionId properties: collectionId: type: number @@ -9360,8 +10156,10 @@ components: addedCollectionItemDescriptors: type: array items: - $ref: "#/components/schemas/CollectionItemDescriptor" + $ref: '#/components/schemas/CollectionItemDescriptor' description: The CollectionItemDescriptors of the items being added. + required: + - collectionId AddCollectionItemsError: properties: errorType: @@ -9372,21 +10170,19 @@ components: AddCollectionItemsResponse: properties: collection: - $ref: "#/components/schemas/Collection" + $ref: '#/components/schemas/Collection' description: The modified Collection. Only CollectionItemMutableProperties are set for each item. error: - $ref: "#/components/schemas/AddCollectionItemsError" + $ref: '#/components/schemas/AddCollectionItemsError' CreateCollectionRequest: allOf: - - $ref: "#/components/schemas/CollectionMutableProperties" + - $ref: '#/components/schemas/CollectionMutableProperties' - type: object properties: newNextItemId: type: string description: The (optional) ItemId of the next CollectionItem in sequence. If omitted, will be added to the end of the Collection. Only used if parentId is specified. CollectionError: - required: - - errorCode properties: errorCode: type: string @@ -9399,6 +10195,8 @@ components: - WIDTH_VIOLATION - NO_PERMISSIONS - CORRUPT_ITEM + required: + - errorCode CreateCollectionResponse: allOf: - type: object @@ -9409,12 +10207,10 @@ components: - error properties: collection: - $ref: "#/components/schemas/Collection" + $ref: '#/components/schemas/Collection' error: - $ref: "#/components/schemas/CollectionError" + $ref: '#/components/schemas/CollectionError' DeleteCollectionRequest: - required: - - ids properties: ids: type: array @@ -9424,10 +10220,9 @@ components: allowedDatasource: type: string description: The datasource allowed in the Collection to be deleted. - DeleteCollectionItemRequest: required: - - collectionId - - itemId + - ids + DeleteCollectionItemRequest: properties: collectionId: type: number @@ -9438,37 +10233,37 @@ components: documentId: type: string description: The (optional) Glean Document ID of the CollectionItem to remove from this Collection if this is an indexed document. + required: + - collectionId + - itemId DeleteCollectionItemResponse: properties: collection: - $ref: "#/components/schemas/Collection" + $ref: '#/components/schemas/Collection' description: The modified Collection. Only CollectionItemMutableProperties are set for each item. EditCollectionRequest: allOf: - - $ref: "#/components/schemas/CollectionMutableProperties" + - $ref: '#/components/schemas/CollectionMutableProperties' - type: object - required: - - id properties: id: type: integer description: The ID of the Collection to modify. + required: + - id EditCollectionResponse: allOf: - - $ref: "#/components/schemas/Collection" - - $ref: "#/components/schemas/CollectionError" + - $ref: '#/components/schemas/Collection' + - $ref: '#/components/schemas/CollectionError' - type: object properties: collection: - $ref: "#/components/schemas/Collection" + $ref: '#/components/schemas/Collection' error: - $ref: "#/components/schemas/CollectionError" + $ref: '#/components/schemas/CollectionError' EditCollectionItemRequest: - required: - - collectionId - - itemId allOf: - - $ref: "#/components/schemas/CollectionItemMutableProperties" + - $ref: '#/components/schemas/CollectionItemMutableProperties' - type: object properties: collectionId: @@ -9477,14 +10272,15 @@ components: itemId: type: string description: The ID of the CollectionItem to edit. + required: + - collectionId + - itemId EditCollectionItemResponse: properties: collection: - $ref: "#/components/schemas/Collection" + $ref: '#/components/schemas/Collection' description: The modified Collection. Only CollectionItemMutableProperties are set for each item. GetCollectionRequest: - required: - - id properties: id: type: integer @@ -9498,14 +10294,16 @@ components: allowedDatasource: type: string description: The datasource allowed in the Collection returned. + required: + - id GetCollectionResponse: properties: collection: - $ref: "#/components/schemas/Collection" + $ref: '#/components/schemas/Collection' rootCollection: - $ref: "#/components/schemas/Collection" + $ref: '#/components/schemas/Collection' error: - $ref: "#/components/schemas/CollectionError" + $ref: '#/components/schemas/CollectionError' trackingToken: type: string description: Use `collection.trackingToken` instead. @@ -9530,14 +10328,14 @@ components: The datasource type this Collection can hold. ANSWERS - for Collections representing answer boards ListCollectionsResponse: - required: - - collections properties: collections: type: array items: - $ref: "#/components/schemas/Collection" + $ref: '#/components/schemas/Collection' description: List of all Collections, no Collection items are fetched. + required: + - collections GetDocPermissionsRequest: type: object properties: @@ -9553,16 +10351,13 @@ components: type: string description: A list of emails of users who have access to the document. If the document is visible to all Glean users, a list with only a single value of 'VISIBLE_TO_ALL'. GetDocumentsRequest: - required: - - documentSpecs properties: documentSpecs: type: array items: - $ref: "#/components/schemas/DocumentSpec" + $ref: '#/components/schemas/DocumentSpec' description: The specification for the documents to be retrieved. includeFields: - description: List of Document fields to return (that aren't returned by default) type: array items: type: string @@ -9572,28 +10367,29 @@ components: - RECENT_SHARES - DOCUMENT_CONTENT - CUSTOM_METADATA + description: List of Document fields to return (that aren't returned by default) + required: + - documentSpecs DocumentOrError: - x-omit-error-on-success: true oneOf: - - $ref: "#/components/schemas/Document" + - $ref: '#/components/schemas/Document' - type: object - required: - - error properties: error: type: string description: The text for error, reason. x-is-error-field: true + required: + - error + x-omit-error-on-success: true GetDocumentsResponse: properties: documents: type: object additionalProperties: - $ref: "#/components/schemas/DocumentOrError" + $ref: '#/components/schemas/DocumentOrError' description: The document details or the error if document is not found. GetDocumentsByFacetsRequest: - required: - - filterSets properties: datasourcesFilter: type: array @@ -9603,17 +10399,19 @@ components: filterSets: type: array items: - $ref: "#/components/schemas/FacetFilterSet" + $ref: '#/components/schemas/FacetFilterSet' description: A list of facet filter sets that will be OR'ed together. An AND is assumed between different filters in each set. cursor: type: string description: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. + required: + - filterSets GetDocumentsByFacetsResponse: properties: documents: type: array items: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' description: The document details, ordered by score. hasMoreResults: type: boolean @@ -9634,7 +10432,7 @@ components: type: string description: Manager emails whose teams should be filtered for. Empty array means no filtering. dayRange: - $ref: "#/components/schemas/Period" + $ref: '#/components/schemas/Period' description: Time period for which Insights are requested. InsightsAssistantRequest: properties: @@ -9649,7 +10447,7 @@ components: type: string description: Manager emails whose teams should be filtered for. Empty array means no filtering. dayRange: - $ref: "#/components/schemas/Period" + $ref: '#/components/schemas/Period' description: Time period for which Insights are requested. AgentsInsightsV2Request: properties: @@ -9669,7 +10467,7 @@ components: type: string description: Manager emails whose teams should be filtered for. Empty array means no filtering. dayRange: - $ref: "#/components/schemas/Period" + $ref: '#/components/schemas/Period' description: Time period for which Insights are requested. McpInsightsRequest: properties: @@ -9689,7 +10487,7 @@ components: type: string description: Manager emails whose teams should be filtered for. Empty array means no filtering. dayRange: - $ref: "#/components/schemas/Period" + $ref: '#/components/schemas/Period' description: Time period for which Insights are requested. McpBreakdownInsightsRequest: properties: @@ -9709,7 +10507,7 @@ components: type: string description: Manager emails whose teams should be filtered for. Empty array means no filtering. dayRange: - $ref: "#/components/schemas/Period" + $ref: '#/components/schemas/Period' description: Time period for which Insights are requested. breakdownType: type: string @@ -9737,32 +10535,29 @@ components: InsightsRequest: properties: overviewRequest: - $ref: "#/components/schemas/InsightsOverviewRequest" - x-visibility: Public + $ref: '#/components/schemas/InsightsOverviewRequest' description: If specified, will return data for the Overview section of the Insights Dashboard. - assistantRequest: - $ref: "#/components/schemas/InsightsAssistantRequest" x-visibility: Public + assistantRequest: + $ref: '#/components/schemas/InsightsAssistantRequest' description: If specified, will return data for the Assistant section of the Insights Dashboard. - agentsRequest: - $ref: "#/components/schemas/AgentsInsightsV2Request" x-visibility: Public + agentsRequest: + $ref: '#/components/schemas/AgentsInsightsV2Request' description: If specified, will return data for the Agents section of the Insights Dashboard. + x-visibility: Public mcpRequest: - $ref: "#/components/schemas/McpInsightsRequest" + $ref: '#/components/schemas/McpInsightsRequest' description: If specified, will return data for the MCP section of the Insights Dashboard. mcpBreakdownRequest: - $ref: "#/components/schemas/McpBreakdownInsightsRequest" + $ref: '#/components/schemas/McpBreakdownInsightsRequest' disablePerUserInsights: type: boolean description: If true, suppresses the generation of per-user Insights in the response. Default is false. UserActivityInsight: - required: - - user - - activity properties: user: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' activity: type: string enum: @@ -9773,9 +10568,12 @@ components: type: integer description: Unix timestamp of the last activity (in seconds since epoch UTC). activityCount: - $ref: "#/components/schemas/CountInfo" + $ref: '#/components/schemas/CountInfo' activeDayCount: - $ref: "#/components/schemas/CountInfo" + $ref: '#/components/schemas/CountInfo' + required: + - user + - activity GleanAssistInsightsResponse: properties: lastLogTimestamp: @@ -9784,7 +10582,7 @@ components: activityInsights: type: array items: - $ref: "#/components/schemas/UserActivityInsight" + $ref: '#/components/schemas/UserActivityInsight' description: Insights for all active users with respect to set of actions. totalActiveUsers: type: integer @@ -9809,7 +10607,7 @@ components: description: Number of current Weekly Active Users. InsightsSearchSummary: allOf: - - $ref: "#/components/schemas/CurrentActiveUsers" + - $ref: '#/components/schemas/CurrentActiveUsers' - type: object properties: numSearches: @@ -9820,7 +10618,7 @@ components: description: Total number of distinct users who searched over the specified time period. InsightsChatSummary: allOf: - - $ref: "#/components/schemas/CurrentActiveUsers" + - $ref: '#/components/schemas/CurrentActiveUsers' - type: object properties: numChats: @@ -9831,7 +10629,7 @@ components: description: Total number of distinct users who used Chat over the specified time period. InsightsDepartmentsSummary: allOf: - - $ref: "#/components/schemas/CurrentActiveUsers" + - $ref: '#/components/schemas/CurrentActiveUsers' - type: object properties: departments: @@ -9846,28 +10644,26 @@ components: type: integer description: Number of current signed up employees in the specified departments, according to the Org Chart. searchSummary: - $ref: "#/components/schemas/InsightsSearchSummary" + $ref: '#/components/schemas/InsightsSearchSummary' chatSummary: - $ref: "#/components/schemas/InsightsChatSummary" + $ref: '#/components/schemas/InsightsChatSummary' searchActiveUsers: - $ref: "#/components/schemas/CurrentActiveUsers" + $ref: '#/components/schemas/CurrentActiveUsers' description: Search-specific active user counts for the specified departments. assistantActiveUsers: - $ref: "#/components/schemas/CurrentActiveUsers" + $ref: '#/components/schemas/CurrentActiveUsers' description: Assistant-specific active user counts for the specified departments. agentsActiveUsers: - $ref: "#/components/schemas/CurrentActiveUsers" + $ref: '#/components/schemas/CurrentActiveUsers' description: Agents-specific active user counts for the specified departments. mcpActiveUsers: - $ref: "#/components/schemas/CurrentActiveUsers" + $ref: '#/components/schemas/CurrentActiveUsers' description: MCP active user counts for the specified departments. extensionSummary: - $ref: "#/components/schemas/CurrentActiveUsers" + $ref: '#/components/schemas/CurrentActiveUsers' ugcSummary: - $ref: "#/components/schemas/CurrentActiveUsers" + $ref: '#/components/schemas/CurrentActiveUsers' LabeledCountInfo: - required: - - label properties: label: type: string @@ -9875,12 +10671,14 @@ components: countInfo: type: array items: - $ref: "#/components/schemas/CountInfo" + $ref: '#/components/schemas/CountInfo' description: List of data points for counts for a given date period. + required: + - label PerUserInsight: properties: person: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' numSearches: type: integer description: Total number of searches by this user over the specified time period. @@ -9910,7 +10708,7 @@ components: description: Total number of MCP calls for this user over the specified time period. InsightsOverviewResponse: allOf: - - $ref: "#/components/schemas/InsightsDepartmentsSummary" + - $ref: '#/components/schemas/InsightsDepartmentsSummary' - type: object properties: lastUpdatedTs: @@ -9928,43 +10726,43 @@ components: removal: "2027-01-15" x-speakeasy-deprecation-message: "Deprecated on 2026-05-13, removal scheduled for 2027-01-15: This property is no longer supported. Please contact Support for alternatives." monthlyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' weeklyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' dailyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' searchMonthlyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' searchWeeklyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' searchDailyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' assistantMonthlyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' assistantWeeklyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' assistantDailyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' agentsMonthlyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' agentsWeeklyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' agentsDailyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' mcpMonthlyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' mcpWeeklyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' mcpDailyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' searchesTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' assistantInteractionsTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' agentRunsTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' mcpCallsTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' searchDatasourceCounts: type: object additionalProperties: @@ -9978,12 +10776,12 @@ components: perUserInsights: type: array items: - $ref: "#/components/schemas/PerUserInsight" + $ref: '#/components/schemas/PerUserInsight' description: Per-user insights, over the specified time period in the specified departments. All current users in the organization who have signed into Glean at least once are included. PerUserAssistantInsight: properties: person: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' numChatMessages: type: integer description: Total number of chat messages sent by this user over the specified time period. @@ -10001,37 +10799,37 @@ components: description: Total number of days this user was active on the Assistant over the specified time period. AssistantInsightsResponse: allOf: - - $ref: "#/components/schemas/CurrentActiveUsers" + - $ref: '#/components/schemas/CurrentActiveUsers' - type: object properties: lastUpdatedTs: type: integer description: Unix timestamp of the last update for the insights data in the response. monthlyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' weeklyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' dailyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' totalSignups: type: integer description: Number of current signed up employees in the specified departments, according to the Org Chart. chatMessagesTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' summarizationsTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' aiAnswersTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' gleanbotInteractionsTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' perUserInsights: type: array items: - $ref: "#/components/schemas/PerUserAssistantInsight" + $ref: '#/components/schemas/PerUserAssistantInsight' upvotesTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' downvotesTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' PerAgentInsight: properties: agentId: @@ -10041,7 +10839,7 @@ components: type: string description: Agent name icon: - $ref: "#/components/schemas/IconConfig" + $ref: '#/components/schemas/IconConfig' description: Agent icon configuration isDeleted: type: boolean @@ -10059,7 +10857,7 @@ components: type: integer description: Total number of downvotes for this agent over the specified time period. owner: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' description: | The creator/owner of the agent. Absent if agent is deleted or owner is unknown. AgentUseCaseInsight: @@ -10084,7 +10882,7 @@ components: type: string description: Name of the most-used agent for this use case. topAgentIcon: - $ref: "#/components/schemas/IconConfig" + $ref: '#/components/schemas/IconConfig' description: Icon of the most-used agent for this use case. topAgentIsDeleted: type: boolean @@ -10111,7 +10909,7 @@ components: type: string description: Name of the agent to be shown in the agent column in this department over the specified time period. icon: - $ref: "#/components/schemas/IconConfig" + $ref: '#/components/schemas/IconConfig' description: Agent icon configuration isDeleted: type: boolean @@ -10119,7 +10917,7 @@ components: AgentUsersInsight: properties: person: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' departmentName: type: string description: Department name @@ -10145,7 +10943,7 @@ components: type: string description: Agent name icon: - $ref: "#/components/schemas/IconConfig" + $ref: '#/components/schemas/IconConfig' description: Agent icon configuration isDeleted: type: boolean @@ -10162,75 +10960,75 @@ components: description: Total number of users who provided feedback on time saved for this agent over the specified time period. AgentsInsightsV2Response: allOf: - - $ref: "#/components/schemas/CurrentActiveUsers" + - $ref: '#/components/schemas/CurrentActiveUsers' - type: object properties: monthlyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' weeklyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' dailyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' sharedAgentsCount: type: integer description: Total number of shared agents. topAgentsInsights: type: array items: - $ref: "#/components/schemas/PerAgentInsight" + $ref: '#/components/schemas/PerAgentInsight' topUseCasesInsights: type: array items: - $ref: "#/components/schemas/AgentUseCaseInsight" + $ref: '#/components/schemas/AgentUseCaseInsight' agentsUsageByDepartmentInsights: type: array items: - $ref: "#/components/schemas/AgentsUsageByDepartmentInsight" + $ref: '#/components/schemas/AgentsUsageByDepartmentInsight' agentUsersInsights: type: array items: - $ref: "#/components/schemas/AgentUsersInsight" + $ref: '#/components/schemas/AgentUsersInsight' agentsTimeSavedInsights: type: array items: - $ref: "#/components/schemas/AgentsTimeSavedInsight" + $ref: '#/components/schemas/AgentsTimeSavedInsight' description: Insights for agents time saved over the specified time period. dailyAgentRunsTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' successfulRunsTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' failedRunsTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' pausedRunsTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' upvotesTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' downvotesTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' McpInsightsResponse: allOf: - - $ref: "#/components/schemas/CurrentActiveUsers" + - $ref: '#/components/schemas/CurrentActiveUsers' - type: object properties: dailyActiveUsers: type: integer description: Number of current Daily Active Users. monthlyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' weeklyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' dailyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' overallDailyActiveUserTimeseries: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' topHostApplicationsActiveUserTimeseries: type: array items: - $ref: "#/components/schemas/LabeledCountInfo" + $ref: '#/components/schemas/LabeledCountInfo' McpUserBreakdown: properties: person: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' totalCalls: type: integer description: Total number of MCP calls made by this user in the specified time period. @@ -10297,24 +11095,24 @@ components: usersBreakdown: type: array items: - $ref: "#/components/schemas/McpUserBreakdown" + $ref: '#/components/schemas/McpUserBreakdown' hostApplicationsBreakdown: type: array items: - $ref: "#/components/schemas/McpHostApplicationBreakdown" + $ref: '#/components/schemas/McpHostApplicationBreakdown' toolsBreakdown: type: array items: - $ref: "#/components/schemas/McpToolBreakdown" + $ref: '#/components/schemas/McpToolBreakdown' serversBreakdown: type: array items: - $ref: "#/components/schemas/McpServerBreakdown" + $ref: '#/components/schemas/McpServerBreakdown' InsightsResponse: properties: gleanAssist: + $ref: '#/components/schemas/GleanAssistInsightsResponse' deprecated: true - $ref: "#/components/schemas/GleanAssistInsightsResponse" x-glean-deprecated: id: 15850758-4d95-4d98-8d57-39c50663a796 introduced: "2026-02-05" @@ -10322,20 +11120,16 @@ components: removal: "2026-10-15" x-speakeasy-deprecation-message: "Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Field is deprecated" overviewResponse: - $ref: "#/components/schemas/InsightsOverviewResponse" + $ref: '#/components/schemas/InsightsOverviewResponse' assistantResponse: - $ref: "#/components/schemas/AssistantInsightsResponse" + $ref: '#/components/schemas/AssistantInsightsResponse' agentsResponse: - $ref: "#/components/schemas/AgentsInsightsV2Response" + $ref: '#/components/schemas/AgentsInsightsV2Response' mcpResponse: - $ref: "#/components/schemas/McpInsightsResponse" + $ref: '#/components/schemas/McpInsightsResponse' mcpBreakdownResponse: - $ref: "#/components/schemas/McpBreakdownInsightsResponse" + $ref: '#/components/schemas/McpBreakdownInsightsResponse' MessagesRequest: - required: - - id - - idType - - datasource properties: idType: type: string @@ -10375,19 +11169,23 @@ components: datasourceInstanceDisplayName: type: string description: The datasource instance display name from which the document was extracted. This is used for appinstance facet filter for datasources that support multiple instances. + required: + - id + - idType + - datasource InvalidOperatorValueError: properties: key: - description: The operator key that has an invalid value. type: string + description: The operator key that has an invalid value. value: - description: The invalid operator value. type: string + description: The invalid operator value. ErrorMessage: properties: source: - description: The datasource this message relates to. type: string + description: The datasource this message relates to. errorMessage: type: string ErrorInfo: @@ -10400,13 +11198,13 @@ components: description: Indicates the outlook results could not be fetched due to bad token. invalidOperators: type: array - description: Indicates results could not be fetched due to invalid operators in the query. items: - $ref: "#/components/schemas/InvalidOperatorValueError" + $ref: '#/components/schemas/InvalidOperatorValueError' + description: Indicates results could not be fetched due to invalid operators in the query. errorMessages: type: array items: - $ref: "#/components/schemas/ErrorMessage" + $ref: '#/components/schemas/ErrorMessage' federatedSearchRateLimitError: type: boolean description: Indicates the federated search results could not be fetched due to rate limiting. @@ -10417,19 +11215,19 @@ components: type: string description: A token that should be passed for additional requests related to this request (such as more results requests). sessionInfo: - $ref: "#/components/schemas/SessionInfo" + $ref: '#/components/schemas/SessionInfo' results: type: array items: - $ref: "#/components/schemas/SearchResult" + $ref: '#/components/schemas/SearchResult' structuredResults: type: array items: - $ref: "#/components/schemas/StructuredResult" + $ref: '#/components/schemas/StructuredResult' generatedQnaResult: - $ref: "#/components/schemas/GeneratedQna" + $ref: '#/components/schemas/GeneratedQna' errorInfo: - $ref: "#/components/schemas/ErrorInfo" + $ref: '#/components/schemas/ErrorInfo' requestID: type: string description: A platform-generated request ID to correlate backend logs. @@ -10447,8 +11245,6 @@ components: format: int64 description: List of experiment ids for the corresponding request. SearchWarning: - required: - - warningType properties: warningType: type: string @@ -10472,6 +11268,8 @@ components: items: type: string description: A list of query terms that were ignored when generating search results, if any. For example, terms containing invalid filters such as "updated:invalid_date" will be ignored. + required: + - warningType SearchResponseMetadata: properties: rewrittenQuery: @@ -10487,16 +11285,16 @@ components: searchedQueryRanges: type: array items: - $ref: "#/components/schemas/TextRange" + $ref: '#/components/schemas/TextRange' description: The bolded ranges within the searched query. originalQuery: type: string description: The query text sent by the client in the request. querySuggestion: - $ref: "#/components/schemas/QuerySuggestion" + $ref: '#/components/schemas/QuerySuggestion' description: An alternative query to the one provided that may give better results, e.g. a spelling suggestion. additionalQuerySuggestions: - $ref: "#/components/schemas/QuerySuggestionList" + $ref: '#/components/schemas/QuerySuggestionList' description: Other alternative queries that may provide better or more specific results than the original query. negatedTerms: type: array @@ -10510,7 +11308,7 @@ components: type: boolean description: No results were found for the original query. The usage of this bit in conjunction with modifiedQueryWasUsed will dictate whether the full page replacement is 0-result or few-result based. searchWarning: - $ref: "#/components/schemas/SearchWarning" + $ref: '#/components/schemas/SearchWarning' triggeredExpertDetection: type: boolean description: Whether the query triggered expert detection results in the People tab. @@ -10521,17 +11319,17 @@ components: properties: stringValue: type: string - example: engineering description: The value that should be set in the FacetFilter when applying this filter to a search request. + example: engineering integerValue: type: integer example: 5 displayLabel: type: string - example: engineering description: An optional user-friendly label to display in place of the facet value. + example: engineering iconConfig: - $ref: "#/components/schemas/IconConfig" + $ref: '#/components/schemas/IconConfig' FacetBucket: properties: count: @@ -10540,14 +11338,14 @@ components: example: 1 datasource: type: string - example: jira description: The datasource the value belongs to. This will be used by the all tab to show types across all datasources. + example: jira percentage: type: integer description: Estimated percentage of results in this facet. example: 5 value: - $ref: "#/components/schemas/FacetValue" + $ref: '#/components/schemas/FacetValue' FacetResult: properties: sourceName: @@ -10560,9 +11358,9 @@ components: example: SelectMultiple buckets: type: array - description: A list of unique buckets that exist within this result set. items: - $ref: "#/components/schemas/FacetBucket" + $ref: '#/components/schemas/FacetBucket' + description: A list of unique buckets that exist within this result set. hasMoreBuckets: type: boolean description: Returns true if more buckets exist than those returned. Additional buckets can be retrieve by requesting again with a higher facetBucketSize. @@ -10577,24 +11375,24 @@ components: type: string description: Textual description of the results. Can be shown at the top of SERP, e.g. 'People who write about this topic' for experts in people tab. iconConfig: - $ref: "#/components/schemas/IconConfig" + $ref: '#/components/schemas/IconConfig' description: The config for the icon that's displayed with this description SearchResponse: allOf: - - $ref: "#/components/schemas/ResultsResponse" - - $ref: "#/components/schemas/BackendExperimentsContext" + - $ref: '#/components/schemas/ResultsResponse' + - $ref: '#/components/schemas/BackendExperimentsContext' - type: object properties: metadata: - $ref: "#/components/schemas/SearchResponseMetadata" + $ref: '#/components/schemas/SearchResponseMetadata' facetResults: type: array items: - $ref: "#/components/schemas/FacetResult" + $ref: '#/components/schemas/FacetResult' resultTabs: type: array items: - $ref: "#/components/schemas/ResultTab" + $ref: '#/components/schemas/ResultTab' description: All result tabs available for the current query. Populated if QUERY_METADATA is specified in the request. resultTabIds: type: array @@ -10602,11 +11400,11 @@ components: type: string description: The unique IDs of the result tabs to which this response belongs. resultsDescription: - $ref: "#/components/schemas/ResultsDescription" + $ref: '#/components/schemas/ResultsDescription' rewrittenFacetFilters: type: array items: - $ref: "#/components/schemas/FacetFilter" + $ref: '#/components/schemas/FacetFilter' description: The actual applied facet filters based on the operators and facetFilters in the query. Useful for mapping typed operators to visual facets. cursor: type: string @@ -10696,19 +11494,19 @@ components: - fieldValues - fieldValues MessagesResponse: - required: - - hasMore properties: hasMore: type: boolean description: Whether there are more results for client to continue requesting. searchResponse: - $ref: "#/components/schemas/SearchResponse" + $ref: '#/components/schemas/SearchResponse' rootMessage: - $ref: "#/components/schemas/SearchResult" + $ref: '#/components/schemas/SearchResult' + required: + - hasMore EditPinRequest: allOf: - - $ref: "#/components/schemas/PinDocumentMutableProperties" + - $ref: '#/components/schemas/PinDocumentMutableProperties' - type: object properties: id: @@ -10722,19 +11520,19 @@ components: GetPinResponse: properties: pin: - $ref: "#/components/schemas/PinDocument" + $ref: '#/components/schemas/PinDocument' ListPinsResponse: - required: - - pins properties: pins: type: array items: - $ref: "#/components/schemas/PinDocument" + $ref: '#/components/schemas/PinDocument' description: List of pinned documents. + required: + - pins PinRequest: allOf: - - $ref: "#/components/schemas/PinDocumentMutableProperties" + - $ref: '#/components/schemas/PinDocumentMutableProperties' - type: object properties: documentId: @@ -10749,29 +11547,27 @@ components: properties: timestamp: type: string - description: The ISO 8601 timestamp associated with the client request. format: date-time + description: The ISO 8601 timestamp associated with the client request. trackingToken: type: string description: A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. sessionInfo: - $ref: "#/components/schemas/SessionInfo" + $ref: '#/components/schemas/SessionInfo' sourceDocument: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' description: The document from which the ResultsRequest is issued, if any. pageSize: type: integer - example: 100 description: Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. + example: 100 maxSnippetSize: type: integer description: Hint to the server about how many characters long a snippet may be. Server may return less or more. example: 400 SearchRequest: - required: - - query allOf: - - $ref: "#/components/schemas/ResultsRequest" + - $ref: '#/components/schemas/ResultsRequest' - type: object properties: query: @@ -10787,9 +11583,9 @@ components: type: string description: The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. inputDetails: - $ref: "#/components/schemas/SearchRequestInputDetails" + $ref: '#/components/schemas/SearchRequestInputDetails' requestOptions: - $ref: "#/components/schemas/SearchRequestOptions" + $ref: '#/components/schemas/SearchRequestOptions' timeoutMillis: type: integer description: Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. @@ -10797,6 +11593,8 @@ components: disableSpellcheck: type: boolean description: Whether or not to disable spellcheck. + required: + - query example: trackingToken: trackingToken query: vacation policy @@ -10819,7 +11617,7 @@ components: trackingToken: type: string sessionInfo: - $ref: "#/components/schemas/SessionInfo" + $ref: '#/components/schemas/SessionInfo' query: type: string description: Partially typed query. @@ -10834,7 +11632,6 @@ components: description: Filter to only return results relevant to the given datasource. resultTypes: type: array - description: Filter to only return results of the given type(s). All types may be returned if omitted. items: type: string enum: @@ -10852,6 +11649,7 @@ components: - OPERATOR_VALUE - QUICKLINK - SUGGESTION + description: Filter to only return results of the given type(s). All types may be returned if omitted. resultSize: type: integer description: | @@ -10859,9 +11657,9 @@ components: example: 10 authTokens: type: array - description: Auth tokens which may be used for federated results. items: - $ref: "#/components/schemas/AuthToken" + $ref: '#/components/schemas/AuthToken' + description: Auth tokens which may be used for federated results. example: trackingToken: trackingToken query: what is a que @@ -10874,8 +11672,6 @@ components: docType: type: string OperatorMetadata: - required: - - name properties: name: type: string @@ -10894,13 +11690,15 @@ components: scopes: type: array items: - $ref: "#/components/schemas/OperatorScope" + $ref: '#/components/schemas/OperatorScope' value: type: string description: Raw/canonical value of the operator. Only applies when result is an operator value. displayValue: type: string description: Human readable value of the operator that can be shown to the user. Only applies when result is an operator value. + required: + - name example: name: Last Updated operatorType: DATE @@ -10909,7 +11707,6 @@ components: docType: Document - datasource: ZENDESK Quicklink: - description: An action for a specific datasource that will show up in autocomplete and app card, e.g. "Create new issue" for jira. properties: name: type: string @@ -10921,14 +11718,13 @@ components: type: string description: The URL of the action. iconConfig: - $ref: "#/components/schemas/IconConfig" + $ref: '#/components/schemas/IconConfig' description: The config for the icon for this quicklink id: type: string description: Unique identifier of this quicklink scopes: type: array - description: The scopes for which this quicklink is applicable items: type: string enum: @@ -10937,10 +11733,9 @@ components: - AUTOCOMPLETE_FUZZY_MATCH - AUTOCOMPLETE_ZERO_QUERY - NEW_TAB_PAGE + description: The scopes for which this quicklink is applicable + description: An action for a specific datasource that will show up in autocomplete and app card, e.g. "Create new issue" for jira. AutocompleteResult: - required: - - result - - result_type properties: result: type: string @@ -10970,23 +11765,26 @@ components: type: number description: Higher indicates a more confident match. operatorMetadata: - $ref: "#/components/schemas/OperatorMetadata" + $ref: '#/components/schemas/OperatorMetadata' quicklink: - $ref: "#/components/schemas/Quicklink" + $ref: '#/components/schemas/Quicklink' document: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' url: type: string structuredResult: - $ref: "#/components/schemas/StructuredResult" + $ref: '#/components/schemas/StructuredResult' trackingToken: type: string description: A token to be passed in /feedback events associated with this autocomplete result. ranges: type: array items: - $ref: "#/components/schemas/TextRange" + $ref: '#/components/schemas/TextRange' description: Subsections of the result string to which some special formatting should be applied (eg. bold) + required: + - result + - result_type example: result: sample result resultType: DOCUMENT @@ -10997,7 +11795,6 @@ components: - datasource: confluence - objectType: page AutocompleteResultGroup: - description: A subsection of the results list from which distinct sections should be created. properties: startIndex: type: integer @@ -11008,27 +11805,28 @@ components: title: type: string description: The title of the result group to be displayed. Empty means no title. + description: A subsection of the results list from which distinct sections should be created. AutocompleteResponse: allOf: - - $ref: "#/components/schemas/BackendExperimentsContext" + - $ref: '#/components/schemas/BackendExperimentsContext' - type: object properties: trackingToken: type: string description: An opaque token that represents this particular set of autocomplete results. To be used for /feedback reporting. sessionInfo: - $ref: "#/components/schemas/SessionInfo" + $ref: '#/components/schemas/SessionInfo' results: type: array items: - $ref: "#/components/schemas/AutocompleteResult" + $ref: '#/components/schemas/AutocompleteResult' groups: type: array items: - $ref: "#/components/schemas/AutocompleteResultGroup" + $ref: '#/components/schemas/AutocompleteResultGroup' description: Subsections of the results list from which distinct sections should be created. errorInfo: - $ref: "#/components/schemas/ErrorInfo" + $ref: '#/components/schemas/ErrorInfo' backendTimeMillis: type: integer format: int64 @@ -11042,8 +11840,6 @@ components: type: string description: The Chat Application ID this feed request should be scoped to. Empty means there is no Chat Application ID.. FeedRequestOptions: - required: - - resultSize properties: resultSize: type: integer @@ -11065,10 +11861,10 @@ components: type: string description: Datasources for which content should be included. Empty is for all. chatZeroStateSuggestionOptions: - $ref: "#/components/schemas/ChatZeroStateSuggestionOptions" - FeedRequest: + $ref: '#/components/schemas/ChatZeroStateSuggestionOptions' required: - - refreshType + - resultSize + FeedRequest: properties: categories: type: array @@ -11119,13 +11915,15 @@ components: - OOO_CATCH_UP description: Categories of content requested. An allowlist gives flexibility to request content separately or together. requestOptions: - $ref: "#/components/schemas/FeedRequestOptions" + $ref: '#/components/schemas/FeedRequestOptions' timeoutMillis: type: integer description: Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. example: 5000 sessionInfo: - $ref: "#/components/schemas/SessionInfo" + $ref: '#/components/schemas/SessionInfo' + required: + - refreshType DisplayableListFormat: properties: format: @@ -11135,15 +11933,12 @@ components: description: defines how to render this particular displayable list card DisplayableListItemUIConfig: type: object - description: UI configurations for each item of the list properties: showNewIndicator: type: boolean description: show a "New" pill next to the item + description: UI configurations for each item of the list ConferenceData: - required: - - provider - - uri properties: provider: type: string @@ -11159,14 +11954,16 @@ components: - NATIVE_CONFERENCE - LOCATION - DESCRIPTION + required: + - provider + - uri EventClassificationName: - description: The name for a generated classification of an event. type: string enum: - External Event + description: The name for a generated classification of an event. EventStrategyName: type: string - description: The name of method used to surface relevant data for a given calendar event. enum: - customerCard - news @@ -11177,17 +11974,17 @@ components: - relevantDocuments - chatFollowUps - conversations + description: The name of method used to surface relevant data for a given calendar event. EventClassification: - description: A generated classification of a given event. properties: name: - $ref: "#/components/schemas/EventClassificationName" + $ref: '#/components/schemas/EventClassificationName' strategies: type: array items: - $ref: "#/components/schemas/EventStrategyName" + $ref: '#/components/schemas/EventStrategyName' + description: A generated classification of a given event. StructuredLink: - description: The display configuration for a link. properties: name: type: string @@ -11196,47 +11993,45 @@ components: type: string description: The URL for the link. iconConfig: - $ref: "#/components/schemas/IconConfig" + $ref: '#/components/schemas/IconConfig' + description: The display configuration for a link. GeneratedAttachmentContent: - description: Content that has been generated or extrapolated from the documents present in the document field. properties: displayHeader: - description: The header describing the generated content. type: string + description: The header describing the generated content. text: - description: The content that has been generated. type: string + description: The content that has been generated. + description: Content that has been generated or extrapolated from the documents present in the document field. example: displayHeader: Action Items content: You said you'd send over the design document after the meeting. GeneratedAttachment: - description: These are attachments that aren't natively present on the event, and have been smartly suggested. properties: strategyName: - $ref: "#/components/schemas/EventStrategyName" + $ref: '#/components/schemas/EventStrategyName' documents: type: array items: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' person: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' customer: - $ref: "#/components/schemas/Customer" + $ref: '#/components/schemas/Customer' externalLinks: - description: A list of links to external sources outside of Glean. type: array items: - $ref: "#/components/schemas/StructuredLink" + $ref: '#/components/schemas/StructuredLink' + description: A list of links to external sources outside of Glean. content: type: array items: - $ref: "#/components/schemas/GeneratedAttachmentContent" + $ref: '#/components/schemas/GeneratedAttachmentContent' + description: These are attachments that aren't natively present on the event, and have been smartly suggested. CalendarEvent: - required: - - id - - url allOf: - - $ref: "#/components/schemas/AnonymousEvent" + - $ref: '#/components/schemas/AnonymousEvent' - type: object properties: id: @@ -11246,12 +12041,12 @@ components: type: string description: A permalink for this calendar event attendees: - $ref: "#/components/schemas/CalendarAttendees" + $ref: '#/components/schemas/CalendarAttendees' location: type: string description: The location that this event is taking place at. conferenceData: - $ref: "#/components/schemas/ConferenceData" + $ref: '#/components/schemas/ConferenceData' description: type: string description: The HTML description of the event. @@ -11267,35 +12062,38 @@ components: classifications: type: array items: - $ref: "#/components/schemas/EventClassification" + $ref: '#/components/schemas/EventClassification' generatedAttachments: type: array items: - $ref: "#/components/schemas/GeneratedAttachment" + $ref: '#/components/schemas/GeneratedAttachment' + required: + - id + - url SectionType: type: string + enum: + - CHANNEL + - MENTIONS + - TOPIC description: Type of the section. This defines how the section should be interpreted and rendered in the digest. x-enumDescriptions: CHANNEL: A standard section for channel-based digests (e.g. from Slack, Teams). MENTIONS: A dedicated section that surfaces user mentions (actionable, informative, or all). TOPIC: A section driven by a generic topic, not tied to any specific channel or instance. - enum: - - CHANNEL - - MENTIONS - - TOPIC x-speakeasy-enum-descriptions: CHANNEL: A standard section for channel-based digests (e.g. from Slack, Teams). MENTIONS: A dedicated section that surfaces user mentions (actionable, informative, or all). TOPIC: A section driven by a generic topic, not tied to any specific channel or instance. UpdateType: type: string + enum: + - ACTIONABLE + - INFORMATIVE description: Optional type classification for the update. x-enumDescriptions: ACTIONABLE: Updates that require user attention or action INFORMATIVE: Updates that are purely informational - enum: - - ACTIONABLE - - INFORMATIVE x-speakeasy-enum-descriptions: ACTIONABLE: Updates that require user attention or action INFORMATIVE: Updates that are purely informational @@ -11304,9 +12102,9 @@ components: properties: urls: type: array - description: List of URLs for similar updates that are grouped together and rendered as a single update. items: type: string + description: List of URLs for similar updates that are grouped together and rendered as a single update. url: type: string description: URL link to the content or document. @@ -11320,19 +12118,15 @@ components: type: string description: Brief summary or description of the update content. type: - $ref: "#/components/schemas/UpdateType" + $ref: '#/components/schemas/UpdateType' DigestSection: type: object - required: - - id - - type - - updates properties: id: type: string description: Unique identifier for the digest section. type: - $ref: "#/components/schemas/SectionType" + $ref: '#/components/schemas/SectionType' displayName: type: string description: Human-readable name for the digest section. @@ -11353,8 +12147,12 @@ components: updates: type: array items: - $ref: "#/components/schemas/DigestUpdate" + $ref: '#/components/schemas/DigestUpdate' description: List of updates within this digest section. + required: + - id + - type + - updates Digest: type: object properties: @@ -11372,7 +12170,7 @@ components: sections: type: array items: - $ref: "#/components/schemas/DigestSection" + $ref: '#/components/schemas/DigestSection' description: Array of digest sections from which the podcast was created. ChatSuggestion: properties: @@ -11391,8 +12189,6 @@ components: type: string description: Document IDs that grounded the suggestion. PromptTemplateMutableProperties: - required: - - template properties: name: type: string @@ -11404,30 +12200,32 @@ components: type: string description: The Application Id the prompt template should be created under. Empty for default assistant. inclusions: - $ref: "#/components/schemas/ChatRestrictionFilters" + $ref: '#/components/schemas/ChatRestrictionFilters' description: A list of filters which only allows the prompt template to access certain content. addedRoles: type: array - description: A list of added user roles for the Workflow. items: - $ref: "#/components/schemas/UserRoleSpecification" + $ref: '#/components/schemas/UserRoleSpecification' + description: A list of added user roles for the Workflow. removedRoles: type: array - description: A list of removed user roles for the Workflow. items: - $ref: "#/components/schemas/UserRoleSpecification" + $ref: '#/components/schemas/UserRoleSpecification' + description: A list of removed user roles for the Workflow. + required: + - template PromptTemplate: allOf: - - $ref: "#/components/schemas/PromptTemplateMutableProperties" - - $ref: "#/components/schemas/PermissionedObject" - - $ref: "#/components/schemas/AttributionProperties" + - $ref: '#/components/schemas/PromptTemplateMutableProperties' + - $ref: '#/components/schemas/PermissionedObject' + - $ref: '#/components/schemas/AttributionProperties' - type: object properties: id: type: string description: Opaque id for this prompt template author: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' createTimestamp: type: integer description: Server Unix timestamp of the creation time. @@ -11435,12 +12233,12 @@ components: type: integer description: Server Unix timestamp of the last update time. lastUpdatedBy: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' roles: type: array - description: A list of roles for this prompt template explicitly granted. items: - $ref: "#/components/schemas/UserRoleSpecification" + $ref: '#/components/schemas/UserRoleSpecification' + description: A list of roles for this prompt template explicitly granted. UgcType: enum: - AGENT_TYPE @@ -11467,34 +12265,34 @@ components: type: object properties: ugcType: - $ref: "#/components/schemas/UgcType" + $ref: '#/components/schemas/UgcType' id: type: string description: Opaque id of the UGC. count: type: integer - x-includeEmpty: true description: Number of users this object has been favorited by. + x-includeEmpty: true favoritedByUser: type: boolean - x-includeEmpty: true description: If the requesting user has favorited this object. + x-includeEmpty: true PromptTemplateResult: properties: promptTemplate: - $ref: "#/components/schemas/PromptTemplate" + $ref: '#/components/schemas/PromptTemplate' trackingToken: type: string description: An opaque token that represents this prompt template favoriteInfo: - $ref: "#/components/schemas/FavoriteInfo" + $ref: '#/components/schemas/FavoriteInfo' runCount: - $ref: "#/components/schemas/CountInfo" + $ref: '#/components/schemas/CountInfo' description: This tracks how many times this prompt template was run. If user runs a prompt template after modifying the original one, it still counts as a run for the original template. UserActivity: properties: actor: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' timestamp: type: integer description: Unix timestamp of the activity (in seconds since epoch UTC). @@ -11517,10 +12315,8 @@ components: - VIEW description: The action for the activity aggregateVisitCount: - $ref: "#/components/schemas/CountInfo" + $ref: '#/components/schemas/CountInfo' FeedEntry: - required: - - title properties: entryId: type: string @@ -11529,16 +12325,16 @@ components: type: string description: Title for the result. Can be document title, event title and so on. thumbnail: - $ref: "#/components/schemas/Thumbnail" + $ref: '#/components/schemas/Thumbnail' createdBy: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' uiConfig: allOf: - - $ref: "#/components/schemas/DisplayableListFormat" + - $ref: '#/components/schemas/DisplayableListFormat' - type: object properties: additionalFlags: - $ref: "#/components/schemas/DisplayableListItemUIConfig" + $ref: '#/components/schemas/DisplayableListItemUIConfig' justificationType: type: string enum: @@ -11608,38 +12404,37 @@ components: type: string description: View URL for the entry if based on links that are not documents in Glean. document: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' event: - $ref: "#/components/schemas/CalendarEvent" + $ref: '#/components/schemas/CalendarEvent' announcement: - $ref: "#/components/schemas/Announcement" + $ref: '#/components/schemas/Announcement' digest: - $ref: "#/components/schemas/Digest" + $ref: '#/components/schemas/Digest' collection: - $ref: "#/components/schemas/Collection" + $ref: '#/components/schemas/Collection' collectionItem: - $ref: "#/components/schemas/CollectionItem" + $ref: '#/components/schemas/CollectionItem' person: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' app: - $ref: "#/components/schemas/AppResult" + $ref: '#/components/schemas/AppResult' chatSuggestion: - $ref: "#/components/schemas/ChatSuggestion" + $ref: '#/components/schemas/ChatSuggestion' promptTemplate: - $ref: "#/components/schemas/PromptTemplateResult" + $ref: '#/components/schemas/PromptTemplateResult' workflow: - $ref: "#/components/schemas/WorkflowResult" + $ref: '#/components/schemas/WorkflowResult' activities: type: array items: - $ref: "#/components/schemas/UserActivity" + $ref: '#/components/schemas/UserActivity' description: List of activity where each activity has user, action, timestamp. documentVisitorCount: - $ref: "#/components/schemas/CountInfo" - FeedResult: + $ref: '#/components/schemas/CountInfo' required: - - category - - primaryEntry + - title + FeedResult: properties: category: type: string @@ -11688,11 +12483,11 @@ components: - OOO_CATCH_UP description: Category of the result, one of the requested categories in incoming request. primaryEntry: - $ref: "#/components/schemas/FeedEntry" + $ref: '#/components/schemas/FeedEntry' secondaryEntries: type: array items: - $ref: "#/components/schemas/FeedEntry" + $ref: '#/components/schemas/FeedEntry' description: Secondary entries for the result e.g. suggested docs for the calendar, carousel. rank: type: integer @@ -11703,11 +12498,12 @@ components: - ORGANIC - PROMO description: Placement source for ranked feed results. ORGANIC means the card was emitted by normal feed ranking. PROMO means the card was inserted by the homepage cards promo framework. - FeedResponse: required: - - serverTimestamp + - category + - primaryEntry + FeedResponse: allOf: - - $ref: "#/components/schemas/BackendExperimentsContext" + - $ref: '#/components/schemas/BackendExperimentsContext' - type: object properties: trackingToken: @@ -11719,17 +12515,19 @@ components: results: type: array items: - $ref: "#/components/schemas/FeedResult" + $ref: '#/components/schemas/FeedResult' facetResults: type: object additionalProperties: type: array items: - $ref: "#/components/schemas/FacetResult" + $ref: '#/components/schemas/FacetResult' description: Map from category to the list of facets that can be used to filter the entry's content. mentionsTimeWindowInHours: type: integer description: The time window (in hours) used for generating user mentions. + required: + - serverTimestamp RecommendationsRequestOptions: properties: datasourceFilter: @@ -11743,30 +12541,30 @@ components: facetFilterSets: type: array items: - $ref: "#/components/schemas/FacetFilterSet" + $ref: '#/components/schemas/FacetFilterSet' description: A list of facet filter sets that will be OR'ed together. context: - $ref: "#/components/schemas/Document" + $ref: '#/components/schemas/Document' description: Content for either a new or unindexed document, or additional content for an indexed document, which may be used to generate recommendations. resultProminence: - description: The types of prominence wanted in results returned. Default is any type. type: array items: - $ref: "#/components/schemas/SearchResultProminenceEnum" + $ref: '#/components/schemas/SearchResultProminenceEnum' + description: The types of prominence wanted in results returned. Default is any type. RecommendationsRequest: allOf: - - $ref: "#/components/schemas/ResultsRequest" + - $ref: '#/components/schemas/ResultsRequest' - type: object properties: recommendationDocumentSpec: - $ref: "#/components/schemas/DocumentSpec" + $ref: '#/components/schemas/DocumentSpec' description: Retrieve recommendations for this document. Glean Document ID is preferred over URL. requestOptions: - $ref: "#/components/schemas/RecommendationsRequestOptions" + $ref: '#/components/schemas/RecommendationsRequestOptions' description: Options for adjusting the request for recommendations. RecommendationsResponse: allOf: - - $ref: "#/components/schemas/ResultsResponse" + - $ref: '#/components/schemas/ResultsResponse' SortOptions: type: object properties: @@ -11783,19 +12581,19 @@ components: filter: type: array items: - $ref: "#/components/schemas/FacetFilter" + $ref: '#/components/schemas/FacetFilter' sort: - description: Use EntitiesSortOrder enum for SortOptions.sortBy type: array items: - $ref: "#/components/schemas/SortOptions" + $ref: '#/components/schemas/SortOptions' + description: Use EntitiesSortOrder enum for SortOptions.sortBy entityType: type: string - default: PEOPLE enum: - PEOPLE - TEAMS - CUSTOM_ENTITIES + default: PEOPLE datasource: type: string description: The datasource associated with the entity type, most commonly used with CUSTOM_ENTITIES @@ -11803,7 +12601,6 @@ components: type: string description: A query string to search for entities that each entity in the response must conform to. An empty query does not filter any entities. includeFields: - description: List of entity fields to return (that aren't returned by default) type: array items: type: string @@ -11817,10 +12614,11 @@ components: - LAST_EXTENSION_USE - MANAGEMENT_DETAILS - UNPROCESSED_TEAMS + description: List of entity fields to return (that aren't returned by default) pageSize: type: integer - example: 100 description: Hint to the server about how many results to send back. Server may return less. + example: 100 cursor: type: string description: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. @@ -11829,20 +12627,19 @@ components: description: A string denoting the search surface from which the endpoint is called. requestType: type: string - default: STANDARD + enum: + - STANDARD + - FULL_DIRECTORY description: The type of request being made. + default: STANDARD x-enumDescriptions: STANDARD: Used by default for all requests and satisfies all standard use cases for list requests. Limited to 10000 entities. FULL_DIRECTORY: Used exclusively to return a comprehensive list of all people entities in the organization, typically for audit like purposes. The recommended approach is to sort by FIRST_NAME or LAST_NAME, and use pagination for large organizations. - enum: - - STANDARD - - FULL_DIRECTORY x-speakeasy-enum-descriptions: STANDARD: Used by default for all requests and satisfies all standard use cases for list requests. Limited to 10000 entities. FULL_DIRECTORY: Used exclusively to return a comprehensive list of all people entities in the organization, typically for audit like purposes. The recommended approach is to sort by FIRST_NAME or LAST_NAME, and use pagination for large organizations. EntitiesSortOrder: type: string - description: Different ways of sorting entities enum: - ENTITY_NAME - FIRST_NAME @@ -11851,25 +12648,26 @@ components: - START_DATE - TEAM_SIZE - RELEVANCE + description: Different ways of sorting entities ListEntitiesResponse: type: object properties: results: type: array items: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' teamResults: type: array items: - $ref: "#/components/schemas/Team" + $ref: '#/components/schemas/Team' customEntityResults: type: array items: - $ref: "#/components/schemas/CustomEntity" + $ref: '#/components/schemas/CustomEntity' facetResults: type: array items: - $ref: "#/components/schemas/FacetResult" + $ref: '#/components/schemas/FacetResult' cursor: type: string description: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. @@ -11881,14 +12679,14 @@ components: description: Whether or not more entities can be fetched. sortOptions: type: array - description: Sort options from EntitiesSortOrder supported for this response. Default is empty list. items: - $ref: "#/components/schemas/EntitiesSortOrder" + $ref: '#/components/schemas/EntitiesSortOrder' + description: Sort options from EntitiesSortOrder supported for this response. Default is empty list. customFacetNames: type: array - description: list of Person attributes that are custom setup by deployment items: type: string + description: list of Person attributes that are custom setup by deployment PeopleRequest: type: object properties: @@ -11906,7 +12704,6 @@ components: type: string description: The email IDs to retrieve. The result is the deduplicated union of emailIds and obfuscatedIds. includeFields: - description: List of PersonMetadata fields to return (that aren't returned by default) type: array items: type: string @@ -11921,17 +12718,18 @@ components: - MANAGEMENT_DETAILS - PEOPLE_PROFILE_SETTINGS - PEOPLE_WITHOUT_MANAGER + description: List of PersonMetadata fields to return (that aren't returned by default) includeTypes: - description: The types of people entities to include in the response in addition to those returned by default. - x-enumDescriptions: - PEOPLE_WITHOUT_MANAGER: Returns all people without a manager apart from the requested IDs. - INVALID_ENTITIES: Includes invalid entities in the response if any of the requested IDs are invalid. type: array items: type: string enum: - PEOPLE_WITHOUT_MANAGER - INVALID_ENTITIES + description: The types of people entities to include in the response in addition to those returned by default. + x-enumDescriptions: + PEOPLE_WITHOUT_MANAGER: Returns all people without a manager apart from the requested IDs. + INVALID_ENTITIES: Includes invalid entities in the response if any of the requested IDs are invalid. x-speakeasy-enum-descriptions: PEOPLE_WITHOUT_MANAGER: Returns all people without a manager apart from the requested IDs. INVALID_ENTITIES: Includes invalid entities in the response if any of the requested IDs are invalid. @@ -11947,12 +12745,12 @@ components: results: type: array items: - $ref: "#/components/schemas/Person" + $ref: '#/components/schemas/Person' description: A Person for each ID in the request, each with PersonMetadata populated. relatedDocuments: type: array items: - $ref: "#/components/schemas/RelatedDocuments" + $ref: '#/components/schemas/RelatedDocuments' description: A list of documents related to this people response. This is only included if DOCUMENT_ACTIVITY is requested and only 1 person is included in the request. errors: type: array @@ -11960,11 +12758,11 @@ components: type: string description: A list of IDs that could not be found. CreateShortcutRequest: - required: - - data properties: data: - $ref: "#/components/schemas/ShortcutMutableProperties" + $ref: '#/components/schemas/ShortcutMutableProperties' + required: + - data ShortcutError: properties: errorType: @@ -11977,44 +12775,42 @@ components: CreateShortcutResponse: properties: shortcut: - $ref: "#/components/schemas/Shortcut" + $ref: '#/components/schemas/Shortcut' error: - $ref: "#/components/schemas/ShortcutError" + $ref: '#/components/schemas/ShortcutError' DeleteShortcutRequest: allOf: - - $ref: "#/components/schemas/UserGeneratedContentId" + - $ref: '#/components/schemas/UserGeneratedContentId' - type: object required: - id GetShortcutRequest: oneOf: - - $ref: "#/components/schemas/UserGeneratedContentId" + - $ref: '#/components/schemas/UserGeneratedContentId' - type: object - required: - - alias properties: alias: type: string description: The alias for the shortcut, including any arguments for variable shortcuts. + required: + - alias GetShortcutResponse: properties: shortcut: - $ref: "#/components/schemas/Shortcut" + $ref: '#/components/schemas/Shortcut' description: Shortcut given the input alias with any provided arguments substituted into the destination URL. error: - $ref: "#/components/schemas/ShortcutError" + $ref: '#/components/schemas/ShortcutError' ListShortcutsPaginatedRequest: - required: - - pageSize properties: includeFields: - description: Array of fields/data to be included in response that are not included by default type: array items: type: string enum: - FACETS - PEOPLE_DETAILS + description: Array of fields/data to be included in response that are not included by default pageSize: type: integer example: 10 @@ -12024,14 +12820,16 @@ components: filters: type: array items: - $ref: "#/components/schemas/FacetFilter" + $ref: '#/components/schemas/FacetFilter' description: A list of filters for the query. An AND is assumed between different filters. We support filters on Go Link name, author, department and type. sort: - $ref: "#/components/schemas/SortOptions" + $ref: '#/components/schemas/SortOptions' description: Specifies fieldname to sort on and order (ASC|DESC) to sort in query: type: string description: Search query that should be a substring in atleast one of the fields (alias , inputAlias, destinationUrl, description). Empty query does not filter shortcuts. + required: + - pageSize ShortcutsPaginationMetadata: properties: cursor: @@ -12042,44 +12840,41 @@ components: totalItemCount: type: integer ListShortcutsPaginatedResponse: - required: - - shortcuts - - meta properties: shortcuts: type: array items: - $ref: "#/components/schemas/Shortcut" + $ref: '#/components/schemas/Shortcut' description: List of all shortcuts accessible to the user facetResults: type: array items: - $ref: "#/components/schemas/FacetResult" + $ref: '#/components/schemas/FacetResult' meta: - $ref: "#/components/schemas/ShortcutsPaginationMetadata" + $ref: '#/components/schemas/ShortcutsPaginationMetadata' description: Contains metadata like total item count and whether next page exists + required: + - shortcuts + - meta UpdateShortcutRequest: allOf: - - $ref: "#/components/schemas/UserGeneratedContentId" - - $ref: "#/components/schemas/ShortcutMutableProperties" + - $ref: '#/components/schemas/UserGeneratedContentId' + - $ref: '#/components/schemas/ShortcutMutableProperties' - type: object required: - id UpdateShortcutResponse: properties: shortcut: - $ref: "#/components/schemas/Shortcut" + $ref: '#/components/schemas/Shortcut' error: - $ref: "#/components/schemas/ShortcutError" + $ref: '#/components/schemas/ShortcutError' SummarizeRequest: - description: Summary of the document - required: - - documentSpecs properties: timestamp: type: string - description: The ISO 8601 timestamp associated with the client request. format: date-time + description: The ISO 8601 timestamp associated with the client request. query: type: string description: Optional query that the summary should be about @@ -12089,11 +12884,14 @@ components: documentSpecs: type: array items: - $ref: "#/components/schemas/DocumentSpec" + $ref: '#/components/schemas/DocumentSpec' description: Specifications of documents to summarize trackingToken: type: string description: An opaque token that represents this particular result. To be used for /feedback reporting. + required: + - documentSpecs + description: Summary of the document Summary: properties: text: @@ -12111,13 +12909,11 @@ components: message: type: string summary: - $ref: "#/components/schemas/Summary" + $ref: '#/components/schemas/Summary' trackingToken: type: string description: An opaque token that represents this summary in this particular query. To be used for /feedback reporting. ReminderRequest: - required: - - documentId properties: documentId: type: string @@ -12131,16 +12927,16 @@ components: reason: type: string description: An optional free-text reason for the reminder. This is particularly useful when a reminder is used to ask for verification from another user (for example, "Duplicate", "Incomplete", "Incorrect"). + required: + - documentId VerificationFeed: properties: documents: type: array items: - $ref: "#/components/schemas/Verification" + $ref: '#/components/schemas/Verification' description: List of document infos that include verification related information for them. VerifyRequest: - required: - - documentId properties: documentId: type: string @@ -12152,18 +12948,20 @@ components: - DEPRECATE - UNVERIFY description: The verification action requested. + required: + - documentId ToolParameter: type: object properties: type: type: string - description: Parameter type (string, number, boolean, object, array) enum: - string - number - boolean - object - array + description: Parameter type (string, number, boolean, object, array) name: type: string description: The name of the parameter @@ -12175,27 +12973,27 @@ components: description: Whether the parameter is required possibleValues: type: array - description: The possible values for the parameter. Can contain only primitive values or arrays of primitive values. items: type: string + description: The possible values for the parameter. Can contain only primitive values or arrays of primitive values. items: + $ref: '#/components/schemas/ToolParameter' type: object description: When type is 'array', this describes the structure of the item in the array. - $ref: "#/components/schemas/ToolParameter" properties: type: object - description: When type is 'object', this describes the structure of the object. additionalProperties: - $ref: "#/components/schemas/ToolParameter" + $ref: '#/components/schemas/ToolParameter' + description: When type is 'object', this describes the structure of the object. Tool: type: object properties: type: type: string - description: Type of tool (READ, WRITE) enum: - READ - WRITE + description: Type of tool (READ, WRITE) name: type: string description: Unique identifier for the tool @@ -12207,21 +13005,18 @@ components: description: LLM friendly description of the tool parameters: type: object - description: The parameters for the tool. Each key is the name of the parameter and the value is the parameter object. additionalProperties: - $ref: "#/components/schemas/ToolParameter" + $ref: '#/components/schemas/ToolParameter' + description: The parameters for the tool. Each key is the name of the parameter and the value is the parameter object. ToolsListResponse: type: object properties: tools: type: array items: - $ref: "#/components/schemas/Tool" + $ref: '#/components/schemas/Tool' ToolsCallParameter: type: object - required: - - name - - value properties: name: type: string @@ -12231,91 +13026,94 @@ components: description: The value of the parameter (for primitive types) items: type: array - description: The value of the parameter (for array types) items: - $ref: "#/components/schemas/ToolsCallParameter" + $ref: '#/components/schemas/ToolsCallParameter' + description: The value of the parameter (for array types) properties: type: object - description: The value of the parameter (for object types) additionalProperties: - $ref: "#/components/schemas/ToolsCallParameter" - ToolsCallRequest: - type: object + $ref: '#/components/schemas/ToolsCallParameter' + description: The value of the parameter (for object types) required: - name - - parameters + - value + ToolsCallRequest: + type: object properties: name: type: string description: Required name of the tool to execute parameters: type: object - description: The parameters for the tool. Each key is the name of the parameter and the value is the parameter object. additionalProperties: - $ref: "#/components/schemas/ToolsCallParameter" + $ref: '#/components/schemas/ToolsCallParameter' + description: The parameters for the tool. Each key is the name of the parameter and the value is the parameter object. + required: + - name + - parameters ToolsCallResponse: type: object properties: rawResponse: - additionalProperties: true type: object + additionalProperties: true description: The raw response from the tool error: type: string description: The error message if applicable ActionAuthType: type: string + enum: + - AUTH_USER_OAUTH + - AUTH_ADMIN + - AUTH_NONE description: | Authentication mechanism used by an action pack. - `AUTH_USER_OAUTH`: Requires per-user OAuth consent to the third-party tool. - `AUTH_ADMIN`: Uses a service-account / admin-owned credential. End users do not authorize individually. - `AUTH_NONE`: Action pack requires no authentication. - enum: - - AUTH_USER_OAUTH - - AUTH_ADMIN - - AUTH_NONE ActionPackAuthStatus: type: object - required: - - authenticated - - authType properties: authenticated: type: boolean description: Whether the calling user is already authenticated to the tool backing the action pack. authType: - $ref: "#/components/schemas/ActionAuthType" + $ref: '#/components/schemas/ActionAuthType' + required: + - authenticated + - authType ActionPackAuthStatusResponse: type: object - required: - - actionPack properties: actionPack: - $ref: "#/components/schemas/ActionPackAuthStatus" + $ref: '#/components/schemas/ActionPackAuthStatus' description: | Action-pack-scoped authentication status. Wrapped under `actionPack` so the response shape clearly conveys that the status applies to the whole pack and leaves room to add sibling fields (e.g. per-action status) later without a breaking change. + required: + - actionPack AuthorizeActionPackRequest: type: object - required: - - returnUrl properties: returnUrl: type: string description: | URL on the customer's domain to redirect the end user's browser back to after the third-party OAuth callback completes. Must be present in the tenant's return URL allowlist. + required: + - returnUrl AuthorizeActionPackResponse: type: object - required: - - redirectUrl properties: redirectUrl: type: string description: | URL that the customer UI should navigate the end user to in order to begin the third-party OAuth flow. After the user consents, control returns to `returnUrl` from the request. + required: + - redirectUrl IndexDocumentRequest: type: object properties: @@ -14927,6 +15725,97 @@ components: required: - name - propertyType + responses: + PlatformBadRequest: + description: Invalid request (malformed JSON, invalid parameter values, unknown fields). + content: + application/problem+json: + schema: + $ref: "#/components/schemas/PlatformProblemDetail" + PlatformUnauthorized: + description: Missing or invalid authentication token. + content: + application/problem+json: + schema: + $ref: "#/components/schemas/PlatformProblemDetail" + PlatformForbidden: + description: Token valid but lacks permission for the requested operation. + content: + application/problem+json: + schema: + $ref: "#/components/schemas/PlatformProblemDetail" + PlatformNotFound: + description: Resource not found. + content: + application/problem+json: + schema: + $ref: "#/components/schemas/PlatformProblemDetail" + PlatformRequestTimeout: + description: Backend did not respond within the timeout window. + content: + application/problem+json: + schema: + $ref: "#/components/schemas/PlatformProblemDetail" + PlatformTooManyRequests: + description: Rate limit exceeded. Includes Retry-After header. + content: + application/problem+json: + schema: + $ref: "#/components/schemas/PlatformProblemDetail" + PlatformInternalServerError: + description: Unexpected server-side failure. + content: + application/problem+json: + schema: + $ref: "#/components/schemas/PlatformProblemDetail" + PlatformServiceUnavailable: + description: Backend temporarily unavailable. + content: + application/problem+json: + schema: + $ref: "#/components/schemas/PlatformProblemDetail" + PlatformConflict: + description: Request conflicts with current state of the resource. + content: + application/problem+json: + schema: + $ref: "#/components/schemas/PlatformProblemDetail" + SuccessResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + BadRequestError: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorInfoResponse' + UnauthorizedError: + description: Not Authorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorInfoResponse' + NotFoundError: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorInfoResponse' + TooManyRequestsError: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorInfoResponse' + InternalServerError: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorInfoResponse' parameters: locale: name: locale @@ -14965,43 +15854,17 @@ components: schema: type: string example: o365sharepoint_abc123 - responses: - SuccessResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessResponse' - BadRequestError: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorInfoResponse' - UnauthorizedError: - description: Not Authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorInfoResponse' - NotFoundError: - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorInfoResponse' - TooManyRequestsError: - description: Too Many Requests - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorInfoResponse' - InternalServerError: - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorInfoResponse' +tags: + - name: Datasources + description: Manage datasources. + - name: Documents + description: Index documents from a datasource. + - name: People + description: Index employee people data. + - name: Permissions + description: Manage users, groups and membership. + - name: Authentication + description: Manage indexing API tokens. x-tagGroups: - name: Search & Generative AI tags: @@ -15031,14 +15894,3 @@ x-tagGroups: - Authentication - Insights - User -tags: - - name: Datasources - description: Manage datasources. - - name: Documents - description: Index documents from a datasource. - - name: People - description: Index employee people data. - - name: Permissions - description: Manage users, groups and membership. - - name: Authentication - description: Manage indexing API tokens. diff --git a/.speakeasy/tests.arazzo.yaml b/.speakeasy/tests.arazzo.yaml index 4f92272d..b21ef140 100644 --- a/.speakeasy/tests.arazzo.yaml +++ b/.speakeasy/tests.arazzo.yaml @@ -158417,7 +158417,7 @@ workflows: condition: | {} type: simple - x-speakeasy-test-group: Governance + x-speakeasy-test-group: findings x-speakeasy-test-rebuild: true - workflowId: downloadfindingsexport steps: @@ -158434,7 +158434,7 @@ workflows: condition: | "" type: simple - x-speakeasy-test-group: Governance + x-speakeasy-test-group: findings x-speakeasy-test-rebuild: true - workflowId: checkdatasourceauth steps: @@ -158447,7 +158447,7 @@ workflows: condition: | {"unauthorizedDatasourceInstances":[{"datasourceInstance":"slack_0","displayName":"Slack"}]} type: simple - x-speakeasy-test-group: Authentication + x-speakeasy-test-group: client_authentication x-speakeasy-test-rebuild: true - workflowId: getDatasourceInstanceConfiguration steps: @@ -158467,7 +158467,7 @@ workflows: condition: | {"configuration":{"values":{"key":{}}}} type: simple - x-speakeasy-test-group: Datasources + x-speakeasy-test-group: client_datasources x-speakeasy-test-rebuild: true - workflowId: updateDatasourceInstanceConfiguration steps: @@ -158492,7 +158492,7 @@ workflows: condition: | {"configuration":{"values":{}}} type: simple - x-speakeasy-test-group: Datasources + x-speakeasy-test-group: client_datasources x-speakeasy-test-rebuild: true - workflowId: getChatFile steps: @@ -158509,7 +158509,7 @@ workflows: condition: | "x-file: example.file" type: simple - x-speakeasy-test-group: Chat_SDK + x-speakeasy-test-group: client_chat x-speakeasy-test-rebuild: true - workflowId: getPersonPhoto steps: @@ -158526,7 +158526,7 @@ workflows: condition: | "x-file: example.file" type: simple - x-speakeasy-test-group: Entities + x-speakeasy-test-group: entities x-speakeasy-test-rebuild: true - workflowId: getActionPackAuthStatus steps: @@ -158543,7 +158543,7 @@ workflows: condition: | {"actionPack":{"authenticated":true,"authType":"AUTH_USER_OAUTH"}} type: simple - x-speakeasy-test-group: Tools + x-speakeasy-test-group: tools x-speakeasy-test-rebuild: true - workflowId: authorizeActionPack steps: @@ -158564,7 +158564,7 @@ workflows: condition: | {"redirectUrl":"https://unconscious-diversity.net"} type: simple - x-speakeasy-test-group: Tools + x-speakeasy-test-group: tools x-speakeasy-test-rebuild: true - workflowId: put_/rest/api/index/document/{docId}/custom-metadata/{groupName} steps: @@ -158680,7 +158680,7 @@ workflows: condition: | {"status":"VALID"} type: simple - x-speakeasy-test-group: Datasources + x-speakeasy-test-group: client_datasources x-speakeasy-test-rebuild: true - workflowId: rotateDatasourceCredentials steps: @@ -158703,7 +158703,7 @@ workflows: condition: | {"status":"MISSING"} type: simple - x-speakeasy-test-group: Datasources + x-speakeasy-test-group: client_datasources x-speakeasy-test-rebuild: true - workflowId: createAgent steps: @@ -158719,5 +158719,112 @@ workflows: condition: | {"workflow":{"author":{"name":"George Clooney","obfuscatedId":"abc123"},"lastDraftSavedBy":{"name":"George Clooney","obfuscatedId":"abc123"},"lastUpdatedBy":{"name":"George Clooney","obfuscatedId":"abc123"}}} type: simple - x-speakeasy-test-group: Agents + x-speakeasy-test-group: client_agents + x-speakeasy-test-rebuild: true + - workflowId: platform-agents-search + steps: + - stepId: test + operationId: platform-agents-search + requestBody: + contentType: application/json + payload: + name: HR Policy Agent + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"agents":[],"request_id":""} + type: simple + x-speakeasy-test-group: agents + x-speakeasy-test-rebuild: true + - workflowId: platform-agents-get + steps: + - stepId: test + operationId: platform-agents-get + parameters: + - name: agent_id + in: path + value: + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"agent":{"agent_id":"mho4lwzylcozgoc2","name":"HR Policy Agent","capabilities":{}},"request_id":""} + type: simple + x-speakeasy-test-group: agents + x-speakeasy-test-rebuild: true + - workflowId: platform-agents-get-schemas + steps: + - stepId: test + operationId: platform-agents-get-schemas + parameters: + - name: agent_id + in: path + value: + - name: include_tools + in: query + value: false + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"agent_id":"","input_schema":{},"output_schema":{"key":"","key1":"","key2":""},"request_id":""} + type: simple + x-speakeasy-test-group: agents + x-speakeasy-test-rebuild: true + - workflowId: platform-agents-create-run + steps: + - stepId: test + operationId: platform-agents-create-run + parameters: + - name: agent_id + in: path + value: + requestBody: + contentType: application/json + payload: + messages: + - content: [] + role: USER + stream: false + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"run":{"agent_id":"","messages":[{"role":"USER","content":[]}],"status":"error"},"messages":[{"role":"USER","content":[]}],"request_id":""} + type: simple + x-speakeasy-test-group: agents + x-speakeasy-test-rebuild: true + - workflowId: platform-search + steps: + - stepId: test + operationId: platform-search + requestBody: + contentType: application/json + payload: + datasource_instances: + - slack_acme + - slack_eu + datasources: + - confluence + - google_drive + filters: + - field: type + values: + - spreadsheet + - presentation + page_size: 10 + query: quarterly planning 2026 + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"results":[],"has_more":false,"next_cursor":"","request_id":""} + type: simple + x-speakeasy-test-group: search x-speakeasy-test-rebuild: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 05dc9671..797cbeba 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.786.1 +speakeasyVersion: 1.788.0 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:979b3f1b9f64bbb58a59297a1984e17b9a8e6c7eed1d56fc712f5ffc3376c23d - sourceBlobDigest: sha256:d0cf8a3fb62165cb2a1797291d7213dbfab4e80a9d8435d2ac732046c9effb28 + sourceRevisionDigest: sha256:246abdd49c246fce5b73bbb889da02141eaebcb7518c0ec21dbfbb75b3a53294 + sourceBlobDigest: sha256:def1b0c41f5ee4bd90ba40af9ce88738cd00213633e1ca6b261558b6d885ab04 tags: - latest Glean Client API: @@ -16,10 +16,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:979b3f1b9f64bbb58a59297a1984e17b9a8e6c7eed1d56fc712f5ffc3376c23d - sourceBlobDigest: sha256:d0cf8a3fb62165cb2a1797291d7213dbfab4e80a9d8435d2ac732046c9effb28 + sourceRevisionDigest: sha256:246abdd49c246fce5b73bbb889da02141eaebcb7518c0ec21dbfbb75b3a53294 + sourceBlobDigest: sha256:def1b0c41f5ee4bd90ba40af9ce88738cd00213633e1ca6b261558b6d885ab04 codeSamplesNamespace: glean-api-specs-python-code-samples - codeSamplesRevisionDigest: sha256:60aa38a0f093349fa189ac4f535bcdf0b2bc99464ffb48ebf83b4318400ff5de + codeSamplesRevisionDigest: sha256:fa15e6b73c9103819abf5631fe1c2785637831631b6afcad6feff7673f2a1aac workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index f5a59cba..70ab7040 100644 --- a/README.md +++ b/README.md @@ -263,8 +263,7 @@ This SDK supports the following security scheme globally: To authenticate with the API the `api_token` parameter must be set when initializing the SDK client instance. For example: ```python -from glean.api_client import Glean, models -from glean.api_client.utils import parse_datetime +from glean.api_client import Glean import os @@ -272,32 +271,10 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - glean.client.activity.report(events=[ - { - "action": models.ActivityEventAction.HISTORICAL_VIEW, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/", - }, - { - "action": models.ActivityEventAction.SEARCH, - "params": { - "query": "query", - }, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/search?q=query", - }, - { - "action": models.ActivityEventAction.VIEW, - "params": { - "duration": 20, - "referrer": "https://example.com/document", - }, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/", - }, - ]) + res = glean.agents.search(name="HR Policy Agent") - # Use the SDK ... + # Handle response + print(res) ``` @@ -339,16 +316,10 @@ For more information on obtaining the appropriate token type, please contact you ### [Agents](docs/sdks/agents/README.md) -* [create_agent](docs/sdks/agents/README.md#create_agent) - Create an agent -* [edit_agent](docs/sdks/agents/README.md#edit_agent) - Edit an agent - -### [Authentication](docs/sdks/authentication/README.md) - -* [checkdatasourceauth](docs/sdks/authentication/README.md#checkdatasourceauth) - Check datasource authorization - -### [Chat](docs/sdks/chatsdk/README.md) - -* [get_chat_file](docs/sdks/chatsdk/README.md#get_chat_file) - Download a chat file +* [search](docs/sdks/agents/README.md#search) - Search agents +* [get](docs/sdks/agents/README.md#get) - Get agent +* [get_schemas](docs/sdks/agents/README.md#get_schemas) - Get agent schemas +* [create_run](docs/sdks/agents/README.md#create_run) - Create agent run ### [Client.Activity](docs/sdks/clientactivity/README.md) @@ -357,7 +328,9 @@ For more information on obtaining the appropriate token type, please contact you ### [Client.Agents](docs/sdks/clientagents/README.md) +* [create](docs/sdks/clientagents/README.md#create) - Create an agent * [retrieve](docs/sdks/clientagents/README.md#retrieve) - Retrieve an agent +* [update](docs/sdks/clientagents/README.md#update) - Edit an agent * [retrieve_schemas](docs/sdks/clientagents/README.md#retrieve_schemas) - List an agent's schemas * [list](docs/sdks/clientagents/README.md#list) - Search agents * [run_stream](docs/sdks/clientagents/README.md#run_stream) - Create an agent run and stream the response @@ -379,6 +352,7 @@ For more information on obtaining the appropriate token type, please contact you ### [Client.Authentication](docs/sdks/clientauthentication/README.md) +* [check_datasource_auth](docs/sdks/clientauthentication/README.md#check_datasource_auth) - Check datasource authorization * [create_token](docs/sdks/clientauthentication/README.md#create_token) - Create authentication token ### [Client.Chat](docs/sdks/clientchat/README.md) @@ -392,6 +366,7 @@ For more information on obtaining the appropriate token type, please contact you * [upload_files](docs/sdks/clientchat/README.md#upload_files) - Upload files for Chat * [retrieve_files](docs/sdks/clientchat/README.md#retrieve_files) - Get files uploaded by a user for Chat * [delete_files](docs/sdks/clientchat/README.md#delete_files) - Delete files uploaded by a user for chat +* [retrieve_file](docs/sdks/clientchat/README.md#retrieve_file) - Download a chat file * [create_stream](docs/sdks/clientchat/README.md#create_stream) - Chat ### [Client.Collections](docs/sdks/collections/README.md) @@ -405,6 +380,13 @@ For more information on obtaining the appropriate token type, please contact you * [retrieve](docs/sdks/collections/README.md#retrieve) - Read Collection * [list](docs/sdks/collections/README.md#list) - List Collections +### [Client.Datasources](docs/sdks/clientdatasources/README.md) + +* [retrieve_configuration](docs/sdks/clientdatasources/README.md#retrieve_configuration) - Get datasource instance configuration +* [update_configuration](docs/sdks/clientdatasources/README.md#update_configuration) - Update datasource instance configuration +* [retrieve_credential_status](docs/sdks/clientdatasources/README.md#retrieve_credential_status) - Get datasource instance credential status +* [rotate_credentials](docs/sdks/clientdatasources/README.md#rotate_credentials) - Rotate datasource instance credentials + ### [Client.Documents](docs/sdks/clientdocuments/README.md) * [retrieve_permissions](docs/sdks/clientdocuments/README.md#retrieve_permissions) - Read document permissions @@ -412,10 +394,18 @@ For more information on obtaining the appropriate token type, please contact you * [retrieve_by_facets](docs/sdks/clientdocuments/README.md#retrieve_by_facets) - Read documents by facets * [summarize](docs/sdks/clientdocuments/README.md#summarize) - Summarize documents -### [Client.Entities](docs/sdks/cliententities/README.md) +### [Client.Entities](docs/sdks/entities/README.md) + +* [list](docs/sdks/entities/README.md#list) - List entities +* [read_people](docs/sdks/entities/README.md#read_people) - Read people +* [retrieve_person_photo](docs/sdks/entities/README.md#retrieve_person_photo) - Get person photo -* [list](docs/sdks/cliententities/README.md#list) - List entities -* [read_people](docs/sdks/cliententities/README.md#read_people) - Read people +### [Client.Governance.Data.Findings](docs/sdks/findings/README.md) + +* [create](docs/sdks/findings/README.md#create) - Creates findings export +* [list](docs/sdks/findings/README.md#list) - Lists findings exports +* [download](docs/sdks/findings/README.md#download) - Downloads findings export +* [delete](docs/sdks/findings/README.md#delete) - Deletes findings export ### [Client.Governance.Data.Policies](docs/sdks/policies/README.md) @@ -452,13 +442,13 @@ For more information on obtaining the appropriate token type, please contact you * [create](docs/sdks/pins/README.md#create) - Create pin * [remove](docs/sdks/pins/README.md#remove) - Delete pin -### [Client.Search](docs/sdks/search/README.md) +### [Client.Search](docs/sdks/clientsearch/README.md) -* [query_as_admin](docs/sdks/search/README.md#query_as_admin) - Search the index (admin) -* [autocomplete](docs/sdks/search/README.md#autocomplete) - Autocomplete -* [retrieve_feed](docs/sdks/search/README.md#retrieve_feed) - Feed of documents and events -* [recommendations](docs/sdks/search/README.md#recommendations) - Recommend documents -* [query](docs/sdks/search/README.md#query) - Search +* [query_as_admin](docs/sdks/clientsearch/README.md#query_as_admin) - Search the index (admin) +* [autocomplete](docs/sdks/clientsearch/README.md#autocomplete) - Autocomplete +* [retrieve_feed](docs/sdks/clientsearch/README.md#retrieve_feed) - Feed of documents and events +* [recommendations](docs/sdks/clientsearch/README.md#recommendations) - Recommend documents +* [query](docs/sdks/clientsearch/README.md#query) - Search ### [Client.Shortcuts](docs/sdks/clientshortcuts/README.md) @@ -468,10 +458,12 @@ For more information on obtaining the appropriate token type, please contact you * [list](docs/sdks/clientshortcuts/README.md#list) - List shortcuts * [update](docs/sdks/clientshortcuts/README.md#update) - Update shortcut -### [Client.Tools](docs/sdks/clienttools/README.md) +### [Client.Tools](docs/sdks/tools/README.md) -* [list](docs/sdks/clienttools/README.md#list) - List available tools -* [run](docs/sdks/clienttools/README.md#run) - Execute the specified tool +* [list](docs/sdks/tools/README.md#list) - List available tools +* [run](docs/sdks/tools/README.md#run) - Execute the specified tool +* [retrieve_action_pack_auth_status](docs/sdks/tools/README.md#retrieve_action_pack_auth_status) - Get end-user authentication status for an action pack. +* [authorize_action_pack](docs/sdks/tools/README.md#authorize_action_pack) - Start the OAuth authorization flow for an action pack. ### [Client.Verification](docs/sdks/clientverification/README.md) @@ -479,24 +471,6 @@ For more information on obtaining the appropriate token type, please contact you * [list](docs/sdks/clientverification/README.md#list) - List verifications * [verify](docs/sdks/clientverification/README.md#verify) - Update verification -### [Datasources](docs/sdks/datasources/README.md) - -* [get_datasource_instance_configuration](docs/sdks/datasources/README.md#get_datasource_instance_configuration) - Get datasource instance configuration -* [update_datasource_instance_configuration](docs/sdks/datasources/README.md#update_datasource_instance_configuration) - Update datasource instance configuration -* [get_datasource_credential_status](docs/sdks/datasources/README.md#get_datasource_credential_status) - Get datasource instance credential status -* [rotate_datasource_credentials](docs/sdks/datasources/README.md#rotate_datasource_credentials) - Rotate datasource instance credentials - -### [Entities](docs/sdks/entities/README.md) - -* [get_person_photo](docs/sdks/entities/README.md#get_person_photo) - Get person photo - -### [Governance](docs/sdks/governance/README.md) - -* [createfindingsexport](docs/sdks/governance/README.md#createfindingsexport) - Creates findings export -* [listfindingsexports](docs/sdks/governance/README.md#listfindingsexports) - Lists findings exports -* [downloadfindingsexport](docs/sdks/governance/README.md#downloadfindingsexport) - Downloads findings export -* [deletefindingsexport](docs/sdks/governance/README.md#deletefindingsexport) - Deletes findings export - ### [Indexing.Authentication](docs/sdks/indexingauthentication/README.md) * [rotate_token](docs/sdks/indexingauthentication/README.md#rotate_token) - Rotate token @@ -533,6 +507,8 @@ For more information on obtaining the appropriate token type, please contact you * [check_access](docs/sdks/indexingdocuments/README.md#check_access) - Check document access * [~~status~~](docs/sdks/indexingdocuments/README.md#status) - Get document upload and indexing status :warning: **Deprecated** * [~~count~~](docs/sdks/indexingdocuments/README.md#count) - Get document count :warning: **Deprecated** +* [debug_events](docs/sdks/indexingdocuments/README.md#debug_events) - Beta: Get document lifecycle events + ### [Indexing.People](docs/sdks/people/README.md) @@ -567,15 +543,9 @@ For more information on obtaining the appropriate token type, please contact you * [bulk_index](docs/sdks/indexingshortcuts/README.md#bulk_index) - Bulk index external shortcuts * [upload](docs/sdks/indexingshortcuts/README.md#upload) - Upload shortcuts -### [Tools](docs/sdks/tools/README.md) - -* [get_action_pack_auth_status](docs/sdks/tools/README.md#get_action_pack_auth_status) - Get end-user authentication status for an action pack. -* [authorize_action_pack](docs/sdks/tools/README.md#authorize_action_pack) - Start the OAuth authorization flow for an action pack. - -### [Troubleshooting](docs/sdks/troubleshooting/README.md) - -* [post_api_index_v1_debug_datasource_document_events](docs/sdks/troubleshooting/README.md#post_api_index_v1_debug_datasource_document_events) - Beta: Get document lifecycle events +### [Search](docs/sdks/search/README.md) +* [query](docs/sdks/search/README.md#query) - Search @@ -614,8 +584,8 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: ```python -from glean.api_client import Glean, models -from glean.api_client.utils import BackoffStrategy, RetryConfig, parse_datetime +from glean.api_client import Glean +from glean.api_client.utils import BackoffStrategy, RetryConfig import os @@ -623,40 +593,18 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - glean.client.activity.report(events=[ - { - "action": models.ActivityEventAction.HISTORICAL_VIEW, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/", - }, - { - "action": models.ActivityEventAction.SEARCH, - "params": { - "query": "query", - }, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/search?q=query", - }, - { - "action": models.ActivityEventAction.VIEW, - "params": { - "duration": 20, - "referrer": "https://example.com/document", - }, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/", - }, - ], + res = glean.agents.search(name="HR Policy Agent", RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) - # Use the SDK ... + # Handle response + print(res) ``` If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: ```python -from glean.api_client import Glean, models -from glean.api_client.utils import BackoffStrategy, RetryConfig, parse_datetime +from glean.api_client import Glean +from glean.api_client.utils import BackoffStrategy, RetryConfig import os @@ -665,32 +613,10 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - glean.client.activity.report(events=[ - { - "action": models.ActivityEventAction.HISTORICAL_VIEW, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/", - }, - { - "action": models.ActivityEventAction.SEARCH, - "params": { - "query": "query", - }, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/search?q=query", - }, - { - "action": models.ActivityEventAction.VIEW, - "params": { - "duration": 20, - "referrer": "https://example.com/document", - }, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/", - }, - ]) + res = glean.agents.search(name="HR Policy Agent") - # Use the SDK ... + # Handle response + print(res) ``` @@ -793,8 +719,7 @@ The default server `https://{instance}-be.glean.com` contains variables and is s #### Example ```python -from glean.api_client import Glean, models -from glean.api_client.utils import parse_datetime +from glean.api_client import Glean import os @@ -804,32 +729,10 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - glean.client.activity.report(events=[ - { - "action": models.ActivityEventAction.HISTORICAL_VIEW, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/", - }, - { - "action": models.ActivityEventAction.SEARCH, - "params": { - "query": "query", - }, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/search?q=query", - }, - { - "action": models.ActivityEventAction.VIEW, - "params": { - "duration": 20, - "referrer": "https://example.com/document", - }, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/", - }, - ]) + res = glean.agents.search(name="HR Policy Agent") - # Use the SDK ... + # Handle response + print(res) ``` @@ -837,8 +740,7 @@ with Glean( The default server can be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example: ```python -from glean.api_client import Glean, models -from glean.api_client.utils import parse_datetime +from glean.api_client import Glean import os @@ -847,32 +749,10 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - glean.client.activity.report(events=[ - { - "action": models.ActivityEventAction.HISTORICAL_VIEW, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/", - }, - { - "action": models.ActivityEventAction.SEARCH, - "params": { - "query": "query", - }, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/search?q=query", - }, - { - "action": models.ActivityEventAction.VIEW, - "params": { - "duration": 20, - "referrer": "https://example.com/document", - }, - "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"), - "url": "https://example.com/", - }, - ]) + res = glean.agents.search(name="HR Policy Agent") - # Use the SDK ... + # Handle response + print(res) ``` diff --git a/RELEASES.md b/RELEASES.md index 1ad7f32b..eaf2142b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -758,4 +758,14 @@ Based on: ### Generated - [python v0.14.0] . ### Releases -- [PyPI v0.14.0] https://pypi.org/project/glean-api-client/0.14.0 - . \ No newline at end of file +- [PyPI v0.14.0] https://pypi.org/project/glean-api-client/0.14.0 - . + +## 2026-07-02 17:47:32 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.788.0 (2.915.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.15.0] . +### Releases +- [PyPI v0.15.0] https://pypi.org/project/glean-api-client/0.15.0 - . \ No newline at end of file diff --git a/docs/errors/platformproblemdetailerror.md b/docs/errors/platformproblemdetailerror.md new file mode 100644 index 00000000..68870011 --- /dev/null +++ b/docs/errors/platformproblemdetailerror.md @@ -0,0 +1,18 @@ +# PlatformProblemDetailError + +Error response following RFC 9457, extended with `code` and `documentation_url` for machine-readable classification and self-service remediation. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `type` | *str* | :heavy_check_mark: | URI identifying the error type. | https://developer.glean.com/errors/invalid-cursor | +| `title` | *str* | :heavy_check_mark: | Short, human-readable summary of the error. | Invalid Pagination Cursor | +| `status` | *int* | :heavy_check_mark: | HTTP status code mirrored from the response. | 400 | +| `detail` | *str* | :heavy_check_mark: | Human-readable explanation specific to this occurrence. | The provided cursor has expired. Start a new search to get a fresh cursor.
| +| `code` | [models.PlatformProblemDetailCode](../models/platformproblemdetailcode.md) | :heavy_check_mark: | Stable machine-readable error code. | invalid_cursor | +| `documentation_url` | *Optional[str]* | :heavy_minus_sign: | Direct URL to documentation for this error code. | https://developer.glean.com/errors/invalid-cursor | +| `request_id` | *str* | :heavy_check_mark: | Platform-generated request ID for support correlation. | req_7f8a9b0c1d2e | +| `errors` | List[[models.PlatformProblemDetailError](../models/platformproblemdetailerror.md)] | :heavy_minus_sign: | Field-level validation problems, one entry per offending field. | | \ No newline at end of file diff --git a/docs/models/platformactionsummary.md b/docs/models/platformactionsummary.md new file mode 100644 index 00000000..4a911ee3 --- /dev/null +++ b/docs/models/platformactionsummary.md @@ -0,0 +1,14 @@ +# PlatformActionSummary + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `tool_id` | *str* | :heavy_check_mark: | Unique identifier of the action. | +| `display_name` | *str* | :heavy_check_mark: | Display name of the action. | +| `type` | *Optional[str]* | :heavy_minus_sign: | Tool type. | +| `auth_type` | *Optional[str]* | :heavy_minus_sign: | Authentication type required by the action. | +| `write_action_type` | *Optional[str]* | :heavy_minus_sign: | Write-action execution type. | +| `is_setup_finished` | *Optional[bool]* | :heavy_minus_sign: | Whether this action has been fully configured. | +| `data_source` | *Optional[str]* | :heavy_minus_sign: | Kind of knowledge the action accesses or modifies. | \ No newline at end of file diff --git a/docs/models/platformagent.md b/docs/models/platformagent.md new file mode 100644 index 00000000..dd4be223 --- /dev/null +++ b/docs/models/platformagent.md @@ -0,0 +1,12 @@ +# PlatformAgent + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent. | mho4lwzylcozgoc2 | +| `name` | *str* | :heavy_check_mark: | Name of the agent. | HR Policy Agent | +| `description` | *Optional[str]* | :heavy_minus_sign: | Description of the agent. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Agent metadata. | | +| `capabilities` | [models.PlatformAgentCapabilities](../models/platformagentcapabilities.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/platformagentcapabilities.md b/docs/models/platformagentcapabilities.md new file mode 100644 index 00000000..052dd7bb --- /dev/null +++ b/docs/models/platformagentcapabilities.md @@ -0,0 +1,10 @@ +# PlatformAgentCapabilities + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `ap_io_messages` | *Optional[bool]* | :heavy_minus_sign: | Whether the agent supports messages as input. | +| `ap_io_streaming` | *Optional[bool]* | :heavy_minus_sign: | Whether the agent supports streaming output. | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/platformagentexecutionstatus.md b/docs/models/platformagentexecutionstatus.md new file mode 100644 index 00000000..c5b5164a --- /dev/null +++ b/docs/models/platformagentexecutionstatus.md @@ -0,0 +1,21 @@ +# PlatformAgentExecutionStatus + +Status of the agent run. + +## Example Usage + +```python +from glean.api_client.models import PlatformAgentExecutionStatus + +value = PlatformAgentExecutionStatus.ERROR + +# Open enum: unrecognized values are captured as UnrecognizedStr +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `ERROR` | error | +| `SUCCESS` | success | \ No newline at end of file diff --git a/docs/models/platformagentgetresponse.md b/docs/models/platformagentgetresponse.md new file mode 100644 index 00000000..be79ecee --- /dev/null +++ b/docs/models/platformagentgetresponse.md @@ -0,0 +1,9 @@ +# PlatformAgentGetResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `agent` | [models.PlatformAgent](../models/platformagent.md) | :heavy_check_mark: | N/A | +| `request_id` | *str* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/platformagentrun.md b/docs/models/platformagentrun.md new file mode 100644 index 00000000..d6dffe14 --- /dev/null +++ b/docs/models/platformagentrun.md @@ -0,0 +1,12 @@ +# PlatformAgentRun + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent being run. | +| `input` | Dict[str, *Any*] | :heavy_minus_sign: | Input fields for an input-form triggered agent. | +| `messages` | List[[models.PlatformMessage](../models/platformmessage.md)] | :heavy_minus_sign: | Messages passed to the agent. | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata passed to the agent. | +| `status` | [models.PlatformAgentExecutionStatus](../models/platformagentexecutionstatus.md) | :heavy_check_mark: | Status of the agent run. | \ No newline at end of file diff --git a/docs/models/platformagentruncreaterequest.md b/docs/models/platformagentruncreaterequest.md new file mode 100644 index 00000000..072a5ce9 --- /dev/null +++ b/docs/models/platformagentruncreaterequest.md @@ -0,0 +1,14 @@ +# PlatformAgentRunCreateRequest + +Request to run an agent. A request MUST supply either `messages` (a non-empty conversation) or `input` (for input-form triggered agents). + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | Dict[str, *Any*] | :heavy_minus_sign: | Input fields for an input-form triggered agent. | +| `messages` | List[[models.PlatformMessage](../models/platformmessage.md)] | :heavy_minus_sign: | Messages to pass to the agent. When provided, the array MUST contain at least one message and each message MUST specify a valid `role` and non-empty `content`.
| +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata to pass to the agent. | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream the run response as server-sent events. | \ No newline at end of file diff --git a/docs/models/platformagentrunwaitresponse.md b/docs/models/platformagentrunwaitresponse.md new file mode 100644 index 00000000..f41e4044 --- /dev/null +++ b/docs/models/platformagentrunwaitresponse.md @@ -0,0 +1,10 @@ +# PlatformAgentRunWaitResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `run` | [Optional[models.PlatformAgentRun]](../models/platformagentrun.md) | :heavy_minus_sign: | N/A | +| `messages` | List[[models.PlatformMessage](../models/platformmessage.md)] | :heavy_minus_sign: | Messages returned by the completed run. | +| `request_id` | *str* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/platformagentschemasresponse.md b/docs/models/platformagentschemasresponse.md new file mode 100644 index 00000000..6ba12306 --- /dev/null +++ b/docs/models/platformagentschemasresponse.md @@ -0,0 +1,13 @@ +# PlatformAgentSchemasResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent. | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the agent. | +| `input_schema` | Dict[str, *Any*] | :heavy_check_mark: | Agent input schema in JSON Schema format. | +| `output_schema` | Dict[str, *Any*] | :heavy_check_mark: | Agent output schema in JSON Schema format. | +| `tools` | List[[models.PlatformActionSummary](../models/platformactionsummary.md)] | :heavy_minus_sign: | Tools that the agent can invoke, when requested. | +| `request_id` | *str* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/platformagentscreaterunrequest.md b/docs/models/platformagentscreaterunrequest.md new file mode 100644 index 00000000..df931458 --- /dev/null +++ b/docs/models/platformagentscreaterunrequest.md @@ -0,0 +1,9 @@ +# PlatformAgentsCreateRunRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent to run. | +| `platform_agent_run_create_request` | [models.PlatformAgentRunCreateRequest](../models/platformagentruncreaterequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/platformagentscreaterunresponse.md b/docs/models/platformagentscreaterunresponse.md new file mode 100644 index 00000000..8282996d --- /dev/null +++ b/docs/models/platformagentscreaterunresponse.md @@ -0,0 +1,17 @@ +# PlatformAgentsCreateRunResponse + + +## Supported Types + +### `models.PlatformAgentRunWaitResponse` + +```python +value: models.PlatformAgentRunWaitResponse = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/models/platformagentsgetrequest.md b/docs/models/platformagentsgetrequest.md new file mode 100644 index 00000000..5cdd73d2 --- /dev/null +++ b/docs/models/platformagentsgetrequest.md @@ -0,0 +1,8 @@ +# PlatformAgentsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent to retrieve. | \ No newline at end of file diff --git a/docs/models/platformagentsgetschemasrequest.md b/docs/models/platformagentsgetschemasrequest.md new file mode 100644 index 00000000..dfb7f4df --- /dev/null +++ b/docs/models/platformagentsgetschemasrequest.md @@ -0,0 +1,9 @@ +# PlatformAgentsGetSchemasRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent whose schemas should be retrieved. | +| `include_tools` | *Optional[bool]* | :heavy_minus_sign: | Whether to include tool metadata in the response. | \ No newline at end of file diff --git a/docs/models/platformagentssearchrequest.md b/docs/models/platformagentssearchrequest.md new file mode 100644 index 00000000..381dc6be --- /dev/null +++ b/docs/models/platformagentssearchrequest.md @@ -0,0 +1,8 @@ +# PlatformAgentsSearchRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `name` | *Optional[str]* | :heavy_minus_sign: | Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied. | HR Policy Agent | \ No newline at end of file diff --git a/docs/models/platformagentssearchresponse.md b/docs/models/platformagentssearchresponse.md new file mode 100644 index 00000000..1c961815 --- /dev/null +++ b/docs/models/platformagentssearchresponse.md @@ -0,0 +1,9 @@ +# PlatformAgentsSearchResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `agents` | List[[models.PlatformAgent](../models/platformagent.md)] | :heavy_check_mark: | Agents matching the search request. | +| `request_id` | *str* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/platformcontenttype.md b/docs/models/platformcontenttype.md new file mode 100644 index 00000000..1b46526d --- /dev/null +++ b/docs/models/platformcontenttype.md @@ -0,0 +1,16 @@ +# PlatformContentType + +## Example Usage + +```python +from glean.api_client.models import PlatformContentType + +value = PlatformContentType.TEXT +``` + + +## Values + +| Name | Value | +| ------ | ------ | +| `TEXT` | text | \ No newline at end of file diff --git a/docs/models/platformfilter.md b/docs/models/platformfilter.md new file mode 100644 index 00000000..b3e8b651 --- /dev/null +++ b/docs/models/platformfilter.md @@ -0,0 +1,13 @@ +# PlatformFilter + +A single filter criterion. For `EQUALS`, multiple values within a filter are OR'd. For `NOT_EQUALS`, multiple values exclude all listed values. Filters are AND'd with each other and with any inline query operators. + + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `field` | *str* | :heavy_check_mark: | The field to filter on. Accepts built-in filter field names such as `type`, `owner`, `from`, `author`, `channel`, `status`, `assignee`, `reporter`, `component`, `mentions`, and `collection`, plus custom datasource property names.
| type | +| `values` | List[*str*] | :heavy_check_mark: | One or more values to match. | [
"spreadsheet",
"presentation"
] | +| `operator` | [Optional[models.PlatformFilterOperator]](../models/platformfilteroperator.md) | :heavy_minus_sign: | Comparison operator to apply to this filter. Defaults to `EQUALS`. `GT`, `GTE`, `LT`, and `LTE` range operators require exactly one value; express bounded ranges with multiple filters on the same field.
| | \ No newline at end of file diff --git a/docs/models/platformfilteroperator.md b/docs/models/platformfilteroperator.md new file mode 100644 index 00000000..f814671e --- /dev/null +++ b/docs/models/platformfilteroperator.md @@ -0,0 +1,23 @@ +# PlatformFilterOperator + +Supported filter operator. + +## Example Usage + +```python +from glean.api_client.models import PlatformFilterOperator + +value = PlatformFilterOperator.EQUALS +``` + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `EQUALS` | EQUALS | +| `NOT_EQUALS` | NOT_EQUALS | +| `GT` | GT | +| `GTE` | GTE | +| `LT` | LT | +| `LTE` | LTE | \ No newline at end of file diff --git a/docs/models/platformmessage.md b/docs/models/platformmessage.md new file mode 100644 index 00000000..626f1c36 --- /dev/null +++ b/docs/models/platformmessage.md @@ -0,0 +1,9 @@ +# PlatformMessage + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `role` | [models.PlatformMessageRole](../models/platformmessagerole.md) | :heavy_check_mark: | Role of the message author. | USER | +| `content` | List[[models.PlatformMessageTextBlock](../models/platformmessagetextblock.md)] | :heavy_check_mark: | Content blocks in the message. | | \ No newline at end of file diff --git a/docs/models/platformmessagerole.md b/docs/models/platformmessagerole.md new file mode 100644 index 00000000..3646a0b7 --- /dev/null +++ b/docs/models/platformmessagerole.md @@ -0,0 +1,21 @@ +# PlatformMessageRole + +Role of the message author. + +## Example Usage + +```python +from glean.api_client.models import PlatformMessageRole + +value = PlatformMessageRole.USER + +# Open enum: unrecognized values are captured as UnrecognizedStr +``` + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `USER` | USER | +| `GLEAN_AI` | GLEAN_AI | \ No newline at end of file diff --git a/docs/models/platformmessagetextblock.md b/docs/models/platformmessagetextblock.md new file mode 100644 index 00000000..68ac4250 --- /dev/null +++ b/docs/models/platformmessagetextblock.md @@ -0,0 +1,9 @@ +# PlatformMessageTextBlock + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `text` | *str* | :heavy_check_mark: | Text content. | +| `type` | [models.PlatformContentType](../models/platformcontenttype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/platformpersonreference.md b/docs/models/platformpersonreference.md new file mode 100644 index 00000000..9602adac --- /dev/null +++ b/docs/models/platformpersonreference.md @@ -0,0 +1,11 @@ +# PlatformPersonReference + +A lightweight reference to a person, used where a payload merely points at someone. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | Opaque Glean person ID. | +| `name` | *str* | :heavy_check_mark: | Display name. | \ No newline at end of file diff --git a/docs/models/platformproblemdetailcode.md b/docs/models/platformproblemdetailcode.md new file mode 100644 index 00000000..21fd0b4c --- /dev/null +++ b/docs/models/platformproblemdetailcode.md @@ -0,0 +1,38 @@ +# PlatformProblemDetailCode + +Stable machine-readable error code. + +## Example Usage + +```python +from glean.api_client.models import PlatformProblemDetailCode + +value = PlatformProblemDetailCode.INVALID_REQUEST + +# Open enum: unrecognized values are captured as UnrecognizedStr +``` + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `INVALID_REQUEST` | invalid_request | +| `MISSING_REQUIRED_FIELD` | missing_required_field | +| `INVALID_PARAMETER` | invalid_parameter | +| `INVALID_CURSOR` | invalid_cursor | +| `EXPIRED_CURSOR` | expired_cursor | +| `INVALID_FILTER` | invalid_filter | +| `INVALID_DATASOURCE` | invalid_datasource | +| `AUTHENTICATION_REQUIRED` | authentication_required | +| `TOKEN_EXPIRED` | token_expired | +| `INSUFFICIENT_PERMISSIONS` | insufficient_permissions | +| `RESOURCE_NOT_FOUND` | resource_not_found | +| `METHOD_NOT_ALLOWED` | method_not_allowed | +| `REQUEST_TIMEOUT` | request_timeout | +| `CONFLICT` | conflict | +| `GONE` | gone | +| `UNPROCESSABLE_QUERY` | unprocessable_query | +| `RATE_LIMIT_EXCEEDED` | rate_limit_exceeded | +| `INTERNAL_ERROR` | internal_error | +| `SERVICE_UNAVAILABLE` | service_unavailable | \ No newline at end of file diff --git a/docs/models/platformproblemdetailerror.md b/docs/models/platformproblemdetailerror.md new file mode 100644 index 00000000..169944d5 --- /dev/null +++ b/docs/models/platformproblemdetailerror.md @@ -0,0 +1,12 @@ +# PlatformProblemDetailError + +Field-level validation problem for a single offending field. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `pointer` | *str* | :heavy_check_mark: | RFC 6901 JSON Pointer to the offending field. | /messages/0/role | +| `detail` | *str* | :heavy_check_mark: | Human-readable explanation for this field. | Must be one of: USER, GLEAN_AI. | +| `code` | [Optional[models.PlatformProblemDetailCode]](../models/platformproblemdetailcode.md) | :heavy_minus_sign: | Stable machine-readable error code. | invalid_cursor | \ No newline at end of file diff --git a/docs/models/platformresult.md b/docs/models/platformresult.md new file mode 100644 index 00000000..e9b2cd6a --- /dev/null +++ b/docs/models/platformresult.md @@ -0,0 +1,17 @@ +# PlatformResult + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `url` | *str* | :heavy_check_mark: | Canonical URL of the result. | https://company.atlassian.net/wiki/spaces/ENG/pages/12345 | +| `title` | *str* | :heavy_check_mark: | Result title. | Q2 2026 Platform Roadmap | +| `snippets` | List[*str*] | :heavy_minus_sign: | Query-relevant plain-text excerpts from the result body. | [
"The platform team will focus on API stability and..."
] | +| `datasource` | *str* | :heavy_check_mark: | The datasource this result originates from. | confluence | +| `datasource_instance` | *OptionalNullable[str]* | :heavy_minus_sign: | The datasource instance this result originates from, if known. | confluence_acme | +| `document_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The document type within the datasource. | page | +| `creator` | [Optional[models.PlatformPersonReference]](../models/platformpersonreference.md) | :heavy_minus_sign: | A lightweight reference to a person, used where a payload merely points at someone. | | +| `owner` | [Optional[models.PlatformPersonReference]](../models/platformpersonreference.md) | :heavy_minus_sign: | A lightweight reference to a person, used where a payload merely points at someone. | | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | When the result was last modified. | | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | When the result was created. | | \ No newline at end of file diff --git a/docs/sdks/cliententities/README.md b/docs/models/platformsearchrequest.md similarity index 52% rename from docs/sdks/cliententities/README.md rename to docs/models/platformsearchrequest.md index 0ac68e93..1acc3f70 100644 --- a/docs/sdks/cliententities/README.md +++ b/docs/models/platformsearchrequest.md @@ -1,121 +1,14 @@ -# Client.Entities +# PlatformSearchRequest -## Overview -### Available Operations +## Fields -* [list](#list) - List entities -* [read_people](#read_people) - Read people - -## list - -List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint, except when using FULL_DIRECTORY request type for people entities. - -### Example Usage - - -```python -from glean.api_client import Glean, models -import os - - -with Glean( - api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as glean: - - res = glean.client.entities.list(filter_=[ - { - "field_name": "type", - "values": [ - { - "value": "Spreadsheet", - "relation_type": models.RelationType.EQUALS, - }, - { - "value": "Presentation", - "relation_type": models.RelationType.EQUALS, - }, - ], - }, - ], entity_type=models.ListEntitiesRequestEntityType.PEOPLE, page_size=100, request_type=models.RequestType.STANDARD) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | | -| `filter_` | List[[models.FacetFilter](../../models/facetfilter.md)] | :heavy_minus_sign: | N/A | | -| `sort` | List[[models.SortOptions](../../models/sortoptions.md)] | :heavy_minus_sign: | Use EntitiesSortOrder enum for SortOptions.sortBy | | -| `entity_type` | [Optional[models.ListEntitiesRequestEntityType]](../../models/listentitiesrequestentitytype.md) | :heavy_minus_sign: | N/A | | -| `datasource` | *Optional[str]* | :heavy_minus_sign: | The datasource associated with the entity type, most commonly used with CUSTOM_ENTITIES | | -| `query` | *Optional[str]* | :heavy_minus_sign: | A query string to search for entities that each entity in the response must conform to. An empty query does not filter any entities. | | -| `include_fields` | List[[models.ListEntitiesRequestIncludeField](../../models/listentitiesrequestincludefield.md)] | :heavy_minus_sign: | List of entity fields to return (that aren't returned by default) | | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | Hint to the server about how many results to send back. Server may return less. | 100 | -| `cursor` | *Optional[str]* | :heavy_minus_sign: | Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. | | -| `source` | *Optional[str]* | :heavy_minus_sign: | A string denoting the search surface from which the endpoint is called. | | -| `request_type` | [Optional[models.RequestType]](../../models/requesttype.md) | :heavy_minus_sign: | The type of request being made. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[models.ListEntitiesResponse](../../models/listentitiesresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------- | ----------------- | ----------------- | -| errors.GleanError | 4XX, 5XX | \*/\* | - -## read_people - -Read people details for the given IDs. - -### Example Usage - - -```python -from glean.api_client import Glean -import os - - -with Glean( - api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as glean: - - res = glean.client.entities.read_people(obfuscated_ids=[ - "abc123", - "abc456", - ]) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | -| `timezone_offset` | *Optional[int]* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. | -| `obfuscated_ids` | List[*str*] | :heavy_minus_sign: | The Person IDs to retrieve. If no IDs are requested, the current user's details are returned. | -| `email_ids` | List[*str*] | :heavy_minus_sign: | The email IDs to retrieve. The result is the deduplicated union of emailIds and obfuscatedIds. | -| `include_fields` | List[[models.PeopleRequestIncludeField](../../models/peoplerequestincludefield.md)] | :heavy_minus_sign: | List of PersonMetadata fields to return (that aren't returned by default) | -| `include_types` | List[[models.IncludeType](../../models/includetype.md)] | :heavy_minus_sign: | The types of people entities to include in the response in addition to those returned by default. | -| `source` | *Optional[str]* | :heavy_minus_sign: | A string denoting the search surface from which the endpoint is called. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.PeopleResponse](../../models/peopleresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------- | ----------------- | ----------------- | -| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `query` | *str* | :heavy_check_mark: | The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`.
| quarterly planning 2026 | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of results to return per page. | | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request.
| | +| `datasources` | List[*str*] | :heavy_minus_sign: | Restrict results to specific datasources. Requests must not specify both `datasources` and `datasource_instances`.
| [
"confluence",
"google_drive"
] | +| `datasource_instances` | List[*str*] | :heavy_minus_sign: | Restrict results to specific datasource instances. Values are datasource instance identifiers returned by `GET /api/search/filters`. Requests must not specify both `datasources` and `datasource_instances`.
| [
"slack_acme",
"slack_eu"
] | +| `filters` | List[[models.PlatformFilter](../models/platformfilter.md)] | :heavy_minus_sign: | Structured filters applied to search results. Equality operators OR multiple values within a filter. Multiple filters are AND'd together, including range filters on the same field. Filters are AND'd with any inline operators in `query`. Note that conflicting constraints on the same field (e.g., `type:document` in the query and `type: spreadsheet` in a filter) produce an empty result set.
| | +| `time_range` | [Optional[models.PlatformTimeRange]](../models/platformtimerange.md) | :heavy_minus_sign: | Filter results to those last updated within this range. | | \ No newline at end of file diff --git a/docs/models/platformsearchresponse.md b/docs/models/platformsearchresponse.md new file mode 100644 index 00000000..219a923e --- /dev/null +++ b/docs/models/platformsearchresponse.md @@ -0,0 +1,11 @@ +# PlatformSearchResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `results` | List[[models.PlatformResult](../models/platformresult.md)] | :heavy_check_mark: | Ordered list of search results. | +| `has_more` | *bool* | :heavy_check_mark: | Indicates whether additional pages of results are available. | +| `next_cursor` | *Nullable[str]* | :heavy_check_mark: | Opaque token to pass as `cursor` in the next request. | +| `request_id` | *str* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/platformtimerange.md b/docs/models/platformtimerange.md new file mode 100644 index 00000000..ff19123b --- /dev/null +++ b/docs/models/platformtimerange.md @@ -0,0 +1,11 @@ +# PlatformTimeRange + +Filter results to those last updated within this range. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `start` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Inclusive lower bound in ISO 8601 format. | +| `end` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Exclusive upper bound in ISO 8601 format. | \ No newline at end of file diff --git a/docs/sdks/agents/README.md b/docs/sdks/agents/README.md index 00789fbf..293302de 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -4,16 +4,62 @@ ### Available Operations -* [create_agent](#create_agent) - Create an agent -* [edit_agent](#edit_agent) - Edit an agent +* [search](#search) - Search agents +* [get](#get) - Get agent +* [get_schemas](#get_schemas) - Get agent schemas +* [create_run](#create_run) - Create agent run -## create_agent +## search + +Search agents available to the authenticated user by agent name. + + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.agents.search(name="HR Policy Agent") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `name` | *Optional[str]* | :heavy_minus_sign: | Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied. | HR Policy Agent | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.PlatformAgentsSearchResponse](../../models/platformagentssearchresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## get + +Retrieve details for an agent available to the authenticated user. -Create an agent. ### Example Usage - + ```python from glean.api_client import Glean import os @@ -23,7 +69,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.agents.create_agent() + res = glean.agents.get(agent_id="") # Handle response print(res) @@ -32,32 +78,31 @@ with Glean( ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | -| `timezone_offset` | *Optional[int]* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. | -| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the workflow. | -| `transient` | *Optional[bool]* | :heavy_minus_sign: | Used to create a transient workflow. | -| `parent_workflow_id` | *Optional[str]* | :heavy_minus_sign: | id of the parent workflow for transient workflows | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent to retrieve. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[models.WorkflowResult](../../models/workflowresult.md)** +**[models.PlatformAgentGetResponse](../../models/platformagentgetresponse.md)** ### Errors -| Error Type | Status Code | Content Type | -| ----------------- | ----------------- | ----------------- | -| errors.GleanError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | -## edit_agent +## get_schemas + +Retrieve an agent's input and output JSON schemas. -Creates a draft or publishes an [agent](https://developers.glean.com/agents/agents-api). Use `isDraft=true` to save a draft, or `isDraft=false` (or omit) to publish immediately. Only draft and publish modes are supported. ### Example Usage - + ```python from glean.api_client import Glean import os @@ -67,26 +112,81 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - glean.agents.edit_agent(agent_id="") + res = glean.agents.get_schemas(agent_id="", include_tools=False) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent whose schemas should be retrieved. | +| `include_tools` | *Optional[bool]* | :heavy_minus_sign: | Whether to include tool metadata in the response. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.PlatformAgentSchemasResponse](../../models/platformagentschemasresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## create_run + +Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. + + +### Example Usage + + +```python +from glean.api_client import Glean, models +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.agents.create_run(agent_id="", messages=[ + { + "role": models.PlatformMessageRole.USER, + "content": [], + }, + ], stream=False) - # Use the SDK ... + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent. | -| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | -| `timezone_offset` | *Optional[int]* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. | -| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the workflow. | -| `id` | *Optional[str]* | :heavy_minus_sign: | The workflow ID we want to update. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent to run. | +| `input` | Dict[str, *Any*] | :heavy_minus_sign: | Input fields for an input-form triggered agent. | +| `messages` | List[[models.PlatformMessage](../../models/platformmessage.md)] | :heavy_minus_sign: | Messages to pass to the agent. When provided, the array MUST contain at least one message and each message MUST specify a valid `role` and non-empty `content`.
| +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata to pass to the agent. | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream the run response as server-sent events. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.PlatformAgentsCreateRunResponse](../../models/platformagentscreaterunresponse.md)** ### Errors -| Error Type | Status Code | Content Type | -| -------------------- | -------------------- | -------------------- | -| errors.ErrorResponse | 404 | application/json | -| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 409, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/authentication/README.md b/docs/sdks/authentication/README.md deleted file mode 100644 index d7fef010..00000000 --- a/docs/sdks/authentication/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# Authentication - -## Overview - -Manage indexing API tokens. - -### Available Operations - -* [checkdatasourceauth](#checkdatasourceauth) - Check datasource authorization - -## checkdatasourceauth - -Returns all datasource instances that require per-user OAuth authorization -for the authenticated user, along with a transient auth token that can be -appended to auth URLs to complete OAuth flows. - -Clients construct the full OAuth URL by combining the backend base URL, -the `authUrlRelativePath` from each instance, and the transient auth token: -`/?transient_auth_token=`. - - -### Example Usage - - -```python -from glean.api_client import Glean -import os - - -with Glean( - api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as glean: - - res = glean.authentication.checkdatasourceauth() - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.CheckDatasourceAuthResponse](../../models/checkdatasourceauthresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------- | ----------------- | ----------------- | -| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/chatsdk/README.md b/docs/sdks/chatsdk/README.md deleted file mode 100644 index 27dea574..00000000 --- a/docs/sdks/chatsdk/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# Chat - -## Overview - -### Available Operations - -* [get_chat_file](#get_chat_file) - Download a chat file - -## get_chat_file - -Download the raw content of a file generated or uploaded during a chat session (for example, an image produced by the assistant). Returns the file bytes with a Content-Type header matching the file's MIME type. - - -### Example Usage - - -```python -from glean.api_client import Glean -import os - - -with Glean( - api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as glean: - - res = glean.chat.get_chat_file(file_id="") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `file_id` | *str* | :heavy_check_mark: | Identifier of the chat file to download. | -| `preview` | *Optional[bool]* | :heavy_minus_sign: | When true and the file is a PDF, the response is served inline (Content-Disposition: inline) instead of as an attachment.
| -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[httpx.Response](../../models/.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------- | ----------------- | ----------------- | -| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/clientagents/README.md b/docs/sdks/clientagents/README.md index 2856eeeb..78fe4036 100644 --- a/docs/sdks/clientagents/README.md +++ b/docs/sdks/clientagents/README.md @@ -4,12 +4,58 @@ ### Available Operations +* [create](#create) - Create an agent * [retrieve](#retrieve) - Retrieve an agent +* [update](#update) - Edit an agent * [retrieve_schemas](#retrieve_schemas) - List an agent's schemas * [list](#list) - Search agents * [run_stream](#run_stream) - Create an agent run and stream the response * [run](#run) - Create an agent run and wait for the response +## create + +Create an agent. + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.agents.create() + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | +| `timezone_offset` | *Optional[int]* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the workflow. | +| `transient` | *Optional[bool]* | :heavy_minus_sign: | Used to create a transient workflow. | +| `parent_workflow_id` | *Optional[str]* | :heavy_minus_sign: | id of the parent workflow for transient workflows | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowResult](../../models/workflowresult.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------- | ----------------- | ----------------- | +| errors.GleanError | 4XX, 5XX | \*/\* | + ## retrieve Returns details of an [agent](https://developers.glean.com/agents/agents-api) created in the Agent Builder. @@ -53,6 +99,46 @@ with Glean( | errors.ErrorResponse | 404 | application/json | | errors.GleanError | 4XX, 5XX | \*/\* | +## update + +Creates a draft or publishes an [agent](https://developers.glean.com/agents/agents-api). Use `isDraft=true` to save a draft, or `isDraft=false` (or omit) to publish immediately. Only draft and publish modes are supported. + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + glean.client.agents.update(agent_id="") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent. | +| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | +| `timezone_offset` | *Optional[int]* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the workflow. | +| `id` | *Optional[str]* | :heavy_minus_sign: | The workflow ID we want to update. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------- | -------------------- | -------------------- | +| errors.ErrorResponse | 404 | application/json | +| errors.GleanError | 4XX, 5XX | \*/\* | + ## retrieve_schemas Return [agent](https://developers.glean.com/agents/agents-api)'s input and output schemas. You can use these schemas to detect changes to an agent's input or output structure. diff --git a/docs/sdks/clientauthentication/README.md b/docs/sdks/clientauthentication/README.md index b9a4856d..7d4827b2 100644 --- a/docs/sdks/clientauthentication/README.md +++ b/docs/sdks/clientauthentication/README.md @@ -4,8 +4,55 @@ ### Available Operations +* [check_datasource_auth](#check_datasource_auth) - Check datasource authorization * [create_token](#create_token) - Create authentication token +## check_datasource_auth + +Returns all datasource instances that require per-user OAuth authorization +for the authenticated user, along with a transient auth token that can be +appended to auth URLs to complete OAuth flows. + +Clients construct the full OAuth URL by combining the backend base URL, +the `authUrlRelativePath` from each instance, and the transient auth token: +`/?transient_auth_token=`. + + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.authentication.check_datasource_auth() + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.CheckDatasourceAuthResponse](../../models/checkdatasourceauthresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------- | ----------------- | ----------------- | +| errors.GleanError | 4XX, 5XX | \*/\* | + ## create_token Creates an authentication token for the authenticated user. These are diff --git a/docs/sdks/clientchat/README.md b/docs/sdks/clientchat/README.md index 09a859f9..df2c74ec 100644 --- a/docs/sdks/clientchat/README.md +++ b/docs/sdks/clientchat/README.md @@ -13,6 +13,7 @@ * [upload_files](#upload_files) - Upload files for Chat * [retrieve_files](#retrieve_files) - Get files uploaded by a user for Chat * [delete_files](#delete_files) - Delete files uploaded by a user for chat +* [retrieve_file](#retrieve_file) - Download a chat file * [create_stream](#create_stream) - Chat ## create @@ -482,6 +483,48 @@ with Glean( | ----------------- | ----------------- | ----------------- | | errors.GleanError | 4XX, 5XX | \*/\* | +## retrieve_file + +Download the raw content of a file generated or uploaded during a chat session (for example, an image produced by the assistant). Returns the file bytes with a Content-Type header matching the file's MIME type. + + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.chat.retrieve_file(file_id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `file_id` | *str* | :heavy_check_mark: | Identifier of the chat file to download. | +| `preview` | *Optional[bool]* | :heavy_minus_sign: | When true and the file is a PDF, the response is served inline (Content-Disposition: inline) instead of as an attachment.
| +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[httpx.Response](../../models/.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------- | ----------------- | ----------------- | +| errors.GleanError | 4XX, 5XX | \*/\* | + ## create_stream Have a conversation with Glean AI. diff --git a/docs/sdks/datasources/README.md b/docs/sdks/clientdatasources/README.md similarity index 91% rename from docs/sdks/datasources/README.md rename to docs/sdks/clientdatasources/README.md index 15b97d59..83d845c0 100644 --- a/docs/sdks/datasources/README.md +++ b/docs/sdks/clientdatasources/README.md @@ -1,17 +1,15 @@ -# Datasources +# Client.Datasources ## Overview -Manage datasources. - ### Available Operations -* [get_datasource_instance_configuration](#get_datasource_instance_configuration) - Get datasource instance configuration -* [update_datasource_instance_configuration](#update_datasource_instance_configuration) - Update datasource instance configuration -* [get_datasource_credential_status](#get_datasource_credential_status) - Get datasource instance credential status -* [rotate_datasource_credentials](#rotate_datasource_credentials) - Rotate datasource instance credentials +* [retrieve_configuration](#retrieve_configuration) - Get datasource instance configuration +* [update_configuration](#update_configuration) - Update datasource instance configuration +* [retrieve_credential_status](#retrieve_credential_status) - Get datasource instance credential status +* [rotate_credentials](#rotate_credentials) - Rotate datasource instance credentials -## get_datasource_instance_configuration +## retrieve_configuration Gets the greenlisted configuration values for a datasource instance. Returns only configuration keys that are exposed via the public API greenlist. @@ -28,7 +26,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.datasources.get_datasource_instance_configuration(datasource_id="o365sharepoint", instance_id="o365sharepoint_abc123") + res = glean.client.datasources.retrieve_configuration(datasource_id="o365sharepoint", instance_id="o365sharepoint_abc123") # Handle response print(res) @@ -54,7 +52,7 @@ with Glean( | errors.ErrorResponse | 400, 403, 404 | application/json | | errors.GleanError | 4XX, 5XX | \*/\* | -## update_datasource_instance_configuration +## update_configuration Updates the greenlisted configuration values for a datasource instance. Only configuration keys that are exposed via the public API greenlist may be set. Returns the full greenlisted configuration after the update is applied. @@ -71,7 +69,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.datasources.update_datasource_instance_configuration(datasource_id="o365sharepoint", instance_id="o365sharepoint_abc123", configuration={ + res = glean.client.datasources.update_configuration(datasource_id="o365sharepoint", instance_id="o365sharepoint_abc123", configuration={ "values": { }, @@ -102,7 +100,7 @@ with Glean( | errors.ErrorResponse | 400, 403, 404 | application/json | | errors.GleanError | 4XX, 5XX | \*/\* | -## get_datasource_credential_status +## retrieve_credential_status Returns the current credential status for a datasource instance. Access is limited to callers with the ADMIN scope; the handler enforces this check. @@ -119,7 +117,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.datasources.get_datasource_credential_status(datasource_instance_id="o365sharepoint_abc123") + res = glean.client.datasources.retrieve_credential_status(datasource_instance_id="o365sharepoint_abc123") # Handle response print(res) @@ -144,7 +142,7 @@ with Glean( | errors.ErrorResponse | 400, 403, 404 | application/json | | errors.GleanError | 4XX, 5XX | \*/\* | -## rotate_datasource_credentials +## rotate_credentials Rotates the credentials that a datasource instance uses to connect to its upstream system. Replaces the active credential material with the supplied values and returns the credential status after rotation. Access is limited to callers with the ADMIN scope; the handler enforces this check. Only keys recognized as credential material for the datasource type may be set in `credentials.values` (e.g. `clientSecret`, `apiToken`, `privateKey`, depending on the configured auth method). Unrecognized keys, or keys that correspond to non-credential configuration, cause a 400; other instance configuration must be updated via PATCH /configure/datasources/{datasourceId}/instances/{instanceId}. @@ -162,7 +160,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.datasources.rotate_datasource_credentials(datasource_instance_id="o365sharepoint_abc123", credentials={ + res = glean.client.datasources.rotate_credentials(datasource_instance_id="o365sharepoint_abc123", credentials={ "values": { "key": {}, }, diff --git a/docs/sdks/clientsearch/README.md b/docs/sdks/clientsearch/README.md new file mode 100644 index 00000000..7e640dd6 --- /dev/null +++ b/docs/sdks/clientsearch/README.md @@ -0,0 +1,633 @@ +# Client.Search + +## Overview + +### Available Operations + +* [query_as_admin](#query_as_admin) - Search the index (admin) +* [autocomplete](#autocomplete) - Autocomplete +* [retrieve_feed](#retrieve_feed) - Feed of documents and events +* [recommendations](#recommendations) - Recommend documents +* [query](#query) - Search + +## query_as_admin + +Retrieves results for search query without respect for permissions. This is available only to privileged users. + +### Example Usage + + +```python +from glean.api_client import Glean, models +from glean.api_client.utils import parse_datetime +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.search.query_as_admin(query="vacation policy", tracking_token="trackingToken", source_document=models.Document( + container_document=models.Document( + metadata=models.DocumentMetadata( + datasource="datasource", + object_type="Feature Request", + container="container", + parent_id="JIRA_EN-1337", + mime_type="mimeType", + document_id="documentId", + create_time=parse_datetime("2000-01-23T04:56:07.000Z"), + update_time=parse_datetime("2000-01-23T04:56:07.000Z"), + author=models.Person( + name="name", + obfuscated_id="", + ), + components=[ + "Backend", + "Networking", + ], + status="[\"Done\"]", + custom_data={ + "someCustomField": models.CustomDataValue(), + }, + ), + ), + parent_document=models.Document( + metadata=models.DocumentMetadata( + datasource="datasource", + object_type="Feature Request", + container="container", + parent_id="JIRA_EN-1337", + mime_type="mimeType", + document_id="documentId", + create_time=parse_datetime("2000-01-23T04:56:07.000Z"), + update_time=parse_datetime("2000-01-23T04:56:07.000Z"), + author=models.Person( + name="name", + obfuscated_id="", + ), + components=[ + "Backend", + "Networking", + ], + status="[\"Done\"]", + custom_data={ + "someCustomField": models.CustomDataValue(), + }, + ), + ), + metadata=models.DocumentMetadata( + datasource="datasource", + object_type="Feature Request", + container="container", + parent_id="JIRA_EN-1337", + mime_type="mimeType", + document_id="documentId", + create_time=parse_datetime("2000-01-23T04:56:07.000Z"), + update_time=parse_datetime("2000-01-23T04:56:07.000Z"), + author=models.Person( + name="name", + obfuscated_id="", + ), + components=[ + "Backend", + "Networking", + ], + status="[\"Done\"]", + custom_data={ + "someCustomField": models.CustomDataValue(), + }, + ), + ), page_size=10, max_snippet_size=400, input_details={ + "has_copy_paste": True, + }, request_options=models.SearchRequestOptions( + facet_filters=[ + models.FacetFilter( + field_name="type", + values=[ + models.FacetFilterValue( + value="article", + relation_type=models.RelationType.EQUALS, + ), + models.FacetFilterValue( + value="document", + relation_type=models.RelationType.EQUALS, + ), + ], + ), + models.FacetFilter( + field_name="department", + values=[ + models.FacetFilterValue( + value="engineering", + relation_type=models.RelationType.EQUALS, + ), + ], + ), + ], + facet_bucket_size=723824, + ), timeout_millis=5000) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `query` | *str* | :heavy_check_mark: | The search terms. | vacation policy | +| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | | +| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The ISO 8601 timestamp associated with the client request. | | +| `tracking_token` | *Optional[str]* | :heavy_minus_sign: | A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. | | +| `session_info` | [Optional[models.SessionInfo]](../../models/sessioninfo.md) | :heavy_minus_sign: | N/A | | +| `source_document` | [Optional[models.Document]](../../models/document.md) | :heavy_minus_sign: | N/A | | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. | 100 | +| `max_snippet_size` | *Optional[int]* | :heavy_minus_sign: | Hint to the server about how many characters long a snippet may be. Server may return less or more. | 400 | +| `cursor` | *Optional[str]* | :heavy_minus_sign: | Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. | | +| `result_tab_ids` | List[*str*] | :heavy_minus_sign: | The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. | | +| `input_details` | [Optional[models.SearchRequestInputDetails]](../../models/searchrequestinputdetails.md) | :heavy_minus_sign: | N/A | {
"hasCopyPaste": true
} | +| `request_options` | [Optional[models.SearchRequestOptions]](../../models/searchrequestoptions.md) | :heavy_minus_sign: | N/A | {
"datasourceFilter": "JIRA",
"datasourcesFilter": [
"JIRA"
],
"queryOverridesFacetFilters": true,
"facetFilters": [
{
"fieldName": "fieldName",
"values": [
"fieldValues",
"fieldValues"
]
},
{
"fieldName": "fieldName",
"values": [
"fieldValues",
"fieldValues"
]
}
]
} | +| `timeout_millis` | *Optional[int]* | :heavy_minus_sign: | Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. | 5000 | +| `disable_spellcheck` | *Optional[bool]* | :heavy_minus_sign: | Whether or not to disable spellcheck. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.SearchResponse](../../models/searchresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| errors.GleanDataError | 403, 422 | application/json | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## autocomplete + +Retrieve query suggestions, operators and documents for the given partially typed query. + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.search.autocomplete(tracking_token="trackingToken", query="what is a que", datasource="GDRIVE", result_size=10, auth_tokens=[ + { + "access_token": "123abc", + "datasource": "gmail", + "scope": "email profile https://www.googleapis.com/auth/gmail.readonly", + "token_type": "Bearer", + "auth_user": "1", + }, + ]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | | +| `tracking_token` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `session_info` | [Optional[models.SessionInfo]](../../models/sessioninfo.md) | :heavy_minus_sign: | N/A | | +| `query` | *Optional[str]* | :heavy_minus_sign: | Partially typed query. | San Fra | +| `datasources_filter` | List[*str*] | :heavy_minus_sign: | Filter results to only those relevant to one or more datasources (e.g. jira, gdrive). Results are unfiltered if missing. | | +| `datasource` | *Optional[str]* | :heavy_minus_sign: | Filter to only return results relevant to the given datasource. | | +| `result_types` | List[[models.AutocompleteRequestResultType](../../models/autocompleterequestresulttype.md)] | :heavy_minus_sign: | Filter to only return results of the given type(s). All types may be returned if omitted. | | +| `result_size` | *Optional[int]* | :heavy_minus_sign: | Maximum number of results to be returned. If no value is provided, the backend will cap at 200.
| 10 | +| `auth_tokens` | List[[models.AuthToken](../../models/authtoken.md)] | :heavy_minus_sign: | Auth tokens which may be used for federated results. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.AutocompleteResponse](../../models/autocompleteresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------- | ----------------- | ----------------- | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## retrieve_feed + +The personalized feed/home includes different types of contents including suggestions, recents, calendar events and many more. + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.search.retrieve_feed(timeout_millis=5000) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | | +| `categories` | List[[models.FeedRequestCategory](../../models/feedrequestcategory.md)] | :heavy_minus_sign: | Categories of content requested. An allowlist gives flexibility to request content separately or together. | | +| `request_options` | [Optional[models.FeedRequestOptions]](../../models/feedrequestoptions.md) | :heavy_minus_sign: | N/A | | +| `timeout_millis` | *Optional[int]* | :heavy_minus_sign: | Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. | 5000 | +| `session_info` | [Optional[models.SessionInfo]](../../models/sessioninfo.md) | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.FeedResponse](../../models/feedresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------- | ----------------- | ----------------- | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## recommendations + +Retrieve recommended documents for the given URL or Glean Document ID. + +### Example Usage + + +```python +from glean.api_client import Glean, models +from glean.api_client.utils import parse_datetime +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.search.recommendations(source_document=models.Document( + container_document=models.Document( + metadata=models.DocumentMetadata( + datasource="datasource", + object_type="Feature Request", + container="container", + parent_id="JIRA_EN-1337", + mime_type="mimeType", + document_id="documentId", + create_time=parse_datetime("2000-01-23T04:56:07.000Z"), + update_time=parse_datetime("2000-01-23T04:56:07.000Z"), + author=models.Person( + name="name", + obfuscated_id="", + ), + components=[ + "Backend", + "Networking", + ], + status="[\"Done\"]", + custom_data={ + "someCustomField": models.CustomDataValue(), + }, + ), + ), + parent_document=models.Document( + metadata=models.DocumentMetadata( + datasource="datasource", + object_type="Feature Request", + container="container", + parent_id="JIRA_EN-1337", + mime_type="mimeType", + document_id="documentId", + create_time=parse_datetime("2000-01-23T04:56:07.000Z"), + update_time=parse_datetime("2000-01-23T04:56:07.000Z"), + author=models.Person( + name="name", + obfuscated_id="", + ), + components=[ + "Backend", + "Networking", + ], + status="[\"Done\"]", + custom_data={ + "someCustomField": models.CustomDataValue(), + }, + ), + ), + metadata=models.DocumentMetadata( + datasource="datasource", + object_type="Feature Request", + container="container", + parent_id="JIRA_EN-1337", + mime_type="mimeType", + document_id="documentId", + create_time=parse_datetime("2000-01-23T04:56:07.000Z"), + update_time=parse_datetime("2000-01-23T04:56:07.000Z"), + author=models.Person( + name="name", + obfuscated_id="", + ), + components=[ + "Backend", + "Networking", + ], + status="[\"Done\"]", + custom_data={ + "someCustomField": models.CustomDataValue(), + }, + ), + ), page_size=100, max_snippet_size=400, request_options=models.RecommendationsRequestOptions( + facet_filter_sets=[ + models.FacetFilterSet( + filters=[ + models.FacetFilter( + field_name="type", + values=[ + models.FacetFilterValue( + value="Spreadsheet", + relation_type=models.RelationType.EQUALS, + ), + models.FacetFilterValue( + value="Presentation", + relation_type=models.RelationType.EQUALS, + ), + ], + ), + ], + ), + ], + context=models.Document( + container_document=models.Document( + metadata=models.DocumentMetadata( + datasource="datasource", + object_type="Feature Request", + container="container", + parent_id="JIRA_EN-1337", + mime_type="mimeType", + document_id="documentId", + create_time=parse_datetime("2000-01-23T04:56:07.000Z"), + update_time=parse_datetime("2000-01-23T04:56:07.000Z"), + author=models.Person( + name="name", + obfuscated_id="", + ), + components=[ + "Backend", + "Networking", + ], + status="[\"Done\"]", + custom_data={ + "someCustomField": models.CustomDataValue(), + }, + ), + ), + parent_document=models.Document( + metadata=models.DocumentMetadata( + datasource="datasource", + object_type="Feature Request", + container="container", + parent_id="JIRA_EN-1337", + mime_type="mimeType", + document_id="documentId", + create_time=parse_datetime("2000-01-23T04:56:07.000Z"), + update_time=parse_datetime("2000-01-23T04:56:07.000Z"), + author=models.Person( + name="name", + obfuscated_id="", + ), + components=[ + "Backend", + "Networking", + ], + status="[\"Done\"]", + custom_data={ + "someCustomField": models.CustomDataValue(), + }, + ), + ), + metadata=models.DocumentMetadata( + datasource="datasource", + object_type="Feature Request", + container="container", + parent_id="JIRA_EN-1337", + mime_type="mimeType", + document_id="documentId", + create_time=parse_datetime("2000-01-23T04:56:07.000Z"), + update_time=parse_datetime("2000-01-23T04:56:07.000Z"), + author=models.Person( + name="name", + obfuscated_id="", + ), + components=[ + "Backend", + "Networking", + ], + status="[\"Done\"]", + custom_data={ + "someCustomField": models.CustomDataValue(), + }, + ), + ), + )) + + assert res is not None + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | | +| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The ISO 8601 timestamp associated with the client request. | | +| `tracking_token` | *Optional[str]* | :heavy_minus_sign: | A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. | | +| `session_info` | [Optional[models.SessionInfo]](../../models/sessioninfo.md) | :heavy_minus_sign: | N/A | | +| `source_document` | [Optional[models.Document]](../../models/document.md) | :heavy_minus_sign: | N/A | | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. | 100 | +| `max_snippet_size` | *Optional[int]* | :heavy_minus_sign: | Hint to the server about how many characters long a snippet may be. Server may return less or more. | 400 | +| `recommendation_document_spec` | [Optional[models.DocumentSpecUnion]](../../models/documentspecunion.md) | :heavy_minus_sign: | N/A | | +| `request_options` | [Optional[models.RecommendationsRequestOptions]](../../models/recommendationsrequestoptions.md) | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.ResultsResponse](../../models/resultsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------- | ----------------- | ----------------- | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## query + +Retrieve results from the index for the given query and filters. + +### Example Usage + + +```python +from glean.api_client import Glean, models +from glean.api_client.utils import parse_datetime +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.search.query(query="vacation policy", tracking_token="trackingToken", source_document=models.Document( + container_document=models.Document( + metadata=models.DocumentMetadata( + datasource="datasource", + object_type="Feature Request", + container="container", + parent_id="JIRA_EN-1337", + mime_type="mimeType", + document_id="documentId", + create_time=parse_datetime("2000-01-23T04:56:07.000Z"), + update_time=parse_datetime("2000-01-23T04:56:07.000Z"), + author=models.Person( + name="name", + obfuscated_id="", + ), + components=[ + "Backend", + "Networking", + ], + status="[\"Done\"]", + custom_data={ + "someCustomField": models.CustomDataValue(), + }, + ), + ), + parent_document=models.Document( + metadata=models.DocumentMetadata( + datasource="datasource", + object_type="Feature Request", + container="container", + parent_id="JIRA_EN-1337", + mime_type="mimeType", + document_id="documentId", + create_time=parse_datetime("2000-01-23T04:56:07.000Z"), + update_time=parse_datetime("2000-01-23T04:56:07.000Z"), + author=models.Person( + name="name", + obfuscated_id="", + ), + components=[ + "Backend", + "Networking", + ], + status="[\"Done\"]", + custom_data={ + "someCustomField": models.CustomDataValue(), + }, + ), + ), + metadata=models.DocumentMetadata( + datasource="datasource", + object_type="Feature Request", + container="container", + parent_id="JIRA_EN-1337", + mime_type="mimeType", + document_id="documentId", + create_time=parse_datetime("2000-01-23T04:56:07.000Z"), + update_time=parse_datetime("2000-01-23T04:56:07.000Z"), + author=models.Person( + name="name", + obfuscated_id="", + ), + components=[ + "Backend", + "Networking", + ], + status="[\"Done\"]", + custom_data={ + "someCustomField": models.CustomDataValue(), + }, + ), + ), page_size=10, max_snippet_size=400, input_details={ + "has_copy_paste": True, + }, request_options=models.SearchRequestOptions( + facet_filters=[ + models.FacetFilter( + field_name="type", + values=[ + models.FacetFilterValue( + value="article", + relation_type=models.RelationType.EQUALS, + ), + models.FacetFilterValue( + value="document", + relation_type=models.RelationType.EQUALS, + ), + ], + ), + models.FacetFilter( + field_name="department", + values=[ + models.FacetFilterValue( + value="engineering", + relation_type=models.RelationType.EQUALS, + ), + ], + ), + ], + facet_bucket_size=939520, + ), timeout_millis=5000) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `query` | *str* | :heavy_check_mark: | The search terms. | vacation policy | +| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | | +| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The ISO 8601 timestamp associated with the client request. | | +| `tracking_token` | *Optional[str]* | :heavy_minus_sign: | A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. | | +| `session_info` | [Optional[models.SessionInfo]](../../models/sessioninfo.md) | :heavy_minus_sign: | N/A | | +| `source_document` | [Optional[models.Document]](../../models/document.md) | :heavy_minus_sign: | N/A | | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. | 100 | +| `max_snippet_size` | *Optional[int]* | :heavy_minus_sign: | Hint to the server about how many characters long a snippet may be. Server may return less or more. | 400 | +| `cursor` | *Optional[str]* | :heavy_minus_sign: | Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. | | +| `result_tab_ids` | List[*str*] | :heavy_minus_sign: | The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. | | +| `input_details` | [Optional[models.SearchRequestInputDetails]](../../models/searchrequestinputdetails.md) | :heavy_minus_sign: | N/A | {
"hasCopyPaste": true
} | +| `request_options` | [Optional[models.SearchRequestOptions]](../../models/searchrequestoptions.md) | :heavy_minus_sign: | N/A | {
"datasourceFilter": "JIRA",
"datasourcesFilter": [
"JIRA"
],
"queryOverridesFacetFilters": true,
"facetFilters": [
{
"fieldName": "fieldName",
"values": [
"fieldValues",
"fieldValues"
]
},
{
"fieldName": "fieldName",
"values": [
"fieldValues",
"fieldValues"
]
}
]
} | +| `timeout_millis` | *Optional[int]* | :heavy_minus_sign: | Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. | 5000 | +| `disable_spellcheck` | *Optional[bool]* | :heavy_minus_sign: | Whether or not to disable spellcheck. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.SearchResponse](../../models/searchresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| errors.GleanDataError | 403, 422 | application/json | +| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/clienttools/README.md b/docs/sdks/clienttools/README.md deleted file mode 100644 index 5dd8efc1..00000000 --- a/docs/sdks/clienttools/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# Client.Tools - -## Overview - -### Available Operations - -* [list](#list) - List available tools -* [run](#run) - Execute the specified tool - -## list - -Returns a filtered set of available tools based on optional tool name parameters. If no filters are provided, all available tools are returned. - -### Example Usage - - -```python -from glean.api_client import Glean -import os - - -with Glean( - api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as glean: - - res = glean.client.tools.list() - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `tool_names` | List[*str*] | :heavy_minus_sign: | Optional array of tool names to filter by | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.ToolsListResponse](../../models/toolslistresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------- | ----------------- | ----------------- | -| errors.GleanError | 4XX, 5XX | \*/\* | - -## run - -Execute the specified tool with provided parameters - -### Example Usage - - -```python -from glean.api_client import Glean -import os - - -with Glean( - api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as glean: - - res = glean.client.tools.run(name="", parameters={ - - }) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | Required name of the tool to execute | -| `parameters` | Dict[str, [models.ToolsCallParameter](../../models/toolscallparameter.md)] | :heavy_check_mark: | The parameters for the tool. Each key is the name of the parameter and the value is the parameter object. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.ToolsCallResponse](../../models/toolscallresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------- | ----------------- | ----------------- | -| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/entities/README.md b/docs/sdks/entities/README.md index dce02213..50f8adc4 100644 --- a/docs/sdks/entities/README.md +++ b/docs/sdks/entities/README.md @@ -1,12 +1,127 @@ -# Entities +# Client.Entities ## Overview ### Available Operations -* [get_person_photo](#get_person_photo) - Get person photo +* [list](#list) - List entities +* [read_people](#read_people) - Read people +* [retrieve_person_photo](#retrieve_person_photo) - Get person photo -## get_person_photo +## list + +List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint, except when using FULL_DIRECTORY request type for people entities. + +### Example Usage + + +```python +from glean.api_client import Glean, models +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.entities.list(filter_=[ + { + "field_name": "type", + "values": [ + { + "value": "Spreadsheet", + "relation_type": models.RelationType.EQUALS, + }, + { + "value": "Presentation", + "relation_type": models.RelationType.EQUALS, + }, + ], + }, + ], entity_type=models.ListEntitiesRequestEntityType.PEOPLE, page_size=100, request_type=models.RequestType.STANDARD) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | | +| `filter_` | List[[models.FacetFilter](../../models/facetfilter.md)] | :heavy_minus_sign: | N/A | | +| `sort` | List[[models.SortOptions](../../models/sortoptions.md)] | :heavy_minus_sign: | Use EntitiesSortOrder enum for SortOptions.sortBy | | +| `entity_type` | [Optional[models.ListEntitiesRequestEntityType]](../../models/listentitiesrequestentitytype.md) | :heavy_minus_sign: | N/A | | +| `datasource` | *Optional[str]* | :heavy_minus_sign: | The datasource associated with the entity type, most commonly used with CUSTOM_ENTITIES | | +| `query` | *Optional[str]* | :heavy_minus_sign: | A query string to search for entities that each entity in the response must conform to. An empty query does not filter any entities. | | +| `include_fields` | List[[models.ListEntitiesRequestIncludeField](../../models/listentitiesrequestincludefield.md)] | :heavy_minus_sign: | List of entity fields to return (that aren't returned by default) | | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Hint to the server about how many results to send back. Server may return less. | 100 | +| `cursor` | *Optional[str]* | :heavy_minus_sign: | Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. | | +| `source` | *Optional[str]* | :heavy_minus_sign: | A string denoting the search surface from which the endpoint is called. | | +| `request_type` | [Optional[models.RequestType]](../../models/requesttype.md) | :heavy_minus_sign: | The type of request being made. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.ListEntitiesResponse](../../models/listentitiesresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------- | ----------------- | ----------------- | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## read_people + +Read people details for the given IDs. + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.entities.read_people(obfuscated_ids=[ + "abc123", + "abc456", + ]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | +| `timezone_offset` | *Optional[int]* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. | +| `obfuscated_ids` | List[*str*] | :heavy_minus_sign: | The Person IDs to retrieve. If no IDs are requested, the current user's details are returned. | +| `email_ids` | List[*str*] | :heavy_minus_sign: | The email IDs to retrieve. The result is the deduplicated union of emailIds and obfuscatedIds. | +| `include_fields` | List[[models.PeopleRequestIncludeField](../../models/peoplerequestincludefield.md)] | :heavy_minus_sign: | List of PersonMetadata fields to return (that aren't returned by default) | +| `include_types` | List[[models.IncludeType](../../models/includetype.md)] | :heavy_minus_sign: | The types of people entities to include in the response in addition to those returned by default. | +| `source` | *Optional[str]* | :heavy_minus_sign: | A string denoting the search surface from which the endpoint is called. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.PeopleResponse](../../models/peopleresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------- | ----------------- | ----------------- | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## retrieve_person_photo Returns the profile photo bytes for a person whose photo is stored in Glean (crawled from an identity source or user-uploaded via admin console). Photos hosted externally (e.g. Slack CDN) are not served by this endpoint; callers should follow the photoUrl from /people or /listentities directly. Responses include a Cache-Control header (max-age=3600) to reduce redundant fetches. @@ -23,7 +138,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.entities.get_person_photo(person_id="") + res = glean.client.entities.retrieve_person_photo(person_id="") # Handle response print(res) diff --git a/docs/sdks/governance/README.md b/docs/sdks/findings/README.md similarity index 93% rename from docs/sdks/governance/README.md rename to docs/sdks/findings/README.md index 8708b51c..df7c4ee4 100644 --- a/docs/sdks/governance/README.md +++ b/docs/sdks/findings/README.md @@ -1,15 +1,15 @@ -# Governance +# Client.Governance.Data.Findings ## Overview ### Available Operations -* [createfindingsexport](#createfindingsexport) - Creates findings export -* [listfindingsexports](#listfindingsexports) - Lists findings exports -* [downloadfindingsexport](#downloadfindingsexport) - Downloads findings export -* [deletefindingsexport](#deletefindingsexport) - Deletes findings export +* [create](#create) - Creates findings export +* [list](#list) - Lists findings exports +* [download](#download) - Downloads findings export +* [delete](#delete) - Deletes findings export -## createfindingsexport +## create Creates a new DLP findings export job. @@ -25,7 +25,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.governance.createfindingsexport() + res = glean.client.governance.data.findings.create() # Handle response print(res) @@ -54,7 +54,7 @@ with Glean( | ----------------- | ----------------- | ----------------- | | errors.GleanError | 4XX, 5XX | \*/\* | -## listfindingsexports +## list Lists all DLP findings exports. @@ -70,7 +70,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.governance.listfindingsexports() + res = glean.client.governance.data.findings.list() # Handle response print(res) @@ -93,7 +93,7 @@ with Glean( | ----------------- | ----------------- | ----------------- | | errors.GleanError | 4XX, 5XX | \*/\* | -## downloadfindingsexport +## download Downloads a DLP findings export as a CSV file. @@ -109,7 +109,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.governance.downloadfindingsexport(id="") + res = glean.client.governance.data.findings.download(id="") # Handle response print(res) @@ -133,7 +133,7 @@ with Glean( | ----------------- | ----------------- | ----------------- | | errors.GleanError | 4XX, 5XX | \*/\* | -## deletefindingsexport +## delete Deletes a DLP findings export. @@ -149,7 +149,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - glean.governance.deletefindingsexport(id=741945) + glean.client.governance.data.findings.delete(id=741945) # Use the SDK ... diff --git a/docs/sdks/indexingdocuments/README.md b/docs/sdks/indexingdocuments/README.md index 184a3903..87baf153 100644 --- a/docs/sdks/indexingdocuments/README.md +++ b/docs/sdks/indexingdocuments/README.md @@ -16,6 +16,8 @@ * [check_access](#check_access) - Check document access * [~~status~~](#status) - Get document upload and indexing status :warning: **Deprecated** * [~~count~~](#count) - Get document count :warning: **Deprecated** +* [debug_events](#debug_events) - Beta: Get document lifecycle events + ## add_or_update @@ -440,6 +442,51 @@ with Glean( ### Errors +| Error Type | Status Code | Content Type | +| ----------------- | ----------------- | ----------------- | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## debug_events + +Retrieves lifecycle events for a specific document including upload time, index times and deletions. Rate limited to 1 request per minute per datasource. Currently in beta, might undergo breaking changes without prior notice. + + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.indexing.documents.debug_events(datasource="", object_type="Article", doc_id="art123", start_date="2025-05-01", max_events=50) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `datasource` | *str* | :heavy_check_mark: | The datasource to which the document belongs | | +| `object_type` | *str* | :heavy_check_mark: | Object type of the document to get lifecycle events for. | Article | +| `doc_id` | *str* | :heavy_check_mark: | Glean Document ID within the datasource to get lifecycle events for. | art123 | +| `start_date` | *Optional[str]* | :heavy_minus_sign: | The start date for events to be fetched. Cannot be more than 30 days (default 7 days) in the past. | 2025-05-01 | +| `max_events` | *Optional[int]* | :heavy_minus_sign: | Max number of events to be fetched. Cannot be more than 100 (default 20). | 50 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.DebugDocumentLifecycleResponse](../../models/debugdocumentlifecycleresponse.md)** + +### Errors + | Error Type | Status Code | Content Type | | ----------------- | ----------------- | ----------------- | | errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index 7e640dd6..0596beea 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -1,176 +1,19 @@ -# Client.Search +# Search ## Overview ### Available Operations -* [query_as_admin](#query_as_admin) - Search the index (admin) -* [autocomplete](#autocomplete) - Autocomplete -* [retrieve_feed](#retrieve_feed) - Feed of documents and events -* [recommendations](#recommendations) - Recommend documents * [query](#query) - Search -## query_as_admin - -Retrieves results for search query without respect for permissions. This is available only to privileged users. - -### Example Usage - - -```python -from glean.api_client import Glean, models -from glean.api_client.utils import parse_datetime -import os - - -with Glean( - api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as glean: - - res = glean.client.search.query_as_admin(query="vacation policy", tracking_token="trackingToken", source_document=models.Document( - container_document=models.Document( - metadata=models.DocumentMetadata( - datasource="datasource", - object_type="Feature Request", - container="container", - parent_id="JIRA_EN-1337", - mime_type="mimeType", - document_id="documentId", - create_time=parse_datetime("2000-01-23T04:56:07.000Z"), - update_time=parse_datetime("2000-01-23T04:56:07.000Z"), - author=models.Person( - name="name", - obfuscated_id="", - ), - components=[ - "Backend", - "Networking", - ], - status="[\"Done\"]", - custom_data={ - "someCustomField": models.CustomDataValue(), - }, - ), - ), - parent_document=models.Document( - metadata=models.DocumentMetadata( - datasource="datasource", - object_type="Feature Request", - container="container", - parent_id="JIRA_EN-1337", - mime_type="mimeType", - document_id="documentId", - create_time=parse_datetime("2000-01-23T04:56:07.000Z"), - update_time=parse_datetime("2000-01-23T04:56:07.000Z"), - author=models.Person( - name="name", - obfuscated_id="", - ), - components=[ - "Backend", - "Networking", - ], - status="[\"Done\"]", - custom_data={ - "someCustomField": models.CustomDataValue(), - }, - ), - ), - metadata=models.DocumentMetadata( - datasource="datasource", - object_type="Feature Request", - container="container", - parent_id="JIRA_EN-1337", - mime_type="mimeType", - document_id="documentId", - create_time=parse_datetime("2000-01-23T04:56:07.000Z"), - update_time=parse_datetime("2000-01-23T04:56:07.000Z"), - author=models.Person( - name="name", - obfuscated_id="", - ), - components=[ - "Backend", - "Networking", - ], - status="[\"Done\"]", - custom_data={ - "someCustomField": models.CustomDataValue(), - }, - ), - ), page_size=10, max_snippet_size=400, input_details={ - "has_copy_paste": True, - }, request_options=models.SearchRequestOptions( - facet_filters=[ - models.FacetFilter( - field_name="type", - values=[ - models.FacetFilterValue( - value="article", - relation_type=models.RelationType.EQUALS, - ), - models.FacetFilterValue( - value="document", - relation_type=models.RelationType.EQUALS, - ), - ], - ), - models.FacetFilter( - field_name="department", - values=[ - models.FacetFilterValue( - value="engineering", - relation_type=models.RelationType.EQUALS, - ), - ], - ), - ], - facet_bucket_size=723824, - ), timeout_millis=5000) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `query` | *str* | :heavy_check_mark: | The search terms. | vacation policy | -| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | | -| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The ISO 8601 timestamp associated with the client request. | | -| `tracking_token` | *Optional[str]* | :heavy_minus_sign: | A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. | | -| `session_info` | [Optional[models.SessionInfo]](../../models/sessioninfo.md) | :heavy_minus_sign: | N/A | | -| `source_document` | [Optional[models.Document]](../../models/document.md) | :heavy_minus_sign: | N/A | | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. | 100 | -| `max_snippet_size` | *Optional[int]* | :heavy_minus_sign: | Hint to the server about how many characters long a snippet may be. Server may return less or more. | 400 | -| `cursor` | *Optional[str]* | :heavy_minus_sign: | Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. | | -| `result_tab_ids` | List[*str*] | :heavy_minus_sign: | The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. | | -| `input_details` | [Optional[models.SearchRequestInputDetails]](../../models/searchrequestinputdetails.md) | :heavy_minus_sign: | N/A | {
"hasCopyPaste": true
} | -| `request_options` | [Optional[models.SearchRequestOptions]](../../models/searchrequestoptions.md) | :heavy_minus_sign: | N/A | {
"datasourceFilter": "JIRA",
"datasourcesFilter": [
"JIRA"
],
"queryOverridesFacetFilters": true,
"facetFilters": [
{
"fieldName": "fieldName",
"values": [
"fieldValues",
"fieldValues"
]
},
{
"fieldName": "fieldName",
"values": [
"fieldValues",
"fieldValues"
]
}
]
} | -| `timeout_millis` | *Optional[int]* | :heavy_minus_sign: | Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. | 5000 | -| `disable_spellcheck` | *Optional[bool]* | :heavy_minus_sign: | Whether or not to disable spellcheck. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[models.SearchResponse](../../models/searchresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------- | --------------------- | --------------------- | -| errors.GleanDataError | 403, 422 | application/json | -| errors.GleanError | 4XX, 5XX | \*/\* | +## query -## autocomplete +Execute a search query and retrieve ranked results. This is the data retrieval variant of the search API and returns only results and pagination state. -Retrieve query suggestions, operators and documents for the given partially typed query. ### Example Usage - + ```python from glean.api_client import Glean import os @@ -180,13 +23,19 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.client.search.autocomplete(tracking_token="trackingToken", query="what is a que", datasource="GDRIVE", result_size=10, auth_tokens=[ + res = glean.search.query(query="quarterly planning 2026", page_size=10, datasources=[ + "confluence", + "google_drive", + ], datasource_instances=[ + "slack_acme", + "slack_eu", + ], filters=[ { - "access_token": "123abc", - "datasource": "gmail", - "scope": "email profile https://www.googleapis.com/auth/gmail.readonly", - "token_type": "Bearer", - "auth_user": "1", + "field": "type", + "values": [ + "spreadsheet", + "presentation", + ], }, ]) @@ -197,437 +46,25 @@ with Glean( ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | | -| `tracking_token` | *Optional[str]* | :heavy_minus_sign: | N/A | | -| `session_info` | [Optional[models.SessionInfo]](../../models/sessioninfo.md) | :heavy_minus_sign: | N/A | | -| `query` | *Optional[str]* | :heavy_minus_sign: | Partially typed query. | San Fra | -| `datasources_filter` | List[*str*] | :heavy_minus_sign: | Filter results to only those relevant to one or more datasources (e.g. jira, gdrive). Results are unfiltered if missing. | | -| `datasource` | *Optional[str]* | :heavy_minus_sign: | Filter to only return results relevant to the given datasource. | | -| `result_types` | List[[models.AutocompleteRequestResultType](../../models/autocompleterequestresulttype.md)] | :heavy_minus_sign: | Filter to only return results of the given type(s). All types may be returned if omitted. | | -| `result_size` | *Optional[int]* | :heavy_minus_sign: | Maximum number of results to be returned. If no value is provided, the backend will cap at 200.
| 10 | -| `auth_tokens` | List[[models.AuthToken](../../models/authtoken.md)] | :heavy_minus_sign: | Auth tokens which may be used for federated results. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[models.AutocompleteResponse](../../models/autocompleteresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------- | ----------------- | ----------------- | -| errors.GleanError | 4XX, 5XX | \*/\* | - -## retrieve_feed - -The personalized feed/home includes different types of contents including suggestions, recents, calendar events and many more. - -### Example Usage - - -```python -from glean.api_client import Glean -import os - - -with Glean( - api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as glean: - - res = glean.client.search.retrieve_feed(timeout_millis=5000) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | | -| `categories` | List[[models.FeedRequestCategory](../../models/feedrequestcategory.md)] | :heavy_minus_sign: | Categories of content requested. An allowlist gives flexibility to request content separately or together. | | -| `request_options` | [Optional[models.FeedRequestOptions]](../../models/feedrequestoptions.md) | :heavy_minus_sign: | N/A | | -| `timeout_millis` | *Optional[int]* | :heavy_minus_sign: | Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. | 5000 | -| `session_info` | [Optional[models.SessionInfo]](../../models/sessioninfo.md) | :heavy_minus_sign: | N/A | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[models.FeedResponse](../../models/feedresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------- | ----------------- | ----------------- | -| errors.GleanError | 4XX, 5XX | \*/\* | - -## recommendations - -Retrieve recommended documents for the given URL or Glean Document ID. - -### Example Usage - - -```python -from glean.api_client import Glean, models -from glean.api_client.utils import parse_datetime -import os - - -with Glean( - api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as glean: - - res = glean.client.search.recommendations(source_document=models.Document( - container_document=models.Document( - metadata=models.DocumentMetadata( - datasource="datasource", - object_type="Feature Request", - container="container", - parent_id="JIRA_EN-1337", - mime_type="mimeType", - document_id="documentId", - create_time=parse_datetime("2000-01-23T04:56:07.000Z"), - update_time=parse_datetime("2000-01-23T04:56:07.000Z"), - author=models.Person( - name="name", - obfuscated_id="", - ), - components=[ - "Backend", - "Networking", - ], - status="[\"Done\"]", - custom_data={ - "someCustomField": models.CustomDataValue(), - }, - ), - ), - parent_document=models.Document( - metadata=models.DocumentMetadata( - datasource="datasource", - object_type="Feature Request", - container="container", - parent_id="JIRA_EN-1337", - mime_type="mimeType", - document_id="documentId", - create_time=parse_datetime("2000-01-23T04:56:07.000Z"), - update_time=parse_datetime("2000-01-23T04:56:07.000Z"), - author=models.Person( - name="name", - obfuscated_id="", - ), - components=[ - "Backend", - "Networking", - ], - status="[\"Done\"]", - custom_data={ - "someCustomField": models.CustomDataValue(), - }, - ), - ), - metadata=models.DocumentMetadata( - datasource="datasource", - object_type="Feature Request", - container="container", - parent_id="JIRA_EN-1337", - mime_type="mimeType", - document_id="documentId", - create_time=parse_datetime("2000-01-23T04:56:07.000Z"), - update_time=parse_datetime("2000-01-23T04:56:07.000Z"), - author=models.Person( - name="name", - obfuscated_id="", - ), - components=[ - "Backend", - "Networking", - ], - status="[\"Done\"]", - custom_data={ - "someCustomField": models.CustomDataValue(), - }, - ), - ), page_size=100, max_snippet_size=400, request_options=models.RecommendationsRequestOptions( - facet_filter_sets=[ - models.FacetFilterSet( - filters=[ - models.FacetFilter( - field_name="type", - values=[ - models.FacetFilterValue( - value="Spreadsheet", - relation_type=models.RelationType.EQUALS, - ), - models.FacetFilterValue( - value="Presentation", - relation_type=models.RelationType.EQUALS, - ), - ], - ), - ], - ), - ], - context=models.Document( - container_document=models.Document( - metadata=models.DocumentMetadata( - datasource="datasource", - object_type="Feature Request", - container="container", - parent_id="JIRA_EN-1337", - mime_type="mimeType", - document_id="documentId", - create_time=parse_datetime("2000-01-23T04:56:07.000Z"), - update_time=parse_datetime("2000-01-23T04:56:07.000Z"), - author=models.Person( - name="name", - obfuscated_id="", - ), - components=[ - "Backend", - "Networking", - ], - status="[\"Done\"]", - custom_data={ - "someCustomField": models.CustomDataValue(), - }, - ), - ), - parent_document=models.Document( - metadata=models.DocumentMetadata( - datasource="datasource", - object_type="Feature Request", - container="container", - parent_id="JIRA_EN-1337", - mime_type="mimeType", - document_id="documentId", - create_time=parse_datetime("2000-01-23T04:56:07.000Z"), - update_time=parse_datetime("2000-01-23T04:56:07.000Z"), - author=models.Person( - name="name", - obfuscated_id="", - ), - components=[ - "Backend", - "Networking", - ], - status="[\"Done\"]", - custom_data={ - "someCustomField": models.CustomDataValue(), - }, - ), - ), - metadata=models.DocumentMetadata( - datasource="datasource", - object_type="Feature Request", - container="container", - parent_id="JIRA_EN-1337", - mime_type="mimeType", - document_id="documentId", - create_time=parse_datetime("2000-01-23T04:56:07.000Z"), - update_time=parse_datetime("2000-01-23T04:56:07.000Z"), - author=models.Person( - name="name", - obfuscated_id="", - ), - components=[ - "Backend", - "Networking", - ], - status="[\"Done\"]", - custom_data={ - "someCustomField": models.CustomDataValue(), - }, - ), - ), - )) - - assert res is not None - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | | -| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The ISO 8601 timestamp associated with the client request. | | -| `tracking_token` | *Optional[str]* | :heavy_minus_sign: | A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. | | -| `session_info` | [Optional[models.SessionInfo]](../../models/sessioninfo.md) | :heavy_minus_sign: | N/A | | -| `source_document` | [Optional[models.Document]](../../models/document.md) | :heavy_minus_sign: | N/A | | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. | 100 | -| `max_snippet_size` | *Optional[int]* | :heavy_minus_sign: | Hint to the server about how many characters long a snippet may be. Server may return less or more. | 400 | -| `recommendation_document_spec` | [Optional[models.DocumentSpecUnion]](../../models/documentspecunion.md) | :heavy_minus_sign: | N/A | | -| `request_options` | [Optional[models.RecommendationsRequestOptions]](../../models/recommendationsrequestoptions.md) | :heavy_minus_sign: | N/A | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[models.ResultsResponse](../../models/resultsresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------- | ----------------- | ----------------- | -| errors.GleanError | 4XX, 5XX | \*/\* | - -## query - -Retrieve results from the index for the given query and filters. - -### Example Usage - - -```python -from glean.api_client import Glean, models -from glean.api_client.utils import parse_datetime -import os - - -with Glean( - api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as glean: - - res = glean.client.search.query(query="vacation policy", tracking_token="trackingToken", source_document=models.Document( - container_document=models.Document( - metadata=models.DocumentMetadata( - datasource="datasource", - object_type="Feature Request", - container="container", - parent_id="JIRA_EN-1337", - mime_type="mimeType", - document_id="documentId", - create_time=parse_datetime("2000-01-23T04:56:07.000Z"), - update_time=parse_datetime("2000-01-23T04:56:07.000Z"), - author=models.Person( - name="name", - obfuscated_id="", - ), - components=[ - "Backend", - "Networking", - ], - status="[\"Done\"]", - custom_data={ - "someCustomField": models.CustomDataValue(), - }, - ), - ), - parent_document=models.Document( - metadata=models.DocumentMetadata( - datasource="datasource", - object_type="Feature Request", - container="container", - parent_id="JIRA_EN-1337", - mime_type="mimeType", - document_id="documentId", - create_time=parse_datetime("2000-01-23T04:56:07.000Z"), - update_time=parse_datetime("2000-01-23T04:56:07.000Z"), - author=models.Person( - name="name", - obfuscated_id="", - ), - components=[ - "Backend", - "Networking", - ], - status="[\"Done\"]", - custom_data={ - "someCustomField": models.CustomDataValue(), - }, - ), - ), - metadata=models.DocumentMetadata( - datasource="datasource", - object_type="Feature Request", - container="container", - parent_id="JIRA_EN-1337", - mime_type="mimeType", - document_id="documentId", - create_time=parse_datetime("2000-01-23T04:56:07.000Z"), - update_time=parse_datetime("2000-01-23T04:56:07.000Z"), - author=models.Person( - name="name", - obfuscated_id="", - ), - components=[ - "Backend", - "Networking", - ], - status="[\"Done\"]", - custom_data={ - "someCustomField": models.CustomDataValue(), - }, - ), - ), page_size=10, max_snippet_size=400, input_details={ - "has_copy_paste": True, - }, request_options=models.SearchRequestOptions( - facet_filters=[ - models.FacetFilter( - field_name="type", - values=[ - models.FacetFilterValue( - value="article", - relation_type=models.RelationType.EQUALS, - ), - models.FacetFilterValue( - value="document", - relation_type=models.RelationType.EQUALS, - ), - ], - ), - models.FacetFilter( - field_name="department", - values=[ - models.FacetFilterValue( - value="engineering", - relation_type=models.RelationType.EQUALS, - ), - ], - ), - ], - facet_bucket_size=939520, - ), timeout_millis=5000) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `query` | *str* | :heavy_check_mark: | The search terms. | vacation policy | -| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. | | -| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The ISO 8601 timestamp associated with the client request. | | -| `tracking_token` | *Optional[str]* | :heavy_minus_sign: | A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. | | -| `session_info` | [Optional[models.SessionInfo]](../../models/sessioninfo.md) | :heavy_minus_sign: | N/A | | -| `source_document` | [Optional[models.Document]](../../models/document.md) | :heavy_minus_sign: | N/A | | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. | 100 | -| `max_snippet_size` | *Optional[int]* | :heavy_minus_sign: | Hint to the server about how many characters long a snippet may be. Server may return less or more. | 400 | -| `cursor` | *Optional[str]* | :heavy_minus_sign: | Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. | | -| `result_tab_ids` | List[*str*] | :heavy_minus_sign: | The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. | | -| `input_details` | [Optional[models.SearchRequestInputDetails]](../../models/searchrequestinputdetails.md) | :heavy_minus_sign: | N/A | {
"hasCopyPaste": true
} | -| `request_options` | [Optional[models.SearchRequestOptions]](../../models/searchrequestoptions.md) | :heavy_minus_sign: | N/A | {
"datasourceFilter": "JIRA",
"datasourcesFilter": [
"JIRA"
],
"queryOverridesFacetFilters": true,
"facetFilters": [
{
"fieldName": "fieldName",
"values": [
"fieldValues",
"fieldValues"
]
},
{
"fieldName": "fieldName",
"values": [
"fieldValues",
"fieldValues"
]
}
]
} | -| `timeout_millis` | *Optional[int]* | :heavy_minus_sign: | Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. | 5000 | -| `disable_spellcheck` | *Optional[bool]* | :heavy_minus_sign: | Whether or not to disable spellcheck. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `query` | *str* | :heavy_check_mark: | The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`.
| quarterly planning 2026 | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of results to return per page. | | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request.
| | +| `datasources` | List[*str*] | :heavy_minus_sign: | Restrict results to specific datasources. Requests must not specify both `datasources` and `datasource_instances`.
| [
"confluence",
"google_drive"
] | +| `datasource_instances` | List[*str*] | :heavy_minus_sign: | Restrict results to specific datasource instances. Values are datasource instance identifiers returned by `GET /api/search/filters`. Requests must not specify both `datasources` and `datasource_instances`.
| [
"slack_acme",
"slack_eu"
] | +| `filters` | List[[models.PlatformFilter](../../models/platformfilter.md)] | :heavy_minus_sign: | Structured filters applied to search results. Equality operators OR multiple values within a filter. Multiple filters are AND'd together, including range filters on the same field. Filters are AND'd with any inline operators in `query`. Note that conflicting constraints on the same field (e.g., `type:document` in the query and `type: spreadsheet` in a filter) produce an empty result set.
| | +| `time_range` | [Optional[models.PlatformTimeRange]](../../models/platformtimerange.md) | :heavy_minus_sign: | Filter results to those last updated within this range. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response -**[models.SearchResponse](../../models/searchresponse.md)** +**[models.PlatformSearchResponse](../../models/platformsearchresponse.md)** ### Errors -| Error Type | Status Code | Content Type | -| --------------------- | --------------------- | --------------------- | -| errors.GleanDataError | 403, 422 | application/json | -| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/tools/README.md b/docs/sdks/tools/README.md index efef9a0f..9d515f24 100644 --- a/docs/sdks/tools/README.md +++ b/docs/sdks/tools/README.md @@ -1,13 +1,98 @@ -# Tools +# Client.Tools ## Overview ### Available Operations -* [get_action_pack_auth_status](#get_action_pack_auth_status) - Get end-user authentication status for an action pack. +* [list](#list) - List available tools +* [run](#run) - Execute the specified tool +* [retrieve_action_pack_auth_status](#retrieve_action_pack_auth_status) - Get end-user authentication status for an action pack. * [authorize_action_pack](#authorize_action_pack) - Start the OAuth authorization flow for an action pack. -## get_action_pack_auth_status +## list + +Returns a filtered set of available tools based on optional tool name parameters. If no filters are provided, all available tools are returned. + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.tools.list() + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `tool_names` | List[*str*] | :heavy_minus_sign: | Optional array of tool names to filter by | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ToolsListResponse](../../models/toolslistresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------- | ----------------- | ----------------- | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## run + +Execute the specified tool with provided parameters + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.tools.run(name="", parameters={ + + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Required name of the tool to execute | +| `parameters` | Dict[str, [models.ToolsCallParameter](../../models/toolscallparameter.md)] | :heavy_check_mark: | The parameters for the tool. Each key is the name of the parameter and the value is the parameter object. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ToolsCallResponse](../../models/toolscallresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------- | ----------------- | ----------------- | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## retrieve_action_pack_auth_status Reports whether the calling user is already authenticated against the third-party tool backing the specified action pack. Intended for headless / server-driven clients @@ -26,7 +111,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.tools.get_action_pack_auth_status(action_pack_id="") + res = glean.client.tools.retrieve_action_pack_auth_status(action_pack_id="") # Handle response print(res) @@ -73,7 +158,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.tools.authorize_action_pack(action_pack_id="", return_url="https://merry-allocation.org/") + res = glean.client.tools.authorize_action_pack(action_pack_id="", return_url="https://merry-allocation.org/") # Handle response print(res) diff --git a/docs/sdks/troubleshooting/README.md b/docs/sdks/troubleshooting/README.md deleted file mode 100644 index 528524fc..00000000 --- a/docs/sdks/troubleshooting/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# Troubleshooting - -## Overview - -### Available Operations - -* [post_api_index_v1_debug_datasource_document_events](#post_api_index_v1_debug_datasource_document_events) - Beta: Get document lifecycle events - - -## post_api_index_v1_debug_datasource_document_events - -Retrieves lifecycle events for a specific document including upload time, index times and deletions. Rate limited to 1 request per minute per datasource. Currently in beta, might undergo breaking changes without prior notice. - - -### Example Usage - - -```python -from glean.api_client import Glean -import os - - -with Glean( - api_token=os.getenv("GLEAN_API_TOKEN", ""), -) as glean: - - res = glean.troubleshooting.post_api_index_v1_debug_datasource_document_events(datasource="", object_type="Article", doc_id="art123", start_date="2025-05-01", max_events=50) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `datasource` | *str* | :heavy_check_mark: | The datasource to which the document belongs | | -| `object_type` | *str* | :heavy_check_mark: | Object type of the document to get lifecycle events for. | Article | -| `doc_id` | *str* | :heavy_check_mark: | Glean Document ID within the datasource to get lifecycle events for. | art123 | -| `start_date` | *Optional[str]* | :heavy_minus_sign: | The start date for events to be fetched. Cannot be more than 30 days (default 7 days) in the past. | 2025-05-01 | -| `max_events` | *Optional[int]* | :heavy_minus_sign: | Max number of events to be fetched. Cannot be more than 100 (default 20). | 50 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[models.DebugDocumentLifecycleResponse](../../models/debugdocumentlifecycleresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------- | ----------------- | ----------------- | -| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index 3bc0aa0d..c851f21c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -573,21 +573,21 @@ nodejs = ["nodejs-wheel-binaries"] [[package]] name = "pytest" -version = "8.4.2" +version = "9.1.1" description = "pytest: simple powerful testing with Python" optional = false -python-versions = ">=3.9" +python-versions = ">=3.10" groups = ["dev"] files = [ - {file = "pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79"}, - {file = "pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01"}, + {file = "pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c"}, + {file = "pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313"}, ] [package.dependencies] colorama = {version = ">=0.4", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1", markers = "python_version < \"3.11\""} -iniconfig = ">=1" -packaging = ">=20" +iniconfig = ">=1.0.1" +packaging = ">=22" pluggy = ">=1.5,<2" pygments = ">=2.7.2" tomli = {version = ">=1", markers = "python_version < \"3.11\""} @@ -734,4 +734,4 @@ typing-extensions = ">=4.12.0" [metadata] lock-version = "2.1" python-versions = ">=3.10" -content-hash = "7957d409be705d06bf23e0bf7eec3bc69e2c6721fee7fd3e64286968df49a12a" +content-hash = "95606e43a093e9473529c06d35ada64b8804a9615f05f59a5b32c0e186ea237d" diff --git a/pyproject.toml b/pyproject.toml index be2c723b..a11f0b60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "glean-api-client" -version = "0.14.0" +version = "0.15.0" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Glean Technologies, Inc." },] readme = "README-PYPI.md" @@ -29,7 +29,7 @@ in-project = true mypy = "==1.15.0" pylint = "==3.2.3" pyright = "==1.1.398" -pytest = "^8.4.1" +pytest = "^9.0.3" pytest-asyncio = ">=1.3.0" pytest-xdist = "^3.8.0" diff --git a/src/glean/api_client/_version.py b/src/glean/api_client/_version.py index 4ef4e9f5..4a974591 100644 --- a/src/glean/api_client/_version.py +++ b/src/glean/api_client/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "glean-api-client" -__version__: str = "0.14.0" +__version__: str = "0.15.0" __openapi_doc_version__: str = "0.9.0" -__gen_version__: str = "2.913.3" -__user_agent__: str = "speakeasy-sdk/python 0.14.0 2.913.3 0.9.0 glean-api-client" +__gen_version__: str = "2.915.0" +__user_agent__: str = "speakeasy-sdk/python 0.15.0 2.915.0 0.9.0 glean-api-client" try: if __package__ is not None: diff --git a/src/glean/api_client/agents.py b/src/glean/api_client/agents.py index cfd615e4..ea960e0a 100644 --- a/src/glean/api_client/agents.py +++ b/src/glean/api_client/agents.py @@ -1,37 +1,36 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK +from enum import Enum from glean.api_client import errors, models, utils from glean.api_client._hooks import HookContext from glean.api_client.types import OptionalNullable, UNSET from glean.api_client.utils import get_security_from_env from glean.api_client.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Mapping, Optional +from typing import Any, Dict, Iterable, List, Mapping, Optional, Union + + +class CreateRunAcceptEnum(str, Enum): + APPLICATION_JSON = "application/json" + TEXT_EVENT_STREAM = "text/event-stream" class Agents(BaseSDK): - def create_agent( + def search( self, *, - locale: Optional[str] = None, - timezone_offset: Optional[int] = None, name: Optional[str] = None, - transient: Optional[bool] = None, - parent_workflow_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.WorkflowResult: - r"""Create an agent + ) -> models.PlatformAgentsSearchResponse: + r"""Search agents + + Search agents available to the authenticated user by agent name. - Create an agent. - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param timezone_offset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. - :param name: The name of the workflow. - :param transient: Used to create a transient workflow. - :param parent_workflow_id: id of the parent workflow for transient workflows + :param name: Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -47,19 +46,13 @@ def create_agent( else: base_url = self._get_url(base_url, url_variables) - request = models.CreateAgentRequest( - locale=locale, - timezone_offset=timezone_offset, - create_workflow_request=models.CreateWorkflowRequest( - name=name, - transient=transient, - parent_workflow_id=parent_workflow_id, - ), + request = models.PlatformAgentsSearchRequest( + name=name, ) req = self._build_request( method="POST", - path="/rest/api/v1/agents", + path="/api/agents/search", base_url=base_url, url_variables=url_variables, request=request, @@ -71,11 +64,7 @@ def create_agent( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.create_workflow_request, - False, - False, - "json", - models.CreateWorkflowRequest, + request, False, False, "json", models.PlatformAgentsSearchRequest ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -93,52 +82,69 @@ def create_agent( hook_ctx=HookContext( config=self.sdk_configuration, base_url=base_url or "", - operation_id="createAgent", + operation_id="platform-agents-search", oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), tags=["Agents"], - extensions={"x-visibility": "Preview"}, + extensions={ + "x-codegen-request-body-name": "payload", + "x-glean-experimental": { + "id": "4abc1e17-8e06-490b-99a7-e8f97592405a", + "introduced": "2026-05-12", + }, + "x-visibility": "Public", + }, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.WorkflowResult, http_res) - if utils.match_response(http_res, ["400", "401", "403", "4XX"], "*"): + return unmarshal_json_response( + models.PlatformAgentsSearchResponse, http_res + ) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, ["500", "5XX"], "*"): + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.GleanError("API error occurred", http_res, http_res_text) raise errors.GleanError("Unexpected response received", http_res) - async def create_agent_async( + async def search_async( self, *, - locale: Optional[str] = None, - timezone_offset: Optional[int] = None, name: Optional[str] = None, - transient: Optional[bool] = None, - parent_workflow_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.WorkflowResult: - r"""Create an agent + ) -> models.PlatformAgentsSearchResponse: + r"""Search agents + + Search agents available to the authenticated user by agent name. - Create an agent. - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param timezone_offset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. - :param name: The name of the workflow. - :param transient: Used to create a transient workflow. - :param parent_workflow_id: id of the parent workflow for transient workflows + :param name: Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -154,19 +160,13 @@ async def create_agent_async( else: base_url = self._get_url(base_url, url_variables) - request = models.CreateAgentRequest( - locale=locale, - timezone_offset=timezone_offset, - create_workflow_request=models.CreateWorkflowRequest( - name=name, - transient=transient, - parent_workflow_id=parent_workflow_id, - ), + request = models.PlatformAgentsSearchRequest( + name=name, ) req = self._build_request_async( method="POST", - path="/rest/api/v1/agents", + path="/api/agents/search", base_url=base_url, url_variables=url_variables, request=request, @@ -178,11 +178,7 @@ async def create_agent_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.create_workflow_request, - False, - False, - "json", - models.CreateWorkflowRequest, + request, False, False, "json", models.PlatformAgentsSearchRequest ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -200,52 +196,287 @@ async def create_agent_async( hook_ctx=HookContext( config=self.sdk_configuration, base_url=base_url or "", - operation_id="createAgent", + operation_id="platform-agents-search", oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), tags=["Agents"], - extensions={"x-visibility": "Preview"}, + extensions={ + "x-codegen-request-body-name": "payload", + "x-glean-experimental": { + "id": "4abc1e17-8e06-490b-99a7-e8f97592405a", + "introduced": "2026-05-12", + }, + "x-visibility": "Public", + }, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.WorkflowResult, http_res) - if utils.match_response(http_res, ["400", "401", "403", "4XX"], "*"): + return unmarshal_json_response( + models.PlatformAgentsSearchResponse, http_res + ) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, ["500", "5XX"], "*"): + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.GleanError("API error occurred", http_res, http_res_text) raise errors.GleanError("Unexpected response received", http_res) - def edit_agent( + def get( self, *, agent_id: str, - locale: Optional[str] = None, - timezone_offset: Optional[int] = None, - name: Optional[str] = None, - id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ): - r"""Edit an agent + ) -> models.PlatformAgentGetResponse: + r"""Get agent + + Retrieve details for an agent available to the authenticated user. + + + :param agent_id: ID of the agent to retrieve. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PlatformAgentsGetRequest( + agent_id=agent_id, + ) + + req = self._build_request( + method="GET", + path="/api/agents/{agent_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="platform-agents-get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={ + "x-glean-experimental": { + "id": "009b3e94-694b-4deb-b80a-c67011173715", + "introduced": "2026-05-12", + }, + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.PlatformAgentGetResponse, http_res) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def get_async( + self, + *, + agent_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformAgentGetResponse: + r"""Get agent + + Retrieve details for an agent available to the authenticated user. + + + :param agent_id: ID of the agent to retrieve. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PlatformAgentsGetRequest( + agent_id=agent_id, + ) + + req = self._build_request_async( + method="GET", + path="/api/agents/{agent_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="platform-agents-get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={ + "x-glean-experimental": { + "id": "009b3e94-694b-4deb-b80a-c67011173715", + "introduced": "2026-05-12", + }, + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.PlatformAgentGetResponse, http_res) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def get_schemas( + self, + *, + agent_id: str, + include_tools: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformAgentSchemasResponse: + r"""Get agent schemas + + Retrieve an agent's input and output JSON schemas. - Creates a draft or publishes an [agent](https://developers.glean.com/agents/agents-api). Use `isDraft=true` to save a draft, or `isDraft=false` (or omit) to publish immediately. Only draft and publish modes are supported. - :param agent_id: The ID of the agent. - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param timezone_offset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. - :param name: The name of the workflow. - :param id: The workflow ID we want to update. + :param agent_id: ID of the agent whose schemas should be retrieved. + :param include_tools: Whether to include tool metadata in the response. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -261,19 +492,261 @@ def edit_agent( else: base_url = self._get_url(base_url, url_variables) - request = models.EditAgentRequest( - locale=locale, - timezone_offset=timezone_offset, + request = models.PlatformAgentsGetSchemasRequest( agent_id=agent_id, - edit_workflow_request=models.EditWorkflowRequest( - name=name, - id=id, + include_tools=include_tools, + ) + + req = self._build_request( + method="GET", + path="/api/agents/{agent_id}/schemas", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="platform-agents-get-schemas", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={ + "x-glean-experimental": { + "id": "b40b4dd3-3839-48e6-9e45-7e63e8148b49", + "introduced": "2026-05-12", + }, + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.PlatformAgentSchemasResponse, http_res + ) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def get_schemas_async( + self, + *, + agent_id: str, + include_tools: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformAgentSchemasResponse: + r"""Get agent schemas + + Retrieve an agent's input and output JSON schemas. + + + :param agent_id: ID of the agent whose schemas should be retrieved. + :param include_tools: Whether to include tool metadata in the response. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PlatformAgentsGetSchemasRequest( + agent_id=agent_id, + include_tools=include_tools, + ) + + req = self._build_request_async( + method="GET", + path="/api/agents/{agent_id}/schemas", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="platform-agents-get-schemas", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={ + "x-glean-experimental": { + "id": "b40b4dd3-3839-48e6-9e45-7e63e8148b49", + "introduced": "2026-05-12", + }, + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.PlatformAgentSchemasResponse, http_res + ) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def create_run( + self, + *, + agent_id: str, + input: Optional[Mapping[str, Any]] = None, + messages: Optional[ + Union[ + Iterable[models.PlatformMessage], + Iterable[models.PlatformMessageTypedDict], + ] + ] = None, + metadata: Optional[Mapping[str, Any]] = None, + stream: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + accept_header_override: Optional[CreateRunAcceptEnum] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformAgentsCreateRunResponse: + r"""Create agent run + + Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. + + + :param agent_id: ID of the agent to run. + :param input: Input fields for an input-form triggered agent. + :param messages: Messages to pass to the agent. When provided, the array MUST contain at least one message and each message MUST specify a valid `role` and non-empty `content`. + + :param metadata: Metadata to pass to the agent. + :param stream: Whether to stream the run response as server-sent events. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PlatformAgentsCreateRunRequest( + agent_id=agent_id, + platform_agent_run_create_request=models.PlatformAgentRunCreateRequest( + input=utils.unmarshal(input, Optional[Dict[str, Any]]), + messages=utils.get_pydantic_model( + messages, Optional[List[models.PlatformMessage]] + ), + metadata=utils.unmarshal(metadata, Optional[Dict[str, Any]]), + stream=stream, ), ) req = self._build_request( method="POST", - path="/rest/api/v1/agents/{agent_id}", + path="/api/agents/{agent_id}/runs", base_url=base_url, url_variables=url_variables, request=request, @@ -281,15 +754,17 @@ def edit_agent( request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", - accept_header_value="application/json", + accept_header_value=accept_header_override.value + if accept_header_override is not None + else "application/json;q=1, text/event-stream;q=0", http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.edit_workflow_request, + request.platform_agent_run_create_request, False, False, "json", - models.EditWorkflowRequest, + models.PlatformAgentRunCreateRequest, ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -307,13 +782,20 @@ def edit_agent( hook_ctx=HookContext( config=self.sdk_configuration, base_url=base_url or "", - operation_id="editAgent", + operation_id="platform-agents-create-run", oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), tags=["Agents"], - extensions={"x-visibility": "Preview"}, + extensions={ + "x-codegen-request-body-name": "payload", + "x-glean-experimental": { + "id": "26bba669-2e92-4e5d-9798-6a532fae4e9f", + "introduced": "2026-05-12", + }, + "x-visibility": "Public", + }, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -321,45 +803,69 @@ def edit_agent( ) response_data: Any = None - if utils.match_response(http_res, "200", "*"): - return - if utils.match_response(http_res, "404", "application/json"): - response_data = unmarshal_json_response(errors.ErrorResponseData, http_res) - raise errors.ErrorResponse(response_data, http_res) - if utils.match_response(http_res, ["400", "401", "403", "4XX"], "*"): + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.PlatformAgentRunWaitResponse, http_res + ) + if utils.match_response(http_res, "200", "text/event-stream"): + return http_res.text + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "409", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, ["500", "5XX"], "*"): + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.GleanError("API error occurred", http_res, http_res_text) raise errors.GleanError("Unexpected response received", http_res) - async def edit_agent_async( + async def create_run_async( self, *, agent_id: str, - locale: Optional[str] = None, - timezone_offset: Optional[int] = None, - name: Optional[str] = None, - id: Optional[str] = None, + input: Optional[Mapping[str, Any]] = None, + messages: Optional[ + Union[ + Iterable[models.PlatformMessage], + Iterable[models.PlatformMessageTypedDict], + ] + ] = None, + metadata: Optional[Mapping[str, Any]] = None, + stream: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, + accept_header_override: Optional[CreateRunAcceptEnum] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ): - r"""Edit an agent + ) -> models.PlatformAgentsCreateRunResponse: + r"""Create agent run - Creates a draft or publishes an [agent](https://developers.glean.com/agents/agents-api). Use `isDraft=true` to save a draft, or `isDraft=false` (or omit) to publish immediately. Only draft and publish modes are supported. + Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. - :param agent_id: The ID of the agent. - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param timezone_offset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. - :param name: The name of the workflow. - :param id: The workflow ID we want to update. + + :param agent_id: ID of the agent to run. + :param input: Input fields for an input-form triggered agent. + :param messages: Messages to pass to the agent. When provided, the array MUST contain at least one message and each message MUST specify a valid `role` and non-empty `content`. + + :param metadata: Metadata to pass to the agent. + :param stream: Whether to stream the run response as server-sent events. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param accept_header_override: Override the default accept header for this method :param http_headers: Additional headers to set or replace on requests. """ base_url = None @@ -372,19 +878,21 @@ async def edit_agent_async( else: base_url = self._get_url(base_url, url_variables) - request = models.EditAgentRequest( - locale=locale, - timezone_offset=timezone_offset, + request = models.PlatformAgentsCreateRunRequest( agent_id=agent_id, - edit_workflow_request=models.EditWorkflowRequest( - name=name, - id=id, + platform_agent_run_create_request=models.PlatformAgentRunCreateRequest( + input=utils.unmarshal(input, Optional[Dict[str, Any]]), + messages=utils.get_pydantic_model( + messages, Optional[List[models.PlatformMessage]] + ), + metadata=utils.unmarshal(metadata, Optional[Dict[str, Any]]), + stream=stream, ), ) req = self._build_request_async( method="POST", - path="/rest/api/v1/agents/{agent_id}", + path="/api/agents/{agent_id}/runs", base_url=base_url, url_variables=url_variables, request=request, @@ -392,15 +900,17 @@ async def edit_agent_async( request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", - accept_header_value="application/json", + accept_header_value=accept_header_override.value + if accept_header_override is not None + else "application/json;q=1, text/event-stream;q=0", http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.edit_workflow_request, + request.platform_agent_run_create_request, False, False, "json", - models.EditWorkflowRequest, + models.PlatformAgentRunCreateRequest, ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -418,13 +928,20 @@ async def edit_agent_async( hook_ctx=HookContext( config=self.sdk_configuration, base_url=base_url or "", - operation_id="editAgent", + operation_id="platform-agents-create-run", oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), tags=["Agents"], - extensions={"x-visibility": "Preview"}, + extensions={ + "x-codegen-request-body-name": "payload", + "x-glean-experimental": { + "id": "26bba669-2e92-4e5d-9798-6a532fae4e9f", + "introduced": "2026-05-12", + }, + "x-visibility": "Public", + }, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -432,15 +949,30 @@ async def edit_agent_async( ) response_data: Any = None - if utils.match_response(http_res, "200", "*"): - return - if utils.match_response(http_res, "404", "application/json"): - response_data = unmarshal_json_response(errors.ErrorResponseData, http_res) - raise errors.ErrorResponse(response_data, http_res) - if utils.match_response(http_res, ["400", "401", "403", "4XX"], "*"): + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.PlatformAgentRunWaitResponse, http_res + ) + if utils.match_response(http_res, "200", "text/event-stream"): + return http_res.text + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "409", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, ["500", "5XX"], "*"): + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.GleanError("API error occurred", http_res, http_res_text) diff --git a/src/glean/api_client/authentication.py b/src/glean/api_client/authentication.py deleted file mode 100644 index 66854e5c..00000000 --- a/src/glean/api_client/authentication.py +++ /dev/null @@ -1,185 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from glean.api_client import errors, models, utils -from glean.api_client._hooks import HookContext -from glean.api_client.types import OptionalNullable, UNSET -from glean.api_client.utils import get_security_from_env -from glean.api_client.utils.unmarshal_json_response import unmarshal_json_response -from typing import Mapping, Optional - - -class Authentication(BaseSDK): - r"""Manage indexing API tokens.""" - - def checkdatasourceauth( - self, - *, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.CheckDatasourceAuthResponse: - r"""Check datasource authorization - - Returns all datasource instances that require per-user OAuth authorization - for the authenticated user, along with a transient auth token that can be - appended to auth URLs to complete OAuth flows. - - Clients construct the full OAuth URL by combining the backend base URL, - the `authUrlRelativePath` from each instance, and the transient auth token: - `/?transient_auth_token=`. - - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - req = self._build_request( - method="POST", - path="/rest/api/v1/checkdatasourceauth", - base_url=base_url, - url_variables=url_variables, - request=None, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="checkdatasourceauth", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Authentication"], - extensions={"x-visibility": "Public"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.CheckDatasourceAuthResponse, http_res) - if utils.match_response(http_res, ["401", "429", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - async def checkdatasourceauth_async( - self, - *, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.CheckDatasourceAuthResponse: - r"""Check datasource authorization - - Returns all datasource instances that require per-user OAuth authorization - for the authenticated user, along with a transient auth token that can be - appended to auth URLs to complete OAuth flows. - - Clients construct the full OAuth URL by combining the backend base URL, - the `authUrlRelativePath` from each instance, and the transient auth token: - `/?transient_auth_token=`. - - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - req = self._build_request_async( - method="POST", - path="/rest/api/v1/checkdatasourceauth", - base_url=base_url, - url_variables=url_variables, - request=None, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="checkdatasourceauth", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Authentication"], - extensions={"x-visibility": "Public"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.CheckDatasourceAuthResponse, http_res) - if utils.match_response(http_res, ["401", "429", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) diff --git a/src/glean/api_client/chat_sdk.py b/src/glean/api_client/chat_sdk.py deleted file mode 100644 index b40d3a25..00000000 --- a/src/glean/api_client/chat_sdk.py +++ /dev/null @@ -1,197 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from glean.api_client import errors, models, utils -from glean.api_client._hooks import HookContext -from glean.api_client.types import OptionalNullable, UNSET -from glean.api_client.utils import get_security_from_env -import httpx -from typing import Mapping, Optional - - -class ChatSDK(BaseSDK): - def get_chat_file( - self, - *, - file_id: str, - preview: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> httpx.Response: - r"""Download a chat file - - Download the raw content of a file generated or uploaded during a chat session (for example, an image produced by the assistant). Returns the file bytes with a Content-Type header matching the file's MIME type. - - - :param file_id: Identifier of the chat file to download. - :param preview: When true and the file is a PDF, the response is served inline (Content-Disposition: inline) instead of as an attachment. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.GetChatFileRequest( - file_id=file_id, - preview=preview, - ) - - req = self._build_request( - method="GET", - path="/rest/api/v1/chat-files/{fileId}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/octet-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getChatFile", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Chat"], - extensions={"x-visibility": "Public"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - stream=True, - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/octet-stream"): - return http_res - if utils.match_response(http_res, ["400", "401", "403", "404", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, ["500", "5XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("Unexpected response received", http_res, http_res_text) - - async def get_chat_file_async( - self, - *, - file_id: str, - preview: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> httpx.Response: - r"""Download a chat file - - Download the raw content of a file generated or uploaded during a chat session (for example, an image produced by the assistant). Returns the file bytes with a Content-Type header matching the file's MIME type. - - - :param file_id: Identifier of the chat file to download. - :param preview: When true and the file is a PDF, the response is served inline (Content-Disposition: inline) instead of as an attachment. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.GetChatFileRequest( - file_id=file_id, - preview=preview, - ) - - req = self._build_request_async( - method="GET", - path="/rest/api/v1/chat-files/{fileId}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/octet-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getChatFile", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Chat"], - extensions={"x-visibility": "Public"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - stream=True, - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/octet-stream"): - return http_res - if utils.match_response(http_res, ["400", "401", "403", "404", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, ["500", "5XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("Unexpected response received", http_res, http_res_text) diff --git a/src/glean/api_client/client.py b/src/glean/api_client/client.py index 122be2b9..e64a90a5 100644 --- a/src/glean/api_client/client.py +++ b/src/glean/api_client/client.py @@ -8,17 +8,18 @@ from glean.api_client.client_agents import ClientAgents from glean.api_client.client_authentication import ClientAuthentication from glean.api_client.client_chat import ClientChat +from glean.api_client.client_datasources import ClientDatasources from glean.api_client.client_documents import ClientDocuments -from glean.api_client.client_entities import ClientEntities -from glean.api_client.client_governance import ClientGovernance +from glean.api_client.client_search import ClientSearch from glean.api_client.client_shortcuts import ClientShortcuts -from glean.api_client.client_tools import ClientTools from glean.api_client.client_verification import ClientVerification from glean.api_client.collections import Collections +from glean.api_client.entities import Entities +from glean.api_client.governance import Governance from glean.api_client.insights import Insights from glean.api_client.messages import Messages from glean.api_client.pins import Pins -from glean.api_client.search import Search +from glean.api_client.tools import Tools from typing import Optional @@ -34,12 +35,13 @@ class Client(BaseSDK): insights: Insights messages: Messages pins: Pins - search: Search - entities: ClientEntities + search: ClientSearch + entities: Entities shortcuts: ClientShortcuts verification: ClientVerification - tools: ClientTools - governance: ClientGovernance + tools: Tools + governance: Governance + datasources: ClientDatasources def __init__( self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None @@ -70,17 +72,16 @@ def _init_sdks(self): self.insights = Insights(self.sdk_configuration, parent_ref=self.parent_ref) self.messages = Messages(self.sdk_configuration, parent_ref=self.parent_ref) self.pins = Pins(self.sdk_configuration, parent_ref=self.parent_ref) - self.search = Search(self.sdk_configuration, parent_ref=self.parent_ref) - self.entities = ClientEntities( - self.sdk_configuration, parent_ref=self.parent_ref - ) + self.search = ClientSearch(self.sdk_configuration, parent_ref=self.parent_ref) + self.entities = Entities(self.sdk_configuration, parent_ref=self.parent_ref) self.shortcuts = ClientShortcuts( self.sdk_configuration, parent_ref=self.parent_ref ) self.verification = ClientVerification( self.sdk_configuration, parent_ref=self.parent_ref ) - self.tools = ClientTools(self.sdk_configuration, parent_ref=self.parent_ref) - self.governance = ClientGovernance( + self.tools = Tools(self.sdk_configuration, parent_ref=self.parent_ref) + self.governance = Governance(self.sdk_configuration, parent_ref=self.parent_ref) + self.datasources = ClientDatasources( self.sdk_configuration, parent_ref=self.parent_ref ) diff --git a/src/glean/api_client/client_agents.py b/src/glean/api_client/client_agents.py index 5f25ddec..0d5dc422 100644 --- a/src/glean/api_client/client_agents.py +++ b/src/glean/api_client/client_agents.py @@ -10,6 +10,220 @@ class ClientAgents(BaseSDK): + def create( + self, + *, + locale: Optional[str] = None, + timezone_offset: Optional[int] = None, + name: Optional[str] = None, + transient: Optional[bool] = None, + parent_workflow_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowResult: + r"""Create an agent + + Create an agent. + + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param timezone_offset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + :param name: The name of the workflow. + :param transient: Used to create a transient workflow. + :param parent_workflow_id: id of the parent workflow for transient workflows + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateAgentRequest( + locale=locale, + timezone_offset=timezone_offset, + create_workflow_request=models.CreateWorkflowRequest( + name=name, + transient=transient, + parent_workflow_id=parent_workflow_id, + ), + ) + + req = self._build_request( + method="POST", + path="/rest/api/v1/agents", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.create_workflow_request, + False, + False, + "json", + models.CreateWorkflowRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createAgent", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={"x-visibility": "Preview"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowResult, http_res) + if utils.match_response(http_res, ["400", "401", "403", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, ["500", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def create_async( + self, + *, + locale: Optional[str] = None, + timezone_offset: Optional[int] = None, + name: Optional[str] = None, + transient: Optional[bool] = None, + parent_workflow_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowResult: + r"""Create an agent + + Create an agent. + + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param timezone_offset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + :param name: The name of the workflow. + :param transient: Used to create a transient workflow. + :param parent_workflow_id: id of the parent workflow for transient workflows + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateAgentRequest( + locale=locale, + timezone_offset=timezone_offset, + create_workflow_request=models.CreateWorkflowRequest( + name=name, + transient=transient, + parent_workflow_id=parent_workflow_id, + ), + ) + + req = self._build_request_async( + method="POST", + path="/rest/api/v1/agents", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.create_workflow_request, + False, + False, + "json", + models.CreateWorkflowRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createAgent", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={"x-visibility": "Preview"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowResult, http_res) + if utils.match_response(http_res, ["400", "401", "403", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, ["500", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + def retrieve( self, *, @@ -202,6 +416,228 @@ async def retrieve_async( raise errors.GleanError("Unexpected response received", http_res) + def update( + self, + *, + agent_id: str, + locale: Optional[str] = None, + timezone_offset: Optional[int] = None, + name: Optional[str] = None, + id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Edit an agent + + Creates a draft or publishes an [agent](https://developers.glean.com/agents/agents-api). Use `isDraft=true` to save a draft, or `isDraft=false` (or omit) to publish immediately. Only draft and publish modes are supported. + + :param agent_id: The ID of the agent. + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param timezone_offset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + :param name: The name of the workflow. + :param id: The workflow ID we want to update. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.EditAgentRequest( + locale=locale, + timezone_offset=timezone_offset, + agent_id=agent_id, + edit_workflow_request=models.EditWorkflowRequest( + name=name, + id=id, + ), + ) + + req = self._build_request( + method="POST", + path="/rest/api/v1/agents/{agent_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.edit_workflow_request, + False, + False, + "json", + models.EditWorkflowRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="editAgent", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={"x-visibility": "Preview"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "*"): + return + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.ErrorResponseData, http_res) + raise errors.ErrorResponse(response_data, http_res) + if utils.match_response(http_res, ["400", "401", "403", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, ["500", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def update_async( + self, + *, + agent_id: str, + locale: Optional[str] = None, + timezone_offset: Optional[int] = None, + name: Optional[str] = None, + id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Edit an agent + + Creates a draft or publishes an [agent](https://developers.glean.com/agents/agents-api). Use `isDraft=true` to save a draft, or `isDraft=false` (or omit) to publish immediately. Only draft and publish modes are supported. + + :param agent_id: The ID of the agent. + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param timezone_offset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + :param name: The name of the workflow. + :param id: The workflow ID we want to update. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.EditAgentRequest( + locale=locale, + timezone_offset=timezone_offset, + agent_id=agent_id, + edit_workflow_request=models.EditWorkflowRequest( + name=name, + id=id, + ), + ) + + req = self._build_request_async( + method="POST", + path="/rest/api/v1/agents/{agent_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.edit_workflow_request, + False, + False, + "json", + models.EditWorkflowRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="editAgent", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={"x-visibility": "Preview"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "*"): + return + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.ErrorResponseData, http_res) + raise errors.ErrorResponse(response_data, http_res) + if utils.match_response(http_res, ["400", "401", "403", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, ["500", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + def retrieve_schemas( self, *, diff --git a/src/glean/api_client/client_authentication.py b/src/glean/api_client/client_authentication.py index 27679b5b..9cd4f878 100644 --- a/src/glean/api_client/client_authentication.py +++ b/src/glean/api_client/client_authentication.py @@ -10,6 +10,178 @@ class ClientAuthentication(BaseSDK): + def check_datasource_auth( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CheckDatasourceAuthResponse: + r"""Check datasource authorization + + Returns all datasource instances that require per-user OAuth authorization + for the authenticated user, along with a transient auth token that can be + appended to auth URLs to complete OAuth flows. + + Clients construct the full OAuth URL by combining the backend base URL, + the `authUrlRelativePath` from each instance, and the transient auth token: + `/?transient_auth_token=`. + + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( + method="POST", + path="/rest/api/v1/checkdatasourceauth", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="checkdatasourceauth", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Authentication"], + extensions={"x-visibility": "Public"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CheckDatasourceAuthResponse, http_res) + if utils.match_response(http_res, ["401", "429", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def check_datasource_auth_async( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CheckDatasourceAuthResponse: + r"""Check datasource authorization + + Returns all datasource instances that require per-user OAuth authorization + for the authenticated user, along with a transient auth token that can be + appended to auth URLs to complete OAuth flows. + + Clients construct the full OAuth URL by combining the backend base URL, + the `authUrlRelativePath` from each instance, and the transient auth token: + `/?transient_auth_token=`. + + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( + method="POST", + path="/rest/api/v1/checkdatasourceauth", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="checkdatasourceauth", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Authentication"], + extensions={"x-visibility": "Public"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CheckDatasourceAuthResponse, http_res) + if utils.match_response(http_res, ["401", "429", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + def create_token( self, *, diff --git a/src/glean/api_client/client_chat.py b/src/glean/api_client/client_chat.py index d504d063..9067145d 100644 --- a/src/glean/api_client/client_chat.py +++ b/src/glean/api_client/client_chat.py @@ -6,6 +6,7 @@ from glean.api_client.types import OptionalNullable, UNSET from glean.api_client.utils import get_security_from_env from glean.api_client.utils.unmarshal_json_response import unmarshal_json_response +import httpx from typing import Iterable, List, Mapping, Optional, Union @@ -1896,6 +1897,192 @@ async def delete_files_async( raise errors.GleanError("Unexpected response received", http_res) + def retrieve_file( + self, + *, + file_id: str, + preview: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> httpx.Response: + r"""Download a chat file + + Download the raw content of a file generated or uploaded during a chat session (for example, an image produced by the assistant). Returns the file bytes with a Content-Type header matching the file's MIME type. + + + :param file_id: Identifier of the chat file to download. + :param preview: When true and the file is a PDF, the response is served inline (Content-Disposition: inline) instead of as an attachment. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetChatFileRequest( + file_id=file_id, + preview=preview, + ) + + req = self._build_request( + method="GET", + path="/rest/api/v1/chat-files/{fileId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/octet-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getChatFile", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Chat"], + extensions={"x-visibility": "Public"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + stream=True, + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/octet-stream"): + return http_res + if utils.match_response(http_res, ["400", "401", "403", "404", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, ["500", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("Unexpected response received", http_res, http_res_text) + + async def retrieve_file_async( + self, + *, + file_id: str, + preview: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> httpx.Response: + r"""Download a chat file + + Download the raw content of a file generated or uploaded during a chat session (for example, an image produced by the assistant). Returns the file bytes with a Content-Type header matching the file's MIME type. + + + :param file_id: Identifier of the chat file to download. + :param preview: When true and the file is a PDF, the response is served inline (Content-Disposition: inline) instead of as an attachment. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetChatFileRequest( + file_id=file_id, + preview=preview, + ) + + req = self._build_request_async( + method="GET", + path="/rest/api/v1/chat-files/{fileId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/octet-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getChatFile", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Chat"], + extensions={"x-visibility": "Public"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + stream=True, + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/octet-stream"): + return http_res + if utils.match_response(http_res, ["400", "401", "403", "404", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, ["500", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("Unexpected response received", http_res, http_res_text) + def create_stream( self, *, diff --git a/src/glean/api_client/datasources.py b/src/glean/api_client/client_datasources.py similarity index 98% rename from src/glean/api_client/datasources.py rename to src/glean/api_client/client_datasources.py index eb6593e3..0cfdfc1b 100644 --- a/src/glean/api_client/datasources.py +++ b/src/glean/api_client/client_datasources.py @@ -9,10 +9,8 @@ from typing import Any, Mapping, Optional, Union -class Datasources(BaseSDK): - r"""Manage datasources.""" - - def get_datasource_instance_configuration( +class ClientDatasources(BaseSDK): + def retrieve_configuration( self, *, datasource_id: str, @@ -108,7 +106,7 @@ def get_datasource_instance_configuration( raise errors.GleanError("Unexpected response received", http_res) - async def get_datasource_instance_configuration_async( + async def retrieve_configuration_async( self, *, datasource_id: str, @@ -204,7 +202,7 @@ async def get_datasource_instance_configuration_async( raise errors.GleanError("Unexpected response received", http_res) - def update_datasource_instance_configuration( + def update_configuration( self, *, datasource_id: str, @@ -317,7 +315,7 @@ def update_datasource_instance_configuration( raise errors.GleanError("Unexpected response received", http_res) - async def update_datasource_instance_configuration_async( + async def update_configuration_async( self, *, datasource_id: str, @@ -430,7 +428,7 @@ async def update_datasource_instance_configuration_async( raise errors.GleanError("Unexpected response received", http_res) - def get_datasource_credential_status( + def retrieve_credential_status( self, *, datasource_instance_id: str, @@ -523,7 +521,7 @@ def get_datasource_credential_status( raise errors.GleanError("Unexpected response received", http_res) - async def get_datasource_credential_status_async( + async def retrieve_credential_status_async( self, *, datasource_instance_id: str, @@ -616,7 +614,7 @@ async def get_datasource_credential_status_async( raise errors.GleanError("Unexpected response received", http_res) - def rotate_datasource_credentials( + def rotate_credentials( self, *, datasource_instance_id: str, @@ -727,7 +725,7 @@ def rotate_datasource_credentials( raise errors.GleanError("Unexpected response received", http_res) - async def rotate_datasource_credentials_async( + async def rotate_credentials_async( self, *, datasource_instance_id: str, diff --git a/src/glean/api_client/client_entities.py b/src/glean/api_client/client_entities.py deleted file mode 100644 index 819e58a2..00000000 --- a/src/glean/api_client/client_entities.py +++ /dev/null @@ -1,525 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from glean.api_client import errors, models, utils -from glean.api_client._hooks import HookContext -from glean.api_client.types import OptionalNullable, UNSET -from glean.api_client.utils import get_security_from_env -from glean.api_client.utils.unmarshal_json_response import unmarshal_json_response -from typing import Iterable, List, Mapping, Optional, Union - - -class ClientEntities(BaseSDK): - def list( - self, - *, - locale: Optional[str] = None, - filter_: Optional[ - Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] - ] = None, - sort: Optional[ - Union[Iterable[models.SortOptions], Iterable[models.SortOptionsTypedDict]] - ] = None, - entity_type: Optional[ - models.ListEntitiesRequestEntityType - ] = models.ListEntitiesRequestEntityType.PEOPLE, - datasource: Optional[str] = None, - query: Optional[str] = None, - include_fields: Optional[ - Iterable[models.ListEntitiesRequestIncludeField] - ] = None, - page_size: Optional[int] = None, - cursor: Optional[str] = None, - source: Optional[str] = None, - request_type: Optional[models.RequestType] = models.RequestType.STANDARD, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ListEntitiesResponse: - r"""List entities - - List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint, except when using FULL_DIRECTORY request type for people entities. - - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param filter_: - :param sort: Use EntitiesSortOrder enum for SortOptions.sortBy - :param entity_type: - :param datasource: The datasource associated with the entity type, most commonly used with CUSTOM_ENTITIES - :param query: A query string to search for entities that each entity in the response must conform to. An empty query does not filter any entities. - :param include_fields: List of entity fields to return (that aren't returned by default) - :param page_size: Hint to the server about how many results to send back. Server may return less. - :param cursor: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. - :param source: A string denoting the search surface from which the endpoint is called. - :param request_type: The type of request being made. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ListentitiesRequestRequest( - locale=locale, - list_entities_request=models.ListEntitiesRequest( - filter_=utils.get_pydantic_model( - filter_, Optional[List[models.FacetFilter]] - ), - sort=utils.get_pydantic_model(sort, Optional[List[models.SortOptions]]), - entity_type=entity_type, - datasource=datasource, - query=query, - include_fields=utils.unmarshal( - include_fields, - Optional[List[models.ListEntitiesRequestIncludeField]], - ), - page_size=page_size, - cursor=cursor, - source=source, - request_type=request_type, - ), - ) - - req = self._build_request( - method="POST", - path="/rest/api/v1/listentities", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.list_entities_request, - False, - False, - "json", - models.ListEntitiesRequest, - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="listentities", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Entities"], - extensions={ - "x-codegen-request-body-name": "payload", - "x-visibility": "Public", - }, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ListEntitiesResponse, http_res) - if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - async def list_async( - self, - *, - locale: Optional[str] = None, - filter_: Optional[ - Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] - ] = None, - sort: Optional[ - Union[Iterable[models.SortOptions], Iterable[models.SortOptionsTypedDict]] - ] = None, - entity_type: Optional[ - models.ListEntitiesRequestEntityType - ] = models.ListEntitiesRequestEntityType.PEOPLE, - datasource: Optional[str] = None, - query: Optional[str] = None, - include_fields: Optional[ - Iterable[models.ListEntitiesRequestIncludeField] - ] = None, - page_size: Optional[int] = None, - cursor: Optional[str] = None, - source: Optional[str] = None, - request_type: Optional[models.RequestType] = models.RequestType.STANDARD, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ListEntitiesResponse: - r"""List entities - - List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint, except when using FULL_DIRECTORY request type for people entities. - - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param filter_: - :param sort: Use EntitiesSortOrder enum for SortOptions.sortBy - :param entity_type: - :param datasource: The datasource associated with the entity type, most commonly used with CUSTOM_ENTITIES - :param query: A query string to search for entities that each entity in the response must conform to. An empty query does not filter any entities. - :param include_fields: List of entity fields to return (that aren't returned by default) - :param page_size: Hint to the server about how many results to send back. Server may return less. - :param cursor: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. - :param source: A string denoting the search surface from which the endpoint is called. - :param request_type: The type of request being made. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ListentitiesRequestRequest( - locale=locale, - list_entities_request=models.ListEntitiesRequest( - filter_=utils.get_pydantic_model( - filter_, Optional[List[models.FacetFilter]] - ), - sort=utils.get_pydantic_model(sort, Optional[List[models.SortOptions]]), - entity_type=entity_type, - datasource=datasource, - query=query, - include_fields=utils.unmarshal( - include_fields, - Optional[List[models.ListEntitiesRequestIncludeField]], - ), - page_size=page_size, - cursor=cursor, - source=source, - request_type=request_type, - ), - ) - - req = self._build_request_async( - method="POST", - path="/rest/api/v1/listentities", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.list_entities_request, - False, - False, - "json", - models.ListEntitiesRequest, - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="listentities", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Entities"], - extensions={ - "x-codegen-request-body-name": "payload", - "x-visibility": "Public", - }, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ListEntitiesResponse, http_res) - if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - def read_people( - self, - *, - locale: Optional[str] = None, - timezone_offset: Optional[int] = None, - obfuscated_ids: Optional[Iterable[str]] = None, - email_ids: Optional[Iterable[str]] = None, - include_fields: Optional[Iterable[models.PeopleRequestIncludeField]] = None, - include_types: Optional[Iterable[models.IncludeType]] = None, - source: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.PeopleResponse: - r"""Read people - - Read people details for the given IDs. - - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param timezone_offset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. - :param obfuscated_ids: The Person IDs to retrieve. If no IDs are requested, the current user's details are returned. - :param email_ids: The email IDs to retrieve. The result is the deduplicated union of emailIds and obfuscatedIds. - :param include_fields: List of PersonMetadata fields to return (that aren't returned by default) - :param include_types: The types of people entities to include in the response in addition to those returned by default. - :param source: A string denoting the search surface from which the endpoint is called. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.PeopleRequestRequest( - locale=locale, - people_request=models.PeopleRequest( - timezone_offset=timezone_offset, - obfuscated_ids=utils.unmarshal(obfuscated_ids, Optional[List[str]]), - email_ids=utils.unmarshal(email_ids, Optional[List[str]]), - include_fields=utils.unmarshal( - include_fields, Optional[List[models.PeopleRequestIncludeField]] - ), - include_types=utils.unmarshal( - include_types, Optional[List[models.IncludeType]] - ), - source=source, - ), - ) - - req = self._build_request( - method="POST", - path="/rest/api/v1/people", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.people_request, False, False, "json", models.PeopleRequest - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="people", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Entities"], - extensions={ - "x-codegen-request-body-name": "payload", - "x-visibility": "Public", - }, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.PeopleResponse, http_res) - if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - async def read_people_async( - self, - *, - locale: Optional[str] = None, - timezone_offset: Optional[int] = None, - obfuscated_ids: Optional[Iterable[str]] = None, - email_ids: Optional[Iterable[str]] = None, - include_fields: Optional[Iterable[models.PeopleRequestIncludeField]] = None, - include_types: Optional[Iterable[models.IncludeType]] = None, - source: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.PeopleResponse: - r"""Read people - - Read people details for the given IDs. - - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param timezone_offset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. - :param obfuscated_ids: The Person IDs to retrieve. If no IDs are requested, the current user's details are returned. - :param email_ids: The email IDs to retrieve. The result is the deduplicated union of emailIds and obfuscatedIds. - :param include_fields: List of PersonMetadata fields to return (that aren't returned by default) - :param include_types: The types of people entities to include in the response in addition to those returned by default. - :param source: A string denoting the search surface from which the endpoint is called. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.PeopleRequestRequest( - locale=locale, - people_request=models.PeopleRequest( - timezone_offset=timezone_offset, - obfuscated_ids=utils.unmarshal(obfuscated_ids, Optional[List[str]]), - email_ids=utils.unmarshal(email_ids, Optional[List[str]]), - include_fields=utils.unmarshal( - include_fields, Optional[List[models.PeopleRequestIncludeField]] - ), - include_types=utils.unmarshal( - include_types, Optional[List[models.IncludeType]] - ), - source=source, - ), - ) - - req = self._build_request_async( - method="POST", - path="/rest/api/v1/people", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.people_request, False, False, "json", models.PeopleRequest - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="people", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Entities"], - extensions={ - "x-codegen-request-body-name": "payload", - "x-visibility": "Public", - }, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.PeopleResponse, http_res) - if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) diff --git a/src/glean/api_client/client_governance.py b/src/glean/api_client/client_governance.py deleted file mode 100644 index 6011411d..00000000 --- a/src/glean/api_client/client_governance.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from .sdkconfiguration import SDKConfiguration -from glean.api_client.data import Data -from glean.api_client.governance_documents import GovernanceDocuments -from typing import Optional - - -class ClientGovernance(BaseSDK): - data: Data - documents: GovernanceDocuments - - def __init__( - self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None - ) -> None: - BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) - self.sdk_configuration = sdk_config - self._init_sdks() - - def _init_sdks(self): - self.data = Data(self.sdk_configuration, parent_ref=self.parent_ref) - self.documents = GovernanceDocuments( - self.sdk_configuration, parent_ref=self.parent_ref - ) diff --git a/src/glean/api_client/client_search.py b/src/glean/api_client/client_search.py new file mode 100644 index 00000000..53d4e166 --- /dev/null +++ b/src/glean/api_client/client_search.py @@ -0,0 +1,1424 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from datetime import datetime +from glean.api_client import errors, models, utils +from glean.api_client._hooks import HookContext +from glean.api_client.types import OptionalNullable, UNSET +from glean.api_client.utils import get_security_from_env +from glean.api_client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Iterable, List, Mapping, Optional, Union + + +class ClientSearch(BaseSDK): + def query_as_admin( + self, + *, + query: str, + locale: Optional[str] = None, + timestamp: Optional[datetime] = None, + tracking_token: Optional[str] = None, + session_info: Optional[ + Union[models.SessionInfo, models.SessionInfoTypedDict] + ] = None, + source_document: Optional[ + Union[models.Document, models.DocumentTypedDict] + ] = None, + page_size: Optional[int] = None, + max_snippet_size: Optional[int] = None, + cursor: Optional[str] = None, + result_tab_ids: Optional[Iterable[str]] = None, + input_details: Optional[ + Union[ + models.SearchRequestInputDetails, + models.SearchRequestInputDetailsTypedDict, + ] + ] = None, + request_options: Optional[ + Union[models.SearchRequestOptions, models.SearchRequestOptionsTypedDict] + ] = None, + timeout_millis: Optional[int] = None, + disable_spellcheck: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SearchResponse: + r"""Search the index (admin) + + Retrieves results for search query without respect for permissions. This is available only to privileged users. + + :param query: The search terms. + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param timestamp: The ISO 8601 timestamp associated with the client request. + :param tracking_token: A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. + :param session_info: + :param source_document: + :param page_size: Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. + :param max_snippet_size: Hint to the server about how many characters long a snippet may be. Server may return less or more. + :param cursor: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. + :param result_tab_ids: The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. + :param input_details: + :param request_options: + :param timeout_millis: Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. + :param disable_spellcheck: Whether or not to disable spellcheck. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AdminsearchRequest( + locale=locale, + search_request=models.SearchRequest( + timestamp=timestamp, + tracking_token=tracking_token, + session_info=utils.get_pydantic_model( + session_info, Optional[models.SessionInfo] + ), + source_document=utils.get_pydantic_model( + source_document, Optional[models.Document] + ), + page_size=page_size, + max_snippet_size=max_snippet_size, + query=query, + cursor=cursor, + result_tab_ids=utils.unmarshal(result_tab_ids, Optional[List[str]]), + input_details=utils.get_pydantic_model( + input_details, Optional[models.SearchRequestInputDetails] + ), + request_options=utils.get_pydantic_model( + request_options, Optional[models.SearchRequestOptions] + ), + timeout_millis=timeout_millis, + disable_spellcheck=disable_spellcheck, + ), + ) + + req = self._build_request( + method="POST", + path="/rest/api/v1/adminsearch", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.search_request, False, False, "json", models.SearchRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="adminsearch", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Search"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Preview", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.SearchResponse, http_res) + if utils.match_response(http_res, ["403", "422"], "application/json"): + response_data = unmarshal_json_response(errors.GleanDataErrorData, http_res) + raise errors.GleanDataError(response_data, http_res) + if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def query_as_admin_async( + self, + *, + query: str, + locale: Optional[str] = None, + timestamp: Optional[datetime] = None, + tracking_token: Optional[str] = None, + session_info: Optional[ + Union[models.SessionInfo, models.SessionInfoTypedDict] + ] = None, + source_document: Optional[ + Union[models.Document, models.DocumentTypedDict] + ] = None, + page_size: Optional[int] = None, + max_snippet_size: Optional[int] = None, + cursor: Optional[str] = None, + result_tab_ids: Optional[Iterable[str]] = None, + input_details: Optional[ + Union[ + models.SearchRequestInputDetails, + models.SearchRequestInputDetailsTypedDict, + ] + ] = None, + request_options: Optional[ + Union[models.SearchRequestOptions, models.SearchRequestOptionsTypedDict] + ] = None, + timeout_millis: Optional[int] = None, + disable_spellcheck: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SearchResponse: + r"""Search the index (admin) + + Retrieves results for search query without respect for permissions. This is available only to privileged users. + + :param query: The search terms. + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param timestamp: The ISO 8601 timestamp associated with the client request. + :param tracking_token: A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. + :param session_info: + :param source_document: + :param page_size: Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. + :param max_snippet_size: Hint to the server about how many characters long a snippet may be. Server may return less or more. + :param cursor: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. + :param result_tab_ids: The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. + :param input_details: + :param request_options: + :param timeout_millis: Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. + :param disable_spellcheck: Whether or not to disable spellcheck. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AdminsearchRequest( + locale=locale, + search_request=models.SearchRequest( + timestamp=timestamp, + tracking_token=tracking_token, + session_info=utils.get_pydantic_model( + session_info, Optional[models.SessionInfo] + ), + source_document=utils.get_pydantic_model( + source_document, Optional[models.Document] + ), + page_size=page_size, + max_snippet_size=max_snippet_size, + query=query, + cursor=cursor, + result_tab_ids=utils.unmarshal(result_tab_ids, Optional[List[str]]), + input_details=utils.get_pydantic_model( + input_details, Optional[models.SearchRequestInputDetails] + ), + request_options=utils.get_pydantic_model( + request_options, Optional[models.SearchRequestOptions] + ), + timeout_millis=timeout_millis, + disable_spellcheck=disable_spellcheck, + ), + ) + + req = self._build_request_async( + method="POST", + path="/rest/api/v1/adminsearch", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.search_request, False, False, "json", models.SearchRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="adminsearch", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Search"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Preview", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.SearchResponse, http_res) + if utils.match_response(http_res, ["403", "422"], "application/json"): + response_data = unmarshal_json_response(errors.GleanDataErrorData, http_res) + raise errors.GleanDataError(response_data, http_res) + if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def autocomplete( + self, + *, + locale: Optional[str] = None, + tracking_token: Optional[str] = None, + session_info: Optional[ + Union[models.SessionInfo, models.SessionInfoTypedDict] + ] = None, + query: Optional[str] = None, + datasources_filter: Optional[Iterable[str]] = None, + datasource: Optional[str] = None, + result_types: Optional[Iterable[models.AutocompleteRequestResultType]] = None, + result_size: Optional[int] = None, + auth_tokens: Optional[ + Union[Iterable[models.AuthToken], Iterable[models.AuthTokenTypedDict]] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.AutocompleteResponse: + r"""Autocomplete + + Retrieve query suggestions, operators and documents for the given partially typed query. + + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param tracking_token: + :param session_info: + :param query: Partially typed query. + :param datasources_filter: Filter results to only those relevant to one or more datasources (e.g. jira, gdrive). Results are unfiltered if missing. + :param datasource: Filter to only return results relevant to the given datasource. + :param result_types: Filter to only return results of the given type(s). All types may be returned if omitted. + :param result_size: Maximum number of results to be returned. If no value is provided, the backend will cap at 200. + + :param auth_tokens: Auth tokens which may be used for federated results. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AutocompleteRequestRequest( + locale=locale, + autocomplete_request=models.AutocompleteRequest( + tracking_token=tracking_token, + session_info=utils.get_pydantic_model( + session_info, Optional[models.SessionInfo] + ), + query=query, + datasources_filter=utils.unmarshal( + datasources_filter, Optional[List[str]] + ), + datasource=datasource, + result_types=utils.unmarshal( + result_types, Optional[List[models.AutocompleteRequestResultType]] + ), + result_size=result_size, + auth_tokens=utils.get_pydantic_model( + auth_tokens, Optional[List[models.AuthToken]] + ), + ), + ) + + req = self._build_request( + method="POST", + path="/rest/api/v1/autocomplete", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.autocomplete_request, + False, + False, + "json", + models.AutocompleteRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="autocomplete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Search"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.AutocompleteResponse, http_res) + if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def autocomplete_async( + self, + *, + locale: Optional[str] = None, + tracking_token: Optional[str] = None, + session_info: Optional[ + Union[models.SessionInfo, models.SessionInfoTypedDict] + ] = None, + query: Optional[str] = None, + datasources_filter: Optional[Iterable[str]] = None, + datasource: Optional[str] = None, + result_types: Optional[Iterable[models.AutocompleteRequestResultType]] = None, + result_size: Optional[int] = None, + auth_tokens: Optional[ + Union[Iterable[models.AuthToken], Iterable[models.AuthTokenTypedDict]] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.AutocompleteResponse: + r"""Autocomplete + + Retrieve query suggestions, operators and documents for the given partially typed query. + + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param tracking_token: + :param session_info: + :param query: Partially typed query. + :param datasources_filter: Filter results to only those relevant to one or more datasources (e.g. jira, gdrive). Results are unfiltered if missing. + :param datasource: Filter to only return results relevant to the given datasource. + :param result_types: Filter to only return results of the given type(s). All types may be returned if omitted. + :param result_size: Maximum number of results to be returned. If no value is provided, the backend will cap at 200. + + :param auth_tokens: Auth tokens which may be used for federated results. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AutocompleteRequestRequest( + locale=locale, + autocomplete_request=models.AutocompleteRequest( + tracking_token=tracking_token, + session_info=utils.get_pydantic_model( + session_info, Optional[models.SessionInfo] + ), + query=query, + datasources_filter=utils.unmarshal( + datasources_filter, Optional[List[str]] + ), + datasource=datasource, + result_types=utils.unmarshal( + result_types, Optional[List[models.AutocompleteRequestResultType]] + ), + result_size=result_size, + auth_tokens=utils.get_pydantic_model( + auth_tokens, Optional[List[models.AuthToken]] + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/rest/api/v1/autocomplete", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.autocomplete_request, + False, + False, + "json", + models.AutocompleteRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="autocomplete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Search"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.AutocompleteResponse, http_res) + if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def retrieve_feed( + self, + *, + locale: Optional[str] = None, + categories: Optional[Iterable[models.FeedRequestCategory]] = None, + request_options: Optional[ + Union[models.FeedRequestOptions, models.FeedRequestOptionsTypedDict] + ] = None, + timeout_millis: Optional[int] = None, + session_info: Optional[ + Union[models.SessionInfo, models.SessionInfoTypedDict] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.FeedResponse: + r"""Feed of documents and events + + The personalized feed/home includes different types of contents including suggestions, recents, calendar events and many more. + + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param categories: Categories of content requested. An allowlist gives flexibility to request content separately or together. + :param request_options: + :param timeout_millis: Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. + :param session_info: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.FeedRequestRequest( + locale=locale, + feed_request=models.FeedRequest( + categories=utils.unmarshal( + categories, Optional[List[models.FeedRequestCategory]] + ), + request_options=utils.get_pydantic_model( + request_options, Optional[models.FeedRequestOptions] + ), + timeout_millis=timeout_millis, + session_info=utils.get_pydantic_model( + session_info, Optional[models.SessionInfo] + ), + ), + ) + + req = self._build_request( + method="POST", + path="/rest/api/v1/feed", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.feed_request, False, False, "json", models.FeedRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="feed", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Search"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.FeedResponse, http_res) + if utils.match_response(http_res, ["400", "401", "408", "429", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def retrieve_feed_async( + self, + *, + locale: Optional[str] = None, + categories: Optional[Iterable[models.FeedRequestCategory]] = None, + request_options: Optional[ + Union[models.FeedRequestOptions, models.FeedRequestOptionsTypedDict] + ] = None, + timeout_millis: Optional[int] = None, + session_info: Optional[ + Union[models.SessionInfo, models.SessionInfoTypedDict] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.FeedResponse: + r"""Feed of documents and events + + The personalized feed/home includes different types of contents including suggestions, recents, calendar events and many more. + + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param categories: Categories of content requested. An allowlist gives flexibility to request content separately or together. + :param request_options: + :param timeout_millis: Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. + :param session_info: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.FeedRequestRequest( + locale=locale, + feed_request=models.FeedRequest( + categories=utils.unmarshal( + categories, Optional[List[models.FeedRequestCategory]] + ), + request_options=utils.get_pydantic_model( + request_options, Optional[models.FeedRequestOptions] + ), + timeout_millis=timeout_millis, + session_info=utils.get_pydantic_model( + session_info, Optional[models.SessionInfo] + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/rest/api/v1/feed", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.feed_request, False, False, "json", models.FeedRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="feed", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Search"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.FeedResponse, http_res) + if utils.match_response(http_res, ["400", "401", "408", "429", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def recommendations( + self, + *, + locale: Optional[str] = None, + timestamp: Optional[datetime] = None, + tracking_token: Optional[str] = None, + session_info: Optional[ + Union[models.SessionInfo, models.SessionInfoTypedDict] + ] = None, + source_document: Optional[ + Union[models.Document, models.DocumentTypedDict] + ] = None, + page_size: Optional[int] = None, + max_snippet_size: Optional[int] = None, + recommendation_document_spec: Optional[ + Union[models.DocumentSpecUnion, models.DocumentSpecUnionTypedDict] + ] = None, + request_options: Optional[ + Union[ + models.RecommendationsRequestOptions, + models.RecommendationsRequestOptionsTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.ResultsResponse]: + r"""Recommend documents + + Retrieve recommended documents for the given URL or Glean Document ID. + + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param timestamp: The ISO 8601 timestamp associated with the client request. + :param tracking_token: A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. + :param session_info: + :param source_document: + :param page_size: Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. + :param max_snippet_size: Hint to the server about how many characters long a snippet may be. Server may return less or more. + :param recommendation_document_spec: + :param request_options: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.RecommendationsRequestRequest( + locale=locale, + recommendations_request=models.RecommendationsRequest( + timestamp=timestamp, + tracking_token=tracking_token, + session_info=utils.get_pydantic_model( + session_info, Optional[models.SessionInfo] + ), + source_document=utils.get_pydantic_model( + source_document, Optional[models.Document] + ), + page_size=page_size, + max_snippet_size=max_snippet_size, + recommendation_document_spec=utils.get_pydantic_model( + recommendation_document_spec, Optional[models.DocumentSpecUnion] + ), + request_options=utils.get_pydantic_model( + request_options, Optional[models.RecommendationsRequestOptions] + ), + ), + ) + + req = self._build_request( + method="POST", + path="/rest/api/v1/recommendations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.recommendations_request, + False, + False, + "json", + models.RecommendationsRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="recommendations", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Search"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Preview", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ResultsResponse, http_res) + if utils.match_response(http_res, ["202", "204"], "*"): + return None + if utils.match_response(http_res, ["400", "401", "403", "429", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def recommendations_async( + self, + *, + locale: Optional[str] = None, + timestamp: Optional[datetime] = None, + tracking_token: Optional[str] = None, + session_info: Optional[ + Union[models.SessionInfo, models.SessionInfoTypedDict] + ] = None, + source_document: Optional[ + Union[models.Document, models.DocumentTypedDict] + ] = None, + page_size: Optional[int] = None, + max_snippet_size: Optional[int] = None, + recommendation_document_spec: Optional[ + Union[models.DocumentSpecUnion, models.DocumentSpecUnionTypedDict] + ] = None, + request_options: Optional[ + Union[ + models.RecommendationsRequestOptions, + models.RecommendationsRequestOptionsTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.ResultsResponse]: + r"""Recommend documents + + Retrieve recommended documents for the given URL or Glean Document ID. + + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param timestamp: The ISO 8601 timestamp associated with the client request. + :param tracking_token: A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. + :param session_info: + :param source_document: + :param page_size: Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. + :param max_snippet_size: Hint to the server about how many characters long a snippet may be. Server may return less or more. + :param recommendation_document_spec: + :param request_options: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.RecommendationsRequestRequest( + locale=locale, + recommendations_request=models.RecommendationsRequest( + timestamp=timestamp, + tracking_token=tracking_token, + session_info=utils.get_pydantic_model( + session_info, Optional[models.SessionInfo] + ), + source_document=utils.get_pydantic_model( + source_document, Optional[models.Document] + ), + page_size=page_size, + max_snippet_size=max_snippet_size, + recommendation_document_spec=utils.get_pydantic_model( + recommendation_document_spec, Optional[models.DocumentSpecUnion] + ), + request_options=utils.get_pydantic_model( + request_options, Optional[models.RecommendationsRequestOptions] + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/rest/api/v1/recommendations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.recommendations_request, + False, + False, + "json", + models.RecommendationsRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="recommendations", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Search"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Preview", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ResultsResponse, http_res) + if utils.match_response(http_res, ["202", "204"], "*"): + return None + if utils.match_response(http_res, ["400", "401", "403", "429", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def query( + self, + *, + query: str, + locale: Optional[str] = None, + timestamp: Optional[datetime] = None, + tracking_token: Optional[str] = None, + session_info: Optional[ + Union[models.SessionInfo, models.SessionInfoTypedDict] + ] = None, + source_document: Optional[ + Union[models.Document, models.DocumentTypedDict] + ] = None, + page_size: Optional[int] = None, + max_snippet_size: Optional[int] = None, + cursor: Optional[str] = None, + result_tab_ids: Optional[Iterable[str]] = None, + input_details: Optional[ + Union[ + models.SearchRequestInputDetails, + models.SearchRequestInputDetailsTypedDict, + ] + ] = None, + request_options: Optional[ + Union[models.SearchRequestOptions, models.SearchRequestOptionsTypedDict] + ] = None, + timeout_millis: Optional[int] = None, + disable_spellcheck: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SearchResponse: + r"""Search + + Retrieve results from the index for the given query and filters. + + :param query: The search terms. + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param timestamp: The ISO 8601 timestamp associated with the client request. + :param tracking_token: A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. + :param session_info: + :param source_document: + :param page_size: Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. + :param max_snippet_size: Hint to the server about how many characters long a snippet may be. Server may return less or more. + :param cursor: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. + :param result_tab_ids: The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. + :param input_details: + :param request_options: + :param timeout_millis: Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. + :param disable_spellcheck: Whether or not to disable spellcheck. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.SearchRequestRequest( + locale=locale, + search_request=models.SearchRequest( + timestamp=timestamp, + tracking_token=tracking_token, + session_info=utils.get_pydantic_model( + session_info, Optional[models.SessionInfo] + ), + source_document=utils.get_pydantic_model( + source_document, Optional[models.Document] + ), + page_size=page_size, + max_snippet_size=max_snippet_size, + query=query, + cursor=cursor, + result_tab_ids=utils.unmarshal(result_tab_ids, Optional[List[str]]), + input_details=utils.get_pydantic_model( + input_details, Optional[models.SearchRequestInputDetails] + ), + request_options=utils.get_pydantic_model( + request_options, Optional[models.SearchRequestOptions] + ), + timeout_millis=timeout_millis, + disable_spellcheck=disable_spellcheck, + ), + ) + + req = self._build_request( + method="POST", + path="/rest/api/v1/search", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.search_request, False, False, "json", models.SearchRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="search", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Search"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.SearchResponse, http_res) + if utils.match_response(http_res, ["403", "422"], "application/json"): + response_data = unmarshal_json_response(errors.GleanDataErrorData, http_res) + raise errors.GleanDataError(response_data, http_res) + if utils.match_response(http_res, ["400", "401", "408", "429", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def query_async( + self, + *, + query: str, + locale: Optional[str] = None, + timestamp: Optional[datetime] = None, + tracking_token: Optional[str] = None, + session_info: Optional[ + Union[models.SessionInfo, models.SessionInfoTypedDict] + ] = None, + source_document: Optional[ + Union[models.Document, models.DocumentTypedDict] + ] = None, + page_size: Optional[int] = None, + max_snippet_size: Optional[int] = None, + cursor: Optional[str] = None, + result_tab_ids: Optional[Iterable[str]] = None, + input_details: Optional[ + Union[ + models.SearchRequestInputDetails, + models.SearchRequestInputDetailsTypedDict, + ] + ] = None, + request_options: Optional[ + Union[models.SearchRequestOptions, models.SearchRequestOptionsTypedDict] + ] = None, + timeout_millis: Optional[int] = None, + disable_spellcheck: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SearchResponse: + r"""Search + + Retrieve results from the index for the given query and filters. + + :param query: The search terms. + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param timestamp: The ISO 8601 timestamp associated with the client request. + :param tracking_token: A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. + :param session_info: + :param source_document: + :param page_size: Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. + :param max_snippet_size: Hint to the server about how many characters long a snippet may be. Server may return less or more. + :param cursor: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. + :param result_tab_ids: The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. + :param input_details: + :param request_options: + :param timeout_millis: Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. + :param disable_spellcheck: Whether or not to disable spellcheck. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.SearchRequestRequest( + locale=locale, + search_request=models.SearchRequest( + timestamp=timestamp, + tracking_token=tracking_token, + session_info=utils.get_pydantic_model( + session_info, Optional[models.SessionInfo] + ), + source_document=utils.get_pydantic_model( + source_document, Optional[models.Document] + ), + page_size=page_size, + max_snippet_size=max_snippet_size, + query=query, + cursor=cursor, + result_tab_ids=utils.unmarshal(result_tab_ids, Optional[List[str]]), + input_details=utils.get_pydantic_model( + input_details, Optional[models.SearchRequestInputDetails] + ), + request_options=utils.get_pydantic_model( + request_options, Optional[models.SearchRequestOptions] + ), + timeout_millis=timeout_millis, + disable_spellcheck=disable_spellcheck, + ), + ) + + req = self._build_request_async( + method="POST", + path="/rest/api/v1/search", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.search_request, False, False, "json", models.SearchRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="search", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Search"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.SearchResponse, http_res) + if utils.match_response(http_res, ["403", "422"], "application/json"): + response_data = unmarshal_json_response(errors.GleanDataErrorData, http_res) + raise errors.GleanDataError(response_data, http_res) + if utils.match_response(http_res, ["400", "401", "408", "429", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) diff --git a/src/glean/api_client/client_tools.py b/src/glean/api_client/client_tools.py deleted file mode 100644 index 143bb037..00000000 --- a/src/glean/api_client/client_tools.py +++ /dev/null @@ -1,377 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from glean.api_client import errors, models, utils -from glean.api_client._hooks import HookContext -from glean.api_client.types import OptionalNullable, UNSET -from glean.api_client.utils import get_security_from_env -from glean.api_client.utils.unmarshal_json_response import unmarshal_json_response -from typing import Dict, Iterable, List, Mapping, Optional, Union - - -class ClientTools(BaseSDK): - def list( - self, - *, - tool_names: Optional[Iterable[str]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ToolsListResponse: - r"""List available tools - - Returns a filtered set of available tools based on optional tool name parameters. If no filters are provided, all available tools are returned. - - :param tool_names: Optional array of tool names to filter by - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.GetRestAPIV1ToolsListRequest( - tool_names=utils.unmarshal(tool_names, Optional[List[str]]), - ) - - req = self._build_request( - method="GET", - path="/rest/api/v1/tools/list", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="get_/rest/api/v1/tools/list", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Tools", "Tools"], - extensions={"x-visibility": "Preview"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ToolsListResponse, http_res) - if utils.match_response(http_res, ["400", "401", "404", "429", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - async def list_async( - self, - *, - tool_names: Optional[Iterable[str]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ToolsListResponse: - r"""List available tools - - Returns a filtered set of available tools based on optional tool name parameters. If no filters are provided, all available tools are returned. - - :param tool_names: Optional array of tool names to filter by - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.GetRestAPIV1ToolsListRequest( - tool_names=utils.unmarshal(tool_names, Optional[List[str]]), - ) - - req = self._build_request_async( - method="GET", - path="/rest/api/v1/tools/list", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="get_/rest/api/v1/tools/list", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Tools", "Tools"], - extensions={"x-visibility": "Preview"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ToolsListResponse, http_res) - if utils.match_response(http_res, ["400", "401", "404", "429", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - def run( - self, - *, - name: str, - parameters: Union[ - Mapping[str, models.ToolsCallParameter], - Mapping[str, models.ToolsCallParameterTypedDict], - ], - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ToolsCallResponse: - r"""Execute the specified tool - - Execute the specified tool with provided parameters - - :param name: Required name of the tool to execute - :param parameters: The parameters for the tool. Each key is the name of the parameter and the value is the parameter object. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ToolsCallRequest( - name=name, - parameters=utils.get_pydantic_model( - parameters, Dict[str, models.ToolsCallParameter] - ), - ) - - req = self._build_request( - method="POST", - path="/rest/api/v1/tools/call", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ToolsCallRequest - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="post_/rest/api/v1/tools/call", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Tools", "Tools"], - extensions={"x-visibility": "Preview"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ToolsCallResponse, http_res) - if utils.match_response(http_res, ["400", "401", "404", "429", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - async def run_async( - self, - *, - name: str, - parameters: Union[ - Mapping[str, models.ToolsCallParameter], - Mapping[str, models.ToolsCallParameterTypedDict], - ], - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ToolsCallResponse: - r"""Execute the specified tool - - Execute the specified tool with provided parameters - - :param name: Required name of the tool to execute - :param parameters: The parameters for the tool. Each key is the name of the parameter and the value is the parameter object. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ToolsCallRequest( - name=name, - parameters=utils.get_pydantic_model( - parameters, Dict[str, models.ToolsCallParameter] - ), - ) - - req = self._build_request_async( - method="POST", - path="/rest/api/v1/tools/call", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ToolsCallRequest - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="post_/rest/api/v1/tools/call", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Tools", "Tools"], - extensions={"x-visibility": "Preview"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ToolsCallResponse, http_res) - if utils.match_response(http_res, ["400", "401", "404", "429", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) diff --git a/src/glean/api_client/data.py b/src/glean/api_client/data.py index 756e122c..1187e013 100644 --- a/src/glean/api_client/data.py +++ b/src/glean/api_client/data.py @@ -2,6 +2,7 @@ from .basesdk import BaseSDK from .sdkconfiguration import SDKConfiguration +from glean.api_client.findings import Findings from glean.api_client.policies import Policies from glean.api_client.reports import Reports from typing import Optional @@ -10,6 +11,7 @@ class Data(BaseSDK): policies: Policies reports: Reports + findings: Findings def __init__( self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None @@ -21,3 +23,4 @@ def __init__( def _init_sdks(self): self.policies = Policies(self.sdk_configuration, parent_ref=self.parent_ref) self.reports = Reports(self.sdk_configuration, parent_ref=self.parent_ref) + self.findings = Findings(self.sdk_configuration, parent_ref=self.parent_ref) diff --git a/src/glean/api_client/entities.py b/src/glean/api_client/entities.py index dbf83344..f90b9ae8 100644 --- a/src/glean/api_client/entities.py +++ b/src/glean/api_client/entities.py @@ -6,23 +6,538 @@ from glean.api_client._hooks import HookContext from glean.api_client.types import OptionalNullable, UNSET from glean.api_client.utils import get_security_from_env -from typing import Mapping, Optional +from glean.api_client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Iterable, List, Mapping, Optional, Union -class GetPersonPhotoAcceptEnum(str, Enum): +class RetrievePersonPhotoAcceptEnum(str, Enum): IMAGE_JPEG = "image/jpeg" IMAGE_PNG = "image/png" class Entities(BaseSDK): - def get_person_photo( + def list( + self, + *, + locale: Optional[str] = None, + filter_: Optional[ + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] + ] = None, + sort: Optional[ + Union[Iterable[models.SortOptions], Iterable[models.SortOptionsTypedDict]] + ] = None, + entity_type: Optional[ + models.ListEntitiesRequestEntityType + ] = models.ListEntitiesRequestEntityType.PEOPLE, + datasource: Optional[str] = None, + query: Optional[str] = None, + include_fields: Optional[ + Iterable[models.ListEntitiesRequestIncludeField] + ] = None, + page_size: Optional[int] = None, + cursor: Optional[str] = None, + source: Optional[str] = None, + request_type: Optional[models.RequestType] = models.RequestType.STANDARD, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListEntitiesResponse: + r"""List entities + + List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint, except when using FULL_DIRECTORY request type for people entities. + + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param filter_: + :param sort: Use EntitiesSortOrder enum for SortOptions.sortBy + :param entity_type: + :param datasource: The datasource associated with the entity type, most commonly used with CUSTOM_ENTITIES + :param query: A query string to search for entities that each entity in the response must conform to. An empty query does not filter any entities. + :param include_fields: List of entity fields to return (that aren't returned by default) + :param page_size: Hint to the server about how many results to send back. Server may return less. + :param cursor: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. + :param source: A string denoting the search surface from which the endpoint is called. + :param request_type: The type of request being made. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ListentitiesRequestRequest( + locale=locale, + list_entities_request=models.ListEntitiesRequest( + filter_=utils.get_pydantic_model( + filter_, Optional[List[models.FacetFilter]] + ), + sort=utils.get_pydantic_model(sort, Optional[List[models.SortOptions]]), + entity_type=entity_type, + datasource=datasource, + query=query, + include_fields=utils.unmarshal( + include_fields, + Optional[List[models.ListEntitiesRequestIncludeField]], + ), + page_size=page_size, + cursor=cursor, + source=source, + request_type=request_type, + ), + ) + + req = self._build_request( + method="POST", + path="/rest/api/v1/listentities", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.list_entities_request, + False, + False, + "json", + models.ListEntitiesRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listentities", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Entities"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListEntitiesResponse, http_res) + if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def list_async( + self, + *, + locale: Optional[str] = None, + filter_: Optional[ + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] + ] = None, + sort: Optional[ + Union[Iterable[models.SortOptions], Iterable[models.SortOptionsTypedDict]] + ] = None, + entity_type: Optional[ + models.ListEntitiesRequestEntityType + ] = models.ListEntitiesRequestEntityType.PEOPLE, + datasource: Optional[str] = None, + query: Optional[str] = None, + include_fields: Optional[ + Iterable[models.ListEntitiesRequestIncludeField] + ] = None, + page_size: Optional[int] = None, + cursor: Optional[str] = None, + source: Optional[str] = None, + request_type: Optional[models.RequestType] = models.RequestType.STANDARD, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListEntitiesResponse: + r"""List entities + + List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint, except when using FULL_DIRECTORY request type for people entities. + + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param filter_: + :param sort: Use EntitiesSortOrder enum for SortOptions.sortBy + :param entity_type: + :param datasource: The datasource associated with the entity type, most commonly used with CUSTOM_ENTITIES + :param query: A query string to search for entities that each entity in the response must conform to. An empty query does not filter any entities. + :param include_fields: List of entity fields to return (that aren't returned by default) + :param page_size: Hint to the server about how many results to send back. Server may return less. + :param cursor: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. + :param source: A string denoting the search surface from which the endpoint is called. + :param request_type: The type of request being made. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ListentitiesRequestRequest( + locale=locale, + list_entities_request=models.ListEntitiesRequest( + filter_=utils.get_pydantic_model( + filter_, Optional[List[models.FacetFilter]] + ), + sort=utils.get_pydantic_model(sort, Optional[List[models.SortOptions]]), + entity_type=entity_type, + datasource=datasource, + query=query, + include_fields=utils.unmarshal( + include_fields, + Optional[List[models.ListEntitiesRequestIncludeField]], + ), + page_size=page_size, + cursor=cursor, + source=source, + request_type=request_type, + ), + ) + + req = self._build_request_async( + method="POST", + path="/rest/api/v1/listentities", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.list_entities_request, + False, + False, + "json", + models.ListEntitiesRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listentities", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Entities"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListEntitiesResponse, http_res) + if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def read_people( + self, + *, + locale: Optional[str] = None, + timezone_offset: Optional[int] = None, + obfuscated_ids: Optional[Iterable[str]] = None, + email_ids: Optional[Iterable[str]] = None, + include_fields: Optional[Iterable[models.PeopleRequestIncludeField]] = None, + include_types: Optional[Iterable[models.IncludeType]] = None, + source: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PeopleResponse: + r"""Read people + + Read people details for the given IDs. + + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param timezone_offset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + :param obfuscated_ids: The Person IDs to retrieve. If no IDs are requested, the current user's details are returned. + :param email_ids: The email IDs to retrieve. The result is the deduplicated union of emailIds and obfuscatedIds. + :param include_fields: List of PersonMetadata fields to return (that aren't returned by default) + :param include_types: The types of people entities to include in the response in addition to those returned by default. + :param source: A string denoting the search surface from which the endpoint is called. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PeopleRequestRequest( + locale=locale, + people_request=models.PeopleRequest( + timezone_offset=timezone_offset, + obfuscated_ids=utils.unmarshal(obfuscated_ids, Optional[List[str]]), + email_ids=utils.unmarshal(email_ids, Optional[List[str]]), + include_fields=utils.unmarshal( + include_fields, Optional[List[models.PeopleRequestIncludeField]] + ), + include_types=utils.unmarshal( + include_types, Optional[List[models.IncludeType]] + ), + source=source, + ), + ) + + req = self._build_request( + method="POST", + path="/rest/api/v1/people", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.people_request, False, False, "json", models.PeopleRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="people", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Entities"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.PeopleResponse, http_res) + if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def read_people_async( + self, + *, + locale: Optional[str] = None, + timezone_offset: Optional[int] = None, + obfuscated_ids: Optional[Iterable[str]] = None, + email_ids: Optional[Iterable[str]] = None, + include_fields: Optional[Iterable[models.PeopleRequestIncludeField]] = None, + include_types: Optional[Iterable[models.IncludeType]] = None, + source: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PeopleResponse: + r"""Read people + + Read people details for the given IDs. + + :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. + :param timezone_offset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + :param obfuscated_ids: The Person IDs to retrieve. If no IDs are requested, the current user's details are returned. + :param email_ids: The email IDs to retrieve. The result is the deduplicated union of emailIds and obfuscatedIds. + :param include_fields: List of PersonMetadata fields to return (that aren't returned by default) + :param include_types: The types of people entities to include in the response in addition to those returned by default. + :param source: A string denoting the search surface from which the endpoint is called. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PeopleRequestRequest( + locale=locale, + people_request=models.PeopleRequest( + timezone_offset=timezone_offset, + obfuscated_ids=utils.unmarshal(obfuscated_ids, Optional[List[str]]), + email_ids=utils.unmarshal(email_ids, Optional[List[str]]), + include_fields=utils.unmarshal( + include_fields, Optional[List[models.PeopleRequestIncludeField]] + ), + include_types=utils.unmarshal( + include_types, Optional[List[models.IncludeType]] + ), + source=source, + ), + ) + + req = self._build_request_async( + method="POST", + path="/rest/api/v1/people", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.people_request, False, False, "json", models.PeopleRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="people", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Entities"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.PeopleResponse, http_res) + if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def retrieve_person_photo( self, *, person_id: str, ds: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, - accept_header_override: Optional[GetPersonPhotoAcceptEnum] = None, + accept_header_override: Optional[RetrievePersonPhotoAcceptEnum] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> models.GetPersonPhotoResponse: @@ -118,14 +633,14 @@ def get_person_photo( http_res_text = utils.stream_to_text(http_res) raise errors.GleanError("Unexpected response received", http_res, http_res_text) - async def get_person_photo_async( + async def retrieve_person_photo_async( self, *, person_id: str, ds: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, - accept_header_override: Optional[GetPersonPhotoAcceptEnum] = None, + accept_header_override: Optional[RetrievePersonPhotoAcceptEnum] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> models.GetPersonPhotoResponse: diff --git a/src/glean/api_client/errors/__init__.py b/src/glean/api_client/errors/__init__.py index 2a3a78db..56e241a9 100644 --- a/src/glean/api_client/errors/__init__.py +++ b/src/glean/api_client/errors/__init__.py @@ -12,6 +12,10 @@ from .gleandataerror import GleanDataError, GleanDataErrorData from .gleanerror import GleanError from .no_response_error import NoResponseError + from .platformproblemdetail_error import ( + PlatformProblemDetailError, + PlatformProblemDetailErrorData, + ) from .responsevalidationerror import ResponseValidationError __all__ = [ @@ -26,6 +30,8 @@ "GleanDataErrorData", "GleanError", "NoResponseError", + "PlatformProblemDetailError", + "PlatformProblemDetailErrorData", "ResponseValidationError", ] @@ -40,6 +46,8 @@ "GleanDataErrorData": ".gleandataerror", "GleanError": ".gleanerror", "NoResponseError": ".no_response_error", + "PlatformProblemDetailError": ".platformproblemdetail_error", + "PlatformProblemDetailErrorData": ".platformproblemdetail_error", "ResponseValidationError": ".responsevalidationerror", } diff --git a/src/glean/api_client/errors/platformproblemdetail_error.py b/src/glean/api_client/errors/platformproblemdetail_error.py new file mode 100644 index 00000000..2bd60f32 --- /dev/null +++ b/src/glean/api_client/errors/platformproblemdetail_error.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from dataclasses import dataclass, field +from glean.api_client.errors import GleanBaseError +from glean.api_client.models import ( + platformproblemdetailcode as models_platformproblemdetailcode, + platformproblemdetailerror as models_platformproblemdetailerror, +) +from glean.api_client.types import BaseModel +import httpx +from typing import List, Optional + + +class PlatformProblemDetailErrorData(BaseModel): + type: str + r"""URI identifying the error type.""" + title: str + r"""Short, human-readable summary of the error.""" + status: int + r"""HTTP status code mirrored from the response.""" + detail: str + r"""Human-readable explanation specific to this occurrence.""" + code: models_platformproblemdetailcode.PlatformProblemDetailCode + r"""Stable machine-readable error code.""" + request_id: str + r"""Platform-generated request ID for support correlation.""" + documentation_url: Optional[str] = None + r"""Direct URL to documentation for this error code.""" + errors: Optional[ + List[models_platformproblemdetailerror.PlatformProblemDetailError] + ] = None + r"""Field-level validation problems, one entry per offending field.""" + + +@dataclass(unsafe_hash=True) +class PlatformProblemDetailError(GleanBaseError): + r"""Error response following RFC 9457, extended with `code` and `documentation_url` for machine-readable classification and self-service remediation.""" + + data: PlatformProblemDetailErrorData = field(hash=False) + + def __init__( + self, + data: PlatformProblemDetailErrorData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/src/glean/api_client/findings.py b/src/glean/api_client/findings.py new file mode 100644 index 00000000..6dce13bd --- /dev/null +++ b/src/glean/api_client/findings.py @@ -0,0 +1,741 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from glean.api_client import errors, models, utils +from glean.api_client._hooks import HookContext +from glean.api_client.types import OptionalNullable, UNSET +from glean.api_client.utils import get_security_from_env +from glean.api_client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Iterable, List, Mapping, Optional, Union + + +class Findings(BaseSDK): + def create( + self, + *, + export_type: Optional[models.DlpExportFindingsRequestExportType] = None, + filter_: Optional[ + Union[models.DlpFindingFilter, models.DlpFindingFilterTypedDict] + ] = None, + issue_filter: Optional[ + Union[models.DlpIssueFilter, models.DlpIssueFilterTypedDict] + ] = None, + file_name: Optional[str] = None, + field_scope: Optional[models.FieldScope] = None, + fields_to_exclude: Optional[Iterable[str]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ExportInfo: + r"""Creates findings export + + Creates a new DLP findings export job. + + :param export_type: The type of export to perform + :param filter_: + :param issue_filter: Filter for DLP issues. Includes document-level filters and issue-specific filters. + :param file_name: The name of the file to export the findings to + :param field_scope: Controls which fields to include in the export + :param fields_to_exclude: List of field names to exclude from the export + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DlpExportFindingsRequest( + export_type=export_type, + filter_=utils.get_pydantic_model( + filter_, Optional[models.DlpFindingFilter] + ), + issue_filter=utils.get_pydantic_model( + issue_filter, Optional[models.DlpIssueFilter] + ), + file_name=file_name, + field_scope=field_scope, + fields_to_exclude=utils.unmarshal(fields_to_exclude, Optional[List[str]]), + ) + + req = self._build_request( + method="POST", + path="/rest/api/v1/governance/data/findings/exports", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.DlpExportFindingsRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createfindingsexport", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Governance"], + extensions={"x-visibility": "Public"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ExportInfo, http_res) + if utils.match_response(http_res, ["403", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, ["500", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def create_async( + self, + *, + export_type: Optional[models.DlpExportFindingsRequestExportType] = None, + filter_: Optional[ + Union[models.DlpFindingFilter, models.DlpFindingFilterTypedDict] + ] = None, + issue_filter: Optional[ + Union[models.DlpIssueFilter, models.DlpIssueFilterTypedDict] + ] = None, + file_name: Optional[str] = None, + field_scope: Optional[models.FieldScope] = None, + fields_to_exclude: Optional[Iterable[str]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ExportInfo: + r"""Creates findings export + + Creates a new DLP findings export job. + + :param export_type: The type of export to perform + :param filter_: + :param issue_filter: Filter for DLP issues. Includes document-level filters and issue-specific filters. + :param file_name: The name of the file to export the findings to + :param field_scope: Controls which fields to include in the export + :param fields_to_exclude: List of field names to exclude from the export + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DlpExportFindingsRequest( + export_type=export_type, + filter_=utils.get_pydantic_model( + filter_, Optional[models.DlpFindingFilter] + ), + issue_filter=utils.get_pydantic_model( + issue_filter, Optional[models.DlpIssueFilter] + ), + file_name=file_name, + field_scope=field_scope, + fields_to_exclude=utils.unmarshal(fields_to_exclude, Optional[List[str]]), + ) + + req = self._build_request_async( + method="POST", + path="/rest/api/v1/governance/data/findings/exports", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.DlpExportFindingsRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createfindingsexport", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Governance"], + extensions={"x-visibility": "Public"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ExportInfo, http_res) + if utils.match_response(http_res, ["403", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, ["500", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def list( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListDlpFindingsExportsResponse: + r"""Lists findings exports + + Lists all DLP findings exports. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( + method="GET", + path="/rest/api/v1/governance/data/findings/exports", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listfindingsexports", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Governance"], + extensions={"x-visibility": "Public"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.ListDlpFindingsExportsResponse, http_res + ) + if utils.match_response(http_res, ["403", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, ["500", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def list_async( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListDlpFindingsExportsResponse: + r"""Lists findings exports + + Lists all DLP findings exports. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( + method="GET", + path="/rest/api/v1/governance/data/findings/exports", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listfindingsexports", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Governance"], + extensions={"x-visibility": "Public"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.ListDlpFindingsExportsResponse, http_res + ) + if utils.match_response(http_res, ["403", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, ["500", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def download( + self, + *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> str: + r"""Downloads findings export + + Downloads a DLP findings export as a CSV file. + + :param id: The ID of the export to download. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DownloadfindingsexportRequest( + id=id, + ) + + req = self._build_request( + method="GET", + path="/rest/api/v1/governance/data/findings/exports/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/csv; charset=UTF-8", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="downloadfindingsexport", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Governance"], + extensions={"x-visibility": "Public"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "text/csv; charset=UTF-8"): + return http_res.text + if utils.match_response(http_res, ["403", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, ["500", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def download_async( + self, + *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> str: + r"""Downloads findings export + + Downloads a DLP findings export as a CSV file. + + :param id: The ID of the export to download. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DownloadfindingsexportRequest( + id=id, + ) + + req = self._build_request_async( + method="GET", + path="/rest/api/v1/governance/data/findings/exports/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/csv; charset=UTF-8", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="downloadfindingsexport", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Governance"], + extensions={"x-visibility": "Public"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "text/csv; charset=UTF-8"): + return http_res.text + if utils.match_response(http_res, ["403", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, ["500", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def delete( + self, + *, + id: int, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Deletes findings export + + Deletes a DLP findings export. + + :param id: The ID of the export to delete. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeletefindingsexportRequest( + id=id, + ) + + req = self._build_request( + method="DELETE", + path="/rest/api/v1/governance/data/findings/exports/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="*/*", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="deletefindingsexport", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Governance"], + extensions={"x-visibility": "Public"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "*"): + return + if utils.match_response(http_res, ["403", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, ["500", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + id: int, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Deletes findings export + + Deletes a DLP findings export. + + :param id: The ID of the export to delete. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeletefindingsexportRequest( + id=id, + ) + + req = self._build_request_async( + method="DELETE", + path="/rest/api/v1/governance/data/findings/exports/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="*/*", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="deletefindingsexport", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Governance"], + extensions={"x-visibility": "Public"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "*"): + return + if utils.match_response(http_res, ["403", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, ["500", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) diff --git a/src/glean/api_client/governance.py b/src/glean/api_client/governance.py index c8e2256e..0917cce6 100644 --- a/src/glean/api_client/governance.py +++ b/src/glean/api_client/governance.py @@ -1,741 +1,25 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK -from glean.api_client import errors, models, utils -from glean.api_client._hooks import HookContext -from glean.api_client.types import OptionalNullable, UNSET -from glean.api_client.utils import get_security_from_env -from glean.api_client.utils.unmarshal_json_response import unmarshal_json_response -from typing import Iterable, List, Mapping, Optional, Union +from .sdkconfiguration import SDKConfiguration +from glean.api_client.data import Data +from glean.api_client.governance_documents import GovernanceDocuments +from typing import Optional class Governance(BaseSDK): - def createfindingsexport( - self, - *, - export_type: Optional[models.DlpExportFindingsRequestExportType] = None, - filter_: Optional[ - Union[models.DlpFindingFilter, models.DlpFindingFilterTypedDict] - ] = None, - issue_filter: Optional[ - Union[models.DlpIssueFilter, models.DlpIssueFilterTypedDict] - ] = None, - file_name: Optional[str] = None, - field_scope: Optional[models.FieldScope] = None, - fields_to_exclude: Optional[Iterable[str]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ExportInfo: - r"""Creates findings export + data: Data + documents: GovernanceDocuments - Creates a new DLP findings export job. + def __init__( + self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None + ) -> None: + BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) + self.sdk_configuration = sdk_config + self._init_sdks() - :param export_type: The type of export to perform - :param filter_: - :param issue_filter: Filter for DLP issues. Includes document-level filters and issue-specific filters. - :param file_name: The name of the file to export the findings to - :param field_scope: Controls which fields to include in the export - :param fields_to_exclude: List of field names to exclude from the export - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.DlpExportFindingsRequest( - export_type=export_type, - filter_=utils.get_pydantic_model( - filter_, Optional[models.DlpFindingFilter] - ), - issue_filter=utils.get_pydantic_model( - issue_filter, Optional[models.DlpIssueFilter] - ), - file_name=file_name, - field_scope=field_scope, - fields_to_exclude=utils.unmarshal(fields_to_exclude, Optional[List[str]]), - ) - - req = self._build_request( - method="POST", - path="/rest/api/v1/governance/data/findings/exports", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.DlpExportFindingsRequest - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="createfindingsexport", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Governance"], - extensions={"x-visibility": "Public"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ExportInfo, http_res) - if utils.match_response(http_res, ["403", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, ["500", "5XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - async def createfindingsexport_async( - self, - *, - export_type: Optional[models.DlpExportFindingsRequestExportType] = None, - filter_: Optional[ - Union[models.DlpFindingFilter, models.DlpFindingFilterTypedDict] - ] = None, - issue_filter: Optional[ - Union[models.DlpIssueFilter, models.DlpIssueFilterTypedDict] - ] = None, - file_name: Optional[str] = None, - field_scope: Optional[models.FieldScope] = None, - fields_to_exclude: Optional[Iterable[str]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ExportInfo: - r"""Creates findings export - - Creates a new DLP findings export job. - - :param export_type: The type of export to perform - :param filter_: - :param issue_filter: Filter for DLP issues. Includes document-level filters and issue-specific filters. - :param file_name: The name of the file to export the findings to - :param field_scope: Controls which fields to include in the export - :param fields_to_exclude: List of field names to exclude from the export - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.DlpExportFindingsRequest( - export_type=export_type, - filter_=utils.get_pydantic_model( - filter_, Optional[models.DlpFindingFilter] - ), - issue_filter=utils.get_pydantic_model( - issue_filter, Optional[models.DlpIssueFilter] - ), - file_name=file_name, - field_scope=field_scope, - fields_to_exclude=utils.unmarshal(fields_to_exclude, Optional[List[str]]), - ) - - req = self._build_request_async( - method="POST", - path="/rest/api/v1/governance/data/findings/exports", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.DlpExportFindingsRequest - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="createfindingsexport", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Governance"], - extensions={"x-visibility": "Public"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ExportInfo, http_res) - if utils.match_response(http_res, ["403", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, ["500", "5XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - def listfindingsexports( - self, - *, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ListDlpFindingsExportsResponse: - r"""Lists findings exports - - Lists all DLP findings exports. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - req = self._build_request( - method="GET", - path="/rest/api/v1/governance/data/findings/exports", - base_url=base_url, - url_variables=url_variables, - request=None, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="listfindingsexports", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Governance"], - extensions={"x-visibility": "Public"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response( - models.ListDlpFindingsExportsResponse, http_res - ) - if utils.match_response(http_res, ["403", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, ["500", "5XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - async def listfindingsexports_async( - self, - *, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ListDlpFindingsExportsResponse: - r"""Lists findings exports - - Lists all DLP findings exports. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - req = self._build_request_async( - method="GET", - path="/rest/api/v1/governance/data/findings/exports", - base_url=base_url, - url_variables=url_variables, - request=None, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="listfindingsexports", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Governance"], - extensions={"x-visibility": "Public"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response( - models.ListDlpFindingsExportsResponse, http_res - ) - if utils.match_response(http_res, ["403", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, ["500", "5XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - def downloadfindingsexport( - self, - *, - id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> str: - r"""Downloads findings export - - Downloads a DLP findings export as a CSV file. - - :param id: The ID of the export to download. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.DownloadfindingsexportRequest( - id=id, - ) - - req = self._build_request( - method="GET", - path="/rest/api/v1/governance/data/findings/exports/{id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/csv; charset=UTF-8", - http_headers=http_headers, - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="downloadfindingsexport", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Governance"], - extensions={"x-visibility": "Public"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "text/csv; charset=UTF-8"): - return http_res.text - if utils.match_response(http_res, ["403", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, ["500", "5XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - async def downloadfindingsexport_async( - self, - *, - id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> str: - r"""Downloads findings export - - Downloads a DLP findings export as a CSV file. - - :param id: The ID of the export to download. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.DownloadfindingsexportRequest( - id=id, - ) - - req = self._build_request_async( - method="GET", - path="/rest/api/v1/governance/data/findings/exports/{id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/csv; charset=UTF-8", - http_headers=http_headers, - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, + def _init_sdks(self): + self.data = Data(self.sdk_configuration, parent_ref=self.parent_ref) + self.documents = GovernanceDocuments( + self.sdk_configuration, parent_ref=self.parent_ref ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="downloadfindingsexport", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Governance"], - extensions={"x-visibility": "Public"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "text/csv; charset=UTF-8"): - return http_res.text - if utils.match_response(http_res, ["403", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, ["500", "5XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - def deletefindingsexport( - self, - *, - id: int, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ): - r"""Deletes findings export - - Deletes a DLP findings export. - - :param id: The ID of the export to delete. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.DeletefindingsexportRequest( - id=id, - ) - - req = self._build_request( - method="DELETE", - path="/rest/api/v1/governance/data/findings/exports/{id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="*/*", - http_headers=http_headers, - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="deletefindingsexport", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Governance"], - extensions={"x-visibility": "Public"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "*"): - return - if utils.match_response(http_res, ["403", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, ["500", "5XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - async def deletefindingsexport_async( - self, - *, - id: int, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ): - r"""Deletes findings export - - Deletes a DLP findings export. - - :param id: The ID of the export to delete. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.DeletefindingsexportRequest( - id=id, - ) - - req = self._build_request_async( - method="DELETE", - path="/rest/api/v1/governance/data/findings/exports/{id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="*/*", - http_headers=http_headers, - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="deletefindingsexport", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Governance"], - extensions={"x-visibility": "Public"}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "*"): - return - if utils.match_response(http_res, ["403", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, ["500", "5XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) diff --git a/src/glean/api_client/indexing_documents.py b/src/glean/api_client/indexing_documents.py index 8677ab51..e296949f 100644 --- a/src/glean/api_client/indexing_documents.py +++ b/src/glean/api_client/indexing_documents.py @@ -2078,3 +2078,223 @@ async def count_async( raise errors.GleanError("API error occurred", http_res, http_res_text) raise errors.GleanError("Unexpected response received", http_res) + + def debug_events( + self, + *, + datasource: str, + object_type: str, + doc_id: str, + start_date: Optional[str] = None, + max_events: Optional[int] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DebugDocumentLifecycleResponse: + r"""Beta: Get document lifecycle events + + Retrieves lifecycle events for a specific document including upload time, index times and deletions. Rate limited to 1 request per minute per datasource. Currently in beta, might undergo breaking changes without prior notice. + + + :param datasource: The datasource to which the document belongs + :param object_type: Object type of the document to get lifecycle events for. + :param doc_id: Glean Document ID within the datasource to get lifecycle events for. + :param start_date: The start date for events to be fetched. Cannot be more than 30 days (default 7 days) in the past. + :param max_events: Max number of events to be fetched. Cannot be more than 100 (default 20). + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PostAPIIndexV1DebugDatasourceDocumentEventsRequest( + datasource=datasource, + debug_document_lifecycle_request=models.DebugDocumentLifecycleRequest( + object_type=object_type, + doc_id=doc_id, + start_date=start_date, + max_events=max_events, + ), + ) + + req = self._build_request( + method="POST", + path="/api/index/v1/debug/{datasource}/document/events", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json; charset=UTF-8", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.debug_document_lifecycle_request, + False, + False, + "json", + models.DebugDocumentLifecycleRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="post_/api/index/v1/debug/{datasource}/document/events", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Troubleshooting"], + extensions={"x-beta": True}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json; charset=UTF-8"): + return unmarshal_json_response( + models.DebugDocumentLifecycleResponse, http_res + ) + if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def debug_events_async( + self, + *, + datasource: str, + object_type: str, + doc_id: str, + start_date: Optional[str] = None, + max_events: Optional[int] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DebugDocumentLifecycleResponse: + r"""Beta: Get document lifecycle events + + Retrieves lifecycle events for a specific document including upload time, index times and deletions. Rate limited to 1 request per minute per datasource. Currently in beta, might undergo breaking changes without prior notice. + + + :param datasource: The datasource to which the document belongs + :param object_type: Object type of the document to get lifecycle events for. + :param doc_id: Glean Document ID within the datasource to get lifecycle events for. + :param start_date: The start date for events to be fetched. Cannot be more than 30 days (default 7 days) in the past. + :param max_events: Max number of events to be fetched. Cannot be more than 100 (default 20). + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PostAPIIndexV1DebugDatasourceDocumentEventsRequest( + datasource=datasource, + debug_document_lifecycle_request=models.DebugDocumentLifecycleRequest( + object_type=object_type, + doc_id=doc_id, + start_date=start_date, + max_events=max_events, + ), + ) + + req = self._build_request_async( + method="POST", + path="/api/index/v1/debug/{datasource}/document/events", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json; charset=UTF-8", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.debug_document_lifecycle_request, + False, + False, + "json", + models.DebugDocumentLifecycleRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="post_/api/index/v1/debug/{datasource}/document/events", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Troubleshooting"], + extensions={"x-beta": True}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json; charset=UTF-8"): + return unmarshal_json_response( + models.DebugDocumentLifecycleResponse, http_res + ) + if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) diff --git a/src/glean/api_client/models/__init__.py b/src/glean/api_client/models/__init__.py index 6292b575..4338fc86 100644 --- a/src/glean/api_client/models/__init__.py +++ b/src/glean/api_client/models/__init__.py @@ -1199,6 +1199,83 @@ from .peruserinsight import PerUserInsight, PerUserInsightTypedDict from .pinop import PinRequestRequest, PinRequestRequestTypedDict from .pinrequest import PinRequest, PinRequestTypedDict + from .platform_agents_create_runop import ( + PlatformAgentsCreateRunRequest, + PlatformAgentsCreateRunRequestTypedDict, + PlatformAgentsCreateRunResponse, + PlatformAgentsCreateRunResponseTypedDict, + ) + from .platform_agents_get_schemasop import ( + PlatformAgentsGetSchemasRequest, + PlatformAgentsGetSchemasRequestTypedDict, + ) + from .platform_agents_getop import ( + PlatformAgentsGetRequest, + PlatformAgentsGetRequestTypedDict, + ) + from .platformactionsummary import ( + PlatformActionSummary, + PlatformActionSummaryTypedDict, + ) + from .platformagent import PlatformAgent, PlatformAgentTypedDict + from .platformagentcapabilities import ( + PlatformAgentCapabilities, + PlatformAgentCapabilitiesTypedDict, + ) + from .platformagentexecutionstatus import PlatformAgentExecutionStatus + from .platformagentgetresponse import ( + PlatformAgentGetResponse, + PlatformAgentGetResponseTypedDict, + ) + from .platformagentrun import PlatformAgentRun, PlatformAgentRunTypedDict + from .platformagentruncreaterequest import ( + PlatformAgentRunCreateRequest, + PlatformAgentRunCreateRequestTypedDict, + ) + from .platformagentrunwaitresponse import ( + PlatformAgentRunWaitResponse, + PlatformAgentRunWaitResponseTypedDict, + ) + from .platformagentschemasresponse import ( + PlatformAgentSchemasResponse, + PlatformAgentSchemasResponseTypedDict, + ) + from .platformagentssearchrequest import ( + PlatformAgentsSearchRequest, + PlatformAgentsSearchRequestTypedDict, + ) + from .platformagentssearchresponse import ( + PlatformAgentsSearchResponse, + PlatformAgentsSearchResponseTypedDict, + ) + from .platformcontenttype import PlatformContentType + from .platformfilter import PlatformFilter, PlatformFilterTypedDict + from .platformfilteroperator import PlatformFilterOperator + from .platformmessage import PlatformMessage, PlatformMessageTypedDict + from .platformmessagerole import PlatformMessageRole + from .platformmessagetextblock import ( + PlatformMessageTextBlock, + PlatformMessageTextBlockTypedDict, + ) + from .platformpersonreference import ( + PlatformPersonReference, + PlatformPersonReferenceTypedDict, + ) + from .platformproblemdetailcode import PlatformProblemDetailCode + from .platformproblemdetailerror import ( + PlatformProblemDetailError, + PlatformProblemDetailErrorTypedDict, + ) + from .platformresult import PlatformResult, PlatformResultTypedDict + from .platformsearchrequest import ( + PlatformSearchRequest, + PlatformSearchRequestTypedDict, + ) + from .platformsearchresponse import ( + PlatformSearchResponse, + PlatformSearchResponseTypedDict, + ) + from .platformtimerange import PlatformTimeRange, PlatformTimeRangeTypedDict from .possiblevalue import PossibleValue, PossibleValueTypedDict from .post_api_index_v1_debug_datasource_document_eventsop import ( PostAPIIndexV1DebugDatasourceDocumentEventsRequest, @@ -2494,6 +2571,57 @@ "PinRequestRequestTypedDict", "PinRequestTypedDict", "PlacementReason", + "PlatformActionSummary", + "PlatformActionSummaryTypedDict", + "PlatformAgent", + "PlatformAgentCapabilities", + "PlatformAgentCapabilitiesTypedDict", + "PlatformAgentExecutionStatus", + "PlatformAgentGetResponse", + "PlatformAgentGetResponseTypedDict", + "PlatformAgentRun", + "PlatformAgentRunCreateRequest", + "PlatformAgentRunCreateRequestTypedDict", + "PlatformAgentRunTypedDict", + "PlatformAgentRunWaitResponse", + "PlatformAgentRunWaitResponseTypedDict", + "PlatformAgentSchemasResponse", + "PlatformAgentSchemasResponseTypedDict", + "PlatformAgentTypedDict", + "PlatformAgentsCreateRunRequest", + "PlatformAgentsCreateRunRequestTypedDict", + "PlatformAgentsCreateRunResponse", + "PlatformAgentsCreateRunResponseTypedDict", + "PlatformAgentsGetRequest", + "PlatformAgentsGetRequestTypedDict", + "PlatformAgentsGetSchemasRequest", + "PlatformAgentsGetSchemasRequestTypedDict", + "PlatformAgentsSearchRequest", + "PlatformAgentsSearchRequestTypedDict", + "PlatformAgentsSearchResponse", + "PlatformAgentsSearchResponseTypedDict", + "PlatformContentType", + "PlatformFilter", + "PlatformFilterOperator", + "PlatformFilterTypedDict", + "PlatformMessage", + "PlatformMessageRole", + "PlatformMessageTextBlock", + "PlatformMessageTextBlockTypedDict", + "PlatformMessageTypedDict", + "PlatformPersonReference", + "PlatformPersonReferenceTypedDict", + "PlatformProblemDetailCode", + "PlatformProblemDetailError", + "PlatformProblemDetailErrorTypedDict", + "PlatformResult", + "PlatformResultTypedDict", + "PlatformSearchRequest", + "PlatformSearchRequestTypedDict", + "PlatformSearchResponse", + "PlatformSearchResponseTypedDict", + "PlatformTimeRange", + "PlatformTimeRangeTypedDict", "PossibleValue", "PossibleValueTypedDict", "PostAPIIndexV1DebugDatasourceDocumentEventsRequest", @@ -3682,6 +3810,57 @@ "PinRequestRequestTypedDict": ".pinop", "PinRequest": ".pinrequest", "PinRequestTypedDict": ".pinrequest", + "PlatformAgentsCreateRunRequest": ".platform_agents_create_runop", + "PlatformAgentsCreateRunRequestTypedDict": ".platform_agents_create_runop", + "PlatformAgentsCreateRunResponse": ".platform_agents_create_runop", + "PlatformAgentsCreateRunResponseTypedDict": ".platform_agents_create_runop", + "PlatformAgentsGetSchemasRequest": ".platform_agents_get_schemasop", + "PlatformAgentsGetSchemasRequestTypedDict": ".platform_agents_get_schemasop", + "PlatformAgentsGetRequest": ".platform_agents_getop", + "PlatformAgentsGetRequestTypedDict": ".platform_agents_getop", + "PlatformActionSummary": ".platformactionsummary", + "PlatformActionSummaryTypedDict": ".platformactionsummary", + "PlatformAgent": ".platformagent", + "PlatformAgentTypedDict": ".platformagent", + "PlatformAgentCapabilities": ".platformagentcapabilities", + "PlatformAgentCapabilitiesTypedDict": ".platformagentcapabilities", + "PlatformAgentExecutionStatus": ".platformagentexecutionstatus", + "PlatformAgentGetResponse": ".platformagentgetresponse", + "PlatformAgentGetResponseTypedDict": ".platformagentgetresponse", + "PlatformAgentRun": ".platformagentrun", + "PlatformAgentRunTypedDict": ".platformagentrun", + "PlatformAgentRunCreateRequest": ".platformagentruncreaterequest", + "PlatformAgentRunCreateRequestTypedDict": ".platformagentruncreaterequest", + "PlatformAgentRunWaitResponse": ".platformagentrunwaitresponse", + "PlatformAgentRunWaitResponseTypedDict": ".platformagentrunwaitresponse", + "PlatformAgentSchemasResponse": ".platformagentschemasresponse", + "PlatformAgentSchemasResponseTypedDict": ".platformagentschemasresponse", + "PlatformAgentsSearchRequest": ".platformagentssearchrequest", + "PlatformAgentsSearchRequestTypedDict": ".platformagentssearchrequest", + "PlatformAgentsSearchResponse": ".platformagentssearchresponse", + "PlatformAgentsSearchResponseTypedDict": ".platformagentssearchresponse", + "PlatformContentType": ".platformcontenttype", + "PlatformFilter": ".platformfilter", + "PlatformFilterTypedDict": ".platformfilter", + "PlatformFilterOperator": ".platformfilteroperator", + "PlatformMessage": ".platformmessage", + "PlatformMessageTypedDict": ".platformmessage", + "PlatformMessageRole": ".platformmessagerole", + "PlatformMessageTextBlock": ".platformmessagetextblock", + "PlatformMessageTextBlockTypedDict": ".platformmessagetextblock", + "PlatformPersonReference": ".platformpersonreference", + "PlatformPersonReferenceTypedDict": ".platformpersonreference", + "PlatformProblemDetailCode": ".platformproblemdetailcode", + "PlatformProblemDetailError": ".platformproblemdetailerror", + "PlatformProblemDetailErrorTypedDict": ".platformproblemdetailerror", + "PlatformResult": ".platformresult", + "PlatformResultTypedDict": ".platformresult", + "PlatformSearchRequest": ".platformsearchrequest", + "PlatformSearchRequestTypedDict": ".platformsearchrequest", + "PlatformSearchResponse": ".platformsearchresponse", + "PlatformSearchResponseTypedDict": ".platformsearchresponse", + "PlatformTimeRange": ".platformtimerange", + "PlatformTimeRangeTypedDict": ".platformtimerange", "PossibleValue": ".possiblevalue", "PossibleValueTypedDict": ".possiblevalue", "PostAPIIndexV1DebugDatasourceDocumentEventsRequest": ".post_api_index_v1_debug_datasource_document_eventsop", diff --git a/src/glean/api_client/models/platform_agents_create_runop.py b/src/glean/api_client/models/platform_agents_create_runop.py new file mode 100644 index 00000000..e99e8d10 --- /dev/null +++ b/src/glean/api_client/models/platform_agents_create_runop.py @@ -0,0 +1,44 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformagentruncreaterequest import ( + PlatformAgentRunCreateRequest, + PlatformAgentRunCreateRequestTypedDict, +) +from .platformagentrunwaitresponse import ( + PlatformAgentRunWaitResponse, + PlatformAgentRunWaitResponseTypedDict, +) +from glean.api_client.types import BaseModel +from glean.api_client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing import Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +class PlatformAgentsCreateRunRequestTypedDict(TypedDict): + agent_id: str + r"""ID of the agent to run.""" + platform_agent_run_create_request: PlatformAgentRunCreateRequestTypedDict + + +class PlatformAgentsCreateRunRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the agent to run.""" + + platform_agent_run_create_request: Annotated[ + PlatformAgentRunCreateRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + +PlatformAgentsCreateRunResponseTypedDict = TypeAliasType( + "PlatformAgentsCreateRunResponseTypedDict", + Union[PlatformAgentRunWaitResponseTypedDict, str], +) + + +PlatformAgentsCreateRunResponse = TypeAliasType( + "PlatformAgentsCreateRunResponse", Union[PlatformAgentRunWaitResponse, str] +) diff --git a/src/glean/api_client/models/platform_agents_get_schemasop.py b/src/glean/api_client/models/platform_agents_get_schemasop.py new file mode 100644 index 00000000..dbe9a036 --- /dev/null +++ b/src/glean/api_client/models/platform_agents_get_schemasop.py @@ -0,0 +1,44 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from glean.api_client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PlatformAgentsGetSchemasRequestTypedDict(TypedDict): + agent_id: str + r"""ID of the agent whose schemas should be retrieved.""" + include_tools: NotRequired[bool] + r"""Whether to include tool metadata in the response.""" + + +class PlatformAgentsGetSchemasRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the agent whose schemas should be retrieved.""" + + include_tools: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Whether to include tool metadata in the response.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["include_tools"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platform_agents_getop.py b/src/glean/api_client/models/platform_agents_getop.py new file mode 100644 index 00000000..880c65c1 --- /dev/null +++ b/src/glean/api_client/models/platform_agents_getop.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from glean.api_client.types import BaseModel +from glean.api_client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class PlatformAgentsGetRequestTypedDict(TypedDict): + agent_id: str + r"""ID of the agent to retrieve.""" + + +class PlatformAgentsGetRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the agent to retrieve.""" diff --git a/src/glean/api_client/models/platformactionsummary.py b/src/glean/api_client/models/platformactionsummary.py new file mode 100644 index 00000000..66c767a0 --- /dev/null +++ b/src/glean/api_client/models/platformactionsummary.py @@ -0,0 +1,71 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformActionSummaryTypedDict(TypedDict): + tool_id: str + r"""Unique identifier of the action.""" + display_name: str + r"""Display name of the action.""" + type: NotRequired[str] + r"""Tool type.""" + auth_type: NotRequired[str] + r"""Authentication type required by the action.""" + write_action_type: NotRequired[str] + r"""Write-action execution type.""" + is_setup_finished: NotRequired[bool] + r"""Whether this action has been fully configured.""" + data_source: NotRequired[str] + r"""Kind of knowledge the action accesses or modifies.""" + + +class PlatformActionSummary(BaseModel): + tool_id: str + r"""Unique identifier of the action.""" + + display_name: str + r"""Display name of the action.""" + + type: Optional[str] = None + r"""Tool type.""" + + auth_type: Optional[str] = None + r"""Authentication type required by the action.""" + + write_action_type: Optional[str] = None + r"""Write-action execution type.""" + + is_setup_finished: Optional[bool] = None + r"""Whether this action has been fully configured.""" + + data_source: Optional[str] = None + r"""Kind of knowledge the action accesses or modifies.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "type", + "auth_type", + "write_action_type", + "is_setup_finished", + "data_source", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformagent.py b/src/glean/api_client/models/platformagent.py new file mode 100644 index 00000000..84a399b6 --- /dev/null +++ b/src/glean/api_client/models/platformagent.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformagentcapabilities import ( + PlatformAgentCapabilities, + PlatformAgentCapabilitiesTypedDict, +) +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformAgentTypedDict(TypedDict): + agent_id: str + r"""ID of the agent.""" + name: str + r"""Name of the agent.""" + capabilities: PlatformAgentCapabilitiesTypedDict + description: NotRequired[str] + r"""Description of the agent.""" + metadata: NotRequired[Dict[str, Any]] + r"""Agent metadata.""" + + +class PlatformAgent(BaseModel): + agent_id: str + r"""ID of the agent.""" + + name: str + r"""Name of the agent.""" + + capabilities: PlatformAgentCapabilities + + description: Optional[str] = None + r"""Description of the agent.""" + + metadata: Optional[Dict[str, Any]] = None + r"""Agent metadata.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description", "metadata"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformagentcapabilities.py b/src/glean/api_client/models/platformagentcapabilities.py new file mode 100644 index 00000000..099c35b7 --- /dev/null +++ b/src/glean/api_client/models/platformagentcapabilities.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from glean.api_client.types import BaseModel, UNSET_SENTINEL +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PlatformAgentCapabilitiesTypedDict(TypedDict): + ap_io_messages: NotRequired[bool] + r"""Whether the agent supports messages as input.""" + ap_io_streaming: NotRequired[bool] + r"""Whether the agent supports streaming output.""" + + +class PlatformAgentCapabilities(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + ap_io_messages: Annotated[ + Optional[bool], pydantic.Field(alias="ap.io.messages") + ] = None + r"""Whether the agent supports messages as input.""" + + ap_io_streaming: Annotated[ + Optional[bool], pydantic.Field(alias="ap.io.streaming") + ] = None + r"""Whether the agent supports streaming output.""" + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["ap.io.messages", "ap.io.streaming"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + PlatformAgentCapabilities.model_rebuild() +except NameError: + pass diff --git a/src/glean/api_client/models/platformagentexecutionstatus.py b/src/glean/api_client/models/platformagentexecutionstatus.py new file mode 100644 index 00000000..cab8cafc --- /dev/null +++ b/src/glean/api_client/models/platformagentexecutionstatus.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from glean.api_client import utils + + +class PlatformAgentExecutionStatus(str, Enum, metaclass=utils.OpenEnumMeta): + r"""Status of the agent run.""" + + ERROR = "error" + SUCCESS = "success" diff --git a/src/glean/api_client/models/platformagentgetresponse.py b/src/glean/api_client/models/platformagentgetresponse.py new file mode 100644 index 00000000..dff40930 --- /dev/null +++ b/src/glean/api_client/models/platformagentgetresponse.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformagent import PlatformAgent, PlatformAgentTypedDict +from glean.api_client.types import BaseModel +from typing_extensions import TypedDict + + +class PlatformAgentGetResponseTypedDict(TypedDict): + agent: PlatformAgentTypedDict + request_id: str + r"""Platform-generated request ID for support correlation.""" + + +class PlatformAgentGetResponse(BaseModel): + agent: PlatformAgent + + request_id: str + r"""Platform-generated request ID for support correlation.""" diff --git a/src/glean/api_client/models/platformagentrun.py b/src/glean/api_client/models/platformagentrun.py new file mode 100644 index 00000000..26bf4003 --- /dev/null +++ b/src/glean/api_client/models/platformagentrun.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformagentexecutionstatus import PlatformAgentExecutionStatus +from .platformmessage import PlatformMessage, PlatformMessageTypedDict +from glean.api_client import models +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import field_serializer, model_serializer +from typing import Any, Dict, List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformAgentRunTypedDict(TypedDict): + agent_id: str + r"""ID of the agent being run.""" + status: PlatformAgentExecutionStatus + r"""Status of the agent run.""" + input: NotRequired[Dict[str, Any]] + r"""Input fields for an input-form triggered agent.""" + messages: NotRequired[List[PlatformMessageTypedDict]] + r"""Messages passed to the agent.""" + metadata: NotRequired[Dict[str, Any]] + r"""Metadata passed to the agent.""" + + +class PlatformAgentRun(BaseModel): + agent_id: str + r"""ID of the agent being run.""" + + status: PlatformAgentExecutionStatus + r"""Status of the agent run.""" + + input: Optional[Dict[str, Any]] = None + r"""Input fields for an input-form triggered agent.""" + + messages: Optional[List[PlatformMessage]] = None + r"""Messages passed to the agent.""" + + metadata: Optional[Dict[str, Any]] = None + r"""Metadata passed to the agent.""" + + @field_serializer("status") + def serialize_status(self, value): + if isinstance(value, str): + try: + return models.PlatformAgentExecutionStatus(value) + except ValueError: + return value + return value + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["input", "messages", "metadata"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformagentruncreaterequest.py b/src/glean/api_client/models/platformagentruncreaterequest.py new file mode 100644 index 00000000..8d669029 --- /dev/null +++ b/src/glean/api_client/models/platformagentruncreaterequest.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformmessage import PlatformMessage, PlatformMessageTypedDict +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, Dict, List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformAgentRunCreateRequestTypedDict(TypedDict): + r"""Request to run an agent. A request MUST supply either `messages` (a non-empty conversation) or `input` (for input-form triggered agents).""" + + input: NotRequired[Dict[str, Any]] + r"""Input fields for an input-form triggered agent.""" + messages: NotRequired[List[PlatformMessageTypedDict]] + r"""Messages to pass to the agent. When provided, the array MUST contain at least one message and each message MUST specify a valid `role` and non-empty `content`. + + """ + metadata: NotRequired[Dict[str, Any]] + r"""Metadata to pass to the agent.""" + stream: NotRequired[bool] + r"""Whether to stream the run response as server-sent events.""" + + +class PlatformAgentRunCreateRequest(BaseModel): + r"""Request to run an agent. A request MUST supply either `messages` (a non-empty conversation) or `input` (for input-form triggered agents).""" + + input: Optional[Dict[str, Any]] = None + r"""Input fields for an input-form triggered agent.""" + + messages: Optional[List[PlatformMessage]] = None + r"""Messages to pass to the agent. When provided, the array MUST contain at least one message and each message MUST specify a valid `role` and non-empty `content`. + + """ + + metadata: Optional[Dict[str, Any]] = None + r"""Metadata to pass to the agent.""" + + stream: Optional[bool] = False + r"""Whether to stream the run response as server-sent events.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["input", "messages", "metadata", "stream"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformagentrunwaitresponse.py b/src/glean/api_client/models/platformagentrunwaitresponse.py new file mode 100644 index 00000000..f2454eb0 --- /dev/null +++ b/src/glean/api_client/models/platformagentrunwaitresponse.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformagentrun import PlatformAgentRun, PlatformAgentRunTypedDict +from .platformmessage import PlatformMessage, PlatformMessageTypedDict +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformAgentRunWaitResponseTypedDict(TypedDict): + request_id: str + r"""Platform-generated request ID for support correlation.""" + run: NotRequired[PlatformAgentRunTypedDict] + messages: NotRequired[List[PlatformMessageTypedDict]] + r"""Messages returned by the completed run.""" + + +class PlatformAgentRunWaitResponse(BaseModel): + request_id: str + r"""Platform-generated request ID for support correlation.""" + + run: Optional[PlatformAgentRun] = None + + messages: Optional[List[PlatformMessage]] = None + r"""Messages returned by the completed run.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["run", "messages"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformagentschemasresponse.py b/src/glean/api_client/models/platformagentschemasresponse.py new file mode 100644 index 00000000..9bd08605 --- /dev/null +++ b/src/glean/api_client/models/platformagentschemasresponse.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformactionsummary import PlatformActionSummary, PlatformActionSummaryTypedDict +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, Dict, List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformAgentSchemasResponseTypedDict(TypedDict): + agent_id: str + r"""ID of the agent.""" + input_schema: Dict[str, Any] + r"""Agent input schema in JSON Schema format.""" + output_schema: Dict[str, Any] + r"""Agent output schema in JSON Schema format.""" + request_id: str + r"""Platform-generated request ID for support correlation.""" + name: NotRequired[str] + r"""Name of the agent.""" + tools: NotRequired[List[PlatformActionSummaryTypedDict]] + r"""Tools that the agent can invoke, when requested.""" + + +class PlatformAgentSchemasResponse(BaseModel): + agent_id: str + r"""ID of the agent.""" + + input_schema: Dict[str, Any] + r"""Agent input schema in JSON Schema format.""" + + output_schema: Dict[str, Any] + r"""Agent output schema in JSON Schema format.""" + + request_id: str + r"""Platform-generated request ID for support correlation.""" + + name: Optional[str] = None + r"""Name of the agent.""" + + tools: Optional[List[PlatformActionSummary]] = None + r"""Tools that the agent can invoke, when requested.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["name", "tools"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformagentssearchrequest.py b/src/glean/api_client/models/platformagentssearchrequest.py new file mode 100644 index 00000000..0ddc45d2 --- /dev/null +++ b/src/glean/api_client/models/platformagentssearchrequest.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformAgentsSearchRequestTypedDict(TypedDict): + name: NotRequired[str] + r"""Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied.""" + + +class PlatformAgentsSearchRequest(BaseModel): + name: Optional[str] = None + r"""Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["name"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformagentssearchresponse.py b/src/glean/api_client/models/platformagentssearchresponse.py new file mode 100644 index 00000000..c9f820b8 --- /dev/null +++ b/src/glean/api_client/models/platformagentssearchresponse.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformagent import PlatformAgent, PlatformAgentTypedDict +from glean.api_client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class PlatformAgentsSearchResponseTypedDict(TypedDict): + agents: List[PlatformAgentTypedDict] + r"""Agents matching the search request.""" + request_id: str + r"""Platform-generated request ID for support correlation.""" + + +class PlatformAgentsSearchResponse(BaseModel): + agents: List[PlatformAgent] + r"""Agents matching the search request.""" + + request_id: str + r"""Platform-generated request ID for support correlation.""" diff --git a/src/glean/api_client/models/platformcontenttype.py b/src/glean/api_client/models/platformcontenttype.py new file mode 100644 index 00000000..c327d0ce --- /dev/null +++ b/src/glean/api_client/models/platformcontenttype.py @@ -0,0 +1,8 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PlatformContentType(str, Enum): + TEXT = "text" diff --git a/src/glean/api_client/models/platformfilter.py b/src/glean/api_client/models/platformfilter.py new file mode 100644 index 00000000..40c1e357 --- /dev/null +++ b/src/glean/api_client/models/platformfilter.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformfilteroperator import PlatformFilterOperator +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformFilterTypedDict(TypedDict): + r"""A single filter criterion. For `EQUALS`, multiple values within a filter are OR'd. For `NOT_EQUALS`, multiple values exclude all listed values. Filters are AND'd with each other and with any inline query operators.""" + + field: str + r"""The field to filter on. Accepts built-in filter field names such as `type`, `owner`, `from`, `author`, `channel`, `status`, `assignee`, `reporter`, `component`, `mentions`, and `collection`, plus custom datasource property names. + + """ + values: List[str] + r"""One or more values to match.""" + operator: NotRequired[PlatformFilterOperator] + r"""Comparison operator to apply to this filter. Defaults to `EQUALS`. `GT`, `GTE`, `LT`, and `LTE` range operators require exactly one value; express bounded ranges with multiple filters on the same field. + + """ + + +class PlatformFilter(BaseModel): + r"""A single filter criterion. For `EQUALS`, multiple values within a filter are OR'd. For `NOT_EQUALS`, multiple values exclude all listed values. Filters are AND'd with each other and with any inline query operators.""" + + field: str + r"""The field to filter on. Accepts built-in filter field names such as `type`, `owner`, `from`, `author`, `channel`, `status`, `assignee`, `reporter`, `component`, `mentions`, and `collection`, plus custom datasource property names. + + """ + + values: List[str] + r"""One or more values to match.""" + + operator: Optional[PlatformFilterOperator] = None + r"""Comparison operator to apply to this filter. Defaults to `EQUALS`. `GT`, `GTE`, `LT`, and `LTE` range operators require exactly one value; express bounded ranges with multiple filters on the same field. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["operator"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformfilteroperator.py b/src/glean/api_client/models/platformfilteroperator.py new file mode 100644 index 00000000..1ac40ef8 --- /dev/null +++ b/src/glean/api_client/models/platformfilteroperator.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PlatformFilterOperator(str, Enum): + r"""Supported filter operator.""" + + EQUALS = "EQUALS" + NOT_EQUALS = "NOT_EQUALS" + GT = "GT" + GTE = "GTE" + LT = "LT" + LTE = "LTE" diff --git a/src/glean/api_client/models/platformmessage.py b/src/glean/api_client/models/platformmessage.py new file mode 100644 index 00000000..7be2c4dc --- /dev/null +++ b/src/glean/api_client/models/platformmessage.py @@ -0,0 +1,37 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformmessagerole import PlatformMessageRole +from .platformmessagetextblock import ( + PlatformMessageTextBlock, + PlatformMessageTextBlockTypedDict, +) +from glean.api_client import models +from glean.api_client.types import BaseModel +from pydantic import field_serializer +from typing import List +from typing_extensions import TypedDict + + +class PlatformMessageTypedDict(TypedDict): + role: PlatformMessageRole + r"""Role of the message author.""" + content: List[PlatformMessageTextBlockTypedDict] + r"""Content blocks in the message.""" + + +class PlatformMessage(BaseModel): + role: PlatformMessageRole + r"""Role of the message author.""" + + content: List[PlatformMessageTextBlock] + r"""Content blocks in the message.""" + + @field_serializer("role") + def serialize_role(self, value): + if isinstance(value, str): + try: + return models.PlatformMessageRole(value) + except ValueError: + return value + return value diff --git a/src/glean/api_client/models/platformmessagerole.py b/src/glean/api_client/models/platformmessagerole.py new file mode 100644 index 00000000..9d7939bd --- /dev/null +++ b/src/glean/api_client/models/platformmessagerole.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from glean.api_client import utils + + +class PlatformMessageRole(str, Enum, metaclass=utils.OpenEnumMeta): + r"""Role of the message author.""" + + USER = "USER" + GLEAN_AI = "GLEAN_AI" diff --git a/src/glean/api_client/models/platformmessagetextblock.py b/src/glean/api_client/models/platformmessagetextblock.py new file mode 100644 index 00000000..35266bb6 --- /dev/null +++ b/src/glean/api_client/models/platformmessagetextblock.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformcontenttype import PlatformContentType +from glean.api_client.types import BaseModel +from typing_extensions import TypedDict + + +class PlatformMessageTextBlockTypedDict(TypedDict): + text: str + r"""Text content.""" + type: PlatformContentType + + +class PlatformMessageTextBlock(BaseModel): + text: str + r"""Text content.""" + + type: PlatformContentType diff --git a/src/glean/api_client/models/platformpersonreference.py b/src/glean/api_client/models/platformpersonreference.py new file mode 100644 index 00000000..3f687979 --- /dev/null +++ b/src/glean/api_client/models/platformpersonreference.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformPersonReferenceTypedDict(TypedDict): + r"""A lightweight reference to a person, used where a payload merely points at someone.""" + + name: str + r"""Display name.""" + id: NotRequired[str] + r"""Opaque Glean person ID.""" + + +class PlatformPersonReference(BaseModel): + r"""A lightweight reference to a person, used where a payload merely points at someone.""" + + name: str + r"""Display name.""" + + id: Optional[str] = None + r"""Opaque Glean person ID.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformproblemdetailcode.py b/src/glean/api_client/models/platformproblemdetailcode.py new file mode 100644 index 00000000..fab2cc23 --- /dev/null +++ b/src/glean/api_client/models/platformproblemdetailcode.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from glean.api_client import utils + + +class PlatformProblemDetailCode(str, Enum, metaclass=utils.OpenEnumMeta): + r"""Stable machine-readable error code.""" + + INVALID_REQUEST = "invalid_request" + MISSING_REQUIRED_FIELD = "missing_required_field" + INVALID_PARAMETER = "invalid_parameter" + INVALID_CURSOR = "invalid_cursor" + EXPIRED_CURSOR = "expired_cursor" + INVALID_FILTER = "invalid_filter" + INVALID_DATASOURCE = "invalid_datasource" + AUTHENTICATION_REQUIRED = "authentication_required" + TOKEN_EXPIRED = "token_expired" + INSUFFICIENT_PERMISSIONS = "insufficient_permissions" + RESOURCE_NOT_FOUND = "resource_not_found" + METHOD_NOT_ALLOWED = "method_not_allowed" + REQUEST_TIMEOUT = "request_timeout" + CONFLICT = "conflict" + GONE = "gone" + UNPROCESSABLE_QUERY = "unprocessable_query" + RATE_LIMIT_EXCEEDED = "rate_limit_exceeded" + INTERNAL_ERROR = "internal_error" + SERVICE_UNAVAILABLE = "service_unavailable" diff --git a/src/glean/api_client/models/platformproblemdetailerror.py b/src/glean/api_client/models/platformproblemdetailerror.py new file mode 100644 index 00000000..336efdc3 --- /dev/null +++ b/src/glean/api_client/models/platformproblemdetailerror.py @@ -0,0 +1,58 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformproblemdetailcode import PlatformProblemDetailCode +from glean.api_client import models +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import field_serializer, model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformProblemDetailErrorTypedDict(TypedDict): + r"""Field-level validation problem for a single offending field.""" + + pointer: str + r"""RFC 6901 JSON Pointer to the offending field.""" + detail: str + r"""Human-readable explanation for this field.""" + code: NotRequired[PlatformProblemDetailCode] + r"""Stable machine-readable error code.""" + + +class PlatformProblemDetailError(BaseModel): + r"""Field-level validation problem for a single offending field.""" + + pointer: str + r"""RFC 6901 JSON Pointer to the offending field.""" + + detail: str + r"""Human-readable explanation for this field.""" + + code: Optional[PlatformProblemDetailCode] = None + r"""Stable machine-readable error code.""" + + @field_serializer("code") + def serialize_code(self, value): + if isinstance(value, str): + try: + return models.PlatformProblemDetailCode(value) + except ValueError: + return value + return value + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["code"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformresult.py b/src/glean/api_client/models/platformresult.py new file mode 100644 index 00000000..08c36e88 --- /dev/null +++ b/src/glean/api_client/models/platformresult.py @@ -0,0 +1,110 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformpersonreference import ( + PlatformPersonReference, + PlatformPersonReferenceTypedDict, +) +from datetime import datetime +from glean.api_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformResultTypedDict(TypedDict): + url: str + r"""Canonical URL of the result.""" + title: str + r"""Result title.""" + datasource: str + r"""The datasource this result originates from.""" + snippets: NotRequired[List[str]] + r"""Query-relevant plain-text excerpts from the result body.""" + datasource_instance: NotRequired[Nullable[str]] + r"""The datasource instance this result originates from, if known.""" + document_type: NotRequired[Nullable[str]] + r"""The document type within the datasource.""" + creator: NotRequired[PlatformPersonReferenceTypedDict] + r"""A lightweight reference to a person, used where a payload merely points at someone.""" + owner: NotRequired[PlatformPersonReferenceTypedDict] + r"""A lightweight reference to a person, used where a payload merely points at someone.""" + updated_at: NotRequired[Nullable[datetime]] + r"""When the result was last modified.""" + created_at: NotRequired[Nullable[datetime]] + r"""When the result was created.""" + + +class PlatformResult(BaseModel): + url: str + r"""Canonical URL of the result.""" + + title: str + r"""Result title.""" + + datasource: str + r"""The datasource this result originates from.""" + + snippets: Optional[List[str]] = None + r"""Query-relevant plain-text excerpts from the result body.""" + + datasource_instance: OptionalNullable[str] = UNSET + r"""The datasource instance this result originates from, if known.""" + + document_type: OptionalNullable[str] = UNSET + r"""The document type within the datasource.""" + + creator: Optional[PlatformPersonReference] = None + r"""A lightweight reference to a person, used where a payload merely points at someone.""" + + owner: Optional[PlatformPersonReference] = None + r"""A lightweight reference to a person, used where a payload merely points at someone.""" + + updated_at: OptionalNullable[datetime] = UNSET + r"""When the result was last modified.""" + + created_at: OptionalNullable[datetime] = UNSET + r"""When the result was created.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "snippets", + "datasource_instance", + "document_type", + "creator", + "owner", + "updated_at", + "created_at", + ] + ) + nullable_fields = set( + ["datasource_instance", "document_type", "updated_at", "created_at"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformsearchrequest.py b/src/glean/api_client/models/platformsearchrequest.py new file mode 100644 index 00000000..8f37fa7d --- /dev/null +++ b/src/glean/api_client/models/platformsearchrequest.py @@ -0,0 +1,109 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformfilter import PlatformFilter, PlatformFilterTypedDict +from .platformtimerange import PlatformTimeRange, PlatformTimeRangeTypedDict +from glean.api_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformSearchRequestTypedDict(TypedDict): + query: str + r"""The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. + + """ + page_size: NotRequired[int] + r"""Number of results to return per page.""" + cursor: NotRequired[Nullable[str]] + r"""Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. + + """ + datasources: NotRequired[List[str]] + r"""Restrict results to specific datasources. Requests must not specify both `datasources` and `datasource_instances`. + + """ + datasource_instances: NotRequired[List[str]] + r"""Restrict results to specific datasource instances. Values are datasource instance identifiers returned by `GET /api/search/filters`. Requests must not specify both `datasources` and `datasource_instances`. + + """ + filters: NotRequired[List[PlatformFilterTypedDict]] + r"""Structured filters applied to search results. Equality operators OR multiple values within a filter. Multiple filters are AND'd together, including range filters on the same field. Filters are AND'd with any inline operators in `query`. Note that conflicting constraints on the same field (e.g., `type:document` in the query and `type: spreadsheet` in a filter) produce an empty result set. + + """ + time_range: NotRequired[PlatformTimeRangeTypedDict] + r"""Filter results to those last updated within this range.""" + + +class PlatformSearchRequest(BaseModel): + query: str + r"""The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. + + """ + + page_size: Optional[int] = 10 + r"""Number of results to return per page.""" + + cursor: OptionalNullable[str] = UNSET + r"""Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. + + """ + + datasources: Optional[List[str]] = None + r"""Restrict results to specific datasources. Requests must not specify both `datasources` and `datasource_instances`. + + """ + + datasource_instances: Optional[List[str]] = None + r"""Restrict results to specific datasource instances. Values are datasource instance identifiers returned by `GET /api/search/filters`. Requests must not specify both `datasources` and `datasource_instances`. + + """ + + filters: Optional[List[PlatformFilter]] = None + r"""Structured filters applied to search results. Equality operators OR multiple values within a filter. Multiple filters are AND'd together, including range filters on the same field. Filters are AND'd with any inline operators in `query`. Note that conflicting constraints on the same field (e.g., `type:document` in the query and `type: spreadsheet` in a filter) produce an empty result set. + + """ + + time_range: Optional[PlatformTimeRange] = None + r"""Filter results to those last updated within this range.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "page_size", + "cursor", + "datasources", + "datasource_instances", + "filters", + "time_range", + ] + ) + nullable_fields = set(["cursor"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformsearchresponse.py b/src/glean/api_client/models/platformsearchresponse.py new file mode 100644 index 00000000..d98c78d6 --- /dev/null +++ b/src/glean/api_client/models/platformsearchresponse.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformresult import PlatformResult, PlatformResultTypedDict +from glean.api_client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List +from typing_extensions import TypedDict + + +class PlatformSearchResponseTypedDict(TypedDict): + results: List[PlatformResultTypedDict] + r"""Ordered list of search results.""" + has_more: bool + r"""Indicates whether additional pages of results are available.""" + next_cursor: Nullable[str] + r"""Opaque token to pass as `cursor` in the next request.""" + request_id: str + r"""Platform-generated request ID for support correlation.""" + + +class PlatformSearchResponse(BaseModel): + results: List[PlatformResult] + r"""Ordered list of search results.""" + + has_more: bool + r"""Indicates whether additional pages of results are available.""" + + next_cursor: Nullable[str] + r"""Opaque token to pass as `cursor` in the next request.""" + + request_id: str + r"""Platform-generated request ID for support correlation.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformtimerange.py b/src/glean/api_client/models/platformtimerange.py new file mode 100644 index 00000000..0a5acb2a --- /dev/null +++ b/src/glean/api_client/models/platformtimerange.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import datetime +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformTimeRangeTypedDict(TypedDict): + r"""Filter results to those last updated within this range.""" + + start: NotRequired[datetime] + r"""Inclusive lower bound in ISO 8601 format.""" + end: NotRequired[datetime] + r"""Exclusive upper bound in ISO 8601 format.""" + + +class PlatformTimeRange(BaseModel): + r"""Filter results to those last updated within this range.""" + + start: Optional[datetime] = None + r"""Inclusive lower bound in ISO 8601 format.""" + + end: Optional[datetime] = None + r"""Exclusive upper bound in ISO 8601 format.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["start", "end"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/glean/api_client/sdk.py b/src/glean/api_client/sdk.py index 7f064950..4d65c6df 100644 --- a/src/glean/api_client/sdk.py +++ b/src/glean/api_client/sdk.py @@ -16,15 +16,9 @@ if TYPE_CHECKING: from glean.api_client.agents import Agents - from glean.api_client.authentication import Authentication - from glean.api_client.chat_sdk import ChatSDK from glean.api_client.client import Client - from glean.api_client.datasources import Datasources - from glean.api_client.entities import Entities - from glean.api_client.governance import Governance from glean.api_client.indexing import Indexing - from glean.api_client.tools import Tools - from glean.api_client.troubleshooting import Troubleshooting + from glean.api_client.search import Search class Glean(BaseSDK): @@ -47,29 +41,15 @@ class Glean(BaseSDK): """ - client: "Client" - authentication: "Authentication" - r"""Manage indexing API tokens.""" - chat: "ChatSDK" agents: "Agents" - entities: "Entities" - tools: "Tools" + search: "Search" + client: "Client" indexing: "Indexing" - troubleshooting: "Troubleshooting" - governance: "Governance" - datasources: "Datasources" - r"""Manage datasources.""" _sub_sdk_map = { - "client": ("glean.api_client.client", "Client"), - "authentication": ("glean.api_client.authentication", "Authentication"), - "chat": ("glean.api_client.chat_sdk", "ChatSDK"), "agents": ("glean.api_client.agents", "Agents"), - "entities": ("glean.api_client.entities", "Entities"), - "tools": ("glean.api_client.tools", "Tools"), + "search": ("glean.api_client.search", "Search"), + "client": ("glean.api_client.client", "Client"), "indexing": ("glean.api_client.indexing", "Indexing"), - "troubleshooting": ("glean.api_client.troubleshooting", "Troubleshooting"), - "governance": ("glean.api_client.governance", "Governance"), - "datasources": ("glean.api_client.datasources", "Datasources"), } def __init__( diff --git a/src/glean/api_client/search.py b/src/glean/api_client/search.py index b48e6212..d1279caf 100644 --- a/src/glean/api_client/search.py +++ b/src/glean/api_client/search.py @@ -1,7 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK -from datetime import datetime from glean.api_client import errors, models, utils from glean.api_client._hooks import HookContext from glean.api_client.types import OptionalNullable, UNSET @@ -11,1004 +10,45 @@ class Search(BaseSDK): - def query_as_admin( - self, - *, - query: str, - locale: Optional[str] = None, - timestamp: Optional[datetime] = None, - tracking_token: Optional[str] = None, - session_info: Optional[ - Union[models.SessionInfo, models.SessionInfoTypedDict] - ] = None, - source_document: Optional[ - Union[models.Document, models.DocumentTypedDict] - ] = None, - page_size: Optional[int] = None, - max_snippet_size: Optional[int] = None, - cursor: Optional[str] = None, - result_tab_ids: Optional[Iterable[str]] = None, - input_details: Optional[ - Union[ - models.SearchRequestInputDetails, - models.SearchRequestInputDetailsTypedDict, - ] - ] = None, - request_options: Optional[ - Union[models.SearchRequestOptions, models.SearchRequestOptionsTypedDict] - ] = None, - timeout_millis: Optional[int] = None, - disable_spellcheck: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.SearchResponse: - r"""Search the index (admin) - - Retrieves results for search query without respect for permissions. This is available only to privileged users. - - :param query: The search terms. - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param timestamp: The ISO 8601 timestamp associated with the client request. - :param tracking_token: A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. - :param session_info: - :param source_document: - :param page_size: Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. - :param max_snippet_size: Hint to the server about how many characters long a snippet may be. Server may return less or more. - :param cursor: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. - :param result_tab_ids: The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. - :param input_details: - :param request_options: - :param timeout_millis: Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. - :param disable_spellcheck: Whether or not to disable spellcheck. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AdminsearchRequest( - locale=locale, - search_request=models.SearchRequest( - timestamp=timestamp, - tracking_token=tracking_token, - session_info=utils.get_pydantic_model( - session_info, Optional[models.SessionInfo] - ), - source_document=utils.get_pydantic_model( - source_document, Optional[models.Document] - ), - page_size=page_size, - max_snippet_size=max_snippet_size, - query=query, - cursor=cursor, - result_tab_ids=utils.unmarshal(result_tab_ids, Optional[List[str]]), - input_details=utils.get_pydantic_model( - input_details, Optional[models.SearchRequestInputDetails] - ), - request_options=utils.get_pydantic_model( - request_options, Optional[models.SearchRequestOptions] - ), - timeout_millis=timeout_millis, - disable_spellcheck=disable_spellcheck, - ), - ) - - req = self._build_request( - method="POST", - path="/rest/api/v1/adminsearch", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.search_request, False, False, "json", models.SearchRequest - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="adminsearch", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Search"], - extensions={ - "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", - }, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.SearchResponse, http_res) - if utils.match_response(http_res, ["403", "422"], "application/json"): - response_data = unmarshal_json_response(errors.GleanDataErrorData, http_res) - raise errors.GleanDataError(response_data, http_res) - if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - async def query_as_admin_async( - self, - *, - query: str, - locale: Optional[str] = None, - timestamp: Optional[datetime] = None, - tracking_token: Optional[str] = None, - session_info: Optional[ - Union[models.SessionInfo, models.SessionInfoTypedDict] - ] = None, - source_document: Optional[ - Union[models.Document, models.DocumentTypedDict] - ] = None, - page_size: Optional[int] = None, - max_snippet_size: Optional[int] = None, - cursor: Optional[str] = None, - result_tab_ids: Optional[Iterable[str]] = None, - input_details: Optional[ - Union[ - models.SearchRequestInputDetails, - models.SearchRequestInputDetailsTypedDict, - ] - ] = None, - request_options: Optional[ - Union[models.SearchRequestOptions, models.SearchRequestOptionsTypedDict] - ] = None, - timeout_millis: Optional[int] = None, - disable_spellcheck: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.SearchResponse: - r"""Search the index (admin) - - Retrieves results for search query without respect for permissions. This is available only to privileged users. - - :param query: The search terms. - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param timestamp: The ISO 8601 timestamp associated with the client request. - :param tracking_token: A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. - :param session_info: - :param source_document: - :param page_size: Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. - :param max_snippet_size: Hint to the server about how many characters long a snippet may be. Server may return less or more. - :param cursor: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. - :param result_tab_ids: The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. - :param input_details: - :param request_options: - :param timeout_millis: Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. - :param disable_spellcheck: Whether or not to disable spellcheck. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AdminsearchRequest( - locale=locale, - search_request=models.SearchRequest( - timestamp=timestamp, - tracking_token=tracking_token, - session_info=utils.get_pydantic_model( - session_info, Optional[models.SessionInfo] - ), - source_document=utils.get_pydantic_model( - source_document, Optional[models.Document] - ), - page_size=page_size, - max_snippet_size=max_snippet_size, - query=query, - cursor=cursor, - result_tab_ids=utils.unmarshal(result_tab_ids, Optional[List[str]]), - input_details=utils.get_pydantic_model( - input_details, Optional[models.SearchRequestInputDetails] - ), - request_options=utils.get_pydantic_model( - request_options, Optional[models.SearchRequestOptions] - ), - timeout_millis=timeout_millis, - disable_spellcheck=disable_spellcheck, - ), - ) - - req = self._build_request_async( - method="POST", - path="/rest/api/v1/adminsearch", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.search_request, False, False, "json", models.SearchRequest - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="adminsearch", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Search"], - extensions={ - "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", - }, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.SearchResponse, http_res) - if utils.match_response(http_res, ["403", "422"], "application/json"): - response_data = unmarshal_json_response(errors.GleanDataErrorData, http_res) - raise errors.GleanDataError(response_data, http_res) - if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - def autocomplete( - self, - *, - locale: Optional[str] = None, - tracking_token: Optional[str] = None, - session_info: Optional[ - Union[models.SessionInfo, models.SessionInfoTypedDict] - ] = None, - query: Optional[str] = None, - datasources_filter: Optional[Iterable[str]] = None, - datasource: Optional[str] = None, - result_types: Optional[Iterable[models.AutocompleteRequestResultType]] = None, - result_size: Optional[int] = None, - auth_tokens: Optional[ - Union[Iterable[models.AuthToken], Iterable[models.AuthTokenTypedDict]] - ] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.AutocompleteResponse: - r"""Autocomplete - - Retrieve query suggestions, operators and documents for the given partially typed query. - - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param tracking_token: - :param session_info: - :param query: Partially typed query. - :param datasources_filter: Filter results to only those relevant to one or more datasources (e.g. jira, gdrive). Results are unfiltered if missing. - :param datasource: Filter to only return results relevant to the given datasource. - :param result_types: Filter to only return results of the given type(s). All types may be returned if omitted. - :param result_size: Maximum number of results to be returned. If no value is provided, the backend will cap at 200. - - :param auth_tokens: Auth tokens which may be used for federated results. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AutocompleteRequestRequest( - locale=locale, - autocomplete_request=models.AutocompleteRequest( - tracking_token=tracking_token, - session_info=utils.get_pydantic_model( - session_info, Optional[models.SessionInfo] - ), - query=query, - datasources_filter=utils.unmarshal( - datasources_filter, Optional[List[str]] - ), - datasource=datasource, - result_types=utils.unmarshal( - result_types, Optional[List[models.AutocompleteRequestResultType]] - ), - result_size=result_size, - auth_tokens=utils.get_pydantic_model( - auth_tokens, Optional[List[models.AuthToken]] - ), - ), - ) - - req = self._build_request( - method="POST", - path="/rest/api/v1/autocomplete", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.autocomplete_request, - False, - False, - "json", - models.AutocompleteRequest, - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="autocomplete", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Search"], - extensions={ - "x-codegen-request-body-name": "payload", - "x-visibility": "Public", - }, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.AutocompleteResponse, http_res) - if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - async def autocomplete_async( - self, - *, - locale: Optional[str] = None, - tracking_token: Optional[str] = None, - session_info: Optional[ - Union[models.SessionInfo, models.SessionInfoTypedDict] - ] = None, - query: Optional[str] = None, - datasources_filter: Optional[Iterable[str]] = None, - datasource: Optional[str] = None, - result_types: Optional[Iterable[models.AutocompleteRequestResultType]] = None, - result_size: Optional[int] = None, - auth_tokens: Optional[ - Union[Iterable[models.AuthToken], Iterable[models.AuthTokenTypedDict]] - ] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.AutocompleteResponse: - r"""Autocomplete - - Retrieve query suggestions, operators and documents for the given partially typed query. - - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param tracking_token: - :param session_info: - :param query: Partially typed query. - :param datasources_filter: Filter results to only those relevant to one or more datasources (e.g. jira, gdrive). Results are unfiltered if missing. - :param datasource: Filter to only return results relevant to the given datasource. - :param result_types: Filter to only return results of the given type(s). All types may be returned if omitted. - :param result_size: Maximum number of results to be returned. If no value is provided, the backend will cap at 200. - - :param auth_tokens: Auth tokens which may be used for federated results. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AutocompleteRequestRequest( - locale=locale, - autocomplete_request=models.AutocompleteRequest( - tracking_token=tracking_token, - session_info=utils.get_pydantic_model( - session_info, Optional[models.SessionInfo] - ), - query=query, - datasources_filter=utils.unmarshal( - datasources_filter, Optional[List[str]] - ), - datasource=datasource, - result_types=utils.unmarshal( - result_types, Optional[List[models.AutocompleteRequestResultType]] - ), - result_size=result_size, - auth_tokens=utils.get_pydantic_model( - auth_tokens, Optional[List[models.AuthToken]] - ), - ), - ) - - req = self._build_request_async( - method="POST", - path="/rest/api/v1/autocomplete", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.autocomplete_request, - False, - False, - "json", - models.AutocompleteRequest, - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="autocomplete", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Search"], - extensions={ - "x-codegen-request-body-name": "payload", - "x-visibility": "Public", - }, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.AutocompleteResponse, http_res) - if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - def retrieve_feed( - self, - *, - locale: Optional[str] = None, - categories: Optional[Iterable[models.FeedRequestCategory]] = None, - request_options: Optional[ - Union[models.FeedRequestOptions, models.FeedRequestOptionsTypedDict] - ] = None, - timeout_millis: Optional[int] = None, - session_info: Optional[ - Union[models.SessionInfo, models.SessionInfoTypedDict] - ] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.FeedResponse: - r"""Feed of documents and events - - The personalized feed/home includes different types of contents including suggestions, recents, calendar events and many more. - - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param categories: Categories of content requested. An allowlist gives flexibility to request content separately or together. - :param request_options: - :param timeout_millis: Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. - :param session_info: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.FeedRequestRequest( - locale=locale, - feed_request=models.FeedRequest( - categories=utils.unmarshal( - categories, Optional[List[models.FeedRequestCategory]] - ), - request_options=utils.get_pydantic_model( - request_options, Optional[models.FeedRequestOptions] - ), - timeout_millis=timeout_millis, - session_info=utils.get_pydantic_model( - session_info, Optional[models.SessionInfo] - ), - ), - ) - - req = self._build_request( - method="POST", - path="/rest/api/v1/feed", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.feed_request, False, False, "json", models.FeedRequest - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="feed", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Search"], - extensions={ - "x-codegen-request-body-name": "payload", - "x-visibility": "Public", - }, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.FeedResponse, http_res) - if utils.match_response(http_res, ["400", "401", "408", "429", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - async def retrieve_feed_async( - self, - *, - locale: Optional[str] = None, - categories: Optional[Iterable[models.FeedRequestCategory]] = None, - request_options: Optional[ - Union[models.FeedRequestOptions, models.FeedRequestOptionsTypedDict] - ] = None, - timeout_millis: Optional[int] = None, - session_info: Optional[ - Union[models.SessionInfo, models.SessionInfoTypedDict] - ] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.FeedResponse: - r"""Feed of documents and events - - The personalized feed/home includes different types of contents including suggestions, recents, calendar events and many more. - - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param categories: Categories of content requested. An allowlist gives flexibility to request content separately or together. - :param request_options: - :param timeout_millis: Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. - :param session_info: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.FeedRequestRequest( - locale=locale, - feed_request=models.FeedRequest( - categories=utils.unmarshal( - categories, Optional[List[models.FeedRequestCategory]] - ), - request_options=utils.get_pydantic_model( - request_options, Optional[models.FeedRequestOptions] - ), - timeout_millis=timeout_millis, - session_info=utils.get_pydantic_model( - session_info, Optional[models.SessionInfo] - ), - ), - ) - - req = self._build_request_async( - method="POST", - path="/rest/api/v1/feed", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.feed_request, False, False, "json", models.FeedRequest - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="feed", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Search"], - extensions={ - "x-codegen-request-body-name": "payload", - "x-visibility": "Public", - }, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.FeedResponse, http_res) - if utils.match_response(http_res, ["400", "401", "408", "429", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - def recommendations( + def query( self, *, - locale: Optional[str] = None, - timestamp: Optional[datetime] = None, - tracking_token: Optional[str] = None, - session_info: Optional[ - Union[models.SessionInfo, models.SessionInfoTypedDict] - ] = None, - source_document: Optional[ - Union[models.Document, models.DocumentTypedDict] - ] = None, - page_size: Optional[int] = None, - max_snippet_size: Optional[int] = None, - recommendation_document_spec: Optional[ - Union[models.DocumentSpecUnion, models.DocumentSpecUnionTypedDict] - ] = None, - request_options: Optional[ + query: str, + page_size: Optional[int] = 10, + cursor: OptionalNullable[str] = UNSET, + datasources: Optional[Iterable[str]] = None, + datasource_instances: Optional[Iterable[str]] = None, + filters: Optional[ Union[ - models.RecommendationsRequestOptions, - models.RecommendationsRequestOptionsTypedDict, + Iterable[models.PlatformFilter], + Iterable[models.PlatformFilterTypedDict], ] ] = None, + time_range: Optional[ + Union[models.PlatformTimeRange, models.PlatformTimeRangeTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[models.ResultsResponse]: - r"""Recommend documents - - Retrieve recommended documents for the given URL or Glean Document ID. - - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param timestamp: The ISO 8601 timestamp associated with the client request. - :param tracking_token: A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. - :param session_info: - :param source_document: - :param page_size: Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. - :param max_snippet_size: Hint to the server about how many characters long a snippet may be. Server may return less or more. - :param recommendation_document_spec: - :param request_options: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.RecommendationsRequestRequest( - locale=locale, - recommendations_request=models.RecommendationsRequest( - timestamp=timestamp, - tracking_token=tracking_token, - session_info=utils.get_pydantic_model( - session_info, Optional[models.SessionInfo] - ), - source_document=utils.get_pydantic_model( - source_document, Optional[models.Document] - ), - page_size=page_size, - max_snippet_size=max_snippet_size, - recommendation_document_spec=utils.get_pydantic_model( - recommendation_document_spec, Optional[models.DocumentSpecUnion] - ), - request_options=utils.get_pydantic_model( - request_options, Optional[models.RecommendationsRequestOptions] - ), - ), - ) - - req = self._build_request( - method="POST", - path="/rest/api/v1/recommendations", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.recommendations_request, - False, - False, - "json", - models.RecommendationsRequest, - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) + ) -> models.PlatformSearchResponse: + r"""Search - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config + Execute a search query and retrieve ranked results. This is the data retrieval variant of the search API and returns only results and pagination state. - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="recommendations", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Search"], - extensions={ - "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", - }, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) + :param query: The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ResultsResponse, http_res) - if utils.match_response(http_res, ["202", "204"], "*"): - return None - if utils.match_response(http_res, ["400", "401", "403", "429", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) + :param page_size: Number of results to return per page. + :param cursor: Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. - raise errors.GleanError("Unexpected response received", http_res) + :param datasources: Restrict results to specific datasources. Requests must not specify both `datasources` and `datasource_instances`. - async def recommendations_async( - self, - *, - locale: Optional[str] = None, - timestamp: Optional[datetime] = None, - tracking_token: Optional[str] = None, - session_info: Optional[ - Union[models.SessionInfo, models.SessionInfoTypedDict] - ] = None, - source_document: Optional[ - Union[models.Document, models.DocumentTypedDict] - ] = None, - page_size: Optional[int] = None, - max_snippet_size: Optional[int] = None, - recommendation_document_spec: Optional[ - Union[models.DocumentSpecUnion, models.DocumentSpecUnionTypedDict] - ] = None, - request_options: Optional[ - Union[ - models.RecommendationsRequestOptions, - models.RecommendationsRequestOptionsTypedDict, - ] - ] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[models.ResultsResponse]: - r"""Recommend documents + :param datasource_instances: Restrict results to specific datasource instances. Values are datasource instance identifiers returned by `GET /api/search/filters`. Requests must not specify both `datasources` and `datasource_instances`. - Retrieve recommended documents for the given URL or Glean Document ID. + :param filters: Structured filters applied to search results. Equality operators OR multiple values within a filter. Multiple filters are AND'd together, including range filters on the same field. Filters are AND'd with any inline operators in `query`. Note that conflicting constraints on the same field (e.g., `type:document` in the query and `type: spreadsheet` in a filter) produce an empty result set. - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param timestamp: The ISO 8601 timestamp associated with the client request. - :param tracking_token: A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. - :param session_info: - :param source_document: - :param page_size: Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. - :param max_snippet_size: Hint to the server about how many characters long a snippet may be. Server may return less or more. - :param recommendation_document_spec: - :param request_options: + :param time_range: Filter results to those last updated within this range. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1024,189 +64,25 @@ async def recommendations_async( else: base_url = self._get_url(base_url, url_variables) - request = models.RecommendationsRequestRequest( - locale=locale, - recommendations_request=models.RecommendationsRequest( - timestamp=timestamp, - tracking_token=tracking_token, - session_info=utils.get_pydantic_model( - session_info, Optional[models.SessionInfo] - ), - source_document=utils.get_pydantic_model( - source_document, Optional[models.Document] - ), - page_size=page_size, - max_snippet_size=max_snippet_size, - recommendation_document_spec=utils.get_pydantic_model( - recommendation_document_spec, Optional[models.DocumentSpecUnion] - ), - request_options=utils.get_pydantic_model( - request_options, Optional[models.RecommendationsRequestOptions] - ), - ), - ) - - req = self._build_request_async( - method="POST", - path="/rest/api/v1/recommendations", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.recommendations_request, - False, - False, - "json", - models.RecommendationsRequest, + request = models.PlatformSearchRequest( + query=query, + page_size=page_size, + cursor=cursor, + datasources=utils.unmarshal(datasources, Optional[List[str]]), + datasource_instances=utils.unmarshal( + datasource_instances, Optional[List[str]] ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="recommendations", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Search"], - extensions={ - "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", - }, + filters=utils.get_pydantic_model( + filters, Optional[List[models.PlatformFilter]] ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ResultsResponse, http_res) - if utils.match_response(http_res, ["202", "204"], "*"): - return None - if utils.match_response(http_res, ["400", "401", "403", "429", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - def query( - self, - *, - query: str, - locale: Optional[str] = None, - timestamp: Optional[datetime] = None, - tracking_token: Optional[str] = None, - session_info: Optional[ - Union[models.SessionInfo, models.SessionInfoTypedDict] - ] = None, - source_document: Optional[ - Union[models.Document, models.DocumentTypedDict] - ] = None, - page_size: Optional[int] = None, - max_snippet_size: Optional[int] = None, - cursor: Optional[str] = None, - result_tab_ids: Optional[Iterable[str]] = None, - input_details: Optional[ - Union[ - models.SearchRequestInputDetails, - models.SearchRequestInputDetailsTypedDict, - ] - ] = None, - request_options: Optional[ - Union[models.SearchRequestOptions, models.SearchRequestOptionsTypedDict] - ] = None, - timeout_millis: Optional[int] = None, - disable_spellcheck: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.SearchResponse: - r"""Search - - Retrieve results from the index for the given query and filters. - - :param query: The search terms. - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param timestamp: The ISO 8601 timestamp associated with the client request. - :param tracking_token: A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. - :param session_info: - :param source_document: - :param page_size: Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. - :param max_snippet_size: Hint to the server about how many characters long a snippet may be. Server may return less or more. - :param cursor: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. - :param result_tab_ids: The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. - :param input_details: - :param request_options: - :param timeout_millis: Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. - :param disable_spellcheck: Whether or not to disable spellcheck. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.SearchRequestRequest( - locale=locale, - search_request=models.SearchRequest( - timestamp=timestamp, - tracking_token=tracking_token, - session_info=utils.get_pydantic_model( - session_info, Optional[models.SessionInfo] - ), - source_document=utils.get_pydantic_model( - source_document, Optional[models.Document] - ), - page_size=page_size, - max_snippet_size=max_snippet_size, - query=query, - cursor=cursor, - result_tab_ids=utils.unmarshal(result_tab_ids, Optional[List[str]]), - input_details=utils.get_pydantic_model( - input_details, Optional[models.SearchRequestInputDetails] - ), - request_options=utils.get_pydantic_model( - request_options, Optional[models.SearchRequestOptions] - ), - timeout_millis=timeout_millis, - disable_spellcheck=disable_spellcheck, + time_range=utils.get_pydantic_model( + time_range, Optional[models.PlatformTimeRange] ), ) req = self._build_request( method="POST", - path="/rest/api/v1/search", + path="/api/search", base_url=base_url, url_variables=url_variables, request=request, @@ -1218,7 +94,7 @@ def query( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.search_request, False, False, "json", models.SearchRequest + request, False, False, "json", models.PlatformSearchRequest ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -1236,7 +112,7 @@ def query( hook_ctx=HookContext( config=self.sdk_configuration, base_url=base_url or "", - operation_id="search", + operation_id="platform-search", oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security @@ -1244,6 +120,10 @@ def query( tags=["Search"], extensions={ "x-codegen-request-body-name": "payload", + "x-glean-experimental": { + "id": "5ab612fc-ed50-4419-bec3-e5fe83934653", + "introduced": "2026-04-08", + }, "x-visibility": "Public", }, ), @@ -1254,11 +134,22 @@ def query( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.SearchResponse, http_res) - if utils.match_response(http_res, ["403", "422"], "application/json"): - response_data = unmarshal_json_response(errors.GleanDataErrorData, http_res) - raise errors.GleanDataError(response_data, http_res) - if utils.match_response(http_res, ["400", "401", "408", "429", "4XX"], "*"): + return unmarshal_json_response(models.PlatformSearchResponse, http_res) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.GleanError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): @@ -1271,53 +162,41 @@ async def query_async( self, *, query: str, - locale: Optional[str] = None, - timestamp: Optional[datetime] = None, - tracking_token: Optional[str] = None, - session_info: Optional[ - Union[models.SessionInfo, models.SessionInfoTypedDict] - ] = None, - source_document: Optional[ - Union[models.Document, models.DocumentTypedDict] - ] = None, - page_size: Optional[int] = None, - max_snippet_size: Optional[int] = None, - cursor: Optional[str] = None, - result_tab_ids: Optional[Iterable[str]] = None, - input_details: Optional[ + page_size: Optional[int] = 10, + cursor: OptionalNullable[str] = UNSET, + datasources: Optional[Iterable[str]] = None, + datasource_instances: Optional[Iterable[str]] = None, + filters: Optional[ Union[ - models.SearchRequestInputDetails, - models.SearchRequestInputDetailsTypedDict, + Iterable[models.PlatformFilter], + Iterable[models.PlatformFilterTypedDict], ] ] = None, - request_options: Optional[ - Union[models.SearchRequestOptions, models.SearchRequestOptionsTypedDict] + time_range: Optional[ + Union[models.PlatformTimeRange, models.PlatformTimeRangeTypedDict] ] = None, - timeout_millis: Optional[int] = None, - disable_spellcheck: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.SearchResponse: + ) -> models.PlatformSearchResponse: r"""Search - Retrieve results from the index for the given query and filters. + Execute a search query and retrieve ranked results. This is the data retrieval variant of the search API and returns only results and pagination state. + + + :param query: The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. + + :param page_size: Number of results to return per page. + :param cursor: Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. + + :param datasources: Restrict results to specific datasources. Requests must not specify both `datasources` and `datasource_instances`. - :param query: The search terms. - :param locale: The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. - :param timestamp: The ISO 8601 timestamp associated with the client request. - :param tracking_token: A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. - :param session_info: - :param source_document: - :param page_size: Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. - :param max_snippet_size: Hint to the server about how many characters long a snippet may be. Server may return less or more. - :param cursor: Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. - :param result_tab_ids: The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. - :param input_details: - :param request_options: - :param timeout_millis: Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. - :param disable_spellcheck: Whether or not to disable spellcheck. + :param datasource_instances: Restrict results to specific datasource instances. Values are datasource instance identifiers returned by `GET /api/search/filters`. Requests must not specify both `datasources` and `datasource_instances`. + + :param filters: Structured filters applied to search results. Equality operators OR multiple values within a filter. Multiple filters are AND'd together, including range filters on the same field. Filters are AND'd with any inline operators in `query`. Note that conflicting constraints on the same field (e.g., `type:document` in the query and `type: spreadsheet` in a filter) produce an empty result set. + + :param time_range: Filter results to those last updated within this range. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1333,36 +212,25 @@ async def query_async( else: base_url = self._get_url(base_url, url_variables) - request = models.SearchRequestRequest( - locale=locale, - search_request=models.SearchRequest( - timestamp=timestamp, - tracking_token=tracking_token, - session_info=utils.get_pydantic_model( - session_info, Optional[models.SessionInfo] - ), - source_document=utils.get_pydantic_model( - source_document, Optional[models.Document] - ), - page_size=page_size, - max_snippet_size=max_snippet_size, - query=query, - cursor=cursor, - result_tab_ids=utils.unmarshal(result_tab_ids, Optional[List[str]]), - input_details=utils.get_pydantic_model( - input_details, Optional[models.SearchRequestInputDetails] - ), - request_options=utils.get_pydantic_model( - request_options, Optional[models.SearchRequestOptions] - ), - timeout_millis=timeout_millis, - disable_spellcheck=disable_spellcheck, + request = models.PlatformSearchRequest( + query=query, + page_size=page_size, + cursor=cursor, + datasources=utils.unmarshal(datasources, Optional[List[str]]), + datasource_instances=utils.unmarshal( + datasource_instances, Optional[List[str]] + ), + filters=utils.get_pydantic_model( + filters, Optional[List[models.PlatformFilter]] + ), + time_range=utils.get_pydantic_model( + time_range, Optional[models.PlatformTimeRange] ), ) req = self._build_request_async( method="POST", - path="/rest/api/v1/search", + path="/api/search", base_url=base_url, url_variables=url_variables, request=request, @@ -1374,7 +242,7 @@ async def query_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.search_request, False, False, "json", models.SearchRequest + request, False, False, "json", models.PlatformSearchRequest ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -1392,7 +260,7 @@ async def query_async( hook_ctx=HookContext( config=self.sdk_configuration, base_url=base_url or "", - operation_id="search", + operation_id="platform-search", oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security @@ -1400,6 +268,10 @@ async def query_async( tags=["Search"], extensions={ "x-codegen-request-body-name": "payload", + "x-glean-experimental": { + "id": "5ab612fc-ed50-4419-bec3-e5fe83934653", + "introduced": "2026-04-08", + }, "x-visibility": "Public", }, ), @@ -1410,11 +282,22 @@ async def query_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.SearchResponse, http_res) - if utils.match_response(http_res, ["403", "422"], "application/json"): - response_data = unmarshal_json_response(errors.GleanDataErrorData, http_res) - raise errors.GleanDataError(response_data, http_res) - if utils.match_response(http_res, ["400", "401", "408", "429", "4XX"], "*"): + return unmarshal_json_response(models.PlatformSearchResponse, http_res) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.GleanError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): diff --git a/src/glean/api_client/tools.py b/src/glean/api_client/tools.py index 9ac9f2a0..7751bb50 100644 --- a/src/glean/api_client/tools.py +++ b/src/glean/api_client/tools.py @@ -6,11 +6,377 @@ from glean.api_client.types import OptionalNullable, UNSET from glean.api_client.utils import get_security_from_env from glean.api_client.utils.unmarshal_json_response import unmarshal_json_response -from typing import Mapping, Optional +from typing import Dict, Iterable, List, Mapping, Optional, Union class Tools(BaseSDK): - def get_action_pack_auth_status( + def list( + self, + *, + tool_names: Optional[Iterable[str]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ToolsListResponse: + r"""List available tools + + Returns a filtered set of available tools based on optional tool name parameters. If no filters are provided, all available tools are returned. + + :param tool_names: Optional array of tool names to filter by + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetRestAPIV1ToolsListRequest( + tool_names=utils.unmarshal(tool_names, Optional[List[str]]), + ) + + req = self._build_request( + method="GET", + path="/rest/api/v1/tools/list", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_/rest/api/v1/tools/list", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Tools", "Tools"], + extensions={"x-visibility": "Preview"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ToolsListResponse, http_res) + if utils.match_response(http_res, ["400", "401", "404", "429", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def list_async( + self, + *, + tool_names: Optional[Iterable[str]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ToolsListResponse: + r"""List available tools + + Returns a filtered set of available tools based on optional tool name parameters. If no filters are provided, all available tools are returned. + + :param tool_names: Optional array of tool names to filter by + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetRestAPIV1ToolsListRequest( + tool_names=utils.unmarshal(tool_names, Optional[List[str]]), + ) + + req = self._build_request_async( + method="GET", + path="/rest/api/v1/tools/list", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_/rest/api/v1/tools/list", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Tools", "Tools"], + extensions={"x-visibility": "Preview"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ToolsListResponse, http_res) + if utils.match_response(http_res, ["400", "401", "404", "429", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def run( + self, + *, + name: str, + parameters: Union[ + Mapping[str, models.ToolsCallParameter], + Mapping[str, models.ToolsCallParameterTypedDict], + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ToolsCallResponse: + r"""Execute the specified tool + + Execute the specified tool with provided parameters + + :param name: Required name of the tool to execute + :param parameters: The parameters for the tool. Each key is the name of the parameter and the value is the parameter object. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ToolsCallRequest( + name=name, + parameters=utils.get_pydantic_model( + parameters, Dict[str, models.ToolsCallParameter] + ), + ) + + req = self._build_request( + method="POST", + path="/rest/api/v1/tools/call", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ToolsCallRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="post_/rest/api/v1/tools/call", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Tools", "Tools"], + extensions={"x-visibility": "Preview"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ToolsCallResponse, http_res) + if utils.match_response(http_res, ["400", "401", "404", "429", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def run_async( + self, + *, + name: str, + parameters: Union[ + Mapping[str, models.ToolsCallParameter], + Mapping[str, models.ToolsCallParameterTypedDict], + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ToolsCallResponse: + r"""Execute the specified tool + + Execute the specified tool with provided parameters + + :param name: Required name of the tool to execute + :param parameters: The parameters for the tool. Each key is the name of the parameter and the value is the parameter object. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ToolsCallRequest( + name=name, + parameters=utils.get_pydantic_model( + parameters, Dict[str, models.ToolsCallParameter] + ), + ) + + req = self._build_request_async( + method="POST", + path="/rest/api/v1/tools/call", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ToolsCallRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="post_/rest/api/v1/tools/call", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Tools", "Tools"], + extensions={"x-visibility": "Preview"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ToolsCallResponse, http_res) + if utils.match_response(http_res, ["400", "401", "404", "429", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def retrieve_action_pack_auth_status( self, *, action_pack_id: str, @@ -101,7 +467,7 @@ def get_action_pack_auth_status( raise errors.GleanError("Unexpected response received", http_res) - async def get_action_pack_auth_status_async( + async def retrieve_action_pack_auth_status_async( self, *, action_pack_id: str, diff --git a/src/glean/api_client/troubleshooting.py b/src/glean/api_client/troubleshooting.py deleted file mode 100644 index a713f2ab..00000000 --- a/src/glean/api_client/troubleshooting.py +++ /dev/null @@ -1,231 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from glean.api_client import errors, models, utils -from glean.api_client._hooks import HookContext -from glean.api_client.types import OptionalNullable, UNSET -from glean.api_client.utils import get_security_from_env -from glean.api_client.utils.unmarshal_json_response import unmarshal_json_response -from typing import Mapping, Optional - - -class Troubleshooting(BaseSDK): - def post_api_index_v1_debug_datasource_document_events( - self, - *, - datasource: str, - object_type: str, - doc_id: str, - start_date: Optional[str] = None, - max_events: Optional[int] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.DebugDocumentLifecycleResponse: - r"""Beta: Get document lifecycle events - - Retrieves lifecycle events for a specific document including upload time, index times and deletions. Rate limited to 1 request per minute per datasource. Currently in beta, might undergo breaking changes without prior notice. - - - :param datasource: The datasource to which the document belongs - :param object_type: Object type of the document to get lifecycle events for. - :param doc_id: Glean Document ID within the datasource to get lifecycle events for. - :param start_date: The start date for events to be fetched. Cannot be more than 30 days (default 7 days) in the past. - :param max_events: Max number of events to be fetched. Cannot be more than 100 (default 20). - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.PostAPIIndexV1DebugDatasourceDocumentEventsRequest( - datasource=datasource, - debug_document_lifecycle_request=models.DebugDocumentLifecycleRequest( - object_type=object_type, - doc_id=doc_id, - start_date=start_date, - max_events=max_events, - ), - ) - - req = self._build_request( - method="POST", - path="/api/index/v1/debug/{datasource}/document/events", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json; charset=UTF-8", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.debug_document_lifecycle_request, - False, - False, - "json", - models.DebugDocumentLifecycleRequest, - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="post_/api/index/v1/debug/{datasource}/document/events", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Troubleshooting"], - extensions={"x-beta": True}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json; charset=UTF-8"): - return unmarshal_json_response( - models.DebugDocumentLifecycleResponse, http_res - ) - if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) - - async def post_api_index_v1_debug_datasource_document_events_async( - self, - *, - datasource: str, - object_type: str, - doc_id: str, - start_date: Optional[str] = None, - max_events: Optional[int] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.DebugDocumentLifecycleResponse: - r"""Beta: Get document lifecycle events - - Retrieves lifecycle events for a specific document including upload time, index times and deletions. Rate limited to 1 request per minute per datasource. Currently in beta, might undergo breaking changes without prior notice. - - - :param datasource: The datasource to which the document belongs - :param object_type: Object type of the document to get lifecycle events for. - :param doc_id: Glean Document ID within the datasource to get lifecycle events for. - :param start_date: The start date for events to be fetched. Cannot be more than 30 days (default 7 days) in the past. - :param max_events: Max number of events to be fetched. Cannot be more than 100 (default 20). - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.PostAPIIndexV1DebugDatasourceDocumentEventsRequest( - datasource=datasource, - debug_document_lifecycle_request=models.DebugDocumentLifecycleRequest( - object_type=object_type, - doc_id=doc_id, - start_date=start_date, - max_events=max_events, - ), - ) - - req = self._build_request_async( - method="POST", - path="/api/index/v1/debug/{datasource}/document/events", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json; charset=UTF-8", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.debug_document_lifecycle_request, - False, - False, - "json", - models.DebugDocumentLifecycleRequest, - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="post_/api/index/v1/debug/{datasource}/document/events", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - tags=["Troubleshooting"], - extensions={"x-beta": True}, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json; charset=UTF-8"): - return unmarshal_json_response( - models.DebugDocumentLifecycleResponse, http_res - ) - if utils.match_response(http_res, ["400", "401", "429", "4XX"], "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.GleanError("API error occurred", http_res, http_res_text) - - raise errors.GleanError("Unexpected response received", http_res) diff --git a/tests/mockserver/internal/handler/generated_handlers.go b/tests/mockserver/internal/handler/generated_handlers.go index a8a0a755..67af751e 100644 --- a/tests/mockserver/internal/handler/generated_handlers.go +++ b/tests/mockserver/internal/handler/generated_handlers.go @@ -14,6 +14,8 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * return []*GeneratedHandler{ NewGeneratedHandler(ctx, http.MethodDelete, "/rest/api/index/custom-metadata/schema/{groupName}", pathDeleteRestAPIIndexCustomMetadataSchemaGroupName(dir, rt)), NewGeneratedHandler(ctx, http.MethodDelete, "/rest/api/index/document/{docId}/custom-metadata/{groupName}", pathDeleteRestAPIIndexDocumentDocIDCustomMetadataGroupName(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}", pathGetAPIAgentsAgentID(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}/schemas", pathGetAPIAgentsAgentIDSchemas(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/index/custom-metadata/schema/{groupName}", pathGetRestAPIIndexCustomMetadataSchemaGroupName(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/actions/actionpack/{actionPackId}/auth", pathGetRestAPIV1ActionsActionpackActionPackIDAuth(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/agents/{agent_id}", pathGetRestAPIV1AgentsAgentID(dir, rt)), @@ -27,6 +29,8 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/people/{person_id}/photo", pathGetRestAPIV1PeoplePersonIDPhoto(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/tools/list", pathGetRestAPIV1ToolsList(dir, rt)), NewGeneratedHandler(ctx, http.MethodPatch, "/rest/api/v1/configure/datasources/{datasourceId}/instances/{instanceId}", pathPatchRestAPIV1ConfigureDatasourcesDatasourceIDInstancesInstanceID(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/agents/search", pathPostAPIAgentsSearch(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/agents/{agent_id}/runs", pathPostAPIAgentsAgentIDRuns(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/adddatasource", pathPostAPIIndexV1Adddatasource(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/betausers", pathPostAPIIndexV1Betausers(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/bulkindexdocuments", pathPostAPIIndexV1Bulkindexdocuments(dir, rt)), @@ -52,6 +56,7 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/processallmemberships", pathPostAPIIndexV1Processallmemberships(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/rotatetoken", pathPostAPIIndexV1Rotatetoken(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/updatepermissions", pathPostAPIIndexV1Updatepermissions(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/search", pathPostAPISearch(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/actions/actionpack/{actionPackId}/auth", pathPostRestAPIV1ActionsActionpackActionPackIDAuth(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/activity", pathPostRestAPIV1Activity(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/addcollectionitems", pathPostRestAPIV1Addcollectionitems(dir, rt)), diff --git a/tests/mockserver/internal/handler/pathgetapiagentsagentid.go b/tests/mockserver/internal/handler/pathgetapiagentsagentid.go new file mode 100644 index 00000000..821cdaf9 --- /dev/null +++ b/tests/mockserver/internal/handler/pathgetapiagentsagentid.go @@ -0,0 +1,69 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetAPIAgentsAgentID(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-agents-get[0]": + dir.HandlerFunc("platform-agents-get", testPlatformAgentsGetPlatformAgentsGet0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformAgentsGetPlatformAgentsGet0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PlatformAgentGetResponse = &components.PlatformAgentGetResponse{ + Agent: components.PlatformAgent{ + AgentID: "mho4lwzylcozgoc2", + Name: "HR Policy Agent", + Capabilities: components.PlatformAgentCapabilities{}, + }, + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathgetapiagentsagentidschemas.go b/tests/mockserver/internal/handler/pathgetapiagentsagentidschemas.go new file mode 100644 index 00000000..a9212f1d --- /dev/null +++ b/tests/mockserver/internal/handler/pathgetapiagentsagentidschemas.go @@ -0,0 +1,71 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetAPIAgentsAgentIDSchemas(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-agents-get-schemas[0]": + dir.HandlerFunc("platform-agents-get-schemas", testPlatformAgentsGetSchemasPlatformAgentsGetSchemas0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformAgentsGetSchemasPlatformAgentsGetSchemas0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PlatformAgentSchemasResponse = &components.PlatformAgentSchemasResponse{ + AgentID: "", + InputSchema: map[string]any{}, + OutputSchema: map[string]any{ + "key": "", + "key1": "", + "key2": "", + }, + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostapiagentsagentidruns.go b/tests/mockserver/internal/handler/pathpostapiagentsagentidruns.go new file mode 100644 index 00000000..93595d14 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiagentsagentidruns.go @@ -0,0 +1,85 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIAgentsAgentIDRuns(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-agents-create-run[0]": + dir.HandlerFunc("platform-agents-create-run", testPlatformAgentsCreateRunPlatformAgentsCreateRun0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformAgentsCreateRunPlatformAgentsCreateRun0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json;q=1", "text/event-stream;q=0"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PlatformAgentRunWaitResponse = &components.PlatformAgentRunWaitResponse{ + Run: &components.PlatformAgentRun{ + AgentID: "", + Messages: []components.PlatformMessage{ + components.PlatformMessage{ + Role: components.PlatformMessageRoleUser, + Content: []components.PlatformMessageTextBlock{}, + }, + }, + Status: components.PlatformAgentExecutionStatusError, + }, + Messages: []components.PlatformMessage{ + components.PlatformMessage{ + Role: components.PlatformMessageRoleUser, + Content: []components.PlatformMessageTextBlock{}, + }, + }, + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostapiagentssearch.go b/tests/mockserver/internal/handler/pathpostapiagentssearch.go new file mode 100644 index 00000000..da7d08b0 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiagentssearch.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIAgentsSearch(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-agents-search[0]": + dir.HandlerFunc("platform-agents-search", testPlatformAgentsSearchPlatformAgentsSearch0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformAgentsSearchPlatformAgentsSearch0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PlatformAgentsSearchResponse = &components.PlatformAgentsSearchResponse{ + Agents: []components.PlatformAgent{}, + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostapisearch.go b/tests/mockserver/internal/handler/pathpostapisearch.go new file mode 100644 index 00000000..1575aab3 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapisearch.go @@ -0,0 +1,73 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPISearch(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-search[0]": + dir.HandlerFunc("platform-search", testPlatformSearchPlatformSearch0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformSearchPlatformSearch0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PlatformSearchResponse = &components.PlatformSearchResponse{ + Results: []components.PlatformResult{}, + HasMore: false, + NextCursor: types.String(""), + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/sdk/models/components/platformactionsummary.go b/tests/mockserver/internal/sdk/models/components/platformactionsummary.go new file mode 100644 index 00000000..5a56a4c8 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformactionsummary.go @@ -0,0 +1,69 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PlatformActionSummary struct { + // Unique identifier of the action. + ToolID string `json:"tool_id"` + // Display name of the action. + DisplayName string `json:"display_name"` + // Tool type. + Type *string `json:"type,omitempty"` + // Authentication type required by the action. + AuthType *string `json:"auth_type,omitempty"` + // Write-action execution type. + WriteActionType *string `json:"write_action_type,omitempty"` + // Whether this action has been fully configured. + IsSetupFinished *bool `json:"is_setup_finished,omitempty"` + // Kind of knowledge the action accesses or modifies. + DataSource *string `json:"data_source,omitempty"` +} + +func (o *PlatformActionSummary) GetToolID() string { + if o == nil { + return "" + } + return o.ToolID +} + +func (o *PlatformActionSummary) GetDisplayName() string { + if o == nil { + return "" + } + return o.DisplayName +} + +func (o *PlatformActionSummary) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +func (o *PlatformActionSummary) GetAuthType() *string { + if o == nil { + return nil + } + return o.AuthType +} + +func (o *PlatformActionSummary) GetWriteActionType() *string { + if o == nil { + return nil + } + return o.WriteActionType +} + +func (o *PlatformActionSummary) GetIsSetupFinished() *bool { + if o == nil { + return nil + } + return o.IsSetupFinished +} + +func (o *PlatformActionSummary) GetDataSource() *string { + if o == nil { + return nil + } + return o.DataSource +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagent.go b/tests/mockserver/internal/sdk/models/components/platformagent.go new file mode 100644 index 00000000..79049da4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagent.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PlatformAgent struct { + // ID of the agent. + AgentID string `json:"agent_id"` + // Name of the agent. + Name string `json:"name"` + // Description of the agent. + Description *string `json:"description,omitempty"` + // Agent metadata. + Metadata map[string]any `json:"metadata,omitempty"` + Capabilities PlatformAgentCapabilities `json:"capabilities"` +} + +func (o *PlatformAgent) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgent) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *PlatformAgent) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *PlatformAgent) GetMetadata() map[string]any { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *PlatformAgent) GetCapabilities() PlatformAgentCapabilities { + if o == nil { + return PlatformAgentCapabilities{} + } + return o.Capabilities +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentcapabilities.go b/tests/mockserver/internal/sdk/models/components/platformagentcapabilities.go new file mode 100644 index 00000000..562c8682 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentcapabilities.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" +) + +type PlatformAgentCapabilities struct { + // Whether the agent supports messages as input. + ApIoMessages *bool `json:"ap.io.messages,omitempty"` + // Whether the agent supports streaming output. + ApIoStreaming *bool `json:"ap.io.streaming,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (p PlatformAgentCapabilities) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformAgentCapabilities) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *PlatformAgentCapabilities) GetApIoMessages() *bool { + if o == nil { + return nil + } + return o.ApIoMessages +} + +func (o *PlatformAgentCapabilities) GetApIoStreaming() *bool { + if o == nil { + return nil + } + return o.ApIoStreaming +} + +func (o *PlatformAgentCapabilities) GetAdditionalProperties() map[string]any { + if o == nil { + return nil + } + return o.AdditionalProperties +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentexecutionstatus.go b/tests/mockserver/internal/sdk/models/components/platformagentexecutionstatus.go new file mode 100644 index 00000000..c8c2bfb9 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentexecutionstatus.go @@ -0,0 +1,35 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformAgentExecutionStatus - Status of the agent run. +type PlatformAgentExecutionStatus string + +const ( + PlatformAgentExecutionStatusError PlatformAgentExecutionStatus = "error" + PlatformAgentExecutionStatusSuccess PlatformAgentExecutionStatus = "success" +) + +func (e PlatformAgentExecutionStatus) ToPointer() *PlatformAgentExecutionStatus { + return &e +} +func (e *PlatformAgentExecutionStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "error": + fallthrough + case "success": + *e = PlatformAgentExecutionStatus(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformAgentExecutionStatus: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentgetresponse.go b/tests/mockserver/internal/sdk/models/components/platformagentgetresponse.go new file mode 100644 index 00000000..3df4f65d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentgetresponse.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PlatformAgentGetResponse struct { + Agent PlatformAgent `json:"agent"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformAgentGetResponse) GetAgent() PlatformAgent { + if o == nil { + return PlatformAgent{} + } + return o.Agent +} + +func (o *PlatformAgentGetResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentrun.go b/tests/mockserver/internal/sdk/models/components/platformagentrun.go new file mode 100644 index 00000000..a3139f71 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentrun.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PlatformAgentRun struct { + // ID of the agent being run. + AgentID string `json:"agent_id"` + // Input fields for an input-form triggered agent. + Input map[string]any `json:"input,omitempty"` + // Messages passed to the agent. + Messages []PlatformMessage `json:"messages,omitempty"` + // Metadata passed to the agent. + Metadata map[string]any `json:"metadata,omitempty"` + // Status of the agent run. + Status PlatformAgentExecutionStatus `json:"status"` +} + +func (o *PlatformAgentRun) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgentRun) GetInput() map[string]any { + if o == nil { + return nil + } + return o.Input +} + +func (o *PlatformAgentRun) GetMessages() []PlatformMessage { + if o == nil { + return nil + } + return o.Messages +} + +func (o *PlatformAgentRun) GetMetadata() map[string]any { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *PlatformAgentRun) GetStatus() PlatformAgentExecutionStatus { + if o == nil { + return PlatformAgentExecutionStatus("") + } + return o.Status +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go b/tests/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go new file mode 100644 index 00000000..d653f4bc --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go @@ -0,0 +1,59 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" +) + +// PlatformAgentRunCreateRequest - Request to run an agent. A request MUST supply either `messages` (a non-empty conversation) or `input` (for input-form triggered agents). +type PlatformAgentRunCreateRequest struct { + // Input fields for an input-form triggered agent. + Input map[string]any `json:"input,omitempty"` + // Messages to pass to the agent. When provided, the array MUST contain at least one message and each message MUST specify a valid `role` and non-empty `content`. + // + Messages []PlatformMessage `json:"messages,omitempty"` + // Metadata to pass to the agent. + Metadata map[string]any `json:"metadata,omitempty"` + // Whether to stream the run response as server-sent events. + Stream *bool `default:"false" json:"stream"` +} + +func (p PlatformAgentRunCreateRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformAgentRunCreateRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *PlatformAgentRunCreateRequest) GetInput() map[string]any { + if o == nil { + return nil + } + return o.Input +} + +func (o *PlatformAgentRunCreateRequest) GetMessages() []PlatformMessage { + if o == nil { + return nil + } + return o.Messages +} + +func (o *PlatformAgentRunCreateRequest) GetMetadata() map[string]any { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *PlatformAgentRunCreateRequest) GetStream() *bool { + if o == nil { + return nil + } + return o.Stream +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentrunwaitresponse.go b/tests/mockserver/internal/sdk/models/components/platformagentrunwaitresponse.go new file mode 100644 index 00000000..b157f036 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentrunwaitresponse.go @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PlatformAgentRunWaitResponse struct { + Run *PlatformAgentRun `json:"run,omitempty"` + // Messages returned by the completed run. + Messages []PlatformMessage `json:"messages,omitempty"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformAgentRunWaitResponse) GetRun() *PlatformAgentRun { + if o == nil { + return nil + } + return o.Run +} + +func (o *PlatformAgentRunWaitResponse) GetMessages() []PlatformMessage { + if o == nil { + return nil + } + return o.Messages +} + +func (o *PlatformAgentRunWaitResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentschemasresponse.go b/tests/mockserver/internal/sdk/models/components/platformagentschemasresponse.go new file mode 100644 index 00000000..6f9aa5d0 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentschemasresponse.go @@ -0,0 +1,60 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PlatformAgentSchemasResponse struct { + // ID of the agent. + AgentID string `json:"agent_id"` + // Name of the agent. + Name *string `json:"name,omitempty"` + // Agent input schema in JSON Schema format. + InputSchema map[string]any `json:"input_schema"` + // Agent output schema in JSON Schema format. + OutputSchema map[string]any `json:"output_schema"` + // Tools that the agent can invoke, when requested. + Tools []PlatformActionSummary `json:"tools,omitempty"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformAgentSchemasResponse) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgentSchemasResponse) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *PlatformAgentSchemasResponse) GetInputSchema() map[string]any { + if o == nil { + return map[string]any{} + } + return o.InputSchema +} + +func (o *PlatformAgentSchemasResponse) GetOutputSchema() map[string]any { + if o == nil { + return map[string]any{} + } + return o.OutputSchema +} + +func (o *PlatformAgentSchemasResponse) GetTools() []PlatformActionSummary { + if o == nil { + return nil + } + return o.Tools +} + +func (o *PlatformAgentSchemasResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentssearchrequest.go b/tests/mockserver/internal/sdk/models/components/platformagentssearchrequest.go new file mode 100644 index 00000000..a74eaf65 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentssearchrequest.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PlatformAgentsSearchRequest struct { + // Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied. + Name *string `json:"name,omitempty"` +} + +func (o *PlatformAgentsSearchRequest) GetName() *string { + if o == nil { + return nil + } + return o.Name +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentssearchresponse.go b/tests/mockserver/internal/sdk/models/components/platformagentssearchresponse.go new file mode 100644 index 00000000..ba08e943 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentssearchresponse.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PlatformAgentsSearchResponse struct { + // Agents matching the search request. + Agents []PlatformAgent `json:"agents"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformAgentsSearchResponse) GetAgents() []PlatformAgent { + if o == nil { + return []PlatformAgent{} + } + return o.Agents +} + +func (o *PlatformAgentsSearchResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/tests/mockserver/internal/sdk/models/components/platformcontenttype.go b/tests/mockserver/internal/sdk/models/components/platformcontenttype.go new file mode 100644 index 00000000..e96a7c78 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformcontenttype.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type PlatformContentType string + +const ( + PlatformContentTypeText PlatformContentType = "text" +) + +func (e PlatformContentType) ToPointer() *PlatformContentType { + return &e +} +func (e *PlatformContentType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "text": + *e = PlatformContentType(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformContentType: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/platformfilter.go b/tests/mockserver/internal/sdk/models/components/platformfilter.go new file mode 100644 index 00000000..b8a9ea1a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformfilter.go @@ -0,0 +1,36 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PlatformFilter - A single filter criterion. For `EQUALS`, multiple values within a filter are OR'd. For `NOT_EQUALS`, multiple values exclude all listed values. Filters are AND'd with each other and with any inline query operators. +type PlatformFilter struct { + // The field to filter on. Accepts built-in filter field names such as `type`, `owner`, `from`, `author`, `channel`, `status`, `assignee`, `reporter`, `component`, `mentions`, and `collection`, plus custom datasource property names. + // + Field string `json:"field"` + // One or more values to match. + Values []string `json:"values"` + // Comparison operator to apply to this filter. Defaults to `EQUALS`. `GT`, `GTE`, `LT`, and `LTE` range operators require exactly one value; express bounded ranges with multiple filters on the same field. + // + Operator *PlatformFilterOperator `json:"operator,omitempty"` +} + +func (o *PlatformFilter) GetField() string { + if o == nil { + return "" + } + return o.Field +} + +func (o *PlatformFilter) GetValues() []string { + if o == nil { + return []string{} + } + return o.Values +} + +func (o *PlatformFilter) GetOperator() *PlatformFilterOperator { + if o == nil { + return nil + } + return o.Operator +} diff --git a/tests/mockserver/internal/sdk/models/components/platformfilteroperator.go b/tests/mockserver/internal/sdk/models/components/platformfilteroperator.go new file mode 100644 index 00000000..7515a283 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformfilteroperator.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformFilterOperator - Supported filter operator. +type PlatformFilterOperator string + +const ( + PlatformFilterOperatorEquals PlatformFilterOperator = "EQUALS" + PlatformFilterOperatorNotEquals PlatformFilterOperator = "NOT_EQUALS" + PlatformFilterOperatorGt PlatformFilterOperator = "GT" + PlatformFilterOperatorGte PlatformFilterOperator = "GTE" + PlatformFilterOperatorLt PlatformFilterOperator = "LT" + PlatformFilterOperatorLte PlatformFilterOperator = "LTE" +) + +func (e PlatformFilterOperator) ToPointer() *PlatformFilterOperator { + return &e +} +func (e *PlatformFilterOperator) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "EQUALS": + fallthrough + case "NOT_EQUALS": + fallthrough + case "GT": + fallthrough + case "GTE": + fallthrough + case "LT": + fallthrough + case "LTE": + *e = PlatformFilterOperator(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformFilterOperator: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/platformmessage.go b/tests/mockserver/internal/sdk/models/components/platformmessage.go new file mode 100644 index 00000000..c8062f03 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformmessage.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PlatformMessage struct { + // Role of the message author. + Role PlatformMessageRole `json:"role"` + // Content blocks in the message. + Content []PlatformMessageTextBlock `json:"content"` +} + +func (o *PlatformMessage) GetRole() PlatformMessageRole { + if o == nil { + return PlatformMessageRole("") + } + return o.Role +} + +func (o *PlatformMessage) GetContent() []PlatformMessageTextBlock { + if o == nil { + return []PlatformMessageTextBlock{} + } + return o.Content +} diff --git a/tests/mockserver/internal/sdk/models/components/platformmessagerole.go b/tests/mockserver/internal/sdk/models/components/platformmessagerole.go new file mode 100644 index 00000000..bece7dac --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformmessagerole.go @@ -0,0 +1,35 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformMessageRole - Role of the message author. +type PlatformMessageRole string + +const ( + PlatformMessageRoleUser PlatformMessageRole = "USER" + PlatformMessageRoleGleanAi PlatformMessageRole = "GLEAN_AI" +) + +func (e PlatformMessageRole) ToPointer() *PlatformMessageRole { + return &e +} +func (e *PlatformMessageRole) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "USER": + fallthrough + case "GLEAN_AI": + *e = PlatformMessageRole(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformMessageRole: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/platformmessagetextblock.go b/tests/mockserver/internal/sdk/models/components/platformmessagetextblock.go new file mode 100644 index 00000000..0432f13a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformmessagetextblock.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PlatformMessageTextBlock struct { + // Text content. + Text string `json:"text"` + Type PlatformContentType `json:"type"` +} + +func (o *PlatformMessageTextBlock) GetText() string { + if o == nil { + return "" + } + return o.Text +} + +func (o *PlatformMessageTextBlock) GetType() PlatformContentType { + if o == nil { + return PlatformContentType("") + } + return o.Type +} diff --git a/tests/mockserver/internal/sdk/models/components/platformpersonreference.go b/tests/mockserver/internal/sdk/models/components/platformpersonreference.go new file mode 100644 index 00000000..dca6a6f8 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformpersonreference.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PlatformPersonReference - A lightweight reference to a person, used where a payload merely points at someone. +type PlatformPersonReference struct { + // Opaque Glean person ID. + ID *string `json:"id,omitempty"` + // Display name. + Name string `json:"name"` +} + +func (o *PlatformPersonReference) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *PlatformPersonReference) GetName() string { + if o == nil { + return "" + } + return o.Name +} diff --git a/tests/mockserver/internal/sdk/models/components/platformproblemdetailcode.go b/tests/mockserver/internal/sdk/models/components/platformproblemdetailcode.go new file mode 100644 index 00000000..cc0f7162 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformproblemdetailcode.go @@ -0,0 +1,86 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformProblemDetailCode - Stable machine-readable error code. +type PlatformProblemDetailCode string + +const ( + PlatformProblemDetailCodeInvalidRequest PlatformProblemDetailCode = "invalid_request" + PlatformProblemDetailCodeMissingRequiredField PlatformProblemDetailCode = "missing_required_field" + PlatformProblemDetailCodeInvalidParameter PlatformProblemDetailCode = "invalid_parameter" + PlatformProblemDetailCodeInvalidCursor PlatformProblemDetailCode = "invalid_cursor" + PlatformProblemDetailCodeExpiredCursor PlatformProblemDetailCode = "expired_cursor" + PlatformProblemDetailCodeInvalidFilter PlatformProblemDetailCode = "invalid_filter" + PlatformProblemDetailCodeInvalidDatasource PlatformProblemDetailCode = "invalid_datasource" + PlatformProblemDetailCodeAuthenticationRequired PlatformProblemDetailCode = "authentication_required" + PlatformProblemDetailCodeTokenExpired PlatformProblemDetailCode = "token_expired" + PlatformProblemDetailCodeInsufficientPermissions PlatformProblemDetailCode = "insufficient_permissions" + PlatformProblemDetailCodeResourceNotFound PlatformProblemDetailCode = "resource_not_found" + PlatformProblemDetailCodeMethodNotAllowed PlatformProblemDetailCode = "method_not_allowed" + PlatformProblemDetailCodeRequestTimeout PlatformProblemDetailCode = "request_timeout" + PlatformProblemDetailCodeConflict PlatformProblemDetailCode = "conflict" + PlatformProblemDetailCodeGone PlatformProblemDetailCode = "gone" + PlatformProblemDetailCodeUnprocessableQuery PlatformProblemDetailCode = "unprocessable_query" + PlatformProblemDetailCodeRateLimitExceeded PlatformProblemDetailCode = "rate_limit_exceeded" + PlatformProblemDetailCodeInternalError PlatformProblemDetailCode = "internal_error" + PlatformProblemDetailCodeServiceUnavailable PlatformProblemDetailCode = "service_unavailable" +) + +func (e PlatformProblemDetailCode) ToPointer() *PlatformProblemDetailCode { + return &e +} +func (e *PlatformProblemDetailCode) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "invalid_request": + fallthrough + case "missing_required_field": + fallthrough + case "invalid_parameter": + fallthrough + case "invalid_cursor": + fallthrough + case "expired_cursor": + fallthrough + case "invalid_filter": + fallthrough + case "invalid_datasource": + fallthrough + case "authentication_required": + fallthrough + case "token_expired": + fallthrough + case "insufficient_permissions": + fallthrough + case "resource_not_found": + fallthrough + case "method_not_allowed": + fallthrough + case "request_timeout": + fallthrough + case "conflict": + fallthrough + case "gone": + fallthrough + case "unprocessable_query": + fallthrough + case "rate_limit_exceeded": + fallthrough + case "internal_error": + fallthrough + case "service_unavailable": + *e = PlatformProblemDetailCode(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformProblemDetailCode: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/platformproblemdetailerror.go b/tests/mockserver/internal/sdk/models/components/platformproblemdetailerror.go new file mode 100644 index 00000000..058f5e62 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformproblemdetailerror.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PlatformProblemDetailError - Field-level validation problem for a single offending field. +type PlatformProblemDetailError struct { + // RFC 6901 JSON Pointer to the offending field. + Pointer string `json:"pointer"` + // Human-readable explanation for this field. + Detail string `json:"detail"` + // Stable machine-readable error code. + Code *PlatformProblemDetailCode `json:"code,omitempty"` +} + +func (o *PlatformProblemDetailError) GetPointer() string { + if o == nil { + return "" + } + return o.Pointer +} + +func (o *PlatformProblemDetailError) GetDetail() string { + if o == nil { + return "" + } + return o.Detail +} + +func (o *PlatformProblemDetailError) GetCode() *PlatformProblemDetailCode { + if o == nil { + return nil + } + return o.Code +} diff --git a/tests/mockserver/internal/sdk/models/components/platformresult.go b/tests/mockserver/internal/sdk/models/components/platformresult.go new file mode 100644 index 00000000..441ea968 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformresult.go @@ -0,0 +1,113 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/optionalnullable" + "mockserver/internal/sdk/utils" + "time" +) + +type PlatformResult struct { + // Canonical URL of the result. + URL string `json:"url"` + // Result title. + Title string `json:"title"` + // Query-relevant plain-text excerpts from the result body. + Snippets []string `json:"snippets,omitempty"` + // The datasource this result originates from. + Datasource string `json:"datasource"` + // The datasource instance this result originates from, if known. + DatasourceInstance optionalnullable.OptionalNullable[string] `json:"datasource_instance,omitempty"` + // The document type within the datasource. + DocumentType optionalnullable.OptionalNullable[string] `json:"document_type,omitempty"` + // A lightweight reference to a person, used where a payload merely points at someone. + Creator *PlatformPersonReference `json:"creator,omitempty"` + // A lightweight reference to a person, used where a payload merely points at someone. + Owner *PlatformPersonReference `json:"owner,omitempty"` + // When the result was last modified. + UpdatedAt optionalnullable.OptionalNullable[time.Time] `json:"updated_at,omitempty"` + // When the result was created. + CreatedAt optionalnullable.OptionalNullable[time.Time] `json:"created_at,omitempty"` +} + +func (p PlatformResult) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformResult) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"url", "title", "datasource"}); err != nil { + return err + } + return nil +} + +func (o *PlatformResult) GetURL() string { + if o == nil { + return "" + } + return o.URL +} + +func (o *PlatformResult) GetTitle() string { + if o == nil { + return "" + } + return o.Title +} + +func (o *PlatformResult) GetSnippets() []string { + if o == nil { + return nil + } + return o.Snippets +} + +func (o *PlatformResult) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *PlatformResult) GetDatasourceInstance() optionalnullable.OptionalNullable[string] { + if o == nil { + return nil + } + return o.DatasourceInstance +} + +func (o *PlatformResult) GetDocumentType() optionalnullable.OptionalNullable[string] { + if o == nil { + return nil + } + return o.DocumentType +} + +func (o *PlatformResult) GetCreator() *PlatformPersonReference { + if o == nil { + return nil + } + return o.Creator +} + +func (o *PlatformResult) GetOwner() *PlatformPersonReference { + if o == nil { + return nil + } + return o.Owner +} + +func (o *PlatformResult) GetUpdatedAt() optionalnullable.OptionalNullable[time.Time] { + if o == nil { + return nil + } + return o.UpdatedAt +} + +func (o *PlatformResult) GetCreatedAt() optionalnullable.OptionalNullable[time.Time] { + if o == nil { + return nil + } + return o.CreatedAt +} diff --git a/tests/mockserver/internal/sdk/models/components/platformsearchrequest.go b/tests/mockserver/internal/sdk/models/components/platformsearchrequest.go new file mode 100644 index 00000000..108bab41 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformsearchrequest.go @@ -0,0 +1,90 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/optionalnullable" + "mockserver/internal/sdk/utils" +) + +type PlatformSearchRequest struct { + // The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. + // + Query string `json:"query"` + // Number of results to return per page. + PageSize *int64 `default:"10" json:"page_size"` + // Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. + // + Cursor optionalnullable.OptionalNullable[string] `json:"cursor,omitempty"` + // Restrict results to specific datasources. Requests must not specify both `datasources` and `datasource_instances`. + // + Datasources []string `json:"datasources,omitempty"` + // Restrict results to specific datasource instances. Values are datasource instance identifiers returned by `GET /api/search/filters`. Requests must not specify both `datasources` and `datasource_instances`. + // + DatasourceInstances []string `json:"datasource_instances,omitempty"` + // Structured filters applied to search results. Equality operators OR multiple values within a filter. Multiple filters are AND'd together, including range filters on the same field. Filters are AND'd with any inline operators in `query`. Note that conflicting constraints on the same field (e.g., `type:document` in the query and `type: spreadsheet` in a filter) produce an empty result set. + // + Filters []PlatformFilter `json:"filters,omitempty"` + // Filter results to those last updated within this range. + TimeRange *PlatformTimeRange `json:"time_range,omitempty"` +} + +func (p PlatformSearchRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformSearchRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"query"}); err != nil { + return err + } + return nil +} + +func (o *PlatformSearchRequest) GetQuery() string { + if o == nil { + return "" + } + return o.Query +} + +func (o *PlatformSearchRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *PlatformSearchRequest) GetCursor() optionalnullable.OptionalNullable[string] { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *PlatformSearchRequest) GetDatasources() []string { + if o == nil { + return nil + } + return o.Datasources +} + +func (o *PlatformSearchRequest) GetDatasourceInstances() []string { + if o == nil { + return nil + } + return o.DatasourceInstances +} + +func (o *PlatformSearchRequest) GetFilters() []PlatformFilter { + if o == nil { + return nil + } + return o.Filters +} + +func (o *PlatformSearchRequest) GetTimeRange() *PlatformTimeRange { + if o == nil { + return nil + } + return o.TimeRange +} diff --git a/tests/mockserver/internal/sdk/models/components/platformsearchresponse.go b/tests/mockserver/internal/sdk/models/components/platformsearchresponse.go new file mode 100644 index 00000000..e8243de2 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformsearchresponse.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PlatformSearchResponse struct { + // Ordered list of search results. + Results []PlatformResult `json:"results"` + // Indicates whether additional pages of results are available. + HasMore bool `json:"has_more"` + // Opaque token to pass as `cursor` in the next request. + NextCursor *string `json:"next_cursor"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformSearchResponse) GetResults() []PlatformResult { + if o == nil { + return []PlatformResult{} + } + return o.Results +} + +func (o *PlatformSearchResponse) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *PlatformSearchResponse) GetNextCursor() *string { + if o == nil { + return nil + } + return o.NextCursor +} + +func (o *PlatformSearchResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/tests/mockserver/internal/sdk/models/components/platformtimerange.go b/tests/mockserver/internal/sdk/models/components/platformtimerange.go new file mode 100644 index 00000000..b88a152d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformtimerange.go @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +// PlatformTimeRange - Filter results to those last updated within this range. +type PlatformTimeRange struct { + // Inclusive lower bound in ISO 8601 format. + Start *time.Time `json:"start,omitempty"` + // Exclusive upper bound in ISO 8601 format. + End *time.Time `json:"end,omitempty"` +} + +func (p PlatformTimeRange) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformTimeRange) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *PlatformTimeRange) GetStart() *time.Time { + if o == nil { + return nil + } + return o.Start +} + +func (o *PlatformTimeRange) GetEnd() *time.Time { + if o == nil { + return nil + } + return o.End +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentscreaterun.go b/tests/mockserver/internal/sdk/models/operations/platformagentscreaterun.go new file mode 100644 index 00000000..a677b6c1 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformagentscreaterun.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformAgentsCreateRunRequest struct { + // ID of the agent to run. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` + Body components.PlatformAgentRunCreateRequest `request:"mediaType=application/json"` +} + +func (o *PlatformAgentsCreateRunRequest) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgentsCreateRunRequest) GetBody() components.PlatformAgentRunCreateRequest { + if o == nil { + return components.PlatformAgentRunCreateRequest{} + } + return o.Body +} + +type PlatformAgentsCreateRunResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformAgentRunWaitResponse *components.PlatformAgentRunWaitResponse + // Successful response. + Res *string +} + +func (o *PlatformAgentsCreateRunResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformAgentsCreateRunResponse) GetPlatformAgentRunWaitResponse() *components.PlatformAgentRunWaitResponse { + if o == nil { + return nil + } + return o.PlatformAgentRunWaitResponse +} + +func (o *PlatformAgentsCreateRunResponse) GetRes() *string { + if o == nil { + return nil + } + return o.Res +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentsget.go b/tests/mockserver/internal/sdk/models/operations/platformagentsget.go new file mode 100644 index 00000000..9b2282ad --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformagentsget.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformAgentsGetRequest struct { + // ID of the agent to retrieve. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` +} + +func (o *PlatformAgentsGetRequest) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +type PlatformAgentsGetResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformAgentGetResponse *components.PlatformAgentGetResponse +} + +func (o *PlatformAgentsGetResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformAgentsGetResponse) GetPlatformAgentGetResponse() *components.PlatformAgentGetResponse { + if o == nil { + return nil + } + return o.PlatformAgentGetResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentsgetschemas.go b/tests/mockserver/internal/sdk/models/operations/platformagentsgetschemas.go new file mode 100644 index 00000000..117158ef --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformagentsgetschemas.go @@ -0,0 +1,60 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" +) + +type PlatformAgentsGetSchemasRequest struct { + // ID of the agent whose schemas should be retrieved. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` + // Whether to include tool metadata in the response. + IncludeTools *bool `default:"false" queryParam:"style=form,explode=true,name=include_tools"` +} + +func (p PlatformAgentsGetSchemasRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformAgentsGetSchemasRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"agent_id"}); err != nil { + return err + } + return nil +} + +func (o *PlatformAgentsGetSchemasRequest) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgentsGetSchemasRequest) GetIncludeTools() *bool { + if o == nil { + return nil + } + return o.IncludeTools +} + +type PlatformAgentsGetSchemasResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformAgentSchemasResponse *components.PlatformAgentSchemasResponse +} + +func (o *PlatformAgentsGetSchemasResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformAgentsGetSchemasResponse) GetPlatformAgentSchemasResponse() *components.PlatformAgentSchemasResponse { + if o == nil { + return nil + } + return o.PlatformAgentSchemasResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentssearch.go b/tests/mockserver/internal/sdk/models/operations/platformagentssearch.go new file mode 100644 index 00000000..cdbc9f55 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformagentssearch.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformAgentsSearchResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformAgentsSearchResponse *components.PlatformAgentsSearchResponse +} + +func (o *PlatformAgentsSearchResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformAgentsSearchResponse) GetPlatformAgentsSearchResponse() *components.PlatformAgentsSearchResponse { + if o == nil { + return nil + } + return o.PlatformAgentsSearchResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformsearch.go b/tests/mockserver/internal/sdk/models/operations/platformsearch.go new file mode 100644 index 00000000..16b6e86f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformsearch.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformSearchResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful search. + PlatformSearchResponse *components.PlatformSearchResponse +} + +func (o *PlatformSearchResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformSearchResponse) GetPlatformSearchResponse() *components.PlatformSearchResponse { + if o == nil { + return nil + } + return o.PlatformSearchResponse +} diff --git a/tests/mockserver/internal/sdk/models/sdkerrors/platformproblemdetailerror.go b/tests/mockserver/internal/sdk/models/sdkerrors/platformproblemdetailerror.go new file mode 100644 index 00000000..2910d0bd --- /dev/null +++ b/tests/mockserver/internal/sdk/models/sdkerrors/platformproblemdetailerror.go @@ -0,0 +1,36 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "mockserver/internal/sdk/models/components" +) + +// PlatformProblemDetailError - Error response following RFC 9457, extended with `code` and `documentation_url` for machine-readable classification and self-service remediation. +type PlatformProblemDetailError struct { + // URI identifying the error type. + Type string `json:"type"` + // Short, human-readable summary of the error. + Title string `json:"title"` + // HTTP status code mirrored from the response. + Status int64 `json:"status"` + // Human-readable explanation specific to this occurrence. + Detail string `json:"detail"` + // Stable machine-readable error code. + Code components.PlatformProblemDetailCode `json:"code"` + // Direct URL to documentation for this error code. + DocumentationURL *string `json:"documentation_url,omitempty"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` + // Field-level validation problems, one entry per offending field. + Errors []components.PlatformProblemDetailError `json:"errors,omitempty"` + HTTPMeta components.HTTPMetadata `json:"-"` +} + +var _ error = &PlatformProblemDetailError{} + +func (e *PlatformProblemDetailError) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/tests/test_agents.py b/tests/test_agents.py index 46852ff4..8b75a0e0 100644 --- a/tests/test_agents.py +++ b/tests/test_agents.py @@ -1,6 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from glean.api_client import Glean +from glean.api_client import Glean, models import os import pytest from tests.test_client import create_test_http_client @@ -76,8 +76,8 @@ def test_agents_create_and_wait_run(): pass -def test_agents_create_agent(): - test_http_client = create_test_http_client("createAgent") +def test_agents_platform_agents_search(): + test_http_client = create_test_http_client("platform-agents-search") with Glean( server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), @@ -86,5 +86,56 @@ def test_agents_create_agent(): ) as glean: assert glean is not None - res = glean.agents.create_agent() + res = glean.agents.search(name="HR Policy Agent") + assert res is not None + + +def test_agents_platform_agents_get(): + test_http_client = create_test_http_client("platform-agents-get") + + with Glean( + server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), + client=test_http_client, + api_token=os.getenv("GLEAN_API_TOKEN", "value"), + ) as glean: + assert glean is not None + + res = glean.agents.get(agent_id="") + assert res is not None + + +def test_agents_platform_agents_get_schemas(): + test_http_client = create_test_http_client("platform-agents-get-schemas") + + with Glean( + server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), + client=test_http_client, + api_token=os.getenv("GLEAN_API_TOKEN", "value"), + ) as glean: + assert glean is not None + + res = glean.agents.get_schemas(agent_id="", include_tools=False) + assert res is not None + + +def test_agents_platform_agents_create_run(): + test_http_client = create_test_http_client("platform-agents-create-run") + + with Glean( + server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), + client=test_http_client, + api_token=os.getenv("GLEAN_API_TOKEN", "value"), + ) as glean: + assert glean is not None + + res = glean.agents.create_run( + agent_id="", + messages=[ + { + "role": models.PlatformMessageRole.USER, + "content": [], + }, + ], + stream=False, + ) assert res is not None diff --git a/tests/test_authentication.py b/tests/test_authentication.py deleted file mode 100644 index 438848aa..00000000 --- a/tests/test_authentication.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from glean.api_client import Glean -import os -from tests.test_client import create_test_http_client - - -def test_authentication_checkdatasourceauth(): - test_http_client = create_test_http_client("checkdatasourceauth") - - with Glean( - server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), - client=test_http_client, - api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as glean: - assert glean is not None - - res = glean.authentication.checkdatasourceauth() - assert res is not None diff --git a/tests/test_chat_sdk.py b/tests/test_client_agents.py similarity index 74% rename from tests/test_chat_sdk.py rename to tests/test_client_agents.py index f82975aa..93354a84 100644 --- a/tests/test_chat_sdk.py +++ b/tests/test_client_agents.py @@ -5,8 +5,8 @@ from tests.test_client import create_test_http_client -def test_chat_sdk_get_chat_file(): - test_http_client = create_test_http_client("getChatFile") +def test_client_agents_create_agent(): + test_http_client = create_test_http_client("createAgent") with Glean( server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), @@ -15,5 +15,5 @@ def test_chat_sdk_get_chat_file(): ) as glean: assert glean is not None - res = glean.chat.get_chat_file(file_id="") + res = glean.client.agents.create() assert res is not None diff --git a/tests/test_client_authentication.py b/tests/test_client_authentication.py index 1ea7ec89..8e770a85 100644 --- a/tests/test_client_authentication.py +++ b/tests/test_client_authentication.py @@ -25,3 +25,17 @@ def test_client_authentication_createauthtoken(): res = glean.client.authentication.create_token() assert res is not None + + +def test_client_authentication_checkdatasourceauth(): + test_http_client = create_test_http_client("checkdatasourceauth") + + with Glean( + server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), + client=test_http_client, + api_token=os.getenv("GLEAN_API_TOKEN", "value"), + ) as glean: + assert glean is not None + + res = glean.client.authentication.check_datasource_auth() + assert res is not None diff --git a/tests/test_client_chat.py b/tests/test_client_chat.py index 6be5e6a7..e6df2edf 100644 --- a/tests/test_client_chat.py +++ b/tests/test_client_chat.py @@ -9128,3 +9128,17 @@ def test_client_chat_chat_stream_citation_response(): timeout_millis=30000, ) assert res is not None + + +def test_client_chat_get_chat_file(): + test_http_client = create_test_http_client("getChatFile") + + with Glean( + server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), + client=test_http_client, + api_token=os.getenv("GLEAN_API_TOKEN", "value"), + ) as glean: + assert glean is not None + + res = glean.client.chat.retrieve_file(file_id="") + assert res is not None diff --git a/tests/test_client_datasources.py b/tests/test_client_datasources.py new file mode 100644 index 00000000..c9318708 --- /dev/null +++ b/tests/test_client_datasources.py @@ -0,0 +1,78 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from glean.api_client import Glean +import os +from tests.test_client import create_test_http_client + + +def test_client_datasources_get_datasource_instance_configuration(): + test_http_client = create_test_http_client("getDatasourceInstanceConfiguration") + + with Glean( + server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), + client=test_http_client, + api_token=os.getenv("GLEAN_API_TOKEN", "value"), + ) as glean: + assert glean is not None + + res = glean.client.datasources.retrieve_configuration( + datasource_id="o365sharepoint", instance_id="o365sharepoint_abc123" + ) + assert res is not None + + +def test_client_datasources_update_datasource_instance_configuration(): + test_http_client = create_test_http_client("updateDatasourceInstanceConfiguration") + + with Glean( + server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), + client=test_http_client, + api_token=os.getenv("GLEAN_API_TOKEN", "value"), + ) as glean: + assert glean is not None + + res = glean.client.datasources.update_configuration( + datasource_id="o365sharepoint", + instance_id="o365sharepoint_abc123", + configuration={ + "values": {}, + }, + ) + assert res is not None + + +def test_client_datasources_get_datasource_credential_status(): + test_http_client = create_test_http_client("getDatasourceCredentialStatus") + + with Glean( + server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), + client=test_http_client, + api_token=os.getenv("GLEAN_API_TOKEN", "value"), + ) as glean: + assert glean is not None + + res = glean.client.datasources.retrieve_credential_status( + datasource_instance_id="o365sharepoint_abc123" + ) + assert res is not None + + +def test_client_datasources_rotate_datasource_credentials(): + test_http_client = create_test_http_client("rotateDatasourceCredentials") + + with Glean( + server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), + client=test_http_client, + api_token=os.getenv("GLEAN_API_TOKEN", "value"), + ) as glean: + assert glean is not None + + res = glean.client.datasources.rotate_credentials( + datasource_instance_id="o365sharepoint_abc123", + credentials={ + "values": { + "key": {}, + }, + }, + ) + assert res is not None diff --git a/tests/test_datasources.py b/tests/test_datasources.py index b36dd408..8aaeb530 100644 --- a/tests/test_datasources.py +++ b/tests/test_datasources.py @@ -56,76 +56,3 @@ def test_datasources_post_api_index_v1_getdatasourceconfig(): res = glean.indexing.datasources.retrieve_config(datasource="") assert res is not None - - -def test_datasources_get_datasource_instance_configuration(): - test_http_client = create_test_http_client("getDatasourceInstanceConfiguration") - - with Glean( - server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), - client=test_http_client, - api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as glean: - assert glean is not None - - res = glean.datasources.get_datasource_instance_configuration( - datasource_id="o365sharepoint", instance_id="o365sharepoint_abc123" - ) - assert res is not None - - -def test_datasources_update_datasource_instance_configuration(): - test_http_client = create_test_http_client("updateDatasourceInstanceConfiguration") - - with Glean( - server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), - client=test_http_client, - api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as glean: - assert glean is not None - - res = glean.datasources.update_datasource_instance_configuration( - datasource_id="o365sharepoint", - instance_id="o365sharepoint_abc123", - configuration={ - "values": {}, - }, - ) - assert res is not None - - -def test_datasources_get_datasource_credential_status(): - test_http_client = create_test_http_client("getDatasourceCredentialStatus") - - with Glean( - server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), - client=test_http_client, - api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as glean: - assert glean is not None - - res = glean.datasources.get_datasource_credential_status( - datasource_instance_id="o365sharepoint_abc123" - ) - assert res is not None - - -def test_datasources_rotate_datasource_credentials(): - test_http_client = create_test_http_client("rotateDatasourceCredentials") - - with Glean( - server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), - client=test_http_client, - api_token=os.getenv("GLEAN_API_TOKEN", "value"), - ) as glean: - assert glean is not None - - res = glean.datasources.rotate_datasource_credentials( - datasource_instance_id="o365sharepoint_abc123", - credentials={ - "values": { - "key": {}, - }, - }, - ) - assert res is not None diff --git a/tests/test_entities.py b/tests/test_entities.py index c6b986f4..6479bed7 100644 --- a/tests/test_entities.py +++ b/tests/test_entities.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from glean.api_client import Glean, models -from glean.api_client.entities import GetPersonPhotoAcceptEnum +from glean.api_client.entities import RetrievePersonPhotoAcceptEnum import os import pytest from tests.test_client import create_test_http_client @@ -76,7 +76,8 @@ def test_entities_get_person_photo(): ) as glean: assert glean is not None - res = glean.entities.get_person_photo( - person_id="", accept_header_override=GetPersonPhotoAcceptEnum.IMAGE_PNG + res = glean.client.entities.retrieve_person_photo( + person_id="", + accept_header_override=RetrievePersonPhotoAcceptEnum.IMAGE_PNG, ) assert res is not None diff --git a/tests/test_governance.py b/tests/test_findings.py similarity index 85% rename from tests/test_governance.py rename to tests/test_findings.py index 16b5840b..bc9f6357 100644 --- a/tests/test_governance.py +++ b/tests/test_findings.py @@ -6,7 +6,7 @@ from tests.test_client import create_test_http_client -def test_governance_listfindingsexports(): +def test_findings_listfindingsexports(): test_http_client = create_test_http_client("listfindingsexports") with Glean( @@ -16,12 +16,12 @@ def test_governance_listfindingsexports(): ) as glean: assert glean is not None - res = glean.governance.listfindingsexports() + res = glean.client.governance.data.findings.list() assert res is not None @pytest.mark.skip( reason="incomplete test found please make sure to address the following errors: [`workflow step downloadfindingsexport.test contains criterion simple with invalid condition`, `workflow step downloadfindingsexport.test does not contain $contentType successCriteria and required for response body assertion`]" ) -def test_governance_downloadfindingsexport(): +def test_findings_downloadfindingsexport(): pass diff --git a/tests/test_messages.py b/tests/test_messages.py index dfdc1864..36643db3 100644 --- a/tests/test_messages.py +++ b/tests/test_messages.py @@ -18,7 +18,7 @@ def test_messages_messages(): res = glean.client.messages.retrieve( id_type=models.IDType.CONVERSATION_ID, id="", - datasource=models.Datasource.SLACKENTGRID, + datasource=models.Datasource.MICROSOFTTEAMS, timestamp_millis=558834, ) assert res is not None diff --git a/tests/test_search.py b/tests/test_search.py index df2944eb..e8c5284c 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -2204,3 +2204,37 @@ def test_search_search(): timeout_millis=5000, ) assert res is not None + + +def test_search_platform_search(): + test_http_client = create_test_http_client("platform-search") + + with Glean( + server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), + client=test_http_client, + api_token=os.getenv("GLEAN_API_TOKEN", "value"), + ) as glean: + assert glean is not None + + res = glean.search.query( + query="quarterly planning 2026", + page_size=10, + datasources=[ + "confluence", + "google_drive", + ], + datasource_instances=[ + "slack_acme", + "slack_eu", + ], + filters=[ + { + "field": "type", + "values": [ + "spreadsheet", + "presentation", + ], + }, + ], + ) + assert res is not None diff --git a/tests/test_summarize.py b/tests/test_summarize.py index df71d57d..a3e49087 100644 --- a/tests/test_summarize.py +++ b/tests/test_summarize.py @@ -18,12 +18,12 @@ def test_summarize_summarize(): res = glean.client.documents.summarize( document_specs=[ { - "ugc_type": models.DocumentSpecUgcType2.ANNOUNCEMENTS, + "ugc_type": models.DocumentSpecUgcType2.SHORTCUTS, "ugc_id": "", }, { - "ugc_type": models.DocumentSpecUgcType1.COLLECTIONS, - "content_id": 885812, + "ugc_type": models.DocumentSpecUgcType2.SHORTCUTS, + "ugc_id": "", }, ] ) diff --git a/tests/test_tools.py b/tests/test_tools.py index e9c3dac5..6dfee17c 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -51,7 +51,7 @@ def test_tools_get_action_pack_auth_status(): ) as glean: assert glean is not None - res = glean.tools.get_action_pack_auth_status(action_pack_id="") + res = glean.client.tools.retrieve_action_pack_auth_status(action_pack_id="") assert res is not None @@ -65,7 +65,7 @@ def test_tools_authorize_action_pack(): ) as glean: assert glean is not None - res = glean.tools.authorize_action_pack( + res = glean.client.tools.authorize_action_pack( action_pack_id="", return_url="https://merry-allocation.org/" ) assert res is not None From 733b5d1af6fbcf96cdebf93f20c3257075769e17 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Thu, 2 Jul 2026 17:50:34 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow