diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index b5ac377c..aa668840 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 0359d4fe-2923-46fc-aaca-cf70b48dcfa1 management: - docChecksum: 33958fda4f2b946f46f0593aac3a619d + docChecksum: cba6d168870630c0bc23385e98ab7d5c docVersion: 0.9.0 speakeasyVersion: 1.789.2 generationVersion: 2.916.4 - releaseVersion: 0.14.3 - configChecksum: be03d2f5afbc5351e940b5326128717f + releaseVersion: 0.14.4 + configChecksum: d5edf6a2d997b6ca0f087370023c40e2 repoURL: https://github.com/gleanwork/api-client-java.git installationURL: https://github.com/gleanwork/api-client-java published: true persistentEdits: - generation_id: da2ce852-fd82-4787-ab76-282c5d4a507f - pristine_commit_hash: e67e100bfc2d4e008318688c9b90c15832b1a62d - pristine_tree_hash: 3befd1d0abeb1604cecdd80affb5d2b0ad2a86f5 + generation_id: 417c00c6-3917-4d53-8d42-47c2164d899a + pristine_commit_hash: ee886a54f35c0743d70b22d75bb9d1e4a7fcc8f0 + pristine_tree_hash: b783405bfef9128e99ba8131248e2ec3440d1c4e features: java: acceptHeaders: 2.81.2 @@ -1913,6 +1913,34 @@ trackedFiles: id: 5f92876fb5c8 last_write_checksum: sha1:d463001b22ff3419918e31ec7832587341fb35a1 pristine_git_object: 083cad412eb152684e3895da619d1f4f393ae0bf + docs/models/components/PlatformSkill.md: + id: 48b17cdbdcf3 + last_write_checksum: sha1:6a89514c591aa917f1859e7f695b5a2e67d0ce1f + pristine_git_object: ae055121bbcfc7fcdd5fdbe10ca373d84c54e638 + docs/models/components/PlatformSkillGetResponse.md: + id: 9463c73e1a4f + last_write_checksum: sha1:7003d9e9b76b756614e56b880a7c1c94826c9173 + pristine_git_object: 295031b7d5aaea130707b845293c4e8c0e3477bb + docs/models/components/PlatformSkillOrigin.md: + id: 3f51c4b399cd + last_write_checksum: sha1:60470475b7e2bf5c205090330b0e592b6a3a4f28 + pristine_git_object: aa217c27d2ecf215776707434717e38960439948 + docs/models/components/PlatformSkillSourceProvenance.md: + id: b3c0d1b1c723 + last_write_checksum: sha1:0e672c92cecb5cfecaa887dc16afb52f970d3eff + pristine_git_object: a42f8d71a53b1a3422e55325ab4259157dfa2677 + docs/models/components/PlatformSkillStatus.md: + id: 9c586f4b13dd + last_write_checksum: sha1:4297a7da9090e5fc5374779ebd20c2ceef751ecc + pristine_git_object: f3ebbcf2410f7df6b49920e0611ffd1c6c81053f + docs/models/components/PlatformSkillSyncStatus.md: + id: 0475ccc16596 + last_write_checksum: sha1:8560f0773fe9ce87d41c1f499bf30766dbf50e2b + pristine_git_object: d8195068b74dd1f14eb8649ec44e53ae551d143c + docs/models/components/PlatformSkillsListResponse.md: + id: 26c44c678682 + last_write_checksum: sha1:285e8b28837c7b6cd376aa5fe63ceb1dd7e402b6 + pristine_git_object: 1a206faa97db13103b326b757737cb9882083914 docs/models/components/PlatformTimeRange.md: id: e23ca7368dc2 last_write_checksum: sha1:48c1a8a19bac073372bdf5b5e688865d568d6225 @@ -3241,6 +3269,22 @@ trackedFiles: id: 7ab2beea5f75 last_write_checksum: sha1:b019dc80b72396e4103f40bc931b1a39b8b00117 pristine_git_object: 10908aeaba0726a7003a58e259f514c0cb3d33ba + docs/models/operations/PlatformSkillsGetRequest.md: + id: 6bcca0e1d876 + last_write_checksum: sha1:6fb8769f827b2ac8b85140e1223e1369dc708cd1 + pristine_git_object: 1e6a21c8542c5444c38e944bdd200dac7d56e71d + docs/models/operations/PlatformSkillsGetResponse.md: + id: a178cbde7bf1 + last_write_checksum: sha1:29e127c2743edc3bf93cca5b2f639736d6be73ae + pristine_git_object: a2da05c0c876106339be78dc15ede106b3eeab3a + docs/models/operations/PlatformSkillsListRequest.md: + id: a2df3ca6e157 + last_write_checksum: sha1:df7ccb85f8be9bcc2d3d3171220d99a153530755 + pristine_git_object: 15f66cfe08bdc084dcfc4570d020d7b4094de670 + docs/models/operations/PlatformSkillsListResponse.md: + id: ed5d42d5c8ff + last_write_checksum: sha1:79b3a9ccf00e0280e3f960cffe929808fbb389ae + pristine_git_object: c362bbc10764f3342faefe3b31e5d77851615270 docs/models/operations/PostApiIndexV1AdddatasourceResponse.md: id: 6cd8415eee56 last_write_checksum: sha1:0b68cdac07ec9e7f87091e7dfc4a45184dedb70d @@ -3649,6 +3693,10 @@ trackedFiles: id: 5c534716244c last_write_checksum: sha1:fcf7c1cf8c87935eca2cc104391ffdd2b25473d4 pristine_git_object: 6555e422489b48401d8c5896d8902dd40752d251 + docs/sdks/skills/README.md: + id: 3a14a5c90791 + last_write_checksum: sha1:5ea867e691722f2064326b6734f0f65c099e6a95 + pristine_git_object: 132af797bf4c50e6e587813aa114fadeab0b5362 docs/sdks/tools/README.md: id: 044286549bac last_write_checksum: sha1:f463db245c247de5af8035245870ca014bbe82fc @@ -3667,8 +3715,8 @@ trackedFiles: pristine_git_object: 3decbce5bd40edbe278c1c5d2dbf585808e51d9a gradle.properties: id: 2afbb999f001 - last_write_checksum: sha1:8379af9fa277a6752c1e33a237c83a9c494333db - pristine_git_object: 947c27d5aa59d385012bc2e657ef72db71c1959c + last_write_checksum: sha1:befc4a3824a4d11786b3517a0cc3c5fe9555903c + pristine_git_object: 706f89784c40c2e0255d6d368812ff7505eff14b gradle/wrapper/gradle-wrapper.jar: id: ec27dae6e852 last_write_checksum: sha1:f725fb1467084142d74fd7cd8eab691ab3442611 @@ -3783,8 +3831,8 @@ trackedFiles: pristine_git_object: b688538c7b9c976d4493061d3608ebff442b6875 src/main/java/com/glean/api_client/glean_api_client/AsyncGlean.java: id: 41f5be2f8342 - last_write_checksum: sha1:454467031a5fa7d6a7abb56ccdeddf7e1a778a7e - pristine_git_object: 043e1a834f9199a6e52545d2a6e6c46872ca5753 + last_write_checksum: sha1:0cc9b65d351820828de7ddc29d681a0e3725abbe + pristine_git_object: 9968a62f59e408a33f479e15aeddda4185e5bb01 src/main/java/com/glean/api_client/glean_api_client/AsyncGovernance.java: id: 38b2443ece41 last_write_checksum: sha1:d98fcd8de4bbdd2455f0b186d630f68cf0aede69 @@ -3833,6 +3881,10 @@ trackedFiles: id: bc11b718d590 last_write_checksum: sha1:12b17133a76791f0113e1f26949c95876af98887 pristine_git_object: 412064d0b2fe554afcb9bd197d6c6f05e6f9b8b8 + src/main/java/com/glean/api_client/glean_api_client/AsyncPlatform.java: + id: c2862f050fcc + last_write_checksum: sha1:21b4109c08c8d8b8f8e823f1b5d0441aa085efa2 + pristine_git_object: 9383ab57e47d7b9abc4eb58c13eb3e78606787a1 src/main/java/com/glean/api_client/glean_api_client/AsyncPolicies.java: id: a806d94d5cbc last_write_checksum: sha1:57686ed6be932ec904e34eb03885abebc31551e3 @@ -3845,6 +3897,10 @@ trackedFiles: id: 443645b885fa last_write_checksum: sha1:0241338c962eda005c9e6c3fe4f66d78030a20d2 pristine_git_object: 4a17ff91f2cad3a65578dd16fac8bfbb864699e5 + src/main/java/com/glean/api_client/glean_api_client/AsyncSkills.java: + id: 809381bacfb1 + last_write_checksum: sha1:1fddb6a4e696c9bd1a11366ac7740ab23a829091 + pristine_git_object: e27ff0941c23588cabe43ed67644eeccbf1bc680 src/main/java/com/glean/api_client/glean_api_client/AsyncTools.java: id: 02ad87504d7a last_write_checksum: sha1:506200f5eeb1be124b9352d28f9db587d0b12cad @@ -3915,8 +3971,8 @@ trackedFiles: pristine_git_object: e9ce0228b65e0b98e94830159dd24e3cd4abb9d3 src/main/java/com/glean/api_client/glean_api_client/Glean.java: id: ebe9053b14eb - last_write_checksum: sha1:0d365163ee1902e4797ba948db1a93f9f8a29ad1 - pristine_git_object: 3a9023767e0eb05306b07dd990a5e9d59b6958a1 + last_write_checksum: sha1:7e79cc4a4c6557a9b28540e082b39b45dfa25e46 + pristine_git_object: 23e3e1703d2c40f5fbfa6ca3bd4cc295b1fc5d8a src/main/java/com/glean/api_client/glean_api_client/Governance.java: id: 2d4a3c95da6a last_write_checksum: sha1:66221fd24d5e17ecdfed6bf44bbd6f73a1f93c67 @@ -3965,6 +4021,10 @@ trackedFiles: id: 598f151c69da last_write_checksum: sha1:d501398ba4971c74e6c0044790942ff41e570ba1 pristine_git_object: 8a01a4e7a637188a07054c57e9538c31a3df0da3 + src/main/java/com/glean/api_client/glean_api_client/Platform.java: + id: b8013fc2d58e + last_write_checksum: sha1:eb7d635658e0bb2f58dae053afadd6785805d5bd + pristine_git_object: 6f6536fbd37fb9c34dd3c42baae30286747e39d3 src/main/java/com/glean/api_client/glean_api_client/Policies.java: id: 6cbaf93ef0d3 last_write_checksum: sha1:d5add25d9a50d04c92343c423089649c63aaf08f @@ -3975,8 +4035,8 @@ trackedFiles: pristine_git_object: ffae914775eb41ff311371f62504344a59d090fd src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java: id: d5fcc61f5992 - last_write_checksum: sha1:0425f25702347060031630a96596cd0a8c713edb - pristine_git_object: f24764cdd8070d3dd11fbfd5a0ef3ee8657a898e + last_write_checksum: sha1:dd3589fb154e9cb49a5cc487ca5d24308af8f30c + pristine_git_object: cbb3d90e072ac7bfa6a424d4a070491bfef78604 src/main/java/com/glean/api_client/glean_api_client/Search.java: id: f22d94b920b5 last_write_checksum: sha1:803fcb8e55cb4a76ec275ae45b83730fc7ed18c7 @@ -3985,6 +4045,10 @@ trackedFiles: id: add211a7c1dd last_write_checksum: sha1:060fd502a5844abda3dba22f9e00ca79f8317f94 pristine_git_object: f1e58a1696e5159e96259e20e83ca6f5584f810a + src/main/java/com/glean/api_client/glean_api_client/Skills.java: + id: 6903ae835067 + last_write_checksum: sha1:c7c928eec4132a4b47efc8ac9cff3cfead5bfa11 + pristine_git_object: 1273572e83e1c11acb83eb467db3b2fc907f6de6 src/main/java/com/glean/api_client/glean_api_client/Tools.java: id: bb072637f39b last_write_checksum: sha1:052d5febd57bebffbebd0884fd5698bff5cd20a7 @@ -5861,6 +5925,34 @@ trackedFiles: id: 170859d5c40a last_write_checksum: sha1:f6bb81d05003571db41220e1d40d54a854206d97 pristine_git_object: bba2b20565c5103d873fb2de0ca511298695c829 + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkill.java: + id: 11a29891a283 + last_write_checksum: sha1:e77a0aafec5bb5d8d40466d462b0dad59d2c81db + pristine_git_object: 06ad3a2718f4d3fed8a3875f57099390eb1ff046 + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillGetResponse.java: + id: 88de4cd9201f + last_write_checksum: sha1:6c648eb968a6315e75b300f64bac9535c5b4ad02 + pristine_git_object: f442b75f10fdaef7ca8b3114292ea367933bd5f4 + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillOrigin.java: + id: 673d58eb0c96 + last_write_checksum: sha1:c5f62255b8b368c6b850127f99cc7e09e35d14a8 + pristine_git_object: 2694ce8a273231a3f3ee30422e5694273ae5d3ca + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillSourceProvenance.java: + id: 1fb785647231 + last_write_checksum: sha1:318bcb6327c7023217b0aff63cbabab2d3edacd2 + pristine_git_object: de7125a5376fa7a396097349518bff00c0c9642a + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillStatus.java: + id: d165c204cdfe + last_write_checksum: sha1:89b04089b9f7138b635380c39a0ab8bf1eb28cef + pristine_git_object: e699f0936477647cce8b2b63fb9e11c87385dfde + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillSyncStatus.java: + id: 9b52c0471fec + last_write_checksum: sha1:cec4bc12d4d8c5b20508d90697efd3d7b8423fef + pristine_git_object: 201289404dd7c8e35dc64503796481f4cd2fd79b + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillsListResponse.java: + id: 33ab82accff8 + last_write_checksum: sha1:2428e90bdb520d8f5932542298d3247c4e2b7fb4 + pristine_git_object: 174834b7e10119ec5e4819959a975a0d03231eb0 src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformTimeRange.java: id: ab9269c32c6a last_write_checksum: sha1:6f3c5cb8d6d2a61f8d2b7ee42a1d7b73ac02c6b7 @@ -6909,6 +7001,14 @@ trackedFiles: id: 82db0b41fde4 last_write_checksum: sha1:7af4c73a77eeb27581501f320f4b69e76cf83d62 pristine_git_object: 18d1426633220ae8c17fb39a810f941ece0a2713 + src/main/java/com/glean/api_client/glean_api_client/models/operations//async/PlatformSkillsGetRequestBuilder.java: + id: 6446a69d453f + last_write_checksum: sha1:17bd5be18252d9907fa1f81155f67c125a9275fc + pristine_git_object: af6066c6c3728f1b96a393f9d1cfb3e91d3a1847 + src/main/java/com/glean/api_client/glean_api_client/models/operations//async/PlatformSkillsListRequestBuilder.java: + id: 9ce19ecbdb6d + last_write_checksum: sha1:fece1fc2d4f39e8e5e704f5db8d177b19958544a + pristine_git_object: bac4251507ff67e2e21de3b73c423e33425955f1 src/main/java/com/glean/api_client/glean_api_client/models/operations//async/PostApiIndexV1AdddatasourceRequestBuilder.java: id: 3c6f34b93b68 last_write_checksum: sha1:4e8bdefb602c072ec9b82058b5593546e04e059b @@ -8085,6 +8185,30 @@ trackedFiles: id: 68bd184c4656 last_write_checksum: sha1:602ef94742690f30edd18aed6eeb9c6b0ff5b846 pristine_git_object: f019690379285f41adeeae32dce29d9891e6f82d + src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsGetRequest.java: + id: b1a1021e45fa + last_write_checksum: sha1:ff261484abc6ca03a3bb2a33f1c9214c559ddc69 + pristine_git_object: e95a3f18e24713fb10f58e05daef68fd8b189793 + src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsGetRequestBuilder.java: + id: acf97a47458e + last_write_checksum: sha1:38e59bac457dcd87319b58620a095a3f2d06348f + pristine_git_object: 7c12088cde716fdfb0498a8c12fbe8728b11bddd + src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsGetResponse.java: + id: 10e964f47660 + last_write_checksum: sha1:f95774eddeaf8c0cf53b6e4c312c1cffd8735eab + pristine_git_object: 85f533a8b7cd39d355ce6d494623918836a843c6 + src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsListRequest.java: + id: 0c784c11f038 + last_write_checksum: sha1:c3f6882b97ce023c15b636b7ebe9c5a36c492f0a + pristine_git_object: ad2303005c0384c3f9619d2a830802d5c1d1d590 + src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsListRequestBuilder.java: + id: c4faa9ffd8e1 + last_write_checksum: sha1:3bceb47670a1e9b7ad60b723dc20d1d5f5d87212 + pristine_git_object: b242ac171532c22c30286be83cef859f9e78b70f + src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsListResponse.java: + id: 61140aa877b7 + last_write_checksum: sha1:6775d5e44002f34ae44149a052c6e021f95eaf8f + pristine_git_object: 4194c210069a13c26c2fb968462ac25ffecbe13f src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1AdddatasourceRequestBuilder.java: id: 12cfb3a208c3 last_write_checksum: sha1:46483ea129771ac3bc157a1e7bfcc5f672bb645b @@ -8929,6 +9053,14 @@ trackedFiles: id: c324b8a2e02b last_write_checksum: sha1:0ce35493af407ceddc10f68564a406736d6a2247 pristine_git_object: 2fe9dd653b898a2ac834b9bc870086e4e200f75f + src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformSkillsGetResponse.java: + id: d9bcb05e5190 + last_write_checksum: sha1:4e382b701048c2bb3730a1b7a0874016aae8cfb6 + pristine_git_object: bcb83e3e72f78a50f7775192ee046e8bbb99a5eb + src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformSkillsListResponse.java: + id: 7213f13e0653 + last_write_checksum: sha1:d14803de77e8aab0f74f6184bcb144234469ddbd + pristine_git_object: f2aa06a9634325edd0eae111a7be75a80b5c6aa4 src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PostApiIndexV1AdddatasourceResponse.java: id: 8063718dd4c6 last_write_checksum: sha1:8f5180b2a2f460afab4f8278f71524ab24d411eb @@ -9481,6 +9613,14 @@ trackedFiles: id: 9b5d67796029 last_write_checksum: sha1:f5c9d065cb970a5852c4c8fa32456c92d63d3095 pristine_git_object: 9cf91fe44e9b5e8e4cc98dd62a2adce6b40df81a + src/main/java/com/glean/api_client/glean_api_client/operations/PlatformSkillsGet.java: + id: 35379a4f4ed2 + last_write_checksum: sha1:e7dca9cc453438718bcfa8f84348362b02e2f655 + pristine_git_object: 612b0dfc1430a9af27b9956c4575229c14e7b084 + src/main/java/com/glean/api_client/glean_api_client/operations/PlatformSkillsList.java: + id: f9f1d5a5462f + last_write_checksum: sha1:8974aef09c86c4ed1aa10691bad55f7c336da56d + pristine_git_object: 1bb80ab1ef4611a76cd715b5bbde367ce8304ec6 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1Adddatasource.java: id: 06627a85321f last_write_checksum: sha1:0a738b10de0b1c822504f5cee019a66bb4bdf35c @@ -10969,6 +11109,27 @@ examples: responses: "200": application/json: {"authorizationUrl": "https://shocked-casket.name/"} + platform-skills-list: + speakeasy-default-platform-skills-list: + responses: + "200": + application/json: {"skills": [], "has_more": true, "next_cursor": "", "request_id": ""} + "400": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-skills-get: + speakeasy-default-platform-skills-get: + parameters: + path: + skill_id: "" + responses: + "200": + application/json: {"skill": {"id": "", "display_name": "Chad_Herzog", "description": "whenever up aha controvert", "latest_version": 151495, "latest_minor_version": 170771, "status": "DISABLED", "origin": "CUSTOM", "owner": {"name": ""}, "created_at": "2024-12-25T16:41:00.099Z", "updated_at": "2026-12-07T21:59:59.375Z"}, "request_id": ""} + "400": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} examplesVersion: 1.0.2 generatedTests: activity: "2025-06-09T18:03:44Z" @@ -11111,7 +11272,10 @@ generatedTests: get_/rest/api/v1/tools/list: "2025-06-09T18:03:44Z" post_/rest/api/v1/tools/call: "2025-06-09T18:03:44Z" listpolicies: "2025-06-09T18:03:44Z" -releaseNotes: "## Java SDK Changes:\n* `glean.client.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" +releaseNotes: | + ## Java SDK Changes: + * `glean.platform.skills.list()`: **Added** + * `glean.platform.skills.retrieve()`: **Added** generatedFiles: - .gitattributes - USAGE.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 786fdb02..c0ca718b 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -30,7 +30,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false java: - version: 0.14.3 + version: 0.14.4 additionalDependencies: [] additionalPlugins: [] artifactID: glean-api-client diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index a1f493a7..290a17c8 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -2,8 +2,8 @@ openapi: 3.0.0 info: version: "0.9.0" title: Glean API - x-source-commit-sha: 270b693d49bac2f68e751b2345bac0c267741119 - x-open-api-commit-sha: 592aec2b4913505edb8161645eaf9a72b5286f20 + x-source-commit-sha: a6a475757a3799d2146d7b0d0db2ae609b6bdc0f + x-open-api-commit-sha: 3f74e993e22cee24401a816dc24063d4e4bec47b description: | # Introduction In addition to the data sources that Glean has built-in support for, Glean also provides a REST API that enables customers to put arbitrary content in the search index. This is useful, for example, for doing permissions-aware search over content in internal tools that reside on-prem as well as for searching over applications that Glean does not currently support first class. In addition these APIs allow the customer to push organization data (people info, organization structure etc) into Glean. @@ -250,6 +250,108 @@ paths: x-speakeasy-name-override: createRun security: - APIToken: [] + /api/skills: + get: + tags: + - Skills + summary: List skills + description: | + List skills available to the authenticated user. + operationId: platform-skills-list + x-visibility: Public + x-glean-experimental: + id: 3eb65937-03a3-472b-9a00-be713f302b5f + introduced: "2026-06-23" + parameters: + - in: query + name: page_size + description: Maximum number of skills to return. + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + - in: query + name: cursor + description: Opaque pagination cursor from a previous response. + required: false + schema: + type: string + minLength: 1 + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformSkillsListResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: platform.skills + x-speakeasy-name-override: list + security: + - APIToken: [] + /api/skills/{skill_id}: + get: + tags: + - Skills + summary: Retrieve skill + description: | + Retrieve metadata for a skill available to the authenticated user. + operationId: platform-skills-get + x-visibility: Public + x-glean-experimental: + id: 8f8d1c92-a484-4769-9903-200613dc8a72 + introduced: "2026-06-23" + parameters: + - name: skill_id + in: path + required: true + description: Glean skill ID. + schema: + type: string + minLength: 1 + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformSkillGetResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: platform.skills + x-speakeasy-name-override: retrieve + security: + - APIToken: [] /api/search: post: tags: @@ -5479,6 +5581,138 @@ components: request_id: type: string description: Platform-generated request ID for support correlation. + PlatformSkillStatus: + type: string + enum: + - DRAFT + - ENABLED + - DISABLED + description: Current skill status. + PlatformSkillOrigin: + type: string + enum: + - CUSTOM + description: Source category for the skill. + PlatformSkillSyncStatus: + type: string + enum: + - UP_TO_DATE + - UPDATE_AVAILABLE + - SYNC_FAILED + description: Current external-source sync status. + PlatformSkillSourceProvenance: + type: object + properties: + source_url: + type: string + description: URL of the external source the skill was imported from. + commit_sha: + type: string + description: Source commit SHA for the imported skill. + imported_at: + type: string + format: date-time + description: Time the skill was imported. + last_synced_at: + type: string + format: date-time + description: Time the skill was last synced from its source. + sync_status: + $ref: "#/components/schemas/PlatformSkillSyncStatus" + sync_error: + type: string + description: Human-readable sync failure reason, present only when sync_status is SYNC_FAILED. + PlatformPersonReference: + type: object + description: A lightweight reference to a person, used where a payload merely points at someone. + required: + - name + properties: + id: + type: string + description: Opaque Glean person ID. + name: + type: string + description: Display name. + PlatformSkill: + type: object + required: + - id + - display_name + - description + - latest_version + - latest_minor_version + - status + - origin + - owner + - created_at + - updated_at + properties: + id: + type: string + description: Glean skill ID. + display_name: + type: string + description: Human-readable skill name. + description: + type: string + description: Human-readable skill description. + latest_version: + type: integer + description: Latest major version number for the skill. + latest_minor_version: + type: integer + description: Latest minor version number for the skill. + status: + $ref: "#/components/schemas/PlatformSkillStatus" + origin: + $ref: "#/components/schemas/PlatformSkillOrigin" + source_provenance: + $ref: "#/components/schemas/PlatformSkillSourceProvenance" + owner: + $ref: "#/components/schemas/PlatformPersonReference" + created_at: + type: string + format: date-time + description: Time the skill was created. + updated_at: + type: string + format: date-time + description: Time the skill was last updated. + PlatformSkillsListResponse: + type: object + required: + - skills + - has_more + - next_cursor + - request_id + properties: + skills: + type: array + description: Skills available to the user. + items: + $ref: "#/components/schemas/PlatformSkill" + has_more: + type: boolean + description: Whether additional results are available. + next_cursor: + type: string + nullable: true + description: Cursor for the next page, or null when no more results are available. + request_id: + type: string + description: Platform-generated request ID for support correlation. + PlatformSkillGetResponse: + type: object + required: + - skill + - request_id + properties: + skill: + $ref: "#/components/schemas/PlatformSkill" + request_id: + type: string + description: Platform-generated request ID for support correlation. PlatformFilterOperator: type: string description: Supported filter operator. @@ -5579,18 +5813,6 @@ components: Structured filters applied to search results. Equality operators OR multiple values within a filter. Multiple filters are AND'd together, including range filters on the same field. Filters are AND'd with any inline operators in `query`. Note that conflicting constraints on the same field (e.g., `type:document` in the query and `type: spreadsheet` in a filter) produce an empty result set. time_range: $ref: "#/components/schemas/PlatformTimeRange" - PlatformPersonReference: - type: object - description: A lightweight reference to a person, used where a payload merely points at someone. - required: - - name - properties: - id: - type: string - description: Opaque Glean person ID. - name: - type: string - description: Display name. PlatformResult: type: object required: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index ed0d1379..e50bab68 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.789.2 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:145236c33451e6e87cf1507a4d8829678b0df02af59afc9341330627e33ed760 - sourceBlobDigest: sha256:862b1370a65d146eac83f86c6fbd2d787f04ea93c2cf28259af5ded934f9fb3b + sourceRevisionDigest: sha256:f5ae8d5309190d64c093519c5102cb3d4d6da1315a4fc86be83598d33185a55a + sourceBlobDigest: sha256:4473e76be6cb393aa28cf300cb3aee22d91366e47b0c1afebc1ab79a1f4dd36d tags: - latest Glean-OAS: @@ -17,10 +17,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:145236c33451e6e87cf1507a4d8829678b0df02af59afc9341330627e33ed760 - sourceBlobDigest: sha256:862b1370a65d146eac83f86c6fbd2d787f04ea93c2cf28259af5ded934f9fb3b + sourceRevisionDigest: sha256:f5ae8d5309190d64c093519c5102cb3d4d6da1315a4fc86be83598d33185a55a + sourceBlobDigest: sha256:4473e76be6cb393aa28cf300cb3aee22d91366e47b0c1afebc1ab79a1f4dd36d codeSamplesNamespace: glean-api-specs-java-code-samples - codeSamplesRevisionDigest: sha256:8ece00a5293a8b8a6ba95820e2cbeb8403fe62126b980b4fe41338b20b87982a + codeSamplesRevisionDigest: sha256:790ffb29fa42b1186061cc6916b8571afe56ff81f9ba8954f871197c88412108 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 83329c00..d59c4ffe 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'com.glean.api-client:glean-api-client:0.14.3' +implementation 'com.glean.api-client:glean-api-client:0.14.4' ``` Maven: @@ -75,7 +75,7 @@ Maven: com.glean.api-client glean-api-client - 0.14.3 + 0.14.4 ``` @@ -598,6 +598,11 @@ For more information on obtaining the appropriate token type, please contact you * [bulkIndex](docs/sdks/indexingshortcuts/README.md#bulkindex) - Bulk index external shortcuts * [upload](docs/sdks/indexingshortcuts/README.md#upload) - Upload shortcuts +### [Platform.Skills](docs/sdks/skills/README.md) + +* [list](docs/sdks/skills/README.md#list) - List skills +* [retrieve](docs/sdks/skills/README.md#retrieve) - Retrieve skill + ### [Search](docs/sdks/search/README.md) * [query](docs/sdks/search/README.md#query) - Search @@ -707,11 +712,11 @@ public class Application { many more subclasses in the JDK platform). **Inherit from [`GleanError`](./src/main/java/models/errors/GleanError.java)**: -* [`com.glean.api_client.glean_api_client.models.errors.ErrorResponse`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.ErrorResponse.java): Error response returned for failed requests. Applicable to 9 of 137 methods.* -* [`com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException.java): Error response following RFC 9457, extended with `code` and `documentation_url` for machine-readable classification and self-service remediation. Applicable to 5 of 137 methods.* -* [`com.glean.api_client.glean_api_client.models.errors.ErrorInfoResponse`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.ErrorInfoResponse.java): Error response for custom metadata operations. Applicable to 5 of 137 methods.* -* [`com.glean.api_client.glean_api_client.models.errors.CollectionError`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.CollectionError.java): Semantic error. Status code `422`. Applicable to 3 of 137 methods.* -* [`com.glean.api_client.glean_api_client.models.errors.GleanDataError`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.GleanDataError.java): Forbidden. Applicable to 2 of 137 methods.* +* [`com.glean.api_client.glean_api_client.models.errors.ErrorResponse`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.ErrorResponse.java): Error response returned for failed requests. Applicable to 9 of 139 methods.* +* [`com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException.java): Error response following RFC 9457, extended with `code` and `documentation_url` for machine-readable classification and self-service remediation. Applicable to 7 of 139 methods.* +* [`com.glean.api_client.glean_api_client.models.errors.ErrorInfoResponse`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.ErrorInfoResponse.java): Error response for custom metadata operations. Applicable to 5 of 139 methods.* +* [`com.glean.api_client.glean_api_client.models.errors.CollectionError`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.CollectionError.java): Semantic error. Status code `422`. Applicable to 3 of 139 methods.* +* [`com.glean.api_client.glean_api_client.models.errors.GleanDataError`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.GleanDataError.java): Forbidden. Applicable to 2 of 139 methods.* diff --git a/RELEASES.md b/RELEASES.md index a0a4eb51..05f06cf4 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -798,4 +798,14 @@ Based on: ### Generated - [java v0.14.3] . ### Releases -- [Maven Central v0.14.3] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.14.3 - . \ No newline at end of file +- [Maven Central v0.14.3] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.14.3 - . + +## 2026-07-11 03:23:01 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.789.2 (2.916.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v0.14.4] . +### Releases +- [Maven Central v0.14.4] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.14.4 - . \ 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..ae055121 --- /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` | *long* | :heavy_check_mark: | Latest major version number for the skill. | +| `latestMinorVersion` | *long* | :heavy_check_mark: | Latest minor version number for the skill. | +| `status` | [PlatformSkillStatus](../../models/components/PlatformSkillStatus.md) | :heavy_check_mark: | Current skill status. | +| `origin` | [PlatformSkillOrigin](../../models/components/PlatformSkillOrigin.md) | :heavy_check_mark: | Source category for the skill. | +| `sourceProvenance` | [Optional\](../../models/components/PlatformSkillSourceProvenance.md) | :heavy_minus_sign: | N/A | +| `owner` | [PlatformPersonReference](../../models/components/PlatformPersonReference.md) | :heavy_check_mark: | A lightweight reference to a person, used where a payload merely points at someone. | +| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | Time the skill was created. | +| `updatedAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :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..295031b7 --- /dev/null +++ b/docs/models/components/PlatformSkillGetResponse.md @@ -0,0 +1,9 @@ +# PlatformSkillGetResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `skill` | [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..aa217c27 --- /dev/null +++ b/docs/models/components/PlatformSkillOrigin.md @@ -0,0 +1,18 @@ +# PlatformSkillOrigin + +Source category for the skill. + +## Example Usage + +```java +import com.glean.api_client.glean_api_client.models.components.PlatformSkillOrigin; + +PlatformSkillOrigin value = PlatformSkillOrigin.CUSTOM; +``` + + +## Values + +| Name | Value | +| -------- | -------- | +| `CUSTOM` | CUSTOM | \ 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..a42f8d71 --- /dev/null +++ b/docs/models/components/PlatformSkillSourceProvenance.md @@ -0,0 +1,13 @@ +# PlatformSkillSourceProvenance + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `sourceUrl` | *Optional\* | :heavy_minus_sign: | URL of the external source the skill was imported from. | +| `commitSha` | *Optional\* | :heavy_minus_sign: | Source commit SHA for the imported skill. | +| `importedAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | Time the skill was imported. | +| `lastSyncedAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | Time the skill was last synced from its source. | +| `syncStatus` | [Optional\](../../models/components/PlatformSkillSyncStatus.md) | :heavy_minus_sign: | Current external-source sync status. | +| `syncError` | *Optional\* | :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..f3ebbcf2 --- /dev/null +++ b/docs/models/components/PlatformSkillStatus.md @@ -0,0 +1,23 @@ +# PlatformSkillStatus + +Current skill status. + +## Example Usage + +```java +import com.glean.api_client.glean_api_client.models.components.PlatformSkillStatus; + +PlatformSkillStatus value = PlatformSkillStatus.DRAFT; + +// Open enum: use .of() to create instances from custom string values +PlatformSkillStatus custom = PlatformSkillStatus.of("custom_value"); +``` + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `DRAFT` | DRAFT | +| `ENABLED` | ENABLED | +| `DISABLED` | 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..d8195068 --- /dev/null +++ b/docs/models/components/PlatformSkillSyncStatus.md @@ -0,0 +1,23 @@ +# PlatformSkillSyncStatus + +Current external-source sync status. + +## Example Usage + +```java +import com.glean.api_client.glean_api_client.models.components.PlatformSkillSyncStatus; + +PlatformSkillSyncStatus value = PlatformSkillSyncStatus.UP_TO_DATE; + +// Open enum: use .of() to create instances from custom string values +PlatformSkillSyncStatus custom = PlatformSkillSyncStatus.of("custom_value"); +``` + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `UP_TO_DATE` | UP_TO_DATE | +| `UPDATE_AVAILABLE` | UPDATE_AVAILABLE | +| `SYNC_FAILED` | SYNC_FAILED | \ No newline at end of file diff --git a/docs/models/components/PlatformSkillsListResponse.md b/docs/models/components/PlatformSkillsListResponse.md new file mode 100644 index 00000000..1a206faa --- /dev/null +++ b/docs/models/components/PlatformSkillsListResponse.md @@ -0,0 +1,11 @@ +# PlatformSkillsListResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `skills` | List\<[PlatformSkill](../../models/components/PlatformSkill.md)> | :heavy_check_mark: | Skills available to the user. | +| `hasMore` | *boolean* | :heavy_check_mark: | Whether additional results are available. | +| `nextCursor` | *Optional\* | :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/operations/PlatformSkillsGetRequest.md b/docs/models/operations/PlatformSkillsGetRequest.md new file mode 100644 index 00000000..1e6a21c8 --- /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..a2da05c0 --- /dev/null +++ b/docs/models/operations/PlatformSkillsGetResponse.md @@ -0,0 +1,11 @@ +# PlatformSkillsGetResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `platformSkillGetResponse` | [Optional\](../../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..15f66cfe --- /dev/null +++ b/docs/models/operations/PlatformSkillsListRequest.md @@ -0,0 +1,9 @@ +# PlatformSkillsListRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `pageSize` | *Optional\* | :heavy_minus_sign: | Maximum number of skills to return. | +| `cursor` | *Optional\* | :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..c362bbc1 --- /dev/null +++ b/docs/models/operations/PlatformSkillsListResponse.md @@ -0,0 +1,11 @@ +# PlatformSkillsListResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `platformSkillsListResponse` | [Optional\](../../models/components/PlatformSkillsListResponse.md) | :heavy_minus_sign: | Successful response. | \ 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..132af797 --- /dev/null +++ b/docs/sdks/skills/README.md @@ -0,0 +1,114 @@ +# Platform.Skills + +## Overview + +### Available Operations + +* [list](#list) - List skills +* [retrieve](#retrieve) - Retrieve skill + +## list + +List skills available to the authenticated user. + + +### Example Usage + + +```java +package hello.world; + +import com.glean.api_client.glean_api_client.Glean; +import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException; +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsListResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws PlatformProblemDetailException, Exception { + + Glean sdk = Glean.builder() + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) + .build(); + + PlatformSkillsListResponse res = sdk.platform().skills().list() + .call(); + + if (res.platformSkillsListResponse().isPresent()) { + System.out.println(res.platformSkillsListResponse().get()); + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `pageSize` | *Optional\* | :heavy_minus_sign: | Maximum number of skills to return. | +| `cursor` | *Optional\* | :heavy_minus_sign: | Opaque pagination cursor from a previous response. | + +### Response + +**[PlatformSkillsListResponse](../../models/operations/PlatformSkillsListResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| models/errors/PlatformProblemDetailException | 400, 401, 403, 404, 408, 429 | application/problem+json | +| models/errors/PlatformProblemDetailException | 500, 503 | application/problem+json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## retrieve + +Retrieve metadata for a skill available to the authenticated user. + + +### Example Usage + + +```java +package hello.world; + +import com.glean.api_client.glean_api_client.Glean; +import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException; +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsGetResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws PlatformProblemDetailException, Exception { + + Glean sdk = Glean.builder() + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) + .build(); + + PlatformSkillsGetResponse res = sdk.platform().skills().retrieve() + .skillId("") + .call(); + + if (res.platformSkillGetResponse().isPresent()) { + System.out.println(res.platformSkillGetResponse().get()); + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `skillId` | *String* | :heavy_check_mark: | Glean skill ID. | + +### Response + +**[PlatformSkillsGetResponse](../../models/operations/PlatformSkillsGetResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| models/errors/PlatformProblemDetailException | 400, 401, 403, 404, 408, 429 | application/problem+json | +| models/errors/PlatformProblemDetailException | 500, 503 | application/problem+json | +| models/errors/APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 947c27d5..706f8978 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ groupId=com.glean.api-client artifactId=glean-api-client -version=0.14.3 +version=0.14.4 org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g diff --git a/src/main/java/com/glean/api_client/glean_api_client/AsyncGlean.java b/src/main/java/com/glean/api_client/glean_api_client/AsyncGlean.java index 043e1a83..9968a62f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/AsyncGlean.java +++ b/src/main/java/com/glean/api_client/glean_api_client/AsyncGlean.java @@ -36,6 +36,8 @@ public class AsyncGlean { private final AsyncAgents agents; + private final AsyncPlatform platform; + private final AsyncSearch search; private final AsyncClient client; @@ -46,6 +48,10 @@ public AsyncAgents agents() { return agents; } + public AsyncPlatform platform() { + return platform; + } + public AsyncSearch search() { return search; } @@ -65,6 +71,7 @@ public AsyncIndexing indexing() { this.syncSDK = syncSDK; this.sdkConfiguration = sdkConfiguration; this.agents = new AsyncAgents(syncSDK.agents(), sdkConfiguration); + this.platform = new AsyncPlatform(syncSDK.platform(), sdkConfiguration); this.search = new AsyncSearch(syncSDK.search(), sdkConfiguration); this.client = new AsyncClient(syncSDK.client(), sdkConfiguration); this.indexing = new AsyncIndexing(syncSDK.indexing(), sdkConfiguration); diff --git a/src/main/java/com/glean/api_client/glean_api_client/AsyncPlatform.java b/src/main/java/com/glean/api_client/glean_api_client/AsyncPlatform.java new file mode 100644 index 00000000..9383ab57 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/AsyncPlatform.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c2862f050fcc + */ +package com.glean.api_client.glean_api_client; + +import com.glean.api_client.glean_api_client.utils.Headers; + + +public class AsyncPlatform { + private static final Headers _headers = Headers.EMPTY; + private final SDKConfiguration sdkConfiguration; + private final AsyncSkills skills; + private final Platform syncSDK; + + AsyncPlatform(Platform syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.skills = new AsyncSkills(syncSDK.skills(), this.sdkConfiguration); + this.syncSDK = syncSDK; + } + + public final AsyncSkills skills() { + return skills; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Platform sync() { + return syncSDK; + } + +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/AsyncSkills.java b/src/main/java/com/glean/api_client/glean_api_client/AsyncSkills.java new file mode 100644 index 00000000..e27ff094 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/AsyncSkills.java @@ -0,0 +1,120 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 809381bacfb1 + */ +package com.glean.api_client.glean_api_client; + +import static com.glean.api_client.glean_api_client.operations.Operations.AsyncRequestOperation; + +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsGetRequest; +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsListRequest; +import com.glean.api_client.glean_api_client.models.operations.async.PlatformSkillsGetRequestBuilder; +import com.glean.api_client.glean_api_client.models.operations.async.PlatformSkillsGetResponse; +import com.glean.api_client.glean_api_client.models.operations.async.PlatformSkillsListRequestBuilder; +import com.glean.api_client.glean_api_client.models.operations.async.PlatformSkillsListResponse; +import com.glean.api_client.glean_api_client.operations.PlatformSkillsGet; +import com.glean.api_client.glean_api_client.operations.PlatformSkillsList; +import com.glean.api_client.glean_api_client.utils.Headers; +import java.lang.Long; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + + +public class AsyncSkills { + private static final Headers _headers = Headers.EMPTY; + private final SDKConfiguration sdkConfiguration; + private final Skills syncSDK; + + AsyncSkills(Skills syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Skills sync() { + return syncSDK; + } + + + /** + * List skills + * + *

List skills available to the authenticated user. + * + * @return The async call builder + */ + public PlatformSkillsListRequestBuilder list() { + return new PlatformSkillsListRequestBuilder(sdkConfiguration); + } + + /** + * List skills + * + *

List skills available to the authenticated user. + * + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture listDirect() { + return list(Optional.empty(), Optional.empty()); + } + + /** + * List skills + * + *

List skills available to the authenticated user. + * + * @param pageSize Maximum number of skills to return. + * @param cursor Opaque pagination cursor from a previous response. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture list(Optional pageSize, Optional cursor) { + PlatformSkillsListRequest request = + PlatformSkillsListRequest + .builder() + .pageSize(pageSize) + .cursor(cursor) + .build(); + AsyncRequestOperation operation + = new PlatformSkillsList.Async(sdkConfiguration, _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Retrieve skill + * + *

Retrieve metadata for a skill available to the authenticated user. + * + * @return The async call builder + */ + public PlatformSkillsGetRequestBuilder retrieve() { + return new PlatformSkillsGetRequestBuilder(sdkConfiguration); + } + + /** + * Retrieve skill + * + *

Retrieve metadata for a skill available to the authenticated user. + * + * @param skillId Glean skill ID. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture retrieve(String skillId) { + PlatformSkillsGetRequest request = + PlatformSkillsGetRequest + .builder() + .skillId(skillId) + .build(); + AsyncRequestOperation operation + = new PlatformSkillsGet.Async(sdkConfiguration, _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/Glean.java b/src/main/java/com/glean/api_client/glean_api_client/Glean.java index 3a902376..23e3e170 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Glean.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Glean.java @@ -58,6 +58,9 @@ public class Glean { private final Agents agents; + private final Platform platform; + + private final Search search; @@ -72,6 +75,11 @@ public Agents agents() { } + public Platform platform() { + return platform; + } + + public Search search() { return search; } @@ -252,6 +260,7 @@ public static Builder builder() { private Glean(SDKConfiguration sdkConfiguration) { sdkConfiguration.initialize(); this.agents = new Agents(sdkConfiguration); + this.platform = new Platform(sdkConfiguration); this.search = new Search(sdkConfiguration); this.client = new Client(sdkConfiguration); this.indexing = new Indexing(sdkConfiguration); diff --git a/src/main/java/com/glean/api_client/glean_api_client/Platform.java b/src/main/java/com/glean/api_client/glean_api_client/Platform.java new file mode 100644 index 00000000..6f6536fb --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/Platform.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b8013fc2d58e + */ +package com.glean.api_client.glean_api_client; + +import com.glean.api_client.glean_api_client.utils.Headers; + + +public class Platform { + private static final Headers _headers = Headers.EMPTY; + private final SDKConfiguration sdkConfiguration; + private final AsyncPlatform asyncSDK; + private final Skills skills; + + Platform(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.skills = new Skills(this.sdkConfiguration); + this.asyncSDK = new AsyncPlatform(this, sdkConfiguration); + } + + public final Skills skills() { + return skills; + } + + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncPlatform async() { + return asyncSDK; + } + +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java b/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java index f24764cd..cbb3d90e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java +++ b/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java @@ -25,7 +25,7 @@ public class SDKConfiguration { private static final String LANGUAGE = "java"; public static final String OPENAPI_DOC_VERSION = "0.9.0"; - public static final String SDK_VERSION = "0.14.3"; + public static final String SDK_VERSION = "0.14.4"; public static final String GEN_VERSION = "2.916.4"; private static final String BASE_PACKAGE = "com.glean.api_client.glean_api_client"; public static final String USER_AGENT = diff --git a/src/main/java/com/glean/api_client/glean_api_client/Skills.java b/src/main/java/com/glean/api_client/glean_api_client/Skills.java new file mode 100644 index 00000000..1273572e --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/Skills.java @@ -0,0 +1,118 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6903ae835067 + */ +package com.glean.api_client.glean_api_client; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsGetRequest; +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsGetRequestBuilder; +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsGetResponse; +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsListRequest; +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsListRequestBuilder; +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsListResponse; +import com.glean.api_client.glean_api_client.operations.PlatformSkillsGet; +import com.glean.api_client.glean_api_client.operations.PlatformSkillsList; +import com.glean.api_client.glean_api_client.utils.Headers; +import java.lang.Long; +import java.lang.String; +import java.util.Optional; + + +public class Skills { + private static final Headers _headers = Headers.EMPTY; + private final SDKConfiguration sdkConfiguration; + private final AsyncSkills asyncSDK; + + Skills(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncSkills(this, sdkConfiguration); + } + + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncSkills async() { + return asyncSDK; + } + + /** + * List skills + * + *

List skills available to the authenticated user. + * + * @return The call builder + */ + public PlatformSkillsListRequestBuilder list() { + return new PlatformSkillsListRequestBuilder(sdkConfiguration); + } + + /** + * List skills + * + *

List skills available to the authenticated user. + * + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public PlatformSkillsListResponse listDirect() { + return list(Optional.empty(), Optional.empty()); + } + + /** + * List skills + * + *

List skills available to the authenticated user. + * + * @param pageSize Maximum number of skills to return. + * @param cursor Opaque pagination cursor from a previous response. + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public PlatformSkillsListResponse list(Optional pageSize, Optional cursor) { + PlatformSkillsListRequest request = + PlatformSkillsListRequest + .builder() + .pageSize(pageSize) + .cursor(cursor) + .build(); + RequestOperation operation + = new PlatformSkillsList.Sync(sdkConfiguration, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Retrieve skill + * + *

Retrieve metadata for a skill available to the authenticated user. + * + * @return The call builder + */ + public PlatformSkillsGetRequestBuilder retrieve() { + return new PlatformSkillsGetRequestBuilder(sdkConfiguration); + } + + /** + * Retrieve skill + * + *

Retrieve metadata for a skill available to the authenticated user. + * + * @param skillId Glean skill ID. + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public PlatformSkillsGetResponse retrieve(String skillId) { + PlatformSkillsGetRequest request = + PlatformSkillsGetRequest + .builder() + .skillId(skillId) + .build(); + RequestOperation operation + = new PlatformSkillsGet.Sync(sdkConfiguration, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkill.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkill.java new file mode 100644 index 00000000..06ad3a27 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkill.java @@ -0,0 +1,535 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 11a29891a283 + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Long; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.OffsetDateTime; +import java.util.Optional; + + +public class PlatformSkill { + /** + * Glean skill ID. + */ + @JsonProperty("id") + private String id; + + /** + * Human-readable skill name. + */ + @JsonProperty("display_name") + private String displayName; + + /** + * Human-readable skill description. + */ + @JsonProperty("description") + private String description; + + /** + * Latest major version number for the skill. + */ + @JsonProperty("latest_version") + private long latestVersion; + + /** + * Latest minor version number for the skill. + */ + @JsonProperty("latest_minor_version") + private long latestMinorVersion; + + /** + * Current skill status. + */ + @JsonProperty("status") + private PlatformSkillStatus status; + + /** + * Source category for the skill. + */ + @JsonProperty("origin") + private PlatformSkillOrigin origin; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("source_provenance") + private Optional sourceProvenance; + + /** + * A lightweight reference to a person, used where a payload merely points at someone. + */ + @JsonProperty("owner") + private PlatformPersonReference owner; + + /** + * Time the skill was created. + */ + @JsonProperty("created_at") + private OffsetDateTime createdAt; + + /** + * Time the skill was last updated. + */ + @JsonProperty("updated_at") + private OffsetDateTime updatedAt; + + @JsonCreator + public PlatformSkill( + @JsonProperty("id") String id, + @JsonProperty("display_name") String displayName, + @JsonProperty("description") String description, + @JsonProperty("latest_version") long latestVersion, + @JsonProperty("latest_minor_version") long latestMinorVersion, + @JsonProperty("status") PlatformSkillStatus status, + @JsonProperty("origin") PlatformSkillOrigin origin, + @JsonProperty("source_provenance") Optional sourceProvenance, + @JsonProperty("owner") PlatformPersonReference owner, + @JsonProperty("created_at") OffsetDateTime createdAt, + @JsonProperty("updated_at") OffsetDateTime updatedAt) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(displayName, "displayName"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(latestVersion, "latestVersion"); + Utils.checkNotNull(latestMinorVersion, "latestMinorVersion"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(origin, "origin"); + Utils.checkNotNull(sourceProvenance, "sourceProvenance"); + Utils.checkNotNull(owner, "owner"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.id = id; + this.displayName = displayName; + this.description = description; + this.latestVersion = latestVersion; + this.latestMinorVersion = latestMinorVersion; + this.status = status; + this.origin = origin; + this.sourceProvenance = sourceProvenance; + this.owner = owner; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public PlatformSkill( + String id, + String displayName, + String description, + long latestVersion, + long latestMinorVersion, + PlatformSkillStatus status, + PlatformSkillOrigin origin, + PlatformPersonReference owner, + OffsetDateTime createdAt, + OffsetDateTime updatedAt) { + this(id, displayName, description, + latestVersion, latestMinorVersion, status, + origin, Optional.empty(), owner, + createdAt, updatedAt); + } + + /** + * Glean skill ID. + */ + @JsonIgnore + public String id() { + return id; + } + + /** + * Human-readable skill name. + */ + @JsonIgnore + public String displayName() { + return displayName; + } + + /** + * Human-readable skill description. + */ + @JsonIgnore + public String description() { + return description; + } + + /** + * Latest major version number for the skill. + */ + @JsonIgnore + public long latestVersion() { + return latestVersion; + } + + /** + * Latest minor version number for the skill. + */ + @JsonIgnore + public long latestMinorVersion() { + return latestMinorVersion; + } + + /** + * Current skill status. + */ + @JsonIgnore + public PlatformSkillStatus status() { + return status; + } + + /** + * Source category for the skill. + */ + @JsonIgnore + public PlatformSkillOrigin origin() { + return origin; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional sourceProvenance() { + return (Optional) sourceProvenance; + } + + /** + * A lightweight reference to a person, used where a payload merely points at someone. + */ + @JsonIgnore + public PlatformPersonReference owner() { + return owner; + } + + /** + * Time the skill was created. + */ + @JsonIgnore + public OffsetDateTime createdAt() { + return createdAt; + } + + /** + * Time the skill was last updated. + */ + @JsonIgnore + public OffsetDateTime updatedAt() { + return updatedAt; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Glean skill ID. + */ + public PlatformSkill withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Human-readable skill name. + */ + public PlatformSkill withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + /** + * Human-readable skill description. + */ + public PlatformSkill withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Latest major version number for the skill. + */ + public PlatformSkill withLatestVersion(long latestVersion) { + Utils.checkNotNull(latestVersion, "latestVersion"); + this.latestVersion = latestVersion; + return this; + } + + /** + * Latest minor version number for the skill. + */ + public PlatformSkill withLatestMinorVersion(long latestMinorVersion) { + Utils.checkNotNull(latestMinorVersion, "latestMinorVersion"); + this.latestMinorVersion = latestMinorVersion; + return this; + } + + /** + * Current skill status. + */ + public PlatformSkill withStatus(PlatformSkillStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Source category for the skill. + */ + public PlatformSkill withOrigin(PlatformSkillOrigin origin) { + Utils.checkNotNull(origin, "origin"); + this.origin = origin; + return this; + } + + public PlatformSkill withSourceProvenance(PlatformSkillSourceProvenance sourceProvenance) { + Utils.checkNotNull(sourceProvenance, "sourceProvenance"); + this.sourceProvenance = Optional.ofNullable(sourceProvenance); + return this; + } + + + public PlatformSkill withSourceProvenance(Optional sourceProvenance) { + Utils.checkNotNull(sourceProvenance, "sourceProvenance"); + this.sourceProvenance = sourceProvenance; + return this; + } + + /** + * A lightweight reference to a person, used where a payload merely points at someone. + */ + public PlatformSkill withOwner(PlatformPersonReference owner) { + Utils.checkNotNull(owner, "owner"); + this.owner = owner; + return this; + } + + /** + * Time the skill was created. + */ + public PlatformSkill withCreatedAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Time the skill was last updated. + */ + public PlatformSkill withUpdatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformSkill other = (PlatformSkill) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.displayName, other.displayName) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.latestVersion, other.latestVersion) && + Utils.enhancedDeepEquals(this.latestMinorVersion, other.latestMinorVersion) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.origin, other.origin) && + Utils.enhancedDeepEquals(this.sourceProvenance, other.sourceProvenance) && + Utils.enhancedDeepEquals(this.owner, other.owner) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, displayName, description, + latestVersion, latestMinorVersion, status, + origin, sourceProvenance, owner, + createdAt, updatedAt); + } + + @Override + public String toString() { + return Utils.toString(PlatformSkill.class, + "id", id, + "displayName", displayName, + "description", description, + "latestVersion", latestVersion, + "latestMinorVersion", latestMinorVersion, + "status", status, + "origin", origin, + "sourceProvenance", sourceProvenance, + "owner", owner, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String id; + + private String displayName; + + private String description; + + private Long latestVersion; + + private Long latestMinorVersion; + + private PlatformSkillStatus status; + + private PlatformSkillOrigin origin; + + private Optional sourceProvenance = Optional.empty(); + + private PlatformPersonReference owner; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Builder() { + // force use of static builder() method + } + + + /** + * Glean skill ID. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * Human-readable skill name. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + + /** + * Human-readable skill description. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + + /** + * Latest major version number for the skill. + */ + public Builder latestVersion(long latestVersion) { + Utils.checkNotNull(latestVersion, "latestVersion"); + this.latestVersion = latestVersion; + return this; + } + + + /** + * Latest minor version number for the skill. + */ + public Builder latestMinorVersion(long latestMinorVersion) { + Utils.checkNotNull(latestMinorVersion, "latestMinorVersion"); + this.latestMinorVersion = latestMinorVersion; + return this; + } + + + /** + * Current skill status. + */ + public Builder status(PlatformSkillStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Source category for the skill. + */ + public Builder origin(PlatformSkillOrigin origin) { + Utils.checkNotNull(origin, "origin"); + this.origin = origin; + return this; + } + + + public Builder sourceProvenance(PlatformSkillSourceProvenance sourceProvenance) { + Utils.checkNotNull(sourceProvenance, "sourceProvenance"); + this.sourceProvenance = Optional.ofNullable(sourceProvenance); + return this; + } + + public Builder sourceProvenance(Optional sourceProvenance) { + Utils.checkNotNull(sourceProvenance, "sourceProvenance"); + this.sourceProvenance = sourceProvenance; + return this; + } + + + /** + * A lightweight reference to a person, used where a payload merely points at someone. + */ + public Builder owner(PlatformPersonReference owner) { + Utils.checkNotNull(owner, "owner"); + this.owner = owner; + return this; + } + + + /** + * Time the skill was created. + */ + public Builder createdAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + + /** + * Time the skill was last updated. + */ + public Builder updatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public PlatformSkill build() { + + return new PlatformSkill( + id, displayName, description, + latestVersion, latestMinorVersion, status, + origin, sourceProvenance, owner, + createdAt, updatedAt); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillGetResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillGetResponse.java new file mode 100644 index 00000000..f442b75f --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillGetResponse.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 88de4cd9201f + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Override; +import java.lang.String; + + +public class PlatformSkillGetResponse { + + @JsonProperty("skill") + private PlatformSkill skill; + + /** + * Platform-generated request ID for support correlation. + */ + @JsonProperty("request_id") + private String requestId; + + @JsonCreator + public PlatformSkillGetResponse( + @JsonProperty("skill") PlatformSkill skill, + @JsonProperty("request_id") String requestId) { + Utils.checkNotNull(skill, "skill"); + Utils.checkNotNull(requestId, "requestId"); + this.skill = skill; + this.requestId = requestId; + } + + @JsonIgnore + public PlatformSkill skill() { + return skill; + } + + /** + * Platform-generated request ID for support correlation. + */ + @JsonIgnore + public String requestId() { + return requestId; + } + + public static Builder builder() { + return new Builder(); + } + + + public PlatformSkillGetResponse withSkill(PlatformSkill skill) { + Utils.checkNotNull(skill, "skill"); + this.skill = skill; + return this; + } + + /** + * Platform-generated request ID for support correlation. + */ + public PlatformSkillGetResponse withRequestId(String requestId) { + Utils.checkNotNull(requestId, "requestId"); + this.requestId = requestId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformSkillGetResponse other = (PlatformSkillGetResponse) o; + return + Utils.enhancedDeepEquals(this.skill, other.skill) && + Utils.enhancedDeepEquals(this.requestId, other.requestId); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + skill, requestId); + } + + @Override + public String toString() { + return Utils.toString(PlatformSkillGetResponse.class, + "skill", skill, + "requestId", requestId); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private PlatformSkill skill; + + private String requestId; + + private Builder() { + // force use of static builder() method + } + + + public Builder skill(PlatformSkill skill) { + Utils.checkNotNull(skill, "skill"); + this.skill = skill; + return this; + } + + + /** + * Platform-generated request ID for support correlation. + */ + public Builder requestId(String requestId) { + Utils.checkNotNull(requestId, "requestId"); + this.requestId = requestId; + return this; + } + + public PlatformSkillGetResponse build() { + + return new PlatformSkillGetResponse( + skill, requestId); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillOrigin.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillOrigin.java new file mode 100644 index 00000000..2694ce8a --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillOrigin.java @@ -0,0 +1,129 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 673d58eb0c96 + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.Override; +import java.lang.String; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +/** + * Wrapper for an "open" enum that can handle unknown values from API responses + * without runtime errors. Instances are immutable singletons with reference equality. + * Use {@code asEnum()} for switch expressions. + */ +/** + * PlatformSkillOrigin + * + *

Source category for the skill. + */ +public class PlatformSkillOrigin { + + public static final PlatformSkillOrigin CUSTOM = new PlatformSkillOrigin("CUSTOM"); + + // This map will grow whenever a Color gets created with a new + // unrecognized value (a potential memory leak if the user is not + // careful). Keep this field lower case to avoid clashing with + // generated member names which will always be upper cased (Java + // convention) + private static final Map values = createValuesMap(); + private static final Map enums = createEnumsMap(); + + private final String value; + + private PlatformSkillOrigin(String value) { + this.value = value; + } + + /** + * Returns a PlatformSkillOrigin with the given value. For a specific value the + * returned object will always be a singleton so reference equality + * is satisfied when the values are the same. + * + * @param value value to be wrapped as PlatformSkillOrigin + */ + @JsonCreator + public static PlatformSkillOrigin of(String value) { + synchronized (PlatformSkillOrigin.class) { + return values.computeIfAbsent(value, v -> new PlatformSkillOrigin(v)); + } + } + + @JsonValue + public String value() { + return value; + } + + public Optional asEnum() { + return Optional.ofNullable(enums.getOrDefault(value, null)); + } + + public boolean isKnown() { + return asEnum().isPresent(); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public boolean equals(java.lang.Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + PlatformSkillOrigin other = (PlatformSkillOrigin) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "PlatformSkillOrigin [value=" + value + "]"; + } + + // return an array just like an enum + public static PlatformSkillOrigin[] values() { + synchronized (PlatformSkillOrigin.class) { + return values.values().toArray(new PlatformSkillOrigin[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("CUSTOM", CUSTOM); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("CUSTOM", PlatformSkillOriginEnum.CUSTOM); + return map; + } + + + public enum PlatformSkillOriginEnum { + + CUSTOM("CUSTOM"),; + + private final String value; + + private PlatformSkillOriginEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} + diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillSourceProvenance.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillSourceProvenance.java new file mode 100644 index 00000000..de7125a5 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillSourceProvenance.java @@ -0,0 +1,435 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 1fb785647231 + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.OffsetDateTime; +import java.util.Optional; + + +public class PlatformSkillSourceProvenance { + /** + * URL of the external source the skill was imported from. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("source_url") + private Optional sourceUrl; + + /** + * Source commit SHA for the imported skill. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("commit_sha") + private Optional commitSha; + + /** + * Time the skill was imported. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("imported_at") + private Optional importedAt; + + /** + * Time the skill was last synced from its source. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_synced_at") + private Optional lastSyncedAt; + + /** + * Current external-source sync status. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sync_status") + private Optional syncStatus; + + /** + * Human-readable sync failure reason, present only when sync_status is SYNC_FAILED. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sync_error") + private Optional syncError; + + @JsonCreator + public PlatformSkillSourceProvenance( + @JsonProperty("source_url") Optional sourceUrl, + @JsonProperty("commit_sha") Optional commitSha, + @JsonProperty("imported_at") Optional importedAt, + @JsonProperty("last_synced_at") Optional lastSyncedAt, + @JsonProperty("sync_status") Optional syncStatus, + @JsonProperty("sync_error") Optional syncError) { + Utils.checkNotNull(sourceUrl, "sourceUrl"); + Utils.checkNotNull(commitSha, "commitSha"); + Utils.checkNotNull(importedAt, "importedAt"); + Utils.checkNotNull(lastSyncedAt, "lastSyncedAt"); + Utils.checkNotNull(syncStatus, "syncStatus"); + Utils.checkNotNull(syncError, "syncError"); + this.sourceUrl = sourceUrl; + this.commitSha = commitSha; + this.importedAt = importedAt; + this.lastSyncedAt = lastSyncedAt; + this.syncStatus = syncStatus; + this.syncError = syncError; + } + + public PlatformSkillSourceProvenance() { + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * URL of the external source the skill was imported from. + */ + @JsonIgnore + public Optional sourceUrl() { + return sourceUrl; + } + + /** + * Source commit SHA for the imported skill. + */ + @JsonIgnore + public Optional commitSha() { + return commitSha; + } + + /** + * Time the skill was imported. + */ + @JsonIgnore + public Optional importedAt() { + return importedAt; + } + + /** + * Time the skill was last synced from its source. + */ + @JsonIgnore + public Optional lastSyncedAt() { + return lastSyncedAt; + } + + /** + * Current external-source sync status. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional syncStatus() { + return (Optional) syncStatus; + } + + /** + * Human-readable sync failure reason, present only when sync_status is SYNC_FAILED. + */ + @JsonIgnore + public Optional syncError() { + return syncError; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * URL of the external source the skill was imported from. + */ + public PlatformSkillSourceProvenance withSourceUrl(String sourceUrl) { + Utils.checkNotNull(sourceUrl, "sourceUrl"); + this.sourceUrl = Optional.ofNullable(sourceUrl); + return this; + } + + + /** + * URL of the external source the skill was imported from. + */ + public PlatformSkillSourceProvenance withSourceUrl(Optional sourceUrl) { + Utils.checkNotNull(sourceUrl, "sourceUrl"); + this.sourceUrl = sourceUrl; + return this; + } + + /** + * Source commit SHA for the imported skill. + */ + public PlatformSkillSourceProvenance withCommitSha(String commitSha) { + Utils.checkNotNull(commitSha, "commitSha"); + this.commitSha = Optional.ofNullable(commitSha); + return this; + } + + + /** + * Source commit SHA for the imported skill. + */ + public PlatformSkillSourceProvenance withCommitSha(Optional commitSha) { + Utils.checkNotNull(commitSha, "commitSha"); + this.commitSha = commitSha; + return this; + } + + /** + * Time the skill was imported. + */ + public PlatformSkillSourceProvenance withImportedAt(OffsetDateTime importedAt) { + Utils.checkNotNull(importedAt, "importedAt"); + this.importedAt = Optional.ofNullable(importedAt); + return this; + } + + + /** + * Time the skill was imported. + */ + public PlatformSkillSourceProvenance withImportedAt(Optional importedAt) { + Utils.checkNotNull(importedAt, "importedAt"); + this.importedAt = importedAt; + return this; + } + + /** + * Time the skill was last synced from its source. + */ + public PlatformSkillSourceProvenance withLastSyncedAt(OffsetDateTime lastSyncedAt) { + Utils.checkNotNull(lastSyncedAt, "lastSyncedAt"); + this.lastSyncedAt = Optional.ofNullable(lastSyncedAt); + return this; + } + + + /** + * Time the skill was last synced from its source. + */ + public PlatformSkillSourceProvenance withLastSyncedAt(Optional lastSyncedAt) { + Utils.checkNotNull(lastSyncedAt, "lastSyncedAt"); + this.lastSyncedAt = lastSyncedAt; + return this; + } + + /** + * Current external-source sync status. + */ + public PlatformSkillSourceProvenance withSyncStatus(PlatformSkillSyncStatus syncStatus) { + Utils.checkNotNull(syncStatus, "syncStatus"); + this.syncStatus = Optional.ofNullable(syncStatus); + return this; + } + + + /** + * Current external-source sync status. + */ + public PlatformSkillSourceProvenance withSyncStatus(Optional syncStatus) { + Utils.checkNotNull(syncStatus, "syncStatus"); + this.syncStatus = syncStatus; + return this; + } + + /** + * Human-readable sync failure reason, present only when sync_status is SYNC_FAILED. + */ + public PlatformSkillSourceProvenance withSyncError(String syncError) { + Utils.checkNotNull(syncError, "syncError"); + this.syncError = Optional.ofNullable(syncError); + return this; + } + + + /** + * Human-readable sync failure reason, present only when sync_status is SYNC_FAILED. + */ + public PlatformSkillSourceProvenance withSyncError(Optional syncError) { + Utils.checkNotNull(syncError, "syncError"); + this.syncError = syncError; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformSkillSourceProvenance other = (PlatformSkillSourceProvenance) o; + return + Utils.enhancedDeepEquals(this.sourceUrl, other.sourceUrl) && + Utils.enhancedDeepEquals(this.commitSha, other.commitSha) && + Utils.enhancedDeepEquals(this.importedAt, other.importedAt) && + Utils.enhancedDeepEquals(this.lastSyncedAt, other.lastSyncedAt) && + Utils.enhancedDeepEquals(this.syncStatus, other.syncStatus) && + Utils.enhancedDeepEquals(this.syncError, other.syncError); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + sourceUrl, commitSha, importedAt, + lastSyncedAt, syncStatus, syncError); + } + + @Override + public String toString() { + return Utils.toString(PlatformSkillSourceProvenance.class, + "sourceUrl", sourceUrl, + "commitSha", commitSha, + "importedAt", importedAt, + "lastSyncedAt", lastSyncedAt, + "syncStatus", syncStatus, + "syncError", syncError); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional sourceUrl = Optional.empty(); + + private Optional commitSha = Optional.empty(); + + private Optional importedAt = Optional.empty(); + + private Optional lastSyncedAt = Optional.empty(); + + private Optional syncStatus = Optional.empty(); + + private Optional syncError = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * URL of the external source the skill was imported from. + */ + public Builder sourceUrl(String sourceUrl) { + Utils.checkNotNull(sourceUrl, "sourceUrl"); + this.sourceUrl = Optional.ofNullable(sourceUrl); + return this; + } + + /** + * URL of the external source the skill was imported from. + */ + public Builder sourceUrl(Optional sourceUrl) { + Utils.checkNotNull(sourceUrl, "sourceUrl"); + this.sourceUrl = sourceUrl; + return this; + } + + + /** + * Source commit SHA for the imported skill. + */ + public Builder commitSha(String commitSha) { + Utils.checkNotNull(commitSha, "commitSha"); + this.commitSha = Optional.ofNullable(commitSha); + return this; + } + + /** + * Source commit SHA for the imported skill. + */ + public Builder commitSha(Optional commitSha) { + Utils.checkNotNull(commitSha, "commitSha"); + this.commitSha = commitSha; + return this; + } + + + /** + * Time the skill was imported. + */ + public Builder importedAt(OffsetDateTime importedAt) { + Utils.checkNotNull(importedAt, "importedAt"); + this.importedAt = Optional.ofNullable(importedAt); + return this; + } + + /** + * Time the skill was imported. + */ + public Builder importedAt(Optional importedAt) { + Utils.checkNotNull(importedAt, "importedAt"); + this.importedAt = importedAt; + return this; + } + + + /** + * Time the skill was last synced from its source. + */ + public Builder lastSyncedAt(OffsetDateTime lastSyncedAt) { + Utils.checkNotNull(lastSyncedAt, "lastSyncedAt"); + this.lastSyncedAt = Optional.ofNullable(lastSyncedAt); + return this; + } + + /** + * Time the skill was last synced from its source. + */ + public Builder lastSyncedAt(Optional lastSyncedAt) { + Utils.checkNotNull(lastSyncedAt, "lastSyncedAt"); + this.lastSyncedAt = lastSyncedAt; + return this; + } + + + /** + * Current external-source sync status. + */ + public Builder syncStatus(PlatformSkillSyncStatus syncStatus) { + Utils.checkNotNull(syncStatus, "syncStatus"); + this.syncStatus = Optional.ofNullable(syncStatus); + return this; + } + + /** + * Current external-source sync status. + */ + public Builder syncStatus(Optional syncStatus) { + Utils.checkNotNull(syncStatus, "syncStatus"); + this.syncStatus = syncStatus; + return this; + } + + + /** + * Human-readable sync failure reason, present only when sync_status is SYNC_FAILED. + */ + public Builder syncError(String syncError) { + Utils.checkNotNull(syncError, "syncError"); + this.syncError = Optional.ofNullable(syncError); + return this; + } + + /** + * Human-readable sync failure reason, present only when sync_status is SYNC_FAILED. + */ + public Builder syncError(Optional syncError) { + Utils.checkNotNull(syncError, "syncError"); + this.syncError = syncError; + return this; + } + + public PlatformSkillSourceProvenance build() { + + return new PlatformSkillSourceProvenance( + sourceUrl, commitSha, importedAt, + lastSyncedAt, syncStatus, syncError); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillStatus.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillStatus.java new file mode 100644 index 00000000..e699f093 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillStatus.java @@ -0,0 +1,137 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d165c204cdfe + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.Override; +import java.lang.String; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +/** + * Wrapper for an "open" enum that can handle unknown values from API responses + * without runtime errors. Instances are immutable singletons with reference equality. + * Use {@code asEnum()} for switch expressions. + */ +/** + * PlatformSkillStatus + * + *

Current skill status. + */ +public class PlatformSkillStatus { + + public static final PlatformSkillStatus DRAFT = new PlatformSkillStatus("DRAFT"); + public static final PlatformSkillStatus ENABLED = new PlatformSkillStatus("ENABLED"); + public static final PlatformSkillStatus DISABLED = new PlatformSkillStatus("DISABLED"); + + // This map will grow whenever a Color gets created with a new + // unrecognized value (a potential memory leak if the user is not + // careful). Keep this field lower case to avoid clashing with + // generated member names which will always be upper cased (Java + // convention) + private static final Map values = createValuesMap(); + private static final Map enums = createEnumsMap(); + + private final String value; + + private PlatformSkillStatus(String value) { + this.value = value; + } + + /** + * Returns a PlatformSkillStatus with the given value. For a specific value the + * returned object will always be a singleton so reference equality + * is satisfied when the values are the same. + * + * @param value value to be wrapped as PlatformSkillStatus + */ + @JsonCreator + public static PlatformSkillStatus of(String value) { + synchronized (PlatformSkillStatus.class) { + return values.computeIfAbsent(value, v -> new PlatformSkillStatus(v)); + } + } + + @JsonValue + public String value() { + return value; + } + + public Optional asEnum() { + return Optional.ofNullable(enums.getOrDefault(value, null)); + } + + public boolean isKnown() { + return asEnum().isPresent(); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public boolean equals(java.lang.Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + PlatformSkillStatus other = (PlatformSkillStatus) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "PlatformSkillStatus [value=" + value + "]"; + } + + // return an array just like an enum + public static PlatformSkillStatus[] values() { + synchronized (PlatformSkillStatus.class) { + return values.values().toArray(new PlatformSkillStatus[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("DRAFT", DRAFT); + map.put("ENABLED", ENABLED); + map.put("DISABLED", DISABLED); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("DRAFT", PlatformSkillStatusEnum.DRAFT); + map.put("ENABLED", PlatformSkillStatusEnum.ENABLED); + map.put("DISABLED", PlatformSkillStatusEnum.DISABLED); + return map; + } + + + public enum PlatformSkillStatusEnum { + + DRAFT("DRAFT"), + ENABLED("ENABLED"), + DISABLED("DISABLED"),; + + private final String value; + + private PlatformSkillStatusEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} + diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillSyncStatus.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillSyncStatus.java new file mode 100644 index 00000000..20128940 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillSyncStatus.java @@ -0,0 +1,137 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 9b52c0471fec + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.Override; +import java.lang.String; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +/** + * Wrapper for an "open" enum that can handle unknown values from API responses + * without runtime errors. Instances are immutable singletons with reference equality. + * Use {@code asEnum()} for switch expressions. + */ +/** + * PlatformSkillSyncStatus + * + *

Current external-source sync status. + */ +public class PlatformSkillSyncStatus { + + public static final PlatformSkillSyncStatus UP_TO_DATE = new PlatformSkillSyncStatus("UP_TO_DATE"); + public static final PlatformSkillSyncStatus UPDATE_AVAILABLE = new PlatformSkillSyncStatus("UPDATE_AVAILABLE"); + public static final PlatformSkillSyncStatus SYNC_FAILED = new PlatformSkillSyncStatus("SYNC_FAILED"); + + // This map will grow whenever a Color gets created with a new + // unrecognized value (a potential memory leak if the user is not + // careful). Keep this field lower case to avoid clashing with + // generated member names which will always be upper cased (Java + // convention) + private static final Map values = createValuesMap(); + private static final Map enums = createEnumsMap(); + + private final String value; + + private PlatformSkillSyncStatus(String value) { + this.value = value; + } + + /** + * Returns a PlatformSkillSyncStatus with the given value. For a specific value the + * returned object will always be a singleton so reference equality + * is satisfied when the values are the same. + * + * @param value value to be wrapped as PlatformSkillSyncStatus + */ + @JsonCreator + public static PlatformSkillSyncStatus of(String value) { + synchronized (PlatformSkillSyncStatus.class) { + return values.computeIfAbsent(value, v -> new PlatformSkillSyncStatus(v)); + } + } + + @JsonValue + public String value() { + return value; + } + + public Optional asEnum() { + return Optional.ofNullable(enums.getOrDefault(value, null)); + } + + public boolean isKnown() { + return asEnum().isPresent(); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public boolean equals(java.lang.Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + PlatformSkillSyncStatus other = (PlatformSkillSyncStatus) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "PlatformSkillSyncStatus [value=" + value + "]"; + } + + // return an array just like an enum + public static PlatformSkillSyncStatus[] values() { + synchronized (PlatformSkillSyncStatus.class) { + return values.values().toArray(new PlatformSkillSyncStatus[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("UP_TO_DATE", UP_TO_DATE); + map.put("UPDATE_AVAILABLE", UPDATE_AVAILABLE); + map.put("SYNC_FAILED", SYNC_FAILED); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("UP_TO_DATE", PlatformSkillSyncStatusEnum.UP_TO_DATE); + map.put("UPDATE_AVAILABLE", PlatformSkillSyncStatusEnum.UPDATE_AVAILABLE); + map.put("SYNC_FAILED", PlatformSkillSyncStatusEnum.SYNC_FAILED); + return map; + } + + + public enum PlatformSkillSyncStatusEnum { + + UP_TO_DATE("UP_TO_DATE"), + UPDATE_AVAILABLE("UPDATE_AVAILABLE"), + SYNC_FAILED("SYNC_FAILED"),; + + private final String value; + + private PlatformSkillSyncStatusEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} + diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillsListResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillsListResponse.java new file mode 100644 index 00000000..174834b7 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformSkillsListResponse.java @@ -0,0 +1,257 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 33ab82accff8 + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Optional; + + +public class PlatformSkillsListResponse { + /** + * Skills available to the user. + */ + @JsonProperty("skills") + private List skills; + + /** + * Whether additional results are available. + */ + @JsonProperty("has_more") + private boolean hasMore; + + /** + * Cursor for the next page, or null when no more results are available. + */ + @JsonInclude(Include.ALWAYS) + @JsonProperty("next_cursor") + private Optional nextCursor; + + /** + * Platform-generated request ID for support correlation. + */ + @JsonProperty("request_id") + private String requestId; + + @JsonCreator + public PlatformSkillsListResponse( + @JsonProperty("skills") List skills, + @JsonProperty("has_more") boolean hasMore, + @JsonProperty("next_cursor") Optional nextCursor, + @JsonProperty("request_id") String requestId) { + Utils.checkNotNull(skills, "skills"); + Utils.checkNotNull(hasMore, "hasMore"); + Utils.checkNotNull(nextCursor, "nextCursor"); + Utils.checkNotNull(requestId, "requestId"); + this.skills = skills; + this.hasMore = hasMore; + this.nextCursor = nextCursor; + this.requestId = requestId; + } + + public PlatformSkillsListResponse( + List skills, + boolean hasMore, + String requestId) { + this(skills, hasMore, Optional.empty(), + requestId); + } + + /** + * Skills available to the user. + */ + @JsonIgnore + public List skills() { + return skills; + } + + /** + * Whether additional results are available. + */ + @JsonIgnore + public boolean hasMore() { + return hasMore; + } + + /** + * Cursor for the next page, or null when no more results are available. + */ + @JsonIgnore + public Optional nextCursor() { + return nextCursor; + } + + /** + * Platform-generated request ID for support correlation. + */ + @JsonIgnore + public String requestId() { + return requestId; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Skills available to the user. + */ + public PlatformSkillsListResponse withSkills(List skills) { + Utils.checkNotNull(skills, "skills"); + this.skills = skills; + return this; + } + + /** + * Whether additional results are available. + */ + public PlatformSkillsListResponse withHasMore(boolean hasMore) { + Utils.checkNotNull(hasMore, "hasMore"); + this.hasMore = hasMore; + return this; + } + + /** + * Cursor for the next page, or null when no more results are available. + */ + public PlatformSkillsListResponse withNextCursor(String nextCursor) { + Utils.checkNotNull(nextCursor, "nextCursor"); + this.nextCursor = Optional.ofNullable(nextCursor); + return this; + } + + + /** + * Cursor for the next page, or null when no more results are available. + */ + public PlatformSkillsListResponse withNextCursor(Optional nextCursor) { + Utils.checkNotNull(nextCursor, "nextCursor"); + this.nextCursor = nextCursor; + return this; + } + + /** + * Platform-generated request ID for support correlation. + */ + public PlatformSkillsListResponse withRequestId(String requestId) { + Utils.checkNotNull(requestId, "requestId"); + this.requestId = requestId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformSkillsListResponse other = (PlatformSkillsListResponse) o; + return + Utils.enhancedDeepEquals(this.skills, other.skills) && + Utils.enhancedDeepEquals(this.hasMore, other.hasMore) && + Utils.enhancedDeepEquals(this.nextCursor, other.nextCursor) && + Utils.enhancedDeepEquals(this.requestId, other.requestId); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + skills, hasMore, nextCursor, + requestId); + } + + @Override + public String toString() { + return Utils.toString(PlatformSkillsListResponse.class, + "skills", skills, + "hasMore", hasMore, + "nextCursor", nextCursor, + "requestId", requestId); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private List skills; + + private Boolean hasMore; + + private Optional nextCursor = Optional.empty(); + + private String requestId; + + private Builder() { + // force use of static builder() method + } + + + /** + * Skills available to the user. + */ + public Builder skills(List skills) { + Utils.checkNotNull(skills, "skills"); + this.skills = skills; + return this; + } + + + /** + * Whether additional results are available. + */ + public Builder hasMore(boolean hasMore) { + Utils.checkNotNull(hasMore, "hasMore"); + this.hasMore = hasMore; + return this; + } + + + /** + * Cursor for the next page, or null when no more results are available. + */ + public Builder nextCursor(String nextCursor) { + Utils.checkNotNull(nextCursor, "nextCursor"); + this.nextCursor = Optional.ofNullable(nextCursor); + return this; + } + + /** + * Cursor for the next page, or null when no more results are available. + */ + public Builder nextCursor(Optional nextCursor) { + Utils.checkNotNull(nextCursor, "nextCursor"); + this.nextCursor = nextCursor; + return this; + } + + + /** + * Platform-generated request ID for support correlation. + */ + public Builder requestId(String requestId) { + Utils.checkNotNull(requestId, "requestId"); + this.requestId = requestId; + return this; + } + + public PlatformSkillsListResponse build() { + + return new PlatformSkillsListResponse( + skills, hasMore, nextCursor, + requestId); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsGetRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsGetRequest.java new file mode 100644 index 00000000..e95a3f18 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsGetRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b1a1021e45fa + */ +package com.glean.api_client.glean_api_client.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.glean.api_client.glean_api_client.utils.SpeakeasyMetadata; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Override; +import java.lang.String; + + +public class PlatformSkillsGetRequest { + /** + * Glean skill ID. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=skill_id") + private String skillId; + + @JsonCreator + public PlatformSkillsGetRequest( + String skillId) { + Utils.checkNotNull(skillId, "skillId"); + this.skillId = skillId; + } + + /** + * Glean skill ID. + */ + @JsonIgnore + public String skillId() { + return skillId; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Glean skill ID. + */ + public PlatformSkillsGetRequest withSkillId(String skillId) { + Utils.checkNotNull(skillId, "skillId"); + this.skillId = skillId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformSkillsGetRequest other = (PlatformSkillsGetRequest) o; + return + Utils.enhancedDeepEquals(this.skillId, other.skillId); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + skillId); + } + + @Override + public String toString() { + return Utils.toString(PlatformSkillsGetRequest.class, + "skillId", skillId); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String skillId; + + private Builder() { + // force use of static builder() method + } + + + /** + * Glean skill ID. + */ + public Builder skillId(String skillId) { + Utils.checkNotNull(skillId, "skillId"); + this.skillId = skillId; + return this; + } + + public PlatformSkillsGetRequest build() { + + return new PlatformSkillsGetRequest( + skillId); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsGetRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsGetRequestBuilder.java new file mode 100644 index 00000000..7c12088c --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsGetRequestBuilder.java @@ -0,0 +1,47 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: acf97a47458e + */ +package com.glean.api_client.glean_api_client.models.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.PlatformSkillsGet; +import com.glean.api_client.glean_api_client.utils.Headers; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.String; + +public class PlatformSkillsGetRequestBuilder { + + private String skillId; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public PlatformSkillsGetRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public PlatformSkillsGetRequestBuilder skillId(String skillId) { + Utils.checkNotNull(skillId, "skillId"); + this.skillId = skillId; + return this; + } + + + private PlatformSkillsGetRequest buildRequest() { + + PlatformSkillsGetRequest request = new PlatformSkillsGetRequest(skillId); + + return request; + } + + public PlatformSkillsGetResponse call() { + + RequestOperation operation + = new PlatformSkillsGet.Sync(sdkConfiguration, _headers); + PlatformSkillsGetRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsGetResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsGetResponse.java new file mode 100644 index 00000000..85f533a8 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsGetResponse.java @@ -0,0 +1,254 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 10e964f47660 + */ +package com.glean.api_client.glean_api_client.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.glean.api_client.glean_api_client.models.components.PlatformSkillGetResponse; +import com.glean.api_client.glean_api_client.utils.Response; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PlatformSkillsGetResponse implements Response { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful response. + */ + private Optional platformSkillGetResponse; + + @JsonCreator + public PlatformSkillsGetResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional platformSkillGetResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(platformSkillGetResponse, "platformSkillGetResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.platformSkillGetResponse = platformSkillGetResponse; + } + + public PlatformSkillsGetResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful response. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platformSkillGetResponse() { + return (Optional) platformSkillGetResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public PlatformSkillsGetResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public PlatformSkillsGetResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PlatformSkillsGetResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful response. + */ + public PlatformSkillsGetResponse withPlatformSkillGetResponse(PlatformSkillGetResponse platformSkillGetResponse) { + Utils.checkNotNull(platformSkillGetResponse, "platformSkillGetResponse"); + this.platformSkillGetResponse = Optional.ofNullable(platformSkillGetResponse); + return this; + } + + + /** + * Successful response. + */ + public PlatformSkillsGetResponse withPlatformSkillGetResponse(Optional platformSkillGetResponse) { + Utils.checkNotNull(platformSkillGetResponse, "platformSkillGetResponse"); + this.platformSkillGetResponse = platformSkillGetResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformSkillsGetResponse other = (PlatformSkillsGetResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.platformSkillGetResponse, other.platformSkillGetResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + platformSkillGetResponse); + } + + @Override + public String toString() { + return Utils.toString(PlatformSkillsGetResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "platformSkillGetResponse", platformSkillGetResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional platformSkillGetResponse = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful response. + */ + public Builder platformSkillGetResponse(PlatformSkillGetResponse platformSkillGetResponse) { + Utils.checkNotNull(platformSkillGetResponse, "platformSkillGetResponse"); + this.platformSkillGetResponse = Optional.ofNullable(platformSkillGetResponse); + return this; + } + + /** + * Successful response. + */ + public Builder platformSkillGetResponse(Optional platformSkillGetResponse) { + Utils.checkNotNull(platformSkillGetResponse, "platformSkillGetResponse"); + this.platformSkillGetResponse = platformSkillGetResponse; + return this; + } + + public PlatformSkillsGetResponse build() { + + return new PlatformSkillsGetResponse( + contentType, statusCode, rawResponse, + platformSkillGetResponse); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsListRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsListRequest.java new file mode 100644 index 00000000..ad230300 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsListRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0c784c11f038 + */ +package com.glean.api_client.glean_api_client.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.glean.api_client.glean_api_client.utils.SpeakeasyMetadata; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Long; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + + +public class PlatformSkillsListRequest { + /** + * Maximum number of skills to return. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page_size") + private Optional pageSize; + + /** + * Opaque pagination cursor from a previous response. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=cursor") + private Optional cursor; + + @JsonCreator + public PlatformSkillsListRequest( + Optional pageSize, + Optional cursor) { + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(cursor, "cursor"); + this.pageSize = pageSize; + this.cursor = cursor; + } + + public PlatformSkillsListRequest() { + this(Optional.empty(), Optional.empty()); + } + + /** + * Maximum number of skills to return. + */ + @JsonIgnore + public Optional pageSize() { + return pageSize; + } + + /** + * Opaque pagination cursor from a previous response. + */ + @JsonIgnore + public Optional cursor() { + return cursor; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Maximum number of skills to return. + */ + public PlatformSkillsListRequest withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + + /** + * Maximum number of skills to return. + */ + public PlatformSkillsListRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Opaque pagination cursor from a previous response. + */ + public PlatformSkillsListRequest withCursor(String cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = Optional.ofNullable(cursor); + return this; + } + + + /** + * Opaque pagination cursor from a previous response. + */ + public PlatformSkillsListRequest withCursor(Optional cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = cursor; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformSkillsListRequest other = (PlatformSkillsListRequest) o; + return + Utils.enhancedDeepEquals(this.pageSize, other.pageSize) && + Utils.enhancedDeepEquals(this.cursor, other.cursor); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + pageSize, cursor); + } + + @Override + public String toString() { + return Utils.toString(PlatformSkillsListRequest.class, + "pageSize", pageSize, + "cursor", cursor); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional pageSize = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * Maximum number of skills to return. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Maximum number of skills to return. + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + + /** + * Opaque pagination cursor from a previous response. + */ + public Builder cursor(String cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + * Opaque pagination cursor from a previous response. + */ + public Builder cursor(Optional cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = cursor; + return this; + } + + public PlatformSkillsListRequest build() { + + return new PlatformSkillsListRequest( + pageSize, cursor); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsListRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsListRequestBuilder.java new file mode 100644 index 00000000..b242ac17 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsListRequestBuilder.java @@ -0,0 +1,69 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c4faa9ffd8e1 + */ +package com.glean.api_client.glean_api_client.models.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.PlatformSkillsList; +import com.glean.api_client.glean_api_client.utils.Headers; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Long; +import java.lang.String; +import java.util.Optional; + +public class PlatformSkillsListRequestBuilder { + + private Optional pageSize = Optional.empty(); + private Optional cursor = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public PlatformSkillsListRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public PlatformSkillsListRequestBuilder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.of(pageSize); + return this; + } + + public PlatformSkillsListRequestBuilder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public PlatformSkillsListRequestBuilder cursor(String cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = Optional.of(cursor); + return this; + } + + public PlatformSkillsListRequestBuilder cursor(Optional cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = cursor; + return this; + } + + + private PlatformSkillsListRequest buildRequest() { + + PlatformSkillsListRequest request = new PlatformSkillsListRequest(pageSize, + cursor); + + return request; + } + + public PlatformSkillsListResponse call() { + + RequestOperation operation + = new PlatformSkillsList.Sync(sdkConfiguration, _headers); + PlatformSkillsListRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsListResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsListResponse.java new file mode 100644 index 00000000..4194c210 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSkillsListResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 61140aa877b7 + */ +package com.glean.api_client.glean_api_client.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.glean.api_client.glean_api_client.utils.Response; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PlatformSkillsListResponse implements Response { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful response. + */ + private Optional platformSkillsListResponse; + + @JsonCreator + public PlatformSkillsListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional platformSkillsListResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(platformSkillsListResponse, "platformSkillsListResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.platformSkillsListResponse = platformSkillsListResponse; + } + + public PlatformSkillsListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful response. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platformSkillsListResponse() { + return (Optional) platformSkillsListResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public PlatformSkillsListResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public PlatformSkillsListResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PlatformSkillsListResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful response. + */ + public PlatformSkillsListResponse withPlatformSkillsListResponse(com.glean.api_client.glean_api_client.models.components.PlatformSkillsListResponse platformSkillsListResponse) { + Utils.checkNotNull(platformSkillsListResponse, "platformSkillsListResponse"); + this.platformSkillsListResponse = Optional.ofNullable(platformSkillsListResponse); + return this; + } + + + /** + * Successful response. + */ + public PlatformSkillsListResponse withPlatformSkillsListResponse(Optional platformSkillsListResponse) { + Utils.checkNotNull(platformSkillsListResponse, "platformSkillsListResponse"); + this.platformSkillsListResponse = platformSkillsListResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformSkillsListResponse other = (PlatformSkillsListResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.platformSkillsListResponse, other.platformSkillsListResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + platformSkillsListResponse); + } + + @Override + public String toString() { + return Utils.toString(PlatformSkillsListResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "platformSkillsListResponse", platformSkillsListResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional platformSkillsListResponse = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful response. + */ + public Builder platformSkillsListResponse(com.glean.api_client.glean_api_client.models.components.PlatformSkillsListResponse platformSkillsListResponse) { + Utils.checkNotNull(platformSkillsListResponse, "platformSkillsListResponse"); + this.platformSkillsListResponse = Optional.ofNullable(platformSkillsListResponse); + return this; + } + + /** + * Successful response. + */ + public Builder platformSkillsListResponse(Optional platformSkillsListResponse) { + Utils.checkNotNull(platformSkillsListResponse, "platformSkillsListResponse"); + this.platformSkillsListResponse = platformSkillsListResponse; + return this; + } + + public PlatformSkillsListResponse build() { + + return new PlatformSkillsListResponse( + contentType, statusCode, rawResponse, + platformSkillsListResponse); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformSkillsGetRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformSkillsGetRequestBuilder.java new file mode 100644 index 00000000..af6066c6 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformSkillsGetRequestBuilder.java @@ -0,0 +1,50 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 9f29a43ef0e1 + */ +package com.glean.api_client.glean_api_client.models.operations.async; + +import static com.glean.api_client.glean_api_client.operations.Operations.AsyncRequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsGetRequest; +import com.glean.api_client.glean_api_client.operations.PlatformSkillsGet; +import com.glean.api_client.glean_api_client.utils.Headers; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class PlatformSkillsGetRequestBuilder { + + private String skillId; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public PlatformSkillsGetRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public PlatformSkillsGetRequestBuilder skillId(String skillId) { + Utils.checkNotNull(skillId, "skillId"); + this.skillId = skillId; + return this; + } + + + private PlatformSkillsGetRequest buildRequest() { + + PlatformSkillsGetRequest request = new PlatformSkillsGetRequest(skillId); + + return request; + } + + public CompletableFuture call() { + + AsyncRequestOperation operation + = new PlatformSkillsGet.Async(sdkConfiguration, _headers); + PlatformSkillsGetRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformSkillsGetResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformSkillsGetResponse.java new file mode 100644 index 00000000..bcb83e3e --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformSkillsGetResponse.java @@ -0,0 +1,254 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d9bcb05e5190 + */ +package com.glean.api_client.glean_api_client.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.glean.api_client.glean_api_client.models.components.PlatformSkillGetResponse; +import com.glean.api_client.glean_api_client.utils.AsyncResponse; +import com.glean.api_client.glean_api_client.utils.Blob; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PlatformSkillsGetResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful response. + */ + private Optional platformSkillGetResponse; + + @JsonCreator + public PlatformSkillsGetResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional platformSkillGetResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(platformSkillGetResponse, "platformSkillGetResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.platformSkillGetResponse = platformSkillGetResponse; + } + + public PlatformSkillsGetResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful response. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platformSkillGetResponse() { + return (Optional) platformSkillGetResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public PlatformSkillsGetResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public PlatformSkillsGetResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PlatformSkillsGetResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful response. + */ + public PlatformSkillsGetResponse withPlatformSkillGetResponse(PlatformSkillGetResponse platformSkillGetResponse) { + Utils.checkNotNull(platformSkillGetResponse, "platformSkillGetResponse"); + this.platformSkillGetResponse = Optional.ofNullable(platformSkillGetResponse); + return this; + } + + + /** + * Successful response. + */ + public PlatformSkillsGetResponse withPlatformSkillGetResponse(Optional platformSkillGetResponse) { + Utils.checkNotNull(platformSkillGetResponse, "platformSkillGetResponse"); + this.platformSkillGetResponse = platformSkillGetResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformSkillsGetResponse other = (PlatformSkillsGetResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.platformSkillGetResponse, other.platformSkillGetResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + platformSkillGetResponse); + } + + @Override + public String toString() { + return Utils.toString(PlatformSkillsGetResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "platformSkillGetResponse", platformSkillGetResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional platformSkillGetResponse = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful response. + */ + public Builder platformSkillGetResponse(PlatformSkillGetResponse platformSkillGetResponse) { + Utils.checkNotNull(platformSkillGetResponse, "platformSkillGetResponse"); + this.platformSkillGetResponse = Optional.ofNullable(platformSkillGetResponse); + return this; + } + + /** + * Successful response. + */ + public Builder platformSkillGetResponse(Optional platformSkillGetResponse) { + Utils.checkNotNull(platformSkillGetResponse, "platformSkillGetResponse"); + this.platformSkillGetResponse = platformSkillGetResponse; + return this; + } + + public PlatformSkillsGetResponse build() { + + return new PlatformSkillsGetResponse( + contentType, statusCode, rawResponse, + platformSkillGetResponse); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformSkillsListRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformSkillsListRequestBuilder.java new file mode 100644 index 00000000..bac42515 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformSkillsListRequestBuilder.java @@ -0,0 +1,72 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7f6d7d6b2033 + */ +package com.glean.api_client.glean_api_client.models.operations.async; + +import static com.glean.api_client.glean_api_client.operations.Operations.AsyncRequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsListRequest; +import com.glean.api_client.glean_api_client.operations.PlatformSkillsList; +import com.glean.api_client.glean_api_client.utils.Headers; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Long; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class PlatformSkillsListRequestBuilder { + + private Optional pageSize = Optional.empty(); + private Optional cursor = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public PlatformSkillsListRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public PlatformSkillsListRequestBuilder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.of(pageSize); + return this; + } + + public PlatformSkillsListRequestBuilder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public PlatformSkillsListRequestBuilder cursor(String cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = Optional.of(cursor); + return this; + } + + public PlatformSkillsListRequestBuilder cursor(Optional cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = cursor; + return this; + } + + + private PlatformSkillsListRequest buildRequest() { + + PlatformSkillsListRequest request = new PlatformSkillsListRequest(pageSize, + cursor); + + return request; + } + + public CompletableFuture call() { + + AsyncRequestOperation operation + = new PlatformSkillsList.Async(sdkConfiguration, _headers); + PlatformSkillsListRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformSkillsListResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformSkillsListResponse.java new file mode 100644 index 00000000..f2aa06a9 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformSkillsListResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7213f13e0653 + */ +package com.glean.api_client.glean_api_client.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.glean.api_client.glean_api_client.utils.AsyncResponse; +import com.glean.api_client.glean_api_client.utils.Blob; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PlatformSkillsListResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful response. + */ + private Optional platformSkillsListResponse; + + @JsonCreator + public PlatformSkillsListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional platformSkillsListResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(platformSkillsListResponse, "platformSkillsListResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.platformSkillsListResponse = platformSkillsListResponse; + } + + public PlatformSkillsListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful response. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platformSkillsListResponse() { + return (Optional) platformSkillsListResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public PlatformSkillsListResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public PlatformSkillsListResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PlatformSkillsListResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful response. + */ + public PlatformSkillsListResponse withPlatformSkillsListResponse(com.glean.api_client.glean_api_client.models.components.PlatformSkillsListResponse platformSkillsListResponse) { + Utils.checkNotNull(platformSkillsListResponse, "platformSkillsListResponse"); + this.platformSkillsListResponse = Optional.ofNullable(platformSkillsListResponse); + return this; + } + + + /** + * Successful response. + */ + public PlatformSkillsListResponse withPlatformSkillsListResponse(Optional platformSkillsListResponse) { + Utils.checkNotNull(platformSkillsListResponse, "platformSkillsListResponse"); + this.platformSkillsListResponse = platformSkillsListResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformSkillsListResponse other = (PlatformSkillsListResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.platformSkillsListResponse, other.platformSkillsListResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + platformSkillsListResponse); + } + + @Override + public String toString() { + return Utils.toString(PlatformSkillsListResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "platformSkillsListResponse", platformSkillsListResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional platformSkillsListResponse = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful response. + */ + public Builder platformSkillsListResponse(com.glean.api_client.glean_api_client.models.components.PlatformSkillsListResponse platformSkillsListResponse) { + Utils.checkNotNull(platformSkillsListResponse, "platformSkillsListResponse"); + this.platformSkillsListResponse = Optional.ofNullable(platformSkillsListResponse); + return this; + } + + /** + * Successful response. + */ + public Builder platformSkillsListResponse(Optional platformSkillsListResponse) { + Utils.checkNotNull(platformSkillsListResponse, "platformSkillsListResponse"); + this.platformSkillsListResponse = platformSkillsListResponse; + return this; + } + + public PlatformSkillsListResponse build() { + + return new PlatformSkillsListResponse( + contentType, statusCode, rawResponse, + platformSkillsListResponse); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PlatformSkillsGet.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PlatformSkillsGet.java new file mode 100644 index 00000000..612b0dfc --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PlatformSkillsGet.java @@ -0,0 +1,277 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 35379a4f4ed2 + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; +import static com.glean.api_client.glean_api_client.utils.Exceptions.unchecked; +import static com.glean.api_client.glean_api_client.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.PlatformSkillGetResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException; +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsGetRequest; +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsGetResponse; +import com.glean.api_client.glean_api_client.utils.Blob; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Headers; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class PlatformSkillsGet { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + final Headers _headers; + + public Base(SDKConfiguration sdkConfiguration, Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "platform-skills-get", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "platform-skills-get", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "platform-skills-get", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/api/skills/{skill_id}", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + _headers.forEach((k, list) -> list.forEach(v -> req.addHeader(k, v))); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private HttpRequest onBuildRequest(PlatformSkillsGetRequest request) throws Exception { + HttpRequest req = buildRequest(request, PlatformSkillsGetRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(PlatformSkillsGetRequest request) { + HttpRequest r = unchecked(() -> onBuildRequest(request)).get(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = unchecked(() -> onError(null, e)).get(); + } + + return httpRes; + } + + + @Override + public PlatformSkillsGetResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PlatformSkillsGetResponse.Builder resBuilder = + PlatformSkillsGetResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PlatformSkillsGetResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withPlatformSkillGetResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "404", "408", "429")) { + if (Utils.contentTypeMatches(contentType, "application/problem+json")) { + throw PlatformProblemDetailException.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "503")) { + if (Utils.contentTypeMatches(contentType, "application/problem+json")) { + throw PlatformProblemDetailException.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw APIException.from("API error occurred", response); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw APIException.from("API error occurred", response); + } + throw APIException.from("Unexpected status code received: " + response.statusCode(), response); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private CompletableFuture onBuildRequest(PlatformSkillsGetRequest request) throws Exception { + HttpRequest req = buildRequest(request, PlatformSkillsGetRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(PlatformSkillsGetRequest request) { + return unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.glean.api_client.glean_api_client.models.operations.async.PlatformSkillsGetResponse.Builder resBuilder = + com.glean.api_client.glean_api_client.models.operations.async.PlatformSkillsGetResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.glean.api_client.glean_api_client.models.operations.async.PlatformSkillsGetResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withPlatformSkillGetResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "404", "408", "429")) { + if (Utils.contentTypeMatches(contentType, "application/problem+json")) { + return PlatformProblemDetailException.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "503")) { + if (Utils.contentTypeMatches(contentType, "application/problem+json")) { + return PlatformProblemDetailException.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PlatformSkillsList.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PlatformSkillsList.java new file mode 100644 index 00000000..1bb80ab1 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PlatformSkillsList.java @@ -0,0 +1,279 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f9f1d5a5462f + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; +import static com.glean.api_client.glean_api_client.utils.Exceptions.unchecked; +import static com.glean.api_client.glean_api_client.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException; +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsListRequest; +import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsListResponse; +import com.glean.api_client.glean_api_client.utils.Blob; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Headers; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class PlatformSkillsList { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + final Headers _headers; + + public Base(SDKConfiguration sdkConfiguration, Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "platform-skills-list", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "platform-skills-list", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "platform-skills-list", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/api/skills"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + _headers.forEach((k, list) -> list.forEach(v -> req.addHeader(k, v))); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private HttpRequest onBuildRequest(PlatformSkillsListRequest request) throws Exception { + HttpRequest req = buildRequest(request, PlatformSkillsListRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(PlatformSkillsListRequest request) { + HttpRequest r = unchecked(() -> onBuildRequest(request)).get(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = unchecked(() -> onError(null, e)).get(); + } + + return httpRes; + } + + + @Override + public PlatformSkillsListResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PlatformSkillsListResponse.Builder resBuilder = + PlatformSkillsListResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PlatformSkillsListResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withPlatformSkillsListResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "404", "408", "429")) { + if (Utils.contentTypeMatches(contentType, "application/problem+json")) { + throw PlatformProblemDetailException.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "503")) { + if (Utils.contentTypeMatches(contentType, "application/problem+json")) { + throw PlatformProblemDetailException.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw APIException.from("API error occurred", response); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw APIException.from("API error occurred", response); + } + throw APIException.from("Unexpected status code received: " + response.statusCode(), response); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private CompletableFuture onBuildRequest(PlatformSkillsListRequest request) throws Exception { + HttpRequest req = buildRequest(request, PlatformSkillsListRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(PlatformSkillsListRequest request) { + return unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.glean.api_client.glean_api_client.models.operations.async.PlatformSkillsListResponse.Builder resBuilder = + com.glean.api_client.glean_api_client.models.operations.async.PlatformSkillsListResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.glean.api_client.glean_api_client.models.operations.async.PlatformSkillsListResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withPlatformSkillsListResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "404", "408", "429")) { + if (Utils.contentTypeMatches(contentType, "application/problem+json")) { + return PlatformProblemDetailException.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "503")) { + if (Utils.contentTypeMatches(contentType, "application/problem+json")) { + return PlatformProblemDetailException.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +}