diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index cbb86e27..968bf860 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,23 +1,23 @@ lockVersion: 2.0.0 id: 9d90eb9e-33f8-4170-8944-988f4000aad0 management: - docChecksum: 33958fda4f2b946f46f0593aac3a619d + docChecksum: 3836053a1bea65480340d871e1bc5a5f docVersion: 0.9.0 - speakeasyVersion: 1.789.2 - generationVersion: 2.916.4 - releaseVersion: 0.13.3 - configChecksum: d8c5dbc61d50c91087ddac380658b2a3 + speakeasyVersion: 1.790.2 + generationVersion: 2.918.3 + releaseVersion: 0.13.4 + configChecksum: 84f1d1ec26d1cb0114798c5ca0cb5bf2 repoURL: https://github.com/gleanwork/api-client-go.git installationURL: https://github.com/gleanwork/api-client-go persistentEdits: - generation_id: 301d40aa-b90e-41af-9218-fb049a9c791c - pristine_commit_hash: 1c29a1de06c6e288407e955d5c99d20d99f92db9 - pristine_tree_hash: ed54f2a158557d2898fb704c6fd2c794de48031c + generation_id: 90168e1a-20c8-4514-8b3d-31412e412a50 + pristine_commit_hash: 14f5aeb9d8434c1bf7eb1291f77b40ca2a8acb2d + pristine_tree_hash: 24f4ca4a6ce7399b60273863c62801c369ea2e12 features: go: acceptHeaders: 2.81.2 additionalDependencies: 0.1.0 - additionalProperties: 0.1.2 + additionalProperties: 0.1.3 constsAndDefaults: 0.1.14 core: 3.13.47 defaultEnabledRetries: 0.2.0 @@ -168,6 +168,10 @@ trackedFiles: id: f9f286d7b5c6 last_write_checksum: sha1:4772a941c6ff48ac882f8af37ba75ba3992f23c8 pristine_git_object: 519f7906092a23ddcfb3681a849754413edab352 + docs/models/components/actiontypesource.md: + id: 5a875e42f006 + last_write_checksum: sha1:bcc6b7810e05e81eeda22c2bfab5f530a9750774 + pristine_git_object: 8ddec1006ed9662611131621e64c2a204c4bcca1 docs/models/components/activity.md: id: a2d8273e4214 last_write_checksum: sha1:5793af93a85c85a322ebfbe8660bd955b2ab4685 @@ -994,8 +998,8 @@ trackedFiles: pristine_git_object: bce8e915846ff941892e670381f96485a38d5a08 docs/models/components/dlpfindingfilter.md: id: ad24e16401ed - last_write_checksum: sha1:924d56ff50b04f6e3cb8b206d8d0e48b73567d17 - pristine_git_object: bc10cf34dc8441d38047646b0cb496d82fa5954e + last_write_checksum: sha1:0c6d57e13f7e6116028a9dcfe59aabd165bf6ff7 + pristine_git_object: 6fdb36c7ff5c10fd42e3a892731ee7c78aad9e0c docs/models/components/dlpfrequency.md: id: 05f0009c75ed last_write_checksum: sha1:ce50970b1d0d795ca4ed944fd6d3cb46301ea337 @@ -1026,8 +1030,8 @@ trackedFiles: pristine_git_object: f3850a87df1e7310bdd4711565ae8a9ea249bec5 docs/models/components/dlpseverity.md: id: d67a8f061250 - last_write_checksum: sha1:dfefc1307678ef132dd8fe8915fb995d5a87ff68 - pristine_git_object: 7f91823d04938f2d2547d77fe58d0609efd82beb + last_write_checksum: sha1:1bc0aca197c60257d4488c11b0d384fa9b969332 + pristine_git_object: 895f1ad397a1c93b55020c11a91bd209caa613c7 docs/models/components/dlpsimpleresult.md: id: c7731038836f last_write_checksum: sha1:d269d84f29d9023a29575e76b33a78e085206eaa @@ -2008,6 +2012,34 @@ trackedFiles: id: d398b8139176 last_write_checksum: sha1:8e60e11bbdf3cb4c64446551d422cffba1d47238 pristine_git_object: 0794886b804c14ea6a92f1146621164ab81e0fee + docs/models/components/platformskill.md: + id: 0085679a1f14 + last_write_checksum: sha1:7fb7ab3d042d0c28c27716010cddc30bc47cb06c + pristine_git_object: 28d865f006c9630eec3d7c10370402b951dcecf6 + docs/models/components/platformskillgetresponse.md: + id: bc5043e8f6f7 + last_write_checksum: sha1:9f676850351c3869e0c5765ccf341e659562857f + pristine_git_object: f39ce31f59cdf798b50be591c1f0accfb1f2b758 + docs/models/components/platformskillorigin.md: + id: 9dc751dc212a + last_write_checksum: sha1:4a1d6ce7afa526d37d4386871f24471c1daff646 + pristine_git_object: 898011b445cbf9ad0e6fb7e66b7b09d4f72fa639 + docs/models/components/platformskillslistresponse.md: + id: 58b27e4bea7e + last_write_checksum: sha1:efe68fd855c2344a01f93d8d103866372a06fc69 + pristine_git_object: 3e7bca2ce6fa6ad499fe7b1b0e52fbdaf1862daf + docs/models/components/platformskillsourceprovenance.md: + id: 29fe97f47f93 + last_write_checksum: sha1:175c6ef974cbfe66b806e810db5c69060bf432fc + pristine_git_object: c9c901dd9f1740f879336b4fd06348d35f5ef0e0 + docs/models/components/platformskillstatus.md: + id: 3342d36796ac + last_write_checksum: sha1:6d88bc81927adb5900359e8d16ff9550f0c01ca3 + pristine_git_object: 0eb8f54e948b71747e9f9a1a928f91733bdd88eb + docs/models/components/platformskillsyncstatus.md: + id: b4dfbecbfcf6 + last_write_checksum: sha1:d444bf3ae45d30a6d3a8d57d0a36281e721542ae + pristine_git_object: 0b0a0c1ff41ee9c5e6fa7b1f9f95b9ee0b7b7ed3 docs/models/components/platformtimerange.md: id: d2e589bb488c last_write_checksum: sha1:61236d3fb6f05a246d0a61150bf2456c18cfd7f5 @@ -2442,8 +2474,8 @@ trackedFiles: pristine_git_object: 96500bce6c762f21c7d5b7927898bb309a201414 docs/models/components/toolmetadata.md: id: e8ce3b56fbdc - last_write_checksum: sha1:0e73c5d8394b4b0358621b7bc54c2217537d7d10 - pristine_git_object: 0eb177c9b4e179deb001b03934a24250a0f91be4 + last_write_checksum: sha1:4c10de41704ef0fb11c7261ff052293e04171156 + pristine_git_object: feadc76e887744b8704909c72702a7e123c7bb55 docs/models/components/toolmetadatatype.md: id: 45942314082a last_write_checksum: sha1:f78c398a278a268a3ad1a9d66f7145b80b3237c6 @@ -2654,8 +2686,8 @@ trackedFiles: pristine_git_object: 63fe00e65819716b5506a942069c425a50adf0b8 docs/models/components/workflow.md: id: f569d478b233 - last_write_checksum: sha1:638a8b2ab4f14ecb2490e4c47af51ca8da591d8f - pristine_git_object: c6b0e34b7e77c6280a9f4e2fde00fe062aafca0d + last_write_checksum: sha1:046f3355684d4892bf281cfbf3de922a1623c88d + pristine_git_object: 16392d738eeac4cd3a1f8b3c0eaec65c8e52de8c docs/models/components/workflowfeedbackinfo.md: id: fc6ea7558326 last_write_checksum: sha1:f54515e67180906a8b81931baa055bd474796f66 @@ -3316,6 +3348,22 @@ trackedFiles: id: a46e42d54b9f last_write_checksum: sha1:ca08b9c8ea57085a78456a25c94f175bc22b6357 pristine_git_object: aac966cebf050dbaec08ec5a7ca67cb03ba1779e + docs/models/operations/platformskillsgetrequest.md: + id: 6e77031ea696 + last_write_checksum: sha1:bb06dad1a6c863ce306117a166eb58d7803970a2 + pristine_git_object: b5d6c2b611f8b12098984153097ac086b99f5c1c + docs/models/operations/platformskillsgetresponse.md: + id: bcd6a2c49669 + last_write_checksum: sha1:8028981d53d2a7cdece1d5927b226384067143d6 + pristine_git_object: 2a33875ec169fc83ef78cf18b1db96301549309e + docs/models/operations/platformskillslistrequest.md: + id: 2e304cbf2212 + last_write_checksum: sha1:90c7ee33379213fe5e88db31513945f25da76034 + pristine_git_object: 7727a9476f5a848f051ec94e9629e984e49d2563 + docs/models/operations/platformskillslistresponse.md: + id: b0b541d98b59 + last_write_checksum: sha1:a332cc22fae23106c991d0a9fcad6455043c6667 + pristine_git_object: e33cf96998184b7b5eea817d71c91bae30fa4e20 docs/models/operations/postapiindexv1adddatasourceresponse.md: id: 6fe122d45c0b last_write_checksum: sha1:cda908b7a1c12d7638556f7c4573c97a50140504 @@ -3488,6 +3536,18 @@ trackedFiles: id: aa2ee1648ad6 last_write_checksum: sha1:4c01e1e0194a288fa426486ab6a75cd55a85afb5 pristine_git_object: 909415c4182d5f81462f05eb9c635f7e7b275434 + docs/models/operations/postrestapiindexsubmissionsdatasourceinstancetyperequest.md: + id: 0237c1fecb7c + last_write_checksum: sha1:dc6a60fc633e2761a006b7c840ae00e2a941a0d8 + pristine_git_object: 8a2d334cd673da60dd0c16db4916d836da8e40ef + docs/models/operations/postrestapiindexsubmissionsdatasourceinstancetyperesponse.md: + id: eb51e79f4b3a + last_write_checksum: sha1:ff3904d22a2ca411f6292aa9a798876e1b80321a + pristine_git_object: 9be22d01f23b6447c6129a3f5aa5645aae7b13cc + docs/models/operations/postrestapiindexsubmissionsdatasourceinstancetyperesponsebody.md: + id: 28b12698d443 + last_write_checksum: sha1:711461b745278d0ae3adbd8fb2cd3abcb9b2a2d8 + pristine_git_object: e0ccae7b6485ae57e1d014a19dd715bae8ba3373 docs/models/operations/postrestapiv1toolscallresponse.md: id: c4414169756f last_write_checksum: sha1:887d05b9aa864cbe327f2160146d1729f43d7043 @@ -3682,8 +3742,8 @@ trackedFiles: pristine_git_object: 71d196c5c1050ea917ea7241cf97a0aa96e4a5d6 docs/sdks/indexingdatasources/README.md: id: aa113bda8cbc - last_write_checksum: sha1:660976c27beca11f5a14a14827f5a8a4cd0cb62d - pristine_git_object: 6fe0a50060f16cb92d0a067a0760fe48df58b803 + last_write_checksum: sha1:6fc04326a41c3a9856ad40513938f3171b526009 + pristine_git_object: 5b6072803b4ca6ba836dbcf493c952c753efecbd docs/sdks/indexingdocuments/README.md: id: 7ca38da53414 last_write_checksum: sha1:6333c319edaeebe143c77cb51ec83ef7717eb93e @@ -3724,6 +3784,10 @@ trackedFiles: id: 5c534716244c last_write_checksum: sha1:2ff02ecfda4f97e039b24254528a20800148f39f pristine_git_object: 2487f2f798a866383f669952a76f999c869d4927 + docs/sdks/skills/README.md: + id: 3a14a5c90791 + last_write_checksum: sha1:89b9b212e70e74796125cf2225ea836cd6840ed7 + pristine_git_object: eded2ea7efc384e32572a038417109b6676f84d7 docs/sdks/tools/README.md: id: 044286549bac last_write_checksum: sha1:496baa99aee4567d5338f6bf39dbca987ea67684 @@ -3750,8 +3814,8 @@ trackedFiles: pristine_git_object: a3cb3e5448f3fdcfad77ed2a4ba47ae848d5cd5d glean.go: id: f5ed099b8e85 - last_write_checksum: sha1:dce5f3a64b81b878278dd1c24c9913042379433d - pristine_git_object: 4842a872e30637d4adc5bc344128ef0c67b37ef4 + last_write_checksum: sha1:d45805571635015990ab70f5e394444a1e2a7927 + pristine_git_object: ab1fa878d93cde2a10bc2c0168cb556dbeff51bc go.mod: id: c47645c391ad last_write_checksum: sha1:cf65a2c96e303858d4cf70e07d4c44d3f1c1db38 @@ -3774,8 +3838,8 @@ trackedFiles: pristine_git_object: e527bac45070946dfbec01fd843f71a744eb0cf8 indexingdatasources.go: id: ce0d6b0e3978 - last_write_checksum: sha1:84e48231e9936227b52e28ab98a5d1bc04878ef6 - pristine_git_object: 415a2d1131de2ebeffccdd65f26f4559b2afbee8 + last_write_checksum: sha1:7773061729e2f3fad8432e1ccc468e9e66a1f45b + pristine_git_object: 7ad5e303318c06554c2057660af1b1be535c46b7 indexingdocuments.go: id: 7d5a0edb352e last_write_checksum: sha1:400fcfa08e7cc3c0c804ba3336c29c3ff487b8bd @@ -4566,8 +4630,8 @@ trackedFiles: pristine_git_object: fd55eaa475b8f942a81f16790949f8c6b45dc20e models/components/dlpfindingfilter.go: id: 31a6847e3151 - last_write_checksum: sha1:1f87e94653b219009b45106315efabede152803c - pristine_git_object: 1188f37dc53c66a64b3f48836749e2bcae6bf301 + last_write_checksum: sha1:e4c89b1fe0cf96b46022759252ecebc1afb4c052 + pristine_git_object: c487437815edaf8e788d9e13a21ef2b586b05da4 models/components/dlpfrequency.go: id: 21b98c91992e last_write_checksum: sha1:ecef88cf1252a7ce689e03c6b6bd85fde6701b1a @@ -4598,8 +4662,8 @@ trackedFiles: pristine_git_object: 4f6f99a18d3ff622fba73c0a78b2ab7972cd961b models/components/dlpseverity.go: id: eb57e3d63bc4 - last_write_checksum: sha1:cf7821d83bcc5b14125a7bcdbecc112757bd0c8c - pristine_git_object: 25ba9d3cf84b4ef257c6fc2896fb4b6c964198c9 + last_write_checksum: sha1:3f264237304ea797cdb023020f779fa4a84df27e + pristine_git_object: 2fd56ade82ab6df16d2503f93a9087b5a0554121 models/components/dlpsimpleresult.go: id: ed072db63b90 last_write_checksum: sha1:1b8e884eb7f6185902e7ff51215caaa1baf0942f @@ -5336,6 +5400,34 @@ trackedFiles: id: ff5d88deb51b last_write_checksum: sha1:bf19b10d0c3a06060a7e7b53d239ca242e14dd2a pristine_git_object: c70f12b5a8c25b8eea7ec71cc0c85f7e099fb2bf + models/components/platformskill.go: + id: 3b83f267399a + last_write_checksum: sha1:79813bab4f800c69ff646440bf159bcb313b9b3c + pristine_git_object: b4dec8678af8499f7ce23c432d876009539cb543 + models/components/platformskillgetresponse.go: + id: 86b58b63e055 + last_write_checksum: sha1:41c82f75c9a8c429ab0b442ec8b201f7aabd581b + pristine_git_object: 76a2907a66cb48ab74a155fbc093adfda64cf57c + models/components/platformskillorigin.go: + id: fa87164c0c39 + last_write_checksum: sha1:4bbd57b85b9318d5fa9ea3ca97e26cab34e689fd + pristine_git_object: e0a004498154f0b4285d2d29dde3d0e27b163bb6 + models/components/platformskillslistresponse.go: + id: de5ae3de61d7 + last_write_checksum: sha1:dead111d978716b3e7a49db1188239a31cda405c + pristine_git_object: 3fd760ac8fe6d0c187c619c3a58126d447498329 + models/components/platformskillsourceprovenance.go: + id: 7e47a9ae686a + last_write_checksum: sha1:23ea2ee6399d336e99984816805d3fe491be50d6 + pristine_git_object: 650f7afe9af9948f61446c01d5168ec4f4901c16 + models/components/platformskillstatus.go: + id: 1fa7daee9a52 + last_write_checksum: sha1:3f5a7d9dbd27108b2788a8a660a3b357b8e1c7b7 + pristine_git_object: 78b9bc62466fa3d55d1a6a01ad621ff7e3f71740 + models/components/platformskillsyncstatus.go: + id: b58f34432b9f + last_write_checksum: sha1:890f2323825ded5cf09da513d5f8d31c0e2d1472 + pristine_git_object: 5396a955fc1e5c467149a7536f6b5dedc1797627 models/components/platformtimerange.go: id: f0d79b3ada90 last_write_checksum: sha1:736cbfaac97901328f8d421406492a94be6ce71c @@ -5674,8 +5766,8 @@ trackedFiles: pristine_git_object: a1dc22ea354cb4fc593878d90f724e7db40a5ee2 models/components/toolmetadata.go: id: bd86fa2d74d6 - last_write_checksum: sha1:6b40595e506874ce55ec5e534ba43eaeff077b94 - pristine_git_object: 7033e2fc29975798f99e6772c5437d4f4aeab1cc + last_write_checksum: sha1:e9eb31b6687bf1c69f5666bc62b8d59c4b301a80 + pristine_git_object: ee48ef71127655438f9224b703d26fb3fe515403 models/components/toolparameter.go: id: 46b9f903cbf5 last_write_checksum: sha1:d0fb7e0d7e895e8a229a5df42d6322b129137802 @@ -5842,8 +5934,8 @@ trackedFiles: pristine_git_object: 0cbacdae56f7ffdbcc52ee097144428b121b8fbc models/components/workflow.go: id: a4551549e107 - last_write_checksum: sha1:a7acb23dcbc957f06140d49fa595f905cbf05366 - pristine_git_object: 16c922a02f071c828e4278896089d5725c165742 + last_write_checksum: sha1:ff386db5d31c864e727af550365ddcb157b60c85 + pristine_git_object: ca8ff009fbf69c1369014e111750922293041fca models/components/workflowfeedbackinfo.go: id: b79e4c51cab0 last_write_checksum: sha1:e07ac6f363c804aac890c59603988d5c60ab185b @@ -6196,6 +6288,14 @@ trackedFiles: id: 875844d95a55 last_write_checksum: sha1:3582ce5977fb23592979ddf1c59d85d14075fa46 pristine_git_object: 8718a747925ff5a4e74302ddca26810b8bba5241 + models/operations/platformskillsget.go: + id: f2d9d9b1237e + last_write_checksum: sha1:f0ac0d795a8eeb2217e19baa67243386f6e6da45 + pristine_git_object: bb8b938840bd8cd8ae3f0334e2e4a3e04217e44f + models/operations/platformskillslist.go: + id: c7324bad43ea + last_write_checksum: sha1:f95f57643e407c5d86d16e9e330fee0bf9ad2613 + pristine_git_object: b004ed194f507b7d723dce51adccc90a35e41009 models/operations/postapiindexv1adddatasource.go: id: 50ff52426165 last_write_checksum: sha1:c14aac3a71bfaeca68789cbc3ecf8c64639a161d @@ -6348,6 +6448,10 @@ trackedFiles: id: c5c3dec204db last_write_checksum: sha1:8f0992118d0dd36786ad4e0a080b5cf4e20299f4 pristine_git_object: bac92a3ec2c9b3d5ca1feaf484288a982e124444 + models/operations/postrestapiindexsubmissionsdatasourceinstancetype.go: + id: c1515d3ecf7c + last_write_checksum: sha1:5796d95fe190860c8d1da00107ad3f292829bfbe + pristine_git_object: b005b502862f29f5d55be93c8c3511c8c502701f models/operations/postrestapiv1toolscall.go: id: 825492a9ffcc last_write_checksum: sha1:6b7fc2978ba5f6ae8eb7cefcaff9740ecae74de8 @@ -6448,6 +6552,10 @@ trackedFiles: id: 4c057402d2bf last_write_checksum: sha1:a5737cd0c6d9dfcf7cd5d9cd126fc1f330926b7c pristine_git_object: 32fa4d06b5561a9ae06eb0d9c594c6da076a3b64 + skills.go: + id: 65ecddcd9ce6 + last_write_checksum: sha1:92b27b7ab8639a8e73e9977c8f98ba335e331236 + pristine_git_object: b42d6f31272a92c7d440bcb4448ec665d2c991dc tests/activities_test.go: id: 93b3ec0f226c last_write_checksum: sha1:d8e9f9a0d877a8e7d4277c174581d44633e1b8ec @@ -6540,6 +6648,10 @@ trackedFiles: id: 21b8c3505380 last_write_checksum: sha1:4effacede99617d2307be533f162092e97d6b0b5 pristine_git_object: 475357347a76845923f24888e17e658671e6a056 + tests/indexingdatasources_test.go: + id: 9ad8a1618608 + last_write_checksum: sha1:c7dde884565fdca8d32e2aa1bc79bbe59569c5f4 + pristine_git_object: 2bb4402178940a769850838dd21ab52c45fa8795 tests/indexingdocuments_test.go: id: e095d7949cf3 last_write_checksum: sha1:0c55f644fe8e620d489ac3cd75f3556dcbecde09 @@ -6554,8 +6666,8 @@ trackedFiles: pristine_git_object: 6d9cbca42012c2760de3ecaf4f569c53d32197da tests/messages_test.go: id: 3433c956b7a3 - last_write_checksum: sha1:63e7b1c9a68b43467855286635a88cb166b2bc79 - pristine_git_object: febdc0e8a34b769bfc6dcfe3a9e33053b2267433 + last_write_checksum: sha1:352ecfa3a01795bbe7fad9b0202c4ccaa02448c3 + pristine_git_object: 64ef64fe1c0ccbc223987d87ddddf3d6e2de7799 tests/mockserver/.gitignore: id: 7705eb663274 last_write_checksum: sha1:228e1b05712a973948fd771323a2140a3b355ff4 @@ -6610,8 +6722,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:5ed54a303ffae27d013453156fd2c4de84ba56e6 + pristine_git_object: 4ef1a950c740170300f1bf9b56c120112a701caa tests/mockserver/internal/handler/pathdeleterestapiindexcustommetadataschemagroupname.go: id: 979e4583765b last_write_checksum: sha1:b1d4edb259d907c7a88b634bf16f0cf152321693 @@ -6628,6 +6740,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 @@ -6796,6 +6916,10 @@ trackedFiles: id: 53e6a34b5b4b last_write_checksum: sha1:503df322e00b6cb1cb9cc80d7aa30d63c96df86f pristine_git_object: 1575aab3ac4539db059de358acc56ecc7f90ff07 + tests/mockserver/internal/handler/pathpostrestapiindexsubmissionsdatasourceinstancetype.go: + id: 1a5daf7874ce + last_write_checksum: sha1:b5b37f0b5a7b4d9a4c69ab523e831f1702301118 + pristine_git_object: d4978bcc8073b6491879e4a27b30ccefbcb89272 tests/mockserver/internal/handler/pathpostrestapiv1actionsactionpackactionpackidauth.go: id: 9aaa5b8c2f43 last_write_checksum: sha1:6e74488c94c9f19f95861e6b5940457c55078190 @@ -6918,8 +7042,8 @@ trackedFiles: pristine_git_object: abb763ddc8504b28c0cb6fdf8d25237d46e21bab tests/mockserver/internal/handler/pathpostrestapiv1getchat.go: id: a0ec7bafa599 - last_write_checksum: sha1:2267292ba8173cf8df70ddbc6ac02ff3439cb879 - pristine_git_object: 8740195860b6c08e036caae19aab8e7374350960 + last_write_checksum: sha1:b48e2313407814ee4f8ed181b8e5299a84960c44 + pristine_git_object: 96d4127e0455272a9842e2d1954e5fcefa3278cc tests/mockserver/internal/handler/pathpostrestapiv1getchatapplication.go: id: 7d101c69d4bc last_write_checksum: sha1:7b81898137fdb3a89b4dcfa318b9b5b92e8860c0 @@ -7766,8 +7890,8 @@ trackedFiles: pristine_git_object: 77fdbe9636ede5978c6c82e5a54e2d0c062a99b0 tests/mockserver/internal/sdk/models/components/dlpfindingfilter.go: id: a7d6016908e6 - last_write_checksum: sha1:3a7776befd51d54ad43802b3e808bed01f7ceb31 - pristine_git_object: f04989270a40d3385eafd74542aef8a5ab2dd3d0 + last_write_checksum: sha1:6e04b0a334b6e59d6065a786ca40d540ed53debe + pristine_git_object: f3b7f96f3bda79e3fa8c1d480a62ebabd76cf4c7 tests/mockserver/internal/sdk/models/components/dlpfrequency.go: id: 0e58077c7ce5 last_write_checksum: sha1:a43530a5536fc8d7e9e059f9256acb659e57f636 @@ -7798,8 +7922,8 @@ trackedFiles: pristine_git_object: 6c4ea46f5822a3783a2349fc90b37b0659a0a647 tests/mockserver/internal/sdk/models/components/dlpseverity.go: id: 6226aa236cbd - last_write_checksum: sha1:e04497e3bb7699f8686daee91fd4a37f9a646ceb - pristine_git_object: a0c021992d357a7e1b9573aa6f497cf6ce27a497 + last_write_checksum: sha1:6794db59c95551021133f24bd0ce1dd52050c0f5 + pristine_git_object: aac78928c01f6a9a1d468e181c8fd585e53ab42f tests/mockserver/internal/sdk/models/components/dlpsimpleresult.go: id: 9c8ef716150c last_write_checksum: sha1:7e58ca80e00935371b714da76574b40b5502660e @@ -8536,6 +8660,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 @@ -8874,8 +9026,8 @@ trackedFiles: pristine_git_object: dea3298b26e324de06316da296f7a4d899dd475d tests/mockserver/internal/sdk/models/components/toolmetadata.go: id: 2777b3aa0636 - last_write_checksum: sha1:4487cdc2b5b1dc1a2fa1a3ca7d46188bfc0e211c - pristine_git_object: 3c803a6d3c1c80f7f1e230a843a8c3f1c1186dfe + last_write_checksum: sha1:97ddaa6e15c52ec37c4ea46e933f7ec5d4ca7bca + pristine_git_object: 061df30afb35d8282910bd66ddd76838607ea7ab tests/mockserver/internal/sdk/models/components/toolparameter.go: id: d02a0b83b357 last_write_checksum: sha1:66a7a1e6154a3c42741d575291f358116f017c87 @@ -9042,8 +9194,8 @@ trackedFiles: pristine_git_object: 5abdc47f9b8f109ea08ac7b1dc963379d880bef2 tests/mockserver/internal/sdk/models/components/workflow.go: id: 229cbc0e7f6f - last_write_checksum: sha1:9e63f3b61d31a98f5357f4be62804379f37cfec5 - pristine_git_object: dfe489b8d49bfad25fcd11bed21af8c75b34ea6f + last_write_checksum: sha1:d341832b97426683942df2564e76029d6f53db8d + pristine_git_object: 47aa9d245a4cc99101e6323f93e53ca934f820c1 tests/mockserver/internal/sdk/models/components/workflowfeedbackinfo.go: id: 3350baa380bd last_write_checksum: sha1:6723c2b80df391bab5e91b8ac23f9ca4938665f7 @@ -9392,6 +9544,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 @@ -9544,6 +9704,10 @@ trackedFiles: id: 050d90bfef03 last_write_checksum: sha1:ed4651d4860935aaf0e344aeb9bbffb1365b8db7 pristine_git_object: cc5dbf54dc3c27fb7c8deae58311079a11510827 + tests/mockserver/internal/sdk/models/operations/postrestapiindexsubmissionsdatasourceinstancetype.go: + id: 93b21d4811cb + last_write_checksum: sha1:4c19c046232b28b4690f580188874df776fe9710 + pristine_git_object: f18b0916913896d0028d84c699c07fdcbd88ad90 tests/mockserver/internal/sdk/models/operations/postrestapiv1toolscall.go: id: 2cb295dd1782 last_write_checksum: sha1:a598e25aef310bd7c8c7c37987899e6f88e918f9 @@ -9732,10 +9896,14 @@ trackedFiles: id: 2ec51916e3e4 last_write_checksum: sha1:75e97d28b0ad3c777774ab5cc211fc0c97394968 pristine_git_object: 245e79dbdefc57ffcf8d2282e3f80bd581fdcda2 + tests/skills_test.go: + id: 67834dec1608 + last_write_checksum: sha1:c826d203ca43b9d16db01962146639976c371fc5 + pristine_git_object: 5b060bc5bc09e55ba581e221d81c3aed658f8987 tests/summarize_test.go: id: 1b63b0a16e69 - last_write_checksum: sha1:4e661ba3ca605bf350ae9afbecb86a268efed456 - pristine_git_object: 4474f69b10e0c4f6741ed3eca7df59f18a9038b7 + last_write_checksum: sha1:1ee326a69be155dde0572bd9a291c217c10a8467 + pristine_git_object: a4bc656a62b6499de9c23b689d10bab44e366abe tests/testclient.go: id: 78d36c6e169c last_write_checksum: sha1:507c44e437934fbff8d295201c1327e18bd00df8 @@ -10784,6 +10952,42 @@ 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"}]} + post_/rest/api/index/submissions/{datasourceInstance}/{type}: + speakeasy-default-post-/rest/api/index/submissions/{datasource-instance}/{type}: + parameters: + path: + datasourceInstance: "" + type: "" + requestBody: + application/json: {"key": "", "key1": "", "key2": ""} + responses: + "202": + application/json: {"requestId": ""} + "400": + application/json: {"error": ""} + "500": + application/json: {"error": ""} examplesVersion: 1.0.2 generatedTests: activity: "2025-04-29T16:18:24+01:00" @@ -10951,7 +11155,10 @@ generatedTests: platform-search: "2026-07-02T17:50:54Z" getToolServerAuthStatus: "2026-07-08T02:15:48Z" authorizeToolServer: "2026-07-08T02:15:48Z" -releaseNotes: "## Go SDK Changes:\n* `Glean.Client.Chat.Create()`: \n * `request.ChatRequest.Messages[].Fragments[]` **Changed**\n * `response.Messages[].Fragments[]` **Changed**\n* `Glean.Client.Chat.Retrieve()`: `response.ChatResult.Chat.Messages[].Fragments[]` **Changed**\n* `Glean.Client.Chat.CreateStream()`: \n * `request.ChatRequest.Messages[].Fragments[]` **Changed**\n" + platform-skills-list: "2026-07-17T02:14:19Z" + platform-skills-get: "2026-07-17T02:14:19Z" + post_/rest/api/index/submissions/{datasourceInstance}/{type}: "2026-07-17T02:14:19Z" +releaseNotes: "## Go SDK Changes:\n* `Glean.Skills.List()`: **Added**\n* `Glean.Skills.Retrieve()`: **Added**\n* `Glean.Indexing.Datasources.Submit()`: **Added**\n* `Glean.Client.Chat.Create()`: \n * `request.ChatRequest.Messages[].Fragments[].Action.Metadata.ActionTypeSource` **Added**\n * `response.Messages[].Fragments[].Action.Metadata.ActionTypeSource` **Added**\n* `Glean.Client.Chat.Retrieve()`: `response.ChatResult.Chat.Messages[].Fragments[].Action.Metadata.ActionTypeSource` **Added**\n* `Glean.Client.Chat.CreateStream()`: \n * `request.ChatRequest.Messages[].Fragments[].Action.Metadata.ActionTypeSource` **Added**\n* `Glean.Client.Agents.Create()`: `response.Workflow.WebhookUrl` **Added**\n* `Glean.Client.Search.RetrieveFeed()`: `response.Results[].PrimaryEntry.Workflow.Workflow.WebhookUrl` **Added**\n* `Glean.Client.Governance.Data.Findings.Create()`: \n * `request.Request.Filter.Severity.Enum(falsePositive)` **Added**\n * `response.Filter.Severity.Enum(falsePositive)` **Added**\n* `Glean.Client.Governance.Data.Findings.List()`: `response.Exports[].Filter.Severity.Enum(falsePositive)` **Added**\n" generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 9bb0da5b..f966ea54 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true go: - version: 0.13.3 + version: 0.13.4 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false baseErrorName: GleanError diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index a1f493a7..e20f1266 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: d12349c4951fe43caa94a15fb11bee729e26325a + x-open-api-commit-sha: 54e1ec01bccde12b9c12ad8bd4ae5adac11a2fa5 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: 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: skills + x-speakeasy-name-override: retrieve + security: + - APIToken: [] /api/search: post: tags: @@ -4177,6 +4279,69 @@ paths: x-beta: true x-speakeasy-group: indexing.documents x-speakeasy-name-override: debugEvents + /rest/api/index/submissions/{datasourceInstance}/{type}: + post: + summary: Submit datasource data + description: Validates and asynchronously processes a datasource-specific submission. + tags: + - Datasources + security: + - APIToken: [] + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: true + required: true + x-exportParamName: SubmissionRequest + responses: + "202": + description: Accepted + content: + application/json: + schema: + type: object + properties: + requestId: + type: string + required: + - requestId + "400": + $ref: '#/components/responses/BadRequestError' + "401": + $ref: '#/components/responses/UnauthorizedError' + "404": + $ref: '#/components/responses/NotFoundError' + "405": + description: Method Not Allowed + "413": + description: Payload Too Large + "500": + $ref: '#/components/responses/InternalServerError' + "503": + description: Service Unavailable + x-speakeasy-name-override: submit + x-speakeasy-group: indexing.datasources + servers: + - url: https://{instance}-be.glean.com + variables: + instance: + default: instance-name + description: The instance name (typically the email domain without the TLD) that determines the deployment backend. + parameters: + - name: datasourceInstance + in: path + description: Datasource instance that should process the submission + required: true + schema: + type: string + - name: type + in: path + description: Submission type registered for the datasource + required: true + schema: + type: string /rest/api/index/document/{docId}/custom-metadata/{groupName}: put: summary: Add or update custom metadata @@ -5479,6 +5644,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 +5876,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: @@ -9635,6 +9920,22 @@ components: - EXECUTION - MCP description: Valid only for write actions. Represents the type of write action. REDIRECT - The client renders the URL which contains information for carrying out the action. EXECUTION - Send a request to an external server and execute the action. MCP - Send a tools/call request to an MCP server to execute the action. + actionTypeSource: + type: string + enum: + - MCP_ANNOTATION + - ADMIN_OVERRIDE + - NONE + - NATIVE_TOOL_DEFINITION + description: | + Analytics-only signal (product snapshot) describing WHERE the action's + read/write determination came from. Complementary to the effective + read/write value (the tool's ToolType, which drives HITL): the value says + read-or-write, this says how confident that is. MCP_ANNOTATION = from the + tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it; + NONE = no usable hint (the effective value then defaults to write); + NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived). + Does not affect runtime behavior. authType: type: string enum: @@ -10223,6 +10524,11 @@ components: type: boolean description: When true, displays organization name instead of author name in agent card. Set via the dedicated admin settings endpoint, not by regular edits. readOnly: true + webhookUrl: + type: string + description: | + For a CUSTOM_WEBHOOK-triggered agent, the full inbound webhook URL (.../webhooks/custom/) minted for the agent. Empty for other trigger types. + readOnly: true WorkflowResult: type: object properties: @@ -15753,7 +16059,8 @@ components: - LOW - MEDIUM - HIGH - description: Severity levels for DLP findings and analyses. + - FALSE_POSITIVE + description: Severity levels for DLP findings and analyses. FALSE_POSITIVE ranks below LOW and marks analyses that concluded every flagged entity is a detector false positive. x-include-enum-class-prefix: true DlpIssueStatus: type: string diff --git a/.speakeasy/tests.arazzo.yaml b/.speakeasy/tests.arazzo.yaml index ffba480f..a0bc501c 100644 --- a/.speakeasy/tests.arazzo.yaml +++ b/.speakeasy/tests.arazzo.yaml @@ -164714,3 +164714,59 @@ 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 + - workflowId: post_/rest/api/index/submissions/{datasourceInstance}/{type} + steps: + - stepId: test + operationId: post_/rest/api/index/submissions/{datasourceInstance}/{type} + parameters: + - name: datasourceInstance + in: path + value: + - name: type + in: path + value: + requestBody: + contentType: application/json + payload: + key: + key1: + key2: + successCriteria: + - condition: $statusCode == 202 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"requestId":""} + type: simple + x-speakeasy-test-group: indexing_datasources + x-speakeasy-test-rebuild: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index b21e544d..0f8c1b61 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.789.2 +speakeasyVersion: 1.790.2 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:145236c33451e6e87cf1507a4d8829678b0df02af59afc9341330627e33ed760 - sourceBlobDigest: sha256:862b1370a65d146eac83f86c6fbd2d787f04ea93c2cf28259af5ded934f9fb3b + sourceRevisionDigest: sha256:c813e8166b3360c1020b84897e7ccb075d86f1384433201e34bba13abcbb3efb + sourceBlobDigest: sha256:9f1eaa79f59fcfc4cb53102efcd3a45f7400127e3fb05ff9fed657c593a35e1f tags: - latest petstore-oas: @@ -17,10 +17,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:145236c33451e6e87cf1507a4d8829678b0df02af59afc9341330627e33ed760 - sourceBlobDigest: sha256:862b1370a65d146eac83f86c6fbd2d787f04ea93c2cf28259af5ded934f9fb3b + sourceRevisionDigest: sha256:c813e8166b3360c1020b84897e7ccb075d86f1384433201e34bba13abcbb3efb + sourceBlobDigest: sha256:9f1eaa79f59fcfc4cb53102efcd3a45f7400127e3fb05ff9fed657c593a35e1f codeSamplesNamespace: glean-api-specs-go-code-samples - codeSamplesRevisionDigest: sha256:90941ca05c5c8e8a7acfa165b3674411f1c712692e4e071afecb72791b282a07 + codeSamplesRevisionDigest: sha256:b60c909c808d27952d8d8b664836f4e2ce104af37b12583d8e4c4fac8a01db90 petstore: source: petstore-oas sourceNamespace: petstore-oas diff --git a/README.md b/README.md index 40bd7650..573e7304 100644 --- a/README.md +++ b/README.md @@ -407,6 +407,7 @@ For more information on obtaining the appropriate token type, please contact you * [Add](docs/sdks/indexingdatasources/README.md#add) - Add or update datasource * [RetrieveConfig](docs/sdks/indexingdatasources/README.md#retrieveconfig) - Get datasource config +* [Submit](docs/sdks/indexingdatasources/README.md#submit) - Submit datasource data ### [Indexing.Documents](docs/sdks/indexingdocuments/README.md) @@ -462,6 +463,11 @@ For more information on obtaining the appropriate token type, please contact you * [Query](docs/sdks/search/README.md#query) - Search +### [Skills](docs/sdks/skills/README.md) + +* [List](docs/sdks/skills/README.md#list) - List skills +* [Retrieve](docs/sdks/skills/README.md#retrieve) - Retrieve skill + @@ -714,7 +720,6 @@ package main import ( "context" apiclientgo "github.com/gleanwork/api-client-go" - "github.com/gleanwork/api-client-go/models/components" "github.com/gleanwork/api-client-go/models/operations" "log" "os" @@ -727,13 +732,15 @@ func main() { apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")), ) - res, err := s.Indexing.CustomMetadata.Upsert(ctx, "", "", components.CustomMetadataPutRequest{ - CustomMetadata: []components.CustomProperty{}, + res, err := s.Indexing.Datasources.Submit(ctx, "", "", map[string]any{ + "key": "", + "key1": "", + "key2": "", }, operations.WithServerURL("https://instance-name-be.glean.com")) if err != nil { log.Fatal(err) } - if res.SuccessResponse != nil { + if res.Object != nil { // handle response } } diff --git a/RELEASES.md b/RELEASES.md index ee34ffff..30414b87 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -798,4 +798,14 @@ Based on: ### Generated - [go v0.13.3] . ### Releases -- [Go v0.13.3] https://github.com/gleanwork/api-client-go/releases/tag/v0.13.3 - . \ No newline at end of file +- [Go v0.13.3] https://github.com/gleanwork/api-client-go/releases/tag/v0.13.3 - . + +## 2026-07-17 02:11:42 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.790.2 (2.918.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.13.4] . +### Releases +- [Go v0.13.4] https://github.com/gleanwork/api-client-go/releases/tag/v0.13.4 - . \ No newline at end of file diff --git a/docs/models/components/actiontypesource.md b/docs/models/components/actiontypesource.md new file mode 100644 index 00000000..8ddec100 --- /dev/null +++ b/docs/models/components/actiontypesource.md @@ -0,0 +1,34 @@ +# ActionTypeSource + +Analytics-only signal (product snapshot) describing WHERE the action's +read/write determination came from. Complementary to the effective +read/write value (the tool's ToolType, which drives HITL): the value says +read-or-write, this says how confident that is. MCP_ANNOTATION = from the +tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it; +NONE = no usable hint (the effective value then defaults to write); +NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived). +Does not affect runtime behavior. + + +## Example Usage + +```go +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +value := components.ActionTypeSourceMcpAnnotation + +// Open enum: custom values can be created with a direct type cast +custom := components.ActionTypeSource("custom_value") +``` + + +## Values + +| Name | Value | +| -------------------------------------- | -------------------------------------- | +| `ActionTypeSourceMcpAnnotation` | MCP_ANNOTATION | +| `ActionTypeSourceAdminOverride` | ADMIN_OVERRIDE | +| `ActionTypeSourceNone` | NONE | +| `ActionTypeSourceNativeToolDefinition` | NATIVE_TOOL_DEFINITION | \ No newline at end of file diff --git a/docs/models/components/dlpfindingfilter.md b/docs/models/components/dlpfindingfilter.md index bc10cf34..6fdb36c7 100644 --- a/docs/models/components/dlpfindingfilter.md +++ b/docs/models/components/dlpfindingfilter.md @@ -3,16 +3,16 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `InfoType` | `*string` | :heavy_minus_sign: | N/A | -| `RegexID` | `*string` | :heavy_minus_sign: | N/A | -| `ReportID` | `*string` | :heavy_minus_sign: | N/A | -| `Datasource` | `*string` | :heavy_minus_sign: | N/A | -| `Visibility` | `*string` | :heavy_minus_sign: | N/A | -| `DocumentIds` | []`string` | :heavy_minus_sign: | N/A | -| `Severity` | [*components.DlpSeverity](../../models/components/dlpseverity.md) | :heavy_minus_sign: | Severity levels for DLP findings and analyses. | -| `DocumentSeverity` | [][components.DlpSeverity](../../models/components/dlpseverity.md) | :heavy_minus_sign: | N/A | -| `Statuses` | [][components.DlpIssueStatus](../../models/components/dlpissuestatus.md) | :heavy_minus_sign: | N/A | -| `TimeRange` | [*components.TimeRangeFilter](../../models/components/timerangefilter.md) | :heavy_minus_sign: | N/A | -| `Archived` | `*bool` | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `InfoType` | `*string` | :heavy_minus_sign: | N/A | +| `RegexID` | `*string` | :heavy_minus_sign: | N/A | +| `ReportID` | `*string` | :heavy_minus_sign: | N/A | +| `Datasource` | `*string` | :heavy_minus_sign: | N/A | +| `Visibility` | `*string` | :heavy_minus_sign: | N/A | +| `DocumentIds` | []`string` | :heavy_minus_sign: | N/A | +| `Severity` | [*components.DlpSeverity](../../models/components/dlpseverity.md) | :heavy_minus_sign: | Severity levels for DLP findings and analyses. FALSE_POSITIVE ranks below LOW and marks analyses that concluded every flagged entity is a detector false positive. | +| `DocumentSeverity` | [][components.DlpSeverity](../../models/components/dlpseverity.md) | :heavy_minus_sign: | N/A | +| `Statuses` | [][components.DlpIssueStatus](../../models/components/dlpissuestatus.md) | :heavy_minus_sign: | N/A | +| `TimeRange` | [*components.TimeRangeFilter](../../models/components/timerangefilter.md) | :heavy_minus_sign: | N/A | +| `Archived` | `*bool` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/dlpseverity.md b/docs/models/components/dlpseverity.md index 7f91823d..895f1ad3 100644 --- a/docs/models/components/dlpseverity.md +++ b/docs/models/components/dlpseverity.md @@ -1,6 +1,6 @@ # DlpSeverity -Severity levels for DLP findings and analyses. +Severity levels for DLP findings and analyses. FALSE_POSITIVE ranks below LOW and marks analyses that concluded every flagged entity is a detector false positive. ## Example Usage @@ -18,9 +18,10 @@ custom := components.DlpSeverity("custom_value") ## Values -| Name | Value | -| ------------------------ | ------------------------ | -| `DlpSeverityUnspecified` | UNSPECIFIED | -| `DlpSeverityLow` | LOW | -| `DlpSeverityMedium` | MEDIUM | -| `DlpSeverityHigh` | HIGH | \ No newline at end of file +| Name | Value | +| -------------------------- | -------------------------- | +| `DlpSeverityUnspecified` | UNSPECIFIED | +| `DlpSeverityLow` | LOW | +| `DlpSeverityMedium` | MEDIUM | +| `DlpSeverityHigh` | HIGH | +| `DlpSeverityFalsePositive` | FALSE_POSITIVE | \ No newline at end of file diff --git a/docs/models/components/platformskill.md b/docs/models/components/platformskill.md new file mode 100644 index 00000000..28d865f0 --- /dev/null +++ b/docs/models/components/platformskill.md @@ -0,0 +1,18 @@ +# PlatformSkill + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | Glean skill ID. | +| `DisplayName` | `string` | :heavy_check_mark: | Human-readable skill name. | +| `Description` | `string` | :heavy_check_mark: | Human-readable skill description. | +| `LatestVersion` | `int64` | :heavy_check_mark: | Latest major version number for the skill. | +| `LatestMinorVersion` | `int64` | :heavy_check_mark: | Latest minor version number for the skill. | +| `Status` | [components.PlatformSkillStatus](../../models/components/platformskillstatus.md) | :heavy_check_mark: | Current skill status. | +| `Origin` | [components.PlatformSkillOrigin](../../models/components/platformskillorigin.md) | :heavy_check_mark: | Source category for the skill. | +| `SourceProvenance` | [*components.PlatformSkillSourceProvenance](../../models/components/platformskillsourceprovenance.md) | :heavy_minus_sign: | N/A | +| `Owner` | [components.PlatformPersonReference](../../models/components/platformpersonreference.md) | :heavy_check_mark: | A lightweight reference to a person, used where a payload merely points at someone. | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | Time the skill was created. | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | Time the skill was last updated. | \ No newline at end of file diff --git a/docs/models/components/platformskillgetresponse.md b/docs/models/components/platformskillgetresponse.md new file mode 100644 index 00000000..f39ce31f --- /dev/null +++ b/docs/models/components/platformskillgetresponse.md @@ -0,0 +1,9 @@ +# PlatformSkillGetResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `Skill` | [components.PlatformSkill](../../models/components/platformskill.md) | :heavy_check_mark: | N/A | +| `RequestID` | `string` | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/components/platformskillorigin.md b/docs/models/components/platformskillorigin.md new file mode 100644 index 00000000..898011b4 --- /dev/null +++ b/docs/models/components/platformskillorigin.md @@ -0,0 +1,20 @@ +# PlatformSkillOrigin + +Source category for the skill. + +## Example Usage + +```go +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +value := components.PlatformSkillOriginCustom +``` + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `PlatformSkillOriginCustom` | CUSTOM | \ No newline at end of file diff --git a/docs/models/components/platformskillslistresponse.md b/docs/models/components/platformskillslistresponse.md new file mode 100644 index 00000000..3e7bca2c --- /dev/null +++ b/docs/models/components/platformskillslistresponse.md @@ -0,0 +1,11 @@ +# PlatformSkillsListResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `Skills` | [][components.PlatformSkill](../../models/components/platformskill.md) | :heavy_check_mark: | Skills available to the user. | +| `HasMore` | `bool` | :heavy_check_mark: | Whether additional results are available. | +| `NextCursor` | `*string` | :heavy_check_mark: | Cursor for the next page, or null when no more results are available. | +| `RequestID` | `string` | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/components/platformskillsourceprovenance.md b/docs/models/components/platformskillsourceprovenance.md new file mode 100644 index 00000000..c9c901dd --- /dev/null +++ b/docs/models/components/platformskillsourceprovenance.md @@ -0,0 +1,13 @@ +# PlatformSkillSourceProvenance + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `SourceURL` | `*string` | :heavy_minus_sign: | URL of the external source the skill was imported from. | +| `CommitSha` | `*string` | :heavy_minus_sign: | Source commit SHA for the imported skill. | +| `ImportedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | Time the skill was imported. | +| `LastSyncedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | Time the skill was last synced from its source. | +| `SyncStatus` | [*components.PlatformSkillSyncStatus](../../models/components/platformskillsyncstatus.md) | :heavy_minus_sign: | Current external-source sync status. | +| `SyncError` | `*string` | :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/components/platformskillstatus.md b/docs/models/components/platformskillstatus.md new file mode 100644 index 00000000..0eb8f54e --- /dev/null +++ b/docs/models/components/platformskillstatus.md @@ -0,0 +1,25 @@ +# PlatformSkillStatus + +Current skill status. + +## Example Usage + +```go +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +value := components.PlatformSkillStatusDraft + +// Open enum: custom values can be created with a direct type cast +custom := components.PlatformSkillStatus("custom_value") +``` + + +## Values + +| Name | Value | +| ----------------------------- | ----------------------------- | +| `PlatformSkillStatusDraft` | DRAFT | +| `PlatformSkillStatusEnabled` | ENABLED | +| `PlatformSkillStatusDisabled` | DISABLED | \ No newline at end of file diff --git a/docs/models/components/platformskillsyncstatus.md b/docs/models/components/platformskillsyncstatus.md new file mode 100644 index 00000000..0b0a0c1f --- /dev/null +++ b/docs/models/components/platformskillsyncstatus.md @@ -0,0 +1,25 @@ +# PlatformSkillSyncStatus + +Current external-source sync status. + +## Example Usage + +```go +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +value := components.PlatformSkillSyncStatusUpToDate + +// Open enum: custom values can be created with a direct type cast +custom := components.PlatformSkillSyncStatus("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------------------- | ---------------------------------------- | +| `PlatformSkillSyncStatusUpToDate` | UP_TO_DATE | +| `PlatformSkillSyncStatusUpdateAvailable` | UPDATE_AVAILABLE | +| `PlatformSkillSyncStatusSyncFailed` | SYNC_FAILED | \ No newline at end of file diff --git a/docs/models/components/toolmetadata.md b/docs/models/components/toolmetadata.md index 0eb177c9..feadc76e 100644 --- a/docs/models/components/toolmetadata.md +++ b/docs/models/components/toolmetadata.md @@ -5,23 +5,24 @@ The manifest for a tool that can be used to augment Glean Assistant. ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Type` | [components.ToolMetadataType](../../models/components/toolmetadatatype.md) | :heavy_check_mark: | The type of tool. | | -| `Name` | `string` | :heavy_check_mark: | Unique identifier for the tool. Name should be understandable by the LLM, and will be used to invoke a tool. | | -| `DisplayName` | `string` | :heavy_check_mark: | Human understandable name of the tool. Max 50 characters. | | -| `ToolID` | `*string` | :heavy_minus_sign: | An opaque id which is unique identifier for the tool. | | -| `DisplayDescription` | `string` | :heavy_check_mark: | Description of the tool meant for a human. | | -| `LogoURL` | `*string` | :heavy_minus_sign: | URL used to fetch the logo. | | -| `ObjectName` | `*string` | :heavy_minus_sign: | Name of the generated object. This will be used to indicate to the end user what the generated object contains. | [
"HR ticket",
"Email",
"Chat message"
] | -| `KnowledgeType` | [*components.KnowledgeType](../../models/components/knowledgetype.md) | :heavy_minus_sign: | Indicates the kind of knowledge a tool would access or modify. | | -| `CreatedBy` | [*components.PersonObject](../../models/components/personobject.md) | :heavy_minus_sign: | N/A | | -| `LastUpdatedBy` | [*components.PersonObject](../../models/components/personobject.md) | :heavy_minus_sign: | N/A | | -| `CreatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | The time the tool was created in ISO format (ISO 8601) | | -| `LastUpdatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | The time the tool was last updated in ISO format (ISO 8601) | | -| `WriteActionType` | [*components.WriteActionType](../../models/components/writeactiontype.md) | :heavy_minus_sign: | Valid only for write actions. Represents the type of write action. REDIRECT - The client renders the URL which contains information for carrying out the action. EXECUTION - Send a request to an external server and execute the action. MCP - Send a tools/call request to an MCP server to execute the action. | | -| `AuthType` | [*components.AuthType](../../models/components/authtype.md) | :heavy_minus_sign: | The type of authentication being used.
Use 'OAUTH_*' when Glean calls an external API (e.g., Jira) on behalf of a user to obtain an OAuth token.
'OAUTH_ADMIN' utilizes an admin token for external API calls on behalf all users.
'OAUTH_USER' uses individual user tokens for external API calls.
'DWD' refers to domain wide delegation.
| | -| `Auth` | [*components.AuthConfig](../../models/components/authconfig.md) | :heavy_minus_sign: | Config for tool's authentication method. | | -| `Permissions` | [*components.ObjectPermissions](../../models/components/objectpermissions.md) | :heavy_minus_sign: | N/A | | -| `UsageInstructions` | `*string` | :heavy_minus_sign: | Usage instructions for the LLM to use this action. | | -| `IsSetupFinished` | `*bool` | :heavy_minus_sign: | Whether this action has been fully configured and validated. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Type` | [components.ToolMetadataType](../../models/components/toolmetadatatype.md) | :heavy_check_mark: | The type of tool. | | +| `Name` | `string` | :heavy_check_mark: | Unique identifier for the tool. Name should be understandable by the LLM, and will be used to invoke a tool. | | +| `DisplayName` | `string` | :heavy_check_mark: | Human understandable name of the tool. Max 50 characters. | | +| `ToolID` | `*string` | :heavy_minus_sign: | An opaque id which is unique identifier for the tool. | | +| `DisplayDescription` | `string` | :heavy_check_mark: | Description of the tool meant for a human. | | +| `LogoURL` | `*string` | :heavy_minus_sign: | URL used to fetch the logo. | | +| `ObjectName` | `*string` | :heavy_minus_sign: | Name of the generated object. This will be used to indicate to the end user what the generated object contains. | [
"HR ticket",
"Email",
"Chat message"
] | +| `KnowledgeType` | [*components.KnowledgeType](../../models/components/knowledgetype.md) | :heavy_minus_sign: | Indicates the kind of knowledge a tool would access or modify. | | +| `CreatedBy` | [*components.PersonObject](../../models/components/personobject.md) | :heavy_minus_sign: | N/A | | +| `LastUpdatedBy` | [*components.PersonObject](../../models/components/personobject.md) | :heavy_minus_sign: | N/A | | +| `CreatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | The time the tool was created in ISO format (ISO 8601) | | +| `LastUpdatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | The time the tool was last updated in ISO format (ISO 8601) | | +| `WriteActionType` | [*components.WriteActionType](../../models/components/writeactiontype.md) | :heavy_minus_sign: | Valid only for write actions. Represents the type of write action. REDIRECT - The client renders the URL which contains information for carrying out the action. EXECUTION - Send a request to an external server and execute the action. MCP - Send a tools/call request to an MCP server to execute the action. | | +| `ActionTypeSource` | [*components.ActionTypeSource](../../models/components/actiontypesource.md) | :heavy_minus_sign: | Analytics-only signal (product snapshot) describing WHERE the action's
read/write determination came from. Complementary to the effective
read/write value (the tool's ToolType, which drives HITL): the value says
read-or-write, this says how confident that is. MCP_ANNOTATION = from the
tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it;
NONE = no usable hint (the effective value then defaults to write);
NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived).
Does not affect runtime behavior.
| | +| `AuthType` | [*components.AuthType](../../models/components/authtype.md) | :heavy_minus_sign: | The type of authentication being used.
Use 'OAUTH_*' when Glean calls an external API (e.g., Jira) on behalf of a user to obtain an OAuth token.
'OAUTH_ADMIN' utilizes an admin token for external API calls on behalf all users.
'OAUTH_USER' uses individual user tokens for external API calls.
'DWD' refers to domain wide delegation.
| | +| `Auth` | [*components.AuthConfig](../../models/components/authconfig.md) | :heavy_minus_sign: | Config for tool's authentication method. | | +| `Permissions` | [*components.ObjectPermissions](../../models/components/objectpermissions.md) | :heavy_minus_sign: | N/A | | +| `UsageInstructions` | `*string` | :heavy_minus_sign: | Usage instructions for the LLM to use this action. | | +| `IsSetupFinished` | `*bool` | :heavy_minus_sign: | Whether this action has been fully configured and validated. | | \ No newline at end of file diff --git a/docs/models/components/workflow.md b/docs/models/components/workflow.md index c6b0e34b..16392d73 100644 --- a/docs/models/components/workflow.md +++ b/docs/models/components/workflow.md @@ -3,17 +3,18 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | -| `Name` | `*string` | :heavy_minus_sign: | The name of the workflow. | | -| `Author` | [*components.Person](../../models/components/person.md) | :heavy_minus_sign: | N/A | {
"name": "George Clooney",
"obfuscatedId": "abc123"
} | -| `CreateTimestamp` | `*int64` | :heavy_minus_sign: | Server Unix timestamp of the creation time. | | -| `LastUpdateTimestamp` | `*int64` | :heavy_minus_sign: | Server Unix timestamp of the last update time. | | -| `LastDraftSavedAt` | `*int64` | :heavy_minus_sign: | Server Unix timestamp of the last time the draft was saved. | | -| `LastDraftSavedBy` | [*components.Person](../../models/components/person.md) | :heavy_minus_sign: | N/A | {
"name": "George Clooney",
"obfuscatedId": "abc123"
} | -| `LastDraftGitAuthorID` | `*string` | :heavy_minus_sign: | ID of the VCS user (e.g. GitHub username) who last saved the draft. Set only by the draft save path via the external Git integration API. | | -| `LastUpdatedBy` | [*components.Person](../../models/components/person.md) | :heavy_minus_sign: | N/A | {
"name": "George Clooney",
"obfuscatedId": "abc123"
} | -| `Permissions` | [*components.ObjectPermissions](../../models/components/objectpermissions.md) | :heavy_minus_sign: | N/A | | -| `ID` | `*string` | :heavy_minus_sign: | The ID of the workflow. | | -| `Verified` | `*bool` | :heavy_minus_sign: | When present, indicates this workflow is admin-verified. Set via the dedicated admin settings endpoint, not by regular edits. | | -| `ShowOrganizationAsAuthor` | `*bool` | :heavy_minus_sign: | When true, displays organization name instead of author name in agent card. Set via the dedicated admin settings endpoint, not by regular edits. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Name` | `*string` | :heavy_minus_sign: | The name of the workflow. | | +| `Author` | [*components.Person](../../models/components/person.md) | :heavy_minus_sign: | N/A | {
"name": "George Clooney",
"obfuscatedId": "abc123"
} | +| `CreateTimestamp` | `*int64` | :heavy_minus_sign: | Server Unix timestamp of the creation time. | | +| `LastUpdateTimestamp` | `*int64` | :heavy_minus_sign: | Server Unix timestamp of the last update time. | | +| `LastDraftSavedAt` | `*int64` | :heavy_minus_sign: | Server Unix timestamp of the last time the draft was saved. | | +| `LastDraftSavedBy` | [*components.Person](../../models/components/person.md) | :heavy_minus_sign: | N/A | {
"name": "George Clooney",
"obfuscatedId": "abc123"
} | +| `LastDraftGitAuthorID` | `*string` | :heavy_minus_sign: | ID of the VCS user (e.g. GitHub username) who last saved the draft. Set only by the draft save path via the external Git integration API. | | +| `LastUpdatedBy` | [*components.Person](../../models/components/person.md) | :heavy_minus_sign: | N/A | {
"name": "George Clooney",
"obfuscatedId": "abc123"
} | +| `Permissions` | [*components.ObjectPermissions](../../models/components/objectpermissions.md) | :heavy_minus_sign: | N/A | | +| `ID` | `*string` | :heavy_minus_sign: | The ID of the workflow. | | +| `Verified` | `*bool` | :heavy_minus_sign: | When present, indicates this workflow is admin-verified. Set via the dedicated admin settings endpoint, not by regular edits. | | +| `ShowOrganizationAsAuthor` | `*bool` | :heavy_minus_sign: | When true, displays organization name instead of author name in agent card. Set via the dedicated admin settings endpoint, not by regular edits. | | +| `WebhookURL` | `*string` | :heavy_minus_sign: | For a CUSTOM_WEBHOOK-triggered agent, the full inbound webhook URL (.../webhooks/custom/) minted for the agent. Empty for other trigger types.
| | \ No newline at end of file diff --git a/docs/models/operations/platformskillsgetrequest.md b/docs/models/operations/platformskillsgetrequest.md new file mode 100644 index 00000000..b5d6c2b6 --- /dev/null +++ b/docs/models/operations/platformskillsgetrequest.md @@ -0,0 +1,8 @@ +# PlatformSkillsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `SkillID` | `string` | :heavy_check_mark: | Glean skill ID. | \ No newline at end of file diff --git a/docs/models/operations/platformskillsgetresponse.md b/docs/models/operations/platformskillsgetresponse.md new file mode 100644 index 00000000..2a33875e --- /dev/null +++ b/docs/models/operations/platformskillsgetresponse.md @@ -0,0 +1,9 @@ +# PlatformSkillsGetResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `PlatformSkillGetResponse` | [*components.PlatformSkillGetResponse](../../models/components/platformskillgetresponse.md) | :heavy_minus_sign: | Successful response. | \ No newline at end of file diff --git a/docs/models/operations/platformskillslistrequest.md b/docs/models/operations/platformskillslistrequest.md new file mode 100644 index 00000000..7727a947 --- /dev/null +++ b/docs/models/operations/platformskillslistrequest.md @@ -0,0 +1,9 @@ +# PlatformSkillsListRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `PageSize` | `*int64` | :heavy_minus_sign: | Maximum number of skills to return. | +| `Cursor` | `*string` | :heavy_minus_sign: | Opaque pagination cursor from a previous response. | \ No newline at end of file diff --git a/docs/models/operations/platformskillslistresponse.md b/docs/models/operations/platformskillslistresponse.md new file mode 100644 index 00000000..e33cf969 --- /dev/null +++ b/docs/models/operations/platformskillslistresponse.md @@ -0,0 +1,9 @@ +# PlatformSkillsListResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `PlatformSkillsListResponse` | [*components.PlatformSkillsListResponse](../../models/components/platformskillslistresponse.md) | :heavy_minus_sign: | Successful response. | \ No newline at end of file diff --git a/docs/models/operations/postrestapiindexsubmissionsdatasourceinstancetyperequest.md b/docs/models/operations/postrestapiindexsubmissionsdatasourceinstancetyperequest.md new file mode 100644 index 00000000..8a2d334c --- /dev/null +++ b/docs/models/operations/postrestapiindexsubmissionsdatasourceinstancetyperequest.md @@ -0,0 +1,10 @@ +# PostRestAPIIndexSubmissionsDatasourceInstanceTypeRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `DatasourceInstance` | `string` | :heavy_check_mark: | Datasource instance that should process the submission | +| `Type` | `string` | :heavy_check_mark: | Submission type registered for the datasource | +| `RequestBody` | map[string]`any` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/postrestapiindexsubmissionsdatasourceinstancetyperesponse.md b/docs/models/operations/postrestapiindexsubmissionsdatasourceinstancetyperesponse.md new file mode 100644 index 00000000..9be22d01 --- /dev/null +++ b/docs/models/operations/postrestapiindexsubmissionsdatasourceinstancetyperesponse.md @@ -0,0 +1,9 @@ +# PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `Object` | [*operations.PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody](../../models/operations/postrestapiindexsubmissionsdatasourceinstancetyperesponsebody.md) | :heavy_minus_sign: | Accepted | \ No newline at end of file diff --git a/docs/models/operations/postrestapiindexsubmissionsdatasourceinstancetyperesponsebody.md b/docs/models/operations/postrestapiindexsubmissionsdatasourceinstancetyperesponsebody.md new file mode 100644 index 00000000..e0ccae7b --- /dev/null +++ b/docs/models/operations/postrestapiindexsubmissionsdatasourceinstancetyperesponsebody.md @@ -0,0 +1,10 @@ +# PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody + +Accepted + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `RequestID` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/indexingdatasources/README.md b/docs/sdks/indexingdatasources/README.md index 6fe0a500..5b607280 100644 --- a/docs/sdks/indexingdatasources/README.md +++ b/docs/sdks/indexingdatasources/README.md @@ -6,6 +6,7 @@ * [Add](#add) - Add or update datasource * [RetrieveConfig](#retrieveconfig) - Get datasource config +* [Submit](#submit) - Submit datasource data ## Add @@ -126,4 +127,64 @@ func main() { | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| apierrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file +| apierrors.APIError | 4XX, 5XX | \*/\* | + +## Submit + +Validates and asynchronously processes a datasource-specific submission. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + apiclientgo "github.com/gleanwork/api-client-go" + "log" +) + +func main() { + ctx := context.Background() + + s := apiclientgo.New( + apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")), + ) + + res, err := s.Indexing.Datasources.Submit(ctx, "", "", map[string]any{ + "key": "", + "key1": "", + "key2": "", + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `datasourceInstance` | `string` | :heavy_check_mark: | Datasource instance that should process the submission | +| `type_` | `string` | :heavy_check_mark: | Submission type registered for the datasource | +| `requestBody` | map[string]`any` | :heavy_check_mark: | N/A | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponse](../../models/operations/postrestapiindexsubmissionsdatasourceinstancetyperesponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------- | --------------------------- | --------------------------- | +| apierrors.ErrorInfoResponse | 400, 401, 404 | application/json | +| apierrors.ErrorInfoResponse | 500 | application/json | +| apierrors.APIError | 4XX, 5XX | \*/\* | \ 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..eded2ea7 --- /dev/null +++ b/docs/sdks/skills/README.md @@ -0,0 +1,119 @@ +# Skills + +## Overview + +### Available Operations + +* [List](#list) - List skills +* [Retrieve](#retrieve) - Retrieve skill + +## List + +List skills available to the authenticated user. + + +### Example Usage + + +```go +package main + +import( + "context" + "os" + apiclientgo "github.com/gleanwork/api-client-go" + "log" +) + +func main() { + ctx := context.Background() + + s := apiclientgo.New( + apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")), + ) + + res, err := s.Skills.List(ctx, nil, nil) + if err != nil { + log.Fatal(err) + } + if res.PlatformSkillsListResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `pageSize` | `*int64` | :heavy_minus_sign: | Maximum number of skills to return. | +| `cursor` | `*string` | :heavy_minus_sign: | Opaque pagination cursor from a previous response. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.PlatformSkillsListResponse](../../models/operations/platformskillslistresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | +| apierrors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | +| apierrors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| apierrors.APIError | 4XX, 5XX | \*/\* | + +## Retrieve + +Retrieve metadata for a skill available to the authenticated user. + + +### Example Usage + + +```go +package main + +import( + "context" + "os" + apiclientgo "github.com/gleanwork/api-client-go" + "log" +) + +func main() { + ctx := context.Background() + + s := apiclientgo.New( + apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")), + ) + + res, err := s.Skills.Retrieve(ctx, "") + if err != nil { + log.Fatal(err) + } + if res.PlatformSkillGetResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `skillID` | `string` | :heavy_check_mark: | Glean skill ID. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.PlatformSkillsGetResponse](../../models/operations/platformskillsgetresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | +| apierrors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | +| apierrors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| apierrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/glean.go b/glean.go index 4842a872..ab1fa878 100644 --- a/glean.go +++ b/glean.go @@ -2,7 +2,7 @@ package apiclientgo -// Generated from OpenAPI doc version 0.9.0 and generator version 2.916.4 +// Generated from OpenAPI doc version 0.9.0 and generator version 2.918.3 import ( "context" @@ -66,6 +66,7 @@ func Pointer[T any](v T) *T { return &v } type Glean struct { SDKVersion string Agents *Agents + Skills *Skills // Search agents // Search agents available to the authenticated user by agent name. // @@ -161,9 +162,9 @@ func WithTimeout(timeout time.Duration) SDKOption { // New creates a new instance of the SDK with the provided options func New(opts ...SDKOption) *Glean { sdk := &Glean{ - SDKVersion: "0.13.3", + SDKVersion: "0.13.4", sdkConfiguration: config.SDKConfiguration{ - UserAgent: "speakeasy-sdk/go 0.13.3 2.916.4 0.9.0 github.com/gleanwork/api-client-go", + UserAgent: "speakeasy-sdk/go 0.13.4 2.918.3 0.9.0 github.com/gleanwork/api-client-go", ServerList: ServerList, ServerVariables: []map[string]string{ { @@ -197,6 +198,7 @@ func New(opts ...SDKOption) *Glean { } sdk.Agents = newAgents(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Skills = newSkills(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Search = newSearch(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Client = newClient(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Indexing = newIndexing(sdk, sdk.sdkConfiguration, sdk.hooks) diff --git a/indexingdatasources.go b/indexingdatasources.go index 415a2d11..7ad5e303 100644 --- a/indexingdatasources.go +++ b/indexingdatasources.go @@ -447,3 +447,283 @@ func (s *IndexingDatasources) RetrieveConfig(ctx context.Context, request compon return res, nil } + +// Submit datasource data +// Validates and asynchronously processes a datasource-specific submission. +func (s *IndexingDatasources) Submit(ctx context.Context, datasourceInstance string, type_ string, requestBody map[string]any, opts ...operations.Option) (*operations.PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponse, error) { + request := operations.PostRestAPIIndexSubmissionsDatasourceInstanceTypeRequest{ + DatasourceInstance: datasourceInstance, + Type: type_, + RequestBody: requestBody, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + baseURL := utils.ReplaceParameters(operations.PostRestAPIIndexSubmissionsDatasourceInstanceTypeServerList[0], map[string]string{ + "instance": "instance-name", + }) + if o.ServerURL != nil { + baseURL = *o.ServerURL + } + + opURL, err := utils.GenerateURL(ctx, baseURL, "/rest/api/index/submissions/{datasourceInstance}/{type}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "post_/rest/api/index/submissions/{datasourceInstance}/{type}", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RequestBody", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 202: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out apierrors.ErrorInfoResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + out.HTTPMeta = components.HTTPMetadata{ + Request: req, + Response: httpRes, + } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out apierrors.ErrorInfoResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + out.HTTPMeta = components.HTTPMetadata{ + Request: req, + Response: httpRes, + } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 405: + fallthrough + case httpRes.StatusCode == 413: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 503: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/models/components/dlpfindingfilter.go b/models/components/dlpfindingfilter.go index 1188f37d..c4874378 100644 --- a/models/components/dlpfindingfilter.go +++ b/models/components/dlpfindingfilter.go @@ -9,7 +9,7 @@ type DlpFindingFilter struct { Datasource *string `json:"datasource,omitempty"` Visibility *string `json:"visibility,omitempty"` DocumentIds []string `json:"documentIds,omitempty"` - // Severity levels for DLP findings and analyses. + // Severity levels for DLP findings and analyses. FALSE_POSITIVE ranks below LOW and marks analyses that concluded every flagged entity is a detector false positive. Severity *DlpSeverity `json:"severity,omitempty"` DocumentSeverity []DlpSeverity `json:"documentSeverity,omitempty"` Statuses []DlpIssueStatus `json:"statuses,omitempty"` diff --git a/models/components/dlpseverity.go b/models/components/dlpseverity.go index 25ba9d3c..2fd56ade 100644 --- a/models/components/dlpseverity.go +++ b/models/components/dlpseverity.go @@ -2,14 +2,15 @@ package components -// DlpSeverity - Severity levels for DLP findings and analyses. +// DlpSeverity - Severity levels for DLP findings and analyses. FALSE_POSITIVE ranks below LOW and marks analyses that concluded every flagged entity is a detector false positive. type DlpSeverity string const ( - DlpSeverityUnspecified DlpSeverity = "UNSPECIFIED" - DlpSeverityLow DlpSeverity = "LOW" - DlpSeverityMedium DlpSeverity = "MEDIUM" - DlpSeverityHigh DlpSeverity = "HIGH" + DlpSeverityUnspecified DlpSeverity = "UNSPECIFIED" + DlpSeverityLow DlpSeverity = "LOW" + DlpSeverityMedium DlpSeverity = "MEDIUM" + DlpSeverityHigh DlpSeverity = "HIGH" + DlpSeverityFalsePositive DlpSeverity = "FALSE_POSITIVE" ) func (e DlpSeverity) ToPointer() *DlpSeverity { @@ -20,7 +21,7 @@ func (e DlpSeverity) ToPointer() *DlpSeverity { func (e *DlpSeverity) IsExact() bool { if e != nil { switch *e { - case "UNSPECIFIED", "LOW", "MEDIUM", "HIGH": + case "UNSPECIFIED", "LOW", "MEDIUM", "HIGH", "FALSE_POSITIVE": return true } } diff --git a/models/components/platformskill.go b/models/components/platformskill.go new file mode 100644 index 00000000..b4dec867 --- /dev/null +++ b/models/components/platformskill.go @@ -0,0 +1,120 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/gleanwork/api-client-go/internal/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, nil); err != nil { + return err + } + return nil +} + +func (p *PlatformSkill) GetID() string { + if p == nil { + return "" + } + return p.ID +} + +func (p *PlatformSkill) GetDisplayName() string { + if p == nil { + return "" + } + return p.DisplayName +} + +func (p *PlatformSkill) GetDescription() string { + if p == nil { + return "" + } + return p.Description +} + +func (p *PlatformSkill) GetLatestVersion() int64 { + if p == nil { + return 0 + } + return p.LatestVersion +} + +func (p *PlatformSkill) GetLatestMinorVersion() int64 { + if p == nil { + return 0 + } + return p.LatestMinorVersion +} + +func (p *PlatformSkill) GetStatus() PlatformSkillStatus { + if p == nil { + return PlatformSkillStatus("") + } + return p.Status +} + +func (p *PlatformSkill) GetOrigin() PlatformSkillOrigin { + if p == nil { + return PlatformSkillOrigin("") + } + return p.Origin +} + +func (p *PlatformSkill) GetSourceProvenance() *PlatformSkillSourceProvenance { + if p == nil { + return nil + } + return p.SourceProvenance +} + +func (p *PlatformSkill) GetOwner() PlatformPersonReference { + if p == nil { + return PlatformPersonReference{} + } + return p.Owner +} + +func (p *PlatformSkill) GetCreatedAt() time.Time { + if p == nil { + return time.Time{} + } + return p.CreatedAt +} + +func (p *PlatformSkill) GetUpdatedAt() time.Time { + if p == nil { + return time.Time{} + } + return p.UpdatedAt +} diff --git a/models/components/platformskillgetresponse.go b/models/components/platformskillgetresponse.go new file mode 100644 index 00000000..76a2907a --- /dev/null +++ b/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 (p *PlatformSkillGetResponse) GetSkill() PlatformSkill { + if p == nil { + return PlatformSkill{} + } + return p.Skill +} + +func (p *PlatformSkillGetResponse) GetRequestID() string { + if p == nil { + return "" + } + return p.RequestID +} diff --git a/models/components/platformskillorigin.go b/models/components/platformskillorigin.go new file mode 100644 index 00000000..e0a00449 --- /dev/null +++ b/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/models/components/platformskillslistresponse.go b/models/components/platformskillslistresponse.go new file mode 100644 index 00000000..3fd760ac --- /dev/null +++ b/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 (p *PlatformSkillsListResponse) GetSkills() []PlatformSkill { + if p == nil { + return []PlatformSkill{} + } + return p.Skills +} + +func (p *PlatformSkillsListResponse) GetHasMore() bool { + if p == nil { + return false + } + return p.HasMore +} + +func (p *PlatformSkillsListResponse) GetNextCursor() *string { + if p == nil { + return nil + } + return p.NextCursor +} + +func (p *PlatformSkillsListResponse) GetRequestID() string { + if p == nil { + return "" + } + return p.RequestID +} diff --git a/models/components/platformskillsourceprovenance.go b/models/components/platformskillsourceprovenance.go new file mode 100644 index 00000000..650f7afe --- /dev/null +++ b/models/components/platformskillsourceprovenance.go @@ -0,0 +1,76 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/gleanwork/api-client-go/internal/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 (p *PlatformSkillSourceProvenance) GetSourceURL() *string { + if p == nil { + return nil + } + return p.SourceURL +} + +func (p *PlatformSkillSourceProvenance) GetCommitSha() *string { + if p == nil { + return nil + } + return p.CommitSha +} + +func (p *PlatformSkillSourceProvenance) GetImportedAt() *time.Time { + if p == nil { + return nil + } + return p.ImportedAt +} + +func (p *PlatformSkillSourceProvenance) GetLastSyncedAt() *time.Time { + if p == nil { + return nil + } + return p.LastSyncedAt +} + +func (p *PlatformSkillSourceProvenance) GetSyncStatus() *PlatformSkillSyncStatus { + if p == nil { + return nil + } + return p.SyncStatus +} + +func (p *PlatformSkillSourceProvenance) GetSyncError() *string { + if p == nil { + return nil + } + return p.SyncError +} diff --git a/models/components/platformskillstatus.go b/models/components/platformskillstatus.go new file mode 100644 index 00000000..78b9bc62 --- /dev/null +++ b/models/components/platformskillstatus.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PlatformSkillStatus - Current skill status. +type PlatformSkillStatus string + +const ( + PlatformSkillStatusDraft PlatformSkillStatus = "DRAFT" + PlatformSkillStatusEnabled PlatformSkillStatus = "ENABLED" + PlatformSkillStatusDisabled PlatformSkillStatus = "DISABLED" +) + +func (e PlatformSkillStatus) ToPointer() *PlatformSkillStatus { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *PlatformSkillStatus) IsExact() bool { + if e != nil { + switch *e { + case "DRAFT", "ENABLED", "DISABLED": + return true + } + } + return false +} diff --git a/models/components/platformskillsyncstatus.go b/models/components/platformskillsyncstatus.go new file mode 100644 index 00000000..5396a955 --- /dev/null +++ b/models/components/platformskillsyncstatus.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// 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 +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *PlatformSkillSyncStatus) IsExact() bool { + if e != nil { + switch *e { + case "UP_TO_DATE", "UPDATE_AVAILABLE", "SYNC_FAILED": + return true + } + } + return false +} diff --git a/models/components/toolmetadata.go b/models/components/toolmetadata.go index 7033e2fc..ee48ef71 100644 --- a/models/components/toolmetadata.go +++ b/models/components/toolmetadata.go @@ -78,6 +78,38 @@ func (e *WriteActionType) IsExact() bool { return false } +// ActionTypeSource - Analytics-only signal (product snapshot) describing WHERE the action's +// read/write determination came from. Complementary to the effective +// read/write value (the tool's ToolType, which drives HITL): the value says +// read-or-write, this says how confident that is. MCP_ANNOTATION = from the +// tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it; +// NONE = no usable hint (the effective value then defaults to write); +// NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived). +// Does not affect runtime behavior. +type ActionTypeSource string + +const ( + ActionTypeSourceMcpAnnotation ActionTypeSource = "MCP_ANNOTATION" + ActionTypeSourceAdminOverride ActionTypeSource = "ADMIN_OVERRIDE" + ActionTypeSourceNone ActionTypeSource = "NONE" + ActionTypeSourceNativeToolDefinition ActionTypeSource = "NATIVE_TOOL_DEFINITION" +) + +func (e ActionTypeSource) ToPointer() *ActionTypeSource { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ActionTypeSource) IsExact() bool { + if e != nil { + switch *e { + case "MCP_ANNOTATION", "ADMIN_OVERRIDE", "NONE", "NATIVE_TOOL_DEFINITION": + return true + } + } + return false +} + // AuthType - The type of authentication being used. // Use 'OAUTH_*' when Glean calls an external API (e.g., Jira) on behalf of a user to obtain an OAuth token. // 'OAUTH_ADMIN' utilizes an admin token for external API calls on behalf all users. @@ -135,6 +167,16 @@ type ToolMetadata struct { LastUpdatedAt *time.Time `json:"lastUpdatedAt,omitempty"` // Valid only for write actions. Represents the type of write action. REDIRECT - The client renders the URL which contains information for carrying out the action. EXECUTION - Send a request to an external server and execute the action. MCP - Send a tools/call request to an MCP server to execute the action. WriteActionType *WriteActionType `json:"writeActionType,omitempty"` + // Analytics-only signal (product snapshot) describing WHERE the action's + // read/write determination came from. Complementary to the effective + // read/write value (the tool's ToolType, which drives HITL): the value says + // read-or-write, this says how confident that is. MCP_ANNOTATION = from the + // tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it; + // NONE = no usable hint (the effective value then defaults to write); + // NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived). + // Does not affect runtime behavior. + // + ActionTypeSource *ActionTypeSource `json:"actionTypeSource,omitempty"` // The type of authentication being used. // Use 'OAUTH_*' when Glean calls an external API (e.g., Jira) on behalf of a user to obtain an OAuth token. // 'OAUTH_ADMIN' utilizes an admin token for external API calls on behalf all users. @@ -253,6 +295,13 @@ func (t *ToolMetadata) GetWriteActionType() *WriteActionType { return t.WriteActionType } +func (t *ToolMetadata) GetActionTypeSource() *ActionTypeSource { + if t == nil { + return nil + } + return t.ActionTypeSource +} + func (t *ToolMetadata) GetAuthType() *AuthType { if t == nil { return nil diff --git a/models/components/workflow.go b/models/components/workflow.go index 16c922a0..ca8ff009 100644 --- a/models/components/workflow.go +++ b/models/components/workflow.go @@ -23,6 +23,9 @@ type Workflow struct { Verified *bool `json:"verified,omitempty"` // When true, displays organization name instead of author name in agent card. Set via the dedicated admin settings endpoint, not by regular edits. ShowOrganizationAsAuthor *bool `json:"showOrganizationAsAuthor,omitempty"` + // For a CUSTOM_WEBHOOK-triggered agent, the full inbound webhook URL (.../webhooks/custom/) minted for the agent. Empty for other trigger types. + // + WebhookURL *string `json:"webhookUrl,omitempty"` } func (w *Workflow) GetName() *string { @@ -108,3 +111,10 @@ func (w *Workflow) GetShowOrganizationAsAuthor() *bool { } return w.ShowOrganizationAsAuthor } + +func (w *Workflow) GetWebhookURL() *string { + if w == nil { + return nil + } + return w.WebhookURL +} diff --git a/models/operations/platformskillsget.go b/models/operations/platformskillsget.go new file mode 100644 index 00000000..bb8b9388 --- /dev/null +++ b/models/operations/platformskillsget.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +type PlatformSkillsGetRequest struct { + // Glean skill ID. + SkillID string `pathParam:"style=simple,explode=false,name=skill_id"` +} + +func (p *PlatformSkillsGetRequest) GetSkillID() string { + if p == nil { + return "" + } + return p.SkillID +} + +type PlatformSkillsGetResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformSkillGetResponse *components.PlatformSkillGetResponse +} + +func (p *PlatformSkillsGetResponse) GetHTTPMeta() components.HTTPMetadata { + if p == nil { + return components.HTTPMetadata{} + } + return p.HTTPMeta +} + +func (p *PlatformSkillsGetResponse) GetPlatformSkillGetResponse() *components.PlatformSkillGetResponse { + if p == nil { + return nil + } + return p.PlatformSkillGetResponse +} diff --git a/models/operations/platformskillslist.go b/models/operations/platformskillslist.go new file mode 100644 index 00000000..b004ed19 --- /dev/null +++ b/models/operations/platformskillslist.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/gleanwork/api-client-go/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 (p *PlatformSkillsListRequest) GetPageSize() *int64 { + if p == nil { + return nil + } + return p.PageSize +} + +func (p *PlatformSkillsListRequest) GetCursor() *string { + if p == nil { + return nil + } + return p.Cursor +} + +type PlatformSkillsListResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformSkillsListResponse *components.PlatformSkillsListResponse +} + +func (p *PlatformSkillsListResponse) GetHTTPMeta() components.HTTPMetadata { + if p == nil { + return components.HTTPMetadata{} + } + return p.HTTPMeta +} + +func (p *PlatformSkillsListResponse) GetPlatformSkillsListResponse() *components.PlatformSkillsListResponse { + if p == nil { + return nil + } + return p.PlatformSkillsListResponse +} diff --git a/models/operations/postrestapiindexsubmissionsdatasourceinstancetype.go b/models/operations/postrestapiindexsubmissionsdatasourceinstancetype.go new file mode 100644 index 00000000..b005b502 --- /dev/null +++ b/models/operations/postrestapiindexsubmissionsdatasourceinstancetype.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +var PostRestAPIIndexSubmissionsDatasourceInstanceTypeServerList = []string{ + "https://{instance}-be.glean.com", +} + +type PostRestAPIIndexSubmissionsDatasourceInstanceTypeRequest struct { + // Datasource instance that should process the submission + DatasourceInstance string `pathParam:"style=simple,explode=false,name=datasourceInstance"` + // Submission type registered for the datasource + Type string `pathParam:"style=simple,explode=false,name=type"` + RequestBody map[string]any `request:"mediaType=application/json"` +} + +func (p *PostRestAPIIndexSubmissionsDatasourceInstanceTypeRequest) GetDatasourceInstance() string { + if p == nil { + return "" + } + return p.DatasourceInstance +} + +func (p *PostRestAPIIndexSubmissionsDatasourceInstanceTypeRequest) GetType() string { + if p == nil { + return "" + } + return p.Type +} + +func (p *PostRestAPIIndexSubmissionsDatasourceInstanceTypeRequest) GetRequestBody() map[string]any { + if p == nil { + return map[string]any{} + } + return p.RequestBody +} + +// PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody - Accepted +type PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody struct { + RequestID string `json:"requestId"` +} + +func (p *PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody) GetRequestID() string { + if p == nil { + return "" + } + return p.RequestID +} + +type PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Accepted + Object *PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody +} + +func (p *PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponse) GetHTTPMeta() components.HTTPMetadata { + if p == nil { + return components.HTTPMetadata{} + } + return p.HTTPMeta +} + +func (p *PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponse) GetObject() *PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody { + if p == nil { + return nil + } + return p.Object +} diff --git a/skills.go b/skills.go new file mode 100644 index 00000000..b42d6f31 --- /dev/null +++ b/skills.go @@ -0,0 +1,581 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package apiclientgo + +import ( + "bytes" + "context" + "fmt" + "github.com/gleanwork/api-client-go/internal/config" + "github.com/gleanwork/api-client-go/internal/hooks" + "github.com/gleanwork/api-client-go/internal/utils" + "github.com/gleanwork/api-client-go/models/apierrors" + "github.com/gleanwork/api-client-go/models/components" + "github.com/gleanwork/api-client-go/models/operations" + "github.com/gleanwork/api-client-go/retry" + "net/http" + "net/url" +) + +type Skills struct { + rootSDK *Glean + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newSkills(rootSDK *Glean, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Skills { + return &Skills{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// List skills +// List skills available to the authenticated user. +func (s *Skills) List(ctx context.Context, pageSize *int64, cursor *string, opts ...operations.Option) (*operations.PlatformSkillsListResponse, error) { + request := operations.PlatformSkillsListRequest{ + PageSize: pageSize, + Cursor: cursor, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/skills") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "platform-skills-list", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.PlatformSkillsListResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.PlatformSkillsListResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PlatformSkillsListResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 408: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/problem+json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out apierrors.PlatformProblemDetailError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + out.HTTPMeta = components.HTTPMetadata{ + Request: req, + Response: httpRes, + } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode == 503: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/problem+json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out apierrors.PlatformProblemDetailError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + out.HTTPMeta = components.HTTPMetadata{ + Request: req, + Response: httpRes, + } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Retrieve skill +// Retrieve metadata for a skill available to the authenticated user. +func (s *Skills) Retrieve(ctx context.Context, skillID string, opts ...operations.Option) (*operations.PlatformSkillsGetResponse, error) { + request := operations.PlatformSkillsGetRequest{ + SkillID: skillID, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/skills/{skill_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "platform-skills-get", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.PlatformSkillsGetResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.PlatformSkillGetResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PlatformSkillGetResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 408: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/problem+json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out apierrors.PlatformProblemDetailError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + out.HTTPMeta = components.HTTPMetadata{ + Request: req, + Response: httpRes, + } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode == 503: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/problem+json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out apierrors.PlatformProblemDetailError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + out.HTTPMeta = components.HTTPMetadata{ + Request: req, + Response: httpRes, + } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/tests/indexingdatasources_test.go b/tests/indexingdatasources_test.go new file mode 100644 index 00000000..2bb44021 --- /dev/null +++ b/tests/indexingdatasources_test.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package tests + +import ( + "context" + apiclientgo "github.com/gleanwork/api-client-go" + "github.com/gleanwork/api-client-go/internal/utils" + "github.com/gleanwork/api-client-go/models/operations" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func TestIndexingDatasources_PostRestAPIIndexSubmissionsDatasourceInstanceType(t *testing.T) { + ctx := context.Background() + + testHTTPClient := createTestHTTPClient("post_/rest/api/index/submissions/{datasourceInstance}/{type}") + + s := apiclientgo.New( + apiclientgo.WithClient(testHTTPClient), + apiclientgo.WithSecurity(utils.GetEnv("GLEAN_API_TOKEN", "value")), + ) + + res, err := s.Indexing.Datasources.Submit(ctx, "", "", map[string]any{ + "key": "", + "key1": "", + "key2": "", + }, operations.WithServerURL(utils.GetEnv("TEST_SERVER_URL", "http://localhost:18080"))) + require.NoError(t, err) + assert.Equal(t, 202, res.HTTPMeta.Response.StatusCode) + +} diff --git a/tests/messages_test.go b/tests/messages_test.go index febdc0e8..64ef64fe 100644 --- a/tests/messages_test.go +++ b/tests/messages_test.go @@ -27,7 +27,7 @@ func TestMessages_Messages(t *testing.T) { IDType: components.IDTypeConversationID, ID: "", TimestampMillis: apiclientgo.Pointer[int64](558834), - Datasource: components.DatasourceGchat, + Datasource: components.DatasourceFacebookworkplace, }, nil) require.NoError(t, err) assert.Equal(t, 200, res.HTTPMeta.Response.StatusCode) diff --git a/tests/mockserver/internal/handler/generated_handlers.go b/tests/mockserver/internal/handler/generated_handlers.go index d5fe2f85..4ef1a950 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)), @@ -58,6 +60,7 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/rotatetoken", pathPostAPIIndexV1Rotatetoken(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/updatepermissions", pathPostAPIIndexV1Updatepermissions(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/search", pathPostAPISearch(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/index/submissions/{datasourceInstance}/{type}", pathPostRestAPIIndexSubmissionsDatasourceInstanceType(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/actions/actionpack/{actionPackId}/auth", pathPostRestAPIV1ActionsActionpackActionPackIDAuth(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/activity", pathPostRestAPIV1Activity(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/addcollectionitems", pathPostRestAPIV1Addcollectionitems(dir, rt)), diff --git a/tests/mockserver/internal/handler/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/pathpostrestapiindexsubmissionsdatasourceinstancetype.go b/tests/mockserver/internal/handler/pathpostrestapiindexsubmissionsdatasourceinstancetype.go new file mode 100644 index 00000000..d4978bcc --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiindexsubmissionsdatasourceinstancetype.go @@ -0,0 +1,69 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/operations" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIIndexSubmissionsDatasourceInstanceType(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 "post_/rest/api/index/submissions/{datasourceInstance}/{type}[0]": + dir.HandlerFunc("post_/rest/api/index/submissions/{datasourceInstance}/{type}", testPostRestAPIIndexSubmissionsDatasourceInstanceTypePostRestAPIIndexSubmissionsDatasourceInstanceType0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostRestAPIIndexSubmissionsDatasourceInstanceTypePostRestAPIIndexSubmissionsDatasourceInstanceType0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *operations.PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody = &operations.PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody{ + 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.StatusAccepted) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go b/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go index 87401958..96d4127e 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go @@ -628,8 +628,8 @@ func testGetchatGetchat0(w http.ResponseWriter, req *http.Request) { Roles: []components.UserRoleSpecification{}, SourceDocumentSpec: types.Pointer(components.CreateDocumentSpecUnionDocumentSpec3( components.DocumentSpec3{ - UgcType: components.DocumentSpecUgcType1Shortcuts, - ContentID: 602763, + UgcType: components.DocumentSpecUgcType1Announcements, + ContentID: 848009, }, )), SourceType: components.AnswerSourceTypeAssistant.ToPointer(), diff --git a/tests/mockserver/internal/sdk/models/components/dlpfindingfilter.go b/tests/mockserver/internal/sdk/models/components/dlpfindingfilter.go index f0498927..f3b7f96f 100644 --- a/tests/mockserver/internal/sdk/models/components/dlpfindingfilter.go +++ b/tests/mockserver/internal/sdk/models/components/dlpfindingfilter.go @@ -9,7 +9,7 @@ type DlpFindingFilter struct { Datasource *string `json:"datasource,omitempty"` Visibility *string `json:"visibility,omitempty"` DocumentIds []string `json:"documentIds,omitempty"` - // Severity levels for DLP findings and analyses. + // Severity levels for DLP findings and analyses. FALSE_POSITIVE ranks below LOW and marks analyses that concluded every flagged entity is a detector false positive. Severity *DlpSeverity `json:"severity,omitempty"` DocumentSeverity []DlpSeverity `json:"documentSeverity,omitempty"` Statuses []DlpIssueStatus `json:"statuses,omitempty"` diff --git a/tests/mockserver/internal/sdk/models/components/dlpseverity.go b/tests/mockserver/internal/sdk/models/components/dlpseverity.go index a0c02199..aac78928 100644 --- a/tests/mockserver/internal/sdk/models/components/dlpseverity.go +++ b/tests/mockserver/internal/sdk/models/components/dlpseverity.go @@ -7,14 +7,15 @@ import ( "fmt" ) -// DlpSeverity - Severity levels for DLP findings and analyses. +// DlpSeverity - Severity levels for DLP findings and analyses. FALSE_POSITIVE ranks below LOW and marks analyses that concluded every flagged entity is a detector false positive. type DlpSeverity string const ( - DlpSeverityUnspecified DlpSeverity = "UNSPECIFIED" - DlpSeverityLow DlpSeverity = "LOW" - DlpSeverityMedium DlpSeverity = "MEDIUM" - DlpSeverityHigh DlpSeverity = "HIGH" + DlpSeverityUnspecified DlpSeverity = "UNSPECIFIED" + DlpSeverityLow DlpSeverity = "LOW" + DlpSeverityMedium DlpSeverity = "MEDIUM" + DlpSeverityHigh DlpSeverity = "HIGH" + DlpSeverityFalsePositive DlpSeverity = "FALSE_POSITIVE" ) func (e DlpSeverity) ToPointer() *DlpSeverity { @@ -33,6 +34,8 @@ func (e *DlpSeverity) UnmarshalJSON(data []byte) error { case "MEDIUM": fallthrough case "HIGH": + fallthrough + case "FALSE_POSITIVE": *e = DlpSeverity(v) return nil default: 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/components/toolmetadata.go b/tests/mockserver/internal/sdk/models/components/toolmetadata.go index 3c803a6d..061df30a 100644 --- a/tests/mockserver/internal/sdk/models/components/toolmetadata.go +++ b/tests/mockserver/internal/sdk/models/components/toolmetadata.go @@ -96,6 +96,46 @@ func (e *WriteActionType) UnmarshalJSON(data []byte) error { } } +// ActionTypeSource - Analytics-only signal (product snapshot) describing WHERE the action's +// read/write determination came from. Complementary to the effective +// read/write value (the tool's ToolType, which drives HITL): the value says +// read-or-write, this says how confident that is. MCP_ANNOTATION = from the +// tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it; +// NONE = no usable hint (the effective value then defaults to write); +// NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived). +// Does not affect runtime behavior. +type ActionTypeSource string + +const ( + ActionTypeSourceMcpAnnotation ActionTypeSource = "MCP_ANNOTATION" + ActionTypeSourceAdminOverride ActionTypeSource = "ADMIN_OVERRIDE" + ActionTypeSourceNone ActionTypeSource = "NONE" + ActionTypeSourceNativeToolDefinition ActionTypeSource = "NATIVE_TOOL_DEFINITION" +) + +func (e ActionTypeSource) ToPointer() *ActionTypeSource { + return &e +} +func (e *ActionTypeSource) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "MCP_ANNOTATION": + fallthrough + case "ADMIN_OVERRIDE": + fallthrough + case "NONE": + fallthrough + case "NATIVE_TOOL_DEFINITION": + *e = ActionTypeSource(v) + return nil + default: + return fmt.Errorf("invalid value for ActionTypeSource: %v", v) + } +} + // AuthType - The type of authentication being used. // Use 'OAUTH_*' when Glean calls an external API (e.g., Jira) on behalf of a user to obtain an OAuth token. // 'OAUTH_ADMIN' utilizes an admin token for external API calls on behalf all users. @@ -165,6 +205,16 @@ type ToolMetadata struct { LastUpdatedAt *time.Time `json:"lastUpdatedAt,omitempty"` // Valid only for write actions. Represents the type of write action. REDIRECT - The client renders the URL which contains information for carrying out the action. EXECUTION - Send a request to an external server and execute the action. MCP - Send a tools/call request to an MCP server to execute the action. WriteActionType *WriteActionType `json:"writeActionType,omitempty"` + // Analytics-only signal (product snapshot) describing WHERE the action's + // read/write determination came from. Complementary to the effective + // read/write value (the tool's ToolType, which drives HITL): the value says + // read-or-write, this says how confident that is. MCP_ANNOTATION = from the + // tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it; + // NONE = no usable hint (the effective value then defaults to write); + // NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived). + // Does not affect runtime behavior. + // + ActionTypeSource *ActionTypeSource `json:"actionTypeSource,omitempty"` // The type of authentication being used. // Use 'OAUTH_*' when Glean calls an external API (e.g., Jira) on behalf of a user to obtain an OAuth token. // 'OAUTH_ADMIN' utilizes an admin token for external API calls on behalf all users. @@ -283,6 +333,13 @@ func (o *ToolMetadata) GetWriteActionType() *WriteActionType { return o.WriteActionType } +func (o *ToolMetadata) GetActionTypeSource() *ActionTypeSource { + if o == nil { + return nil + } + return o.ActionTypeSource +} + func (o *ToolMetadata) GetAuthType() *AuthType { if o == nil { return nil diff --git a/tests/mockserver/internal/sdk/models/components/workflow.go b/tests/mockserver/internal/sdk/models/components/workflow.go index dfe489b8..47aa9d24 100644 --- a/tests/mockserver/internal/sdk/models/components/workflow.go +++ b/tests/mockserver/internal/sdk/models/components/workflow.go @@ -23,6 +23,9 @@ type Workflow struct { Verified *bool `json:"verified,omitempty"` // When true, displays organization name instead of author name in agent card. Set via the dedicated admin settings endpoint, not by regular edits. ShowOrganizationAsAuthor *bool `json:"showOrganizationAsAuthor,omitempty"` + // For a CUSTOM_WEBHOOK-triggered agent, the full inbound webhook URL (.../webhooks/custom/) minted for the agent. Empty for other trigger types. + // + WebhookURL *string `json:"webhookUrl,omitempty"` } func (o *Workflow) GetName() *string { @@ -108,3 +111,10 @@ func (o *Workflow) GetShowOrganizationAsAuthor() *bool { } return o.ShowOrganizationAsAuthor } + +func (o *Workflow) GetWebhookURL() *string { + if o == nil { + return nil + } + return o.WebhookURL +} 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/mockserver/internal/sdk/models/operations/postrestapiindexsubmissionsdatasourceinstancetype.go b/tests/mockserver/internal/sdk/models/operations/postrestapiindexsubmissionsdatasourceinstancetype.go new file mode 100644 index 00000000..f18b0916 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postrestapiindexsubmissionsdatasourceinstancetype.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostRestAPIIndexSubmissionsDatasourceInstanceTypeRequest struct { + // Datasource instance that should process the submission + DatasourceInstance string `pathParam:"style=simple,explode=false,name=datasourceInstance"` + // Submission type registered for the datasource + Type string `pathParam:"style=simple,explode=false,name=type"` + Body map[string]any `request:"mediaType=application/json"` +} + +func (o *PostRestAPIIndexSubmissionsDatasourceInstanceTypeRequest) GetDatasourceInstance() string { + if o == nil { + return "" + } + return o.DatasourceInstance +} + +func (o *PostRestAPIIndexSubmissionsDatasourceInstanceTypeRequest) GetType() string { + if o == nil { + return "" + } + return o.Type +} + +func (o *PostRestAPIIndexSubmissionsDatasourceInstanceTypeRequest) GetBody() map[string]any { + if o == nil { + return map[string]any{} + } + return o.Body +} + +// PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody - Accepted +type PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody struct { + RequestID string `json:"requestId"` +} + +func (o *PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} + +type PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Accepted + Object *PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody +} + +func (o *PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponse) GetObject() *PostRestAPIIndexSubmissionsDatasourceInstanceTypeResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/tests/skills_test.go b/tests/skills_test.go new file mode 100644 index 00000000..5b060bc5 --- /dev/null +++ b/tests/skills_test.go @@ -0,0 +1,46 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package tests + +import ( + "context" + apiclientgo "github.com/gleanwork/api-client-go" + "github.com/gleanwork/api-client-go/internal/utils" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func TestSkills_PlatformSkillsList(t *testing.T) { + ctx := context.Background() + + testHTTPClient := createTestHTTPClient("platform-skills-list") + + s := apiclientgo.New( + apiclientgo.WithServerURL(utils.GetEnv("TEST_SERVER_URL", "http://localhost:18080")), + apiclientgo.WithClient(testHTTPClient), + apiclientgo.WithSecurity(utils.GetEnv("GLEAN_API_TOKEN", "value")), + ) + + res, err := s.Skills.List(ctx, nil, nil) + require.NoError(t, err) + assert.Equal(t, 200, res.HTTPMeta.Response.StatusCode) + +} + +func TestSkills_PlatformSkillsGet(t *testing.T) { + ctx := context.Background() + + testHTTPClient := createTestHTTPClient("platform-skills-get") + + s := apiclientgo.New( + apiclientgo.WithServerURL(utils.GetEnv("TEST_SERVER_URL", "http://localhost:18080")), + apiclientgo.WithClient(testHTTPClient), + apiclientgo.WithSecurity(utils.GetEnv("GLEAN_API_TOKEN", "value")), + ) + + res, err := s.Skills.Retrieve(ctx, "") + require.NoError(t, err) + assert.Equal(t, 200, res.HTTPMeta.Response.StatusCode) + +} diff --git a/tests/summarize_test.go b/tests/summarize_test.go index 4474f69b..a4bc656a 100644 --- a/tests/summarize_test.go +++ b/tests/summarize_test.go @@ -25,16 +25,16 @@ func TestSummarize_Summarize(t *testing.T) { res, err := s.Client.Documents.Summarize(ctx, components.SummarizeRequest{ DocumentSpecs: []components.DocumentSpecUnion{ - components.CreateDocumentSpecUnionDocumentSpec3( - components.DocumentSpec3{ - UgcType: components.DocumentSpecUgcType1Answers, - ContentID: 123467, + components.CreateDocumentSpecUnionDocumentSpec4( + components.DocumentSpec4{ + UgcType: components.DocumentSpecUgcType2Announcements, + UgcID: "", }, ), components.CreateDocumentSpecUnionDocumentSpec3( components.DocumentSpec3{ - UgcType: components.DocumentSpecUgcType1Answers, - ContentID: 123467, + UgcType: components.DocumentSpecUgcType1Collections, + ContentID: 337360, }, ), },