From 8094f26052656951e0e03123c31529bf3baa6c3a Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Sat, 11 Jul 2026 02:46:06 +0000 Subject: [PATCH 1/2] ## Python SDK Changes: * `glean.platform.skills.list()`: **Added** * `glean.platform.skills.retrieve()`: **Added** --- .speakeasy/gen.lock | 196 +++++++- .speakeasy/gen.yaml | 2 +- .speakeasy/glean-merged-spec.yaml | 250 +++++++++- .speakeasy/tests.arazzo.yaml | 30 ++ .speakeasy/workflow.lock | 10 +- README.md | 5 + RELEASES.md | 12 +- docs/models/platformskill.md | 18 + docs/models/platformskillgetresponse.md | 9 + docs/models/platformskillorigin.md | 18 + docs/models/platformskillsgetrequest.md | 8 + docs/models/platformskillslistrequest.md | 9 + docs/models/platformskillslistresponse.md | 11 + docs/models/platformskillsourceprovenance.md | 13 + docs/models/platformskillstatus.md | 22 + docs/models/platformskillsyncstatus.md | 22 + docs/sdks/skills/README.md | 95 ++++ pyproject.toml | 2 +- src/glean/api_client/_version.py | 4 +- src/glean/api_client/models/__init__.py | 54 +++ .../models/platform_skills_getop.py | 18 + .../models/platform_skills_listop.py | 45 ++ src/glean/api_client/models/platformskill.py | 102 ++++ .../models/platformskillgetresponse.py | 19 + .../api_client/models/platformskillorigin.py | 10 + .../models/platformskillslistresponse.py | 47 ++ .../models/platformskillsourceprovenance.py | 79 +++ .../api_client/models/platformskillstatus.py | 13 + .../models/platformskillsyncstatus.py | 13 + src/glean/api_client/platform.py | 20 + src/glean/api_client/sdk.py | 3 + src/glean/api_client/skills.py | 449 ++++++++++++++++++ .../internal/handler/generated_handlers.go | 2 + .../internal/handler/pathgetapiskills.go | 68 +++ .../handler/pathgetapiskillsskillid.go | 79 +++ .../pathpostrestapiv1createcollection.go | 20 +- .../sdk/models/components/platformskill.go | 120 +++++ .../components/platformskillgetresponse.go | 23 + .../models/components/platformskillorigin.go | 32 ++ .../components/platformskillslistresponse.go | 42 ++ .../platformskillsourceprovenance.go | 76 +++ .../models/components/platformskillstatus.go | 38 ++ .../components/platformskillsyncstatus.go | 38 ++ .../models/operations/platformskillsget.go | 39 ++ .../models/operations/platformskillslist.go | 48 ++ tests/test_skills.py | 33 ++ 46 files changed, 2213 insertions(+), 53 deletions(-) create mode 100644 docs/models/platformskill.md create mode 100644 docs/models/platformskillgetresponse.md create mode 100644 docs/models/platformskillorigin.md create mode 100644 docs/models/platformskillsgetrequest.md create mode 100644 docs/models/platformskillslistrequest.md create mode 100644 docs/models/platformskillslistresponse.md create mode 100644 docs/models/platformskillsourceprovenance.md create mode 100644 docs/models/platformskillstatus.md create mode 100644 docs/models/platformskillsyncstatus.md create mode 100644 docs/sdks/skills/README.md create mode 100644 src/glean/api_client/models/platform_skills_getop.py create mode 100644 src/glean/api_client/models/platform_skills_listop.py create mode 100644 src/glean/api_client/models/platformskill.py create mode 100644 src/glean/api_client/models/platformskillgetresponse.py create mode 100644 src/glean/api_client/models/platformskillorigin.py create mode 100644 src/glean/api_client/models/platformskillslistresponse.py create mode 100644 src/glean/api_client/models/platformskillsourceprovenance.py create mode 100644 src/glean/api_client/models/platformskillstatus.py create mode 100644 src/glean/api_client/models/platformskillsyncstatus.py create mode 100644 src/glean/api_client/platform.py create mode 100644 src/glean/api_client/skills.py create mode 100644 tests/mockserver/internal/handler/pathgetapiskills.go create mode 100644 tests/mockserver/internal/handler/pathgetapiskillsskillid.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformskill.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformskillgetresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformskillorigin.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformskillslistresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformskillsourceprovenance.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformskillstatus.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformskillsyncstatus.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformskillsget.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformskillslist.go create mode 100644 tests/test_skills.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index c51cfcac..9b2c0139 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: 33958fda4f2b946f46f0593aac3a619d + docChecksum: cba6d168870630c0bc23385e98ab7d5c docVersion: 0.9.0 speakeasyVersion: 1.789.2 generationVersion: 2.916.4 - releaseVersion: 0.15.3 - configChecksum: b53cb756010d5e6e2f41d4dd168ca9c2 + releaseVersion: 0.15.4 + configChecksum: 0f7f272cfbc1986b8c5a32550c674049 repoURL: https://github.com/gleanwork/api-client-python.git installationURL: https://github.com/gleanwork/api-client-python.git published: true persistentEdits: - generation_id: 64feca36-97de-4a5e-848b-c8c117e455ea - pristine_commit_hash: ae9a83387550bcfedd89703e319f60d876adeb80 - pristine_tree_hash: 669cc3c3cd50adba9fd64d758d1014c3ab2b44a3 + generation_id: a53776d6-9cde-40d7-9580-6d83b94f81e4 + pristine_commit_hash: 5edc34f187cfb0e754ae053afdab8165149fa974 + pristine_tree_hash: d80e61199268cb17679babb89a9fa58996917569 features: python: acceptHeaders: 3.0.0 @@ -2257,6 +2257,42 @@ trackedFiles: id: b20c8f7128fc last_write_checksum: sha1:958639d5fa5b446156df39fd5f69b6c57265f13a pristine_git_object: 219a923e48c2a8cb9333d211f51a87df045a8002 + docs/models/platformskill.md: + id: 83c575f92901 + last_write_checksum: sha1:6b749a33dc64251968dac815aec5189373449b3e + pristine_git_object: f803434a2bd716ccdd0731bfb29c6921ce8e1c88 + docs/models/platformskillgetresponse.md: + id: 1d8d7adbb244 + last_write_checksum: sha1:43c5b413dad154310df7aedf78851e4e41144c7a + pristine_git_object: 305445c73f691db85df4332708d88703eeade009 + docs/models/platformskillorigin.md: + id: 66c12ec2d017 + last_write_checksum: sha1:281337f3fefcac11e66e5d8429b3b601dc357a57 + pristine_git_object: ca7bf36f2c931c0dce0bb529f8c2d86f4a06c326 + docs/models/platformskillsgetrequest.md: + id: a9e7922c0a6b + last_write_checksum: sha1:e8d2aee805f122808b22b7b9967cf01e5dd97e30 + pristine_git_object: 19aeb1fe62fa39cadaa3f70da72f807b6c1b3fd0 + docs/models/platformskillslistrequest.md: + id: 475ac6fb76a7 + last_write_checksum: sha1:4bac5ec35ddeb35d13d8494aebd5e8237a1d6239 + pristine_git_object: ebf0ada9b31b7f0788d46aa6aa866d91270c86e7 + docs/models/platformskillslistresponse.md: + id: 03920dfa6e9d + last_write_checksum: sha1:a01d7093df9c1723f0fc7e5e55c75c13d502e8fd + pristine_git_object: 1adcf3fef9224325ffd1a40f5a37e26aaddc3d7a + docs/models/platformskillsourceprovenance.md: + id: 259c50c9c90f + last_write_checksum: sha1:d59dbc5d8d6a5e0a6da71f5a1bb3be1e0b2c8274 + pristine_git_object: e7728f1bfc51509dc05d0b9e293eb08ad68c445c + docs/models/platformskillstatus.md: + id: 33c93e7414d6 + last_write_checksum: sha1:7012661e93710994b8dc2a827b82bdb7da8bbb5f + pristine_git_object: 566f1092589cad8787c57dd7042e2f2c71ea49b4 + docs/models/platformskillsyncstatus.md: + id: c12e6da882a8 + last_write_checksum: sha1:ddca3bc0c472815cbf35240dc3ce2f17c6fc87e2 + pristine_git_object: 36b3ddd907f7ed42f42bfb7983afdb9f4dfb2b42 docs/models/platformtimerange.md: id: c37b2e815a8d last_write_checksum: sha1:31db2f83dba4ccb6d0a5e7b80edbeff356529101 @@ -3133,6 +3169,10 @@ trackedFiles: id: 5c534716244c last_write_checksum: sha1:4d8def390ef8fa9ed86c89d16d54283263f18849 pristine_git_object: 04d61f7683d46497cb5eb0c511aa5c31f524a95d + docs/sdks/skills/README.md: + id: 3a14a5c90791 + last_write_checksum: sha1:a08de323592de2ce5a796453c996a095f0489473 + pristine_git_object: 35a300267dc8e6aa34e8f8298714b02acd3f0052 docs/sdks/tools/README.md: id: 044286549bac last_write_checksum: sha1:a4916d6065377693c59cfbe6ff5072e83f204965 @@ -3155,8 +3195,8 @@ trackedFiles: pristine_git_object: 79e388be87446ab6a4064b372bad0e8376d0cb5e pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:94c46596dba6babef7e197851675efefed28b972 - pristine_git_object: 9cb2c0bd22be5f56f9c9835a6cd259c92f99eb6d + last_write_checksum: sha1:b617fe03b7f525d4c97e00541628a66356f87480 + pristine_git_object: 932a174501a63a80b6e36b4a4f632bfabf71ab6e scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:c2c83f71dea61eb50c9e05da83b16d18b4da8794 @@ -3183,8 +3223,8 @@ trackedFiles: pristine_git_object: 55f23c1feabfedeb7e8cd5bea8b910f0ae0b77d9 src/glean/api_client/_version.py: id: 0ce22b26136b - last_write_checksum: sha1:3b12e625296b8c8ed92b3fd3a301a395c3316c79 - pristine_git_object: 75a78e98a80eedad79c903a0c99dd8f51609db25 + last_write_checksum: sha1:4530917632c6002ac8eb56acf86b1716210edb79 + pristine_git_object: bf9a5fa1cb429ac4afc72c133e1998cc4bed1176 src/glean/api_client/agents.py: id: b925701a9217 last_write_checksum: sha1:d80196ac5b252a938055308b99efa4830a763ea6 @@ -3351,8 +3391,8 @@ trackedFiles: pristine_git_object: 77016bfff6209866592fd8b42f2f3527f900992b src/glean/api_client/models/__init__.py: id: d5f6ea5efcbe - last_write_checksum: sha1:d6520fa7653f76cf0e819e323fa084a0fe2595ab - pristine_git_object: 536e42f53c2aa8071025788f425b3b6da2fd1903 + last_write_checksum: sha1:e9868f6bea80a3e221cc18020c1ee2b0a32ccd17 + pristine_git_object: 01102948367f2c9b7c6b4a453e27bfd9cf8740fd src/glean/api_client/models/actionauthtype.py: id: c7402f35092d last_write_checksum: sha1:7aaa5d1c11b105d0d7265e2a83cb005aafa89645 @@ -5005,6 +5045,14 @@ trackedFiles: id: 606568a4c8fc last_write_checksum: sha1:58370e345df87a242670e2cfdb26800caa6a00ce pristine_git_object: 880c65c1e74dd49543d650516f29141c6cdd486d + src/glean/api_client/models/platform_skills_getop.py: + id: 6eef4158cd52 + last_write_checksum: sha1:65871de7d2ce9e19c8604336215288d3c7edf96d + pristine_git_object: fc64256bf43449e23e1e7d093a45ee3fdfc441e5 + src/glean/api_client/models/platform_skills_listop.py: + id: 2172706b6858 + last_write_checksum: sha1:7e9d92bd23b8072d38fc787c08d2c1d11afee1dd + pristine_git_object: 3f77419309047da04a558921ae77b447bf465d40 src/glean/api_client/models/platformactionsummary.py: id: 00069b22d246 last_write_checksum: sha1:f714e076c3e0c86ded17dd732ba304dfc7d5526e @@ -5097,6 +5145,34 @@ trackedFiles: id: 7ee9ec06e00c last_write_checksum: sha1:9ed8c951be31629e50f797c8e4bd59a1ef494eef pristine_git_object: d98c78d622564a3fc35ed6d5d543866f64f76704 + src/glean/api_client/models/platformskill.py: + id: 10e1f311015c + last_write_checksum: sha1:c0225f37738625dbb6cab763be77cf5e40beafeb + pristine_git_object: 4b7e21a7eff4002f44ca69cc00ea080b152db720 + src/glean/api_client/models/platformskillgetresponse.py: + id: 912811bc01fd + last_write_checksum: sha1:6c3940b6104fbc71b0f37350f237a37f5af2eade + pristine_git_object: 2cc2863657b9be3256b5c40482cb492bf200f95f + src/glean/api_client/models/platformskillorigin.py: + id: ac7dd2421a25 + last_write_checksum: sha1:d3373713ce852bfc79d180d5a9cb6d27d5bdd0e3 + pristine_git_object: 320c60ec3c2d46cef59742d40c6de29c43425776 + src/glean/api_client/models/platformskillslistresponse.py: + id: b031da1d2783 + last_write_checksum: sha1:45e8d141fb11032f3fd143d1818845a7eb750c3c + pristine_git_object: 7303b0519deea755bd54b5f5a42e5e0908c5c92f + src/glean/api_client/models/platformskillsourceprovenance.py: + id: 9d34177a5499 + last_write_checksum: sha1:f1e2f0b74c65cd83e452b6e1cb0e33f0921c1085 + pristine_git_object: d1352b1f9d6654cc43a2c81e33177d5c9a0e8528 + src/glean/api_client/models/platformskillstatus.py: + id: 4576e2918e48 + last_write_checksum: sha1:1590f56ac48366b921495bf292ee76b6e847d4e2 + pristine_git_object: d57185fb36c553090f5e797908e9f47447901c0c + src/glean/api_client/models/platformskillsyncstatus.py: + id: 4603ae41cbb9 + last_write_checksum: sha1:911e9731ed66a257df85158125499d212a37f995 + pristine_git_object: 13fb6bcf5a11934ae1c8e1cd100715fd8aaaedf6 src/glean/api_client/models/platformtimerange.py: id: bf2b03e84949 last_write_checksum: sha1:645217a3827cd2a7455b88277f1ba2dcd4a5daf1 @@ -5701,6 +5777,10 @@ trackedFiles: id: 4a37ead65f8a last_write_checksum: sha1:127d0abf8b7631fa2cd9ed20e4f3a8c93f082e77 pristine_git_object: fbba9b16426c4243075554b6824f7ba2de3ef8f5 + src/glean/api_client/platform.py: + id: 88e6c38c78b0 + last_write_checksum: sha1:45d3028dcce1f690f1c9dd4f90afd254666430c0 + pristine_git_object: 0a8c08d78c0ce8bb41e9f46fa628bfa74c917b63 src/glean/api_client/policies.py: id: 680f941e0620 last_write_checksum: sha1:3b748f12e450aef5ead84d0e84fe17126a1b9f4c @@ -5715,8 +5795,8 @@ trackedFiles: pristine_git_object: 3a4c3e6eee14c25616dbc8cbec206d9a74070d80 src/glean/api_client/sdk.py: id: e2de37b3ce92 - last_write_checksum: sha1:8e7c616048b12e24e0da6ec1e3933858e03cd3d3 - pristine_git_object: 4d65c6df343753745eeb3cc070b7b6d86bbed5d2 + last_write_checksum: sha1:7e0d91f2bdc65f1657e971a857616914676a4606 + pristine_git_object: b0beef7ee582879b39941437ca0535d99816325f src/glean/api_client/sdkconfiguration.py: id: f356ce00b5b7 last_write_checksum: sha1:1ae43e08ae57ae277b3ab5e66b52d020149ebe00 @@ -5725,6 +5805,10 @@ trackedFiles: id: a3b404a8b402 last_write_checksum: sha1:d89f2b24da1d3355e321bf802841bc17cdde30a4 pristine_git_object: 571fc8909a3c8be6c852a995894ac61c9d743a6f + src/glean/api_client/skills.py: + id: 79f3c37e1b5a + last_write_checksum: sha1:ce3552c8132652f7d6e88023513797520b5e3c47 + pristine_git_object: 392ae641ff0011fac9ffd32a64ac44d531b98cd7 src/glean/api_client/tools.py: id: 3ea40147c1cc last_write_checksum: sha1:9c353defdddf1c89f58a4b7d7cb8b22e4cb0be1d @@ -5879,8 +5963,8 @@ trackedFiles: pristine_git_object: 929558ef2e1165f7e09da6d0a64f016c90971655 tests/mockserver/internal/handler/generated_handlers.go: id: 61ac4f7cce9e - last_write_checksum: sha1:504888816904477536564a19b80f4284b6823e27 - pristine_git_object: d5fe2f854992c1454456ccbe2b496a6446cb6904 + last_write_checksum: sha1:8e4ffe198fbf4365285f96b1a23c4c21b1eb9b1a + pristine_git_object: 49b7267fb0b9cbcfac0d506e6de116172f86acca tests/mockserver/internal/handler/pathdeleterestapiindexcustommetadataschemagroupname.go: id: 979e4583765b last_write_checksum: sha1:b1d4edb259d907c7a88b634bf16f0cf152321693 @@ -5897,6 +5981,14 @@ trackedFiles: id: a3a921765081 last_write_checksum: sha1:41dfbc3d70153e24cc2a898336d7d2a9c6e3d3df pristine_git_object: a9212f1d5de9d8b40e73ea4b410feb26921c35cb + tests/mockserver/internal/handler/pathgetapiskills.go: + id: a1697453079c + last_write_checksum: sha1:1608120c2f9ce748fdd2d373e576b6a0758092c1 + pristine_git_object: 7baa51e79fd4c8ed0f5c9ebadf5030c74e966973 + tests/mockserver/internal/handler/pathgetapiskillsskillid.go: + id: 97a0dcaf8ddf + last_write_checksum: sha1:d939db8a7f6d6e5b3e09402246efd0d1b53c44eb + pristine_git_object: 4f097d8448491dc032cba2fdbb1f9aae85f80600 tests/mockserver/internal/handler/pathgetrestapiindexcustommetadataschemagroupname.go: id: a14a30d0e377 last_write_checksum: sha1:83a992c70c3b7d010928d89a52f70db1042dd186 @@ -6115,8 +6207,8 @@ trackedFiles: pristine_git_object: ab9263d43404e8e6f07af222a3e785aca2fbf35f tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go: id: 3fb93a419933 - last_write_checksum: sha1:f9f4c718408bddadbdf826194f07970bb111e57e - pristine_git_object: 5c99a0ada5302c8f64c0e5da5683fa8bd9e9975d + last_write_checksum: sha1:14b4a1d98dd55ce2b487ae1aaab4a7dece08df25 + pristine_git_object: 371b90231fcd7bd77fd6d9566156605af1712d9a tests/mockserver/internal/handler/pathpostrestapiv1createshortcut.go: id: 8d9d3abb0c34 last_write_checksum: sha1:dcdf684a85e20db1aee571db9a54a3ee259d71d5 @@ -7805,6 +7897,34 @@ trackedFiles: id: a58f32052764 last_write_checksum: sha1:6db9bd73c6fd7cc1c8bf28c2b1ee96cc77d7236a pristine_git_object: e8243de2c4e8582ed42736e75e4aa715a6a376bc + tests/mockserver/internal/sdk/models/components/platformskill.go: + id: a97a51039ff5 + last_write_checksum: sha1:8871b58924c180a5565b43c91b58ed79212739bb + pristine_git_object: 8397a89921fdbadf8ff5733049b9faabf554e21a + tests/mockserver/internal/sdk/models/components/platformskillgetresponse.go: + id: 24cc096b11c0 + last_write_checksum: sha1:44cf3cd559d6e8cde855daafc7c9fe31774fce6f + pristine_git_object: c9bcfa2f4e416f4b6c441f39bd70c157687abc5d + tests/mockserver/internal/sdk/models/components/platformskillorigin.go: + id: b3f692d12f20 + last_write_checksum: sha1:4bbd57b85b9318d5fa9ea3ca97e26cab34e689fd + pristine_git_object: e0a004498154f0b4285d2d29dde3d0e27b163bb6 + tests/mockserver/internal/sdk/models/components/platformskillslistresponse.go: + id: 61695a856d41 + last_write_checksum: sha1:718c3f3013007de52b02444e4a12d43a10fce37d + pristine_git_object: 566d53518ac6a45dc5ae0ec8e5e55df0433f8ae1 + tests/mockserver/internal/sdk/models/components/platformskillsourceprovenance.go: + id: 3a0b70781266 + last_write_checksum: sha1:f64c669b34f9bc8e21d5620001620e8c8a66756f + pristine_git_object: 65ed2aacddbc7cb4f5ac6084a8eb21e236b3b377 + tests/mockserver/internal/sdk/models/components/platformskillstatus.go: + id: d6163aa830e8 + last_write_checksum: sha1:641cb578909b86e1c1166a75e309e5bcf52ecf29 + pristine_git_object: a218b7608eead950ddb62301af0326adc4f091f5 + tests/mockserver/internal/sdk/models/components/platformskillsyncstatus.go: + id: a172da0d9d4d + last_write_checksum: sha1:66e29681184c77fbbff593cc30e33023a3b39c81 + pristine_git_object: 0582664c1c7451d505bc18ea138e299db160c5a6 tests/mockserver/internal/sdk/models/components/platformtimerange.go: id: cf2540151ce1 last_write_checksum: sha1:3a0ec2ca473681b89ff97606f648fc15fcdae38e @@ -8661,6 +8781,14 @@ trackedFiles: id: d990791ac101 last_write_checksum: sha1:995d47533ef63c7518c50398593671059d6ccc07 pristine_git_object: 16b6e86fe62e1e0ec43293439e9fba7995a72a80 + tests/mockserver/internal/sdk/models/operations/platformskillsget.go: + id: fc753bfc0e6f + last_write_checksum: sha1:beb72342b1186ad56896339bb3fa710456214bab + pristine_git_object: 6ebb5b11eb4470e6b8804d62db58a314cefa2a6d + tests/mockserver/internal/sdk/models/operations/platformskillslist.go: + id: daa657929c98 + last_write_checksum: sha1:fb44d154d8dcca86575b76dd6fdef213e2a568a5 + pristine_git_object: 40f74199560f03309466234c52f5d5dfaed2f563 tests/mockserver/internal/sdk/models/operations/postapiindexv1adddatasource.go: id: 85e7185113c5 last_write_checksum: sha1:2f82dc427027cdb45f8fcf8fa6454e28599233aa @@ -9105,6 +9233,10 @@ trackedFiles: id: dd86606b335f last_write_checksum: sha1:b7c2a96a3d765d1498f9fe08dffc59cc4c8822ac pristine_git_object: 3925a6e0f49d8e0b1b35ec08c38283a5643ed307 + tests/test_skills.py: + id: ac5db26bd6b1 + last_write_checksum: sha1:98b1279dba3b8668093182b88eaf1940cc79c50c + pristine_git_object: b982fb6e5099722a916f1b1878f03277276cdc88 tests/test_summarize.py: id: a255d8a6f627 last_write_checksum: sha1:6383d6969c6f1bf1832e5ace511e5c2ffaa6d86f @@ -10117,6 +10249,27 @@ examples: responses: "200": application/json: {"authorizationUrl": "https://shocked-casket.name/"} + platform-skills-list: + speakeasy-default-platform-skills-list: + responses: + "200": + application/json: {"skills": [], "has_more": true, "next_cursor": "", "request_id": ""} + "400": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-skills-get: + speakeasy-default-platform-skills-get: + parameters: + path: + skill_id: "" + responses: + "200": + application/json: {"skill": {"id": "", "display_name": "Chad_Herzog", "description": "whenever up aha controvert", "latest_version": 151495, "latest_minor_version": 170771, "status": "DISABLED", "origin": "CUSTOM", "owner": {"name": ""}, "created_at": "2024-12-25T16:41:00.099Z", "updated_at": "2026-12-07T21:59:59.375Z"}, "request_id": ""} + "400": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} examplesVersion: 1.0.2 generatedTests: activity: "2025-04-28T22:05:12+01:00" @@ -10286,7 +10439,12 @@ generatedTests: platform-search: "2026-07-02T17:48:17Z" getToolServerAuthStatus: "2026-07-08T02:46:37Z" authorizeToolServer: "2026-07-08T02:46:37Z" -releaseNotes: "## Python SDK Changes:\n* `glean.client.chat.create()`: \n * `request.messages[].fragments[]` **Changed**\n * `response.messages[].fragments[]` **Changed**\n* `glean.client.chat.retrieve()`: `response.chat_result.chat.messages[].fragments[]` **Changed**\n* `glean.client.chat.create_stream()`: \n * `request.messages[].fragments[]` **Changed**\n" + platform-skills-list: "2026-07-11T02:43:30Z" + platform-skills-get: "2026-07-11T02:43:30Z" +releaseNotes: | + ## Python SDK Changes: + * `glean.platform.skills.list()`: **Added** + * `glean.platform.skills.retrieve()`: **Added** generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 10919310..b00f8adc 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -34,7 +34,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true python: - version: 0.15.3 + version: 0.15.4 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index a1f493a7..290a17c8 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -2,8 +2,8 @@ openapi: 3.0.0 info: version: "0.9.0" title: Glean API - x-source-commit-sha: 270b693d49bac2f68e751b2345bac0c267741119 - x-open-api-commit-sha: 592aec2b4913505edb8161645eaf9a72b5286f20 + x-source-commit-sha: a6a475757a3799d2146d7b0d0db2ae609b6bdc0f + x-open-api-commit-sha: 3f74e993e22cee24401a816dc24063d4e4bec47b 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. @@ -250,6 +250,108 @@ paths: x-speakeasy-name-override: createRun security: - APIToken: [] + /api/skills: + get: + tags: + - Skills + summary: List skills + description: | + List skills available to the authenticated user. + operationId: platform-skills-list + x-visibility: Public + x-glean-experimental: + id: 3eb65937-03a3-472b-9a00-be713f302b5f + introduced: "2026-06-23" + parameters: + - in: query + name: page_size + description: Maximum number of skills to return. + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + - in: query + name: cursor + description: Opaque pagination cursor from a previous response. + required: false + schema: + type: string + minLength: 1 + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformSkillsListResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: platform.skills + x-speakeasy-name-override: list + security: + - APIToken: [] + /api/skills/{skill_id}: + get: + tags: + - Skills + summary: Retrieve skill + description: | + Retrieve metadata for a skill available to the authenticated user. + operationId: platform-skills-get + x-visibility: Public + x-glean-experimental: + id: 8f8d1c92-a484-4769-9903-200613dc8a72 + introduced: "2026-06-23" + parameters: + - name: skill_id + in: path + required: true + description: Glean skill ID. + schema: + type: string + minLength: 1 + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformSkillGetResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: platform.skills + x-speakeasy-name-override: retrieve + security: + - APIToken: [] /api/search: post: tags: @@ -5479,6 +5581,138 @@ components: request_id: type: string description: Platform-generated request ID for support correlation. + PlatformSkillStatus: + type: string + enum: + - DRAFT + - ENABLED + - DISABLED + description: Current skill status. + PlatformSkillOrigin: + type: string + enum: + - CUSTOM + description: Source category for the skill. + PlatformSkillSyncStatus: + type: string + enum: + - UP_TO_DATE + - UPDATE_AVAILABLE + - SYNC_FAILED + description: Current external-source sync status. + PlatformSkillSourceProvenance: + type: object + properties: + source_url: + type: string + description: URL of the external source the skill was imported from. + commit_sha: + type: string + description: Source commit SHA for the imported skill. + imported_at: + type: string + format: date-time + description: Time the skill was imported. + last_synced_at: + type: string + format: date-time + description: Time the skill was last synced from its source. + sync_status: + $ref: "#/components/schemas/PlatformSkillSyncStatus" + sync_error: + type: string + description: Human-readable sync failure reason, present only when sync_status is SYNC_FAILED. + PlatformPersonReference: + type: object + description: A lightweight reference to a person, used where a payload merely points at someone. + required: + - name + properties: + id: + type: string + description: Opaque Glean person ID. + name: + type: string + description: Display name. + PlatformSkill: + type: object + required: + - id + - display_name + - description + - latest_version + - latest_minor_version + - status + - origin + - owner + - created_at + - updated_at + properties: + id: + type: string + description: Glean skill ID. + display_name: + type: string + description: Human-readable skill name. + description: + type: string + description: Human-readable skill description. + latest_version: + type: integer + description: Latest major version number for the skill. + latest_minor_version: + type: integer + description: Latest minor version number for the skill. + status: + $ref: "#/components/schemas/PlatformSkillStatus" + origin: + $ref: "#/components/schemas/PlatformSkillOrigin" + source_provenance: + $ref: "#/components/schemas/PlatformSkillSourceProvenance" + owner: + $ref: "#/components/schemas/PlatformPersonReference" + created_at: + type: string + format: date-time + description: Time the skill was created. + updated_at: + type: string + format: date-time + description: Time the skill was last updated. + PlatformSkillsListResponse: + type: object + required: + - skills + - has_more + - next_cursor + - request_id + properties: + skills: + type: array + description: Skills available to the user. + items: + $ref: "#/components/schemas/PlatformSkill" + has_more: + type: boolean + description: Whether additional results are available. + next_cursor: + type: string + nullable: true + description: Cursor for the next page, or null when no more results are available. + request_id: + type: string + description: Platform-generated request ID for support correlation. + PlatformSkillGetResponse: + type: object + required: + - skill + - request_id + properties: + skill: + $ref: "#/components/schemas/PlatformSkill" + request_id: + type: string + description: Platform-generated request ID for support correlation. PlatformFilterOperator: type: string description: Supported filter operator. @@ -5579,18 +5813,6 @@ components: Structured filters applied to search results. Equality operators OR multiple values within a filter. Multiple filters are AND'd together, including range filters on the same field. Filters are AND'd with any inline operators in `query`. Note that conflicting constraints on the same field (e.g., `type:document` in the query and `type: spreadsheet` in a filter) produce an empty result set. time_range: $ref: "#/components/schemas/PlatformTimeRange" - PlatformPersonReference: - type: object - description: A lightweight reference to a person, used where a payload merely points at someone. - required: - - name - properties: - id: - type: string - description: Opaque Glean person ID. - name: - type: string - description: Display name. PlatformResult: type: object required: diff --git a/.speakeasy/tests.arazzo.yaml b/.speakeasy/tests.arazzo.yaml index 14e7687a..518d9bc1 100644 --- a/.speakeasy/tests.arazzo.yaml +++ b/.speakeasy/tests.arazzo.yaml @@ -158863,3 +158863,33 @@ workflows: type: simple x-speakeasy-test-group: tools x-speakeasy-test-rebuild: true + - workflowId: platform-skills-list + steps: + - stepId: test + operationId: platform-skills-list + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"skills":[],"has_more":true,"next_cursor":"","request_id":""} + type: simple + x-speakeasy-test-group: skills + x-speakeasy-test-rebuild: true + - workflowId: platform-skills-get + steps: + - stepId: test + operationId: platform-skills-get + parameters: + - name: skill_id + in: path + value: + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"skill":{"id":"","display_name":"Chad_Herzog","description":"whenever up aha controvert","latest_version":151495,"latest_minor_version":170771,"status":"DISABLED","origin":"CUSTOM","owner":{"name":""},"created_at":"2024-12-25T16:41:00.099Z","updated_at":"2026-12-07T21:59:59.375Z"},"request_id":""} + type: simple + x-speakeasy-test-group: skills + x-speakeasy-test-rebuild: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 4a110f2e..2d920c1c 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.789.2 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:145236c33451e6e87cf1507a4d8829678b0df02af59afc9341330627e33ed760 - sourceBlobDigest: sha256:862b1370a65d146eac83f86c6fbd2d787f04ea93c2cf28259af5ded934f9fb3b + sourceRevisionDigest: sha256:f5ae8d5309190d64c093519c5102cb3d4d6da1315a4fc86be83598d33185a55a + sourceBlobDigest: sha256:4473e76be6cb393aa28cf300cb3aee22d91366e47b0c1afebc1ab79a1f4dd36d tags: - latest Glean Client API: @@ -16,10 +16,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:145236c33451e6e87cf1507a4d8829678b0df02af59afc9341330627e33ed760 - sourceBlobDigest: sha256:862b1370a65d146eac83f86c6fbd2d787f04ea93c2cf28259af5ded934f9fb3b + sourceRevisionDigest: sha256:f5ae8d5309190d64c093519c5102cb3d4d6da1315a4fc86be83598d33185a55a + sourceBlobDigest: sha256:4473e76be6cb393aa28cf300cb3aee22d91366e47b0c1afebc1ab79a1f4dd36d codeSamplesNamespace: glean-api-specs-python-code-samples - codeSamplesRevisionDigest: sha256:4a0a1ec3489f36483dc6080dacec4d40157b2e8d34be15e06417ddfc2e4f090a + codeSamplesRevisionDigest: sha256:59b6337e461b4371b65810cd5e1bdd0ae3ba98edcafe091e488e5e7cc6442333 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index ee043e79..0bf7ee30 100644 --- a/README.md +++ b/README.md @@ -545,6 +545,11 @@ For more information on obtaining the appropriate token type, please contact you * [bulk_index](docs/sdks/indexingshortcuts/README.md#bulk_index) - Bulk index external shortcuts * [upload](docs/sdks/indexingshortcuts/README.md#upload) - Upload shortcuts +### [Platform.Skills](docs/sdks/skills/README.md) + +* [list](docs/sdks/skills/README.md#list) - List skills +* [retrieve](docs/sdks/skills/README.md#retrieve) - Retrieve skill + ### [Search](docs/sdks/search/README.md) * [query](docs/sdks/search/README.md#query) - Search diff --git a/RELEASES.md b/RELEASES.md index 4631a03d..d667a89b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -798,4 +798,14 @@ Based on: ### Generated - [python v0.15.3] . ### Releases -- [PyPI v0.15.3] https://pypi.org/project/glean-api-client/0.15.3 - . \ No newline at end of file +- [PyPI v0.15.3] https://pypi.org/project/glean-api-client/0.15.3 - . + +## 2026-07-11 02:42:36 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.789.2 (2.916.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.15.4] . +### Releases +- [PyPI v0.15.4] https://pypi.org/project/glean-api-client/0.15.4 - . \ No newline at end of file diff --git a/docs/models/platformskill.md b/docs/models/platformskill.md new file mode 100644 index 00000000..f803434a --- /dev/null +++ b/docs/models/platformskill.md @@ -0,0 +1,18 @@ +# PlatformSkill + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Glean skill ID. | +| `display_name` | *str* | :heavy_check_mark: | Human-readable skill name. | +| `description` | *str* | :heavy_check_mark: | Human-readable skill description. | +| `latest_version` | *int* | :heavy_check_mark: | Latest major version number for the skill. | +| `latest_minor_version` | *int* | :heavy_check_mark: | Latest minor version number for the skill. | +| `status` | [models.PlatformSkillStatus](../models/platformskillstatus.md) | :heavy_check_mark: | Current skill status. | +| `origin` | [models.PlatformSkillOrigin](../models/platformskillorigin.md) | :heavy_check_mark: | Source category for the skill. | +| `source_provenance` | [Optional[models.PlatformSkillSourceProvenance]](../models/platformskillsourceprovenance.md) | :heavy_minus_sign: | N/A | +| `owner` | [models.PlatformPersonReference](../models/platformpersonreference.md) | :heavy_check_mark: | A lightweight reference to a person, used where a payload merely points at someone. | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Time the skill was created. | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Time the skill was last updated. | \ No newline at end of file diff --git a/docs/models/platformskillgetresponse.md b/docs/models/platformskillgetresponse.md new file mode 100644 index 00000000..305445c7 --- /dev/null +++ b/docs/models/platformskillgetresponse.md @@ -0,0 +1,9 @@ +# PlatformSkillGetResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `skill` | [models.PlatformSkill](../models/platformskill.md) | :heavy_check_mark: | N/A | +| `request_id` | *str* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/platformskillorigin.md b/docs/models/platformskillorigin.md new file mode 100644 index 00000000..ca7bf36f --- /dev/null +++ b/docs/models/platformskillorigin.md @@ -0,0 +1,18 @@ +# PlatformSkillOrigin + +Source category for the skill. + +## Example Usage + +```python +from glean.api_client.models import PlatformSkillOrigin + +value = PlatformSkillOrigin.CUSTOM +``` + + +## Values + +| Name | Value | +| -------- | -------- | +| `CUSTOM` | CUSTOM | \ No newline at end of file diff --git a/docs/models/platformskillsgetrequest.md b/docs/models/platformskillsgetrequest.md new file mode 100644 index 00000000..19aeb1fe --- /dev/null +++ b/docs/models/platformskillsgetrequest.md @@ -0,0 +1,8 @@ +# PlatformSkillsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `skill_id` | *str* | :heavy_check_mark: | Glean skill ID. | \ No newline at end of file diff --git a/docs/models/platformskillslistrequest.md b/docs/models/platformskillslistrequest.md new file mode 100644 index 00000000..ebf0ada9 --- /dev/null +++ b/docs/models/platformskillslistrequest.md @@ -0,0 +1,9 @@ +# PlatformSkillsListRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Maximum number of skills to return. | +| `cursor` | *Optional[str]* | :heavy_minus_sign: | Opaque pagination cursor from a previous response. | \ No newline at end of file diff --git a/docs/models/platformskillslistresponse.md b/docs/models/platformskillslistresponse.md new file mode 100644 index 00000000..1adcf3fe --- /dev/null +++ b/docs/models/platformskillslistresponse.md @@ -0,0 +1,11 @@ +# PlatformSkillsListResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `skills` | List[[models.PlatformSkill](../models/platformskill.md)] | :heavy_check_mark: | Skills available to the user. | +| `has_more` | *bool* | :heavy_check_mark: | Whether additional results are available. | +| `next_cursor` | *Nullable[str]* | :heavy_check_mark: | Cursor for the next page, or null when no more results are available. | +| `request_id` | *str* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/platformskillsourceprovenance.md b/docs/models/platformskillsourceprovenance.md new file mode 100644 index 00000000..e7728f1b --- /dev/null +++ b/docs/models/platformskillsourceprovenance.md @@ -0,0 +1,13 @@ +# PlatformSkillSourceProvenance + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `source_url` | *Optional[str]* | :heavy_minus_sign: | URL of the external source the skill was imported from. | +| `commit_sha` | *Optional[str]* | :heavy_minus_sign: | Source commit SHA for the imported skill. | +| `imported_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Time the skill was imported. | +| `last_synced_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Time the skill was last synced from its source. | +| `sync_status` | [Optional[models.PlatformSkillSyncStatus]](../models/platformskillsyncstatus.md) | :heavy_minus_sign: | Current external-source sync status. | +| `sync_error` | *Optional[str]* | :heavy_minus_sign: | Human-readable sync failure reason, present only when sync_status is SYNC_FAILED. | \ No newline at end of file diff --git a/docs/models/platformskillstatus.md b/docs/models/platformskillstatus.md new file mode 100644 index 00000000..566f1092 --- /dev/null +++ b/docs/models/platformskillstatus.md @@ -0,0 +1,22 @@ +# PlatformSkillStatus + +Current skill status. + +## Example Usage + +```python +from glean.api_client.models import PlatformSkillStatus + +value = PlatformSkillStatus.DRAFT + +# Open enum: unrecognized values are captured as UnrecognizedStr +``` + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `DRAFT` | DRAFT | +| `ENABLED` | ENABLED | +| `DISABLED` | DISABLED | \ No newline at end of file diff --git a/docs/models/platformskillsyncstatus.md b/docs/models/platformskillsyncstatus.md new file mode 100644 index 00000000..36b3ddd9 --- /dev/null +++ b/docs/models/platformskillsyncstatus.md @@ -0,0 +1,22 @@ +# PlatformSkillSyncStatus + +Current external-source sync status. + +## Example Usage + +```python +from glean.api_client.models import PlatformSkillSyncStatus + +value = PlatformSkillSyncStatus.UP_TO_DATE + +# Open enum: unrecognized values are captured as UnrecognizedStr +``` + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `UP_TO_DATE` | UP_TO_DATE | +| `UPDATE_AVAILABLE` | UPDATE_AVAILABLE | +| `SYNC_FAILED` | SYNC_FAILED | \ No newline at end of file diff --git a/docs/sdks/skills/README.md b/docs/sdks/skills/README.md new file mode 100644 index 00000000..35a30026 --- /dev/null +++ b/docs/sdks/skills/README.md @@ -0,0 +1,95 @@ +# Platform.Skills + +## Overview + +### Available Operations + +* [list](#list) - List skills +* [retrieve](#retrieve) - Retrieve skill + +## list + +List skills available to the authenticated user. + + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.platform.skills.list() + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Maximum number of skills to return. | +| `cursor` | *Optional[str]* | :heavy_minus_sign: | Opaque pagination cursor from a previous response. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.PlatformSkillsListResponse](../../models/platformskillslistresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## retrieve + +Retrieve metadata for a skill available to the authenticated user. + + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.platform.skills.retrieve(skill_id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `skill_id` | *str* | :heavy_check_mark: | Glean skill ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.PlatformSkillGetResponse](../../models/platformskillgetresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 9cb2c0bd..932a1745 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "glean-api-client" -version = "0.15.3" +version = "0.15.4" 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 75a78e98..bf9a5fa1 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.15.3" +__version__: str = "0.15.4" __openapi_doc_version__: str = "0.9.0" __gen_version__: str = "2.916.4" -__user_agent__: str = "speakeasy-sdk/python 0.15.3 2.916.4 0.9.0 glean-api-client" +__user_agent__: str = "speakeasy-sdk/python 0.15.4 2.916.4 0.9.0 glean-api-client" try: if __package__ is not None: diff --git a/src/glean/api_client/models/__init__.py b/src/glean/api_client/models/__init__.py index 536e42f5..01102948 100644 --- a/src/glean/api_client/models/__init__.py +++ b/src/glean/api_client/models/__init__.py @@ -1231,6 +1231,14 @@ PlatformAgentsGetRequest, PlatformAgentsGetRequestTypedDict, ) + from .platform_skills_getop import ( + PlatformSkillsGetRequest, + PlatformSkillsGetRequestTypedDict, + ) + from .platform_skills_listop import ( + PlatformSkillsListRequest, + PlatformSkillsListRequestTypedDict, + ) from .platformactionsummary import ( PlatformActionSummary, PlatformActionSummaryTypedDict, @@ -1293,6 +1301,22 @@ PlatformSearchResponse, PlatformSearchResponseTypedDict, ) + from .platformskill import PlatformSkill, PlatformSkillTypedDict + from .platformskillgetresponse import ( + PlatformSkillGetResponse, + PlatformSkillGetResponseTypedDict, + ) + from .platformskillorigin import PlatformSkillOrigin + from .platformskillslistresponse import ( + PlatformSkillsListResponse, + PlatformSkillsListResponseTypedDict, + ) + from .platformskillsourceprovenance import ( + PlatformSkillSourceProvenance, + PlatformSkillSourceProvenanceTypedDict, + ) + from .platformskillstatus import PlatformSkillStatus + from .platformskillsyncstatus import PlatformSkillSyncStatus from .platformtimerange import PlatformTimeRange, PlatformTimeRangeTypedDict from .possiblevalue import PossibleValue, PossibleValueTypedDict from .post_api_index_v1_debug_datasource_document_eventsop import ( @@ -2668,6 +2692,21 @@ "PlatformSearchRequestTypedDict", "PlatformSearchResponse", "PlatformSearchResponseTypedDict", + "PlatformSkill", + "PlatformSkillGetResponse", + "PlatformSkillGetResponseTypedDict", + "PlatformSkillOrigin", + "PlatformSkillSourceProvenance", + "PlatformSkillSourceProvenanceTypedDict", + "PlatformSkillStatus", + "PlatformSkillSyncStatus", + "PlatformSkillTypedDict", + "PlatformSkillsGetRequest", + "PlatformSkillsGetRequestTypedDict", + "PlatformSkillsListRequest", + "PlatformSkillsListRequestTypedDict", + "PlatformSkillsListResponse", + "PlatformSkillsListResponseTypedDict", "PlatformTimeRange", "PlatformTimeRangeTypedDict", "PossibleValue", @@ -3886,6 +3925,10 @@ "PlatformAgentsGetSchemasRequestTypedDict": ".platform_agents_get_schemasop", "PlatformAgentsGetRequest": ".platform_agents_getop", "PlatformAgentsGetRequestTypedDict": ".platform_agents_getop", + "PlatformSkillsGetRequest": ".platform_skills_getop", + "PlatformSkillsGetRequestTypedDict": ".platform_skills_getop", + "PlatformSkillsListRequest": ".platform_skills_listop", + "PlatformSkillsListRequestTypedDict": ".platform_skills_listop", "PlatformActionSummary": ".platformactionsummary", "PlatformActionSummaryTypedDict": ".platformactionsummary", "PlatformAgent": ".platformagent", @@ -3927,6 +3970,17 @@ "PlatformSearchRequestTypedDict": ".platformsearchrequest", "PlatformSearchResponse": ".platformsearchresponse", "PlatformSearchResponseTypedDict": ".platformsearchresponse", + "PlatformSkill": ".platformskill", + "PlatformSkillTypedDict": ".platformskill", + "PlatformSkillGetResponse": ".platformskillgetresponse", + "PlatformSkillGetResponseTypedDict": ".platformskillgetresponse", + "PlatformSkillOrigin": ".platformskillorigin", + "PlatformSkillsListResponse": ".platformskillslistresponse", + "PlatformSkillsListResponseTypedDict": ".platformskillslistresponse", + "PlatformSkillSourceProvenance": ".platformskillsourceprovenance", + "PlatformSkillSourceProvenanceTypedDict": ".platformskillsourceprovenance", + "PlatformSkillStatus": ".platformskillstatus", + "PlatformSkillSyncStatus": ".platformskillsyncstatus", "PlatformTimeRange": ".platformtimerange", "PlatformTimeRangeTypedDict": ".platformtimerange", "PossibleValue": ".possiblevalue", diff --git a/src/glean/api_client/models/platform_skills_getop.py b/src/glean/api_client/models/platform_skills_getop.py new file mode 100644 index 00000000..fc64256b --- /dev/null +++ b/src/glean/api_client/models/platform_skills_getop.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from glean.api_client.types import BaseModel +from glean.api_client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class PlatformSkillsGetRequestTypedDict(TypedDict): + skill_id: str + r"""Glean skill ID.""" + + +class PlatformSkillsGetRequest(BaseModel): + skill_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Glean skill ID.""" diff --git a/src/glean/api_client/models/platform_skills_listop.py b/src/glean/api_client/models/platform_skills_listop.py new file mode 100644 index 00000000..3f774193 --- /dev/null +++ b/src/glean/api_client/models/platform_skills_listop.py @@ -0,0 +1,45 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from glean.api_client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PlatformSkillsListRequestTypedDict(TypedDict): + page_size: NotRequired[int] + r"""Maximum number of skills to return.""" + cursor: NotRequired[str] + r"""Opaque pagination cursor from a previous response.""" + + +class PlatformSkillsListRequest(BaseModel): + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Maximum number of skills to return.""" + + cursor: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Opaque pagination cursor from a previous response.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["page_size", "cursor"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + 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/platformskill.py b/src/glean/api_client/models/platformskill.py new file mode 100644 index 00000000..4b7e21a7 --- /dev/null +++ b/src/glean/api_client/models/platformskill.py @@ -0,0 +1,102 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformpersonreference import ( + PlatformPersonReference, + PlatformPersonReferenceTypedDict, +) +from .platformskillorigin import PlatformSkillOrigin +from .platformskillsourceprovenance import ( + PlatformSkillSourceProvenance, + PlatformSkillSourceProvenanceTypedDict, +) +from .platformskillstatus import PlatformSkillStatus +from datetime import datetime +from glean.api_client import models +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import field_serializer, model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformSkillTypedDict(TypedDict): + id: str + r"""Glean skill ID.""" + display_name: str + r"""Human-readable skill name.""" + description: str + r"""Human-readable skill description.""" + latest_version: int + r"""Latest major version number for the skill.""" + latest_minor_version: int + r"""Latest minor version number for the skill.""" + status: PlatformSkillStatus + r"""Current skill status.""" + origin: PlatformSkillOrigin + r"""Source category for the skill.""" + owner: PlatformPersonReferenceTypedDict + r"""A lightweight reference to a person, used where a payload merely points at someone.""" + created_at: datetime + r"""Time the skill was created.""" + updated_at: datetime + r"""Time the skill was last updated.""" + source_provenance: NotRequired[PlatformSkillSourceProvenanceTypedDict] + + +class PlatformSkill(BaseModel): + id: str + r"""Glean skill ID.""" + + display_name: str + r"""Human-readable skill name.""" + + description: str + r"""Human-readable skill description.""" + + latest_version: int + r"""Latest major version number for the skill.""" + + latest_minor_version: int + r"""Latest minor version number for the skill.""" + + status: PlatformSkillStatus + r"""Current skill status.""" + + origin: PlatformSkillOrigin + r"""Source category for the skill.""" + + owner: PlatformPersonReference + r"""A lightweight reference to a person, used where a payload merely points at someone.""" + + created_at: datetime + r"""Time the skill was created.""" + + updated_at: datetime + r"""Time the skill was last updated.""" + + source_provenance: Optional[PlatformSkillSourceProvenance] = None + + @field_serializer("status") + def serialize_status(self, value): + if isinstance(value, str): + try: + return models.PlatformSkillStatus(value) + except ValueError: + return value + return value + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["source_provenance"]) + 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/platformskillgetresponse.py b/src/glean/api_client/models/platformskillgetresponse.py new file mode 100644 index 00000000..2cc28636 --- /dev/null +++ b/src/glean/api_client/models/platformskillgetresponse.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformskill import PlatformSkill, PlatformSkillTypedDict +from glean.api_client.types import BaseModel +from typing_extensions import TypedDict + + +class PlatformSkillGetResponseTypedDict(TypedDict): + skill: PlatformSkillTypedDict + request_id: str + r"""Platform-generated request ID for support correlation.""" + + +class PlatformSkillGetResponse(BaseModel): + skill: PlatformSkill + + request_id: str + r"""Platform-generated request ID for support correlation.""" diff --git a/src/glean/api_client/models/platformskillorigin.py b/src/glean/api_client/models/platformskillorigin.py new file mode 100644 index 00000000..320c60ec --- /dev/null +++ b/src/glean/api_client/models/platformskillorigin.py @@ -0,0 +1,10 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PlatformSkillOrigin(str, Enum): + r"""Source category for the skill.""" + + CUSTOM = "CUSTOM" diff --git a/src/glean/api_client/models/platformskillslistresponse.py b/src/glean/api_client/models/platformskillslistresponse.py new file mode 100644 index 00000000..7303b051 --- /dev/null +++ b/src/glean/api_client/models/platformskillslistresponse.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformskill import PlatformSkill, PlatformSkillTypedDict +from glean.api_client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List +from typing_extensions import TypedDict + + +class PlatformSkillsListResponseTypedDict(TypedDict): + skills: List[PlatformSkillTypedDict] + r"""Skills available to the user.""" + has_more: bool + r"""Whether additional results are available.""" + next_cursor: Nullable[str] + r"""Cursor for the next page, or null when no more results are available.""" + request_id: str + r"""Platform-generated request ID for support correlation.""" + + +class PlatformSkillsListResponse(BaseModel): + skills: List[PlatformSkill] + r"""Skills available to the user.""" + + has_more: bool + r"""Whether additional results are available.""" + + next_cursor: Nullable[str] + r"""Cursor for the next page, or null when no more results are available.""" + + request_id: str + r"""Platform-generated request ID for support correlation.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformskillsourceprovenance.py b/src/glean/api_client/models/platformskillsourceprovenance.py new file mode 100644 index 00000000..d1352b1f --- /dev/null +++ b/src/glean/api_client/models/platformskillsourceprovenance.py @@ -0,0 +1,79 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformskillsyncstatus import PlatformSkillSyncStatus +from datetime import datetime +from glean.api_client import models +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import field_serializer, model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformSkillSourceProvenanceTypedDict(TypedDict): + source_url: NotRequired[str] + r"""URL of the external source the skill was imported from.""" + commit_sha: NotRequired[str] + r"""Source commit SHA for the imported skill.""" + imported_at: NotRequired[datetime] + r"""Time the skill was imported.""" + last_synced_at: NotRequired[datetime] + r"""Time the skill was last synced from its source.""" + sync_status: NotRequired[PlatformSkillSyncStatus] + r"""Current external-source sync status.""" + sync_error: NotRequired[str] + r"""Human-readable sync failure reason, present only when sync_status is SYNC_FAILED.""" + + +class PlatformSkillSourceProvenance(BaseModel): + source_url: Optional[str] = None + r"""URL of the external source the skill was imported from.""" + + commit_sha: Optional[str] = None + r"""Source commit SHA for the imported skill.""" + + imported_at: Optional[datetime] = None + r"""Time the skill was imported.""" + + last_synced_at: Optional[datetime] = None + r"""Time the skill was last synced from its source.""" + + sync_status: Optional[PlatformSkillSyncStatus] = None + r"""Current external-source sync status.""" + + sync_error: Optional[str] = None + r"""Human-readable sync failure reason, present only when sync_status is SYNC_FAILED.""" + + @field_serializer("sync_status") + def serialize_sync_status(self, value): + if isinstance(value, str): + try: + return models.PlatformSkillSyncStatus(value) + except ValueError: + return value + return value + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "source_url", + "commit_sha", + "imported_at", + "last_synced_at", + "sync_status", + "sync_error", + ] + ) + 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/platformskillstatus.py b/src/glean/api_client/models/platformskillstatus.py new file mode 100644 index 00000000..d57185fb --- /dev/null +++ b/src/glean/api_client/models/platformskillstatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from glean.api_client import utils + + +class PlatformSkillStatus(str, Enum, metaclass=utils.OpenEnumMeta): + r"""Current skill status.""" + + DRAFT = "DRAFT" + ENABLED = "ENABLED" + DISABLED = "DISABLED" diff --git a/src/glean/api_client/models/platformskillsyncstatus.py b/src/glean/api_client/models/platformskillsyncstatus.py new file mode 100644 index 00000000..13fb6bcf --- /dev/null +++ b/src/glean/api_client/models/platformskillsyncstatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from glean.api_client import utils + + +class PlatformSkillSyncStatus(str, Enum, metaclass=utils.OpenEnumMeta): + r"""Current external-source sync status.""" + + UP_TO_DATE = "UP_TO_DATE" + UPDATE_AVAILABLE = "UPDATE_AVAILABLE" + SYNC_FAILED = "SYNC_FAILED" diff --git a/src/glean/api_client/platform.py b/src/glean/api_client/platform.py new file mode 100644 index 00000000..0a8c08d7 --- /dev/null +++ b/src/glean/api_client/platform.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from .sdkconfiguration import SDKConfiguration +from glean.api_client.skills import Skills +from typing import Optional + + +class Platform(BaseSDK): + skills: Skills + + def __init__( + self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None + ) -> None: + BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) + self.sdk_configuration = sdk_config + self._init_sdks() + + def _init_sdks(self): + self.skills = Skills(self.sdk_configuration, parent_ref=self.parent_ref) diff --git a/src/glean/api_client/sdk.py b/src/glean/api_client/sdk.py index 4d65c6df..b0beef7e 100644 --- a/src/glean/api_client/sdk.py +++ b/src/glean/api_client/sdk.py @@ -18,6 +18,7 @@ from glean.api_client.agents import Agents from glean.api_client.client import Client from glean.api_client.indexing import Indexing + from glean.api_client.platform import Platform from glean.api_client.search import Search @@ -42,11 +43,13 @@ class Glean(BaseSDK): """ agents: "Agents" + platform: "Platform" search: "Search" client: "Client" indexing: "Indexing" _sub_sdk_map = { "agents": ("glean.api_client.agents", "Agents"), + "platform": ("glean.api_client.platform", "Platform"), "search": ("glean.api_client.search", "Search"), "client": ("glean.api_client.client", "Client"), "indexing": ("glean.api_client.indexing", "Indexing"), diff --git a/src/glean/api_client/skills.py b/src/glean/api_client/skills.py new file mode 100644 index 00000000..392ae641 --- /dev/null +++ b/src/glean/api_client/skills.py @@ -0,0 +1,449 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from glean.api_client import errors, models, utils +from glean.api_client._hooks import HookContext +from glean.api_client.types import OptionalNullable, UNSET +from glean.api_client.utils import get_security_from_env +from glean.api_client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Mapping, Optional + + +class Skills(BaseSDK): + def list( + self, + *, + page_size: Optional[int] = None, + cursor: 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.PlatformSkillsListResponse: + r"""List skills + + List skills available to the authenticated user. + + + :param page_size: Maximum number of skills to return. + :param cursor: Opaque pagination cursor from a previous response. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PlatformSkillsListRequest( + page_size=page_size, + cursor=cursor, + ) + + req = self._build_request( + method="GET", + path="/api/skills", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="platform-skills-list", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Skills"], + extensions={ + "x-glean-experimental": { + "id": "3eb65937-03a3-472b-9a00-be713f302b5f", + "introduced": "2026-06-23", + }, + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.PlatformSkillsListResponse, http_res) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def list_async( + self, + *, + page_size: Optional[int] = None, + cursor: 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.PlatformSkillsListResponse: + r"""List skills + + List skills available to the authenticated user. + + + :param page_size: Maximum number of skills to return. + :param cursor: Opaque pagination cursor from a previous response. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PlatformSkillsListRequest( + page_size=page_size, + cursor=cursor, + ) + + req = self._build_request_async( + method="GET", + path="/api/skills", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="platform-skills-list", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Skills"], + extensions={ + "x-glean-experimental": { + "id": "3eb65937-03a3-472b-9a00-be713f302b5f", + "introduced": "2026-06-23", + }, + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.PlatformSkillsListResponse, http_res) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def retrieve( + self, + *, + skill_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformSkillGetResponse: + r"""Retrieve skill + + Retrieve metadata for a skill available to the authenticated user. + + + :param skill_id: Glean skill ID. + :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.PlatformSkillsGetRequest( + skill_id=skill_id, + ) + + req = self._build_request( + method="GET", + path="/api/skills/{skill_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="platform-skills-get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Skills"], + extensions={ + "x-glean-experimental": { + "id": "8f8d1c92-a484-4769-9903-200613dc8a72", + "introduced": "2026-06-23", + }, + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.PlatformSkillGetResponse, http_res) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def retrieve_async( + self, + *, + skill_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformSkillGetResponse: + r"""Retrieve skill + + Retrieve metadata for a skill available to the authenticated user. + + + :param skill_id: Glean skill ID. + :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.PlatformSkillsGetRequest( + skill_id=skill_id, + ) + + req = self._build_request_async( + method="GET", + path="/api/skills/{skill_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="platform-skills-get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Skills"], + extensions={ + "x-glean-experimental": { + "id": "8f8d1c92-a484-4769-9903-200613dc8a72", + "introduced": "2026-06-23", + }, + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.PlatformSkillGetResponse, http_res) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) diff --git a/tests/mockserver/internal/handler/generated_handlers.go b/tests/mockserver/internal/handler/generated_handlers.go index d5fe2f85..49b7267f 100644 --- a/tests/mockserver/internal/handler/generated_handlers.go +++ b/tests/mockserver/internal/handler/generated_handlers.go @@ -16,6 +16,8 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodDelete, "/rest/api/index/document/{docId}/custom-metadata/{groupName}", pathDeleteRestAPIIndexDocumentDocIDCustomMetadataGroupName(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}", pathGetAPIAgentsAgentID(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}/schemas", pathGetAPIAgentsAgentIDSchemas(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/api/skills", pathGetAPISkills(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/api/skills/{skill_id}", pathGetAPISkillsSkillID(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/index/custom-metadata/schema/{groupName}", pathGetRestAPIIndexCustomMetadataSchemaGroupName(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/actions/actionpack/{actionPackId}/auth", pathGetRestAPIV1ActionsActionpackActionPackIDAuth(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/agents/{agent_id}", pathGetRestAPIV1AgentsAgentID(dir, rt)), diff --git a/tests/mockserver/internal/handler/pathgetapiskills.go b/tests/mockserver/internal/handler/pathgetapiskills.go new file mode 100644 index 00000000..7baa51e7 --- /dev/null +++ b/tests/mockserver/internal/handler/pathgetapiskills.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetAPISkills(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-skills-list[0]": + dir.HandlerFunc("platform-skills-list", testPlatformSkillsListPlatformSkillsList0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformSkillsListPlatformSkillsList0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PlatformSkillsListResponse = &components.PlatformSkillsListResponse{ + Skills: []components.PlatformSkill{}, + HasMore: true, + NextCursor: types.String(""), + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathgetapiskillsskillid.go b/tests/mockserver/internal/handler/pathgetapiskillsskillid.go new file mode 100644 index 00000000..4f097d84 --- /dev/null +++ b/tests/mockserver/internal/handler/pathgetapiskillsskillid.go @@ -0,0 +1,79 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetAPISkillsSkillID(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-skills-get[0]": + dir.HandlerFunc("platform-skills-get", testPlatformSkillsGetPlatformSkillsGet0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformSkillsGetPlatformSkillsGet0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PlatformSkillGetResponse = &components.PlatformSkillGetResponse{ + Skill: components.PlatformSkill{ + ID: "", + DisplayName: "Chad_Herzog", + Description: "whenever up aha controvert", + LatestVersion: 151495, + LatestMinorVersion: 170771, + Status: components.PlatformSkillStatusDisabled, + Origin: components.PlatformSkillOriginCustom, + Owner: components.PlatformPersonReference{ + Name: "", + }, + CreatedAt: types.MustTimeFromString("2024-12-25T16:41:00.099Z"), + UpdatedAt: types.MustTimeFromString("2026-12-07T21:59:59.375Z"), + }, + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go b/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go index 5c99a0ad..371b9023 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: "motionless whenever paintwork import over cuckoo", + Description: "whole busily jive hawk gee basic minus hence", AddedRoles: []components.UserRoleSpecification{ components.UserRoleSpecification{ Person: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", }, - Role: components.UserRoleOwner, + Role: components.UserRoleAnswerModerator, }, }, RemovedRoles: []components.UserRoleSpecification{ @@ -90,7 +90,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 363711, + ID: 158969, 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: 570197, + CollectionID: 110375, 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.UserRoleAnswerModerator, + Role: components.UserRoleEditor, }, }, }, Collection: &components.Collection{ Name: "", - Description: "athwart skateboard newsstand farm bourgeoisie ah how elliptical aha well-to-do", + Description: "wedge colorfully orientate rally", AudienceFilters: []components.FacetFilter{ components.FacetFilter{ FieldName: types.String("type"), @@ -288,7 +288,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 643990, + ID: 131797, 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: "woot purse salty even as advanced", + Description: "outside yippee sidetrack mature regularly mouser inject worth", AudienceFilters: []components.FacetFilter{ components.FacetFilter{ FieldName: types.String("type"), @@ -316,7 +316,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 359978, + ID: 149448, Creator: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -328,7 +328,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ItemType: components.CollectionItemItemTypeURL, + ItemType: components.CollectionItemItemTypeCollection, }, }, }, diff --git a/tests/mockserver/internal/sdk/models/components/platformskill.go b/tests/mockserver/internal/sdk/models/components/platformskill.go new file mode 100644 index 00000000..8397a899 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformskill.go @@ -0,0 +1,120 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type PlatformSkill struct { + // Glean skill ID. + ID string `json:"id"` + // Human-readable skill name. + DisplayName string `json:"display_name"` + // Human-readable skill description. + Description string `json:"description"` + // Latest major version number for the skill. + LatestVersion int64 `json:"latest_version"` + // Latest minor version number for the skill. + LatestMinorVersion int64 `json:"latest_minor_version"` + // Current skill status. + Status PlatformSkillStatus `json:"status"` + // Source category for the skill. + Origin PlatformSkillOrigin `json:"origin"` + SourceProvenance *PlatformSkillSourceProvenance `json:"source_provenance,omitempty"` + // A lightweight reference to a person, used where a payload merely points at someone. + Owner PlatformPersonReference `json:"owner"` + // Time the skill was created. + CreatedAt time.Time `json:"created_at"` + // Time the skill was last updated. + UpdatedAt time.Time `json:"updated_at"` +} + +func (p PlatformSkill) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformSkill) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"id", "display_name", "description", "latest_version", "latest_minor_version", "status", "origin", "owner", "created_at", "updated_at"}); err != nil { + return err + } + return nil +} + +func (o *PlatformSkill) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *PlatformSkill) GetDisplayName() string { + if o == nil { + return "" + } + return o.DisplayName +} + +func (o *PlatformSkill) GetDescription() string { + if o == nil { + return "" + } + return o.Description +} + +func (o *PlatformSkill) GetLatestVersion() int64 { + if o == nil { + return 0 + } + return o.LatestVersion +} + +func (o *PlatformSkill) GetLatestMinorVersion() int64 { + if o == nil { + return 0 + } + return o.LatestMinorVersion +} + +func (o *PlatformSkill) GetStatus() PlatformSkillStatus { + if o == nil { + return PlatformSkillStatus("") + } + return o.Status +} + +func (o *PlatformSkill) GetOrigin() PlatformSkillOrigin { + if o == nil { + return PlatformSkillOrigin("") + } + return o.Origin +} + +func (o *PlatformSkill) GetSourceProvenance() *PlatformSkillSourceProvenance { + if o == nil { + return nil + } + return o.SourceProvenance +} + +func (o *PlatformSkill) GetOwner() PlatformPersonReference { + if o == nil { + return PlatformPersonReference{} + } + return o.Owner +} + +func (o *PlatformSkill) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *PlatformSkill) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} diff --git a/tests/mockserver/internal/sdk/models/components/platformskillgetresponse.go b/tests/mockserver/internal/sdk/models/components/platformskillgetresponse.go new file mode 100644 index 00000000..c9bcfa2f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformskillgetresponse.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PlatformSkillGetResponse struct { + Skill PlatformSkill `json:"skill"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformSkillGetResponse) GetSkill() PlatformSkill { + if o == nil { + return PlatformSkill{} + } + return o.Skill +} + +func (o *PlatformSkillGetResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/tests/mockserver/internal/sdk/models/components/platformskillorigin.go b/tests/mockserver/internal/sdk/models/components/platformskillorigin.go new file mode 100644 index 00000000..e0a00449 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformskillorigin.go @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformSkillOrigin - Source category for the skill. +type PlatformSkillOrigin string + +const ( + PlatformSkillOriginCustom PlatformSkillOrigin = "CUSTOM" +) + +func (e PlatformSkillOrigin) ToPointer() *PlatformSkillOrigin { + return &e +} +func (e *PlatformSkillOrigin) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "CUSTOM": + *e = PlatformSkillOrigin(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformSkillOrigin: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/platformskillslistresponse.go b/tests/mockserver/internal/sdk/models/components/platformskillslistresponse.go new file mode 100644 index 00000000..566d5351 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformskillslistresponse.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PlatformSkillsListResponse struct { + // Skills available to the user. + Skills []PlatformSkill `json:"skills"` + // Whether additional results are available. + HasMore bool `json:"has_more"` + // Cursor for the next page, or null when no more results are available. + NextCursor *string `json:"next_cursor"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformSkillsListResponse) GetSkills() []PlatformSkill { + if o == nil { + return []PlatformSkill{} + } + return o.Skills +} + +func (o *PlatformSkillsListResponse) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *PlatformSkillsListResponse) GetNextCursor() *string { + if o == nil { + return nil + } + return o.NextCursor +} + +func (o *PlatformSkillsListResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/tests/mockserver/internal/sdk/models/components/platformskillsourceprovenance.go b/tests/mockserver/internal/sdk/models/components/platformskillsourceprovenance.go new file mode 100644 index 00000000..65ed2aac --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformskillsourceprovenance.go @@ -0,0 +1,76 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type PlatformSkillSourceProvenance struct { + // URL of the external source the skill was imported from. + SourceURL *string `json:"source_url,omitempty"` + // Source commit SHA for the imported skill. + CommitSha *string `json:"commit_sha,omitempty"` + // Time the skill was imported. + ImportedAt *time.Time `json:"imported_at,omitempty"` + // Time the skill was last synced from its source. + LastSyncedAt *time.Time `json:"last_synced_at,omitempty"` + // Current external-source sync status. + SyncStatus *PlatformSkillSyncStatus `json:"sync_status,omitempty"` + // Human-readable sync failure reason, present only when sync_status is SYNC_FAILED. + SyncError *string `json:"sync_error,omitempty"` +} + +func (p PlatformSkillSourceProvenance) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformSkillSourceProvenance) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *PlatformSkillSourceProvenance) GetSourceURL() *string { + if o == nil { + return nil + } + return o.SourceURL +} + +func (o *PlatformSkillSourceProvenance) GetCommitSha() *string { + if o == nil { + return nil + } + return o.CommitSha +} + +func (o *PlatformSkillSourceProvenance) GetImportedAt() *time.Time { + if o == nil { + return nil + } + return o.ImportedAt +} + +func (o *PlatformSkillSourceProvenance) GetLastSyncedAt() *time.Time { + if o == nil { + return nil + } + return o.LastSyncedAt +} + +func (o *PlatformSkillSourceProvenance) GetSyncStatus() *PlatformSkillSyncStatus { + if o == nil { + return nil + } + return o.SyncStatus +} + +func (o *PlatformSkillSourceProvenance) GetSyncError() *string { + if o == nil { + return nil + } + return o.SyncError +} diff --git a/tests/mockserver/internal/sdk/models/components/platformskillstatus.go b/tests/mockserver/internal/sdk/models/components/platformskillstatus.go new file mode 100644 index 00000000..a218b760 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformskillstatus.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformSkillStatus - Current skill status. +type PlatformSkillStatus string + +const ( + PlatformSkillStatusDraft PlatformSkillStatus = "DRAFT" + PlatformSkillStatusEnabled PlatformSkillStatus = "ENABLED" + PlatformSkillStatusDisabled PlatformSkillStatus = "DISABLED" +) + +func (e PlatformSkillStatus) ToPointer() *PlatformSkillStatus { + return &e +} +func (e *PlatformSkillStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "DRAFT": + fallthrough + case "ENABLED": + fallthrough + case "DISABLED": + *e = PlatformSkillStatus(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformSkillStatus: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/platformskillsyncstatus.go b/tests/mockserver/internal/sdk/models/components/platformskillsyncstatus.go new file mode 100644 index 00000000..0582664c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformskillsyncstatus.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformSkillSyncStatus - Current external-source sync status. +type PlatformSkillSyncStatus string + +const ( + PlatformSkillSyncStatusUpToDate PlatformSkillSyncStatus = "UP_TO_DATE" + PlatformSkillSyncStatusUpdateAvailable PlatformSkillSyncStatus = "UPDATE_AVAILABLE" + PlatformSkillSyncStatusSyncFailed PlatformSkillSyncStatus = "SYNC_FAILED" +) + +func (e PlatformSkillSyncStatus) ToPointer() *PlatformSkillSyncStatus { + return &e +} +func (e *PlatformSkillSyncStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "UP_TO_DATE": + fallthrough + case "UPDATE_AVAILABLE": + fallthrough + case "SYNC_FAILED": + *e = PlatformSkillSyncStatus(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformSkillSyncStatus: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformskillsget.go b/tests/mockserver/internal/sdk/models/operations/platformskillsget.go new file mode 100644 index 00000000..6ebb5b11 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformskillsget.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformSkillsGetRequest struct { + // Glean skill ID. + SkillID string `pathParam:"style=simple,explode=false,name=skill_id"` +} + +func (o *PlatformSkillsGetRequest) GetSkillID() string { + if o == nil { + return "" + } + return o.SkillID +} + +type PlatformSkillsGetResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformSkillGetResponse *components.PlatformSkillGetResponse +} + +func (o *PlatformSkillsGetResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformSkillsGetResponse) GetPlatformSkillGetResponse() *components.PlatformSkillGetResponse { + if o == nil { + return nil + } + return o.PlatformSkillGetResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformskillslist.go b/tests/mockserver/internal/sdk/models/operations/platformskillslist.go new file mode 100644 index 00000000..40f74199 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformskillslist.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformSkillsListRequest struct { + // Maximum number of skills to return. + PageSize *int64 `queryParam:"style=form,explode=true,name=page_size"` + // Opaque pagination cursor from a previous response. + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` +} + +func (o *PlatformSkillsListRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *PlatformSkillsListRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +type PlatformSkillsListResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformSkillsListResponse *components.PlatformSkillsListResponse +} + +func (o *PlatformSkillsListResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformSkillsListResponse) GetPlatformSkillsListResponse() *components.PlatformSkillsListResponse { + if o == nil { + return nil + } + return o.PlatformSkillsListResponse +} diff --git a/tests/test_skills.py b/tests/test_skills.py new file mode 100644 index 00000000..b982fb6e --- /dev/null +++ b/tests/test_skills.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from glean.api_client import Glean +import os +from tests.test_client import create_test_http_client + + +def test_skills_platform_skills_list(): + test_http_client = create_test_http_client("platform-skills-list") + + 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.platform.skills.list() + assert res is not None + + +def test_skills_platform_skills_get(): + test_http_client = create_test_http_client("platform-skills-get") + + with Glean( + server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), + client=test_http_client, + api_token=os.getenv("GLEAN_API_TOKEN", "value"), + ) as glean: + assert glean is not None + + res = glean.platform.skills.retrieve(skill_id="") + assert res is not None From 3e03c6e829fc0fe48ea2fcd4648868c06e2defa7 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Sat, 11 Jul 2026 02:46:13 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow