diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index c34ed015..5e1ac15a 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: a20695749796cddfd0cc7c0e4a12a7ab + docChecksum: f2cfaf20e250fd8c41b303e53bb0feb0 docVersion: 0.9.0 - speakeasyVersion: 1.770.0 - generationVersion: 2.893.0 - releaseVersion: 0.13.0 - configChecksum: fbdf6564dabfc66d8d43921f9aab9d41 + speakeasyVersion: 1.784.0 + generationVersion: 2.911.0 + releaseVersion: 0.13.1 + configChecksum: 20bd16de79b24045996092730c7ef165 repoURL: https://github.com/gleanwork/api-client-python.git installationURL: https://github.com/gleanwork/api-client-python.git published: true persistentEdits: - generation_id: 987864f6-cd1e-4c05-a16b-4739643415d0 - pristine_commit_hash: 06cc8c7f7c551cc2f82ad39dd38c63fe2ca63e29 - pristine_tree_hash: 9cd8d96d15f384f677b54671075391a45cdd533f + generation_id: e7bba639-10bc-4474-ba96-05b61d15cfce + pristine_commit_hash: f79a8ace0b52b9906bb77c03bb46b63f0cc964d1 + pristine_tree_hash: 2ea1e3aaf35714b604d2ec0baaff8fcb2f829da8 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.24 + core: 6.0.30 defaultEnabledRetries: 0.2.0 deprecations: 3.0.2 devContainers: 3.0.0 @@ -36,17 +36,17 @@ features: globalSecurityFlattening: 1.0.0 globalServerURLs: 3.2.1 groups: 3.0.1 - methodArguments: 1.1.0 + methodArguments: 1.1.1 methodServerURLs: 3.1.2 mockServer: 0.1.4 multipartFileContentType: 1.0.0 nameOverrides: 3.0.3 responseFormat: 1.1.0 - retries: 3.0.5 - sdkHooks: 1.2.1 - tests: 1.19.9 - unions: 3.1.5 - uploadStreams: 1.0.2 + retries: 3.0.7 + sdkHooks: 1.2.2 + tests: 1.19.10 + unions: 3.1.6 + uploadStreams: 1.0.3 trackedFiles: .devcontainer/README.md: id: b170c0f184ac @@ -222,8 +222,8 @@ trackedFiles: pristine_git_object: 69acef4de938067397980887e41d16ff3df23529 docs/models/allowlistoptions.md: id: ba4d408f7c0f - last_write_checksum: sha1:552aedb8f14b744735e387cac111e935991b6330 - pristine_git_object: e986d96670dfd60f104d4690368bd5f08153a4fa + last_write_checksum: sha1:bfb1bfdc89ff18c7b2a1f4674afaee48ebd536ae + pristine_git_object: e1c6f3876247ed4fa2fdce53f576ad5945b2f670 docs/models/announcement.md: id: b48819ef2145 last_write_checksum: sha1:6abbccb48016fff478e8edf48b8a51621d850a54 @@ -612,6 +612,10 @@ trackedFiles: id: fdce0b0bc491 last_write_checksum: sha1:6ba12c90efff718bdd939e773d0426df695090d4 pristine_git_object: dd22b66754081ff30b9d76cfc937603c6d80d965 + docs/models/createagentrequest.md: + id: 9484bab389c1 + last_write_checksum: sha1:2d1e18eb538b82a4e4448cf66696872d8f138b9c + pristine_git_object: 6d556c537edb110ad9d80ee992b5f12a3974713e docs/models/createannouncementrequest.md: id: a37b0e57dfe9 last_write_checksum: sha1:5da6f2bd206ac915200248706e91c0601a4c7d79 @@ -672,6 +676,10 @@ trackedFiles: id: 82707fc9efe5 last_write_checksum: sha1:320bddb9b5ab5dec88760d844b2d585aea2d87f8 pristine_git_object: f3315390350a0db0d3eded212d626abc52c0c834 + docs/models/createworkflowrequest.md: + id: dd9173517846 + last_write_checksum: sha1:0c65e19e884a9444d65dbe54e93073f7d2f7d88f + pristine_git_object: e955a419d336ed9e949e8cab1f341aac83901665 docs/models/currentactiveusers.md: id: 8c45d84c2408 last_write_checksum: sha1:74a4477b894de8d1caca58492504b472a82a94c2 @@ -994,8 +1002,8 @@ trackedFiles: pristine_git_object: e29b2f5fe2b191a8ad8f3e225b6accc748b81e2f docs/models/dlpconfig.md: id: bee569951c5c - last_write_checksum: sha1:a7cafb975a5bca6458a7c4a50e1f98d3d29e1a18 - pristine_git_object: eec4bb2823477745162b6a604d6ed6547bdfcdbd + last_write_checksum: sha1:de8dbe6b705782751b1470f8fca7807df1370387 + pristine_git_object: e99c7c037122ad1b1ba8b3f491460746db994d11 docs/models/dlpexportfindingsrequest.md: id: 846a7d063614 last_write_checksum: sha1:9ca5aec938795a317d000ea1f234a9c64d85be47 @@ -1342,8 +1350,8 @@ trackedFiles: pristine_git_object: a851a7f13eb25d515fa9b9244c5dfdc98fa14e2c docs/models/feedrequestcategory.md: id: 31a02f3064c7 - last_write_checksum: sha1:864d482f0e5991b6e68d380cf56b9e831c473503 - pristine_git_object: a4e28a088012c3ad5150dacc7d9c827b22682aa9 + last_write_checksum: sha1:f97a0f71e53f30efa4515d2f7bc5c0b0b818d1de + pristine_git_object: 07efe28314960724b332c8eb760a770002e1db3a docs/models/feedrequestoptions.md: id: 58eb26b19e77 last_write_checksum: sha1:fd2ab08736cef8156169b0cfee8c52e7aed1accf @@ -1358,20 +1366,20 @@ trackedFiles: pristine_git_object: 7f3ded753911005508191be31592746cef1c2781 docs/models/feedresult.md: id: 4b67dc1cea64 - last_write_checksum: sha1:88483849cc6d4bcfe685cf25a593e9ab50d47c26 - pristine_git_object: 6318b0206b7d4027b036e78c709ed4eb259ccedb + last_write_checksum: sha1:6781234248531681b38a1394afc7a62438440758 + pristine_git_object: f14153ca4fc73e08d620714d4ed5ef2c0bad05c5 docs/models/feedresultcategory.md: id: a5f77f38d0a7 - last_write_checksum: sha1:97990b6481189431a706847e927154583ee09270 - pristine_git_object: 5d0a0beb0c0210a48a7125715620b446c1fdde46 + last_write_checksum: sha1:f4b4c8bf745f9b4f121422a6326c1e4cf1d41a3a + pristine_git_object: 37520b3361d5534017b26e0381c7af8c2c931430 docs/models/fieldscope.md: id: e6b52bcb22a6 last_write_checksum: sha1:13a1492ce39d2f89a01d626996a345a1339a1873 pristine_git_object: 3c3c097ac04d2e75a6cff47985e6688cf027d236 docs/models/file.md: id: 4ad31355bd1c - last_write_checksum: sha1:ade4d3c908c664a07a3c333cc24bc1bfb43ab88b - pristine_git_object: 37cc418f9e5189c18f312c42060fd702e2963765 + last_write_checksum: sha1:3e65f2007c5f8611f830db1406f2bf41a998064b + pristine_git_object: b8713ed6e335b8aa2d39d77a5d56819ee7be12a7 docs/models/followupaction.md: id: 5c7a87d7ed17 last_write_checksum: sha1:c554d9907c2a862ba7d07855bdcbfad06f7631ce @@ -1650,8 +1658,8 @@ trackedFiles: pristine_git_object: c1d48433bcb643f3403e312a32ebbd2a91909f60 docs/models/grouptype.md: id: ca781cf2b1c3 - last_write_checksum: sha1:413a748c346eac3513abddae0d69276e14e52d0a - pristine_git_object: 4e38962c518a55b094e86abba5886f06b4e84c40 + last_write_checksum: sha1:fdc6ccb650825171da890bdf4938250236299c22 + pristine_git_object: 289506119440d77a6f1e1616f6167c856e3a2f90 docs/models/hidebuiltinfacet.md: id: 338b17567126 last_write_checksum: sha1:6fe74dd1957d4050706a4bbce1c1c413fafe12e9 @@ -1778,8 +1786,8 @@ trackedFiles: pristine_git_object: 4203309096512cab077b45bc77906df389c01421 docs/models/justificationtype.md: id: 8286affacee4 - last_write_checksum: sha1:471d436013bd93750dd63edbe0f8ddaa799d2fca - pristine_git_object: adf5b69bdf3cd8c90a108b8fcca2b79a38acddc1 + last_write_checksum: sha1:73ae0d9428ef3185ad19cab8c4834cf5c952dba6 + pristine_git_object: 442119bc4f619c2fe80c6004e4a02d5c81207e2b docs/models/knowledgetype.md: id: 1e0c90679228 last_write_checksum: sha1:0030a7539b9362bbb59e0bbd36580676058b3540 @@ -2100,6 +2108,10 @@ trackedFiles: id: 52df3106f8dd last_write_checksum: sha1:64309a6e996c663f2f34cea4390bab0b5909764e pristine_git_object: a24b8b95237035cda5ff134a9c0cc3bb601e06d7 + docs/models/placementreason.md: + id: e3d1cdfcf2b5 + last_write_checksum: sha1:f4720f3ce89ed29c92e2bd0aa15169ccc428bafd + pristine_git_object: 515cd010b7035e35f410e715d18da9c175d18e89 docs/models/possiblevalue.md: id: 630387aebbc5 last_write_checksum: sha1:490f03fc39621ae0f816bb16d2922e1a8042cdb1 @@ -2838,8 +2850,8 @@ trackedFiles: pristine_git_object: 61dd41f0319201cc105e29174ab1cc0018cecbce docs/sdks/agents/README.md: id: 5965d8232fd8 - last_write_checksum: sha1:f78cc3314d4fdb3c52fcf5b49e01706bc2832bde - pristine_git_object: b929a12d5df1c8a99533448d6c5e6d60f4e17fc0 + last_write_checksum: sha1:48c7b15dfcda891f9a1a2e5ad4bd6eac6f1ca056 + pristine_git_object: 00789fbf58096090a54c254a0f112588042626cb docs/sdks/announcements/README.md: id: 3d2e130a217c last_write_checksum: sha1:ecfa655bb27dee6890656542cfafda0aa6ed1ab9 @@ -2990,8 +3002,8 @@ trackedFiles: pristine_git_object: 79e388be87446ab6a4064b372bad0e8376d0cb5e pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:a3a7799c7cc183344491cfa36f7a0b3c7aba85ff - pristine_git_object: f34dd6a5342bf6af6b1000135c5f479020c0c39b + last_write_checksum: sha1:3159bd445181fc0d0f3097d2b1a72e11f767d0db + pristine_git_object: af1e59cf30ac3ab37f9dc80989f7233e43882a7d scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:c2c83f71dea61eb50c9e05da83b16d18b4da8794 @@ -3018,20 +3030,20 @@ trackedFiles: pristine_git_object: 58c4d70ac1797b86ff5c4237cafbc344c42d8f64 src/glean/api_client/_version.py: id: 0ce22b26136b - last_write_checksum: sha1:ea55ade5532c483da10f1cfec9b6ceccde7522d6 - pristine_git_object: 8d9da6a0d3001f2f5448cc7fb89443c4d02ba5ad + last_write_checksum: sha1:abd8e7c13550ea10839f9454a5b1da1babec1fea + pristine_git_object: 9f3bfa3d71139116bfddccc32ee6f5e3b6b6d705 src/glean/api_client/agents.py: id: b925701a9217 - last_write_checksum: sha1:c90940a6d28847540858c932148d29ef50cac7ec - pristine_git_object: 99f5f6604807830add51abbd79fa0fc82572a11c + last_write_checksum: sha1:c0ef88b0ad7565cfb342c2311587d70e0f18ae57 + pristine_git_object: 2be171859072eeaa3ea7c0bb77de271caa792ed6 src/glean/api_client/announcements.py: id: 452f3d593912 - last_write_checksum: sha1:0767c840c29bba9e3c95bbbd714df374f2907b00 - pristine_git_object: 33123a0a80e55c210fcfb07e47dc9c7cac7e15d9 + last_write_checksum: sha1:63ce0f301a88a9524ab6bbc75d617fea68d283e4 + pristine_git_object: 48d83997d1802da6a568e6fd004aafd9f03b460d src/glean/api_client/answers.py: id: 184a18f8be7e - last_write_checksum: sha1:b839b0e5abf3b11790a98fe100f84f5a3b3254e9 - pristine_git_object: 0757b71f8300ccbd72db4c292ffdf03b03f93231 + last_write_checksum: sha1:910e131bf3b9ce135961b4c810ba008cb0d2ceb9 + pristine_git_object: 20c371ad26e9a541915bbd16eeb9c1c2137a453e src/glean/api_client/authentication.py: id: 84ebb3cfd339 last_write_checksum: sha1:9274054daf1c09ba374849588b20349b079088ea @@ -3050,52 +3062,52 @@ trackedFiles: pristine_git_object: 122be2b984e54e47078c9b37e5722f1aa78b6e28 src/glean/api_client/client_activity.py: id: 8227dd95d034 - last_write_checksum: sha1:7c9fa340b6f5fde6a298fe96f5631cf0b65c7cf0 - pristine_git_object: 0fc1ce18d5ce25d5a371abf17dc974932bb603a8 + last_write_checksum: sha1:dd786de146fb18f813abe7454dee4e40158e5347 + pristine_git_object: 5465d474c851a08895630a7fa9fbd0bc421a0d61 src/glean/api_client/client_agents.py: id: 61b53ccd2b3b - last_write_checksum: sha1:6d12ed745ef6012f59c318195e84c3099e96b081 - pristine_git_object: 6e1ff0f49e8924942f90c22977e38af3d6fb865d + last_write_checksum: sha1:b4b711854c3e872d47a66c271801649453ba19fe + pristine_git_object: 7bc31e5f9550cbd02513002e870af19657c1f134 src/glean/api_client/client_authentication.py: id: 0b237b7c1b11 last_write_checksum: sha1:534efe91d637ae41aa5791b672b2ef91a3fbb81b pristine_git_object: b2e67417be8b3c4927603fb275831447988e9de6 src/glean/api_client/client_chat.py: id: 42cbb9b5acf3 - last_write_checksum: sha1:75b70a975b72b0a748a33fbea4c2e951c89265ca - pristine_git_object: f1e89630d067883690a6fe35687b58a8d2db627e + last_write_checksum: sha1:628139d93bfd23dd4d4956acc9ec0d0f668cc727 + pristine_git_object: f506bfc8a02a5eb8444e02da81daeccc2882bea3 src/glean/api_client/client_documents.py: id: dac599de515c - last_write_checksum: sha1:7a41dae11c9e0c58be6e2e8fe07be6f78d8f24bb - pristine_git_object: c270bf21a93e6b5f3befa10e8975635f18ae2fe9 + last_write_checksum: sha1:f960872f8feecf156459dbfbf2724386df439837 + pristine_git_object: 720450643daf37a932928927b01d2018ffdc33d3 src/glean/api_client/client_entities.py: id: 5a17ae87ac6c - last_write_checksum: sha1:ca58f63deb474cbf31b3da3229e5cc6842631c21 - pristine_git_object: 67fbc0db4c5234d05613f9f37fcf7c382316ecc1 + last_write_checksum: sha1:36b6d96baecd1561239afa1eeaa2b2e09f2bb7be + pristine_git_object: 8f19017d1ada17a9da7b6d2370615f76f70fc01a src/glean/api_client/client_governance.py: id: 106860f10ce0 last_write_checksum: sha1:ebe769873505002b9f00342174c7fd2508af52b6 pristine_git_object: 6011411d2ab08645047358a30c0a87aec61555bc src/glean/api_client/client_shortcuts.py: id: 5ef5dacbcba9 - last_write_checksum: sha1:6bfa420d42f76ed01b60f93abf77ef404d8fa631 - pristine_git_object: a4db274d2b324b9b24a9aa2e5673b229f44d45f1 + last_write_checksum: sha1:a3b62ef016f7254425b99a17df6f16963ac57055 + pristine_git_object: b994e7d26ad43217437c5d5c2d897432db39b794 src/glean/api_client/client_tools.py: id: df600583b558 - last_write_checksum: sha1:5309a9ee24043c49e41c757f575c3d2af899dca3 - pristine_git_object: 14d9f68cc6a74ea72988f7d041dfeb4bffa61921 + last_write_checksum: sha1:3ccc63fabeb10d5578eeebdffdbc93501ce8d9c2 + pristine_git_object: 7cfb900c12ade96665ddc562b525d624166146d2 src/glean/api_client/client_verification.py: id: 211199afa506 last_write_checksum: sha1:468067c52776c584837bccef6db419ea5b339d79 pristine_git_object: 69a3abb71a49fc4cbdb64523f90877d308d1f886 src/glean/api_client/collections.py: id: df34f0fd10dd - last_write_checksum: sha1:f974525cf6b9db9f6be2085224b34653adb9894a - pristine_git_object: f93e472ce543b8e4e46e53c013c680b4f0f031ed + last_write_checksum: sha1:4d5d630346e7f8250b3ecdde182a01129895eb9e + pristine_git_object: fe1c6c917aaf2a5952ccccc7f6ca89a5f39d7313 src/glean/api_client/custommetadata.py: id: d5621a2ad56e - last_write_checksum: sha1:f50c4d35b769079359d852c2f31bcf7237422e38 - pristine_git_object: da51ad9d6751b4fc689538f37db09201189ccb6d + last_write_checksum: sha1:8e5c52c366e4a641bbf160d814757689c059e080 + pristine_git_object: 768525cb007456a3036b7dd42f9cf227c6b814ba src/glean/api_client/data.py: id: 21cf13413429 last_write_checksum: sha1:f03b31e07a912efca080d9298fbb45e16590702c @@ -3146,8 +3158,8 @@ trackedFiles: pristine_git_object: 3e029c12197bb87be06e01323afbc495968a6eaa src/glean/api_client/governance.py: id: e30db8f06e58 - last_write_checksum: sha1:0104a09486062677211230ce8fe2c3dab32a1da1 - pristine_git_object: fd67e05d451590fe3337ad8c8728141035d62294 + last_write_checksum: sha1:90fd16566302ac8cc6529893b7bd4e765033392d + pristine_git_object: 2e662f2bc0f2e2d8ab7afa8ea910b8cca14c2ae1 src/glean/api_client/governance_documents.py: id: e5ab033181fd last_write_checksum: sha1:761beada29ea72f570c55e6377706671d3b8fcbd @@ -3170,20 +3182,20 @@ trackedFiles: pristine_git_object: 0bb158571a104fc4434c1e37680aeb6b7c361e38 src/glean/api_client/indexing_datasources.py: id: 9520e2db8686 - last_write_checksum: sha1:3ac36de64f6216aae0dd69f046bb235dc8bbb8b4 - pristine_git_object: b8b091e823c403c72782ec71db1015aaa6e1cfd9 + last_write_checksum: sha1:d802091ca98a5f4582d95c564117253293405f54 + pristine_git_object: aadeae1444882e049543266e4a9cc1ccc51ae403 src/glean/api_client/indexing_documents.py: id: b5c2b64ee1fa - last_write_checksum: sha1:488660c9bc6160d20012c5e5ab7904c56c276b34 - pristine_git_object: 9817af75d822b6cc1e9eab2ba736819507b0a887 + last_write_checksum: sha1:dd5228d458d97e7f27faa2baed099afaab82f01d + pristine_git_object: 0fc7c88907b6ff0013dd89c8c4e40990b6c8dccb src/glean/api_client/indexing_permissions.py: id: 86fd3f14396c - last_write_checksum: sha1:3e0cb356c1ecc74b3c4fe356b81a3f9e71abe602 - pristine_git_object: c41d5c914dde853dc5403675c3fe0a6108c8db21 + last_write_checksum: sha1:aa1a085d8ab9c2939734b05328304b0b96889379 + pristine_git_object: ce426af46bb46345c41157c4efe7497bbe1f95ca src/glean/api_client/indexing_shortcuts.py: id: e833440cda56 - last_write_checksum: sha1:0dda65c83c173524f8ab4574b8c2b17c3ec884f1 - pristine_git_object: bdfdec85c7d5d5b2cd2cbd09fe5578a78b83c6aa + last_write_checksum: sha1:1254d6adcb57716e131e30e18c46cd18d68f89ba + pristine_git_object: 8e657a10010fd770dea4db539757b6837c34a138 src/glean/api_client/insights.py: id: 4c5708d15234 last_write_checksum: sha1:28398156138e38f0cb8d185bacd54b5aa2cc3ce2 @@ -3194,8 +3206,8 @@ trackedFiles: pristine_git_object: fd580d9a1b7770b488fc424b5f8735d8b9bf681e src/glean/api_client/models/__init__.py: id: d5f6ea5efcbe - last_write_checksum: sha1:5d16cf04d5ea346a12e547e4bfb5ec60f2a656a9 - pristine_git_object: 101111712c9ec0750a3b5599790b4acbf5c9b0e7 + last_write_checksum: sha1:879cdb855fcd2f4219941ba570a69e46f127216e + pristine_git_object: 6292b5752f5b13f8c222147c83c259909213de12 src/glean/api_client/models/actionauthtype.py: id: c7402f35092d last_write_checksum: sha1:7aaa5d1c11b105d0d7265e2a83cb005aafa89645 @@ -3306,8 +3318,8 @@ trackedFiles: pristine_git_object: 13ed679e9400d9033694cfe6c511fb29cbb6932c src/glean/api_client/models/allowlistoptions.py: id: 956eeade455c - last_write_checksum: sha1:a561950c840b4f1e53361dd3bea159fc618f659b - pristine_git_object: 123b345c647c7b305de2915ba7534f9c550eadc5 + last_write_checksum: sha1:60e440360bb3afc80ac0c66ffb03640979ce6426 + pristine_git_object: 0059b3cd1a9aab08d223c9c720fe273155308c08 src/glean/api_client/models/announcement.py: id: acb78a04f33a last_write_checksum: sha1:1ba73ff9151920215ac9c19081b549ab7b32188f @@ -3616,6 +3628,10 @@ trackedFiles: id: 2ff7e2d8021d last_write_checksum: sha1:5203cc6e6506bd574e163b2b18d879c4b19c8a99 pristine_git_object: 83d1aa3b243827c0f27678d94a209aac0a4417b3 + src/glean/api_client/models/createagentop.py: + id: bca1b44cf62a + last_write_checksum: sha1:bc9b540e390ca872fe40d0188311660a039a3881 + pristine_git_object: 4ed4192dbb6da328182b40d002360698706b872e src/glean/api_client/models/createannouncementop.py: id: bf2cd073d77d last_write_checksum: sha1:a636cc5aa94d72878446b69b6ca0e3e91482de2c @@ -3664,6 +3680,10 @@ trackedFiles: id: 65fdd9436d15 last_write_checksum: sha1:285ec74a6e451aa0a6698d663cf501dbd0a24bd6 pristine_git_object: 7fd2e6eb90ed6027e2647312ca3550abc0292b74 + src/glean/api_client/models/createworkflowrequest.py: + id: d084964549e1 + last_write_checksum: sha1:8575c9df02747f481fa8723f4a985c0bded046a3 + pristine_git_object: 206d00f37547917505f9c5a54aaffe7dc6aaf224 src/glean/api_client/models/currentactiveusers.py: id: 0a092cf79074 last_write_checksum: sha1:989717f16473a1c661194af34f9940eb00a26e01 @@ -3946,8 +3966,8 @@ trackedFiles: pristine_git_object: 3e0031b797c3153b0f85b2d219b553fb6f259cf1 src/glean/api_client/models/dlpconfig.py: id: 5012b123f4c3 - last_write_checksum: sha1:ece6188f60c80ab57d3cf8b84c78dcfc2b9420d7 - pristine_git_object: f68bba2b791930a7eff5708502c833d255211f18 + last_write_checksum: sha1:8c4fba40b04eec26d2576f2814037bf55e130918 + pristine_git_object: 5b5700539aee6854e0d421192dc28507d7b04553 src/glean/api_client/models/dlpexportfindingsrequest.py: id: 8776242985ea last_write_checksum: sha1:12a9bc4ffea8f15dbedc67be21158106a56d6ea1 @@ -4206,16 +4226,16 @@ trackedFiles: pristine_git_object: 44041cb376d89949c815ea1e7813505940605855 src/glean/api_client/models/feedentry.py: id: 023eb6c10ae1 - last_write_checksum: sha1:93e85da47116a61d8c9db59ad3bacb954060fce3 - pristine_git_object: eb60f1bdba8b60701958ac591d618e7a0ba5bbc9 + last_write_checksum: sha1:cc44921011cbe99a84d8289ec39e405ed472047b + pristine_git_object: e0057c6b658bcac2f6f779483cb326229796eca7 src/glean/api_client/models/feedop.py: id: b8067ac0a127 last_write_checksum: sha1:c58cb0a3a01925eb14d84176c5c6e9d8f4d84cf1 pristine_git_object: f39626285f84630e5a9233736d652914b759d44b src/glean/api_client/models/feedrequest.py: id: 33496b6a5bab - last_write_checksum: sha1:5c9e71cf8fa61ba2664083654567dfa83035110f - pristine_git_object: 22ab9c4e3a119478466611c6d1b62847f312a20f + last_write_checksum: sha1:368afa62c551563db21d80e3cdd38c9f55343647 + pristine_git_object: d6641777bbf3547507855855b8e07dfa2b7db527 src/glean/api_client/models/feedrequestoptions.py: id: b99003fbf522 last_write_checksum: sha1:d5ffee29242075cbe6d2dd5ec916b0c3d40acf54 @@ -4226,8 +4246,8 @@ trackedFiles: pristine_git_object: 683438c837601f483526ec18756fadc7222edb24 src/glean/api_client/models/feedresult.py: id: ae187332b37a - last_write_checksum: sha1:c9d4daf7c06053ce4a52c93acedc8dba5e144f52 - pristine_git_object: c3ee3e987de032926291cf44340b32b3d3678a52 + last_write_checksum: sha1:2d3c16767cd27cc94ddbe67744c75968676923c3 + pristine_git_object: 1f1f66a2cd86cb9db66cf02c45162e80cc5b716b src/glean/api_client/models/followupaction.py: id: e2de5c4c8524 last_write_checksum: sha1:49e1a826449081fecfcd828c940604db949a8533 @@ -4474,8 +4494,8 @@ trackedFiles: pristine_git_object: f1b4a7e932c2605014da90f15aca4546c4f0a68d src/glean/api_client/models/grouptype.py: id: 64925e34480c - last_write_checksum: sha1:c8119cbb1f44d407b78c99228be80c65cdcdbcf9 - pristine_git_object: c94336ed992ffa187193a41ac0a1b2e072d25338 + last_write_checksum: sha1:8b69c4bf7a96fe5ea89e05741eab3b542061b207 + pristine_git_object: 88a980fb7f1e533c63641e3d9c445d233f751fcd src/glean/api_client/models/hotword.py: id: 0a4b0a179e14 last_write_checksum: sha1:8852104f422c25d298bbc9d2975e820ef744a5a2 @@ -5286,8 +5306,8 @@ trackedFiles: pristine_git_object: 4aafc91088fbdc1fe88f61ea577e131b6bbea769 src/glean/api_client/models/uploadchatfilesrequest.py: id: c648ec79e147 - last_write_checksum: sha1:30d482b8435697b94c62f72ae38a235ea9e1f2e6 - pristine_git_object: 8e8d01c07cc98fb2347ea8e94b0ecc3d1a10ee0b + last_write_checksum: sha1:801b0ae17d628285d5ed6aa4692a58f457a15c84 + pristine_git_object: 1a4665d1033518469a94a1ad73000324aa95df97 src/glean/api_client/models/uploadchatfilesresponse.py: id: 73c5f35b8280 last_write_checksum: sha1:8876a4b054e7099e4ab7be02969b945f19618a92 @@ -5382,12 +5402,12 @@ trackedFiles: pristine_git_object: 85e816dc7cea2c95b4e067d756e428be2696d0a4 src/glean/api_client/people.py: id: e32c03723ded - last_write_checksum: sha1:5e61d51a667fef9cab9fc6f597a17fcff6df1f79 - pristine_git_object: 8f853d2a543d89ce7553b9e67dd3cf6bfc64c2b7 + last_write_checksum: sha1:8896032bffef1f93990712a1aa6aefbd0bf8b255 + pristine_git_object: 9d0027767af65a0c033f141c05e8464528831195 src/glean/api_client/pins.py: id: 4a37ead65f8a - last_write_checksum: sha1:064a62119d9345a93c5b14a465e70e88df97e591 - pristine_git_object: 0127c0074ca0c944349830ab3806d893f1c4ba4e + last_write_checksum: sha1:67d310095ef3713b8fd8745402b2d54e40331d1e + pristine_git_object: 8635dd29bf9b30ec0a9f8396d501e55c8a624d1f src/glean/api_client/policies.py: id: 680f941e0620 last_write_checksum: sha1:b2509e090e4e63b42c01a0592bcdf857122b7c02 @@ -5410,8 +5430,8 @@ trackedFiles: pristine_git_object: 22e0a4eab0ef8e54dcfd986084d01c14a56f47a6 src/glean/api_client/search.py: id: a3b404a8b402 - last_write_checksum: sha1:69ed4e3adb9f484f5b83d601aa6c7cce686b2055 - pristine_git_object: 2274683221d56688636689111335be70ddf62a99 + last_write_checksum: sha1:b791a69934ab2eb1e0caa2bf0cb059022ca3666b + pristine_git_object: d599dd5aa7a7a4a22d3ec866631965f2cd473cd2 src/glean/api_client/tools.py: id: 3ea40147c1cc last_write_checksum: sha1:c9b1636b2cde77d5a505ce01225171a4305e36d9 @@ -5426,8 +5446,8 @@ trackedFiles: pristine_git_object: faa268137bc01c9d08cfadc4797017db48747a96 src/glean/api_client/types/base64fileinput.py: id: 83c3e0b80185 - last_write_checksum: sha1:4780e893d3853b5a6e28d9a6ca3ee102ce0f502d - pristine_git_object: 25fc53989ed497649363f983219fc58705c8bf87 + last_write_checksum: sha1:1522687ae3398374c35710cad993a6e82b5ab99d + pristine_git_object: 862566fe2b1db830276b390e136e65090e5963d2 src/glean/api_client/types/basemodel.py: id: 436a12e02484 last_write_checksum: sha1:10d84aedeb9d35edfdadf2c3020caa1d24d8b584 @@ -5454,12 +5474,12 @@ trackedFiles: pristine_git_object: 3324e1bc2668c54c4d5f5a1a845675319757a828 src/glean/api_client/utils/eventstreaming.py: id: fdc3230ebb0e - last_write_checksum: sha1:620d78a8b4e3b854e08d136e02e40a01a786bd70 - pristine_git_object: 3bdcd6d3d4fc772cb7f5fca8685dcdc8c85e13e8 + last_write_checksum: sha1:7d1dc68f8b48486ab646653aa05cc38752e1f912 + pristine_git_object: a8d4fe5cc88d3c7337339e1b36a61bbf7ca8c4eb src/glean/api_client/utils/forms.py: id: 00f73e14b0f0 - last_write_checksum: sha1:0ca31459b99f761fcc6d0557a0a38daac4ad50f4 - pristine_git_object: 1e550bd5c2c35d977ddc10f49d77c23cb12c158d + last_write_checksum: sha1:dcf527960992b8baef3b21937c7e6c4e652630c0 + pristine_git_object: 193f264960f3014c81d41543b9023c14c44c12e6 src/glean/api_client/utils/headers.py: id: 1510f7a21a4e last_write_checksum: sha1:7c6df233ee006332b566a8afa9ce9a245941d935 @@ -5482,16 +5502,16 @@ trackedFiles: pristine_git_object: 591415af8e64baa410627b507d2740afb5387d13 src/glean/api_client/utils/retries.py: id: 36d4cce6fbf6 - last_write_checksum: sha1:471372f5c5d1dd5583239c9cf3c75f1b636e5d87 - pristine_git_object: af07d4e941007af4213c5ec9047ef8a2fca04e5e + last_write_checksum: sha1:3585b891142f30a597fbf7a2f0340700babef8e4 + pristine_git_object: ca7b59efebbbd9545744d0207ef42725c4cc5143 src/glean/api_client/utils/security.py: id: 5c4255995c2c last_write_checksum: sha1:355ba142fd72ec019e46b9aadb1da7172c17a312 pristine_git_object: 4a272f16c2af33f6364bd9aec9cdc33b91f228d2 src/glean/api_client/utils/serializers.py: id: c499367f56e9 - last_write_checksum: sha1:61009f2e4ef6613a1a5af813fe020373dae5a492 - pristine_git_object: d2149f8b909cb96628db140ac3cddb1b1e981367 + last_write_checksum: sha1:7485f1425b0661fd84836186570df90207eec6af + pristine_git_object: 1031ed930bad5ece220cf7416a56c29f40f0588b src/glean/api_client/utils/unmarshal_json_response.py: id: 10872f2f336a last_write_checksum: sha1:8bea26e2247cd1c5b8dc60c70725ad0aed487c6d @@ -5506,8 +5526,8 @@ trackedFiles: pristine_git_object: dae01a44384ac3bc13ae07453a053bf6c898ebe3 src/glean/api_client/visibilityoverrides.py: id: 85e53a1c5de5 - last_write_checksum: sha1:2476bd662c4f99ea96f9f9199e9c0c5402ef2274 - pristine_git_object: ecbc256b43054dcabb7346c9adcd309320f10a93 + last_write_checksum: sha1:2a0a2b50d9a295d4a3e267ac024d5eac4593e510 + pristine_git_object: e7befb7ab605bd398a1ba152cdb20e38b38e62e0 tests/__init__.py: id: 8e911f6351f3 last_write_checksum: sha1:cffdfca8e87b9acc39f414eddf64d233ba5fe450 @@ -5570,8 +5590,8 @@ trackedFiles: pristine_git_object: 929558ef2e1165f7e09da6d0a64f016c90971655 tests/mockserver/internal/handler/generated_handlers.go: id: 61ac4f7cce9e - last_write_checksum: sha1:1efa96a429f9879c5cdb7bd064661b396b568d31 - pristine_git_object: 6400b090e0a8e321f6348ef79d2b14fb83571f7b + last_write_checksum: sha1:c68c837c6af8f55eb8172dbc62ba472d5dde04a8 + pristine_git_object: a8a0a7558361f126dcbf7f995c52b33e660daa37 tests/mockserver/internal/handler/pathdeleterestapiindexcustommetadataschemagroupname.go: id: 979e4583765b last_write_checksum: sha1:b1d4edb259d907c7a88b634bf16f0cf152321693 @@ -5752,6 +5772,10 @@ trackedFiles: id: 3c3d5555c20b last_write_checksum: sha1:8ef1b12ee725ee32fb6a0a1e0e812594df97e06f pristine_git_object: 26fdfdd7e2d2fdffa6ecc736b7a70d6eb1aa5327 + tests/mockserver/internal/handler/pathpostrestapiv1agents.go: + id: b5d188f39094 + last_write_checksum: sha1:b625a3bbaf0748388febcf87d2b92782167c2c63 + pristine_git_object: 6c1367d61758e68e6cb415247e7473355d17c03a tests/mockserver/internal/handler/pathpostrestapiv1autocomplete.go: id: 9830ef01b25b last_write_checksum: sha1:094d64ddc73a91d38e64e3be18690ebb9d4ef3d3 @@ -5778,8 +5802,8 @@ trackedFiles: pristine_git_object: ab9263d43404e8e6f07af222a3e785aca2fbf35f tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go: id: 3fb93a419933 - last_write_checksum: sha1:14b4a1d98dd55ce2b487ae1aaab4a7dece08df25 - pristine_git_object: 371b90231fcd7bd77fd6d9566156605af1712d9a + last_write_checksum: sha1:f9f4c718408bddadbdf826194f07970bb111e57e + pristine_git_object: 5c99a0ada5302c8f64c0e5da5683fa8bd9e9975d tests/mockserver/internal/handler/pathpostrestapiv1createshortcut.go: id: 8d9d3abb0c34 last_write_checksum: sha1:dcdf684a85e20db1aee571db9a54a3ee259d71d5 @@ -6102,8 +6126,8 @@ trackedFiles: pristine_git_object: edfaaac094589522ad1ad4094131887b43780c92 tests/mockserver/internal/sdk/models/components/allowlistoptions.go: id: 5dd666458357 - last_write_checksum: sha1:db278a11846646ca8794392f2846087d1fba114f - pristine_git_object: cf238c9e67d94abd0f7de713e0922be55618dc75 + last_write_checksum: sha1:dfd379408d88c7eb8de7c86d2c58e084faaa45bc + pristine_git_object: 05ea9fc7fd13d94c67f49984a1a73648a807689b tests/mockserver/internal/sdk/models/components/announcement.go: id: 657490dccd71 last_write_checksum: sha1:038cda5de3f5d66db97e95c8a838f3c1a14bf265 @@ -6428,6 +6452,10 @@ trackedFiles: id: c5f526844132 last_write_checksum: sha1:aa8fbfc7682edb55f79cd9e241d9795d4c8579ea pristine_git_object: df363e8a9dfca1f872da7b286ab2cf7505b2c127 + tests/mockserver/internal/sdk/models/components/createworkflowrequest.go: + id: 92b0c1ccd3f0 + last_write_checksum: sha1:8febb494a066873172f0229af2880901e5f44ef5 + pristine_git_object: 277dd8b7d18f4aa926904cdf892e3475e6e998a6 tests/mockserver/internal/sdk/models/components/currentactiveusers.go: id: 220e7dbe04c9 last_write_checksum: sha1:4c876d24b835be3c5975308c132a4599bc11a71a @@ -6666,8 +6694,8 @@ trackedFiles: pristine_git_object: a0e605281d1c6bfa56c6ee88f2dfceff7b144e93 tests/mockserver/internal/sdk/models/components/dlpconfig.go: id: dd310c689385 - last_write_checksum: sha1:d7f7202ea98f70853dbe57afbbf046a63a59f8d0 - pristine_git_object: 04c23aebfc11d653007748a5653bfe742e2fe962 + last_write_checksum: sha1:62e4f2e5e4a611f7b3eae8479f5bb3d97831b9cc + pristine_git_object: 23a965fc8709811e91e4f40756137761239f6af7 tests/mockserver/internal/sdk/models/components/dlpexportfindingsrequest.go: id: 5edd4787e726 last_write_checksum: sha1:a6fa9927945d74ba513e8299c8102f5f4545c2ab @@ -6890,12 +6918,12 @@ trackedFiles: pristine_git_object: 04cc3a93272ac70933b0485bee31b335e05ab623 tests/mockserver/internal/sdk/models/components/feedentry.go: id: d25fd66fcf7a - last_write_checksum: sha1:802c3c827ceab5ea012ccb4cfdfb41c059a57533 - pristine_git_object: 1274083a6813ebf47b3f6bf587e397bf12b904ff + last_write_checksum: sha1:9100c7409b5249d0e85ae2cedab9800b0da020d0 + pristine_git_object: 36234aa7db5e3c4da48d59cf7bfbb9e4639afda9 tests/mockserver/internal/sdk/models/components/feedrequest.go: id: b06bc4cef0cf - last_write_checksum: sha1:e3e5205728c55eb2beef947db9c45670f2ef73af - pristine_git_object: 7c94e4641e1f167be444e87014e6f9de15b649f2 + last_write_checksum: sha1:2994c91d016176d20fdb2d47d073cb98d66ac056 + pristine_git_object: 28d6dbf022acdb0c38e137948212965d528bbfd3 tests/mockserver/internal/sdk/models/components/feedrequestoptions.go: id: fd9245fe1bf2 last_write_checksum: sha1:fa30b7fd6ee3e45896d7bbe36e33e7c0cb9000ba @@ -6906,8 +6934,8 @@ trackedFiles: pristine_git_object: 54f9d1a8997983156c84e69f888c59a80d06c2b1 tests/mockserver/internal/sdk/models/components/feedresult.go: id: 47411573e67a - last_write_checksum: sha1:dec3c7bf47204e5399fe5b1863ac96134a1a43ec - pristine_git_object: ddd4f095be90f403aac41127aa170c46c75cebd3 + last_write_checksum: sha1:adf5068767d5a4cbc8f3d4daeff4903bc556405b + pristine_git_object: ec49941ce4c605b8de48dda8e303a3ab067a393b tests/mockserver/internal/sdk/models/components/followupaction.go: id: 38179fec19b1 last_write_checksum: sha1:32a31f7af77a58ce6f3284e8550d01fcf0d3bddd @@ -7066,8 +7094,8 @@ trackedFiles: pristine_git_object: ecd7ddb6777546fb2061ed8d7fe99372430d28e3 tests/mockserver/internal/sdk/models/components/grouptype.go: id: 5537ed02d061 - last_write_checksum: sha1:0346c3bd888fdcfa6bdf470f76f7778f32b240dd - pristine_git_object: 3f25f70bef8fa2da5226a5ab4ab60295240ab984 + last_write_checksum: sha1:ac5c2401137f44b275f47896925b258c730d5a6c + pristine_git_object: be69cc6acc4dd739fa09cc6a3117fcd8ab91b269 tests/mockserver/internal/sdk/models/components/hotword.go: id: 541b48d27f83 last_write_checksum: sha1:7aaa2279ba4032458f14d65c2dbd3def0078920d @@ -7892,6 +7920,10 @@ trackedFiles: id: 89e5236173f5 last_write_checksum: sha1:4ea8a844fedb81791dbff6fd5b45031943c118ed pristine_git_object: 55046755b604159689bf327aa7174a0e080a970e + tests/mockserver/internal/sdk/models/operations/createagent.go: + id: 4338e91202b4 + last_write_checksum: sha1:80daff65223d9d23afb599cb4af805f35c29919b + pristine_git_object: 255e835e82fba8bf4023a2f99c5c2d1af40dd2cf tests/mockserver/internal/sdk/models/operations/createandstreamrun.go: id: e9a974b86a39 last_write_checksum: sha1:ff0bc51a66cdb65f5d36415c82e92377fd0d2cff @@ -8478,8 +8510,8 @@ trackedFiles: pristine_git_object: db4221c9f5953adc8f8219979060f1248ae5c342 tests/test_agents.py: id: 2eb70a860f3a - last_write_checksum: sha1:0c2472116b756d6985f893ff62edb5505e2a260d - pristine_git_object: 1d18b7662e493260672cbaabfcbc8461355ffeba + last_write_checksum: sha1:18a474b39a964820ec42a6d5552ab7961871d286 + pristine_git_object: 46852ff43f1fdbc1c65619cccb7a22f51509104b tests/test_announcements.py: id: 720cc07fca06 last_write_checksum: sha1:1d0dcab6446633bc6809bc67e14b6cc1755aa319 @@ -8598,8 +8630,8 @@ trackedFiles: pristine_git_object: df2944ebda36db652b2770dd1c23be83df90fc99 tests/test_summarize.py: id: a255d8a6f627 - last_write_checksum: sha1:884caf9e9ba6ac6d6577682c45419d3fd6312dd9 - pristine_git_object: df71d57de672c7e6967ba36b3671d957ef075d55 + last_write_checksum: sha1:19e1270dae90c3ebc19d93365a0613815d9e5a0e + pristine_git_object: c55cf90ad4fc6407f3a8e208dffda40fd8d45661 tests/test_tools.py: id: 70889bdf7321 last_write_checksum: sha1:293cea8c046c30086e5d57cb48aa59ab8da308f1 @@ -9520,6 +9552,13 @@ examples: application/json: {"status": "MISSING"} "400": application/json: {} + createAgent: + speakeasy-default-create-agent: + requestBody: + application/json: {} + responses: + "200": + application/json: {"workflow": {"author": {"name": "George Clooney", "obfuscatedId": "abc123"}, "lastDraftSavedBy": {"name": "George Clooney", "obfuscatedId": "abc123"}, "lastUpdatedBy": {"name": "George Clooney", "obfuscatedId": "abc123"}}} examplesVersion: 1.0.2 generatedTests: activity: "2025-04-28T22:05:12+01:00" @@ -9681,7 +9720,8 @@ generatedTests: delete_/rest/api/index/custom-metadata/schema/{groupName}: "2026-06-05T03:54:47Z" getDatasourceCredentialStatus: "2026-06-05T03:54:47Z" rotateDatasourceCredentials: "2026-06-05T03:54:47Z" -releaseNotes: "## Python SDK Changes:\n* `glean.client.collections.add_items()`: `response` **Changed** (Breaking ⚠️)\n* `glean.chat.get_chat_file()`: **Added**\n* `glean.agents.edit_agent()`: **Added**\n* `glean.entities.get_person_photo()`: **Added**\n* `glean.tools.get_action_pack_auth_status()`: **Added**\n* `glean.tools.authorize_action_pack()`: **Added**\n* `glean.indexing.custom_metadata.upsert()`: **Added**\n* `glean.indexing.custom_metadata.delete()`: **Added**\n* `glean.indexing.custom_metadata.get_schema()`: **Added**\n* `glean.indexing.custom_metadata.upsert_schema()`: **Added**\n* `glean.indexing.custom_metadata.delete_schema()`: **Added**\n* `glean.troubleshooting.post_/api/index/v1/debug/{datasource}/document/events()`: **Added**\n* `glean.datasources.get_datasource_credential_status()`: **Added**\n* `glean.datasources.rotate_datasource_credentials()`: **Added**\n* `glean.client.activity.feedback()`: \n * `request.feedback1.category` **Changed**\n* `glean.client.announcements.create()`: \n * `request.body.structured_list[].document.metadata.author.related_documents[].results[].structured_results[].answer` **Changed**\n * `response` **Changed**\n* `glean.client.announcements.update()`: \n * `request.body.structured_list[].document.metadata.author.related_documents[].results[].structured_results[].answer` **Changed**\n * `response` **Changed**\n* `glean.client.answers.create()`: \n * `request.data.added_roles[].person.related_documents[]` **Changed**\n * `response` **Changed**\n* `glean.client.answers.update()`: \n * `request.added_roles[].person.related_documents[]` **Changed**\n * `response` **Changed**\n* `glean.client.answers.retrieve()`: `response.answer_result.answer` **Changed**\n* `glean.client.answers.list()`: `response.answer_results[].answer` **Changed**\n* `glean.client.chat.create()`: \n * `request.messages[].citations[].source_document.metadata.author.related_documents[].results[].structured_results[].answer` **Changed**\n * `response.messages[].citations[].source_document.metadata.author.related_documents[].results[].structured_results[].answer` **Changed**\n* `glean.client.chat.retrieve()`: `response.chat_result.chat.created_by.related_documents[]` **Changed**\n* `glean.client.chat.list()`: `response.chat_results[].chat.created_by.related_documents[]` **Changed**\n* `glean.client.chat.create_stream()`: \n * `request.messages[].citations[].source_document.metadata.author.related_documents[].results[].structured_results[].answer` **Changed**\n* `glean.client.collections.create()`: \n * `request.added_roles[].person.related_documents[]` **Changed**\n * `response.union(class (0))` **Changed**\n * `error_code.enum(corrupt_item)` **Added**\n* `glean.client.collections.delete()`: `error_code.enum(corrupt_item)` **Added**\n* `glean.client.collections.delete_item()`: `response.collection` **Changed**\n* `glean.client.collections.update()`: \n * `request.added_roles[].person.related_documents[]` **Changed**\n * `response` **Changed**\n * `error_code.enum(corrupt_item)` **Added**\n* `glean.client.collections.update_item()`: `response.collection` **Changed**\n* `glean.client.collections.retrieve()`: `response` **Changed**\n* `glean.client.collections.list()`: `response.collections[]` **Changed**\n* `glean.client.documents.retrieve()`: `response.documents.Map.union(Document).metadata.author.related_documents[].results[].structured_results[].answer` **Changed**\n* `glean.client.documents.retrieve_by_facets()`: `response.documents[].metadata.author.related_documents[].results[].structured_results[].answer` **Changed**\n* `glean.client.insights.retrieve()`: \n * `request` **Changed**\n * `response` **Changed**\n* `glean.client.messages.retrieve()`: `response.search_response.results[].structured_results[]` **Changed**\n* `glean.client.pins.update()`: `response.attribution.related_documents[]` **Changed**\n* `glean.client.pins.retrieve()`: `response.pin.attribution.related_documents[]` **Changed**\n* `glean.client.pins.list()`: `response.pins[].attribution.related_documents[]` **Changed**\n* `glean.client.pins.create()`: `response.attribution.related_documents[]` **Changed**\n* `glean.client.search.query_as_admin()`: \n * `request.source_document.metadata.author.related_documents[].results[].structured_results[].answer` **Changed**\n * `response.results[].structured_results[]` **Changed**\n* `glean.client.search.autocomplete()`: `response.results[].document.metadata.author.related_documents[].results[].structured_results[].answer` **Changed**\n* `glean.client.search.retrieve_feed()`: \n * `request.categories[]` **Changed**\n * `response.results[]` **Changed**\n* `glean.client.search.recommendations()`: \n * `request.source_document.metadata.author.related_documents[].results[].structured_results[].answer` **Changed**\n * `response.results[].structured_results[]` **Changed**\n* `glean.client.search.query()`: \n * `request.source_document.metadata.author.related_documents[].results[].structured_results[].answer` **Changed**\n * `response.results[].structured_results[]` **Changed**\n* `glean.client.entities.list()`: `response.results[].related_documents[]` **Changed**\n* `glean.client.entities.read_people()`: `response.results[].related_documents[]` **Changed**\n* `glean.client.shortcuts.create()`: \n * `request.data.added_roles[].person.related_documents[]` **Changed**\n * `response.shortcut.added_roles[].person.related_documents[]` **Changed**\n* `glean.client.shortcuts.retrieve()`: `response.shortcut.added_roles[].person.related_documents[]` **Changed**\n* `glean.client.shortcuts.list()`: `response.shortcuts[].added_roles[].person.related_documents[]` **Changed**\n* `glean.client.shortcuts.update()`: \n * `request.added_roles[].person.related_documents[]` **Changed**\n * `response.shortcut.added_roles[].person.related_documents[]` **Changed**\n* `glean.client.verification.add_reminder()`: `response.metadata.last_verifier.related_documents[]` **Changed**\n* `glean.client.verification.list()`: `response.documents[].metadata.last_verifier.related_documents[]` **Changed**\n* `glean.client.verification.verify()`: `response.metadata.last_verifier.related_documents[]` **Changed**\n" + createAgent: "2026-06-20T02:11:32Z" +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" generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 8423ecdd..26ef47b2 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -34,7 +34,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true python: - version: 0.13.0 + version: 0.13.1 additionalDependencies: dev: {} main: {} @@ -54,6 +54,10 @@ python: enableCustomCodeRegions: false enumFormat: enum envVarPrefix: GLEAN + errorSchemaValidation: true + eventStreamClassNames: + async: EventStreamAsync + sync: EventStream fixFlags: asyncPaginationSep2025: false conflictResistantModelImportsFeb2026: false @@ -73,6 +77,7 @@ python: webhooks: "" inferUnionDiscriminators: true inputModelSuffix: input + inputTypedDictSuffix: TypedDict legacyPyright: true license: "" maxMethodParams: 999 @@ -90,6 +95,7 @@ python: pytestTimeout: 0 rawResponseHelpers: false responseFormat: flat + responseSchemaValidation: true sseFlatResponse: false templateVersion: v2 useAsyncHooks: false diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index bd780d7e..88d4fb2f 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -2,7 +2,7 @@ openapi: 3.0.0 info: version: 0.9.0 title: Glean API - x-source-commit-sha: deacbe1e0fd0b5074c1b1445f05b4a5df529f487 + x-source-commit-sha: a866a67699083ca67b6ffb2126427320df4ae258 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 +22,7 @@ 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: 7de1c5956c93a8bdd7b4a2c6a4c6fd98b0c4df70 + x-open-api-commit-sha: 3e86f2c31fb63c32c8dbcea560c555a74b5db989 x-speakeasy-name: 'Glean API' servers: - url: https://{instance}-be.glean.com @@ -569,6 +569,23 @@ paths: startIndex: 0 endIndex: 12 type: CITATION + "202": + description: | + Request accepted but not yet processed. Returned when another + in-flight request is already running for the same chat session; + the body's `queuedRequestId` identifies the deferred run and + output will be persisted to the chat session referenced by + `chatId`. + content: + application/json: + schema: + $ref: "#/components/schemas/ChatResponse" + examples: + queuedExample: + value: + chatId: abc123 + queuedRequestId: qr-xyz + isSavedToChatHistory: true "400": description: Invalid request "401": @@ -893,6 +910,40 @@ paths: description: Internal server error. security: - APIToken: [] + /rest/api/v1/agents: + post: + tags: + - Agents + summary: Create an agent + description: Create an agent. + operationId: createAgent + x-visibility: Preview + parameters: + - $ref: "#/components/parameters/locale" + - $ref: "#/components/parameters/timezoneOffset" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateWorkflowRequest" + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/CreateWorkflowResponse" + "400": + description: Bad request + "401": + description: Not Authorized + "403": + description: Forbidden + "500": + description: Internal server error + security: + - APIToken: [] /rest/api/v1/agents/{agent_id}: get: tags: @@ -1090,7 +1141,7 @@ paths: text/event-stream: schema: type: string - description: The server will send a stream of events in server-sent events (SSE) format. + description: The server will send a stream of events in server-sent events (SSE) format. If execution fails after the stream has started, the stream may terminate with an error message in a normal `message` event. example: | id: 1 event: message @@ -4658,6 +4709,8 @@ components: APIToken: scheme: bearer type: http + 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: ActivityEventParams: properties: @@ -6002,6 +6055,8 @@ components: GroupType: type: string description: The type of user group + x-enumDescriptions: + COLLECTION_AUDIENCE: Refers to any viewers of the Collection. enum: - DEPARTMENT - ALL @@ -6011,6 +6066,9 @@ components: - LOCATION - REGION - EXTERNAL_GROUP + - COLLECTION_AUDIENCE + x-speakeasy-enum-descriptions: + COLLECTION_AUDIENCE: Refers to any viewers of the Collection. Group: required: - type @@ -8973,6 +9031,80 @@ components: items: type: string description: IDs of files to delete. + WorkflowDraftableProperties: + properties: + name: + type: string + description: The name of the workflow. + WorkflowMutableProperties: + type: object + allOf: + - $ref: "#/components/schemas/WorkflowDraftableProperties" + - type: object + CreateWorkflowRequest: + allOf: + - $ref: "#/components/schemas/WorkflowMutableProperties" + - type: object + properties: + transient: + type: boolean + description: Used to create a transient workflow. + parentWorkflowId: + type: string + description: id of the parent workflow for transient workflows + WorkflowMetadata: + allOf: + - type: object + properties: + author: + $ref: "#/components/schemas/Person" + createTimestamp: + type: integer + description: Server Unix timestamp of the creation time. + lastUpdateTimestamp: + type: integer + description: Server Unix timestamp of the last update time. + lastDraftSavedAt: + type: integer + description: Server Unix timestamp of the last time the draft was saved. + lastDraftSavedBy: + 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" + AttributionProperties: {} + Workflow: + allOf: + - $ref: "#/components/schemas/PermissionedObject" + - $ref: "#/components/schemas/WorkflowMutableProperties" + - $ref: "#/components/schemas/WorkflowMetadata" + - $ref: "#/components/schemas/AttributionProperties" + - type: object + properties: + id: + type: string + 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. + 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. + WorkflowResult: + type: object + required: + - workflow + properties: + workflow: + $ref: "#/components/schemas/Workflow" + CreateWorkflowResponse: + allOf: + - $ref: "#/components/schemas/WorkflowResult" Agent: title: Agent type: object @@ -9025,16 +9157,6 @@ components: message: type: string description: Client-facing error message describing what went wrong - WorkflowDraftableProperties: - properties: - name: - type: string - description: The name of the workflow. - WorkflowMutableProperties: - type: object - allOf: - - $ref: "#/components/schemas/WorkflowDraftableProperties" - - type: object EditWorkflowRequest: allOf: - $ref: "#/components/schemas/WorkflowMutableProperties" @@ -10985,6 +11107,7 @@ components: - MID_DAY_CATCH_UP - QUERY_SUGGESTION - COWORK_CUJ_PROMO + - CARD_STACK_PROMO - WEEKLY_MEETINGS - FOLLOW_UP - MILESTONE_TIMELINE_CHECK @@ -11293,7 +11416,6 @@ components: description: A list of removed user roles for the Workflow. items: $ref: "#/components/schemas/UserRoleSpecification" - AttributionProperties: {} PromptTemplate: allOf: - $ref: "#/components/schemas/PromptTemplateMutableProperties" @@ -11369,55 +11491,6 @@ components: runCount: $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. - WorkflowMetadata: - allOf: - - type: object - properties: - author: - $ref: "#/components/schemas/Person" - createTimestamp: - type: integer - description: Server Unix timestamp of the creation time. - lastUpdateTimestamp: - type: integer - description: Server Unix timestamp of the last update time. - lastDraftSavedAt: - type: integer - description: Server Unix timestamp of the last time the draft was saved. - lastDraftSavedBy: - 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" - Workflow: - allOf: - - $ref: "#/components/schemas/PermissionedObject" - - $ref: "#/components/schemas/WorkflowMutableProperties" - - $ref: "#/components/schemas/WorkflowMetadata" - - $ref: "#/components/schemas/AttributionProperties" - - type: object - properties: - id: - type: string - 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. - 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. - WorkflowResult: - type: object - required: - - workflow - properties: - workflow: - $ref: "#/components/schemas/Workflow" UserActivity: properties: actor: @@ -11514,6 +11587,7 @@ components: - MID_DAY_CATCH_UP - QUERY_SUGGESTION - COWORK_CUJ_PROMO + - CARD_STACK_PROMO - WEEKLY_MEETINGS - FOLLOW_UP - MILESTONE_TIMELINE_CHECK @@ -11602,6 +11676,7 @@ components: - MID_DAY_CATCH_UP - QUERY_SUGGESTION - COWORK_CUJ_PROMO + - CARD_STACK_PROMO - WEEKLY_MEETINGS - FOLLOW_UP - MILESTONE_TIMELINE_CHECK @@ -11622,6 +11697,12 @@ components: rank: type: integer description: Rank of the result. Rank is suggested by server. Client side rank may differ. + placementReason: + type: string + enum: + - 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 @@ -14272,7 +14353,12 @@ components: items: type: string description: list of words and phrases to consider as whitelisted content - description: Terms that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term in the allow-list, it will not be counted as a violation. + regexes: + type: array + items: + type: string + description: list of regular expressions whose matches are considered whitelisted content + description: Terms and regexes that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term, or matches a regex, in the allow-list, it will not be counted as a violation. DlpConfig: properties: version: diff --git a/.speakeasy/tests.arazzo.yaml b/.speakeasy/tests.arazzo.yaml index 48029e67..4f92272d 100644 --- a/.speakeasy/tests.arazzo.yaml +++ b/.speakeasy/tests.arazzo.yaml @@ -158705,3 +158705,19 @@ workflows: type: simple x-speakeasy-test-group: Datasources x-speakeasy-test-rebuild: true + - workflowId: createAgent + steps: + - stepId: test + operationId: createAgent + requestBody: + contentType: application/json + payload: {} + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + 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-rebuild: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 92827bbf..23c3cea5 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.770.0 +speakeasyVersion: 1.784.0 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:500649ecd919cc2dcfeb6c54fe552ddcf8628a42b2f67a2ef0f206ad8561a56c - sourceBlobDigest: sha256:cb8902f4548ad637f07f6be9b7ef3f0d5fda8fe6f6540c7eea338bf4dde98413 + sourceRevisionDigest: sha256:d1e4b518e938a62717199ea927a61b365d1922235453cafefdd8e50db2f0844f + sourceBlobDigest: sha256:89f0ec3a08efdbde4df3dbb2437d8467413a32d7962ed12232f77e8a24cdc2b0 tags: - latest Glean Client API: @@ -16,10 +16,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:500649ecd919cc2dcfeb6c54fe552ddcf8628a42b2f67a2ef0f206ad8561a56c - sourceBlobDigest: sha256:cb8902f4548ad637f07f6be9b7ef3f0d5fda8fe6f6540c7eea338bf4dde98413 + sourceRevisionDigest: sha256:d1e4b518e938a62717199ea927a61b365d1922235453cafefdd8e50db2f0844f + sourceBlobDigest: sha256:89f0ec3a08efdbde4df3dbb2437d8467413a32d7962ed12232f77e8a24cdc2b0 codeSamplesNamespace: glean-api-specs-python-code-samples - codeSamplesRevisionDigest: sha256:cc23275cb351da5ef6256061aed3868dab2d09e7764658ea22e4958928b42d8c + codeSamplesRevisionDigest: sha256:60aa38a0f093349fa189ac4f535bcdf0b2bc99464ffb48ebf83b4318400ff5de workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 203405ee..f5a59cba 100644 --- a/README.md +++ b/README.md @@ -339,6 +339,7 @@ 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) diff --git a/RELEASES.md b/RELEASES.md index 87ea457d..bd60c447 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -748,4 +748,14 @@ Based on: ### Generated - [python v0.13.0] . ### Releases -- [PyPI v0.13.0] https://pypi.org/project/glean-api-client/0.13.0 - . \ No newline at end of file +- [PyPI v0.13.0] https://pypi.org/project/glean-api-client/0.13.0 - . + +## 2026-06-20 02:10:39 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.784.0 (2.911.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.13.1] . +### Releases +- [PyPI v0.13.1] https://pypi.org/project/glean-api-client/0.13.1 - . \ No newline at end of file diff --git a/docs/models/allowlistoptions.md b/docs/models/allowlistoptions.md index e986d966..e1c6f387 100644 --- a/docs/models/allowlistoptions.md +++ b/docs/models/allowlistoptions.md @@ -1,10 +1,11 @@ # AllowlistOptions -Terms that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term in the allow-list, it will not be counted as a violation. +Terms and regexes that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term, or matches a regex, in the allow-list, it will not be counted as a violation. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `terms` | List[*str*] | :heavy_minus_sign: | list of words and phrases to consider as whitelisted content | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `terms` | List[*str*] | :heavy_minus_sign: | list of words and phrases to consider as whitelisted content | +| `regexes` | List[*str*] | :heavy_minus_sign: | list of regular expressions whose matches are considered whitelisted content | \ No newline at end of file diff --git a/docs/models/createagentrequest.md b/docs/models/createagentrequest.md new file mode 100644 index 00000000..6d556c53 --- /dev/null +++ b/docs/models/createagentrequest.md @@ -0,0 +1,10 @@ +# CreateAgentRequest + + +## Fields + +| Field | 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. | +| `create_workflow_request` | [models.CreateWorkflowRequest](../models/createworkflowrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createworkflowrequest.md b/docs/models/createworkflowrequest.md new file mode 100644 index 00000000..e955a419 --- /dev/null +++ b/docs/models/createworkflowrequest.md @@ -0,0 +1,10 @@ +# CreateWorkflowRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `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 | \ No newline at end of file diff --git a/docs/models/dlpconfig.md b/docs/models/dlpconfig.md index eec4bb28..e99c7c03 100644 --- a/docs/models/dlpconfig.md +++ b/docs/models/dlpconfig.md @@ -5,18 +5,18 @@ Detailed configuration of what documents and sensitive content will be scanned. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `version` | *Optional[int]* | :heavy_minus_sign: | Synonymous with report/policy id. | -| ~~`sensitive_info_types`~~ | List[[models.SensitiveInfoType](../models/sensitiveinfotype.md)] | :heavy_minus_sign: | : warning: ** DEPRECATED **: Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Use sensitiveContentOptions instead.

DEPRECATED - use `sensitiveContentOptions` instead. | -| `input_options` | [Optional[models.InputOptions]](../models/inputoptions.md) | :heavy_minus_sign: | Controls which data-sources and what time-range to include in scans. | -| ~~`external_sharing_options`~~ | [Optional[models.ExternalSharingOptions]](../models/externalsharingoptions.md) | :heavy_minus_sign: | : warning: ** DEPRECATED **: Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Use broadSharingOptions instead. | -| `broad_sharing_options` | [Optional[models.SharingOptions]](../models/sharingoptions.md) | :heavy_minus_sign: | Controls how "shared" a document must be to get picked for scans. | -| `sensitive_content_options` | [Optional[models.SensitiveContentOptions]](../models/sensitivecontentoptions.md) | :heavy_minus_sign: | Options for defining sensitive content within scanned documents. | -| `report_name` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `frequency` | *Optional[str]* | :heavy_minus_sign: | Interval between scans. | -| `created_by` | [Optional[models.DlpPerson]](../models/dlpperson.md) | :heavy_minus_sign: | Details about the person who created this report/policy. | -| `created_at` | *Optional[str]* | :heavy_minus_sign: | Timestamp at which this configuration was created. | -| `redact_quote` | *Optional[bool]* | :heavy_minus_sign: | redact quote in findings of the report | -| `auto_hide_docs` | *Optional[bool]* | :heavy_minus_sign: | auto hide documents with findings in the report | -| `allowlist_options` | [Optional[models.AllowlistOptions]](../models/allowlistoptions.md) | :heavy_minus_sign: | Terms that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term in the allow-list, it will not be counted as a violation. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `version` | *Optional[int]* | :heavy_minus_sign: | Synonymous with report/policy id. | +| ~~`sensitive_info_types`~~ | List[[models.SensitiveInfoType](../models/sensitiveinfotype.md)] | :heavy_minus_sign: | : warning: ** DEPRECATED **: Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Use sensitiveContentOptions instead.

DEPRECATED - use `sensitiveContentOptions` instead. | +| `input_options` | [Optional[models.InputOptions]](../models/inputoptions.md) | :heavy_minus_sign: | Controls which data-sources and what time-range to include in scans. | +| ~~`external_sharing_options`~~ | [Optional[models.ExternalSharingOptions]](../models/externalsharingoptions.md) | :heavy_minus_sign: | : warning: ** DEPRECATED **: Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Use broadSharingOptions instead. | +| `broad_sharing_options` | [Optional[models.SharingOptions]](../models/sharingoptions.md) | :heavy_minus_sign: | Controls how "shared" a document must be to get picked for scans. | +| `sensitive_content_options` | [Optional[models.SensitiveContentOptions]](../models/sensitivecontentoptions.md) | :heavy_minus_sign: | Options for defining sensitive content within scanned documents. | +| `report_name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `frequency` | *Optional[str]* | :heavy_minus_sign: | Interval between scans. | +| `created_by` | [Optional[models.DlpPerson]](../models/dlpperson.md) | :heavy_minus_sign: | Details about the person who created this report/policy. | +| `created_at` | *Optional[str]* | :heavy_minus_sign: | Timestamp at which this configuration was created. | +| `redact_quote` | *Optional[bool]* | :heavy_minus_sign: | redact quote in findings of the report | +| `auto_hide_docs` | *Optional[bool]* | :heavy_minus_sign: | auto hide documents with findings in the report | +| `allowlist_options` | [Optional[models.AllowlistOptions]](../models/allowlistoptions.md) | :heavy_minus_sign: | Terms and regexes that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term, or matches a regex, in the allow-list, it will not be counted as a violation. | \ No newline at end of file diff --git a/docs/models/feedrequestcategory.md b/docs/models/feedrequestcategory.md index a4e28a08..07efe283 100644 --- a/docs/models/feedrequestcategory.md +++ b/docs/models/feedrequestcategory.md @@ -45,6 +45,7 @@ value = FeedRequestCategory.DOCUMENT_SUGGESTION | `MID_DAY_CATCH_UP` | MID_DAY_CATCH_UP | | `QUERY_SUGGESTION` | QUERY_SUGGESTION | | `COWORK_CUJ_PROMO` | COWORK_CUJ_PROMO | +| `CARD_STACK_PROMO` | CARD_STACK_PROMO | | `WEEKLY_MEETINGS` | WEEKLY_MEETINGS | | `FOLLOW_UP` | FOLLOW_UP | | `MILESTONE_TIMELINE_CHECK` | MILESTONE_TIMELINE_CHECK | diff --git a/docs/models/feedresult.md b/docs/models/feedresult.md index 6318b020..f14153ca 100644 --- a/docs/models/feedresult.md +++ b/docs/models/feedresult.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `category` | [models.FeedResultCategory](../models/feedresultcategory.md) | :heavy_check_mark: | Category of the result, one of the requested categories in incoming request. | -| `primary_entry` | [models.FeedEntry](../models/feedentry.md) | :heavy_check_mark: | N/A | -| `secondary_entries` | List[[models.FeedEntry](../models/feedentry.md)] | :heavy_minus_sign: | Secondary entries for the result e.g. suggested docs for the calendar, carousel. | -| `rank` | *Optional[int]* | :heavy_minus_sign: | Rank of the result. Rank is suggested by server. Client side rank may differ. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `category` | [models.FeedResultCategory](../models/feedresultcategory.md) | :heavy_check_mark: | Category of the result, one of the requested categories in incoming request. | +| `primary_entry` | [models.FeedEntry](../models/feedentry.md) | :heavy_check_mark: | N/A | +| `secondary_entries` | List[[models.FeedEntry](../models/feedentry.md)] | :heavy_minus_sign: | Secondary entries for the result e.g. suggested docs for the calendar, carousel. | +| `rank` | *Optional[int]* | :heavy_minus_sign: | Rank of the result. Rank is suggested by server. Client side rank may differ. | +| `placement_reason` | [Optional[models.PlacementReason]](../models/placementreason.md) | :heavy_minus_sign: | 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. | \ No newline at end of file diff --git a/docs/models/feedresultcategory.md b/docs/models/feedresultcategory.md index 5d0a0beb..37520b33 100644 --- a/docs/models/feedresultcategory.md +++ b/docs/models/feedresultcategory.md @@ -49,6 +49,7 @@ value = FeedResultCategory.DOCUMENT_SUGGESTION | `MID_DAY_CATCH_UP` | MID_DAY_CATCH_UP | | `QUERY_SUGGESTION` | QUERY_SUGGESTION | | `COWORK_CUJ_PROMO` | COWORK_CUJ_PROMO | +| `CARD_STACK_PROMO` | CARD_STACK_PROMO | | `WEEKLY_MEETINGS` | WEEKLY_MEETINGS | | `FOLLOW_UP` | FOLLOW_UP | | `MILESTONE_TIMELINE_CHECK` | MILESTONE_TIMELINE_CHECK | diff --git a/docs/models/file.md b/docs/models/file.md index 37cc418f..b8713ed6 100644 --- a/docs/models/file.md +++ b/docs/models/file.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `file_name` | *str* | :heavy_check_mark: | N/A | -| `content` | *Union[bytes, IO[bytes], io.BufferedReader]* | :heavy_check_mark: | N/A | -| `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `file_name` | *str* | :heavy_check_mark: | N/A | +| `content` | *Union[bytes, IO[bytes], io.IOBase]* | :heavy_check_mark: | N/A | +| `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/grouptype.md b/docs/models/grouptype.md index 4e38962c..28950611 100644 --- a/docs/models/grouptype.md +++ b/docs/models/grouptype.md @@ -15,13 +15,14 @@ value = GroupType.DEPARTMENT ## Values -| Name | Value | -| ---------------- | ---------------- | -| `DEPARTMENT` | DEPARTMENT | -| `ALL` | ALL | -| `TEAM` | TEAM | -| `JOB_TITLE` | JOB_TITLE | -| `ROLE_TYPE` | ROLE_TYPE | -| `LOCATION` | LOCATION | -| `REGION` | REGION | -| `EXTERNAL_GROUP` | EXTERNAL_GROUP | \ No newline at end of file +| Name | Value | +| --------------------- | --------------------- | +| `DEPARTMENT` | DEPARTMENT | +| `ALL` | ALL | +| `TEAM` | TEAM | +| `JOB_TITLE` | JOB_TITLE | +| `ROLE_TYPE` | ROLE_TYPE | +| `LOCATION` | LOCATION | +| `REGION` | REGION | +| `EXTERNAL_GROUP` | EXTERNAL_GROUP | +| `COLLECTION_AUDIENCE` | COLLECTION_AUDIENCE | \ No newline at end of file diff --git a/docs/models/justificationtype.md b/docs/models/justificationtype.md index adf5b69b..442119bc 100644 --- a/docs/models/justificationtype.md +++ b/docs/models/justificationtype.md @@ -62,6 +62,7 @@ value = JustificationType.FREQUENTLY_ACCESSED | `MID_DAY_CATCH_UP` | MID_DAY_CATCH_UP | | `QUERY_SUGGESTION` | QUERY_SUGGESTION | | `COWORK_CUJ_PROMO` | COWORK_CUJ_PROMO | +| `CARD_STACK_PROMO` | CARD_STACK_PROMO | | `WEEKLY_MEETINGS` | WEEKLY_MEETINGS | | `FOLLOW_UP` | FOLLOW_UP | | `MILESTONE_TIMELINE_CHECK` | MILESTONE_TIMELINE_CHECK | diff --git a/docs/models/placementreason.md b/docs/models/placementreason.md new file mode 100644 index 00000000..515cd010 --- /dev/null +++ b/docs/models/placementreason.md @@ -0,0 +1,21 @@ +# PlacementReason + +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. + +## Example Usage + +```python +from glean.api_client.models import PlacementReason + +value = PlacementReason.ORGANIC + +# Open enum: unrecognized values are captured as UnrecognizedStr +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `ORGANIC` | ORGANIC | +| `PROMO` | PROMO | \ No newline at end of file diff --git a/docs/sdks/agents/README.md b/docs/sdks/agents/README.md index b929a12d..00789fbf 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -4,8 +4,53 @@ ### Available Operations +* [create_agent](#create_agent) - Create an agent * [edit_agent](#edit_agent) - Edit an agent +## create_agent + +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.agents.create_agent() + + # 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 | \*/\* | + ## edit_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. diff --git a/pyproject.toml b/pyproject.toml index f34dd6a5..af1e59cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "glean-api-client" -version = "0.13.0" +version = "0.13.1" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Glean Technologies, Inc." },] readme = "README-PYPI.md" diff --git a/src/glean/api_client/_version.py b/src/glean/api_client/_version.py index 8d9da6a0..9f3bfa3d 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.13.0" +__version__: str = "0.13.1" __openapi_doc_version__: str = "0.9.0" -__gen_version__: str = "2.893.0" -__user_agent__: str = "speakeasy-sdk/python 0.13.0 2.893.0 0.9.0 glean-api-client" +__gen_version__: str = "2.911.0" +__user_agent__: str = "speakeasy-sdk/python 0.13.1 2.911.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 99f5f660..2be17185 100644 --- a/src/glean/api_client/agents.py +++ b/src/glean/api_client/agents.py @@ -10,6 +10,216 @@ class Agents(BaseSDK): + def create_agent( + 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 + ), + ), + 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_agent_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 + ), + ), + 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 edit_agent( self, *, diff --git a/src/glean/api_client/announcements.py b/src/glean/api_client/announcements.py index 33123a0a..48d83997 100644 --- a/src/glean/api_client/announcements.py +++ b/src/glean/api_client/announcements.py @@ -7,7 +7,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 -from typing import List, Mapping, Optional, Union +from typing import Iterable, List, Mapping, Optional, Union class Announcements(BaseSDK): @@ -25,7 +25,7 @@ def create( thumbnail: Optional[Union[models.Thumbnail, models.ThumbnailTypedDict]] = None, banner: Optional[Union[models.Thumbnail, models.ThumbnailTypedDict]] = None, audience_filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, source_document_id: Optional[str] = None, hide_attribution: Optional[bool] = None, @@ -168,7 +168,7 @@ async def create_async( thumbnail: Optional[Union[models.Thumbnail, models.ThumbnailTypedDict]] = None, banner: Optional[Union[models.Thumbnail, models.ThumbnailTypedDict]] = None, audience_filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, source_document_id: Optional[str] = None, hide_attribution: Optional[bool] = None, @@ -504,7 +504,7 @@ def update( thumbnail: Optional[Union[models.Thumbnail, models.ThumbnailTypedDict]] = None, banner: Optional[Union[models.Thumbnail, models.ThumbnailTypedDict]] = None, audience_filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, source_document_id: Optional[str] = None, hide_attribution: Optional[bool] = None, @@ -650,7 +650,7 @@ async def update_async( thumbnail: Optional[Union[models.Thumbnail, models.ThumbnailTypedDict]] = None, banner: Optional[Union[models.Thumbnail, models.ThumbnailTypedDict]] = None, audience_filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, source_document_id: Optional[str] = None, hide_attribution: Optional[bool] = None, diff --git a/src/glean/api_client/answers.py b/src/glean/api_client/answers.py index 0757b71f..20c371ad 100644 --- a/src/glean/api_client/answers.py +++ b/src/glean/api_client/answers.py @@ -6,7 +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 -from typing import List, Mapping, Optional, Union +from typing import Iterable, List, Mapping, Optional, Union from typing_extensions import deprecated @@ -408,36 +408,36 @@ def update( locale: Optional[str] = None, doc_id: Optional[str] = None, question: Optional[str] = None, - question_variations: Optional[List[str]] = None, + question_variations: Optional[Iterable[str]] = None, body_text: Optional[str] = None, board_id: Optional[int] = None, audience_filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, added_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, removed_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, source_document_spec: Optional[ Union[models.DocumentSpecUnion, models.DocumentSpecUnionTypedDict] ] = None, source_type: Optional[models.EditAnswerRequestSourceType] = None, - added_collections: Optional[List[int]] = None, - removed_collections: Optional[List[int]] = None, + added_collections: Optional[Iterable[int]] = None, + removed_collections: Optional[Iterable[int]] = None, combined_answer_text: Optional[ Union[ models.StructuredTextMutableProperties, @@ -490,7 +490,9 @@ def update( id=id, doc_id=doc_id, question=question, - question_variations=question_variations, + question_variations=utils.unmarshal( + question_variations, Optional[List[str]] + ), body_text=body_text, board_id=board_id, audience_filters=utils.get_pydantic_model( @@ -509,8 +511,12 @@ def update( source_document_spec, Optional[models.DocumentSpecUnion] ), source_type=source_type, - added_collections=added_collections, - removed_collections=removed_collections, + added_collections=utils.unmarshal( + added_collections, Optional[List[int]] + ), + removed_collections=utils.unmarshal( + removed_collections, Optional[List[int]] + ), combined_answer_text=utils.get_pydantic_model( combined_answer_text, Optional[models.StructuredTextMutableProperties], @@ -583,36 +589,36 @@ async def update_async( locale: Optional[str] = None, doc_id: Optional[str] = None, question: Optional[str] = None, - question_variations: Optional[List[str]] = None, + question_variations: Optional[Iterable[str]] = None, body_text: Optional[str] = None, board_id: Optional[int] = None, audience_filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, added_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, removed_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, source_document_spec: Optional[ Union[models.DocumentSpecUnion, models.DocumentSpecUnionTypedDict] ] = None, source_type: Optional[models.EditAnswerRequestSourceType] = None, - added_collections: Optional[List[int]] = None, - removed_collections: Optional[List[int]] = None, + added_collections: Optional[Iterable[int]] = None, + removed_collections: Optional[Iterable[int]] = None, combined_answer_text: Optional[ Union[ models.StructuredTextMutableProperties, @@ -665,7 +671,9 @@ async def update_async( id=id, doc_id=doc_id, question=question, - question_variations=question_variations, + question_variations=utils.unmarshal( + question_variations, Optional[List[str]] + ), body_text=body_text, board_id=board_id, audience_filters=utils.get_pydantic_model( @@ -684,8 +692,12 @@ async def update_async( source_document_spec, Optional[models.DocumentSpecUnion] ), source_type=source_type, - added_collections=added_collections, - removed_collections=removed_collections, + added_collections=utils.unmarshal( + added_collections, Optional[List[int]] + ), + removed_collections=utils.unmarshal( + removed_collections, Optional[List[int]] + ), combined_answer_text=utils.get_pydantic_model( combined_answer_text, Optional[models.StructuredTextMutableProperties], diff --git a/src/glean/api_client/client_activity.py b/src/glean/api_client/client_activity.py index 0fc1ce18..5465d474 100644 --- a/src/glean/api_client/client_activity.py +++ b/src/glean/api_client/client_activity.py @@ -5,14 +5,16 @@ 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 List, Mapping, Optional, Union +from typing import Iterable, List, Mapping, Optional, Union class ClientActivity(BaseSDK): def report( self, *, - events: Union[List[models.ActivityEvent], List[models.ActivityEventTypedDict]], + events: Union[ + Iterable[models.ActivityEvent], Iterable[models.ActivityEventTypedDict] + ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -99,7 +101,9 @@ def report( async def report_async( self, *, - events: Union[List[models.ActivityEvent], List[models.ActivityEventTypedDict]], + events: Union[ + Iterable[models.ActivityEvent], Iterable[models.ActivityEventTypedDict] + ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, diff --git a/src/glean/api_client/client_agents.py b/src/glean/api_client/client_agents.py index 6e1ff0f4..7bc31e5f 100644 --- a/src/glean/api_client/client_agents.py +++ b/src/glean/api_client/client_agents.py @@ -6,7 +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 -from typing import Any, Dict, List, Mapping, Optional, Union +from typing import Any, Dict, Iterable, List, Mapping, Optional, Union class ClientAgents(BaseSDK): @@ -572,11 +572,11 @@ def run_stream( self, *, agent_id: str, - input: Optional[Dict[str, Any]] = None, + input: Optional[Mapping[str, Any]] = None, messages: Optional[ - Union[List[models.Message], List[models.MessageTypedDict]] + Union[Iterable[models.Message], Iterable[models.MessageTypedDict]] ] = None, - metadata: Optional[Dict[str, Any]] = None, + metadata: Optional[Mapping[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -607,9 +607,9 @@ def run_stream( request = models.AgentRunCreate( agent_id=agent_id, - input=input, + input=utils.unmarshal(input, Optional[Dict[str, Any]]), messages=utils.get_pydantic_model(messages, Optional[List[models.Message]]), - metadata=metadata, + metadata=utils.unmarshal(metadata, Optional[Dict[str, Any]]), ) req = self._build_request( @@ -674,11 +674,11 @@ async def run_stream_async( self, *, agent_id: str, - input: Optional[Dict[str, Any]] = None, + input: Optional[Mapping[str, Any]] = None, messages: Optional[ - Union[List[models.Message], List[models.MessageTypedDict]] + Union[Iterable[models.Message], Iterable[models.MessageTypedDict]] ] = None, - metadata: Optional[Dict[str, Any]] = None, + metadata: Optional[Mapping[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -709,9 +709,9 @@ async def run_stream_async( request = models.AgentRunCreate( agent_id=agent_id, - input=input, + input=utils.unmarshal(input, Optional[Dict[str, Any]]), messages=utils.get_pydantic_model(messages, Optional[List[models.Message]]), - metadata=metadata, + metadata=utils.unmarshal(metadata, Optional[Dict[str, Any]]), ) req = self._build_request_async( @@ -776,11 +776,11 @@ def run( self, *, agent_id: str, - input: Optional[Dict[str, Any]] = None, + input: Optional[Mapping[str, Any]] = None, messages: Optional[ - Union[List[models.Message], List[models.MessageTypedDict]] + Union[Iterable[models.Message], Iterable[models.MessageTypedDict]] ] = None, - metadata: Optional[Dict[str, Any]] = None, + metadata: Optional[Mapping[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -811,9 +811,9 @@ def run( request = models.AgentRunCreate( agent_id=agent_id, - input=input, + input=utils.unmarshal(input, Optional[Dict[str, Any]]), messages=utils.get_pydantic_model(messages, Optional[List[models.Message]]), - metadata=metadata, + metadata=utils.unmarshal(metadata, Optional[Dict[str, Any]]), ) req = self._build_request( @@ -876,11 +876,11 @@ async def run_async( self, *, agent_id: str, - input: Optional[Dict[str, Any]] = None, + input: Optional[Mapping[str, Any]] = None, messages: Optional[ - Union[List[models.Message], List[models.MessageTypedDict]] + Union[Iterable[models.Message], Iterable[models.MessageTypedDict]] ] = None, - metadata: Optional[Dict[str, Any]] = None, + metadata: Optional[Mapping[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -911,9 +911,9 @@ async def run_async( request = models.AgentRunCreate( agent_id=agent_id, - input=input, + input=utils.unmarshal(input, Optional[Dict[str, Any]]), messages=utils.get_pydantic_model(messages, Optional[List[models.Message]]), - metadata=metadata, + metadata=utils.unmarshal(metadata, Optional[Dict[str, Any]]), ) req = self._build_request_async( diff --git a/src/glean/api_client/client_chat.py b/src/glean/api_client/client_chat.py index f1e89630..f506bfc8 100644 --- a/src/glean/api_client/client_chat.py +++ b/src/glean/api_client/client_chat.py @@ -6,14 +6,16 @@ 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 List, Mapping, Optional, Union +from typing import Iterable, List, Mapping, Optional, Union class ClientChat(BaseSDK): def create( self, *, - messages: Union[List[models.ChatMessage], List[models.ChatMessageTypedDict]], + messages: Union[ + Iterable[models.ChatMessage], Iterable[models.ChatMessageTypedDict] + ], locale: Optional[str] = None, timezone_offset: Optional[int] = None, session_info: Optional[ @@ -140,7 +142,7 @@ def create( retry_config=retry_config, ) - if utils.match_response(http_res, "200", "application/json"): + if utils.match_response(http_res, ["200", "202"], "application/json"): return unmarshal_json_response(models.ChatResponse, http_res) if utils.match_response(http_res, ["400", "401", "408", "429", "4XX"], "*"): http_res_text = utils.stream_to_text(http_res) @@ -154,7 +156,9 @@ def create( async def create_async( self, *, - messages: Union[List[models.ChatMessage], List[models.ChatMessageTypedDict]], + messages: Union[ + Iterable[models.ChatMessage], Iterable[models.ChatMessageTypedDict] + ], locale: Optional[str] = None, timezone_offset: Optional[int] = None, session_info: Optional[ @@ -281,7 +285,7 @@ async def create_async( retry_config=retry_config, ) - if utils.match_response(http_res, "200", "application/json"): + if utils.match_response(http_res, ["200", "202"], "application/json"): return unmarshal_json_response(models.ChatResponse, http_res) if utils.match_response(http_res, ["400", "401", "408", "429", "4XX"], "*"): http_res_text = await utils.stream_to_text_async(http_res) @@ -469,7 +473,7 @@ async def delete_all_async( def delete( self, *, - ids: List[str], + ids: Iterable[str], locale: Optional[str] = None, timezone_offset: Optional[int] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -503,7 +507,7 @@ def delete( locale=locale, timezone_offset=timezone_offset, delete_chats_request=models.DeleteChatsRequest( - ids=ids, + ids=utils.unmarshal(ids, List[str]), ), ) @@ -568,7 +572,7 @@ def delete( async def delete_async( self, *, - ids: List[str], + ids: Iterable[str], locale: Optional[str] = None, timezone_offset: Optional[int] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -602,7 +606,7 @@ async def delete_async( locale=locale, timezone_offset=timezone_offset, delete_chats_request=models.DeleteChatsRequest( - ids=ids, + ids=utils.unmarshal(ids, List[str]), ), ) @@ -1229,7 +1233,7 @@ async def retrieve_application_async( def upload_files( self, *, - files: Union[List[models.File], List[models.FileTypedDict]], + files: Union[Iterable[models.File], Iterable[models.FileTypedDict]], locale: Optional[str] = None, timezone_offset: Optional[int] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1328,7 +1332,7 @@ def upload_files( async def upload_files_async( self, *, - files: Union[List[models.File], List[models.FileTypedDict]], + files: Union[Iterable[models.File], Iterable[models.FileTypedDict]], locale: Optional[str] = None, timezone_offset: Optional[int] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1427,7 +1431,7 @@ async def upload_files_async( def retrieve_files( self, *, - file_ids: List[str], + file_ids: Iterable[str], locale: Optional[str] = None, timezone_offset: Optional[int] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1461,7 +1465,7 @@ def retrieve_files( locale=locale, timezone_offset=timezone_offset, get_chat_files_request=models.GetChatFilesRequest( - file_ids=file_ids, + file_ids=utils.unmarshal(file_ids, List[str]), ), ) @@ -1526,7 +1530,7 @@ def retrieve_files( async def retrieve_files_async( self, *, - file_ids: List[str], + file_ids: Iterable[str], locale: Optional[str] = None, timezone_offset: Optional[int] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1560,7 +1564,7 @@ async def retrieve_files_async( locale=locale, timezone_offset=timezone_offset, get_chat_files_request=models.GetChatFilesRequest( - file_ids=file_ids, + file_ids=utils.unmarshal(file_ids, List[str]), ), ) @@ -1625,7 +1629,7 @@ async def retrieve_files_async( def delete_files( self, *, - file_ids: List[str], + file_ids: Iterable[str], locale: Optional[str] = None, timezone_offset: Optional[int] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1659,7 +1663,7 @@ def delete_files( locale=locale, timezone_offset=timezone_offset, delete_chat_files_request=models.DeleteChatFilesRequest( - file_ids=file_ids, + file_ids=utils.unmarshal(file_ids, List[str]), ), ) @@ -1724,7 +1728,7 @@ def delete_files( async def delete_files_async( self, *, - file_ids: List[str], + file_ids: Iterable[str], locale: Optional[str] = None, timezone_offset: Optional[int] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1758,7 +1762,7 @@ async def delete_files_async( locale=locale, timezone_offset=timezone_offset, delete_chat_files_request=models.DeleteChatFilesRequest( - file_ids=file_ids, + file_ids=utils.unmarshal(file_ids, List[str]), ), ) @@ -1823,7 +1827,9 @@ async def delete_files_async( def create_stream( self, *, - messages: Union[List[models.ChatMessage], List[models.ChatMessageTypedDict]], + messages: Union[ + Iterable[models.ChatMessage], Iterable[models.ChatMessageTypedDict] + ], timezone_offset: Optional[int] = None, session_info: Optional[ Union[models.SessionInfo, models.SessionInfoTypedDict] @@ -1961,7 +1967,9 @@ def create_stream( async def create_stream_async( self, *, - messages: Union[List[models.ChatMessage], List[models.ChatMessageTypedDict]], + messages: Union[ + Iterable[models.ChatMessage], Iterable[models.ChatMessageTypedDict] + ], timezone_offset: Optional[int] = None, session_info: Optional[ Union[models.SessionInfo, models.SessionInfoTypedDict] diff --git a/src/glean/api_client/client_documents.py b/src/glean/api_client/client_documents.py index c270bf21..72045064 100644 --- a/src/glean/api_client/client_documents.py +++ b/src/glean/api_client/client_documents.py @@ -7,7 +7,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 -from typing import List, Mapping, Optional, Union +from typing import Iterable, List, Mapping, Optional, Union class ClientDocuments(BaseSDK): @@ -615,7 +615,8 @@ def summarize( self, *, document_specs: Union[ - List[models.DocumentSpecUnion], List[models.DocumentSpecUnionTypedDict] + Iterable[models.DocumentSpecUnion], + Iterable[models.DocumentSpecUnionTypedDict], ], locale: Optional[str] = None, timestamp: Optional[datetime] = None, @@ -723,7 +724,8 @@ async def summarize_async( self, *, document_specs: Union[ - List[models.DocumentSpecUnion], List[models.DocumentSpecUnionTypedDict] + Iterable[models.DocumentSpecUnion], + Iterable[models.DocumentSpecUnionTypedDict], ], locale: Optional[str] = None, timestamp: Optional[datetime] = None, diff --git a/src/glean/api_client/client_entities.py b/src/glean/api_client/client_entities.py index 67fbc0db..8f19017d 100644 --- a/src/glean/api_client/client_entities.py +++ b/src/glean/api_client/client_entities.py @@ -6,7 +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 -from typing import List, Mapping, Optional, Union +from typing import Iterable, List, Mapping, Optional, Union class ClientEntities(BaseSDK): @@ -15,17 +15,19 @@ def list( *, locale: Optional[str] = None, filter_: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, sort: Optional[ - Union[List[models.SortOptions], List[models.SortOptionsTypedDict]] + 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[List[models.ListEntitiesRequestIncludeField]] = None, + include_fields: Optional[ + Iterable[models.ListEntitiesRequestIncludeField] + ] = None, page_size: Optional[int] = None, cursor: Optional[str] = None, source: Optional[str] = None, @@ -75,7 +77,10 @@ def list( entity_type=entity_type, datasource=datasource, query=query, - include_fields=include_fields, + include_fields=utils.unmarshal( + include_fields, + Optional[List[models.ListEntitiesRequestIncludeField]], + ), page_size=page_size, cursor=cursor, source=source, @@ -146,17 +151,19 @@ async def list_async( *, locale: Optional[str] = None, filter_: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, sort: Optional[ - Union[List[models.SortOptions], List[models.SortOptionsTypedDict]] + 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[List[models.ListEntitiesRequestIncludeField]] = None, + include_fields: Optional[ + Iterable[models.ListEntitiesRequestIncludeField] + ] = None, page_size: Optional[int] = None, cursor: Optional[str] = None, source: Optional[str] = None, @@ -206,7 +213,10 @@ async def list_async( entity_type=entity_type, datasource=datasource, query=query, - include_fields=include_fields, + include_fields=utils.unmarshal( + include_fields, + Optional[List[models.ListEntitiesRequestIncludeField]], + ), page_size=page_size, cursor=cursor, source=source, @@ -277,10 +287,10 @@ def read_people( *, locale: Optional[str] = None, timezone_offset: Optional[int] = None, - obfuscated_ids: Optional[List[str]] = None, - email_ids: Optional[List[str]] = None, - include_fields: Optional[List[models.PeopleRequestIncludeField]] = None, - include_types: Optional[List[models.IncludeType]] = 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, @@ -317,10 +327,14 @@ def read_people( locale=locale, people_request=models.PeopleRequest( timezone_offset=timezone_offset, - obfuscated_ids=obfuscated_ids, - email_ids=email_ids, - include_fields=include_fields, - include_types=include_types, + 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, ), ) @@ -384,10 +398,10 @@ async def read_people_async( *, locale: Optional[str] = None, timezone_offset: Optional[int] = None, - obfuscated_ids: Optional[List[str]] = None, - email_ids: Optional[List[str]] = None, - include_fields: Optional[List[models.PeopleRequestIncludeField]] = None, - include_types: Optional[List[models.IncludeType]] = 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, @@ -424,10 +438,14 @@ async def read_people_async( locale=locale, people_request=models.PeopleRequest( timezone_offset=timezone_offset, - obfuscated_ids=obfuscated_ids, - email_ids=email_ids, - include_fields=include_fields, - include_types=include_types, + 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, ), ) diff --git a/src/glean/api_client/client_shortcuts.py b/src/glean/api_client/client_shortcuts.py index a4db274d..b994e7d2 100644 --- a/src/glean/api_client/client_shortcuts.py +++ b/src/glean/api_client/client_shortcuts.py @@ -6,7 +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 -from typing import List, Mapping, Optional, Union +from typing import Iterable, List, Mapping, Optional, Union class ClientShortcuts(BaseSDK): @@ -600,11 +600,11 @@ def list( page_size: int, locale: Optional[str] = None, include_fields: Optional[ - List[models.ListShortcutsPaginatedRequestIncludeField] + Iterable[models.ListShortcutsPaginatedRequestIncludeField] ] = None, cursor: Optional[str] = None, filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, sort: Optional[Union[models.SortOptions, models.SortOptionsTypedDict]] = None, query: Optional[str] = None, @@ -642,7 +642,10 @@ def list( request = models.ListshortcutsRequest( locale=locale, list_shortcuts_paginated_request=models.ListShortcutsPaginatedRequest( - include_fields=include_fields, + include_fields=utils.unmarshal( + include_fields, + Optional[List[models.ListShortcutsPaginatedRequestIncludeField]], + ), page_size=page_size, cursor=cursor, filters=utils.get_pydantic_model( @@ -719,11 +722,11 @@ async def list_async( page_size: int, locale: Optional[str] = None, include_fields: Optional[ - List[models.ListShortcutsPaginatedRequestIncludeField] + Iterable[models.ListShortcutsPaginatedRequestIncludeField] ] = None, cursor: Optional[str] = None, filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, sort: Optional[Union[models.SortOptions, models.SortOptionsTypedDict]] = None, query: Optional[str] = None, @@ -761,7 +764,10 @@ async def list_async( request = models.ListshortcutsRequest( locale=locale, list_shortcuts_paginated_request=models.ListShortcutsPaginatedRequest( - include_fields=include_fields, + include_fields=utils.unmarshal( + include_fields, + Optional[List[models.ListShortcutsPaginatedRequestIncludeField]], + ), page_size=page_size, cursor=cursor, filters=utils.get_pydantic_model( @@ -845,14 +851,14 @@ def update( url_template: Optional[str] = None, added_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, removed_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -979,14 +985,14 @@ async def update_async( url_template: Optional[str] = None, added_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, removed_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, diff --git a/src/glean/api_client/client_tools.py b/src/glean/api_client/client_tools.py index 14d9f68c..7cfb900c 100644 --- a/src/glean/api_client/client_tools.py +++ b/src/glean/api_client/client_tools.py @@ -6,14 +6,14 @@ 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, List, Mapping, Optional, Union +from typing import Dict, Iterable, List, Mapping, Optional, Union class ClientTools(BaseSDK): def list( self, *, - tool_names: Optional[List[str]] = None, + tool_names: Optional[Iterable[str]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -40,7 +40,7 @@ def list( base_url = self._get_url(base_url, url_variables) request = models.GetRestAPIV1ToolsListRequest( - tool_names=tool_names, + tool_names=utils.unmarshal(tool_names, Optional[List[str]]), ) req = self._build_request( @@ -97,7 +97,7 @@ def list( async def list_async( self, *, - tool_names: Optional[List[str]] = None, + tool_names: Optional[Iterable[str]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -124,7 +124,7 @@ async def list_async( base_url = self._get_url(base_url, url_variables) request = models.GetRestAPIV1ToolsListRequest( - tool_names=tool_names, + tool_names=utils.unmarshal(tool_names, Optional[List[str]]), ) req = self._build_request_async( @@ -183,8 +183,8 @@ def run( *, name: str, parameters: Union[ - Dict[str, models.ToolsCallParameter], - Dict[str, models.ToolsCallParameterTypedDict], + Mapping[str, models.ToolsCallParameter], + Mapping[str, models.ToolsCallParameterTypedDict], ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -278,8 +278,8 @@ async def run_async( *, name: str, parameters: Union[ - Dict[str, models.ToolsCallParameter], - Dict[str, models.ToolsCallParameterTypedDict], + Mapping[str, models.ToolsCallParameter], + Mapping[str, models.ToolsCallParameterTypedDict], ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, diff --git a/src/glean/api_client/collections.py b/src/glean/api_client/collections.py index f93e472c..fe1c6c91 100644 --- a/src/glean/api_client/collections.py +++ b/src/glean/api_client/collections.py @@ -6,7 +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 -from typing import Any, List, Mapping, Optional, Union +from typing import Any, Iterable, List, Mapping, Optional, Union class Collections(BaseSDK): @@ -17,8 +17,8 @@ def add_items( locale: Optional[str] = None, added_collection_item_descriptors: Optional[ Union[ - List[models.CollectionItemDescriptor], - List[models.CollectionItemDescriptorTypedDict], + Iterable[models.CollectionItemDescriptor], + Iterable[models.CollectionItemDescriptorTypedDict], ] ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -124,8 +124,8 @@ async def add_items_async( locale: Optional[str] = None, added_collection_item_descriptors: Optional[ Union[ - List[models.CollectionItemDescriptor], - List[models.CollectionItemDescriptorTypedDict], + Iterable[models.CollectionItemDescriptor], + Iterable[models.CollectionItemDescriptorTypedDict], ] ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -232,18 +232,18 @@ def create( description: Optional[str] = None, added_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, removed_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, audience_filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, icon: Optional[str] = None, admin_locked: Optional[bool] = None, @@ -384,18 +384,18 @@ async def create_async( description: Optional[str] = None, added_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, removed_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, audience_filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, icon: Optional[str] = None, admin_locked: Optional[bool] = None, @@ -531,7 +531,7 @@ async def create_async( def delete( self, *, - ids: List[int], + ids: Iterable[int], locale: Optional[str] = None, allowed_datasource: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -564,7 +564,7 @@ def delete( request = models.DeletecollectionRequestRequest( locale=locale, delete_collection_request=models.DeleteCollectionRequest( - ids=ids, + ids=utils.unmarshal(ids, List[int]), allowed_datasource=allowed_datasource, ), ) @@ -636,7 +636,7 @@ def delete( async def delete_async( self, *, - ids: List[int], + ids: Iterable[int], locale: Optional[str] = None, allowed_datasource: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -669,7 +669,7 @@ async def delete_async( request = models.DeletecollectionRequestRequest( locale=locale, delete_collection_request=models.DeleteCollectionRequest( - ids=ids, + ids=utils.unmarshal(ids, List[int]), allowed_datasource=allowed_datasource, ), ) @@ -955,18 +955,18 @@ def update( description: Optional[str] = None, added_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, removed_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, audience_filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, icon: Optional[str] = None, admin_locked: Optional[bool] = None, @@ -1107,18 +1107,18 @@ async def update_async( description: Optional[str] = None, added_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, removed_roles: Optional[ Union[ - List[models.UserRoleSpecification], - List[models.UserRoleSpecificationTypedDict], + Iterable[models.UserRoleSpecification], + Iterable[models.UserRoleSpecificationTypedDict], ] ] = None, audience_filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, icon: Optional[str] = None, admin_locked: Optional[bool] = None, diff --git a/src/glean/api_client/custommetadata.py b/src/glean/api_client/custommetadata.py index da51ad9d..768525cb 100644 --- a/src/glean/api_client/custommetadata.py +++ b/src/glean/api_client/custommetadata.py @@ -6,7 +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 -from typing import Any, List, Mapping, Optional, Union +from typing import Any, Iterable, List, Mapping, Optional, Union class CustomMetadata(BaseSDK): @@ -16,7 +16,7 @@ def upsert( doc_id: str, group_name: str, custom_metadata: Union[ - List[models.CustomProperty], List[models.CustomPropertyTypedDict] + Iterable[models.CustomProperty], Iterable[models.CustomPropertyTypedDict] ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -137,7 +137,7 @@ async def upsert_async( doc_id: str, group_name: str, custom_metadata: Union[ - List[models.CustomProperty], List[models.CustomPropertyTypedDict] + Iterable[models.CustomProperty], Iterable[models.CustomPropertyTypedDict] ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -671,8 +671,8 @@ def upsert_schema( *, group_name: str, metadata_keys: Union[ - List[models.CustomMetadataPropertyDefinition], - List[models.CustomMetadataPropertyDefinitionTypedDict], + Iterable[models.CustomMetadataPropertyDefinition], + Iterable[models.CustomMetadataPropertyDefinitionTypedDict], ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -792,8 +792,8 @@ async def upsert_schema_async( *, group_name: str, metadata_keys: Union[ - List[models.CustomMetadataPropertyDefinition], - List[models.CustomMetadataPropertyDefinitionTypedDict], + Iterable[models.CustomMetadataPropertyDefinition], + Iterable[models.CustomMetadataPropertyDefinitionTypedDict], ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, diff --git a/src/glean/api_client/governance.py b/src/glean/api_client/governance.py index fd67e05d..2e662f2b 100644 --- a/src/glean/api_client/governance.py +++ b/src/glean/api_client/governance.py @@ -6,7 +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 -from typing import List, Mapping, Optional, Union +from typing import Iterable, List, Mapping, Optional, Union class Governance(BaseSDK): @@ -22,7 +22,7 @@ def createfindingsexport( ] = None, file_name: Optional[str] = None, field_scope: Optional[models.FieldScope] = None, - fields_to_exclude: Optional[List[str]] = None, + fields_to_exclude: Optional[Iterable[str]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -63,7 +63,7 @@ def createfindingsexport( ), file_name=file_name, field_scope=field_scope, - fields_to_exclude=fields_to_exclude, + fields_to_exclude=utils.unmarshal(fields_to_exclude, Optional[List[str]]), ) req = self._build_request( @@ -132,7 +132,7 @@ async def createfindingsexport_async( ] = None, file_name: Optional[str] = None, field_scope: Optional[models.FieldScope] = None, - fields_to_exclude: Optional[List[str]] = None, + fields_to_exclude: Optional[Iterable[str]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -173,7 +173,7 @@ async def createfindingsexport_async( ), file_name=file_name, field_scope=field_scope, - fields_to_exclude=fields_to_exclude, + fields_to_exclude=utils.unmarshal(fields_to_exclude, Optional[List[str]]), ) req = self._build_request_async( diff --git a/src/glean/api_client/indexing_datasources.py b/src/glean/api_client/indexing_datasources.py index b8b091e8..aadeae14 100644 --- a/src/glean/api_client/indexing_datasources.py +++ b/src/glean/api_client/indexing_datasources.py @@ -6,7 +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 -from typing import List, Mapping, Optional, Union +from typing import Iterable, List, Mapping, Optional, Union class IndexingDatasources(BaseSDK): @@ -21,32 +21,35 @@ def add( url_regex: Optional[str] = None, icon_url: Optional[str] = None, object_definitions: Optional[ - Union[List[models.ObjectDefinition], List[models.ObjectDefinitionTypedDict]] + Union[ + Iterable[models.ObjectDefinition], + Iterable[models.ObjectDefinitionTypedDict], + ] ] = None, suggestion_text: Optional[str] = None, home_url: Optional[str] = None, - crawler_seed_urls: Optional[List[str]] = None, + crawler_seed_urls: Optional[Iterable[str]] = None, icon_dark_url: Optional[str] = None, - hide_built_in_facets: Optional[List[models.HideBuiltInFacet]] = None, + hide_built_in_facets: Optional[Iterable[models.HideBuiltInFacet]] = None, canonicalizing_url_regex: Optional[ Union[ - List[models.CanonicalizingRegexType], - List[models.CanonicalizingRegexTypeTypedDict], + Iterable[models.CanonicalizingRegexType], + Iterable[models.CanonicalizingRegexTypeTypedDict], ] ] = None, canonicalizing_title_regex: Optional[ Union[ - List[models.CanonicalizingRegexType], - List[models.CanonicalizingRegexTypeTypedDict], + Iterable[models.CanonicalizingRegexType], + Iterable[models.CanonicalizingRegexTypeTypedDict], ] ] = None, redlist_title_regex: Optional[str] = None, connector_type: Optional[models.CustomDatasourceConfigConnectorType] = None, quicklinks: Optional[ - Union[List[models.Quicklink], List[models.QuicklinkTypedDict]] + Union[Iterable[models.Quicklink], Iterable[models.QuicklinkTypedDict]] ] = None, render_config_preset: Optional[str] = None, - aliases: Optional[List[str]] = None, + aliases: Optional[Iterable[str]] = None, is_on_prem: Optional[bool] = None, trust_url_regex_for_view_activity: Optional[bool] = True, include_utm_source: Optional[bool] = None, @@ -118,9 +121,11 @@ def add( ), suggestion_text=suggestion_text, home_url=home_url, - crawler_seed_urls=crawler_seed_urls, + crawler_seed_urls=utils.unmarshal(crawler_seed_urls, Optional[List[str]]), icon_dark_url=icon_dark_url, - hide_built_in_facets=hide_built_in_facets, + hide_built_in_facets=utils.unmarshal( + hide_built_in_facets, Optional[List[models.HideBuiltInFacet]] + ), canonicalizing_url_regex=utils.get_pydantic_model( canonicalizing_url_regex, Optional[List[models.CanonicalizingRegexType]] ), @@ -134,7 +139,7 @@ def add( quicklinks, Optional[List[models.Quicklink]] ), render_config_preset=render_config_preset, - aliases=aliases, + aliases=utils.unmarshal(aliases, Optional[List[str]]), is_on_prem=is_on_prem, trust_url_regex_for_view_activity=trust_url_regex_for_view_activity, include_utm_source=include_utm_source, @@ -211,32 +216,35 @@ async def add_async( url_regex: Optional[str] = None, icon_url: Optional[str] = None, object_definitions: Optional[ - Union[List[models.ObjectDefinition], List[models.ObjectDefinitionTypedDict]] + Union[ + Iterable[models.ObjectDefinition], + Iterable[models.ObjectDefinitionTypedDict], + ] ] = None, suggestion_text: Optional[str] = None, home_url: Optional[str] = None, - crawler_seed_urls: Optional[List[str]] = None, + crawler_seed_urls: Optional[Iterable[str]] = None, icon_dark_url: Optional[str] = None, - hide_built_in_facets: Optional[List[models.HideBuiltInFacet]] = None, + hide_built_in_facets: Optional[Iterable[models.HideBuiltInFacet]] = None, canonicalizing_url_regex: Optional[ Union[ - List[models.CanonicalizingRegexType], - List[models.CanonicalizingRegexTypeTypedDict], + Iterable[models.CanonicalizingRegexType], + Iterable[models.CanonicalizingRegexTypeTypedDict], ] ] = None, canonicalizing_title_regex: Optional[ Union[ - List[models.CanonicalizingRegexType], - List[models.CanonicalizingRegexTypeTypedDict], + Iterable[models.CanonicalizingRegexType], + Iterable[models.CanonicalizingRegexTypeTypedDict], ] ] = None, redlist_title_regex: Optional[str] = None, connector_type: Optional[models.CustomDatasourceConfigConnectorType] = None, quicklinks: Optional[ - Union[List[models.Quicklink], List[models.QuicklinkTypedDict]] + Union[Iterable[models.Quicklink], Iterable[models.QuicklinkTypedDict]] ] = None, render_config_preset: Optional[str] = None, - aliases: Optional[List[str]] = None, + aliases: Optional[Iterable[str]] = None, is_on_prem: Optional[bool] = None, trust_url_regex_for_view_activity: Optional[bool] = True, include_utm_source: Optional[bool] = None, @@ -308,9 +316,11 @@ async def add_async( ), suggestion_text=suggestion_text, home_url=home_url, - crawler_seed_urls=crawler_seed_urls, + crawler_seed_urls=utils.unmarshal(crawler_seed_urls, Optional[List[str]]), icon_dark_url=icon_dark_url, - hide_built_in_facets=hide_built_in_facets, + hide_built_in_facets=utils.unmarshal( + hide_built_in_facets, Optional[List[models.HideBuiltInFacet]] + ), canonicalizing_url_regex=utils.get_pydantic_model( canonicalizing_url_regex, Optional[List[models.CanonicalizingRegexType]] ), @@ -324,7 +334,7 @@ async def add_async( quicklinks, Optional[List[models.Quicklink]] ), render_config_preset=render_config_preset, - aliases=aliases, + aliases=utils.unmarshal(aliases, Optional[List[str]]), is_on_prem=is_on_prem, trust_url_regex_for_view_activity=trust_url_regex_for_view_activity, include_utm_source=include_utm_source, diff --git a/src/glean/api_client/indexing_documents.py b/src/glean/api_client/indexing_documents.py index 9817af75..0fc7c889 100644 --- a/src/glean/api_client/indexing_documents.py +++ b/src/glean/api_client/indexing_documents.py @@ -6,7 +6,7 @@ from glean.api_client.types import BaseModel, 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 List, Mapping, Optional, Union, cast +from typing import Iterable, List, Mapping, Optional, Union, cast from typing_extensions import deprecated @@ -196,7 +196,8 @@ def index( *, datasource: str, documents: Union[ - List[models.DocumentDefinition], List[models.DocumentDefinitionTypedDict] + Iterable[models.DocumentDefinition], + Iterable[models.DocumentDefinitionTypedDict], ], upload_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -293,7 +294,8 @@ async def index_async( *, datasource: str, documents: Union[ - List[models.DocumentDefinition], List[models.DocumentDefinitionTypedDict] + Iterable[models.DocumentDefinition], + Iterable[models.DocumentDefinitionTypedDict], ], upload_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -391,7 +393,8 @@ def bulk_index( upload_id: str, datasource: str, documents: Union[ - List[models.DocumentDefinition], List[models.DocumentDefinitionTypedDict] + Iterable[models.DocumentDefinition], + Iterable[models.DocumentDefinitionTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, @@ -500,7 +503,8 @@ async def bulk_index_async( upload_id: str, datasource: str, documents: Union[ - List[models.DocumentDefinition], List[models.DocumentDefinitionTypedDict] + Iterable[models.DocumentDefinition], + Iterable[models.DocumentDefinitionTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, @@ -1222,8 +1226,8 @@ def debug_many( *, datasource: str, debug_documents: Union[ - List[models.DebugDocumentRequest], - List[models.DebugDocumentRequestTypedDict], + Iterable[models.DebugDocumentRequest], + Iterable[models.DebugDocumentRequestTypedDict], ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -1326,8 +1330,8 @@ async def debug_many_async( *, datasource: str, debug_documents: Union[ - List[models.DebugDocumentRequest], - List[models.DebugDocumentRequestTypedDict], + Iterable[models.DebugDocumentRequest], + Iterable[models.DebugDocumentRequestTypedDict], ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, diff --git a/src/glean/api_client/indexing_permissions.py b/src/glean/api_client/indexing_permissions.py index c41d5c91..ce426af4 100644 --- a/src/glean/api_client/indexing_permissions.py +++ b/src/glean/api_client/indexing_permissions.py @@ -5,7 +5,7 @@ from glean.api_client._hooks import HookContext from glean.api_client.types import BaseModel, OptionalNullable, UNSET from glean.api_client.utils import get_security_from_env -from typing import List, Mapping, Optional, Union, cast +from typing import Iterable, List, Mapping, Optional, Union, cast class IndexingPermissions(BaseSDK): @@ -415,8 +415,8 @@ def bulk_index_users( upload_id: str, datasource: str, users: Union[ - List[models.DatasourceUserDefinition], - List[models.DatasourceUserDefinitionTypedDict], + Iterable[models.DatasourceUserDefinition], + Iterable[models.DatasourceUserDefinitionTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, @@ -527,8 +527,8 @@ async def bulk_index_users_async( upload_id: str, datasource: str, users: Union[ - List[models.DatasourceUserDefinition], - List[models.DatasourceUserDefinitionTypedDict], + Iterable[models.DatasourceUserDefinition], + Iterable[models.DatasourceUserDefinitionTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, @@ -829,8 +829,8 @@ def bulk_index_groups( upload_id: str, datasource: str, groups: Union[ - List[models.DatasourceGroupDefinition], - List[models.DatasourceGroupDefinitionTypedDict], + Iterable[models.DatasourceGroupDefinition], + Iterable[models.DatasourceGroupDefinitionTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, @@ -941,8 +941,8 @@ async def bulk_index_groups_async( upload_id: str, datasource: str, groups: Union[ - List[models.DatasourceGroupDefinition], - List[models.DatasourceGroupDefinitionTypedDict], + Iterable[models.DatasourceGroupDefinition], + Iterable[models.DatasourceGroupDefinitionTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, @@ -1249,8 +1249,8 @@ def bulk_index_memberships( upload_id: str, datasource: str, memberships: Union[ - List[models.DatasourceBulkMembershipDefinition], - List[models.DatasourceBulkMembershipDefinitionTypedDict], + Iterable[models.DatasourceBulkMembershipDefinition], + Iterable[models.DatasourceBulkMembershipDefinitionTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, @@ -1359,8 +1359,8 @@ async def bulk_index_memberships_async( upload_id: str, datasource: str, memberships: Union[ - List[models.DatasourceBulkMembershipDefinition], - List[models.DatasourceBulkMembershipDefinitionTypedDict], + Iterable[models.DatasourceBulkMembershipDefinition], + Iterable[models.DatasourceBulkMembershipDefinitionTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, @@ -2241,7 +2241,7 @@ def authorize_beta_users( self, *, datasource: str, - emails: List[str], + emails: Iterable[str], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2270,7 +2270,7 @@ def authorize_beta_users( request = models.GreenlistUsersRequest( datasource=datasource, - emails=emails, + emails=utils.unmarshal(emails, List[str]), ) req = self._build_request( @@ -2331,7 +2331,7 @@ async def authorize_beta_users_async( self, *, datasource: str, - emails: List[str], + emails: Iterable[str], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2360,7 +2360,7 @@ async def authorize_beta_users_async( request = models.GreenlistUsersRequest( datasource=datasource, - emails=emails, + emails=utils.unmarshal(emails, List[str]), ) req = self._build_request_async( diff --git a/src/glean/api_client/indexing_shortcuts.py b/src/glean/api_client/indexing_shortcuts.py index bdfdec85..8e657a10 100644 --- a/src/glean/api_client/indexing_shortcuts.py +++ b/src/glean/api_client/indexing_shortcuts.py @@ -5,7 +5,7 @@ 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 List, Mapping, Optional, Union +from typing import Iterable, List, Mapping, Optional, Union class IndexingShortcuts(BaseSDK): @@ -14,7 +14,8 @@ def bulk_index( *, upload_id: str, shortcuts: Union[ - List[models.ExternalShortcut], List[models.ExternalShortcutTypedDict] + Iterable[models.ExternalShortcut], + Iterable[models.ExternalShortcutTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, @@ -117,7 +118,8 @@ async def bulk_index_async( *, upload_id: str, shortcuts: Union[ - List[models.ExternalShortcut], List[models.ExternalShortcutTypedDict] + Iterable[models.ExternalShortcut], + Iterable[models.ExternalShortcutTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, @@ -220,7 +222,8 @@ def upload( *, upload_id: str, shortcuts: Union[ - List[models.IndexingShortcut], List[models.IndexingShortcutTypedDict] + Iterable[models.IndexingShortcut], + Iterable[models.IndexingShortcutTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, @@ -323,7 +326,8 @@ async def upload_async( *, upload_id: str, shortcuts: Union[ - List[models.IndexingShortcut], List[models.IndexingShortcutTypedDict] + Iterable[models.IndexingShortcut], + Iterable[models.IndexingShortcutTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, diff --git a/src/glean/api_client/models/__init__.py b/src/glean/api_client/models/__init__.py index 10111171..6292b575 100644 --- a/src/glean/api_client/models/__init__.py +++ b/src/glean/api_client/models/__init__.py @@ -342,6 +342,7 @@ from .contentdefinition import ContentDefinition, ContentDefinitionTypedDict from .contenttype import ContentType from .countinfo import CountInfo, CountInfoTypedDict + from .createagentop import CreateAgentRequest, CreateAgentRequestTypedDict from .createannouncementop import ( CreateannouncementRequestRequest, CreateannouncementRequestRequestTypedDict, @@ -395,6 +396,10 @@ CreateShortcutResponse, CreateShortcutResponseTypedDict, ) + from .createworkflowrequest import ( + CreateWorkflowRequest, + CreateWorkflowRequestTypedDict, + ) from .currentactiveusers import CurrentActiveUsers, CurrentActiveUsersTypedDict from .customdatasourceconfig import ( CustomDatasourceConfig, @@ -790,7 +795,12 @@ FeedRequestOptionsTypedDict, ) from .feedresponse import FeedResponse, FeedResponseTypedDict - from .feedresult import FeedResult, FeedResultCategory, FeedResultTypedDict + from .feedresult import ( + FeedResult, + FeedResultCategory, + FeedResultTypedDict, + PlacementReason, + ) from .followupaction import FollowupAction, FollowupActionTypedDict from .generatedattachment import GeneratedAttachment, GeneratedAttachmentTypedDict from .generatedattachmentcontent import ( @@ -1799,6 +1809,8 @@ "ContentType", "CountInfo", "CountInfoTypedDict", + "CreateAgentRequest", + "CreateAgentRequestTypedDict", "CreateAnnouncementRequest", "CreateAnnouncementRequestChannel", "CreateAnnouncementRequestPostType", @@ -1817,6 +1829,8 @@ "CreateShortcutRequestTypedDict", "CreateShortcutResponse", "CreateShortcutResponseTypedDict", + "CreateWorkflowRequest", + "CreateWorkflowRequestTypedDict", "CreateannouncementRequestRequest", "CreateannouncementRequestRequestTypedDict", "CreateanswerRequestRequest", @@ -2479,6 +2493,7 @@ "PinRequestRequest", "PinRequestRequestTypedDict", "PinRequestTypedDict", + "PlacementReason", "PossibleValue", "PossibleValueTypedDict", "PostAPIIndexV1DebugDatasourceDocumentEventsRequest", @@ -3019,6 +3034,8 @@ "ContentType": ".contenttype", "CountInfo": ".countinfo", "CountInfoTypedDict": ".countinfo", + "CreateAgentRequest": ".createagentop", + "CreateAgentRequestTypedDict": ".createagentop", "CreateannouncementRequestRequest": ".createannouncementop", "CreateannouncementRequestRequestTypedDict": ".createannouncementop", "CreateAnnouncementRequest": ".createannouncementrequest", @@ -3051,6 +3068,8 @@ "CreateShortcutRequestTypedDict": ".createshortcutrequest", "CreateShortcutResponse": ".createshortcutresponse", "CreateShortcutResponseTypedDict": ".createshortcutresponse", + "CreateWorkflowRequest": ".createworkflowrequest", + "CreateWorkflowRequestTypedDict": ".createworkflowrequest", "CurrentActiveUsers": ".currentactiveusers", "CurrentActiveUsersTypedDict": ".currentactiveusers", "CustomDatasourceConfig": ".customdatasourceconfig", @@ -3354,6 +3373,7 @@ "FeedResult": ".feedresult", "FeedResultCategory": ".feedresult", "FeedResultTypedDict": ".feedresult", + "PlacementReason": ".feedresult", "FollowupAction": ".followupaction", "FollowupActionTypedDict": ".followupaction", "GeneratedAttachment": ".generatedattachment", diff --git a/src/glean/api_client/models/allowlistoptions.py b/src/glean/api_client/models/allowlistoptions.py index 123b345c..0059b3cd 100644 --- a/src/glean/api_client/models/allowlistoptions.py +++ b/src/glean/api_client/models/allowlistoptions.py @@ -8,21 +8,26 @@ class AllowlistOptionsTypedDict(TypedDict): - r"""Terms that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term in the allow-list, it will not be counted as a violation.""" + r"""Terms and regexes that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term, or matches a regex, in the allow-list, it will not be counted as a violation.""" terms: NotRequired[List[str]] r"""list of words and phrases to consider as whitelisted content""" + regexes: NotRequired[List[str]] + r"""list of regular expressions whose matches are considered whitelisted content""" class AllowlistOptions(BaseModel): - r"""Terms that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term in the allow-list, it will not be counted as a violation.""" + r"""Terms and regexes that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term, or matches a regex, in the allow-list, it will not be counted as a violation.""" terms: Optional[List[str]] = None r"""list of words and phrases to consider as whitelisted content""" + regexes: Optional[List[str]] = None + r"""list of regular expressions whose matches are considered whitelisted content""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["terms"]) + optional_fields = set(["terms", "regexes"]) serialized = handler(self) m = {} diff --git a/src/glean/api_client/models/createagentop.py b/src/glean/api_client/models/createagentop.py new file mode 100644 index 00000000..4ed4192d --- /dev/null +++ b/src/glean/api_client/models/createagentop.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .createworkflowrequest import CreateWorkflowRequest, CreateWorkflowRequestTypedDict +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from glean.api_client.utils import FieldMetadata, QueryParamMetadata, RequestMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateAgentRequestTypedDict(TypedDict): + create_workflow_request: CreateWorkflowRequestTypedDict + locale: NotRequired[str] + r"""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: NotRequired[int] + r"""The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.""" + + +class CreateAgentRequest(BaseModel): + create_workflow_request: Annotated[ + CreateWorkflowRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + locale: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""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: Annotated[ + Optional[int], + pydantic.Field(alias="timezoneOffset"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["locale", "timezoneOffset"]) + 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/createworkflowrequest.py b/src/glean/api_client/models/createworkflowrequest.py new file mode 100644 index 00000000..206d00f3 --- /dev/null +++ b/src/glean/api_client/models/createworkflowrequest.py @@ -0,0 +1,52 @@ +"""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 model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateWorkflowRequestTypedDict(TypedDict): + name: NotRequired[str] + r"""The name of the workflow.""" + transient: NotRequired[bool] + r"""Used to create a transient workflow.""" + parent_workflow_id: NotRequired[str] + r"""id of the parent workflow for transient workflows""" + + +class CreateWorkflowRequest(BaseModel): + name: Optional[str] = None + r"""The name of the workflow.""" + + transient: Optional[bool] = None + r"""Used to create a transient workflow.""" + + parent_workflow_id: Annotated[ + Optional[str], pydantic.Field(alias="parentWorkflowId") + ] = None + r"""id of the parent workflow for transient workflows""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["name", "transient", "parentWorkflowId"]) + 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 + + +try: + CreateWorkflowRequest.model_rebuild() +except NameError: + pass diff --git a/src/glean/api_client/models/dlpconfig.py b/src/glean/api_client/models/dlpconfig.py index f68bba2b..5b570053 100644 --- a/src/glean/api_client/models/dlpconfig.py +++ b/src/glean/api_client/models/dlpconfig.py @@ -47,7 +47,7 @@ class DlpConfigTypedDict(TypedDict): auto_hide_docs: NotRequired[bool] r"""auto hide documents with findings in the report""" allowlist_options: NotRequired[AllowlistOptionsTypedDict] - r"""Terms that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term in the allow-list, it will not be counted as a violation.""" + r"""Terms and regexes that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term, or matches a regex, in the allow-list, it will not be counted as a violation.""" class DlpConfig(BaseModel): @@ -111,7 +111,7 @@ class DlpConfig(BaseModel): allowlist_options: Annotated[ Optional[AllowlistOptions], pydantic.Field(alias="allowlistOptions") ] = None - r"""Terms that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term in the allow-list, it will not be counted as a violation.""" + r"""Terms and regexes that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term, or matches a regex, in the allow-list, it will not be counted as a violation.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/glean/api_client/models/feedentry.py b/src/glean/api_client/models/feedentry.py index eb60f1bd..e0057c6b 100644 --- a/src/glean/api_client/models/feedentry.py +++ b/src/glean/api_client/models/feedentry.py @@ -115,6 +115,7 @@ class JustificationType(str, Enum, metaclass=utils.OpenEnumMeta): MID_DAY_CATCH_UP = "MID_DAY_CATCH_UP" QUERY_SUGGESTION = "QUERY_SUGGESTION" COWORK_CUJ_PROMO = "COWORK_CUJ_PROMO" + CARD_STACK_PROMO = "CARD_STACK_PROMO" WEEKLY_MEETINGS = "WEEKLY_MEETINGS" FOLLOW_UP = "FOLLOW_UP" MILESTONE_TIMELINE_CHECK = "MILESTONE_TIMELINE_CHECK" diff --git a/src/glean/api_client/models/feedrequest.py b/src/glean/api_client/models/feedrequest.py index 22ab9c4e..d6641777 100644 --- a/src/glean/api_client/models/feedrequest.py +++ b/src/glean/api_client/models/feedrequest.py @@ -44,6 +44,7 @@ class FeedRequestCategory(str, Enum): MID_DAY_CATCH_UP = "MID_DAY_CATCH_UP" QUERY_SUGGESTION = "QUERY_SUGGESTION" COWORK_CUJ_PROMO = "COWORK_CUJ_PROMO" + CARD_STACK_PROMO = "CARD_STACK_PROMO" WEEKLY_MEETINGS = "WEEKLY_MEETINGS" FOLLOW_UP = "FOLLOW_UP" MILESTONE_TIMELINE_CHECK = "MILESTONE_TIMELINE_CHECK" diff --git a/src/glean/api_client/models/feedresult.py b/src/glean/api_client/models/feedresult.py index c3ee3e98..1f1f66a2 100644 --- a/src/glean/api_client/models/feedresult.py +++ b/src/glean/api_client/models/feedresult.py @@ -46,6 +46,7 @@ class FeedResultCategory(str, Enum, metaclass=utils.OpenEnumMeta): MID_DAY_CATCH_UP = "MID_DAY_CATCH_UP" QUERY_SUGGESTION = "QUERY_SUGGESTION" COWORK_CUJ_PROMO = "COWORK_CUJ_PROMO" + CARD_STACK_PROMO = "CARD_STACK_PROMO" WEEKLY_MEETINGS = "WEEKLY_MEETINGS" FOLLOW_UP = "FOLLOW_UP" MILESTONE_TIMELINE_CHECK = "MILESTONE_TIMELINE_CHECK" @@ -57,6 +58,13 @@ class FeedResultCategory(str, Enum, metaclass=utils.OpenEnumMeta): OOO_CATCH_UP = "OOO_CATCH_UP" +class PlacementReason(str, Enum, metaclass=utils.OpenEnumMeta): + r"""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.""" + + ORGANIC = "ORGANIC" + PROMO = "PROMO" + + class FeedResultTypedDict(TypedDict): category: FeedResultCategory r"""Category of the result, one of the requested categories in incoming request.""" @@ -65,6 +73,8 @@ class FeedResultTypedDict(TypedDict): r"""Secondary entries for the result e.g. suggested docs for the calendar, carousel.""" rank: NotRequired[int] r"""Rank of the result. Rank is suggested by server. Client side rank may differ.""" + placement_reason: NotRequired[PlacementReason] + r"""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.""" class FeedResult(BaseModel): @@ -81,6 +91,11 @@ class FeedResult(BaseModel): rank: Optional[int] = None r"""Rank of the result. Rank is suggested by server. Client side rank may differ.""" + placement_reason: Annotated[ + Optional[PlacementReason], pydantic.Field(alias="placementReason") + ] = None + r"""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.""" + @field_serializer("category") def serialize_category(self, value): if isinstance(value, str): @@ -90,9 +105,18 @@ def serialize_category(self, value): return value return value + @field_serializer("placement_reason") + def serialize_placement_reason(self, value): + if isinstance(value, str): + try: + return models.PlacementReason(value) + except ValueError: + return value + return value + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["secondaryEntries", "rank"]) + optional_fields = set(["secondaryEntries", "rank", "placementReason"]) serialized = handler(self) m = {} diff --git a/src/glean/api_client/models/grouptype.py b/src/glean/api_client/models/grouptype.py index c94336ed..88a980fb 100644 --- a/src/glean/api_client/models/grouptype.py +++ b/src/glean/api_client/models/grouptype.py @@ -16,3 +16,5 @@ class GroupType(str, Enum, metaclass=utils.OpenEnumMeta): LOCATION = "LOCATION" REGION = "REGION" EXTERNAL_GROUP = "EXTERNAL_GROUP" + # Refers to any viewers of the Collection. + COLLECTION_AUDIENCE = "COLLECTION_AUDIENCE" diff --git a/src/glean/api_client/models/uploadchatfilesrequest.py b/src/glean/api_client/models/uploadchatfilesrequest.py index 8e8d01c0..1a4665d1 100644 --- a/src/glean/api_client/models/uploadchatfilesrequest.py +++ b/src/glean/api_client/models/uploadchatfilesrequest.py @@ -12,7 +12,7 @@ class FileTypedDict(TypedDict): file_name: str - content: Union[bytes, IO[bytes], io.BufferedReader] + content: Union[bytes, IO[bytes], io.IOBase] content_type: NotRequired[str] @@ -22,7 +22,7 @@ class File(BaseModel): ] content: Annotated[ - Union[bytes, IO[bytes], io.BufferedReader], + Union[bytes, IO[bytes], io.IOBase], pydantic.Field(alias=""), FieldMetadata(multipart=MultipartFormMetadata(content=True)), ] diff --git a/src/glean/api_client/people.py b/src/glean/api_client/people.py index 8f853d2a..9d002776 100644 --- a/src/glean/api_client/people.py +++ b/src/glean/api_client/people.py @@ -6,7 +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 -from typing import List, Mapping, Optional, Union +from typing import Iterable, List, Mapping, Optional, Union from typing_extensions import deprecated @@ -587,8 +587,8 @@ def bulk_index( *, upload_id: str, employees: Union[ - List[models.EmployeeInfoDefinition], - List[models.EmployeeInfoDefinitionTypedDict], + Iterable[models.EmployeeInfoDefinition], + Iterable[models.EmployeeInfoDefinitionTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, @@ -697,8 +697,8 @@ async def bulk_index_async( *, upload_id: str, employees: Union[ - List[models.EmployeeInfoDefinition], - List[models.EmployeeInfoDefinitionTypedDict], + Iterable[models.EmployeeInfoDefinition], + Iterable[models.EmployeeInfoDefinitionTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, @@ -1494,7 +1494,8 @@ def bulk_index_teams( *, upload_id: str, teams: Union[ - List[models.TeamInfoDefinition], List[models.TeamInfoDefinitionTypedDict] + Iterable[models.TeamInfoDefinition], + Iterable[models.TeamInfoDefinitionTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, @@ -1595,7 +1596,8 @@ async def bulk_index_teams_async( *, upload_id: str, teams: Union[ - List[models.TeamInfoDefinition], List[models.TeamInfoDefinitionTypedDict] + Iterable[models.TeamInfoDefinition], + Iterable[models.TeamInfoDefinitionTypedDict], ], is_first_page: Optional[bool] = None, is_last_page: Optional[bool] = None, diff --git a/src/glean/api_client/pins.py b/src/glean/api_client/pins.py index 0127c007..8635dd29 100644 --- a/src/glean/api_client/pins.py +++ b/src/glean/api_client/pins.py @@ -6,7 +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 -from typing import List, Mapping, Optional, Union +from typing import Iterable, List, Mapping, Optional, Union class Pins(BaseSDK): @@ -14,9 +14,9 @@ def update( self, *, locale: Optional[str] = None, - queries: Optional[List[str]] = None, + queries: Optional[Iterable[str]] = None, audience_filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -50,7 +50,7 @@ def update( request = models.EditpinRequestRequest( locale=locale, edit_pin_request=models.EditPinRequest( - queries=queries, + queries=utils.unmarshal(queries, Optional[List[str]]), audience_filters=utils.get_pydantic_model( audience_filters, Optional[List[models.FacetFilter]] ), @@ -116,9 +116,9 @@ async def update_async( self, *, locale: Optional[str] = None, - queries: Optional[List[str]] = None, + queries: Optional[Iterable[str]] = None, audience_filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -152,7 +152,7 @@ async def update_async( request = models.EditpinRequestRequest( locale=locale, edit_pin_request=models.EditPinRequest( - queries=queries, + queries=utils.unmarshal(queries, Optional[List[str]]), audience_filters=utils.get_pydantic_model( audience_filters, Optional[List[models.FacetFilter]] ), @@ -590,9 +590,9 @@ def create( self, *, locale: Optional[str] = None, - queries: Optional[List[str]] = None, + queries: Optional[Iterable[str]] = None, audience_filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, document_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -626,7 +626,7 @@ def create( request = models.PinRequestRequest( locale=locale, pin_request=models.PinRequest( - queries=queries, + queries=utils.unmarshal(queries, Optional[List[str]]), audience_filters=utils.get_pydantic_model( audience_filters, Optional[List[models.FacetFilter]] ), @@ -692,9 +692,9 @@ async def create_async( self, *, locale: Optional[str] = None, - queries: Optional[List[str]] = None, + queries: Optional[Iterable[str]] = None, audience_filters: Optional[ - Union[List[models.FacetFilter], List[models.FacetFilterTypedDict]] + Union[Iterable[models.FacetFilter], Iterable[models.FacetFilterTypedDict]] ] = None, document_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -728,7 +728,7 @@ async def create_async( request = models.PinRequestRequest( locale=locale, pin_request=models.PinRequest( - queries=queries, + queries=utils.unmarshal(queries, Optional[List[str]]), audience_filters=utils.get_pydantic_model( audience_filters, Optional[List[models.FacetFilter]] ), diff --git a/src/glean/api_client/search.py b/src/glean/api_client/search.py index 22746832..d599dd5a 100644 --- a/src/glean/api_client/search.py +++ b/src/glean/api_client/search.py @@ -7,7 +7,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 -from typing import Any, List, Mapping, Optional, Union +from typing import Any, Iterable, List, Mapping, Optional, Union class Search(BaseSDK): @@ -27,7 +27,7 @@ def query_as_admin( page_size: Optional[int] = None, max_snippet_size: Optional[int] = None, cursor: Optional[str] = None, - result_tab_ids: Optional[List[str]] = None, + result_tab_ids: Optional[Iterable[str]] = None, input_details: Optional[ Union[ models.SearchRequestInputDetails, @@ -92,7 +92,7 @@ def query_as_admin( max_snippet_size=max_snippet_size, query=query, cursor=cursor, - result_tab_ids=result_tab_ids, + result_tab_ids=utils.unmarshal(result_tab_ids, Optional[List[str]]), input_details=utils.get_pydantic_model( input_details, Optional[models.SearchRequestInputDetails] ), @@ -178,7 +178,7 @@ async def query_as_admin_async( page_size: Optional[int] = None, max_snippet_size: Optional[int] = None, cursor: Optional[str] = None, - result_tab_ids: Optional[List[str]] = None, + result_tab_ids: Optional[Iterable[str]] = None, input_details: Optional[ Union[ models.SearchRequestInputDetails, @@ -243,7 +243,7 @@ async def query_as_admin_async( max_snippet_size=max_snippet_size, query=query, cursor=cursor, - result_tab_ids=result_tab_ids, + result_tab_ids=utils.unmarshal(result_tab_ids, Optional[List[str]]), input_details=utils.get_pydantic_model( input_details, Optional[models.SearchRequestInputDetails] ), @@ -322,12 +322,12 @@ def autocomplete( Union[models.SessionInfo, models.SessionInfoTypedDict] ] = None, query: Optional[str] = None, - datasources_filter: Optional[List[str]] = None, + datasources_filter: Optional[Iterable[str]] = None, datasource: Optional[str] = None, - result_types: Optional[List[models.AutocompleteRequestResultType]] = None, + result_types: Optional[Iterable[models.AutocompleteRequestResultType]] = None, result_size: Optional[int] = None, auth_tokens: Optional[ - Union[List[models.AuthToken], List[models.AuthTokenTypedDict]] + Union[Iterable[models.AuthToken], Iterable[models.AuthTokenTypedDict]] ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -371,9 +371,13 @@ def autocomplete( session_info, Optional[models.SessionInfo] ), query=query, - datasources_filter=datasources_filter, + datasources_filter=utils.unmarshal( + datasources_filter, Optional[List[str]] + ), datasource=datasource, - result_types=result_types, + 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]] @@ -448,12 +452,12 @@ async def autocomplete_async( Union[models.SessionInfo, models.SessionInfoTypedDict] ] = None, query: Optional[str] = None, - datasources_filter: Optional[List[str]] = None, + datasources_filter: Optional[Iterable[str]] = None, datasource: Optional[str] = None, - result_types: Optional[List[models.AutocompleteRequestResultType]] = None, + result_types: Optional[Iterable[models.AutocompleteRequestResultType]] = None, result_size: Optional[int] = None, auth_tokens: Optional[ - Union[List[models.AuthToken], List[models.AuthTokenTypedDict]] + Union[Iterable[models.AuthToken], Iterable[models.AuthTokenTypedDict]] ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -497,9 +501,13 @@ async def autocomplete_async( session_info, Optional[models.SessionInfo] ), query=query, - datasources_filter=datasources_filter, + datasources_filter=utils.unmarshal( + datasources_filter, Optional[List[str]] + ), datasource=datasource, - result_types=result_types, + 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]] @@ -569,7 +577,7 @@ def retrieve_feed( self, *, locale: Optional[str] = None, - categories: Optional[List[models.FeedRequestCategory]] = None, + categories: Optional[Iterable[models.FeedRequestCategory]] = None, request_options: Optional[ Union[models.FeedRequestOptions, models.FeedRequestOptionsTypedDict] ] = None, @@ -609,7 +617,9 @@ def retrieve_feed( request = models.FeedRequestRequest( locale=locale, feed_request=models.FeedRequest( - categories=categories, + categories=utils.unmarshal( + categories, Optional[List[models.FeedRequestCategory]] + ), request_options=utils.get_pydantic_model( request_options, Optional[models.FeedRequestOptions] ), @@ -678,7 +688,7 @@ async def retrieve_feed_async( self, *, locale: Optional[str] = None, - categories: Optional[List[models.FeedRequestCategory]] = None, + categories: Optional[Iterable[models.FeedRequestCategory]] = None, request_options: Optional[ Union[models.FeedRequestOptions, models.FeedRequestOptionsTypedDict] ] = None, @@ -718,7 +728,9 @@ async def retrieve_feed_async( request = models.FeedRequestRequest( locale=locale, feed_request=models.FeedRequest( - categories=categories, + categories=utils.unmarshal( + categories, Optional[List[models.FeedRequestCategory]] + ), request_options=utils.get_pydantic_model( request_options, Optional[models.FeedRequestOptions] ), @@ -1075,7 +1087,7 @@ def query( page_size: Optional[int] = None, max_snippet_size: Optional[int] = None, cursor: Optional[str] = None, - result_tab_ids: Optional[List[str]] = None, + result_tab_ids: Optional[Iterable[str]] = None, input_details: Optional[ Union[ models.SearchRequestInputDetails, @@ -1140,7 +1152,7 @@ def query( max_snippet_size=max_snippet_size, query=query, cursor=cursor, - result_tab_ids=result_tab_ids, + result_tab_ids=utils.unmarshal(result_tab_ids, Optional[List[str]]), input_details=utils.get_pydantic_model( input_details, Optional[models.SearchRequestInputDetails] ), @@ -1226,7 +1238,7 @@ async def query_async( page_size: Optional[int] = None, max_snippet_size: Optional[int] = None, cursor: Optional[str] = None, - result_tab_ids: Optional[List[str]] = None, + result_tab_ids: Optional[Iterable[str]] = None, input_details: Optional[ Union[ models.SearchRequestInputDetails, @@ -1291,7 +1303,7 @@ async def query_async( max_snippet_size=max_snippet_size, query=query, cursor=cursor, - result_tab_ids=result_tab_ids, + result_tab_ids=utils.unmarshal(result_tab_ids, Optional[List[str]]), input_details=utils.get_pydantic_model( input_details, Optional[models.SearchRequestInputDetails] ), diff --git a/src/glean/api_client/types/base64fileinput.py b/src/glean/api_client/types/base64fileinput.py index 25fc5398..862566fe 100644 --- a/src/glean/api_client/types/base64fileinput.py +++ b/src/glean/api_client/types/base64fileinput.py @@ -23,7 +23,11 @@ def encode_base64_file_input(value: Any) -> Any: with open(value, "rb") as fh: binary = fh.read() else: + # Restore position after reading: pydantic may validate the same stream more than once. + position = value.tell() if value.seekable() else None binary = value.read() + if position is not None: + value.seek(position) if isinstance(binary, str): binary = binary.encode() if not isinstance(binary, (bytes, bytearray)): diff --git a/src/glean/api_client/utils/eventstreaming.py b/src/glean/api_client/utils/eventstreaming.py index 3bdcd6d3..a8d4fe5c 100644 --- a/src/glean/api_client/utils/eventstreaming.py +++ b/src/glean/api_client/utils/eventstreaming.py @@ -7,6 +7,7 @@ Any, Callable, Generic, + List, TypeVar, Optional, Generator, @@ -53,6 +54,9 @@ def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): + self.close() + + def close(self): self._closed = True self.response.close() @@ -92,6 +96,9 @@ async def __aenter__(self): return self async def __aexit__(self, exc_type, exc_val, exc_tb): + await self.close() + + async def close(self): self._closed = True await self.response.aclose() @@ -114,6 +121,7 @@ class ServerEvent: b"\n\r", b"\n\n", ] +MAX_BOUNDARY_LEN = max(len(b) for b in MESSAGE_BOUNDARIES) UTF8_BOM = b"\xef\xbb\xbf" @@ -124,52 +132,56 @@ async def stream_events_async( sentinel: Optional[str] = None, data_required: bool = True, ) -> AsyncGenerator[T, None]: - buffer = bytearray() - position = 0 - event_id: Optional[str] = None - async for chunk in response.aiter_bytes(): - if len(buffer) == 0 and chunk.startswith(UTF8_BOM): - chunk = chunk[len(UTF8_BOM) :] - buffer += chunk - for i in range(position, len(buffer)): - char = buffer[i : i + 1] - seq: Optional[bytes] = None - if char in [b"\r", b"\n"]: - for boundary in MESSAGE_BOUNDARIES: - seq = _peek_sequence(i, buffer, boundary) - if seq is not None: - break - if seq is None: - continue - - block = buffer[position:i] - position = i + len(seq) - event, discard, event_id = _parse_event( - raw=block, - decoder=decoder, - sentinel=sentinel, - event_id=event_id, - data_required=data_required, - ) - if event is not None: - yield event - if discard: - await response.aclose() - return - - if position > 0: - buffer = buffer[position:] - position = 0 - - event, discard, _ = _parse_event( - raw=buffer, - decoder=decoder, - sentinel=sentinel, - event_id=event_id, - data_required=data_required, - ) - if event is not None: - yield event + try: + buffer = bytearray() + position = 0 + event_id: Optional[str] = None + async for chunk in response.aiter_bytes(): + if len(buffer) == 0 and chunk.startswith(UTF8_BOM): + chunk = chunk[len(UTF8_BOM) :] + old_len = len(buffer) + buffer += chunk + search_start = max(position, old_len - MAX_BOUNDARY_LEN + 1) + for i in range(search_start, len(buffer)): + char = buffer[i : i + 1] + seq: Optional[bytes] = None + if char in [b"\r", b"\n"]: + for boundary in MESSAGE_BOUNDARIES: + seq = _peek_sequence(i, buffer, boundary) + if seq is not None: + break + if seq is None: + continue + + block = buffer[position:i] + position = i + len(seq) + event, discard, event_id = _parse_event( + raw=block, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, + ) + if event is not None: + yield event + if discard: + return + + if position > 0: + buffer = buffer[position:] + position = 0 + + event, discard, _ = _parse_event( + raw=buffer, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, + ) + if event is not None: + yield event + finally: + await response.aclose() def stream_events( @@ -178,52 +190,56 @@ def stream_events( sentinel: Optional[str] = None, data_required: bool = True, ) -> Generator[T, None, None]: - buffer = bytearray() - position = 0 - event_id: Optional[str] = None - for chunk in response.iter_bytes(): - if len(buffer) == 0 and chunk.startswith(UTF8_BOM): - chunk = chunk[len(UTF8_BOM) :] - buffer += chunk - for i in range(position, len(buffer)): - char = buffer[i : i + 1] - seq: Optional[bytes] = None - if char in [b"\r", b"\n"]: - for boundary in MESSAGE_BOUNDARIES: - seq = _peek_sequence(i, buffer, boundary) - if seq is not None: - break - if seq is None: - continue - - block = buffer[position:i] - position = i + len(seq) - event, discard, event_id = _parse_event( - raw=block, - decoder=decoder, - sentinel=sentinel, - event_id=event_id, - data_required=data_required, - ) - if event is not None: - yield event - if discard: - response.close() - return - - if position > 0: - buffer = buffer[position:] - position = 0 - - event, discard, _ = _parse_event( - raw=buffer, - decoder=decoder, - sentinel=sentinel, - event_id=event_id, - data_required=data_required, - ) - if event is not None: - yield event + try: + buffer = bytearray() + position = 0 + event_id: Optional[str] = None + for chunk in response.iter_bytes(): + if len(buffer) == 0 and chunk.startswith(UTF8_BOM): + chunk = chunk[len(UTF8_BOM) :] + old_len = len(buffer) + buffer += chunk + search_start = max(position, old_len - MAX_BOUNDARY_LEN + 1) + for i in range(search_start, len(buffer)): + char = buffer[i : i + 1] + seq: Optional[bytes] = None + if char in [b"\r", b"\n"]: + for boundary in MESSAGE_BOUNDARIES: + seq = _peek_sequence(i, buffer, boundary) + if seq is not None: + break + if seq is None: + continue + + block = buffer[position:i] + position = i + len(seq) + event, discard, event_id = _parse_event( + raw=block, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, + ) + if event is not None: + yield event + if discard: + return + + if position > 0: + buffer = buffer[position:] + position = 0 + + event, discard, _ = _parse_event( + raw=buffer, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, + ) + if event is not None: + yield event + finally: + response.close() def _parse_event( @@ -238,7 +254,7 @@ def _parse_event( lines = re.split(r"\r?\n|\r", block) publish = False event = ServerEvent() - data = "" + data_parts: List[str] = [] for line in lines: if not line: continue @@ -259,7 +275,7 @@ def _parse_event( event.event = value publish = True elif field == "data": - data += value + "\n" + data_parts.append(value) publish = True elif field == "id": publish = True @@ -271,16 +287,17 @@ def _parse_event( publish = True event.id = event_id + has_data = bool(data_parts) + data = "\n".join(data_parts) - if sentinel and data == f"{sentinel}\n": + if sentinel and has_data and data == sentinel: return None, True, event_id # Skip data-less events when data is required - if not data and publish and data_required: + if not has_data and publish and data_required: return None, False, event_id - if data: - data = data[:-1] + if has_data: try: event.data = json.loads(data) except json.JSONDecodeError: @@ -291,7 +308,7 @@ def _parse_event( out_dict = { k: v for k, v in asdict(event).items() - if v is not None or (k == "data" and data) + if v is not None or (k == "data" and has_data) } out = decoder(json.dumps(out_dict)) diff --git a/src/glean/api_client/utils/forms.py b/src/glean/api_client/utils/forms.py index 1e550bd5..193f2649 100644 --- a/src/glean/api_client/utils/forms.py +++ b/src/glean/api_client/utils/forms.py @@ -1,5 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +import io from typing import ( Any, Dict, @@ -103,6 +104,10 @@ def _extract_file_properties(file_obj: Any) -> Tuple[str, Any, Any]: if file_metadata.content: content = getattr(file_obj, file_field_name, None) + if isinstance(content, io.TextIOBase): + content = content.read().encode( + getattr(content, "encoding", None) or "utf-8" + ) elif file_field_name == "content_type": content_type = getattr(file_obj, file_field_name, None) else: diff --git a/src/glean/api_client/utils/retries.py b/src/glean/api_client/utils/retries.py index af07d4e9..ca7b59ef 100644 --- a/src/glean/api_client/utils/retries.py +++ b/src/glean/api_client/utils/retries.py @@ -11,10 +11,13 @@ class BackoffStrategy: + """Exponential backoff strategy configuration.""" + initial_interval: int max_interval: int exponent: float max_elapsed_time: int + jitter_ms: Optional[int] def __init__( self, @@ -22,24 +25,63 @@ def __init__( max_interval: int, exponent: float, max_elapsed_time: int, + jitter_ms: Optional[int] = None, ): + """Initialize a backoff strategy. + + Args: + initial_interval: Initial retry interval in milliseconds. + max_interval: Maximum retry interval in milliseconds. + exponent: Base of the exponential backoff; the interval grows as + ``initial_interval * exponent ** retries``. + max_elapsed_time: Maximum total elapsed time in milliseconds. + jitter_ms: Additive jitter bound in milliseconds. When set, adds a random + value in ``[0, jitter_ms]`` to each computed backoff interval (default + ``+[0, 1s]``). + + Note: + When a response carries a ``Retry-After`` or ``retry-after-ms`` header, + that delay is used as-is and the sleep-shaping parameters + (``initial_interval``, ``max_interval``, ``exponent``, ``jitter_ms``) are + ignored for that attempt. + """ + if jitter_ms is not None and jitter_ms < 0: + raise ValueError("jitter_ms must be >= 0") self.initial_interval = initial_interval self.max_interval = max_interval self.exponent = exponent self.max_elapsed_time = max_elapsed_time + self.jitter_ms = jitter_ms class RetryConfig: + """Runtime retry configuration.""" + strategy: str backoff: BackoffStrategy retry_connection_errors: bool + status_codes_override: Optional[List[str]] def __init__( - self, strategy: str, backoff: BackoffStrategy, retry_connection_errors: bool + self, + strategy: str, + backoff: BackoffStrategy, + retry_connection_errors: bool, + status_codes_override: Optional[List[str]] = None, ): + """Initialize a retry configuration. + + Args: + strategy: Retry strategy: ``"none"`` or ``"backoff"``. + backoff: Backoff parameters. + retry_connection_errors: Whether to also retry transport-level connection errors. + status_codes_override: Retryable HTTP status codes that take precedence over the + per-operation defaults when non-empty. + """ self.strategy = strategy self.backoff = backoff self.retry_connection_errors = retry_connection_errors + self.status_codes_override = status_codes_override class Retries: @@ -48,7 +90,7 @@ class Retries: def __init__(self, config: RetryConfig, status_codes: List[str]): self.config = config - self.status_codes = status_codes + self.status_codes = config.status_codes_override or status_codes class TemporaryError(Exception): @@ -93,12 +135,28 @@ def _parse_retry_after_header(response: httpx.Response) -> Optional[int]: return None +def _parse_retry_after_ms_header(response: httpx.Response) -> Optional[int]: + retry_after_ms_header = response.headers.get("retry-after-ms") + if not retry_after_ms_header: + return None + + try: + milliseconds = float(retry_after_ms_header) + if milliseconds >= 0: + return round(milliseconds) + except (OverflowError, ValueError): + pass + + return None + + def _get_sleep_interval( exception: Exception, initial_interval: int, max_interval: int, exponent: float, retries: int, + jitter_ms: Optional[int] = None, ) -> float: """Get sleep interval for retry with exponential backoff. @@ -108,6 +166,7 @@ def _get_sleep_interval( max_interval: Maximum retry interval in milliseconds. exponent: Base for exponential backoff calculation. retries: Current retry attempt count. + jitter_ms: Additive jitter bound in ms; see ``BackoffStrategy.jitter_ms``. Returns: Sleep interval in seconds. @@ -119,7 +178,11 @@ def _get_sleep_interval( ): return exception.retry_after / 1000 - sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) + sleep = (initial_interval / 1000) * exponent**retries + if jitter_ms is not None: + sleep += random.uniform(0, jitter_ms / 1000) + else: + sleep += random.uniform(0, 1) return min(sleep, max_interval / 1000) @@ -162,6 +225,7 @@ def do_request() -> httpx.Response: retries.config.backoff.max_interval, retries.config.backoff.exponent, retries.config.backoff.max_elapsed_time, + retries.config.backoff.jitter_ms, ) return func() @@ -206,6 +270,7 @@ async def do_request() -> httpx.Response: retries.config.backoff.max_interval, retries.config.backoff.exponent, retries.config.backoff.max_elapsed_time, + retries.config.backoff.jitter_ms, ) return await func() @@ -217,6 +282,7 @@ def retry_with_backoff( max_interval=60000, exponent=1.5, max_elapsed_time=3600000, + jitter_ms=None, ): start = round(time.time() * 1000) retries = 0 @@ -234,8 +300,17 @@ def retry_with_backoff( raise + if isinstance(exception, TemporaryError): + retry_after_ms = _parse_retry_after_ms_header(exception.response) + if retry_after_ms is not None: + exception.retry_after = retry_after_ms sleep = _get_sleep_interval( - exception, initial_interval, max_interval, exponent, retries + exception, + initial_interval, + max_interval, + exponent, + retries, + jitter_ms=jitter_ms, ) time.sleep(sleep) retries += 1 @@ -247,6 +322,7 @@ async def retry_with_backoff_async( max_interval=60000, exponent=1.5, max_elapsed_time=3600000, + jitter_ms=None, ): start = round(time.time() * 1000) retries = 0 @@ -264,8 +340,17 @@ async def retry_with_backoff_async( raise + if isinstance(exception, TemporaryError): + retry_after_ms = _parse_retry_after_ms_header(exception.response) + if retry_after_ms is not None: + exception.retry_after = retry_after_ms sleep = _get_sleep_interval( - exception, initial_interval, max_interval, exponent, retries + exception, + initial_interval, + max_interval, + exponent, + retries, + jitter_ms=jitter_ms, ) await asyncio.sleep(sleep) retries += 1 diff --git a/src/glean/api_client/utils/serializers.py b/src/glean/api_client/utils/serializers.py index d2149f8b..1031ed93 100644 --- a/src/glean/api_client/utils/serializers.py +++ b/src/glean/api_client/utils/serializers.py @@ -4,7 +4,7 @@ import functools import json import typing -from typing import Any, Dict, List, Tuple, Union, get_args +from typing import Any, Dict, Iterable, List, Mapping, Tuple, Union, get_args import typing_extensions from typing_extensions import get_origin @@ -113,10 +113,12 @@ def validate(c): def unmarshal_json(raw, typ: Any) -> Any: - return unmarshal(from_json(raw), typ) + return unmarshal(from_json(raw), typ, coerce_iterables=False) -def unmarshal(val, typ: Any) -> Any: +def unmarshal(val, typ: Any, coerce_iterables: bool = True) -> Any: + if coerce_iterables: + val = _coerce_iterables_for_type(val, typ) unmarshaller = create_model( "Unmarshaller", body=(typ, ...), @@ -193,9 +195,88 @@ def get_pydantic_model(data: Any, typ: Any) -> Any: if not _contains_pydantic_model(data): return unmarshal(data, typ) + return _coerce_iterables_for_type(data, typ) + + +def _coerce_iterables_for_type(data: Any, typ: Any) -> Any: + if data is None or isinstance(data, (BaseModel, Unset)): + return data + + typ = _resolve_type_alias(typ) + origin = get_origin(typ) + + if _is_annotated_type(origin): + args = get_args(typ) + return _coerce_iterables_for_type(data, args[0]) if args else data + + if is_union(origin): + for arg in (arg for arg in get_args(typ) if arg is not type(None)): + coerced = _coerce_iterables_for_type(data, arg) + if coerced is not data: + return coerced + return data + + if _is_list_type(typ): + item_type = get_args(typ)[0] if get_args(typ) else Any + if isinstance(data, (str, bytes, bytearray, Mapping)): + return data + if isinstance(data, Iterable): + return [_coerce_iterables_for_type(item, item_type) for item in data] + return data + + if _is_mapping_type(typ): + value_type = get_args(typ)[1] if len(get_args(typ)) > 1 else Any + if isinstance(data, Mapping): + return { + key: _coerce_iterables_for_type(value, value_type) + for key, value in data.items() + } + return data + + if _is_pydantic_model_type(typ) and isinstance(data, Mapping): + coerced = None + for field_name, field in typ.model_fields.items(): + field_type = field.annotation + for key in (field_name, field.alias): + if key is not None and key in data: + value = data[key] if coerced is None else coerced[key] + coerced_value = _coerce_iterables_for_type(value, field_type) + if coerced_value is not value: + if coerced is None: + coerced = dict(data) + coerced[key] = coerced_value + return coerced if coerced is not None else data + return data +def _resolve_type_alias(typ: Any) -> Any: + return getattr(typ, "__value__", typ) + + +def _is_annotated_type(origin: Any) -> bool: + return any( + origin is typing_obj + for typing_obj in _get_typing_objects_by_name_of("Annotated") + ) + + +def _is_list_type(typ: Any) -> bool: + typ = _resolve_type_alias(typ) + return typ is list or get_origin(typ) is list + + +def _is_mapping_type(typ: Any) -> bool: + typ = _resolve_type_alias(typ) + origin = get_origin(typ) + mapping_origin = get_origin(Mapping[Any, Any]) + return typ in (dict, Dict, Mapping) or origin in (dict, Mapping, mapping_origin) + + +def _is_pydantic_model_type(typ: Any) -> bool: + return isinstance(typ, type) and issubclass(typ, BaseModel) + + def _contains_pydantic_model(data: Any) -> bool: if isinstance(data, BaseModel): return True diff --git a/src/glean/api_client/visibilityoverrides.py b/src/glean/api_client/visibilityoverrides.py index ecbc256b..e7befb7a 100644 --- a/src/glean/api_client/visibilityoverrides.py +++ b/src/glean/api_client/visibilityoverrides.py @@ -6,14 +6,14 @@ 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 List, Mapping, Optional, Union +from typing import Iterable, List, Mapping, Optional, Union class Visibilityoverrides(BaseSDK): def list( self, *, - doc_ids: Optional[List[str]] = None, + doc_ids: Optional[Iterable[str]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -40,7 +40,7 @@ def list( base_url = self._get_url(base_url, url_variables) request = models.GetdocvisibilityRequest( - doc_ids=doc_ids, + doc_ids=utils.unmarshal(doc_ids, Optional[List[str]]), ) req = self._build_request( @@ -99,7 +99,7 @@ def list( async def list_async( self, *, - doc_ids: Optional[List[str]] = None, + doc_ids: Optional[Iterable[str]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -126,7 +126,7 @@ async def list_async( base_url = self._get_url(base_url, url_variables) request = models.GetdocvisibilityRequest( - doc_ids=doc_ids, + doc_ids=utils.unmarshal(doc_ids, Optional[List[str]]), ) req = self._build_request_async( @@ -187,8 +187,8 @@ def create( *, visibility_overrides: Optional[ Union[ - List[models.DocumentVisibilityOverride], - List[models.DocumentVisibilityOverrideTypedDict], + Iterable[models.DocumentVisibilityOverride], + Iterable[models.DocumentVisibilityOverrideTypedDict], ] ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -287,8 +287,8 @@ async def create_async( *, visibility_overrides: Optional[ Union[ - List[models.DocumentVisibilityOverride], - List[models.DocumentVisibilityOverrideTypedDict], + Iterable[models.DocumentVisibilityOverride], + Iterable[models.DocumentVisibilityOverrideTypedDict], ] ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, diff --git a/tests/mockserver/internal/handler/generated_handlers.go b/tests/mockserver/internal/handler/generated_handlers.go index 6400b090..a8a0a755 100644 --- a/tests/mockserver/internal/handler/generated_handlers.go +++ b/tests/mockserver/internal/handler/generated_handlers.go @@ -57,6 +57,7 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/addcollectionitems", pathPostRestAPIV1Addcollectionitems(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/addverificationreminder", pathPostRestAPIV1Addverificationreminder(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/adminsearch", pathPostRestAPIV1Adminsearch(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/agents", pathPostRestAPIV1Agents(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/autocomplete", pathPostRestAPIV1Autocomplete(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/chat", pathPostRestAPIV1Chat(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/checkdatasourceauth", pathPostRestAPIV1Checkdatasourceauth(dir, rt)), diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1agents.go b/tests/mockserver/internal/handler/pathpostrestapiv1agents.go new file mode 100644 index 00000000..6c1367d6 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1agents.go @@ -0,0 +1,82 @@ +// 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 pathPostRestAPIV1Agents(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 "createAgent[0]": + dir.HandlerFunc("createAgent", testCreateAgentCreateAgent0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testCreateAgentCreateAgent0(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.WorkflowResult = &components.WorkflowResult{ + Workflow: components.Workflow{ + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + LastDraftSavedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + LastUpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + } + 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/pathpostrestapiv1createcollection.go b/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go index 371b9023..5c99a0ad 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go @@ -56,14 +56,14 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ operations.ResponseBody2{ Collection: &components.Collection{ Name: "", - Description: "whole busily jive hawk gee basic minus hence", + Description: "motionless whenever paintwork import over cuckoo", AddedRoles: []components.UserRoleSpecification{ components.UserRoleSpecification{ Person: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", }, - Role: components.UserRoleAnswerModerator, + Role: components.UserRoleOwner, }, }, RemovedRoles: []components.UserRoleSpecification{ @@ -90,7 +90,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 158969, + ID: 363711, Creator: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -101,7 +101,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, Items: []components.CollectionItem{ components.CollectionItem{ - CollectionID: 110375, + CollectionID: 570197, CreatedBy: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -266,13 +266,13 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ Name: "George Clooney", ObfuscatedID: "abc123", }, - Role: components.UserRoleEditor, + Role: components.UserRoleAnswerModerator, }, }, }, Collection: &components.Collection{ Name: "", - Description: "wedge colorfully orientate rally", + Description: "athwart skateboard newsstand farm bourgeoisie ah how elliptical aha well-to-do", AudienceFilters: []components.FacetFilter{ components.FacetFilter{ FieldName: types.String("type"), @@ -288,7 +288,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 131797, + ID: 643990, Creator: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -300,7 +300,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ Children: []components.Collection{ components.Collection{ Name: "", - Description: "outside yippee sidetrack mature regularly mouser inject worth", + Description: "woot purse salty even as advanced", AudienceFilters: []components.FacetFilter{ components.FacetFilter{ FieldName: types.String("type"), @@ -316,7 +316,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 149448, + ID: 359978, Creator: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -328,7 +328,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ItemType: components.CollectionItemItemTypeCollection, + ItemType: components.CollectionItemItemTypeURL, }, }, }, diff --git a/tests/mockserver/internal/sdk/models/components/allowlistoptions.go b/tests/mockserver/internal/sdk/models/components/allowlistoptions.go index cf238c9e..05ea9fc7 100644 --- a/tests/mockserver/internal/sdk/models/components/allowlistoptions.go +++ b/tests/mockserver/internal/sdk/models/components/allowlistoptions.go @@ -2,10 +2,12 @@ package components -// AllowlistOptions - Terms that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term in the allow-list, it will not be counted as a violation. +// AllowlistOptions - Terms and regexes that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term, or matches a regex, in the allow-list, it will not be counted as a violation. type AllowlistOptions struct { // list of words and phrases to consider as whitelisted content Terms []string `json:"terms,omitempty"` + // list of regular expressions whose matches are considered whitelisted content + Regexes []string `json:"regexes,omitempty"` } func (o *AllowlistOptions) GetTerms() []string { @@ -14,3 +16,10 @@ func (o *AllowlistOptions) GetTerms() []string { } return o.Terms } + +func (o *AllowlistOptions) GetRegexes() []string { + if o == nil { + return nil + } + return o.Regexes +} diff --git a/tests/mockserver/internal/sdk/models/components/createworkflowrequest.go b/tests/mockserver/internal/sdk/models/components/createworkflowrequest.go new file mode 100644 index 00000000..277dd8b7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/createworkflowrequest.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CreateWorkflowRequest struct { + // The name of the workflow. + Name *string `json:"name,omitempty"` + // Used to create a transient workflow. + Transient *bool `json:"transient,omitempty"` + // id of the parent workflow for transient workflows + ParentWorkflowID *string `json:"parentWorkflowId,omitempty"` +} + +func (o *CreateWorkflowRequest) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *CreateWorkflowRequest) GetTransient() *bool { + if o == nil { + return nil + } + return o.Transient +} + +func (o *CreateWorkflowRequest) GetParentWorkflowID() *string { + if o == nil { + return nil + } + return o.ParentWorkflowID +} diff --git a/tests/mockserver/internal/sdk/models/components/dlpconfig.go b/tests/mockserver/internal/sdk/models/components/dlpconfig.go index 04c23aeb..23a965fc 100644 --- a/tests/mockserver/internal/sdk/models/components/dlpconfig.go +++ b/tests/mockserver/internal/sdk/models/components/dlpconfig.go @@ -29,7 +29,7 @@ type DlpConfig struct { RedactQuote *bool `json:"redactQuote,omitempty"` // auto hide documents with findings in the report AutoHideDocs *bool `json:"autoHideDocs,omitempty"` - // Terms that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term in the allow-list, it will not be counted as a violation. + // Terms and regexes that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term, or matches a regex, in the allow-list, it will not be counted as a violation. AllowlistOptions *AllowlistOptions `json:"allowlistOptions,omitempty"` } diff --git a/tests/mockserver/internal/sdk/models/components/feedentry.go b/tests/mockserver/internal/sdk/models/components/feedentry.go index 1274083a..36234aa7 100644 --- a/tests/mockserver/internal/sdk/models/components/feedentry.go +++ b/tests/mockserver/internal/sdk/models/components/feedentry.go @@ -101,6 +101,7 @@ const ( JustificationTypeMidDayCatchUp JustificationType = "MID_DAY_CATCH_UP" JustificationTypeQuerySuggestion JustificationType = "QUERY_SUGGESTION" JustificationTypeCoworkCujPromo JustificationType = "COWORK_CUJ_PROMO" + JustificationTypeCardStackPromo JustificationType = "CARD_STACK_PROMO" JustificationTypeWeeklyMeetings JustificationType = "WEEKLY_MEETINGS" JustificationTypeFollowUp JustificationType = "FOLLOW_UP" JustificationTypeMilestoneTimelineCheck JustificationType = "MILESTONE_TIMELINE_CHECK" @@ -211,6 +212,8 @@ func (e *JustificationType) UnmarshalJSON(data []byte) error { fallthrough case "COWORK_CUJ_PROMO": fallthrough + case "CARD_STACK_PROMO": + fallthrough case "WEEKLY_MEETINGS": fallthrough case "FOLLOW_UP": diff --git a/tests/mockserver/internal/sdk/models/components/feedrequest.go b/tests/mockserver/internal/sdk/models/components/feedrequest.go index 7c94e464..28d6dbf0 100644 --- a/tests/mockserver/internal/sdk/models/components/feedrequest.go +++ b/tests/mockserver/internal/sdk/models/components/feedrequest.go @@ -42,6 +42,7 @@ const ( FeedRequestCategoryMidDayCatchUp FeedRequestCategory = "MID_DAY_CATCH_UP" FeedRequestCategoryQuerySuggestion FeedRequestCategory = "QUERY_SUGGESTION" FeedRequestCategoryCoworkCujPromo FeedRequestCategory = "COWORK_CUJ_PROMO" + FeedRequestCategoryCardStackPromo FeedRequestCategory = "CARD_STACK_PROMO" FeedRequestCategoryWeeklyMeetings FeedRequestCategory = "WEEKLY_MEETINGS" FeedRequestCategoryFollowUp FeedRequestCategory = "FOLLOW_UP" FeedRequestCategoryMilestoneTimelineCheck FeedRequestCategory = "MILESTONE_TIMELINE_CHECK" @@ -126,6 +127,8 @@ func (e *FeedRequestCategory) UnmarshalJSON(data []byte) error { fallthrough case "COWORK_CUJ_PROMO": fallthrough + case "CARD_STACK_PROMO": + fallthrough case "WEEKLY_MEETINGS": fallthrough case "FOLLOW_UP": diff --git a/tests/mockserver/internal/sdk/models/components/feedresult.go b/tests/mockserver/internal/sdk/models/components/feedresult.go index ddd4f095..ec49941c 100644 --- a/tests/mockserver/internal/sdk/models/components/feedresult.go +++ b/tests/mockserver/internal/sdk/models/components/feedresult.go @@ -43,6 +43,7 @@ const ( FeedResultCategoryMidDayCatchUp FeedResultCategory = "MID_DAY_CATCH_UP" FeedResultCategoryQuerySuggestion FeedResultCategory = "QUERY_SUGGESTION" FeedResultCategoryCoworkCujPromo FeedResultCategory = "COWORK_CUJ_PROMO" + FeedResultCategoryCardStackPromo FeedResultCategory = "CARD_STACK_PROMO" FeedResultCategoryWeeklyMeetings FeedResultCategory = "WEEKLY_MEETINGS" FeedResultCategoryFollowUp FeedResultCategory = "FOLLOW_UP" FeedResultCategoryMilestoneTimelineCheck FeedResultCategory = "MILESTONE_TIMELINE_CHECK" @@ -127,6 +128,8 @@ func (e *FeedResultCategory) UnmarshalJSON(data []byte) error { fallthrough case "COWORK_CUJ_PROMO": fallthrough + case "CARD_STACK_PROMO": + fallthrough case "WEEKLY_MEETINGS": fallthrough case "FOLLOW_UP": @@ -151,6 +154,33 @@ func (e *FeedResultCategory) UnmarshalJSON(data []byte) error { } } +// PlacementReason - 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. +type PlacementReason string + +const ( + PlacementReasonOrganic PlacementReason = "ORGANIC" + PlacementReasonPromo PlacementReason = "PROMO" +) + +func (e PlacementReason) ToPointer() *PlacementReason { + return &e +} +func (e *PlacementReason) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ORGANIC": + fallthrough + case "PROMO": + *e = PlacementReason(v) + return nil + default: + return fmt.Errorf("invalid value for PlacementReason: %v", v) + } +} + type FeedResult struct { // Category of the result, one of the requested categories in incoming request. Category FeedResultCategory `json:"category"` @@ -159,6 +189,8 @@ type FeedResult struct { SecondaryEntries []FeedEntry `json:"secondaryEntries,omitempty"` // Rank of the result. Rank is suggested by server. Client side rank may differ. Rank *int64 `json:"rank,omitempty"` + // 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. + PlacementReason *PlacementReason `json:"placementReason,omitempty"` } func (o *FeedResult) GetCategory() FeedResultCategory { @@ -188,3 +220,10 @@ func (o *FeedResult) GetRank() *int64 { } return o.Rank } + +func (o *FeedResult) GetPlacementReason() *PlacementReason { + if o == nil { + return nil + } + return o.PlacementReason +} diff --git a/tests/mockserver/internal/sdk/models/components/grouptype.go b/tests/mockserver/internal/sdk/models/components/grouptype.go index 3f25f70b..be69cc6a 100644 --- a/tests/mockserver/internal/sdk/models/components/grouptype.go +++ b/tests/mockserver/internal/sdk/models/components/grouptype.go @@ -11,14 +11,15 @@ import ( type GroupType string const ( - GroupTypeDepartment GroupType = "DEPARTMENT" - GroupTypeAll GroupType = "ALL" - GroupTypeTeam GroupType = "TEAM" - GroupTypeJobTitle GroupType = "JOB_TITLE" - GroupTypeRoleType GroupType = "ROLE_TYPE" - GroupTypeLocation GroupType = "LOCATION" - GroupTypeRegion GroupType = "REGION" - GroupTypeExternalGroup GroupType = "EXTERNAL_GROUP" + GroupTypeDepartment GroupType = "DEPARTMENT" + GroupTypeAll GroupType = "ALL" + GroupTypeTeam GroupType = "TEAM" + GroupTypeJobTitle GroupType = "JOB_TITLE" + GroupTypeRoleType GroupType = "ROLE_TYPE" + GroupTypeLocation GroupType = "LOCATION" + GroupTypeRegion GroupType = "REGION" + GroupTypeExternalGroup GroupType = "EXTERNAL_GROUP" + GroupTypeCollectionAudience GroupType = "COLLECTION_AUDIENCE" ) func (e GroupType) ToPointer() *GroupType { @@ -45,6 +46,8 @@ func (e *GroupType) UnmarshalJSON(data []byte) error { case "REGION": fallthrough case "EXTERNAL_GROUP": + fallthrough + case "COLLECTION_AUDIENCE": *e = GroupType(v) return nil default: diff --git a/tests/mockserver/internal/sdk/models/operations/createagent.go b/tests/mockserver/internal/sdk/models/operations/createagent.go new file mode 100644 index 00000000..255e835e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/createagent.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type CreateAgentRequest struct { + // 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`. + Locale *string `queryParam:"style=form,explode=true,name=locale"` + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `queryParam:"style=form,explode=true,name=timezoneOffset"` + Body components.CreateWorkflowRequest `request:"mediaType=application/json"` +} + +func (o *CreateAgentRequest) GetLocale() *string { + if o == nil { + return nil + } + return o.Locale +} + +func (o *CreateAgentRequest) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *CreateAgentRequest) GetBody() components.CreateWorkflowRequest { + if o == nil { + return components.CreateWorkflowRequest{} + } + return o.Body +} + +type CreateAgentResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Success + WorkflowResult *components.WorkflowResult +} + +func (o *CreateAgentResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *CreateAgentResponse) GetWorkflowResult() *components.WorkflowResult { + if o == nil { + return nil + } + return o.WorkflowResult +} diff --git a/tests/test_agents.py b/tests/test_agents.py index 1d18b766..46852ff4 100644 --- a/tests/test_agents.py +++ b/tests/test_agents.py @@ -74,3 +74,17 @@ def test_agents_create_and_stream_run(): ) def test_agents_create_and_wait_run(): pass + + +def test_agents_create_agent(): + test_http_client = create_test_http_client("createAgent") + + 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_agent() + assert res is not None diff --git a/tests/test_summarize.py b/tests/test_summarize.py index df71d57d..c55cf90a 100644 --- a/tests/test_summarize.py +++ b/tests/test_summarize.py @@ -23,7 +23,7 @@ def test_summarize_summarize(): }, { "ugc_type": models.DocumentSpecUgcType1.COLLECTIONS, - "content_id": 885812, + "content_id": 337360, }, ] )