diff --git a/requirements.txt b/requirements.txt index b5894b1..6e792fe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,53 +7,18 @@ anyio==4.2.0 ; python_version >= "3.9" and python_version < "4.0" \ attrs==23.2.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30 \ --hash=sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1 -autoflake==2.2.1 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:265cde0a43c1f44ecfb4f30d95b0437796759d07be7706a2f70e4719234c0f79 \ - --hash=sha256:62b7b6449a692c3c9b0c916919bbc21648da7281e8506bcf8d3f8280e431ebc1 -black==23.12.1 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:0808494f2b2df923ffc5723ed3c7b096bd76341f6213989759287611e9837d50 \ - --hash=sha256:1fa88a0f74e50e4487477bc0bb900c6781dbddfdfa32691e780bf854c3b4a47f \ - --hash=sha256:25e57fd232a6d6ff3f4478a6fd0580838e47c93c83eaf1ccc92d4faf27112c4e \ - --hash=sha256:2d9e13db441c509a3763a7a3d9a49ccc1b4e974a47be4e08ade2a228876500ec \ - --hash=sha256:3e1b38b3135fd4c025c28c55ddfc236b05af657828a8a6abe5deec419a0b7055 \ - --hash=sha256:3fa4be75ef2a6b96ea8d92b1587dd8cb3a35c7e3d51f0738ced0781c3aa3a5a3 \ - --hash=sha256:4ce3ef14ebe8d9509188014d96af1c456a910d5b5cbf434a09fef7e024b3d0d5 \ - --hash=sha256:4f0031eaa7b921db76decd73636ef3a12c942ed367d8c3841a0739412b260a54 \ - --hash=sha256:602cfb1196dc692424c70b6507593a2b29aac0547c1be9a1d1365f0d964c353b \ - --hash=sha256:6d1bd9c210f8b109b1762ec9fd36592fdd528485aadb3f5849b2740ef17e674e \ - --hash=sha256:78baad24af0f033958cad29731e27363183e140962595def56423e626f4bee3e \ - --hash=sha256:8d4df77958a622f9b5a4c96edb4b8c0034f8434032ab11077ec6c56ae9f384ba \ - --hash=sha256:97e56155c6b737854e60a9ab1c598ff2533d57e7506d97af5481141671abf3ea \ - --hash=sha256:9c4352800f14be5b4864016882cdba10755bd50805c95f728011bcb47a4afd59 \ - --hash=sha256:a4d6a9668e45ad99d2f8ec70d5c8c04ef4f32f648ef39048d010b0689832ec6d \ - --hash=sha256:a920b569dc6b3472513ba6ddea21f440d4b4c699494d2e972a1753cdc25df7b0 \ - --hash=sha256:ae76c22bde5cbb6bfd211ec343ded2163bba7883c7bc77f6b756a1049436fbb9 \ - --hash=sha256:b18fb2ae6c4bb63eebe5be6bd869ba2f14fd0259bda7d18a46b764d8fb86298a \ - --hash=sha256:c04b6d9d20e9c13f43eee8ea87d44156b8505ca8a3c878773f68b4e4812a421e \ - --hash=sha256:c88b3711d12905b74206227109272673edce0cb29f27e1385f33b0163c414bba \ - --hash=sha256:dd15245c8b68fe2b6bd0f32c1556509d11bb33aec9b5d0866dd8e2ed3dba09c2 \ - --hash=sha256:e0aaf6041986767a5e0ce663c7a2f0e9eaf21e6ff87a5f95cbf3675bfd4c41d2 certifi==2023.11.17 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1 \ --hash=sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474 -cfgv==3.4.0 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9 \ - --hash=sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560 click==8.1.7 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de colorama==0.4.6 ; python_version >= "3.9" and python_version < "4.0" and (sys_platform == "win32" or platform_system == "Windows") \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 -distlib==0.3.8 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:034db59a0b96f8ca18035f36290806a9a6e6bd9d1ff91e45a7f172eb17e51784 \ - --hash=sha256:1530ea13e350031b6312d8580ddb6b27a104275a31106523b8f123787f494f64 exceptiongroup==1.2.0 ; python_version >= "3.9" and python_version < "3.11" \ --hash=sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14 \ --hash=sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68 -filelock==3.13.1 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:521f5f56c50f8426f5e03ad3b281b490a87ef15bc6c526f168290f0c7148d44e \ - --hash=sha256:57dbda9b35157b05fb3e58ee91448612eb674172fab98ee235ccb0b5bee19a1c h11==0.14.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d \ --hash=sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761 @@ -63,21 +28,12 @@ httpcore==1.0.2 ; python_version >= "3.9" and python_version < "4.0" \ httpx==0.25.2 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:8b8fcaa0c8ea7b05edd69a094e63a2094c4efcb48129fb757361bc423c0ad9e8 \ --hash=sha256:a05d3d052d9b2dfce0e3896636467f8a5342fb2b902c819428e1ac65413ca118 -identify==2.5.33 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:161558f9fe4559e1557e1bff323e8631f6a0e4837f7497767c1782832f16b62d \ - --hash=sha256:d40ce5fcd762817627670da8a7d8d8e65f24342d14539c59488dc603bf662e34 -idna==3.6 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \ - --hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f -iniconfig==2.0.0 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \ - --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 -isort==5.13.2 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109 \ - --hash=sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6 -jinja2==3.1.3 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa \ - --hash=sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90 +idna==3.7 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \ + --hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0 +jinja2==3.1.4 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369 \ + --hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d markupsafe==2.1.3 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:05fb21170423db021895e1ea1e1f3ab3adb85d1c2333cbc2310f2a26bc77272e \ --hash=sha256:0a4e4a1aff6c7ac4cd55792abf96c915634c2b97e3cc1c7129578aa68ebd754e \ @@ -139,229 +95,176 @@ markupsafe==2.1.3 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:f698de3fd0c4e6972b92290a45bd9b1536bffe8c6759c62471efaa8acb4c37bc \ --hash=sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2 \ --hash=sha256:ffcc3f7c66b5f5b7931a5aa68fc9cecc51e685ef90282f4a82f0f5e9b704ad11 -mypy-extensions==1.0.0 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \ - --hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782 -nodeenv==1.8.0 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:d51e0c37e64fbf47d017feac3145cdbb58836d7eee8c6f6d3b6880c5456227d2 \ - --hash=sha256:df865724bb3c3adc86b3876fa209771517b0cfe596beff01a92700e0e8be4cec -openapi-python-client==0.15.2 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:240ff6e571eecd81758410cb743c24b6cabc4d30a3fd79cd886feeb8960610c5 \ - --hash=sha256:a0ff88cd142f907277c333fa4e3bb9461ebfd8e58bad1bbccdd8f14dc3c311e7 -packaging==23.2 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \ - --hash=sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7 -pathspec==0.12.1 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08 \ - --hash=sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712 -platformdirs==4.1.0 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:11c8f37bcca40db96d8144522d925583bdb7a31f7b0e37e3ed4318400a8e2380 \ - --hash=sha256:906d548203468492d432bcb294d4bc2fff751bf84971fbb2c10918cc206ee420 -pluggy==1.3.0 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12 \ - --hash=sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7 -pre-commit==3.6.0 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:c255039ef399049a5544b6ce13d135caba8f2c28c3b4033277a788f434308376 \ - --hash=sha256:d30bad9abf165f7785c15a21a1f46da7d0677cb00ee7ff4c579fd38922efe15d -pydantic-core==2.14.6 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:00646784f6cd993b1e1c0e7b0fdcbccc375d539db95555477771c27555e3c556 \ - --hash=sha256:00b1087dabcee0b0ffd104f9f53d7d3eaddfaa314cdd6726143af6bc713aa27e \ - --hash=sha256:0348b1dc6b76041516e8a854ff95b21c55f5a411c3297d2ca52f5528e49d8411 \ - --hash=sha256:036137b5ad0cb0004c75b579445a1efccd072387a36c7f217bb8efd1afbe5245 \ - --hash=sha256:095b707bb287bfd534044166ab767bec70a9bba3175dcdc3371782175c14e43c \ - --hash=sha256:0c08de15d50fa190d577e8591f0329a643eeaed696d7771760295998aca6bc66 \ - --hash=sha256:1302a54f87b5cd8528e4d6d1bf2133b6aa7c6122ff8e9dc5220fbc1e07bffebd \ - --hash=sha256:172de779e2a153d36ee690dbc49c6db568d7b33b18dc56b69a7514aecbcf380d \ - --hash=sha256:1b027c86c66b8627eb90e57aee1f526df77dc6d8b354ec498be9a757d513b92b \ - --hash=sha256:1ce830e480f6774608dedfd4a90c42aac4a7af0a711f1b52f807130c2e434c06 \ - --hash=sha256:1fd0c1d395372843fba13a51c28e3bb9d59bd7aebfeb17358ffaaa1e4dbbe948 \ - --hash=sha256:23598acb8ccaa3d1d875ef3b35cb6376535095e9405d91a3d57a8c7db5d29341 \ - --hash=sha256:24368e31be2c88bd69340fbfe741b405302993242ccb476c5c3ff48aeee1afe0 \ - --hash=sha256:26a92ae76f75d1915806b77cf459811e772d8f71fd1e4339c99750f0e7f6324f \ - --hash=sha256:27e524624eace5c59af499cd97dc18bb201dc6a7a2da24bfc66ef151c69a5f2a \ - --hash=sha256:2b8719037e570639e6b665a4050add43134d80b687288ba3ade18b22bbb29dd2 \ - --hash=sha256:2c5bcf3414367e29f83fd66f7de64509a8fd2368b1edf4351e862910727d3e51 \ - --hash=sha256:2dbe357bc4ddda078f79d2a36fc1dd0494a7f2fad83a0a684465b6f24b46fe80 \ - --hash=sha256:2f5fa187bde8524b1e37ba894db13aadd64faa884657473b03a019f625cee9a8 \ - --hash=sha256:2f6ffc6701a0eb28648c845f4945a194dc7ab3c651f535b81793251e1185ac3d \ - --hash=sha256:314ccc4264ce7d854941231cf71b592e30d8d368a71e50197c905874feacc8a8 \ - --hash=sha256:36026d8f99c58d7044413e1b819a67ca0e0b8ebe0f25e775e6c3d1fabb3c38fb \ - --hash=sha256:36099c69f6b14fc2c49d7996cbf4f87ec4f0e66d1c74aa05228583225a07b590 \ - --hash=sha256:36fa402dcdc8ea7f1b0ddcf0df4254cc6b2e08f8cd80e7010d4c4ae6e86b2a87 \ - --hash=sha256:370ffecb5316ed23b667d99ce4debe53ea664b99cc37bfa2af47bc769056d534 \ - --hash=sha256:3860c62057acd95cc84044e758e47b18dcd8871a328ebc8ccdefd18b0d26a21b \ - --hash=sha256:399ac0891c284fa8eb998bcfa323f2234858f5d2efca3950ae58c8f88830f145 \ - --hash=sha256:3a0b5db001b98e1c649dd55afa928e75aa4087e587b9524a4992316fa23c9fba \ - --hash=sha256:3dcf1978be02153c6a31692d4fbcc2a3f1db9da36039ead23173bc256ee3b91b \ - --hash=sha256:4241204e4b36ab5ae466ecec5c4c16527a054c69f99bba20f6f75232a6a534e2 \ - --hash=sha256:438027a975cc213a47c5d70672e0d29776082155cfae540c4e225716586be75e \ - --hash=sha256:43e166ad47ba900f2542a80d83f9fc65fe99eb63ceec4debec160ae729824052 \ - --hash=sha256:478e9e7b360dfec451daafe286998d4a1eeaecf6d69c427b834ae771cad4b622 \ - --hash=sha256:4ce8299b481bcb68e5c82002b96e411796b844d72b3e92a3fbedfe8e19813eab \ - --hash=sha256:4f86f1f318e56f5cbb282fe61eb84767aee743ebe32c7c0834690ebea50c0a6b \ - --hash=sha256:55a23dcd98c858c0db44fc5c04fc7ed81c4b4d33c653a7c45ddaebf6563a2f66 \ - --hash=sha256:599c87d79cab2a6a2a9df4aefe0455e61e7d2aeede2f8577c1b7c0aec643ee8e \ - --hash=sha256:5aa90562bc079c6c290f0512b21768967f9968e4cfea84ea4ff5af5d917016e4 \ - --hash=sha256:64634ccf9d671c6be242a664a33c4acf12882670b09b3f163cd00a24cffbd74e \ - --hash=sha256:667aa2eac9cd0700af1ddb38b7b1ef246d8cf94c85637cbb03d7757ca4c3fdec \ - --hash=sha256:6a31d98c0d69776c2576dda4b77b8e0c69ad08e8b539c25c7d0ca0dc19a50d6c \ - --hash=sha256:6af4b3f52cc65f8a0bc8b1cd9676f8c21ef3e9132f21fed250f6958bd7223bed \ - --hash=sha256:6c8edaea3089bf908dd27da8f5d9e395c5b4dc092dbcce9b65e7156099b4b937 \ - --hash=sha256:71d72ca5eaaa8d38c8df16b7deb1a2da4f650c41b58bb142f3fb75d5ad4a611f \ - --hash=sha256:72f9a942d739f09cd42fffe5dc759928217649f070056f03c70df14f5770acf9 \ - --hash=sha256:747265448cb57a9f37572a488a57d873fd96bf51e5bb7edb52cfb37124516da4 \ - --hash=sha256:75ec284328b60a4e91010c1acade0c30584f28a1f345bc8f72fe8b9e46ec6a96 \ - --hash=sha256:78d0768ee59baa3de0f4adac9e3748b4b1fffc52143caebddfd5ea2961595277 \ - --hash=sha256:78ee52ecc088c61cce32b2d30a826f929e1708f7b9247dc3b921aec367dc1b23 \ - --hash=sha256:7be719e4d2ae6c314f72844ba9d69e38dff342bc360379f7c8537c48e23034b7 \ - --hash=sha256:7e1f4744eea1501404b20b0ac059ff7e3f96a97d3e3f48ce27a139e053bb370b \ - --hash=sha256:7e90d6cc4aad2cc1f5e16ed56e46cebf4877c62403a311af20459c15da76fd91 \ - --hash=sha256:7ebe3416785f65c28f4f9441e916bfc8a54179c8dea73c23023f7086fa601c5d \ - --hash=sha256:7f41533d7e3cf9520065f610b41ac1c76bc2161415955fbcead4981b22c7611e \ - --hash=sha256:7f5025db12fc6de7bc1104d826d5aee1d172f9ba6ca936bf6474c2148ac336c1 \ - --hash=sha256:86c963186ca5e50d5c8287b1d1c9d3f8f024cbe343d048c5bd282aec2d8641f2 \ - --hash=sha256:86ce5fcfc3accf3a07a729779d0b86c5d0309a4764c897d86c11089be61da160 \ - --hash=sha256:8a14c192c1d724c3acbfb3f10a958c55a2638391319ce8078cb36c02283959b9 \ - --hash=sha256:8b93785eadaef932e4fe9c6e12ba67beb1b3f1e5495631419c784ab87e975670 \ - --hash=sha256:8ed1af8692bd8d2a29d702f1a2e6065416d76897d726e45a1775b1444f5928a7 \ - --hash=sha256:92879bce89f91f4b2416eba4429c7b5ca22c45ef4a499c39f0c5c69257522c7c \ - --hash=sha256:94fc0e6621e07d1e91c44e016cc0b189b48db053061cc22d6298a611de8071bb \ - --hash=sha256:982487f8931067a32e72d40ab6b47b1628a9c5d344be7f1a4e668fb462d2da42 \ - --hash=sha256:9862bf828112e19685b76ca499b379338fd4c5c269d897e218b2ae8fcb80139d \ - --hash=sha256:99b14dbea2fdb563d8b5a57c9badfcd72083f6006caf8e126b491519c7d64ca8 \ - --hash=sha256:9c6a5c79b28003543db3ba67d1df336f253a87d3112dac3a51b94f7d48e4c0e1 \ - --hash=sha256:a19b794f8fe6569472ff77602437ec4430f9b2b9ec7a1105cfd2232f9ba355e6 \ - --hash=sha256:a306cdd2ad3a7d795d8e617a58c3a2ed0f76c8496fb7621b6cd514eb1532cae8 \ - --hash=sha256:a3dde6cac75e0b0902778978d3b1646ca9f438654395a362cb21d9ad34b24acf \ - --hash=sha256:a874f21f87c485310944b2b2734cd6d318765bcbb7515eead33af9641816506e \ - --hash=sha256:a983cca5ed1dd9a35e9e42ebf9f278d344603bfcb174ff99a5815f953925140a \ - --hash=sha256:aca48506a9c20f68ee61c87f2008f81f8ee99f8d7f0104bff3c47e2d148f89d9 \ - --hash=sha256:b2602177668f89b38b9f84b7b3435d0a72511ddef45dc14446811759b82235a1 \ - --hash=sha256:b3e5fe4538001bb82e2295b8d2a39356a84694c97cb73a566dc36328b9f83b40 \ - --hash=sha256:b6ca36c12a5120bad343eef193cc0122928c5c7466121da7c20f41160ba00ba2 \ - --hash=sha256:b89f4477d915ea43b4ceea6756f63f0288941b6443a2b28c69004fe07fde0d0d \ - --hash=sha256:b9a9d92f10772d2a181b5ca339dee066ab7d1c9a34ae2421b2a52556e719756f \ - --hash=sha256:c99462ffc538717b3e60151dfaf91125f637e801f5ab008f81c402f1dff0cd0f \ - --hash=sha256:cb92f9061657287eded380d7dc455bbf115430b3aa4741bdc662d02977e7d0af \ - --hash=sha256:cdee837710ef6b56ebd20245b83799fce40b265b3b406e51e8ccc5b85b9099b7 \ - --hash=sha256:cf10b7d58ae4a1f07fccbf4a0a956d705356fea05fb4c70608bb6fa81d103cda \ - --hash=sha256:d15687d7d7f40333bd8266f3814c591c2e2cd263fa2116e314f60d82086e353a \ - --hash=sha256:d5c28525c19f5bb1e09511669bb57353d22b94cf8b65f3a8d141c389a55dec95 \ - --hash=sha256:d5f916acf8afbcab6bacbb376ba7dc61f845367901ecd5e328fc4d4aef2fcab0 \ - --hash=sha256:dab03ed811ed1c71d700ed08bde8431cf429bbe59e423394f0f4055f1ca0ea60 \ - --hash=sha256:db453f2da3f59a348f514cfbfeb042393b68720787bbef2b4c6068ea362c8149 \ - --hash=sha256:de2a0645a923ba57c5527497daf8ec5df69c6eadf869e9cd46e86349146e5975 \ - --hash=sha256:dea7fcd62915fb150cdc373212141a30037e11b761fbced340e9db3379b892d4 \ - --hash=sha256:dfcbebdb3c4b6f739a91769aea5ed615023f3c88cb70df812849aef634c25fbe \ - --hash=sha256:dfcebb950aa7e667ec226a442722134539e77c575f6cfaa423f24371bb8d2e94 \ - --hash=sha256:e0641b506486f0b4cd1500a2a65740243e8670a2549bb02bc4556a83af84ae03 \ - --hash=sha256:e33b0834f1cf779aa839975f9d8755a7c2420510c0fa1e9fa0497de77cd35d2c \ - --hash=sha256:e4ace1e220b078c8e48e82c081e35002038657e4b37d403ce940fa679e57113b \ - --hash=sha256:e4cf2d5829f6963a5483ec01578ee76d329eb5caf330ecd05b3edd697e7d768a \ - --hash=sha256:e574de99d735b3fc8364cba9912c2bec2da78775eba95cbb225ef7dda6acea24 \ - --hash=sha256:e646c0e282e960345314f42f2cea5e0b5f56938c093541ea6dbf11aec2862391 \ - --hash=sha256:e8a5ac97ea521d7bde7621d86c30e86b798cdecd985723c4ed737a2aa9e77d0c \ - --hash=sha256:eedf97be7bc3dbc8addcef4142f4b4164066df0c6f36397ae4aaed3eb187d8ab \ - --hash=sha256:ef633add81832f4b56d3b4c9408b43d530dfca29e68fb1b797dcb861a2c734cd \ - --hash=sha256:f27207e8ca3e5e021e2402ba942e5b4c629718e665c81b8b306f3c8b1ddbb786 \ - --hash=sha256:f85f3843bdb1fe80e8c206fe6eed7a1caeae897e496542cee499c374a85c6e08 \ - --hash=sha256:f8e81e4b55930e5ffab4a68db1af431629cf2e4066dbdbfef65348b8ab804ea8 \ - --hash=sha256:f96ae96a060a8072ceff4cfde89d261837b4294a4f28b84a28765470d502ccc6 \ - --hash=sha256:fd9e98b408384989ea4ab60206b8e100d8687da18b5c813c11e92fd8212a98e0 \ - --hash=sha256:ffff855100bc066ff2cd3aa4a60bc9534661816b110f0243e59503ec2df38421 -pydantic-settings==2.0.3 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:962dc3672495aad6ae96a4390fac7e593591e144625e5112d359f8f67fb75945 \ - --hash=sha256:ddd907b066622bd67603b75e2ff791875540dc485b7307c4fffc015719da8625 -pydantic==2.5.3 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:b3ef57c62535b0941697cce638c08900d87fcb67e29cfa99e8a68f747f393f7a \ - --hash=sha256:d0caf5954bee831b6bfe7e338c32b9e30c85dfe080c843680783ac2b631673b4 -pyflakes==3.2.0 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f \ - --hash=sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a +openapi-python-client==0.21.1 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:317324691b2e3365978bb3a02aa2eb0b3c951419dde0cfaa2f4944d9c01f5054 \ + --hash=sha256:6de88ea0975404ac441f8d0f1aa080b31d09c4b1eb5db169b1d94d14d814f85d +pydantic-core==2.18.4 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:01dd777215e2aa86dfd664daed5957704b769e726626393438f9c87690ce78c3 \ + --hash=sha256:0eb2a4f660fcd8e2b1c90ad566db2b98d7f3f4717c64fe0a83e0adb39766d5b8 \ + --hash=sha256:0fbbdc827fe5e42e4d196c746b890b3d72876bdbf160b0eafe9f0334525119c8 \ + --hash=sha256:123c3cec203e3f5ac7b000bd82235f1a3eced8665b63d18be751f115588fea30 \ + --hash=sha256:14601cdb733d741b8958224030e2bfe21a4a881fb3dd6fbb21f071cabd48fa0a \ + --hash=sha256:18f469a3d2a2fdafe99296a87e8a4c37748b5080a26b806a707f25a902c040a8 \ + --hash=sha256:19894b95aacfa98e7cb093cd7881a0c76f55731efad31073db4521e2b6ff5b7d \ + --hash=sha256:1b4de2e51bbcb61fdebd0ab86ef28062704f62c82bbf4addc4e37fa4b00b7cbc \ + --hash=sha256:1d886dc848e60cb7666f771e406acae54ab279b9f1e4143babc9c2258213daa2 \ + --hash=sha256:1f4d26ceb5eb9eed4af91bebeae4b06c3fb28966ca3a8fb765208cf6b51102ab \ + --hash=sha256:21a5e440dbe315ab9825fcd459b8814bb92b27c974cbc23c3e8baa2b76890077 \ + --hash=sha256:293afe532740370aba8c060882f7d26cfd00c94cae32fd2e212a3a6e3b7bc15e \ + --hash=sha256:2f5966897e5461f818e136b8451d0551a2e77259eb0f73a837027b47dc95dab9 \ + --hash=sha256:2fd41f6eff4c20778d717af1cc50eca52f5afe7805ee530a4fbd0bae284f16e9 \ + --hash=sha256:2fdf2156aa3d017fddf8aea5adfba9f777db1d6022d392b682d2a8329e087cef \ + --hash=sha256:3c40d4eaad41f78e3bbda31b89edc46a3f3dc6e171bf0ecf097ff7a0ffff7cb1 \ + --hash=sha256:43d447dd2ae072a0065389092a231283f62d960030ecd27565672bd40746c507 \ + --hash=sha256:44a688331d4a4e2129140a8118479443bd6f1905231138971372fcde37e43528 \ + --hash=sha256:44c7486a4228413c317952e9d89598bcdfb06399735e49e0f8df643e1ccd0558 \ + --hash=sha256:44cd83ab6a51da80fb5adbd9560e26018e2ac7826f9626bc06ca3dc074cd198b \ + --hash=sha256:46387e38bd641b3ee5ce247563b60c5ca098da9c56c75c157a05eaa0933ed154 \ + --hash=sha256:4701b19f7e3a06ea655513f7938de6f108123bf7c86bbebb1196eb9bd35cf724 \ + --hash=sha256:4748321b5078216070b151d5271ef3e7cc905ab170bbfd27d5c83ee3ec436695 \ + --hash=sha256:4b06beb3b3f1479d32befd1f3079cc47b34fa2da62457cdf6c963393340b56e9 \ + --hash=sha256:4d0dcc59664fcb8974b356fe0a18a672d6d7cf9f54746c05f43275fc48636851 \ + --hash=sha256:4e99bc050fe65c450344421017f98298a97cefc18c53bb2f7b3531eb39bc7805 \ + --hash=sha256:509daade3b8649f80d4e5ff21aa5673e4ebe58590b25fe42fac5f0f52c6f034a \ + --hash=sha256:51991a89639a912c17bef4b45c87bd83593aee0437d8102556af4885811d59f5 \ + --hash=sha256:53db086f9f6ab2b4061958d9c276d1dbe3690e8dd727d6abf2321d6cce37fa94 \ + --hash=sha256:564d7922e4b13a16b98772441879fcdcbe82ff50daa622d681dd682175ea918c \ + --hash=sha256:574d92eac874f7f4db0ca653514d823a0d22e2354359d0759e3f6a406db5d55d \ + --hash=sha256:578e24f761f3b425834f297b9935e1ce2e30f51400964ce4801002435a1b41ef \ + --hash=sha256:59ff3e89f4eaf14050c8022011862df275b552caef8082e37b542b066ce1ff26 \ + --hash=sha256:5f09baa656c904807e832cf9cce799c6460c450c4ad80803517032da0cd062e2 \ + --hash=sha256:6891a2ae0e8692679c07728819b6e2b822fb30ca7445f67bbf6509b25a96332c \ + --hash=sha256:6a750aec7bf431517a9fd78cb93c97b9b0c496090fee84a47a0d23668976b4b0 \ + --hash=sha256:6f5c4d41b2771c730ea1c34e458e781b18cc668d194958e0112455fff4e402b2 \ + --hash=sha256:77450e6d20016ec41f43ca4a6c63e9fdde03f0ae3fe90e7c27bdbeaece8b1ed4 \ + --hash=sha256:81b5efb2f126454586d0f40c4d834010979cb80785173d1586df845a632e4e6d \ + --hash=sha256:823be1deb01793da05ecb0484d6c9e20baebb39bd42b5d72636ae9cf8350dbd2 \ + --hash=sha256:834b5230b5dfc0c1ec37b2fda433b271cbbc0e507560b5d1588e2cc1148cf1ce \ + --hash=sha256:847a35c4d58721c5dc3dba599878ebbdfd96784f3fb8bb2c356e123bdcd73f34 \ + --hash=sha256:86110d7e1907ab36691f80b33eb2da87d780f4739ae773e5fc83fb272f88825f \ + --hash=sha256:8951eee36c57cd128f779e641e21eb40bc5073eb28b2d23f33eb0ef14ffb3f5d \ + --hash=sha256:8a7164fe2005d03c64fd3b85649891cd4953a8de53107940bf272500ba8a788b \ + --hash=sha256:8b8bab4c97248095ae0c4455b5a1cd1cdd96e4e4769306ab19dda135ea4cdb07 \ + --hash=sha256:90afc12421df2b1b4dcc975f814e21bc1754640d502a2fbcc6d41e77af5ec312 \ + --hash=sha256:938cb21650855054dc54dfd9120a851c974f95450f00683399006aa6e8abb057 \ + --hash=sha256:942ba11e7dfb66dc70f9ae66b33452f51ac7bb90676da39a7345e99ffb55402d \ + --hash=sha256:972658f4a72d02b8abfa2581d92d59f59897d2e9f7e708fdabe922f9087773af \ + --hash=sha256:97736815b9cc893b2b7f663628e63f436018b75f44854c8027040e05230eeddb \ + --hash=sha256:98906207f29bc2c459ff64fa007afd10a8c8ac080f7e4d5beff4c97086a3dabd \ + --hash=sha256:99457f184ad90235cfe8461c4d70ab7dd2680e28821c29eca00252ba90308c78 \ + --hash=sha256:a0d829524aaefdebccb869eed855e2d04c21d2d7479b6cada7ace5448416597b \ + --hash=sha256:a2fdd81edd64342c85ac7cf2753ccae0b79bf2dfa063785503cb85a7d3593223 \ + --hash=sha256:a55b5b16c839df1070bc113c1f7f94a0af4433fcfa1b41799ce7606e5c79ce0a \ + --hash=sha256:a642295cd0c8df1b86fc3dced1d067874c353a188dc8e0f744626d49e9aa51c4 \ + --hash=sha256:ab86ce7c8f9bea87b9d12c7f0af71102acbf5ecbc66c17796cff45dae54ef9a5 \ + --hash=sha256:abc267fa9837245cc28ea6929f19fa335f3dc330a35d2e45509b6566dc18be23 \ + --hash=sha256:ae1d6df168efb88d7d522664693607b80b4080be6750c913eefb77e34c12c71a \ + --hash=sha256:b2ebef0e0b4454320274f5e83a41844c63438fdc874ea40a8b5b4ecb7693f1c4 \ + --hash=sha256:b48ece5bde2e768197a2d0f6e925f9d7e3e826f0ad2271120f8144a9db18d5c8 \ + --hash=sha256:b7cdf28938ac6b8b49ae5e92f2735056a7ba99c9b110a474473fd71185c1af5d \ + --hash=sha256:bb4462bd43c2460774914b8525f79b00f8f407c945d50881568f294c1d9b4443 \ + --hash=sha256:bc4ff9805858bd54d1a20efff925ccd89c9d2e7cf4986144b30802bf78091c3e \ + --hash=sha256:c1322d7dd74713dcc157a2b7898a564ab091ca6c58302d5c7b4c07296e3fd00f \ + --hash=sha256:c67598100338d5d985db1b3d21f3619ef392e185e71b8d52bceacc4a7771ea7e \ + --hash=sha256:ca26a1e73c48cfc54c4a76ff78df3727b9d9f4ccc8dbee4ae3f73306a591676d \ + --hash=sha256:d323a01da91851a4f17bf592faf46149c9169d68430b3146dcba2bb5e5719abc \ + --hash=sha256:dc1803ac5c32ec324c5261c7209e8f8ce88e83254c4e1aebdc8b0a39f9ddb443 \ + --hash=sha256:e00a3f196329e08e43d99b79b286d60ce46bed10f2280d25a1718399457e06be \ + --hash=sha256:e85637bc8fe81ddb73fda9e56bab24560bdddfa98aa64f87aaa4e4b6730c23d2 \ + --hash=sha256:e858ac0a25074ba4bce653f9b5d0a85b7456eaddadc0ce82d3878c22489fa4ee \ + --hash=sha256:eae237477a873ab46e8dd748e515c72c0c804fb380fbe6c85533c7de51f23a8f \ + --hash=sha256:ebef0dd9bf9b812bf75bda96743f2a6c5734a02092ae7f721c048d156d5fabae \ + --hash=sha256:ec3beeada09ff865c344ff3bc2f427f5e6c26401cc6113d77e372c3fdac73864 \ + --hash=sha256:f76d0ad001edd426b92233d45c746fd08f467d56100fd8f30e9ace4b005266e4 \ + --hash=sha256:f85d05aa0918283cf29a30b547b4df2fbb56b45b135f9e35b6807cb28bc47951 \ + --hash=sha256:f9899c94762343f2cc2fc64c13e7cae4c3cc65cdfc87dd810a31654c9b7358cc +pydantic-settings==2.3.4 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:11ad8bacb68a045f00e4f862c7a718c8a9ec766aa8fd4c32e39a0594b207b53a \ + --hash=sha256:c5802e3d62b78e82522319bbc9b8f8ffb28ad1c988a99311d04f2a6051fca0a7 +pydantic==2.7.3 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:c46c76a40bb1296728d7a8b99aa73dd70a48c3510111ff290034f860c99c419e \ + --hash=sha256:ea91b002777bf643bb20dd717c028ec43216b24a6001a280f83877fd2655d0b4 pyhumps==3.8.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:060e1954d9069f428232a1adda165db0b9d8dfdce1d265d36df7fbff540acfd6 \ --hash=sha256:498026258f7ee1a8e447c2e28526c0bea9407f9a59c03260aee4bd6c04d681a3 -pytest==7.4.4 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280 \ - --hash=sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8 python-dateutil==2.8.2 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 python-dotenv==1.0.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:a8df96034aae6d2d50a4ebe8216326c61c3eb64836776504fcca410e5937a3ba \ --hash=sha256:f5971a9226b701070a4bf2c38c89e5a3f0d64de8debda981d1db98583009122a -pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5 \ - --hash=sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc \ - --hash=sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df \ - --hash=sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741 \ - --hash=sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206 \ - --hash=sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27 \ - --hash=sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595 \ - --hash=sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62 \ - --hash=sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98 \ - --hash=sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696 \ - --hash=sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290 \ - --hash=sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9 \ - --hash=sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d \ - --hash=sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6 \ - --hash=sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867 \ - --hash=sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47 \ - --hash=sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486 \ - --hash=sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6 \ - --hash=sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3 \ - --hash=sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007 \ - --hash=sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938 \ - --hash=sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0 \ - --hash=sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c \ - --hash=sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735 \ - --hash=sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d \ - --hash=sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28 \ - --hash=sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4 \ - --hash=sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba \ - --hash=sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8 \ - --hash=sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5 \ - --hash=sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd \ - --hash=sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3 \ - --hash=sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0 \ - --hash=sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515 \ - --hash=sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c \ - --hash=sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c \ - --hash=sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924 \ - --hash=sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34 \ - --hash=sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43 \ - --hash=sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859 \ - --hash=sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673 \ - --hash=sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54 \ - --hash=sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a \ - --hash=sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b \ - --hash=sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab \ - --hash=sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa \ - --hash=sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c \ - --hash=sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585 \ - --hash=sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d \ - --hash=sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f -ruff==0.1.1 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:2a909d3930afdbc2e9fd893b0034479e90e7981791879aab50ce3d9f55205bd6 \ - --hash=sha256:2d68367d1379a6b47e61bc9de144a47bcdb1aad7903bbf256e4c3d31f11a87ae \ - --hash=sha256:3305d1cb4eb8ff6d3e63a48d1659d20aab43b49fe987b3ca4900528342367145 \ - --hash=sha256:3521bf910104bf781e6753282282acc145cbe3eff79a1ce6b920404cd756075a \ - --hash=sha256:3ff3006c97d9dc396b87fb46bb65818e614ad0181f059322df82bbfe6944e264 \ - --hash=sha256:620d4b34302538dbd8bbbe8fdb8e8f98d72d29bd47e972e2b59ce6c1e8862257 \ - --hash=sha256:6aa7e63c3852cf8fe62698aef31e563e97143a4b801b57f920012d0e07049a8d \ - --hash=sha256:8f5b24daddf35b6c207619301170cae5d2699955829cda77b6ce1e5fc69340df \ - --hash=sha256:b7cdc893aef23ccc14c54bd79a8109a82a2c527e11d030b62201d86f6c2b81c5 \ - --hash=sha256:ba3208543ab91d3e4032db2652dcb6c22a25787b85b8dc3aeff084afdc612e5c \ - --hash=sha256:bc11955f6ce3398d2afe81ad7e49d0ebf0a581d8bcb27b8c300281737735e3a3 \ - --hash=sha256:c34ae501d0ec71acf19ee5d4d889e379863dcc4b796bf8ce2934a9357dc31db7 \ - --hash=sha256:c90461ae4abec261609e5ea436de4a4b5f2822921cf04c16d2cc9327182dbbcc \ - --hash=sha256:cbbd8eead88ea83a250499074e2a8e9d80975f0b324b1e2e679e4594da318c25 \ - --hash=sha256:d3f9ac658ba29e07b95c80fa742b059a55aefffa8b1e078bc3c08768bdd4b11a \ - --hash=sha256:e140bd717c49164c8feb4f65c644046fe929c46f42493672853e3213d7bdbce2 \ - --hash=sha256:f4780e2bb52f3863a565ec3f699319d3493b83ff95ebbb4993e59c62aaf6e75e -setuptools==69.0.3 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:385eb4edd9c9d5c17540511303e39a147ce2fc04bc55289c322b9e5904fe2c05 \ - --hash=sha256:be1af57fc409f93647f2e8e4573a142ed38724b8cdd389706a867bb4efcf1e78 +ruamel-yaml-clib==0.2.8 ; platform_python_implementation == "CPython" and python_version < "3.13" and python_version >= "3.9" \ + --hash=sha256:024cfe1fc7c7f4e1aff4a81e718109e13409767e4f871443cbff3dba3578203d \ + --hash=sha256:03d1162b6d1df1caa3a4bd27aa51ce17c9afc2046c31b0ad60a0a96ec22f8001 \ + --hash=sha256:07238db9cbdf8fc1e9de2489a4f68474e70dffcb32232db7c08fa61ca0c7c462 \ + --hash=sha256:09b055c05697b38ecacb7ac50bdab2240bfca1a0c4872b0fd309bb07dc9aa3a9 \ + --hash=sha256:1707814f0d9791df063f8c19bb51b0d1278b8e9a2353abbb676c2f685dee6afe \ + --hash=sha256:1758ce7d8e1a29d23de54a16ae867abd370f01b5a69e1a3ba75223eaa3ca1a1b \ + --hash=sha256:184565012b60405d93838167f425713180b949e9d8dd0bbc7b49f074407c5a8b \ + --hash=sha256:1b617618914cb00bf5c34d4357c37aa15183fa229b24767259657746c9077615 \ + --hash=sha256:1dc67314e7e1086c9fdf2680b7b6c2be1c0d8e3a8279f2e993ca2a7545fecf62 \ + --hash=sha256:25ac8c08322002b06fa1d49d1646181f0b2c72f5cbc15a85e80b4c30a544bb15 \ + --hash=sha256:25c515e350e5b739842fc3228d662413ef28f295791af5e5110b543cf0b57d9b \ + --hash=sha256:305889baa4043a09e5b76f8e2a51d4ffba44259f6b4c72dec8ca56207d9c6fe1 \ + --hash=sha256:3213ece08ea033eb159ac52ae052a4899b56ecc124bb80020d9bbceeb50258e9 \ + --hash=sha256:3f215c5daf6a9d7bbed4a0a4f760f3113b10e82ff4c5c44bec20a68c8014f675 \ + --hash=sha256:46d378daaac94f454b3a0e3d8d78cafd78a026b1d71443f4966c696b48a6d899 \ + --hash=sha256:4ecbf9c3e19f9562c7fdd462e8d18dd902a47ca046a2e64dba80699f0b6c09b7 \ + --hash=sha256:53a300ed9cea38cf5a2a9b069058137c2ca1ce658a874b79baceb8f892f915a7 \ + --hash=sha256:56f4252222c067b4ce51ae12cbac231bce32aee1d33fbfc9d17e5b8d6966c312 \ + --hash=sha256:5c365d91c88390c8d0a8545df0b5857172824b1c604e867161e6b3d59a827eaa \ + --hash=sha256:700e4ebb569e59e16a976857c8798aee258dceac7c7d6b50cab63e080058df91 \ + --hash=sha256:75e1ed13e1f9de23c5607fe6bd1aeaae21e523b32d83bb33918245361e9cc51b \ + --hash=sha256:77159f5d5b5c14f7c34073862a6b7d34944075d9f93e681638f6d753606c6ce6 \ + --hash=sha256:7f67a1ee819dc4562d444bbafb135832b0b909f81cc90f7aa00260968c9ca1b3 \ + --hash=sha256:840f0c7f194986a63d2c2465ca63af8ccbbc90ab1c6001b1978f05119b5e7334 \ + --hash=sha256:84b554931e932c46f94ab306913ad7e11bba988104c5cff26d90d03f68258cd5 \ + --hash=sha256:87ea5ff66d8064301a154b3933ae406b0863402a799b16e4a1d24d9fbbcbe0d3 \ + --hash=sha256:955eae71ac26c1ab35924203fda6220f84dce57d6d7884f189743e2abe3a9fbe \ + --hash=sha256:a1a45e0bb052edf6a1d3a93baef85319733a888363938e1fc9924cb00c8df24c \ + --hash=sha256:a5aa27bad2bb83670b71683aae140a1f52b0857a2deff56ad3f6c13a017a26ed \ + --hash=sha256:a6a9ffd280b71ad062eae53ac1659ad86a17f59a0fdc7699fd9be40525153337 \ + --hash=sha256:a75879bacf2c987c003368cf14bed0ffe99e8e85acfa6c0bfffc21a090f16880 \ + --hash=sha256:aa2267c6a303eb483de8d02db2871afb5c5fc15618d894300b88958f729ad74f \ + --hash=sha256:aab7fd643f71d7946f2ee58cc88c9b7bfc97debd71dcc93e03e2d174628e7e2d \ + --hash=sha256:b16420e621d26fdfa949a8b4b47ade8810c56002f5389970db4ddda51dbff248 \ + --hash=sha256:b42169467c42b692c19cf539c38d4602069d8c1505e97b86387fcf7afb766e1d \ + --hash=sha256:bba64af9fa9cebe325a62fa398760f5c7206b215201b0ec825005f1b18b9bccf \ + --hash=sha256:beb2e0404003de9a4cab9753a8805a8fe9320ee6673136ed7f04255fe60bb512 \ + --hash=sha256:bef08cd86169d9eafb3ccb0a39edb11d8e25f3dae2b28f5c52fd997521133069 \ + --hash=sha256:c2a72e9109ea74e511e29032f3b670835f8a59bbdc9ce692c5b4ed91ccf1eedb \ + --hash=sha256:c58ecd827313af6864893e7af0a3bb85fd529f862b6adbefe14643947cfe2942 \ + --hash=sha256:c69212f63169ec1cfc9bb44723bf2917cbbd8f6191a00ef3410f5a7fe300722d \ + --hash=sha256:cabddb8d8ead485e255fe80429f833172b4cadf99274db39abc080e068cbcc31 \ + --hash=sha256:d176b57452ab5b7028ac47e7b3cf644bcfdc8cacfecf7e71759f7f51a59e5c92 \ + --hash=sha256:da09ad1c359a728e112d60116f626cc9f29730ff3e0e7db72b9a2dbc2e4beed5 \ + --hash=sha256:e2b4c44b60eadec492926a7270abb100ef9f72798e18743939bdbf037aab8c28 \ + --hash=sha256:e79e5db08739731b0ce4850bed599235d601701d5694c36570a99a0c5ca41a9d \ + --hash=sha256:ebc06178e8821efc9692ea7544aa5644217358490145629914d8020042c24aa1 \ + --hash=sha256:edaef1c1200c4b4cb914583150dcaa3bc30e592e907c01117c08b13a07255ec2 \ + --hash=sha256:f481f16baec5290e45aebdc2a5168ebc6d35189ae6fea7a58787613a25f6e875 \ + --hash=sha256:fff3573c2db359f091e1589c3d7c5fc2f86f5bdb6f24252c2d8e539d4e45f412 +ruamel-yaml==0.18.6 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:57b53ba33def16c4f3d807c0ccbc00f8a6081827e81ba2491691b76882d0c636 \ + --hash=sha256:8b27e6a217e786c6fbe5634d8f3f11bc63e0f80f6a5890f28863d9c45aac311b +ruff==0.4.10 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:0f54c481b39a762d48f64d97351048e842861c6662d63ec599f67d515cb417f6 \ + --hash=sha256:18238c80ee3d9100d3535d8eb15a59c4a0753b45cc55f8bf38f38d6a597b9739 \ + --hash=sha256:330421543bd3222cdfec481e8ff3460e8702ed1e58b494cf9d9e4bf90db52b9d \ + --hash=sha256:338a64ef0748f8c3a80d7f05785930f7965d71ca260904a9321d13be24b79695 \ + --hash=sha256:3aa4f2bc388a30d346c56524f7cacca85945ba124945fe489952aadb6b5cd804 \ + --hash=sha256:3cea07079962b2941244191569cf3a05541477286f5cafea638cd3aa94b56815 \ + --hash=sha256:5c2c4d0859305ac5a16310eec40e4e9a9dec5dcdfbe92697acd99624e8638dac \ + --hash=sha256:67f67cef43c55ffc8cc59e8e0b97e9e60b4837c8f21e8ab5ffd5d66e196e25f7 \ + --hash=sha256:67fe086b433b965c22de0b4259ddfe6fa541c95bf418499bedb9ad5fb8d1c631 \ + --hash=sha256:9e9b6fb3a37b772628415b00c4fc892f97954275394ed611056a4b8a2631365e \ + --hash=sha256:a79489607d1495685cdd911a323a35871abfb7a95d4f98fc6f85e799227ac46e \ + --hash=sha256:acfaaab59543382085f9eb51f8e87bac26bf96b164839955f244d07125a982ef \ + --hash=sha256:b1dd1681dfa90a41b8376a61af05cc4dc5ff32c8f14f5fe20dba9ff5deb80cd6 \ + --hash=sha256:c75c53bb79d71310dc79fb69eb4902fba804a81f374bc86a9b117a8d077a1784 \ + --hash=sha256:d8f71885bce242da344989cae08e263de29752f094233f932d4f5cfb4ef36a81 \ + --hash=sha256:dd1fcee327c20addac7916ca4e2653fbbf2e8388d8a6477ce5b4e986b68ae6c0 \ + --hash=sha256:ffe3cd2f89cb54561c62e5fa20e8f182c0a444934bf430515a4b422f1ab7b7ca shellingham==1.5.4 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686 \ --hash=sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de @@ -371,15 +274,9 @@ six==1.16.0 ; python_version >= "3.9" and python_version < "4.0" \ sniffio==1.3.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:e60305c5e5d314f5389259b7f22aaa33d8f7dee49763119234af3755c55b9101 \ --hash=sha256:eecefdce1e5bbfb7ad2eeaabf7c1eeb404d7757c379bd1f7e5cce9d8bf425384 -tomli==2.0.1 ; python_version >= "3.9" and python_version < "3.11" \ - --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ - --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f typer==0.9.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2 \ --hash=sha256:5d96d986a21493606a358cae4461bd8cdf83cbf33a5aa950ae629ca3b51467ee typing-extensions==4.9.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 \ --hash=sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd -virtualenv==20.25.0 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:4238949c5ffe6876362d9c0180fc6c3a824a7b12b80604eeb8085f2ed7460de3 \ - --hash=sha256:bf51c0d9c7dd63ea8e44086fa1e4fb1093a31e963b86959257378aef020e1f1b diff --git a/scripts/update_openapi.sh b/scripts/update_openapi.sh index 082421e..4d64bc8 100755 --- a/scripts/update_openapi.sh +++ b/scripts/update_openapi.sh @@ -3,18 +3,16 @@ # # Copyright (c) 2023 Smallstep Labs, Inc All Rights Reserved. -set -e +set -x +TEMPDIR=$(mktemp -d) : ${SMALLSTEP_API_URL:="https://gateway.smallstep.com/openapi.json"} -# Update smallstep/openapi.json from URL and update the version to 3.0.2 -curl -sL ${SMALLSTEP_API_URL} |jq '.openapi = "3.0.2"'|sponge smallstep/openapi.json - # Update the smallstep-python client libs from smallstep/openapi.json -openapi-python-client update --config scripts/openapi-python-client.yml --path smallstep/openapi.json +openapi-python-client generate --config scripts/openapi-python-client.yml --url ${SMALLSTEP_API_URL} --output-path=${TEMPDIR} --overwrite +rm -rf smallstep/api_client # Do us a find and replace to fix CamelCase issues -rg disable_custom_sa_ns --files-with-matches smallstep/ | xargs sed -i 's/disable_custom_sa_ns/disable_custom_sans/g' -rg project_i_ds --files-with-matches smallstep/ | xargs sed -i 's/project_i_ds/project_ids/g' -rg static_sa_ns --files-with-matches smallstep/ | xargs sed -i 's/static_sa_ns/static_sans/g' -rg device_metadata_key_sa_ns --files-with-matches smallstep/ | xargs sed -i 's/device_metadata_key_sa_ns/device_metadata_key_sans/g' +rg disable_custom_sa_ns --files-with-matches ${TEMPDIR} | xargs sed -i 's/disable_custom_sa_ns/disable_custom_sans/g' +rg project_i_ds --files-with-matches ${TEMPDIR} | xargs sed -i 's/project_i_ds/project_ids/g' +mv ${TEMPDIR}/api_client smallstep/ diff --git a/smallstep/api_client/__init__.py b/smallstep/api_client/__init__.py index 2d80fd1..448e5ae 100644 --- a/smallstep/api_client/__init__.py +++ b/smallstep/api_client/__init__.py @@ -1,4 +1,5 @@ -""" A client library for accessing Smallstep API """ +"""A client library for accessing Smallstep API""" + from .client import AuthenticatedClient, Client __all__ = ( diff --git a/smallstep/api_client/api/__init__.py b/smallstep/api_client/api/__init__.py index dc035f4..81f9fa2 100644 --- a/smallstep/api_client/api/__init__.py +++ b/smallstep/api_client/api/__init__.py @@ -1 +1 @@ -""" Contains methods for accessing the API """ +"""Contains methods for accessing the API""" diff --git a/smallstep/api_client/api/attestation/delete_attestation_authority.py b/smallstep/api_client/api/attestation/delete_attestation_authority.py index 78c7191..8cd3e65 100644 --- a/smallstep/api_client/api/attestation/delete_attestation_authority.py +++ b/smallstep/api_client/api/attestation/delete_attestation_authority.py @@ -14,21 +14,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "delete", - "url": "/attestation-authorities/{attestationAuthorityID}".format( - attestationAuthorityID=attestation_authority_id, - ), - "headers": headers, + "url": f"/attestation-authorities/{attestation_authority_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == HTTPStatus.NO_CONTENT: diff --git a/smallstep/api_client/api/attestation/get_attestation_authorities.py b/smallstep/api_client/api/attestation/get_attestation_authorities.py index d3b7733..2f8a3e7 100644 --- a/smallstep/api_client/api/attestation/get_attestation_authorities.py +++ b/smallstep/api_client/api/attestation/get_attestation_authorities.py @@ -14,19 +14,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", "url": "/attestation-authorities", - "headers": headers, } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/attestation/get_attestation_authority.py b/smallstep/api_client/api/attestation/get_attestation_authority.py index 0332183..ec8ca0e 100644 --- a/smallstep/api_client/api/attestation/get_attestation_authority.py +++ b/smallstep/api_client/api/attestation/get_attestation_authority.py @@ -15,21 +15,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/attestation-authorities/{attestationAuthorityID}".format( - attestationAuthorityID=attestation_authority_id, - ), - "headers": headers, + "url": f"/attestation-authorities/{attestation_authority_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/attestation/post_attestation_authorities.py b/smallstep/api_client/api/attestation/post_attestation_authorities.py index 532eb06..0acf710 100644 --- a/smallstep/api_client/api/attestation/post_attestation_authorities.py +++ b/smallstep/api_client/api/attestation/post_attestation_authorities.py @@ -11,26 +11,30 @@ def _get_kwargs( *, - json_body: AttestationAuthority, + body: AttestationAuthority, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", "url": "/attestation-authorities", - "json": json_json_body, - "headers": headers, } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -71,7 +75,7 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: AttestationAuthority, + body: AttestationAuthority, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, AttestationAuthority]]: @@ -83,11 +87,11 @@ def sync_detailed( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (AttestationAuthority): An attestation authority used with the device-attest-01 - ACME challenge to verify a device's hardware identity. This object is experimental and - subject to change. Example: {'attestorIntermediates': '-----BEGIN CERTIFICATE-----\n ... - \n-----END CERTIFICATE-----', 'attestorRoots': '-----BEGIN CERTIFICATE-----\n ... \n----- - END CERTIFICATE-----', 'createdAt': '2022-11-10T23:00:00Z', 'id': + body (AttestationAuthority): An attestation authority used with the device-attest-01 ACME + challenge to verify a device's hardware identity. This object is experimental and subject + to change. Example: {'attestorIntermediates': '-----BEGIN CERTIFICATE-----\n ... \n----- + END CERTIFICATE-----', 'attestorRoots': '-----BEGIN CERTIFICATE-----\n ... \n-----END + CERTIFICATE-----', 'createdAt': '2022-11-10T23:00:00Z', 'id': '35507915-6ce4-4517-802f-1bdb6e9e80d8', 'name': 'Our Attestation Authority', 'root': ' -----BEGIN CERTIFICATE-----\n ... \n-----END CERTIFICATE-----', 'slug': 'teamfooattestationca'}. @@ -101,7 +105,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -116,7 +120,7 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - json_body: AttestationAuthority, + body: AttestationAuthority, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, AttestationAuthority]]: @@ -128,11 +132,11 @@ def sync( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (AttestationAuthority): An attestation authority used with the device-attest-01 - ACME challenge to verify a device's hardware identity. This object is experimental and - subject to change. Example: {'attestorIntermediates': '-----BEGIN CERTIFICATE-----\n ... - \n-----END CERTIFICATE-----', 'attestorRoots': '-----BEGIN CERTIFICATE-----\n ... \n----- - END CERTIFICATE-----', 'createdAt': '2022-11-10T23:00:00Z', 'id': + body (AttestationAuthority): An attestation authority used with the device-attest-01 ACME + challenge to verify a device's hardware identity. This object is experimental and subject + to change. Example: {'attestorIntermediates': '-----BEGIN CERTIFICATE-----\n ... \n----- + END CERTIFICATE-----', 'attestorRoots': '-----BEGIN CERTIFICATE-----\n ... \n-----END + CERTIFICATE-----', 'createdAt': '2022-11-10T23:00:00Z', 'id': '35507915-6ce4-4517-802f-1bdb6e9e80d8', 'name': 'Our Attestation Authority', 'root': ' -----BEGIN CERTIFICATE-----\n ... \n-----END CERTIFICATE-----', 'slug': 'teamfooattestationca'}. @@ -147,7 +151,7 @@ def sync( return sync_detailed( client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ).parsed @@ -156,7 +160,7 @@ def sync( async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: AttestationAuthority, + body: AttestationAuthority, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, AttestationAuthority]]: @@ -168,11 +172,11 @@ async def asyncio_detailed( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (AttestationAuthority): An attestation authority used with the device-attest-01 - ACME challenge to verify a device's hardware identity. This object is experimental and - subject to change. Example: {'attestorIntermediates': '-----BEGIN CERTIFICATE-----\n ... - \n-----END CERTIFICATE-----', 'attestorRoots': '-----BEGIN CERTIFICATE-----\n ... \n----- - END CERTIFICATE-----', 'createdAt': '2022-11-10T23:00:00Z', 'id': + body (AttestationAuthority): An attestation authority used with the device-attest-01 ACME + challenge to verify a device's hardware identity. This object is experimental and subject + to change. Example: {'attestorIntermediates': '-----BEGIN CERTIFICATE-----\n ... \n----- + END CERTIFICATE-----', 'attestorRoots': '-----BEGIN CERTIFICATE-----\n ... \n-----END + CERTIFICATE-----', 'createdAt': '2022-11-10T23:00:00Z', 'id': '35507915-6ce4-4517-802f-1bdb6e9e80d8', 'name': 'Our Attestation Authority', 'root': ' -----BEGIN CERTIFICATE-----\n ... \n-----END CERTIFICATE-----', 'slug': 'teamfooattestationca'}. @@ -186,7 +190,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -199,7 +203,7 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - json_body: AttestationAuthority, + body: AttestationAuthority, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, AttestationAuthority]]: @@ -211,11 +215,11 @@ async def asyncio( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (AttestationAuthority): An attestation authority used with the device-attest-01 - ACME challenge to verify a device's hardware identity. This object is experimental and - subject to change. Example: {'attestorIntermediates': '-----BEGIN CERTIFICATE-----\n ... - \n-----END CERTIFICATE-----', 'attestorRoots': '-----BEGIN CERTIFICATE-----\n ... \n----- - END CERTIFICATE-----', 'createdAt': '2022-11-10T23:00:00Z', 'id': + body (AttestationAuthority): An attestation authority used with the device-attest-01 ACME + challenge to verify a device's hardware identity. This object is experimental and subject + to change. Example: {'attestorIntermediates': '-----BEGIN CERTIFICATE-----\n ... \n----- + END CERTIFICATE-----', 'attestorRoots': '-----BEGIN CERTIFICATE-----\n ... \n-----END + CERTIFICATE-----', 'createdAt': '2022-11-10T23:00:00Z', 'id': '35507915-6ce4-4517-802f-1bdb6e9e80d8', 'name': 'Our Attestation Authority', 'root': ' -----BEGIN CERTIFICATE-----\n ... \n-----END CERTIFICATE-----', 'slug': 'teamfooattestationca'}. @@ -231,7 +235,7 @@ async def asyncio( return ( await asyncio_detailed( client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/authenticate/post_auth.py b/smallstep/api_client/api/authenticate/post_auth.py index d37861d..daa760b 100644 --- a/smallstep/api_client/api/authenticate/post_auth.py +++ b/smallstep/api_client/api/authenticate/post_auth.py @@ -5,25 +5,30 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.post_auth_json_body import PostAuthJsonBody +from ...models.post_auth_body import PostAuthBody from ...models.post_auth_response_201 import PostAuthResponse201 from ...types import Response def _get_kwargs( *, - json_body: PostAuthJsonBody, + body: PostAuthBody, ) -> Dict[str, Any]: - pass + headers: Dict[str, Any] = {} - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", "url": "/auth", - "json": json_json_body, } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -64,14 +69,14 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - json_body: PostAuthJsonBody, + body: PostAuthBody, ) -> Response[Union[Any, PostAuthResponse201]]: """Authenticate Use client certificate authentication to get an API token Args: - json_body (PostAuthJsonBody): + body (PostAuthBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -82,7 +87,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = client.get_httpx_client().request( @@ -95,14 +100,14 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - json_body: PostAuthJsonBody, + body: PostAuthBody, ) -> Optional[Union[Any, PostAuthResponse201]]: """Authenticate Use client certificate authentication to get an API token Args: - json_body (PostAuthJsonBody): + body (PostAuthBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -114,21 +119,21 @@ def sync( return sync_detailed( client=client, - json_body=json_body, + body=body, ).parsed async def asyncio_detailed( *, client: AuthenticatedClient, - json_body: PostAuthJsonBody, + body: PostAuthBody, ) -> Response[Union[Any, PostAuthResponse201]]: """Authenticate Use client certificate authentication to get an API token Args: - json_body (PostAuthJsonBody): + body (PostAuthBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,7 +144,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -150,14 +155,14 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - json_body: PostAuthJsonBody, + body: PostAuthBody, ) -> Optional[Union[Any, PostAuthResponse201]]: """Authenticate Use client certificate authentication to get an API token Args: - json_body (PostAuthJsonBody): + body (PostAuthBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -170,6 +175,6 @@ async def asyncio( return ( await asyncio_detailed( client=client, - json_body=json_body, + body=body, ) ).parsed diff --git a/smallstep/api_client/api/authorities/delete_authority.py b/smallstep/api_client/api/authorities/delete_authority.py index 3bfa07d..6046ae2 100644 --- a/smallstep/api_client/api/authorities/delete_authority.py +++ b/smallstep/api_client/api/authorities/delete_authority.py @@ -14,21 +14,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "delete", - "url": "/authorities/{authorityID}".format( - authorityID=authority_id, - ), - "headers": headers, + "url": f"/authorities/{authority_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == HTTPStatus.NO_CONTENT: @@ -37,6 +37,8 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None if response.status_code == HTTPStatus.UNAUTHORIZED: return None + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: + return None if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: return None if client.raise_on_unexpected_status: diff --git a/smallstep/api_client/api/authorities/get_authorities.py b/smallstep/api_client/api/authorities/get_authorities.py index 0b473f4..df29d60 100644 --- a/smallstep/api_client/api/authorities/get_authorities.py +++ b/smallstep/api_client/api/authorities/get_authorities.py @@ -14,19 +14,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", "url": "/authorities", - "headers": headers, } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/authorities/get_authority.py b/smallstep/api_client/api/authorities/get_authority.py index 17d2118..87e8d55 100644 --- a/smallstep/api_client/api/authorities/get_authority.py +++ b/smallstep/api_client/api/authorities/get_authority.py @@ -15,21 +15,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/authorities/{authorityID}".format( - authorityID=authority_id, - ), - "headers": headers, + "url": f"/authorities/{authority_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/authorities/post_authorities.py b/smallstep/api_client/api/authorities/post_authorities.py index 8120511..f62384c 100644 --- a/smallstep/api_client/api/authorities/post_authorities.py +++ b/smallstep/api_client/api/authorities/post_authorities.py @@ -12,26 +12,30 @@ def _get_kwargs( *, - json_body: NewHostedAuthority, + body: NewHostedAuthority, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", "url": "/authorities", - "json": json_json_body, - "headers": headers, } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -52,6 +56,9 @@ def _parse_response( if response.status_code == HTTPStatus.PRECONDITION_FAILED: response_412 = cast(Any, None) return response_412 + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: + response_422 = cast(Any, None) + return response_422 if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: response_500 = cast(Any, None) return response_500 @@ -75,7 +82,7 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: NewHostedAuthority, + body: NewHostedAuthority, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, Authority]]: @@ -86,7 +93,7 @@ def sync_detailed( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewHostedAuthority): The body of a request to create a new authority. + body (NewHostedAuthority): The body of a request to create a new authority. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -97,7 +104,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -112,7 +119,7 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - json_body: NewHostedAuthority, + body: NewHostedAuthority, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, Authority]]: @@ -123,7 +130,7 @@ def sync( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewHostedAuthority): The body of a request to create a new authority. + body (NewHostedAuthority): The body of a request to create a new authority. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -135,7 +142,7 @@ def sync( return sync_detailed( client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ).parsed @@ -144,7 +151,7 @@ def sync( async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: NewHostedAuthority, + body: NewHostedAuthority, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, Authority]]: @@ -155,7 +162,7 @@ async def asyncio_detailed( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewHostedAuthority): The body of a request to create a new authority. + body (NewHostedAuthority): The body of a request to create a new authority. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -166,7 +173,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -179,7 +186,7 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - json_body: NewHostedAuthority, + body: NewHostedAuthority, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, Authority]]: @@ -190,7 +197,7 @@ async def asyncio( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewHostedAuthority): The body of a request to create a new authority. + body (NewHostedAuthority): The body of a request to create a new authority. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -203,7 +210,7 @@ async def asyncio( return ( await asyncio_detailed( client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/authorities/post_authorities_csr.py b/smallstep/api_client/api/authorities/post_authorities_csr.py index 1f2a886..9ba08c6 100644 --- a/smallstep/api_client/api/authorities/post_authorities_csr.py +++ b/smallstep/api_client/api/authorities/post_authorities_csr.py @@ -12,26 +12,30 @@ def _get_kwargs( *, - json_body: NewAuthorityCSR, + body: NewAuthorityCSR, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", "url": "/authorities/csr", - "json": json_json_body, - "headers": headers, } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -75,7 +79,7 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: NewAuthorityCSR, + body: NewAuthorityCSR, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, AuthorityCSR]]: @@ -88,8 +92,8 @@ def sync_detailed( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewAuthorityCSR): Body of a request to create a new X509 advanced authority - with an external root. + body (NewAuthorityCSR): Body of a request to create a new X509 advanced authority with an + external root. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -100,7 +104,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -115,7 +119,7 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - json_body: NewAuthorityCSR, + body: NewAuthorityCSR, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, AuthorityCSR]]: @@ -128,8 +132,8 @@ def sync( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewAuthorityCSR): Body of a request to create a new X509 advanced authority - with an external root. + body (NewAuthorityCSR): Body of a request to create a new X509 advanced authority with an + external root. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,7 +145,7 @@ def sync( return sync_detailed( client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ).parsed @@ -150,7 +154,7 @@ def sync( async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: NewAuthorityCSR, + body: NewAuthorityCSR, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, AuthorityCSR]]: @@ -163,8 +167,8 @@ async def asyncio_detailed( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewAuthorityCSR): Body of a request to create a new X509 advanced authority - with an external root. + body (NewAuthorityCSR): Body of a request to create a new X509 advanced authority with an + external root. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -175,7 +179,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -188,7 +192,7 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - json_body: NewAuthorityCSR, + body: NewAuthorityCSR, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, AuthorityCSR]]: @@ -201,8 +205,8 @@ async def asyncio( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewAuthorityCSR): Body of a request to create a new X509 advanced authority - with an external root. + body (NewAuthorityCSR): Body of a request to create a new X509 advanced authority with an + external root. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -215,7 +219,7 @@ async def asyncio( return ( await asyncio_detailed( client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/authorities/post_authority_root.py b/smallstep/api_client/api/authorities/post_authority_root.py index a252077..612b28a 100644 --- a/smallstep/api_client/api/authorities/post_authority_root.py +++ b/smallstep/api_client/api/authorities/post_authority_root.py @@ -6,35 +6,37 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.authority import Authority -from ...models.post_authority_root_json_body import PostAuthorityRootJsonBody +from ...models.post_authority_root_body import PostAuthorityRootBody from ...types import UNSET, Response, Unset def _get_kwargs( authority_id: str, *, - json_body: PostAuthorityRootJsonBody, + body: PostAuthorityRootBody, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", - "url": "/authorities/{authorityID}/root".format( - authorityID=authority_id, - ), - "json": json_json_body, - "headers": headers, + "url": f"/authorities/{authority_id}/root", } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -76,7 +78,7 @@ def sync_detailed( authority_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: PostAuthorityRootJsonBody, + body: PostAuthorityRootBody, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, Authority]]: @@ -91,7 +93,7 @@ def sync_detailed( authority_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (PostAuthorityRootJsonBody): + body (PostAuthorityRootBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -103,7 +105,7 @@ def sync_detailed( kwargs = _get_kwargs( authority_id=authority_id, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -119,7 +121,7 @@ def sync( authority_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: PostAuthorityRootJsonBody, + body: PostAuthorityRootBody, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, Authority]]: @@ -134,7 +136,7 @@ def sync( authority_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (PostAuthorityRootJsonBody): + body (PostAuthorityRootBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -147,7 +149,7 @@ def sync( return sync_detailed( authority_id=authority_id, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ).parsed @@ -157,7 +159,7 @@ async def asyncio_detailed( authority_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: PostAuthorityRootJsonBody, + body: PostAuthorityRootBody, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, Authority]]: @@ -172,7 +174,7 @@ async def asyncio_detailed( authority_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (PostAuthorityRootJsonBody): + body (PostAuthorityRootBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -184,7 +186,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( authority_id=authority_id, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -198,7 +200,7 @@ async def asyncio( authority_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: PostAuthorityRootJsonBody, + body: PostAuthorityRootBody, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, Authority]]: @@ -213,7 +215,7 @@ async def asyncio( authority_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (PostAuthorityRootJsonBody): + body (PostAuthorityRootBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -227,7 +229,7 @@ async def asyncio( await asyncio_detailed( authority_id=authority_id, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/certificates/__init__.py b/smallstep/api_client/api/certificates/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/smallstep/api_client/api/managed_workloads/get_agent_configuration.py b/smallstep/api_client/api/certificates/get_certificate.py similarity index 73% rename from smallstep/api_client/api/managed_workloads/get_agent_configuration.py rename to smallstep/api_client/api/certificates/get_certificate.py index ff95a78..70c4cc7 100644 --- a/smallstep/api_client/api/managed_workloads/get_agent_configuration.py +++ b/smallstep/api_client/api/certificates/get_certificate.py @@ -5,37 +5,37 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.agent_configuration import AgentConfiguration +from ...models.x509_certificate import X509Certificate from ...types import UNSET, Response, Unset def _get_kwargs( - agent_configuration_id: str, + serial_number: str, *, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/agent-configurations/{agentConfigurationID}".format( - agentConfigurationID=agent_configuration_id, - ), - "headers": headers, + "url": f"/certificates/{serial_number}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AgentConfiguration, Any]]: +) -> Optional[Union[Any, X509Certificate]]: if response.status_code == HTTPStatus.OK: - response_200 = AgentConfiguration.from_dict(response.json()) + response_200 = X509Certificate.from_dict(response.json()) return response_200 if response.status_code == HTTPStatus.BAD_REQUEST: @@ -58,7 +58,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AgentConfiguration, Any]]: +) -> Response[Union[Any, X509Certificate]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -68,18 +68,18 @@ def _build_response( def sync_detailed( - agent_configuration_id: str, + serial_number: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Response[Union[AgentConfiguration, Any]]: - """Get Agent Configuration +) -> Response[Union[Any, X509Certificate]]: + """Get Certificate - Get an agent configuration by ID. + Get a certificate by serial number. Args: - agent_configuration_id (str): + serial_number (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -88,11 +88,11 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AgentConfiguration, Any]] + Response[Union[Any, X509Certificate]] """ kwargs = _get_kwargs( - agent_configuration_id=agent_configuration_id, + serial_number=serial_number, x_request_id=x_request_id, accept=accept, ) @@ -105,18 +105,18 @@ def sync_detailed( def sync( - agent_configuration_id: str, + serial_number: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Optional[Union[AgentConfiguration, Any]]: - """Get Agent Configuration +) -> Optional[Union[Any, X509Certificate]]: + """Get Certificate - Get an agent configuration by ID. + Get a certificate by serial number. Args: - agent_configuration_id (str): + serial_number (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -125,11 +125,11 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AgentConfiguration, Any] + Union[Any, X509Certificate] """ return sync_detailed( - agent_configuration_id=agent_configuration_id, + serial_number=serial_number, client=client, x_request_id=x_request_id, accept=accept, @@ -137,18 +137,18 @@ def sync( async def asyncio_detailed( - agent_configuration_id: str, + serial_number: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Response[Union[AgentConfiguration, Any]]: - """Get Agent Configuration +) -> Response[Union[Any, X509Certificate]]: + """Get Certificate - Get an agent configuration by ID. + Get a certificate by serial number. Args: - agent_configuration_id (str): + serial_number (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -157,11 +157,11 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AgentConfiguration, Any]] + Response[Union[Any, X509Certificate]] """ kwargs = _get_kwargs( - agent_configuration_id=agent_configuration_id, + serial_number=serial_number, x_request_id=x_request_id, accept=accept, ) @@ -172,18 +172,18 @@ async def asyncio_detailed( async def asyncio( - agent_configuration_id: str, + serial_number: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Optional[Union[AgentConfiguration, Any]]: - """Get Agent Configuration +) -> Optional[Union[Any, X509Certificate]]: + """Get Certificate - Get an agent configuration by ID. + Get a certificate by serial number. Args: - agent_configuration_id (str): + serial_number (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -192,12 +192,12 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AgentConfiguration, Any] + Union[Any, X509Certificate] """ return ( await asyncio_detailed( - agent_configuration_id=agent_configuration_id, + serial_number=serial_number, client=client, x_request_id=x_request_id, accept=accept, diff --git a/smallstep/api_client/api/managed_workloads/list_agent_configurations.py b/smallstep/api_client/api/certificates/list_certificates.py similarity index 67% rename from smallstep/api_client/api/managed_workloads/list_agent_configurations.py rename to smallstep/api_client/api/certificates/list_certificates.py index bdb82f0..f9bb15a 100644 --- a/smallstep/api_client/api/managed_workloads/list_agent_configurations.py +++ b/smallstep/api_client/api/certificates/list_certificates.py @@ -5,18 +5,18 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.agent_configuration import AgentConfiguration -from ...models.list_agent_configurations_pagination import ListAgentConfigurationsPagination +from ...models.list_certificates_pagination_type_0 import ListCertificatesPaginationType0 +from ...models.x509_certificate import X509Certificate from ...types import UNSET, Response, Unset def _get_kwargs( *, - pagination: Union[Unset, None, "ListAgentConfigurationsPagination"] = UNSET, + pagination: Union["ListCertificatesPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id @@ -24,31 +24,36 @@ def _get_kwargs( headers["Accept"] = accept params: Dict[str, Any] = {} - json_pagination: Union[Unset, None, Dict[str, Any]] = UNSET - if not isinstance(pagination, Unset): - json_pagination = pagination.to_dict() if pagination else None - if not isinstance(json_pagination, Unset) and json_pagination is not None: - params.update(json_pagination) + json_pagination: Union[Dict[str, Any], None, Unset] + if isinstance(pagination, Unset): + json_pagination = UNSET + elif isinstance(pagination, ListCertificatesPaginationType0): + json_pagination = pagination.to_dict() + else: + json_pagination = pagination + params["pagination"] = json_pagination params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/agent-configurations", + "url": "/certificates", "params": params, - "headers": headers, } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, List["AgentConfiguration"]]]: +) -> Optional[Union[Any, List["X509Certificate"]]]: if response.status_code == HTTPStatus.OK: response_200 = [] _response_200 = response.json() for response_200_item_data in _response_200: - response_200_item = AgentConfiguration.from_dict(response_200_item_data) + response_200_item = X509Certificate.from_dict(response_200_item_data) response_200.append(response_200_item) @@ -70,7 +75,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, List["AgentConfiguration"]]]: +) -> Response[Union[Any, List["X509Certificate"]]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,16 +87,16 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListAgentConfigurationsPagination"] = UNSET, + pagination: Union["ListCertificatesPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, List["AgentConfiguration"]]]: - """List Agent Configurations +) -> Response[Union[Any, List["X509Certificate"]]]: + """List Certificates - Paginate over all your team's agent configurations. + Get a page of certificates. Args: - pagination (Union[Unset, None, ListAgentConfigurationsPagination]): + pagination (Union['ListCertificatesPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -100,7 +105,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, List['AgentConfiguration']]] + Response[Union[Any, List['X509Certificate']]] """ kwargs = _get_kwargs( @@ -119,16 +124,16 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListAgentConfigurationsPagination"] = UNSET, + pagination: Union["ListCertificatesPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, List["AgentConfiguration"]]]: - """List Agent Configurations +) -> Optional[Union[Any, List["X509Certificate"]]]: + """List Certificates - Paginate over all your team's agent configurations. + Get a page of certificates. Args: - pagination (Union[Unset, None, ListAgentConfigurationsPagination]): + pagination (Union['ListCertificatesPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -137,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, List['AgentConfiguration']] + Union[Any, List['X509Certificate']] """ return sync_detailed( @@ -151,16 +156,16 @@ def sync( async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListAgentConfigurationsPagination"] = UNSET, + pagination: Union["ListCertificatesPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, List["AgentConfiguration"]]]: - """List Agent Configurations +) -> Response[Union[Any, List["X509Certificate"]]]: + """List Certificates - Paginate over all your team's agent configurations. + Get a page of certificates. Args: - pagination (Union[Unset, None, ListAgentConfigurationsPagination]): + pagination (Union['ListCertificatesPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -169,7 +174,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, List['AgentConfiguration']]] + Response[Union[Any, List['X509Certificate']]] """ kwargs = _get_kwargs( @@ -186,16 +191,16 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListAgentConfigurationsPagination"] = UNSET, + pagination: Union["ListCertificatesPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, List["AgentConfiguration"]]]: - """List Agent Configurations +) -> Optional[Union[Any, List["X509Certificate"]]]: + """List Certificates - Paginate over all your team's agent configurations. + Get a page of certificates. Args: - pagination (Union[Unset, None, ListAgentConfigurationsPagination]): + pagination (Union['ListCertificatesPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -204,7 +209,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, List['AgentConfiguration']] + Union[Any, List['X509Certificate']] """ return ( diff --git a/smallstep/api_client/api/collections/delete_collection.py b/smallstep/api_client/api/collections/delete_collection.py index fe928c6..69cd0fd 100644 --- a/smallstep/api_client/api/collections/delete_collection.py +++ b/smallstep/api_client/api/collections/delete_collection.py @@ -14,21 +14,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "delete", - "url": "/collections/{collectionSlug}".format( - collectionSlug=collection_slug, - ), - "headers": headers, + "url": f"/collections/{collection_slug}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == HTTPStatus.NO_CONTENT: diff --git a/smallstep/api_client/api/collections/delete_collection_instance.py b/smallstep/api_client/api/collections/delete_collection_instance.py index 1c7f1a2..6fe5023 100644 --- a/smallstep/api_client/api/collections/delete_collection_instance.py +++ b/smallstep/api_client/api/collections/delete_collection_instance.py @@ -15,22 +15,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "delete", - "url": "/collections/{collectionSlug}/instances/{instanceID}".format( - collectionSlug=collection_slug, - instanceID=instance_id, - ), - "headers": headers, + "url": f"/collections/{collection_slug}/instances/{instance_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == HTTPStatus.NO_CONTENT: diff --git a/smallstep/api_client/api/collections/get_collection.py b/smallstep/api_client/api/collections/get_collection.py index e6c0cad..235da34 100644 --- a/smallstep/api_client/api/collections/get_collection.py +++ b/smallstep/api_client/api/collections/get_collection.py @@ -15,21 +15,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/collections/{collectionSlug}".format( - collectionSlug=collection_slug, - ), - "headers": headers, + "url": f"/collections/{collection_slug}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/collections/get_collection_instance.py b/smallstep/api_client/api/collections/get_collection_instance.py index 3a22e99..382db8c 100644 --- a/smallstep/api_client/api/collections/get_collection_instance.py +++ b/smallstep/api_client/api/collections/get_collection_instance.py @@ -16,22 +16,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/collections/{collectionSlug}/instances/{instanceID}".format( - collectionSlug=collection_slug, - instanceID=instance_id, - ), - "headers": headers, + "url": f"/collections/{collection_slug}/instances/{instance_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/collections/get_collection_instance_data.py b/smallstep/api_client/api/collections/get_collection_instance_data.py index 65aaa4b..c74f6c6 100644 --- a/smallstep/api_client/api/collections/get_collection_instance_data.py +++ b/smallstep/api_client/api/collections/get_collection_instance_data.py @@ -15,22 +15,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/collections/{collectionSlug}/instances/{instanceID}/data".format( - collectionSlug=collection_slug, - instanceID=instance_id, - ), - "headers": headers, + "url": f"/collections/{collection_slug}/instances/{instance_id}/data", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == HTTPStatus.OK: diff --git a/smallstep/api_client/api/collections/list_collection_instances.py b/smallstep/api_client/api/collections/list_collection_instances.py index b79af84..938efc5 100644 --- a/smallstep/api_client/api/collections/list_collection_instances.py +++ b/smallstep/api_client/api/collections/list_collection_instances.py @@ -6,18 +6,18 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.collection_instance import CollectionInstance -from ...models.list_collection_instances_pagination import ListCollectionInstancesPagination +from ...models.list_collection_instances_pagination_type_0 import ListCollectionInstancesPaginationType0 from ...types import UNSET, Response, Unset def _get_kwargs( collection_slug: str, *, - pagination: Union[Unset, None, "ListCollectionInstancesPagination"] = UNSET, + pagination: Union["ListCollectionInstancesPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id @@ -25,24 +25,27 @@ def _get_kwargs( headers["Accept"] = accept params: Dict[str, Any] = {} - json_pagination: Union[Unset, None, Dict[str, Any]] = UNSET - if not isinstance(pagination, Unset): - json_pagination = pagination.to_dict() if pagination else None - if not isinstance(json_pagination, Unset) and json_pagination is not None: - params.update(json_pagination) + json_pagination: Union[Dict[str, Any], None, Unset] + if isinstance(pagination, Unset): + json_pagination = UNSET + elif isinstance(pagination, ListCollectionInstancesPaginationType0): + json_pagination = pagination.to_dict() + else: + json_pagination = pagination + params["pagination"] = json_pagination params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/collections/{collectionSlug}/items".format( - collectionSlug=collection_slug, - ), + "url": f"/collections/{collection_slug}/items", "params": params, - "headers": headers, } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -89,7 +92,7 @@ def sync_detailed( collection_slug: str, *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListCollectionInstancesPagination"] = UNSET, + pagination: Union["ListCollectionInstancesPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, List["CollectionInstance"]]]: @@ -99,7 +102,7 @@ def sync_detailed( Args: collection_slug (str): - pagination (Union[Unset, None, ListCollectionInstancesPagination]): + pagination (Union['ListCollectionInstancesPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -129,7 +132,7 @@ def sync( collection_slug: str, *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListCollectionInstancesPagination"] = UNSET, + pagination: Union["ListCollectionInstancesPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, List["CollectionInstance"]]]: @@ -139,7 +142,7 @@ def sync( Args: collection_slug (str): - pagination (Union[Unset, None, ListCollectionInstancesPagination]): + pagination (Union['ListCollectionInstancesPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -164,7 +167,7 @@ async def asyncio_detailed( collection_slug: str, *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListCollectionInstancesPagination"] = UNSET, + pagination: Union["ListCollectionInstancesPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, List["CollectionInstance"]]]: @@ -174,7 +177,7 @@ async def asyncio_detailed( Args: collection_slug (str): - pagination (Union[Unset, None, ListCollectionInstancesPagination]): + pagination (Union['ListCollectionInstancesPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -202,7 +205,7 @@ async def asyncio( collection_slug: str, *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListCollectionInstancesPagination"] = UNSET, + pagination: Union["ListCollectionInstancesPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, List["CollectionInstance"]]]: @@ -212,7 +215,7 @@ async def asyncio( Args: collection_slug (str): - pagination (Union[Unset, None, ListCollectionInstancesPagination]): + pagination (Union['ListCollectionInstancesPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): diff --git a/smallstep/api_client/api/collections/list_collections.py b/smallstep/api_client/api/collections/list_collections.py index e04c3dc..09911ea 100644 --- a/smallstep/api_client/api/collections/list_collections.py +++ b/smallstep/api_client/api/collections/list_collections.py @@ -6,17 +6,17 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.collection import Collection -from ...models.list_collections_pagination import ListCollectionsPagination +from ...models.list_collections_pagination_type_0 import ListCollectionsPaginationType0 from ...types import UNSET, Response, Unset def _get_kwargs( *, - pagination: Union[Unset, None, "ListCollectionsPagination"] = UNSET, + pagination: Union["ListCollectionsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id @@ -24,22 +24,27 @@ def _get_kwargs( headers["Accept"] = accept params: Dict[str, Any] = {} - json_pagination: Union[Unset, None, Dict[str, Any]] = UNSET - if not isinstance(pagination, Unset): - json_pagination = pagination.to_dict() if pagination else None - if not isinstance(json_pagination, Unset) and json_pagination is not None: - params.update(json_pagination) + json_pagination: Union[Dict[str, Any], None, Unset] + if isinstance(pagination, Unset): + json_pagination = UNSET + elif isinstance(pagination, ListCollectionsPaginationType0): + json_pagination = pagination.to_dict() + else: + json_pagination = pagination + params["pagination"] = json_pagination params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { + _kwargs: Dict[str, Any] = { "method": "get", "url": "/collections", "params": params, - "headers": headers, } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -82,7 +87,7 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListCollectionsPagination"] = UNSET, + pagination: Union["ListCollectionsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, List["Collection"]]]: @@ -91,7 +96,7 @@ def sync_detailed( Paginate over all your team's collections. Args: - pagination (Union[Unset, None, ListCollectionsPagination]): + pagination (Union['ListCollectionsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -119,7 +124,7 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListCollectionsPagination"] = UNSET, + pagination: Union["ListCollectionsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, List["Collection"]]]: @@ -128,7 +133,7 @@ def sync( Paginate over all your team's collections. Args: - pagination (Union[Unset, None, ListCollectionsPagination]): + pagination (Union['ListCollectionsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -151,7 +156,7 @@ def sync( async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListCollectionsPagination"] = UNSET, + pagination: Union["ListCollectionsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, List["Collection"]]]: @@ -160,7 +165,7 @@ async def asyncio_detailed( Paginate over all your team's collections. Args: - pagination (Union[Unset, None, ListCollectionsPagination]): + pagination (Union['ListCollectionsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -186,7 +191,7 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListCollectionsPagination"] = UNSET, + pagination: Union["ListCollectionsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, List["Collection"]]]: @@ -195,7 +200,7 @@ async def asyncio( Paginate over all your team's collections. Args: - pagination (Union[Unset, None, ListCollectionsPagination]): + pagination (Union['ListCollectionsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): diff --git a/smallstep/api_client/api/collections/post_collections.py b/smallstep/api_client/api/collections/post_collections.py index 4a42f51..beff8f9 100644 --- a/smallstep/api_client/api/collections/post_collections.py +++ b/smallstep/api_client/api/collections/post_collections.py @@ -12,26 +12,30 @@ def _get_kwargs( *, - json_body: NewCollection, + body: NewCollection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", "url": "/collections", - "json": json_json_body, - "headers": headers, } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -75,7 +79,7 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: NewCollection, + body: NewCollection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, Collection]]: @@ -86,7 +90,7 @@ def sync_detailed( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewCollection): Body of a request to create a new collection. Example: + body (NewCollection): Body of a request to create a new collection. Example: {'displayName': 'Employee Laptops', 'slug': 'devices'}. Raises: @@ -98,7 +102,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -113,7 +117,7 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - json_body: NewCollection, + body: NewCollection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, Collection]]: @@ -124,7 +128,7 @@ def sync( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewCollection): Body of a request to create a new collection. Example: + body (NewCollection): Body of a request to create a new collection. Example: {'displayName': 'Employee Laptops', 'slug': 'devices'}. Raises: @@ -137,7 +141,7 @@ def sync( return sync_detailed( client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ).parsed @@ -146,7 +150,7 @@ def sync( async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: NewCollection, + body: NewCollection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, Collection]]: @@ -157,7 +161,7 @@ async def asyncio_detailed( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewCollection): Body of a request to create a new collection. Example: + body (NewCollection): Body of a request to create a new collection. Example: {'displayName': 'Employee Laptops', 'slug': 'devices'}. Raises: @@ -169,7 +173,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -182,7 +186,7 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - json_body: NewCollection, + body: NewCollection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, Collection]]: @@ -193,7 +197,7 @@ async def asyncio( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewCollection): Body of a request to create a new collection. Example: + body (NewCollection): Body of a request to create a new collection. Example: {'displayName': 'Employee Laptops', 'slug': 'devices'}. Raises: @@ -207,7 +211,7 @@ async def asyncio( return ( await asyncio_detailed( client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/collections/put_collection.py b/smallstep/api_client/api/collections/put_collection.py index ae016fd..23dd1f0 100644 --- a/smallstep/api_client/api/collections/put_collection.py +++ b/smallstep/api_client/api/collections/put_collection.py @@ -12,28 +12,30 @@ def _get_kwargs( collection_slug: str, *, - json_body: Collection, + body: Collection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "put", - "url": "/collections/{collectionSlug}".format( - collectionSlug=collection_slug, - ), - "json": json_json_body, - "headers": headers, + "url": f"/collections/{collection_slug}", } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -78,7 +80,7 @@ def sync_detailed( collection_slug: str, *, client: Union[AuthenticatedClient, Client], - json_body: Collection, + body: Collection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, Collection]]: @@ -90,7 +92,7 @@ def sync_detailed( collection_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (Collection): A collection of instances. Example: {'createdAt': + body (Collection): A collection of instances. Example: {'createdAt': '2023-03-12T02:30:53.708Z', 'displayName': 'Employee Laptops', 'instanceCount': 23, 'slug': 'devices', 'updatedAt': '2023-03-22T02:30:53.708Z'}. @@ -104,7 +106,7 @@ def sync_detailed( kwargs = _get_kwargs( collection_slug=collection_slug, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -120,7 +122,7 @@ def sync( collection_slug: str, *, client: Union[AuthenticatedClient, Client], - json_body: Collection, + body: Collection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, Collection]]: @@ -132,7 +134,7 @@ def sync( collection_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (Collection): A collection of instances. Example: {'createdAt': + body (Collection): A collection of instances. Example: {'createdAt': '2023-03-12T02:30:53.708Z', 'displayName': 'Employee Laptops', 'instanceCount': 23, 'slug': 'devices', 'updatedAt': '2023-03-22T02:30:53.708Z'}. @@ -147,7 +149,7 @@ def sync( return sync_detailed( collection_slug=collection_slug, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ).parsed @@ -157,7 +159,7 @@ async def asyncio_detailed( collection_slug: str, *, client: Union[AuthenticatedClient, Client], - json_body: Collection, + body: Collection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, Collection]]: @@ -169,7 +171,7 @@ async def asyncio_detailed( collection_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (Collection): A collection of instances. Example: {'createdAt': + body (Collection): A collection of instances. Example: {'createdAt': '2023-03-12T02:30:53.708Z', 'displayName': 'Employee Laptops', 'instanceCount': 23, 'slug': 'devices', 'updatedAt': '2023-03-22T02:30:53.708Z'}. @@ -183,7 +185,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( collection_slug=collection_slug, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -197,7 +199,7 @@ async def asyncio( collection_slug: str, *, client: Union[AuthenticatedClient, Client], - json_body: Collection, + body: Collection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, Collection]]: @@ -209,7 +211,7 @@ async def asyncio( collection_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (Collection): A collection of instances. Example: {'createdAt': + body (Collection): A collection of instances. Example: {'createdAt': '2023-03-12T02:30:53.708Z', 'displayName': 'Employee Laptops', 'instanceCount': 23, 'slug': 'devices', 'updatedAt': '2023-03-22T02:30:53.708Z'}. @@ -225,7 +227,7 @@ async def asyncio( await asyncio_detailed( collection_slug=collection_slug, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/collections/put_collection_instance.py b/smallstep/api_client/api/collections/put_collection_instance.py index 9a50691..e585959 100644 --- a/smallstep/api_client/api/collections/put_collection_instance.py +++ b/smallstep/api_client/api/collections/put_collection_instance.py @@ -6,7 +6,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.collection_instance import CollectionInstance -from ...models.put_collection_instance_json_body import PutCollectionInstanceJsonBody +from ...models.put_collection_instance_body import PutCollectionInstanceBody from ...types import UNSET, Response, Unset @@ -14,29 +14,30 @@ def _get_kwargs( collection_slug: str, instance_id: str, *, - json_body: PutCollectionInstanceJsonBody, + body: PutCollectionInstanceBody, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "put", - "url": "/collections/{collectionSlug}/instances/{instanceID}".format( - collectionSlug=collection_slug, - instanceID=instance_id, - ), - "json": json_json_body, - "headers": headers, + "url": f"/collections/{collection_slug}/instances/{instance_id}", } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -51,6 +52,9 @@ def _parse_response( if response.status_code == HTTPStatus.UNAUTHORIZED: response_401 = cast(Any, None) return response_401 + if response.status_code == HTTPStatus.CONFLICT: + response_409 = cast(Any, None) + return response_409 if response.status_code == HTTPStatus.PRECONDITION_FAILED: response_412 = cast(Any, None) return response_412 @@ -79,7 +83,7 @@ def sync_detailed( instance_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: PutCollectionInstanceJsonBody, + body: PutCollectionInstanceBody, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, CollectionInstance]]: @@ -92,7 +96,7 @@ def sync_detailed( instance_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (PutCollectionInstanceJsonBody): + body (PutCollectionInstanceBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -105,7 +109,7 @@ def sync_detailed( kwargs = _get_kwargs( collection_slug=collection_slug, instance_id=instance_id, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -122,7 +126,7 @@ def sync( instance_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: PutCollectionInstanceJsonBody, + body: PutCollectionInstanceBody, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, CollectionInstance]]: @@ -135,7 +139,7 @@ def sync( instance_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (PutCollectionInstanceJsonBody): + body (PutCollectionInstanceBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -149,7 +153,7 @@ def sync( collection_slug=collection_slug, instance_id=instance_id, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ).parsed @@ -160,7 +164,7 @@ async def asyncio_detailed( instance_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: PutCollectionInstanceJsonBody, + body: PutCollectionInstanceBody, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, CollectionInstance]]: @@ -173,7 +177,7 @@ async def asyncio_detailed( instance_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (PutCollectionInstanceJsonBody): + body (PutCollectionInstanceBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -186,7 +190,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( collection_slug=collection_slug, instance_id=instance_id, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -201,7 +205,7 @@ async def asyncio( instance_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: PutCollectionInstanceJsonBody, + body: PutCollectionInstanceBody, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, CollectionInstance]]: @@ -214,7 +218,7 @@ async def asyncio( instance_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (PutCollectionInstanceJsonBody): + body (PutCollectionInstanceBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -229,7 +233,7 @@ async def asyncio( collection_slug=collection_slug, instance_id=instance_id, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/collections/put_collection_instance_data.py b/smallstep/api_client/api/collections/put_collection_instance_data.py index 2a240fe..4c022bd 100644 --- a/smallstep/api_client/api/collections/put_collection_instance_data.py +++ b/smallstep/api_client/api/collections/put_collection_instance_data.py @@ -12,29 +12,30 @@ def _get_kwargs( collection_slug: str, instance_id: str, *, - json_body: Any, + body: Any, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body - - return { + _kwargs: Dict[str, Any] = { "method": "put", - "url": "/collections/{collectionSlug}/instances/{instanceID}/data".format( - collectionSlug=collection_slug, - instanceID=instance_id, - ), - "json": json_json_body, - "headers": headers, + "url": f"/collections/{collection_slug}/instances/{instance_id}/data", } + _body = body + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == HTTPStatus.OK: @@ -43,6 +44,8 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None if response.status_code == HTTPStatus.UNAUTHORIZED: return None + if response.status_code == HTTPStatus.CONFLICT: + return None if response.status_code == HTTPStatus.PRECONDITION_FAILED: return None if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: @@ -67,7 +70,7 @@ def sync_detailed( instance_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: Any, + body: Any, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Any]: @@ -82,7 +85,7 @@ def sync_detailed( instance_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (Any): + body (Any): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -95,7 +98,7 @@ def sync_detailed( kwargs = _get_kwargs( collection_slug=collection_slug, instance_id=instance_id, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -112,7 +115,7 @@ async def asyncio_detailed( instance_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: Any, + body: Any, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Any]: @@ -127,7 +130,7 @@ async def asyncio_detailed( instance_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (Any): + body (Any): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -140,7 +143,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( collection_slug=collection_slug, instance_id=instance_id, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/managed_workloads/delete_agent_configuration.py b/smallstep/api_client/api/managed_workloads/delete_account.py similarity index 82% rename from smallstep/api_client/api/managed_workloads/delete_agent_configuration.py rename to smallstep/api_client/api/managed_workloads/delete_account.py index fe5dd8a..20f1765 100644 --- a/smallstep/api_client/api/managed_workloads/delete_agent_configuration.py +++ b/smallstep/api_client/api/managed_workloads/delete_account.py @@ -9,26 +9,26 @@ def _get_kwargs( - agent_configuration_id: str, + account_id: str, *, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "delete", - "url": "/agent-configurations/{agentConfigurationID}".format( - agentConfigurationID=agent_configuration_id, - ), - "headers": headers, + "url": f"/accounts/{account_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == HTTPStatus.NO_CONTENT: @@ -55,18 +55,18 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( - agent_configuration_id: str, + account_id: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Any]: - """Delete Agent Configuration + """Delete Account - Delete an agent configuration by ID. + Delete an account. Args: - agent_configuration_id (str): + account_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -79,7 +79,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - agent_configuration_id=agent_configuration_id, + account_id=account_id, x_request_id=x_request_id, accept=accept, ) @@ -92,18 +92,18 @@ def sync_detailed( async def asyncio_detailed( - agent_configuration_id: str, + account_id: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Any]: - """Delete Agent Configuration + """Delete Account - Delete an agent configuration by ID. + Delete an account. Args: - agent_configuration_id (str): + account_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -116,7 +116,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - agent_configuration_id=agent_configuration_id, + account_id=account_id, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/managed_workloads/delete_device_collection.py b/smallstep/api_client/api/managed_workloads/delete_device_collection.py index 405afaf..d2cd3ee 100644 --- a/smallstep/api_client/api/managed_workloads/delete_device_collection.py +++ b/smallstep/api_client/api/managed_workloads/delete_device_collection.py @@ -11,11 +11,11 @@ def _get_kwargs( collection_slug: str, *, - purge: Union[Unset, None, bool] = UNSET, + purge: Union[Unset, bool] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id @@ -23,19 +23,20 @@ def _get_kwargs( headers["Accept"] = accept params: Dict[str, Any] = {} + params["purge"] = purge params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { + _kwargs: Dict[str, Any] = { "method": "delete", - "url": "/device-collections/{collectionSlug}".format( - collectionSlug=collection_slug, - ), + "url": f"/device-collections/{collection_slug}", "params": params, - "headers": headers, } + _kwargs["headers"] = headers + return _kwargs + def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == HTTPStatus.NO_CONTENT: @@ -67,7 +68,7 @@ def sync_detailed( collection_slug: str, *, client: Union[AuthenticatedClient, Client], - purge: Union[Unset, None, bool] = UNSET, + purge: Union[Unset, bool] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Any]: @@ -77,7 +78,7 @@ def sync_detailed( Args: collection_slug (str): - purge (Union[Unset, None, bool]): + purge (Union[Unset, bool]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -107,7 +108,7 @@ async def asyncio_detailed( collection_slug: str, *, client: Union[AuthenticatedClient, Client], - purge: Union[Unset, None, bool] = UNSET, + purge: Union[Unset, bool] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Any]: @@ -117,7 +118,7 @@ async def asyncio_detailed( Args: collection_slug (str): - purge (Union[Unset, None, bool]): + purge (Union[Unset, bool]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): diff --git a/smallstep/api_client/api/managed_workloads/delete_endpoint_configuration.py b/smallstep/api_client/api/managed_workloads/delete_device_collection_account.py similarity index 79% rename from smallstep/api_client/api/managed_workloads/delete_endpoint_configuration.py rename to smallstep/api_client/api/managed_workloads/delete_device_collection_account.py index 62f8186..7183232 100644 --- a/smallstep/api_client/api/managed_workloads/delete_endpoint_configuration.py +++ b/smallstep/api_client/api/managed_workloads/delete_device_collection_account.py @@ -9,26 +9,27 @@ def _get_kwargs( - endpoint_configuration_id: str, + collection_slug: str, + account_slug: str, *, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "delete", - "url": "/endpoint-configurations/{endpointConfigurationID}".format( - endpointConfigurationID=endpoint_configuration_id, - ), - "headers": headers, + "url": f"/device-collections/{collection_slug}/accounts/{account_slug}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == HTTPStatus.NO_CONTENT: @@ -55,18 +56,20 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( - endpoint_configuration_id: str, + collection_slug: str, + account_slug: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Any]: - """Delete Endpoint Configuration + """Delete Device Collection Account - Delete an endpoint configuration by ID. + Delete a device collection account. Args: - endpoint_configuration_id (str): + collection_slug (str): + account_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -79,7 +82,8 @@ def sync_detailed( """ kwargs = _get_kwargs( - endpoint_configuration_id=endpoint_configuration_id, + collection_slug=collection_slug, + account_slug=account_slug, x_request_id=x_request_id, accept=accept, ) @@ -92,18 +96,20 @@ def sync_detailed( async def asyncio_detailed( - endpoint_configuration_id: str, + collection_slug: str, + account_slug: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Any]: - """Delete Endpoint Configuration + """Delete Device Collection Account - Delete an endpoint configuration by ID. + Delete a device collection account. Args: - endpoint_configuration_id (str): + collection_slug (str): + account_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -116,7 +122,8 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - endpoint_configuration_id=endpoint_configuration_id, + collection_slug=collection_slug, + account_slug=account_slug, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/managed_workloads/delete_managed_configuration.py b/smallstep/api_client/api/managed_workloads/delete_managed_configuration.py deleted file mode 100644 index dec14a1..0000000 --- a/smallstep/api_client/api/managed_workloads/delete_managed_configuration.py +++ /dev/null @@ -1,126 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - managed_configuration_id: str, - *, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Dict[str, Any]: - headers = {} - if not isinstance(x_request_id, Unset): - headers["X-Request-Id"] = x_request_id - - if not isinstance(accept, Unset): - headers["Accept"] = accept - - return { - "method": "delete", - "url": "/managed-configurations/{managedConfigurationID}".format( - managedConfigurationID=managed_configuration_id, - ), - "headers": headers, - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - if response.status_code == HTTPStatus.NO_CONTENT: - return None - if response.status_code == HTTPStatus.BAD_REQUEST: - return None - if response.status_code == HTTPStatus.UNAUTHORIZED: - return None - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - return None - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - managed_configuration_id: str, - *, - client: Union[AuthenticatedClient, Client], - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Any]: - """Delete Managed Configuration - - Delete a managed configuration by ID. - - Args: - managed_configuration_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Any] - """ - - kwargs = _get_kwargs( - managed_configuration_id=managed_configuration_id, - x_request_id=x_request_id, - accept=accept, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - managed_configuration_id: str, - *, - client: Union[AuthenticatedClient, Client], - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Any]: - """Delete Managed Configuration - - Delete a managed configuration by ID. - - Args: - managed_configuration_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Any] - """ - - kwargs = _get_kwargs( - managed_configuration_id=managed_configuration_id, - x_request_id=x_request_id, - accept=accept, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) diff --git a/smallstep/api_client/api/managed_workloads/delete_managed_configuration_host_id.py b/smallstep/api_client/api/managed_workloads/delete_managed_configuration_host_id.py deleted file mode 100644 index 1ac3b84..0000000 --- a/smallstep/api_client/api/managed_workloads/delete_managed_configuration_host_id.py +++ /dev/null @@ -1,126 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - managed_configuration_host_id: str, - *, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Dict[str, Any]: - headers = {} - if not isinstance(x_request_id, Unset): - headers["X-Request-Id"] = x_request_id - - if not isinstance(accept, Unset): - headers["Accept"] = accept - - return { - "method": "delete", - "url": "/managed-configurations/host/{managedConfigurationHostID}".format( - managedConfigurationHostID=managed_configuration_host_id, - ), - "headers": headers, - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - if response.status_code == HTTPStatus.NO_CONTENT: - return None - if response.status_code == HTTPStatus.BAD_REQUEST: - return None - if response.status_code == HTTPStatus.UNAUTHORIZED: - return None - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - return None - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - managed_configuration_host_id: str, - *, - client: Union[AuthenticatedClient, Client], - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Any]: - """Delete Managed Configuration By Host ID - - Delete the managed configuration with the given host ID. - - Args: - managed_configuration_host_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Any] - """ - - kwargs = _get_kwargs( - managed_configuration_host_id=managed_configuration_host_id, - x_request_id=x_request_id, - accept=accept, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - managed_configuration_host_id: str, - *, - client: Union[AuthenticatedClient, Client], - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Any]: - """Delete Managed Configuration By Host ID - - Delete the managed configuration with the given host ID. - - Args: - managed_configuration_host_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Any] - """ - - kwargs = _get_kwargs( - managed_configuration_host_id=managed_configuration_host_id, - x_request_id=x_request_id, - accept=accept, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) diff --git a/smallstep/api_client/api/managed_workloads/delete_workload.py b/smallstep/api_client/api/managed_workloads/delete_workload.py index c1a6f9c..6d8c5e5 100644 --- a/smallstep/api_client/api/managed_workloads/delete_workload.py +++ b/smallstep/api_client/api/managed_workloads/delete_workload.py @@ -15,22 +15,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "delete", - "url": "/device-collections/{collectionSlug}/workloads/{workloadSlug}".format( - collectionSlug=collection_slug, - workloadSlug=workload_slug, - ), - "headers": headers, + "url": f"/device-collections/{collection_slug}/workloads/{workload_slug}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == HTTPStatus.NO_CONTENT: diff --git a/smallstep/api_client/api/managed_workloads/get_managed_configuration.py b/smallstep/api_client/api/managed_workloads/get_account.py similarity index 72% rename from smallstep/api_client/api/managed_workloads/get_managed_configuration.py rename to smallstep/api_client/api/managed_workloads/get_account.py index f59394b..11d7b3d 100644 --- a/smallstep/api_client/api/managed_workloads/get_managed_configuration.py +++ b/smallstep/api_client/api/managed_workloads/get_account.py @@ -5,37 +5,37 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.managed_configuration import ManagedConfiguration +from ...models.account import Account from ...types import UNSET, Response, Unset def _get_kwargs( - managed_configuration_id: str, + account_id: str, *, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/managed-configurations/{managedConfigurationID}".format( - managedConfigurationID=managed_configuration_id, - ), - "headers": headers, + "url": f"/accounts/{account_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ManagedConfiguration]]: +) -> Optional[Union[Account, Any]]: if response.status_code == HTTPStatus.OK: - response_200 = ManagedConfiguration.from_dict(response.json()) + response_200 = Account.from_dict(response.json()) return response_200 if response.status_code == HTTPStatus.BAD_REQUEST: @@ -58,7 +58,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ManagedConfiguration]]: +) -> Response[Union[Account, Any]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -68,18 +68,18 @@ def _build_response( def sync_detailed( - managed_configuration_id: str, + account_id: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, ManagedConfiguration]]: - """Get Managed Configuration +) -> Response[Union[Account, Any]]: + """Get Account - Get a managed configuration by ID. + Get an account. Args: - managed_configuration_id (str): + account_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -88,11 +88,11 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ManagedConfiguration]] + Response[Union[Account, Any]] """ kwargs = _get_kwargs( - managed_configuration_id=managed_configuration_id, + account_id=account_id, x_request_id=x_request_id, accept=accept, ) @@ -105,18 +105,18 @@ def sync_detailed( def sync( - managed_configuration_id: str, + account_id: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, ManagedConfiguration]]: - """Get Managed Configuration +) -> Optional[Union[Account, Any]]: + """Get Account - Get a managed configuration by ID. + Get an account. Args: - managed_configuration_id (str): + account_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -125,11 +125,11 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ManagedConfiguration] + Union[Account, Any] """ return sync_detailed( - managed_configuration_id=managed_configuration_id, + account_id=account_id, client=client, x_request_id=x_request_id, accept=accept, @@ -137,18 +137,18 @@ def sync( async def asyncio_detailed( - managed_configuration_id: str, + account_id: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, ManagedConfiguration]]: - """Get Managed Configuration +) -> Response[Union[Account, Any]]: + """Get Account - Get a managed configuration by ID. + Get an account. Args: - managed_configuration_id (str): + account_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -157,11 +157,11 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ManagedConfiguration]] + Response[Union[Account, Any]] """ kwargs = _get_kwargs( - managed_configuration_id=managed_configuration_id, + account_id=account_id, x_request_id=x_request_id, accept=accept, ) @@ -172,18 +172,18 @@ async def asyncio_detailed( async def asyncio( - managed_configuration_id: str, + account_id: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, ManagedConfiguration]]: - """Get Managed Configuration +) -> Optional[Union[Account, Any]]: + """Get Account - Get a managed configuration by ID. + Get an account. Args: - managed_configuration_id (str): + account_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -192,12 +192,12 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ManagedConfiguration] + Union[Account, Any] """ return ( await asyncio_detailed( - managed_configuration_id=managed_configuration_id, + account_id=account_id, client=client, x_request_id=x_request_id, accept=accept, diff --git a/smallstep/api_client/api/managed_workloads/get_device_collection.py b/smallstep/api_client/api/managed_workloads/get_device_collection.py index 3e0c9aa..5f7ff19 100644 --- a/smallstep/api_client/api/managed_workloads/get_device_collection.py +++ b/smallstep/api_client/api/managed_workloads/get_device_collection.py @@ -15,21 +15,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/device-collections/{collectionSlug}".format( - collectionSlug=collection_slug, - ), - "headers": headers, + "url": f"/device-collections/{collection_slug}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/managed_workloads/get_managed_configuration_host_id.py b/smallstep/api_client/api/managed_workloads/get_device_collection_account.py similarity index 69% rename from smallstep/api_client/api/managed_workloads/get_managed_configuration_host_id.py rename to smallstep/api_client/api/managed_workloads/get_device_collection_account.py index b40063b..2d7c990 100644 --- a/smallstep/api_client/api/managed_workloads/get_managed_configuration_host_id.py +++ b/smallstep/api_client/api/managed_workloads/get_device_collection_account.py @@ -5,37 +5,38 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.managed_configuration import ManagedConfiguration +from ...models.device_collection_account import DeviceCollectionAccount from ...types import UNSET, Response, Unset def _get_kwargs( - managed_configuration_host_id: str, + collection_slug: str, + account_slug: str, *, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/managed-configurations/host/{managedConfigurationHostID}".format( - managedConfigurationHostID=managed_configuration_host_id, - ), - "headers": headers, + "url": f"/device-collections/{collection_slug}/accounts/{account_slug}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ManagedConfiguration]]: +) -> Optional[Union[Any, DeviceCollectionAccount]]: if response.status_code == HTTPStatus.OK: - response_200 = ManagedConfiguration.from_dict(response.json()) + response_200 = DeviceCollectionAccount.from_dict(response.json()) return response_200 if response.status_code == HTTPStatus.BAD_REQUEST: @@ -58,7 +59,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ManagedConfiguration]]: +) -> Response[Union[Any, DeviceCollectionAccount]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -68,18 +69,20 @@ def _build_response( def sync_detailed( - managed_configuration_host_id: str, + collection_slug: str, + account_slug: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, ManagedConfiguration]]: - """Get Managed Configuration By Host ID +) -> Response[Union[Any, DeviceCollectionAccount]]: + """Get Device Collection Account - Get the managed configuration with the given host ID. + Get a device collection account. Args: - managed_configuration_host_id (str): + collection_slug (str): + account_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -88,11 +91,12 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ManagedConfiguration]] + Response[Union[Any, DeviceCollectionAccount]] """ kwargs = _get_kwargs( - managed_configuration_host_id=managed_configuration_host_id, + collection_slug=collection_slug, + account_slug=account_slug, x_request_id=x_request_id, accept=accept, ) @@ -105,18 +109,20 @@ def sync_detailed( def sync( - managed_configuration_host_id: str, + collection_slug: str, + account_slug: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, ManagedConfiguration]]: - """Get Managed Configuration By Host ID +) -> Optional[Union[Any, DeviceCollectionAccount]]: + """Get Device Collection Account - Get the managed configuration with the given host ID. + Get a device collection account. Args: - managed_configuration_host_id (str): + collection_slug (str): + account_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -125,11 +131,12 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ManagedConfiguration] + Union[Any, DeviceCollectionAccount] """ return sync_detailed( - managed_configuration_host_id=managed_configuration_host_id, + collection_slug=collection_slug, + account_slug=account_slug, client=client, x_request_id=x_request_id, accept=accept, @@ -137,18 +144,20 @@ def sync( async def asyncio_detailed( - managed_configuration_host_id: str, + collection_slug: str, + account_slug: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, ManagedConfiguration]]: - """Get Managed Configuration By Host ID +) -> Response[Union[Any, DeviceCollectionAccount]]: + """Get Device Collection Account - Get the managed configuration with the given host ID. + Get a device collection account. Args: - managed_configuration_host_id (str): + collection_slug (str): + account_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -157,11 +166,12 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ManagedConfiguration]] + Response[Union[Any, DeviceCollectionAccount]] """ kwargs = _get_kwargs( - managed_configuration_host_id=managed_configuration_host_id, + collection_slug=collection_slug, + account_slug=account_slug, x_request_id=x_request_id, accept=accept, ) @@ -172,18 +182,20 @@ async def asyncio_detailed( async def asyncio( - managed_configuration_host_id: str, + collection_slug: str, + account_slug: str, *, client: Union[AuthenticatedClient, Client], x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, ManagedConfiguration]]: - """Get Managed Configuration By Host ID +) -> Optional[Union[Any, DeviceCollectionAccount]]: + """Get Device Collection Account - Get the managed configuration with the given host ID. + Get a device collection account. Args: - managed_configuration_host_id (str): + collection_slug (str): + account_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -192,12 +204,13 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ManagedConfiguration] + Union[Any, DeviceCollectionAccount] """ return ( await asyncio_detailed( - managed_configuration_host_id=managed_configuration_host_id, + collection_slug=collection_slug, + account_slug=account_slug, client=client, x_request_id=x_request_id, accept=accept, diff --git a/smallstep/api_client/api/managed_workloads/list_managed_configurations.py b/smallstep/api_client/api/managed_workloads/get_platforms.py similarity index 67% rename from smallstep/api_client/api/managed_workloads/list_managed_configurations.py rename to smallstep/api_client/api/managed_workloads/get_platforms.py index 03564a3..3299f5f 100644 --- a/smallstep/api_client/api/managed_workloads/list_managed_configurations.py +++ b/smallstep/api_client/api/managed_workloads/get_platforms.py @@ -5,18 +5,18 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.list_managed_configurations_pagination import ListManagedConfigurationsPagination -from ...models.managed_configuration import ManagedConfiguration +from ...models.get_platforms_pagination_type_0 import GetPlatformsPaginationType0 +from ...models.platform import Platform from ...types import UNSET, Response, Unset def _get_kwargs( *, - pagination: Union[Unset, None, "ListManagedConfigurationsPagination"] = UNSET, + pagination: Union["GetPlatformsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id @@ -24,31 +24,36 @@ def _get_kwargs( headers["Accept"] = accept params: Dict[str, Any] = {} - json_pagination: Union[Unset, None, Dict[str, Any]] = UNSET - if not isinstance(pagination, Unset): - json_pagination = pagination.to_dict() if pagination else None - if not isinstance(json_pagination, Unset) and json_pagination is not None: - params.update(json_pagination) + json_pagination: Union[Dict[str, Any], None, Unset] + if isinstance(pagination, Unset): + json_pagination = UNSET + elif isinstance(pagination, GetPlatformsPaginationType0): + json_pagination = pagination.to_dict() + else: + json_pagination = pagination + params["pagination"] = json_pagination params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/managed-configurations", + "url": "/platforms", "params": params, - "headers": headers, } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, List["ManagedConfiguration"]]]: +) -> Optional[Union[Any, List["Platform"]]]: if response.status_code == HTTPStatus.OK: response_200 = [] _response_200 = response.json() for response_200_item_data in _response_200: - response_200_item = ManagedConfiguration.from_dict(response_200_item_data) + response_200_item = Platform.from_dict(response_200_item_data) response_200.append(response_200_item) @@ -70,7 +75,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, List["ManagedConfiguration"]]]: +) -> Response[Union[Any, List["Platform"]]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,16 +87,16 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListManagedConfigurationsPagination"] = UNSET, + pagination: Union["GetPlatformsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, List["ManagedConfiguration"]]]: - """List Managed Configurations +) -> Response[Union[Any, List["Platform"]]]: + """List Platforms - Paginate over all your team's managed configurations. + Get a page of platforms. Args: - pagination (Union[Unset, None, ListManagedConfigurationsPagination]): + pagination (Union['GetPlatformsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -100,7 +105,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, List['ManagedConfiguration']]] + Response[Union[Any, List['Platform']]] """ kwargs = _get_kwargs( @@ -119,16 +124,16 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListManagedConfigurationsPagination"] = UNSET, + pagination: Union["GetPlatformsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, List["ManagedConfiguration"]]]: - """List Managed Configurations +) -> Optional[Union[Any, List["Platform"]]]: + """List Platforms - Paginate over all your team's managed configurations. + Get a page of platforms. Args: - pagination (Union[Unset, None, ListManagedConfigurationsPagination]): + pagination (Union['GetPlatformsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -137,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, List['ManagedConfiguration']] + Union[Any, List['Platform']] """ return sync_detailed( @@ -151,16 +156,16 @@ def sync( async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListManagedConfigurationsPagination"] = UNSET, + pagination: Union["GetPlatformsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, List["ManagedConfiguration"]]]: - """List Managed Configurations +) -> Response[Union[Any, List["Platform"]]]: + """List Platforms - Paginate over all your team's managed configurations. + Get a page of platforms. Args: - pagination (Union[Unset, None, ListManagedConfigurationsPagination]): + pagination (Union['GetPlatformsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -169,7 +174,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, List['ManagedConfiguration']]] + Response[Union[Any, List['Platform']]] """ kwargs = _get_kwargs( @@ -186,16 +191,16 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListManagedConfigurationsPagination"] = UNSET, + pagination: Union["GetPlatformsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, List["ManagedConfiguration"]]]: - """List Managed Configurations +) -> Optional[Union[Any, List["Platform"]]]: + """List Platforms - Paginate over all your team's managed configurations. + Get a page of platforms. Args: - pagination (Union[Unset, None, ListManagedConfigurationsPagination]): + pagination (Union['GetPlatformsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -204,7 +209,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, List['ManagedConfiguration']] + Union[Any, List['Platform']] """ return ( diff --git a/smallstep/api_client/api/managed_workloads/get_workload.py b/smallstep/api_client/api/managed_workloads/get_workload.py index 975506d..0b353af 100644 --- a/smallstep/api_client/api/managed_workloads/get_workload.py +++ b/smallstep/api_client/api/managed_workloads/get_workload.py @@ -16,22 +16,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/device-collections/{collectionSlug}/workloads/{workloadSlug}".format( - collectionSlug=collection_slug, - workloadSlug=workload_slug, - ), - "headers": headers, + "url": f"/device-collections/{collection_slug}/workloads/{workload_slug}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/managed_workloads/list_endpoint_configurations.py b/smallstep/api_client/api/managed_workloads/list_accounts.py similarity index 66% rename from smallstep/api_client/api/managed_workloads/list_endpoint_configurations.py rename to smallstep/api_client/api/managed_workloads/list_accounts.py index 6c186c3..7e142ff 100644 --- a/smallstep/api_client/api/managed_workloads/list_endpoint_configurations.py +++ b/smallstep/api_client/api/managed_workloads/list_accounts.py @@ -5,18 +5,18 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.endpoint_configuration import EndpointConfiguration -from ...models.list_endpoint_configurations_pagination import ListEndpointConfigurationsPagination +from ...models.account import Account +from ...models.list_accounts_pagination_type_0 import ListAccountsPaginationType0 from ...types import UNSET, Response, Unset def _get_kwargs( *, - pagination: Union[Unset, None, "ListEndpointConfigurationsPagination"] = UNSET, + pagination: Union["ListAccountsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id @@ -24,31 +24,36 @@ def _get_kwargs( headers["Accept"] = accept params: Dict[str, Any] = {} - json_pagination: Union[Unset, None, Dict[str, Any]] = UNSET - if not isinstance(pagination, Unset): - json_pagination = pagination.to_dict() if pagination else None - if not isinstance(json_pagination, Unset) and json_pagination is not None: - params.update(json_pagination) + json_pagination: Union[Dict[str, Any], None, Unset] + if isinstance(pagination, Unset): + json_pagination = UNSET + elif isinstance(pagination, ListAccountsPaginationType0): + json_pagination = pagination.to_dict() + else: + json_pagination = pagination + params["pagination"] = json_pagination params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/endpoint-configurations", + "url": "/accounts", "params": params, - "headers": headers, } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, List["EndpointConfiguration"]]]: +) -> Optional[Union[Any, List["Account"]]]: if response.status_code == HTTPStatus.OK: response_200 = [] _response_200 = response.json() for response_200_item_data in _response_200: - response_200_item = EndpointConfiguration.from_dict(response_200_item_data) + response_200_item = Account.from_dict(response_200_item_data) response_200.append(response_200_item) @@ -70,7 +75,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, List["EndpointConfiguration"]]]: +) -> Response[Union[Any, List["Account"]]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,16 +87,16 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListEndpointConfigurationsPagination"] = UNSET, + pagination: Union["ListAccountsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, List["EndpointConfiguration"]]]: - """List Endpoint Configurations +) -> Response[Union[Any, List["Account"]]]: + """List Accounts - Paginate over all your team's endpoint configurations. + Get a page of accounts. Args: - pagination (Union[Unset, None, ListEndpointConfigurationsPagination]): + pagination (Union['ListAccountsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -100,7 +105,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, List['EndpointConfiguration']]] + Response[Union[Any, List['Account']]] """ kwargs = _get_kwargs( @@ -119,16 +124,16 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListEndpointConfigurationsPagination"] = UNSET, + pagination: Union["ListAccountsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, List["EndpointConfiguration"]]]: - """List Endpoint Configurations +) -> Optional[Union[Any, List["Account"]]]: + """List Accounts - Paginate over all your team's endpoint configurations. + Get a page of accounts. Args: - pagination (Union[Unset, None, ListEndpointConfigurationsPagination]): + pagination (Union['ListAccountsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -137,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, List['EndpointConfiguration']] + Union[Any, List['Account']] """ return sync_detailed( @@ -151,16 +156,16 @@ def sync( async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListEndpointConfigurationsPagination"] = UNSET, + pagination: Union["ListAccountsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, List["EndpointConfiguration"]]]: - """List Endpoint Configurations +) -> Response[Union[Any, List["Account"]]]: + """List Accounts - Paginate over all your team's endpoint configurations. + Get a page of accounts. Args: - pagination (Union[Unset, None, ListEndpointConfigurationsPagination]): + pagination (Union['ListAccountsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -169,7 +174,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, List['EndpointConfiguration']]] + Response[Union[Any, List['Account']]] """ kwargs = _get_kwargs( @@ -186,16 +191,16 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "ListEndpointConfigurationsPagination"] = UNSET, + pagination: Union["ListAccountsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, List["EndpointConfiguration"]]]: - """List Endpoint Configurations +) -> Optional[Union[Any, List["Account"]]]: + """List Accounts - Paginate over all your team's endpoint configurations. + Get a page of accounts. Args: - pagination (Union[Unset, None, ListEndpointConfigurationsPagination]): + pagination (Union['ListAccountsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -204,7 +209,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, List['EndpointConfiguration']] + Union[Any, List['Account']] """ return ( diff --git a/smallstep/api_client/api/managed_workloads/post_accounts.py b/smallstep/api_client/api/managed_workloads/post_accounts.py new file mode 100644 index 0000000..f5d4205 --- /dev/null +++ b/smallstep/api_client/api/managed_workloads/post_accounts.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.account import Account +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + body: Account, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + if not isinstance(x_request_id, Unset): + headers["X-Request-Id"] = x_request_id + + if not isinstance(accept, Unset): + headers["Accept"] = accept + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/accounts", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Account, Any]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = Account.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = cast(Any, None) + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Account, Any]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: Union[AuthenticatedClient, Client], + body: Account, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Response[Union[Account, Any]]: + """Create Account + + Create a new account. + + Args: + x_request_id (Union[Unset, str]): + accept (Union[Unset, str]): + body (Account): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Account, Any]] + """ + + kwargs = _get_kwargs( + body=body, + x_request_id=x_request_id, + accept=accept, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + body: Account, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Optional[Union[Account, Any]]: + """Create Account + + Create a new account. + + Args: + x_request_id (Union[Unset, str]): + accept (Union[Unset, str]): + body (Account): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Account, Any] + """ + + return sync_detailed( + client=client, + body=body, + x_request_id=x_request_id, + accept=accept, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + body: Account, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Response[Union[Account, Any]]: + """Create Account + + Create a new account. + + Args: + x_request_id (Union[Unset, str]): + accept (Union[Unset, str]): + body (Account): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Account, Any]] + """ + + kwargs = _get_kwargs( + body=body, + x_request_id=x_request_id, + accept=accept, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], + body: Account, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Optional[Union[Account, Any]]: + """Create Account + + Create a new account. + + Args: + x_request_id (Union[Unset, str]): + accept (Union[Unset, str]): + body (Account): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Account, Any] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + x_request_id=x_request_id, + accept=accept, + ) + ).parsed diff --git a/smallstep/api_client/api/managed_workloads/post_agent_configurations.py b/smallstep/api_client/api/managed_workloads/post_agent_configurations.py deleted file mode 100644 index e857506..0000000 --- a/smallstep/api_client/api/managed_workloads/post_agent_configurations.py +++ /dev/null @@ -1,222 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union, cast - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_configuration import AgentConfiguration -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - json_body: AgentConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Dict[str, Any]: - headers = {} - if not isinstance(x_request_id, Unset): - headers["X-Request-Id"] = x_request_id - - if not isinstance(accept, Unset): - headers["Accept"] = accept - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/agent-configurations", - "json": json_json_body, - "headers": headers, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AgentConfiguration, Any]]: - if response.status_code == HTTPStatus.CREATED: - response_201 = AgentConfiguration.from_dict(response.json()) - - return response_201 - if response.status_code == HTTPStatus.BAD_REQUEST: - response_400 = cast(Any, None) - return response_400 - if response.status_code == HTTPStatus.UNAUTHORIZED: - response_401 = cast(Any, None) - return response_401 - if response.status_code == HTTPStatus.PRECONDITION_FAILED: - response_412 = cast(Any, None) - return response_412 - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - response_500 = cast(Any, None) - return response_500 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AgentConfiguration, Any]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: Union[AuthenticatedClient, Client], - json_body: AgentConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Union[AgentConfiguration, Any]]: - """Create Agent Configuration - - Create a new agent configuration. - - Args: - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (AgentConfiguration): The agent configuration describes the attestation - authority used by the agent to grant workload certificates. This object is experimental - and subject to change. Example: {'attestationSlug': 'teamfooattestationca', 'authorityID': - '60bba807-d3dc-414f-90c9-968a0e3b28c3', 'id': '59b4489d-f731-4ae2-8339-16cf829d143d', - 'name': 'Agent 1', 'provisioner': 'agentsattestor'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[AgentConfiguration, Any]] - """ - - kwargs = _get_kwargs( - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: Union[AuthenticatedClient, Client], - json_body: AgentConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Optional[Union[AgentConfiguration, Any]]: - """Create Agent Configuration - - Create a new agent configuration. - - Args: - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (AgentConfiguration): The agent configuration describes the attestation - authority used by the agent to grant workload certificates. This object is experimental - and subject to change. Example: {'attestationSlug': 'teamfooattestationca', 'authorityID': - '60bba807-d3dc-414f-90c9-968a0e3b28c3', 'id': '59b4489d-f731-4ae2-8339-16cf829d143d', - 'name': 'Agent 1', 'provisioner': 'agentsattestor'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[AgentConfiguration, Any] - """ - - return sync_detailed( - client=client, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ).parsed - - -async def asyncio_detailed( - *, - client: Union[AuthenticatedClient, Client], - json_body: AgentConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Union[AgentConfiguration, Any]]: - """Create Agent Configuration - - Create a new agent configuration. - - Args: - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (AgentConfiguration): The agent configuration describes the attestation - authority used by the agent to grant workload certificates. This object is experimental - and subject to change. Example: {'attestationSlug': 'teamfooattestationca', 'authorityID': - '60bba807-d3dc-414f-90c9-968a0e3b28c3', 'id': '59b4489d-f731-4ae2-8339-16cf829d143d', - 'name': 'Agent 1', 'provisioner': 'agentsattestor'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[AgentConfiguration, Any]] - """ - - kwargs = _get_kwargs( - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: Union[AuthenticatedClient, Client], - json_body: AgentConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Optional[Union[AgentConfiguration, Any]]: - """Create Agent Configuration - - Create a new agent configuration. - - Args: - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (AgentConfiguration): The agent configuration describes the attestation - authority used by the agent to grant workload certificates. This object is experimental - and subject to change. Example: {'attestationSlug': 'teamfooattestationca', 'authorityID': - '60bba807-d3dc-414f-90c9-968a0e3b28c3', 'id': '59b4489d-f731-4ae2-8339-16cf829d143d', - 'name': 'Agent 1', 'provisioner': 'agentsattestor'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[AgentConfiguration, Any] - """ - - return ( - await asyncio_detailed( - client=client, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - ).parsed diff --git a/smallstep/api_client/api/managed_workloads/post_device_enrollment_token.py b/smallstep/api_client/api/managed_workloads/post_device_enrollment_token.py index 4d51dde..65a4a3e 100644 --- a/smallstep/api_client/api/managed_workloads/post_device_enrollment_token.py +++ b/smallstep/api_client/api/managed_workloads/post_device_enrollment_token.py @@ -14,29 +14,30 @@ def _get_kwargs( collection_slug: str, instance_id: str, *, - json_body: NewDeviceEnrollmentToken, + body: NewDeviceEnrollmentToken, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", - "url": "/device-collections/{collectionSlug}/{instanceID}/enrollment-token".format( - collectionSlug=collection_slug, - instanceID=instance_id, - ), - "json": json_json_body, - "headers": headers, + "url": f"/device-collections/{collection_slug}/{instance_id}/enrollment-token", } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -82,7 +83,7 @@ def sync_detailed( instance_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: NewDeviceEnrollmentToken, + body: NewDeviceEnrollmentToken, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, DeviceEnrollmentToken]]: @@ -95,8 +96,8 @@ def sync_detailed( instance_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewDeviceEnrollmentToken): The body of a request to generate a new device - enrollment token. + body (NewDeviceEnrollmentToken): The body of a request to generate a new device enrollment + token. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -109,7 +110,7 @@ def sync_detailed( kwargs = _get_kwargs( collection_slug=collection_slug, instance_id=instance_id, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -126,7 +127,7 @@ def sync( instance_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: NewDeviceEnrollmentToken, + body: NewDeviceEnrollmentToken, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, DeviceEnrollmentToken]]: @@ -139,8 +140,8 @@ def sync( instance_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewDeviceEnrollmentToken): The body of a request to generate a new device - enrollment token. + body (NewDeviceEnrollmentToken): The body of a request to generate a new device enrollment + token. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -154,7 +155,7 @@ def sync( collection_slug=collection_slug, instance_id=instance_id, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ).parsed @@ -165,7 +166,7 @@ async def asyncio_detailed( instance_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: NewDeviceEnrollmentToken, + body: NewDeviceEnrollmentToken, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, DeviceEnrollmentToken]]: @@ -178,8 +179,8 @@ async def asyncio_detailed( instance_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewDeviceEnrollmentToken): The body of a request to generate a new device - enrollment token. + body (NewDeviceEnrollmentToken): The body of a request to generate a new device enrollment + token. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -192,7 +193,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( collection_slug=collection_slug, instance_id=instance_id, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -207,7 +208,7 @@ async def asyncio( instance_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: NewDeviceEnrollmentToken, + body: NewDeviceEnrollmentToken, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, DeviceEnrollmentToken]]: @@ -220,8 +221,8 @@ async def asyncio( instance_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewDeviceEnrollmentToken): The body of a request to generate a new device - enrollment token. + body (NewDeviceEnrollmentToken): The body of a request to generate a new device enrollment + token. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -236,7 +237,7 @@ async def asyncio( collection_slug=collection_slug, instance_id=instance_id, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/managed_workloads/post_endpoint_configurations.py b/smallstep/api_client/api/managed_workloads/post_endpoint_configurations.py deleted file mode 100644 index e8669d2..0000000 --- a/smallstep/api_client/api/managed_workloads/post_endpoint_configurations.py +++ /dev/null @@ -1,250 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union, cast - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.endpoint_configuration import EndpointConfiguration -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - json_body: EndpointConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Dict[str, Any]: - headers = {} - if not isinstance(x_request_id, Unset): - headers["X-Request-Id"] = x_request_id - - if not isinstance(accept, Unset): - headers["Accept"] = accept - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/endpoint-configurations", - "json": json_json_body, - "headers": headers, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, EndpointConfiguration]]: - if response.status_code == HTTPStatus.CREATED: - response_201 = EndpointConfiguration.from_dict(response.json()) - - return response_201 - if response.status_code == HTTPStatus.BAD_REQUEST: - response_400 = cast(Any, None) - return response_400 - if response.status_code == HTTPStatus.UNAUTHORIZED: - response_401 = cast(Any, None) - return response_401 - if response.status_code == HTTPStatus.PRECONDITION_FAILED: - response_412 = cast(Any, None) - return response_412 - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - response_500 = cast(Any, None) - return response_500 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, EndpointConfiguration]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: Union[AuthenticatedClient, Client], - json_body: EndpointConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, EndpointConfiguration]]: - """Create Endpoint Configuration - - Create a new endpoint configuration. - - Args: - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (EndpointConfiguration): Configuration for a managed endpoint. This object is - experimental and subject to change. Example: {'authorityID': - '8e3ff498-2059-4859-9053-c334ceab5f83', 'certificateInfo': {'crtFile': '/etc/db.crt', - 'duration': '24h0m0s', 'gid': 999, 'keyFile': '/etc/db.key', 'mode': 256, 'rootFile': - '/etc/ca.crt', 'type': 'X509', 'uid': 1001}, 'hooks': {'renew': {'after': ['echo - renewed'], 'before': ['echo renewing'], 'onError': ['echo failed to renew'], 'shell': - '/bin/bash'}, 'sign': {'after': ['echo signed'], 'before': ['echo signing'], 'onError': - ['echo failed to sign'], 'shell': '/bin/bash'}}, 'id': - 'd9dd9ca8-8624-4eca-84e9-ee3dd74c1786', 'keyInfo': {'format': 'DER', 'pubFile': - '/etc/db.csr', 'type': 'ECDSA_P256'}, 'kind': 'WORKLOAD', 'name': 'My Database Server', - 'provisioner': 'Endpoints Provisioner', 'reloadInfo': {'method': 'SIGNAL', 'pidFile': - '/var/run/db.pid', 'signal': 1}}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[Any, EndpointConfiguration]] - """ - - kwargs = _get_kwargs( - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: Union[AuthenticatedClient, Client], - json_body: EndpointConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, EndpointConfiguration]]: - """Create Endpoint Configuration - - Create a new endpoint configuration. - - Args: - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (EndpointConfiguration): Configuration for a managed endpoint. This object is - experimental and subject to change. Example: {'authorityID': - '8e3ff498-2059-4859-9053-c334ceab5f83', 'certificateInfo': {'crtFile': '/etc/db.crt', - 'duration': '24h0m0s', 'gid': 999, 'keyFile': '/etc/db.key', 'mode': 256, 'rootFile': - '/etc/ca.crt', 'type': 'X509', 'uid': 1001}, 'hooks': {'renew': {'after': ['echo - renewed'], 'before': ['echo renewing'], 'onError': ['echo failed to renew'], 'shell': - '/bin/bash'}, 'sign': {'after': ['echo signed'], 'before': ['echo signing'], 'onError': - ['echo failed to sign'], 'shell': '/bin/bash'}}, 'id': - 'd9dd9ca8-8624-4eca-84e9-ee3dd74c1786', 'keyInfo': {'format': 'DER', 'pubFile': - '/etc/db.csr', 'type': 'ECDSA_P256'}, 'kind': 'WORKLOAD', 'name': 'My Database Server', - 'provisioner': 'Endpoints Provisioner', 'reloadInfo': {'method': 'SIGNAL', 'pidFile': - '/var/run/db.pid', 'signal': 1}}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[Any, EndpointConfiguration] - """ - - return sync_detailed( - client=client, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ).parsed - - -async def asyncio_detailed( - *, - client: Union[AuthenticatedClient, Client], - json_body: EndpointConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, EndpointConfiguration]]: - """Create Endpoint Configuration - - Create a new endpoint configuration. - - Args: - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (EndpointConfiguration): Configuration for a managed endpoint. This object is - experimental and subject to change. Example: {'authorityID': - '8e3ff498-2059-4859-9053-c334ceab5f83', 'certificateInfo': {'crtFile': '/etc/db.crt', - 'duration': '24h0m0s', 'gid': 999, 'keyFile': '/etc/db.key', 'mode': 256, 'rootFile': - '/etc/ca.crt', 'type': 'X509', 'uid': 1001}, 'hooks': {'renew': {'after': ['echo - renewed'], 'before': ['echo renewing'], 'onError': ['echo failed to renew'], 'shell': - '/bin/bash'}, 'sign': {'after': ['echo signed'], 'before': ['echo signing'], 'onError': - ['echo failed to sign'], 'shell': '/bin/bash'}}, 'id': - 'd9dd9ca8-8624-4eca-84e9-ee3dd74c1786', 'keyInfo': {'format': 'DER', 'pubFile': - '/etc/db.csr', 'type': 'ECDSA_P256'}, 'kind': 'WORKLOAD', 'name': 'My Database Server', - 'provisioner': 'Endpoints Provisioner', 'reloadInfo': {'method': 'SIGNAL', 'pidFile': - '/var/run/db.pid', 'signal': 1}}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[Any, EndpointConfiguration]] - """ - - kwargs = _get_kwargs( - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: Union[AuthenticatedClient, Client], - json_body: EndpointConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, EndpointConfiguration]]: - """Create Endpoint Configuration - - Create a new endpoint configuration. - - Args: - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (EndpointConfiguration): Configuration for a managed endpoint. This object is - experimental and subject to change. Example: {'authorityID': - '8e3ff498-2059-4859-9053-c334ceab5f83', 'certificateInfo': {'crtFile': '/etc/db.crt', - 'duration': '24h0m0s', 'gid': 999, 'keyFile': '/etc/db.key', 'mode': 256, 'rootFile': - '/etc/ca.crt', 'type': 'X509', 'uid': 1001}, 'hooks': {'renew': {'after': ['echo - renewed'], 'before': ['echo renewing'], 'onError': ['echo failed to renew'], 'shell': - '/bin/bash'}, 'sign': {'after': ['echo signed'], 'before': ['echo signing'], 'onError': - ['echo failed to sign'], 'shell': '/bin/bash'}}, 'id': - 'd9dd9ca8-8624-4eca-84e9-ee3dd74c1786', 'keyInfo': {'format': 'DER', 'pubFile': - '/etc/db.csr', 'type': 'ECDSA_P256'}, 'kind': 'WORKLOAD', 'name': 'My Database Server', - 'provisioner': 'Endpoints Provisioner', 'reloadInfo': {'method': 'SIGNAL', 'pidFile': - '/var/run/db.pid', 'signal': 1}}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[Any, EndpointConfiguration] - """ - - return ( - await asyncio_detailed( - client=client, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - ).parsed diff --git a/smallstep/api_client/api/managed_workloads/post_managed_configurations.py b/smallstep/api_client/api/managed_workloads/post_managed_configurations.py deleted file mode 100644 index e0d2a26..0000000 --- a/smallstep/api_client/api/managed_workloads/post_managed_configurations.py +++ /dev/null @@ -1,242 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union, cast - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.managed_configuration import ManagedConfiguration -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - json_body: ManagedConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Dict[str, Any]: - headers = {} - if not isinstance(x_request_id, Unset): - headers["X-Request-Id"] = x_request_id - - if not isinstance(accept, Unset): - headers["Accept"] = accept - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/managed-configurations", - "json": json_json_body, - "headers": headers, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ManagedConfiguration]]: - if response.status_code == HTTPStatus.CREATED: - response_201 = ManagedConfiguration.from_dict(response.json()) - - return response_201 - if response.status_code == HTTPStatus.BAD_REQUEST: - response_400 = cast(Any, None) - return response_400 - if response.status_code == HTTPStatus.UNAUTHORIZED: - response_401 = cast(Any, None) - return response_401 - if response.status_code == HTTPStatus.PRECONDITION_FAILED: - response_412 = cast(Any, None) - return response_412 - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - response_500 = cast(Any, None) - return response_500 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ManagedConfiguration]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: Union[AuthenticatedClient, Client], - json_body: ManagedConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, ManagedConfiguration]]: - """Create Managed Configuration - - Create a new managed configuration. - - Args: - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (ManagedConfiguration): The agent and managed endpoints used in one host. This - object is experimental and subject to change. Example: {'agentConfigurationID': - '12d6f7a3-2096-4ed6-b4e7-53e7f925facd', 'hostID': '8d996786-29c8-4fcd-999a-4a625be60616', - 'id': 'aad6ad55-866b-4988-a51e-58a7225db66c', 'managedEndpoints': - [{'endpointConfigurationID': '3b872b88-bb2f-4575-b3fe-69cf92ae57f6', 'id': - '5bad10b3-32fe-44da-b516-aef568790e66', 'x509CertificateData': {'commonName': 'db', - 'sans': ['db', 'db.internal']}}, {'endpointConfigurationID': '1f42f5fe- - eda0-4300-bb7f-462afe483ae1', 'id': '99e45a28-36b9-4dd0-ac57-2d43aac9f36e', - 'sshCertificateData': {'keyID': 'abc123', 'principals': ['ops', 'eng']}}], 'name': 'My - Server'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[Any, ManagedConfiguration]] - """ - - kwargs = _get_kwargs( - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: Union[AuthenticatedClient, Client], - json_body: ManagedConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, ManagedConfiguration]]: - """Create Managed Configuration - - Create a new managed configuration. - - Args: - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (ManagedConfiguration): The agent and managed endpoints used in one host. This - object is experimental and subject to change. Example: {'agentConfigurationID': - '12d6f7a3-2096-4ed6-b4e7-53e7f925facd', 'hostID': '8d996786-29c8-4fcd-999a-4a625be60616', - 'id': 'aad6ad55-866b-4988-a51e-58a7225db66c', 'managedEndpoints': - [{'endpointConfigurationID': '3b872b88-bb2f-4575-b3fe-69cf92ae57f6', 'id': - '5bad10b3-32fe-44da-b516-aef568790e66', 'x509CertificateData': {'commonName': 'db', - 'sans': ['db', 'db.internal']}}, {'endpointConfigurationID': '1f42f5fe- - eda0-4300-bb7f-462afe483ae1', 'id': '99e45a28-36b9-4dd0-ac57-2d43aac9f36e', - 'sshCertificateData': {'keyID': 'abc123', 'principals': ['ops', 'eng']}}], 'name': 'My - Server'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[Any, ManagedConfiguration] - """ - - return sync_detailed( - client=client, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ).parsed - - -async def asyncio_detailed( - *, - client: Union[AuthenticatedClient, Client], - json_body: ManagedConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, ManagedConfiguration]]: - """Create Managed Configuration - - Create a new managed configuration. - - Args: - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (ManagedConfiguration): The agent and managed endpoints used in one host. This - object is experimental and subject to change. Example: {'agentConfigurationID': - '12d6f7a3-2096-4ed6-b4e7-53e7f925facd', 'hostID': '8d996786-29c8-4fcd-999a-4a625be60616', - 'id': 'aad6ad55-866b-4988-a51e-58a7225db66c', 'managedEndpoints': - [{'endpointConfigurationID': '3b872b88-bb2f-4575-b3fe-69cf92ae57f6', 'id': - '5bad10b3-32fe-44da-b516-aef568790e66', 'x509CertificateData': {'commonName': 'db', - 'sans': ['db', 'db.internal']}}, {'endpointConfigurationID': '1f42f5fe- - eda0-4300-bb7f-462afe483ae1', 'id': '99e45a28-36b9-4dd0-ac57-2d43aac9f36e', - 'sshCertificateData': {'keyID': 'abc123', 'principals': ['ops', 'eng']}}], 'name': 'My - Server'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[Any, ManagedConfiguration]] - """ - - kwargs = _get_kwargs( - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: Union[AuthenticatedClient, Client], - json_body: ManagedConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, ManagedConfiguration]]: - """Create Managed Configuration - - Create a new managed configuration. - - Args: - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (ManagedConfiguration): The agent and managed endpoints used in one host. This - object is experimental and subject to change. Example: {'agentConfigurationID': - '12d6f7a3-2096-4ed6-b4e7-53e7f925facd', 'hostID': '8d996786-29c8-4fcd-999a-4a625be60616', - 'id': 'aad6ad55-866b-4988-a51e-58a7225db66c', 'managedEndpoints': - [{'endpointConfigurationID': '3b872b88-bb2f-4575-b3fe-69cf92ae57f6', 'id': - '5bad10b3-32fe-44da-b516-aef568790e66', 'x509CertificateData': {'commonName': 'db', - 'sans': ['db', 'db.internal']}}, {'endpointConfigurationID': '1f42f5fe- - eda0-4300-bb7f-462afe483ae1', 'id': '99e45a28-36b9-4dd0-ac57-2d43aac9f36e', - 'sshCertificateData': {'keyID': 'abc123', 'principals': ['ops', 'eng']}}], 'name': 'My - Server'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[Any, ManagedConfiguration] - """ - - return ( - await asyncio_detailed( - client=client, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - ).parsed diff --git a/smallstep/api_client/api/managed_workloads/get_endpoint_configuration.py b/smallstep/api_client/api/managed_workloads/put_account.py similarity index 71% rename from smallstep/api_client/api/managed_workloads/get_endpoint_configuration.py rename to smallstep/api_client/api/managed_workloads/put_account.py index 60278f4..8385381 100644 --- a/smallstep/api_client/api/managed_workloads/get_endpoint_configuration.py +++ b/smallstep/api_client/api/managed_workloads/put_account.py @@ -5,37 +5,43 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.endpoint_configuration import EndpointConfiguration +from ...models.account import Account from ...types import UNSET, Response, Unset def _get_kwargs( - endpoint_configuration_id: str, + account_id: str, *, + body: Account, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { - "method": "get", - "url": "/endpoint-configurations/{endpointConfigurationID}".format( - endpointConfigurationID=endpoint_configuration_id, - ), - "headers": headers, + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/accounts/{account_id}", } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, EndpointConfiguration]]: +) -> Optional[Union[Account, Any]]: if response.status_code == HTTPStatus.OK: - response_200 = EndpointConfiguration.from_dict(response.json()) + response_200 = Account.from_dict(response.json()) return response_200 if response.status_code == HTTPStatus.BAD_REQUEST: @@ -58,7 +64,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, EndpointConfiguration]]: +) -> Response[Union[Account, Any]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -68,31 +74,34 @@ def _build_response( def sync_detailed( - endpoint_configuration_id: str, + account_id: str, *, client: Union[AuthenticatedClient, Client], + body: Account, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, EndpointConfiguration]]: - """Get Endpoint Configuration +) -> Response[Union[Account, Any]]: + """Update Account - Get an endpoint configuration by ID. + Update an existing account. Args: - endpoint_configuration_id (str): + account_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): + body (Account): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, EndpointConfiguration]] + Response[Union[Account, Any]] """ kwargs = _get_kwargs( - endpoint_configuration_id=endpoint_configuration_id, + account_id=account_id, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -105,63 +114,69 @@ def sync_detailed( def sync( - endpoint_configuration_id: str, + account_id: str, *, client: Union[AuthenticatedClient, Client], + body: Account, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, EndpointConfiguration]]: - """Get Endpoint Configuration +) -> Optional[Union[Account, Any]]: + """Update Account - Get an endpoint configuration by ID. + Update an existing account. Args: - endpoint_configuration_id (str): + account_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): + body (Account): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, EndpointConfiguration] + Union[Account, Any] """ return sync_detailed( - endpoint_configuration_id=endpoint_configuration_id, + account_id=account_id, client=client, + body=body, x_request_id=x_request_id, accept=accept, ).parsed async def asyncio_detailed( - endpoint_configuration_id: str, + account_id: str, *, client: Union[AuthenticatedClient, Client], + body: Account, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, EndpointConfiguration]]: - """Get Endpoint Configuration +) -> Response[Union[Account, Any]]: + """Update Account - Get an endpoint configuration by ID. + Update an existing account. Args: - endpoint_configuration_id (str): + account_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): + body (Account): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, EndpointConfiguration]] + Response[Union[Account, Any]] """ kwargs = _get_kwargs( - endpoint_configuration_id=endpoint_configuration_id, + account_id=account_id, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -172,33 +187,36 @@ async def asyncio_detailed( async def asyncio( - endpoint_configuration_id: str, + account_id: str, *, client: Union[AuthenticatedClient, Client], + body: Account, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, EndpointConfiguration]]: - """Get Endpoint Configuration +) -> Optional[Union[Account, Any]]: + """Update Account - Get an endpoint configuration by ID. + Update an existing account. Args: - endpoint_configuration_id (str): + account_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): + body (Account): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, EndpointConfiguration] + Union[Account, Any] """ return ( await asyncio_detailed( - endpoint_configuration_id=endpoint_configuration_id, + account_id=account_id, client=client, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/managed_workloads/put_agent_configuration.py b/smallstep/api_client/api/managed_workloads/put_agent_configuration.py deleted file mode 100644 index d5c09c5..0000000 --- a/smallstep/api_client/api/managed_workloads/put_agent_configuration.py +++ /dev/null @@ -1,240 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union, cast - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_configuration import AgentConfiguration -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_configuration_id: str, - *, - json_body: AgentConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Dict[str, Any]: - headers = {} - if not isinstance(x_request_id, Unset): - headers["X-Request-Id"] = x_request_id - - if not isinstance(accept, Unset): - headers["Accept"] = accept - - json_json_body = json_body.to_dict() - - return { - "method": "put", - "url": "/agent-configurations/{agentConfigurationID}".format( - agentConfigurationID=agent_configuration_id, - ), - "json": json_json_body, - "headers": headers, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AgentConfiguration, Any]]: - if response.status_code == HTTPStatus.OK: - response_200 = AgentConfiguration.from_dict(response.json()) - - return response_200 - if response.status_code == HTTPStatus.BAD_REQUEST: - response_400 = cast(Any, None) - return response_400 - if response.status_code == HTTPStatus.UNAUTHORIZED: - response_401 = cast(Any, None) - return response_401 - if response.status_code == HTTPStatus.NOT_FOUND: - response_404 = cast(Any, None) - return response_404 - if response.status_code == HTTPStatus.PRECONDITION_FAILED: - response_412 = cast(Any, None) - return response_412 - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - response_500 = cast(Any, None) - return response_500 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AgentConfiguration, Any]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - agent_configuration_id: str, - *, - client: Union[AuthenticatedClient, Client], - json_body: AgentConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Union[AgentConfiguration, Any]]: - """Update Agent Configuration - - Update an agent configuration. - - Args: - agent_configuration_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (AgentConfiguration): The agent configuration describes the attestation - authority used by the agent to grant workload certificates. This object is experimental - and subject to change. Example: {'attestationSlug': 'teamfooattestationca', 'authorityID': - '60bba807-d3dc-414f-90c9-968a0e3b28c3', 'id': '59b4489d-f731-4ae2-8339-16cf829d143d', - 'name': 'Agent 1', 'provisioner': 'agentsattestor'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[AgentConfiguration, Any]] - """ - - kwargs = _get_kwargs( - agent_configuration_id=agent_configuration_id, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_configuration_id: str, - *, - client: Union[AuthenticatedClient, Client], - json_body: AgentConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Optional[Union[AgentConfiguration, Any]]: - """Update Agent Configuration - - Update an agent configuration. - - Args: - agent_configuration_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (AgentConfiguration): The agent configuration describes the attestation - authority used by the agent to grant workload certificates. This object is experimental - and subject to change. Example: {'attestationSlug': 'teamfooattestationca', 'authorityID': - '60bba807-d3dc-414f-90c9-968a0e3b28c3', 'id': '59b4489d-f731-4ae2-8339-16cf829d143d', - 'name': 'Agent 1', 'provisioner': 'agentsattestor'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[AgentConfiguration, Any] - """ - - return sync_detailed( - agent_configuration_id=agent_configuration_id, - client=client, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ).parsed - - -async def asyncio_detailed( - agent_configuration_id: str, - *, - client: Union[AuthenticatedClient, Client], - json_body: AgentConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Union[AgentConfiguration, Any]]: - """Update Agent Configuration - - Update an agent configuration. - - Args: - agent_configuration_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (AgentConfiguration): The agent configuration describes the attestation - authority used by the agent to grant workload certificates. This object is experimental - and subject to change. Example: {'attestationSlug': 'teamfooattestationca', 'authorityID': - '60bba807-d3dc-414f-90c9-968a0e3b28c3', 'id': '59b4489d-f731-4ae2-8339-16cf829d143d', - 'name': 'Agent 1', 'provisioner': 'agentsattestor'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[AgentConfiguration, Any]] - """ - - kwargs = _get_kwargs( - agent_configuration_id=agent_configuration_id, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_configuration_id: str, - *, - client: Union[AuthenticatedClient, Client], - json_body: AgentConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Optional[Union[AgentConfiguration, Any]]: - """Update Agent Configuration - - Update an agent configuration. - - Args: - agent_configuration_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (AgentConfiguration): The agent configuration describes the attestation - authority used by the agent to grant workload certificates. This object is experimental - and subject to change. Example: {'attestationSlug': 'teamfooattestationca', 'authorityID': - '60bba807-d3dc-414f-90c9-968a0e3b28c3', 'id': '59b4489d-f731-4ae2-8339-16cf829d143d', - 'name': 'Agent 1', 'provisioner': 'agentsattestor'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[AgentConfiguration, Any] - """ - - return ( - await asyncio_detailed( - agent_configuration_id=agent_configuration_id, - client=client, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - ).parsed diff --git a/smallstep/api_client/api/managed_workloads/put_device_collection.py b/smallstep/api_client/api/managed_workloads/put_device_collection.py index 2c9e912..9a216ff 100644 --- a/smallstep/api_client/api/managed_workloads/put_device_collection.py +++ b/smallstep/api_client/api/managed_workloads/put_device_collection.py @@ -12,28 +12,30 @@ def _get_kwargs( collection_slug: str, *, - json_body: DeviceCollection, + body: DeviceCollection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "put", - "url": "/device-collections/{collectionSlug}".format( - collectionSlug=collection_slug, - ), - "json": json_json_body, - "headers": headers, + "url": f"/device-collections/{collection_slug}", } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -75,22 +77,24 @@ def sync_detailed( collection_slug: str, *, client: Union[AuthenticatedClient, Client], - json_body: DeviceCollection, + body: DeviceCollection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, DeviceCollection]]: """Create Device Collection - Create a new device collection or update an existing device collection. - A device collection is a set of devices running the smallstep agent with the same configuration. - All resources required to run the smallstep agent on the devices will be created if they do not - already exist, including authorities, provisioners and webhooks. + Create or update a device collection. + A device collection is a set of devices that you will use with Smallstep. + You should group your devices by type (eg. AWS VMs, Azure VM, on-prem devices, mobile devices, etc.) + and by their need for similar workload configurations. + When you create your first device collection, Smallstep will create a few foundational components + (CAs, provisioners, and webhooks) for you. Args: collection_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (DeviceCollection): Configuration to create a new device collection. + body (DeviceCollection): Configuration to create a new device collection. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -102,7 +106,7 @@ def sync_detailed( kwargs = _get_kwargs( collection_slug=collection_slug, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -118,22 +122,24 @@ def sync( collection_slug: str, *, client: Union[AuthenticatedClient, Client], - json_body: DeviceCollection, + body: DeviceCollection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, DeviceCollection]]: """Create Device Collection - Create a new device collection or update an existing device collection. - A device collection is a set of devices running the smallstep agent with the same configuration. - All resources required to run the smallstep agent on the devices will be created if they do not - already exist, including authorities, provisioners and webhooks. + Create or update a device collection. + A device collection is a set of devices that you will use with Smallstep. + You should group your devices by type (eg. AWS VMs, Azure VM, on-prem devices, mobile devices, etc.) + and by their need for similar workload configurations. + When you create your first device collection, Smallstep will create a few foundational components + (CAs, provisioners, and webhooks) for you. Args: collection_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (DeviceCollection): Configuration to create a new device collection. + body (DeviceCollection): Configuration to create a new device collection. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -146,7 +152,7 @@ def sync( return sync_detailed( collection_slug=collection_slug, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ).parsed @@ -156,22 +162,24 @@ async def asyncio_detailed( collection_slug: str, *, client: Union[AuthenticatedClient, Client], - json_body: DeviceCollection, + body: DeviceCollection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, DeviceCollection]]: """Create Device Collection - Create a new device collection or update an existing device collection. - A device collection is a set of devices running the smallstep agent with the same configuration. - All resources required to run the smallstep agent on the devices will be created if they do not - already exist, including authorities, provisioners and webhooks. + Create or update a device collection. + A device collection is a set of devices that you will use with Smallstep. + You should group your devices by type (eg. AWS VMs, Azure VM, on-prem devices, mobile devices, etc.) + and by their need for similar workload configurations. + When you create your first device collection, Smallstep will create a few foundational components + (CAs, provisioners, and webhooks) for you. Args: collection_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (DeviceCollection): Configuration to create a new device collection. + body (DeviceCollection): Configuration to create a new device collection. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -183,7 +191,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( collection_slug=collection_slug, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -197,22 +205,24 @@ async def asyncio( collection_slug: str, *, client: Union[AuthenticatedClient, Client], - json_body: DeviceCollection, + body: DeviceCollection, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, DeviceCollection]]: """Create Device Collection - Create a new device collection or update an existing device collection. - A device collection is a set of devices running the smallstep agent with the same configuration. - All resources required to run the smallstep agent on the devices will be created if they do not - already exist, including authorities, provisioners and webhooks. + Create or update a device collection. + A device collection is a set of devices that you will use with Smallstep. + You should group your devices by type (eg. AWS VMs, Azure VM, on-prem devices, mobile devices, etc.) + and by their need for similar workload configurations. + When you create your first device collection, Smallstep will create a few foundational components + (CAs, provisioners, and webhooks) for you. Args: collection_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (DeviceCollection): Configuration to create a new device collection. + body (DeviceCollection): Configuration to create a new device collection. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -226,7 +236,7 @@ async def asyncio( await asyncio_detailed( collection_slug=collection_slug, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/managed_workloads/put_device_collection_account.py b/smallstep/api_client/api/managed_workloads/put_device_collection_account.py new file mode 100644 index 0000000..c799a7a --- /dev/null +++ b/smallstep/api_client/api/managed_workloads/put_device_collection_account.py @@ -0,0 +1,247 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.device_collection_account import DeviceCollectionAccount +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + collection_slug: str, + account_slug: str, + *, + body: DeviceCollectionAccount, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + if not isinstance(x_request_id, Unset): + headers["X-Request-Id"] = x_request_id + + if not isinstance(accept, Unset): + headers["Accept"] = accept + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/device-collections/{collection_slug}/accounts/{account_slug}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, DeviceCollectionAccount]]: + if response.status_code == HTTPStatus.OK: + response_200 = DeviceCollectionAccount.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: + response_422 = cast(Any, None) + return response_422 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = cast(Any, None) + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, DeviceCollectionAccount]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + collection_slug: str, + account_slug: str, + *, + client: Union[AuthenticatedClient, Client], + body: DeviceCollectionAccount, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Response[Union[Any, DeviceCollectionAccount]]: + """Create or Update Device Collection Account + + Create or update an account in a device collection. + A device collection account is always associated with a pre-existing account and device collection. + + Args: + collection_slug (str): + account_slug (str): + x_request_id (Union[Unset, str]): + accept (Union[Unset, str]): + body (DeviceCollectionAccount): The certificate details binding an account to a device + collection. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, DeviceCollectionAccount]] + """ + + kwargs = _get_kwargs( + collection_slug=collection_slug, + account_slug=account_slug, + body=body, + x_request_id=x_request_id, + accept=accept, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + collection_slug: str, + account_slug: str, + *, + client: Union[AuthenticatedClient, Client], + body: DeviceCollectionAccount, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Optional[Union[Any, DeviceCollectionAccount]]: + """Create or Update Device Collection Account + + Create or update an account in a device collection. + A device collection account is always associated with a pre-existing account and device collection. + + Args: + collection_slug (str): + account_slug (str): + x_request_id (Union[Unset, str]): + accept (Union[Unset, str]): + body (DeviceCollectionAccount): The certificate details binding an account to a device + collection. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, DeviceCollectionAccount] + """ + + return sync_detailed( + collection_slug=collection_slug, + account_slug=account_slug, + client=client, + body=body, + x_request_id=x_request_id, + accept=accept, + ).parsed + + +async def asyncio_detailed( + collection_slug: str, + account_slug: str, + *, + client: Union[AuthenticatedClient, Client], + body: DeviceCollectionAccount, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Response[Union[Any, DeviceCollectionAccount]]: + """Create or Update Device Collection Account + + Create or update an account in a device collection. + A device collection account is always associated with a pre-existing account and device collection. + + Args: + collection_slug (str): + account_slug (str): + x_request_id (Union[Unset, str]): + accept (Union[Unset, str]): + body (DeviceCollectionAccount): The certificate details binding an account to a device + collection. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, DeviceCollectionAccount]] + """ + + kwargs = _get_kwargs( + collection_slug=collection_slug, + account_slug=account_slug, + body=body, + x_request_id=x_request_id, + accept=accept, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + collection_slug: str, + account_slug: str, + *, + client: Union[AuthenticatedClient, Client], + body: DeviceCollectionAccount, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Optional[Union[Any, DeviceCollectionAccount]]: + """Create or Update Device Collection Account + + Create or update an account in a device collection. + A device collection account is always associated with a pre-existing account and device collection. + + Args: + collection_slug (str): + account_slug (str): + x_request_id (Union[Unset, str]): + accept (Union[Unset, str]): + body (DeviceCollectionAccount): The certificate details binding an account to a device + collection. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, DeviceCollectionAccount] + """ + + return ( + await asyncio_detailed( + collection_slug=collection_slug, + account_slug=account_slug, + client=client, + body=body, + x_request_id=x_request_id, + accept=accept, + ) + ).parsed diff --git a/smallstep/api_client/api/managed_workloads/put_endpoint_configuration.py b/smallstep/api_client/api/managed_workloads/put_endpoint_configuration.py deleted file mode 100644 index c892d1c..0000000 --- a/smallstep/api_client/api/managed_workloads/put_endpoint_configuration.py +++ /dev/null @@ -1,268 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union, cast - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.endpoint_configuration import EndpointConfiguration -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - endpoint_configuration_id: str, - *, - json_body: EndpointConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Dict[str, Any]: - headers = {} - if not isinstance(x_request_id, Unset): - headers["X-Request-Id"] = x_request_id - - if not isinstance(accept, Unset): - headers["Accept"] = accept - - json_json_body = json_body.to_dict() - - return { - "method": "put", - "url": "/endpoint-configurations/{endpointConfigurationID}".format( - endpointConfigurationID=endpoint_configuration_id, - ), - "json": json_json_body, - "headers": headers, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, EndpointConfiguration]]: - if response.status_code == HTTPStatus.OK: - response_200 = EndpointConfiguration.from_dict(response.json()) - - return response_200 - if response.status_code == HTTPStatus.BAD_REQUEST: - response_400 = cast(Any, None) - return response_400 - if response.status_code == HTTPStatus.UNAUTHORIZED: - response_401 = cast(Any, None) - return response_401 - if response.status_code == HTTPStatus.NOT_FOUND: - response_404 = cast(Any, None) - return response_404 - if response.status_code == HTTPStatus.PRECONDITION_FAILED: - response_412 = cast(Any, None) - return response_412 - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - response_500 = cast(Any, None) - return response_500 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, EndpointConfiguration]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - endpoint_configuration_id: str, - *, - client: Union[AuthenticatedClient, Client], - json_body: EndpointConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, EndpointConfiguration]]: - """Update Endpoint Configuration - - Update an endpoint configuration. - - Args: - endpoint_configuration_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (EndpointConfiguration): Configuration for a managed endpoint. This object is - experimental and subject to change. Example: {'authorityID': - '8e3ff498-2059-4859-9053-c334ceab5f83', 'certificateInfo': {'crtFile': '/etc/db.crt', - 'duration': '24h0m0s', 'gid': 999, 'keyFile': '/etc/db.key', 'mode': 256, 'rootFile': - '/etc/ca.crt', 'type': 'X509', 'uid': 1001}, 'hooks': {'renew': {'after': ['echo - renewed'], 'before': ['echo renewing'], 'onError': ['echo failed to renew'], 'shell': - '/bin/bash'}, 'sign': {'after': ['echo signed'], 'before': ['echo signing'], 'onError': - ['echo failed to sign'], 'shell': '/bin/bash'}}, 'id': - 'd9dd9ca8-8624-4eca-84e9-ee3dd74c1786', 'keyInfo': {'format': 'DER', 'pubFile': - '/etc/db.csr', 'type': 'ECDSA_P256'}, 'kind': 'WORKLOAD', 'name': 'My Database Server', - 'provisioner': 'Endpoints Provisioner', 'reloadInfo': {'method': 'SIGNAL', 'pidFile': - '/var/run/db.pid', 'signal': 1}}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[Any, EndpointConfiguration]] - """ - - kwargs = _get_kwargs( - endpoint_configuration_id=endpoint_configuration_id, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - endpoint_configuration_id: str, - *, - client: Union[AuthenticatedClient, Client], - json_body: EndpointConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, EndpointConfiguration]]: - """Update Endpoint Configuration - - Update an endpoint configuration. - - Args: - endpoint_configuration_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (EndpointConfiguration): Configuration for a managed endpoint. This object is - experimental and subject to change. Example: {'authorityID': - '8e3ff498-2059-4859-9053-c334ceab5f83', 'certificateInfo': {'crtFile': '/etc/db.crt', - 'duration': '24h0m0s', 'gid': 999, 'keyFile': '/etc/db.key', 'mode': 256, 'rootFile': - '/etc/ca.crt', 'type': 'X509', 'uid': 1001}, 'hooks': {'renew': {'after': ['echo - renewed'], 'before': ['echo renewing'], 'onError': ['echo failed to renew'], 'shell': - '/bin/bash'}, 'sign': {'after': ['echo signed'], 'before': ['echo signing'], 'onError': - ['echo failed to sign'], 'shell': '/bin/bash'}}, 'id': - 'd9dd9ca8-8624-4eca-84e9-ee3dd74c1786', 'keyInfo': {'format': 'DER', 'pubFile': - '/etc/db.csr', 'type': 'ECDSA_P256'}, 'kind': 'WORKLOAD', 'name': 'My Database Server', - 'provisioner': 'Endpoints Provisioner', 'reloadInfo': {'method': 'SIGNAL', 'pidFile': - '/var/run/db.pid', 'signal': 1}}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[Any, EndpointConfiguration] - """ - - return sync_detailed( - endpoint_configuration_id=endpoint_configuration_id, - client=client, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ).parsed - - -async def asyncio_detailed( - endpoint_configuration_id: str, - *, - client: Union[AuthenticatedClient, Client], - json_body: EndpointConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, EndpointConfiguration]]: - """Update Endpoint Configuration - - Update an endpoint configuration. - - Args: - endpoint_configuration_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (EndpointConfiguration): Configuration for a managed endpoint. This object is - experimental and subject to change. Example: {'authorityID': - '8e3ff498-2059-4859-9053-c334ceab5f83', 'certificateInfo': {'crtFile': '/etc/db.crt', - 'duration': '24h0m0s', 'gid': 999, 'keyFile': '/etc/db.key', 'mode': 256, 'rootFile': - '/etc/ca.crt', 'type': 'X509', 'uid': 1001}, 'hooks': {'renew': {'after': ['echo - renewed'], 'before': ['echo renewing'], 'onError': ['echo failed to renew'], 'shell': - '/bin/bash'}, 'sign': {'after': ['echo signed'], 'before': ['echo signing'], 'onError': - ['echo failed to sign'], 'shell': '/bin/bash'}}, 'id': - 'd9dd9ca8-8624-4eca-84e9-ee3dd74c1786', 'keyInfo': {'format': 'DER', 'pubFile': - '/etc/db.csr', 'type': 'ECDSA_P256'}, 'kind': 'WORKLOAD', 'name': 'My Database Server', - 'provisioner': 'Endpoints Provisioner', 'reloadInfo': {'method': 'SIGNAL', 'pidFile': - '/var/run/db.pid', 'signal': 1}}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[Any, EndpointConfiguration]] - """ - - kwargs = _get_kwargs( - endpoint_configuration_id=endpoint_configuration_id, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - endpoint_configuration_id: str, - *, - client: Union[AuthenticatedClient, Client], - json_body: EndpointConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, EndpointConfiguration]]: - """Update Endpoint Configuration - - Update an endpoint configuration. - - Args: - endpoint_configuration_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (EndpointConfiguration): Configuration for a managed endpoint. This object is - experimental and subject to change. Example: {'authorityID': - '8e3ff498-2059-4859-9053-c334ceab5f83', 'certificateInfo': {'crtFile': '/etc/db.crt', - 'duration': '24h0m0s', 'gid': 999, 'keyFile': '/etc/db.key', 'mode': 256, 'rootFile': - '/etc/ca.crt', 'type': 'X509', 'uid': 1001}, 'hooks': {'renew': {'after': ['echo - renewed'], 'before': ['echo renewing'], 'onError': ['echo failed to renew'], 'shell': - '/bin/bash'}, 'sign': {'after': ['echo signed'], 'before': ['echo signing'], 'onError': - ['echo failed to sign'], 'shell': '/bin/bash'}}, 'id': - 'd9dd9ca8-8624-4eca-84e9-ee3dd74c1786', 'keyInfo': {'format': 'DER', 'pubFile': - '/etc/db.csr', 'type': 'ECDSA_P256'}, 'kind': 'WORKLOAD', 'name': 'My Database Server', - 'provisioner': 'Endpoints Provisioner', 'reloadInfo': {'method': 'SIGNAL', 'pidFile': - '/var/run/db.pid', 'signal': 1}}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[Any, EndpointConfiguration] - """ - - return ( - await asyncio_detailed( - endpoint_configuration_id=endpoint_configuration_id, - client=client, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - ).parsed diff --git a/smallstep/api_client/api/managed_workloads/put_managed_configuration.py b/smallstep/api_client/api/managed_workloads/put_managed_configuration.py deleted file mode 100644 index 980cd44..0000000 --- a/smallstep/api_client/api/managed_workloads/put_managed_configuration.py +++ /dev/null @@ -1,260 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union, cast - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.managed_configuration import ManagedConfiguration -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - managed_configuration_host_id: str, - *, - json_body: ManagedConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Dict[str, Any]: - headers = {} - if not isinstance(x_request_id, Unset): - headers["X-Request-Id"] = x_request_id - - if not isinstance(accept, Unset): - headers["Accept"] = accept - - json_json_body = json_body.to_dict() - - return { - "method": "put", - "url": "/managed-configurations/host/{managedConfigurationHostID}".format( - managedConfigurationHostID=managed_configuration_host_id, - ), - "json": json_json_body, - "headers": headers, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ManagedConfiguration]]: - if response.status_code == HTTPStatus.OK: - response_200 = ManagedConfiguration.from_dict(response.json()) - - return response_200 - if response.status_code == HTTPStatus.BAD_REQUEST: - response_400 = cast(Any, None) - return response_400 - if response.status_code == HTTPStatus.UNAUTHORIZED: - response_401 = cast(Any, None) - return response_401 - if response.status_code == HTTPStatus.NOT_FOUND: - response_404 = cast(Any, None) - return response_404 - if response.status_code == HTTPStatus.PRECONDITION_FAILED: - response_412 = cast(Any, None) - return response_412 - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - response_500 = cast(Any, None) - return response_500 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ManagedConfiguration]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - managed_configuration_host_id: str, - *, - client: Union[AuthenticatedClient, Client], - json_body: ManagedConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, ManagedConfiguration]]: - """Update Managed Configuration - - Update a managed configuration. - - Args: - managed_configuration_host_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (ManagedConfiguration): The agent and managed endpoints used in one host. This - object is experimental and subject to change. Example: {'agentConfigurationID': - '12d6f7a3-2096-4ed6-b4e7-53e7f925facd', 'hostID': '8d996786-29c8-4fcd-999a-4a625be60616', - 'id': 'aad6ad55-866b-4988-a51e-58a7225db66c', 'managedEndpoints': - [{'endpointConfigurationID': '3b872b88-bb2f-4575-b3fe-69cf92ae57f6', 'id': - '5bad10b3-32fe-44da-b516-aef568790e66', 'x509CertificateData': {'commonName': 'db', - 'sans': ['db', 'db.internal']}}, {'endpointConfigurationID': '1f42f5fe- - eda0-4300-bb7f-462afe483ae1', 'id': '99e45a28-36b9-4dd0-ac57-2d43aac9f36e', - 'sshCertificateData': {'keyID': 'abc123', 'principals': ['ops', 'eng']}}], 'name': 'My - Server'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[Any, ManagedConfiguration]] - """ - - kwargs = _get_kwargs( - managed_configuration_host_id=managed_configuration_host_id, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - managed_configuration_host_id: str, - *, - client: Union[AuthenticatedClient, Client], - json_body: ManagedConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, ManagedConfiguration]]: - """Update Managed Configuration - - Update a managed configuration. - - Args: - managed_configuration_host_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (ManagedConfiguration): The agent and managed endpoints used in one host. This - object is experimental and subject to change. Example: {'agentConfigurationID': - '12d6f7a3-2096-4ed6-b4e7-53e7f925facd', 'hostID': '8d996786-29c8-4fcd-999a-4a625be60616', - 'id': 'aad6ad55-866b-4988-a51e-58a7225db66c', 'managedEndpoints': - [{'endpointConfigurationID': '3b872b88-bb2f-4575-b3fe-69cf92ae57f6', 'id': - '5bad10b3-32fe-44da-b516-aef568790e66', 'x509CertificateData': {'commonName': 'db', - 'sans': ['db', 'db.internal']}}, {'endpointConfigurationID': '1f42f5fe- - eda0-4300-bb7f-462afe483ae1', 'id': '99e45a28-36b9-4dd0-ac57-2d43aac9f36e', - 'sshCertificateData': {'keyID': 'abc123', 'principals': ['ops', 'eng']}}], 'name': 'My - Server'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[Any, ManagedConfiguration] - """ - - return sync_detailed( - managed_configuration_host_id=managed_configuration_host_id, - client=client, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ).parsed - - -async def asyncio_detailed( - managed_configuration_host_id: str, - *, - client: Union[AuthenticatedClient, Client], - json_body: ManagedConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Response[Union[Any, ManagedConfiguration]]: - """Update Managed Configuration - - Update a managed configuration. - - Args: - managed_configuration_host_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (ManagedConfiguration): The agent and managed endpoints used in one host. This - object is experimental and subject to change. Example: {'agentConfigurationID': - '12d6f7a3-2096-4ed6-b4e7-53e7f925facd', 'hostID': '8d996786-29c8-4fcd-999a-4a625be60616', - 'id': 'aad6ad55-866b-4988-a51e-58a7225db66c', 'managedEndpoints': - [{'endpointConfigurationID': '3b872b88-bb2f-4575-b3fe-69cf92ae57f6', 'id': - '5bad10b3-32fe-44da-b516-aef568790e66', 'x509CertificateData': {'commonName': 'db', - 'sans': ['db', 'db.internal']}}, {'endpointConfigurationID': '1f42f5fe- - eda0-4300-bb7f-462afe483ae1', 'id': '99e45a28-36b9-4dd0-ac57-2d43aac9f36e', - 'sshCertificateData': {'keyID': 'abc123', 'principals': ['ops', 'eng']}}], 'name': 'My - Server'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[Any, ManagedConfiguration]] - """ - - kwargs = _get_kwargs( - managed_configuration_host_id=managed_configuration_host_id, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - managed_configuration_host_id: str, - *, - client: Union[AuthenticatedClient, Client], - json_body: ManagedConfiguration, - x_request_id: Union[Unset, str] = UNSET, - accept: Union[Unset, str] = UNSET, -) -> Optional[Union[Any, ManagedConfiguration]]: - """Update Managed Configuration - - Update a managed configuration. - - Args: - managed_configuration_host_id (str): - x_request_id (Union[Unset, str]): - accept (Union[Unset, str]): - json_body (ManagedConfiguration): The agent and managed endpoints used in one host. This - object is experimental and subject to change. Example: {'agentConfigurationID': - '12d6f7a3-2096-4ed6-b4e7-53e7f925facd', 'hostID': '8d996786-29c8-4fcd-999a-4a625be60616', - 'id': 'aad6ad55-866b-4988-a51e-58a7225db66c', 'managedEndpoints': - [{'endpointConfigurationID': '3b872b88-bb2f-4575-b3fe-69cf92ae57f6', 'id': - '5bad10b3-32fe-44da-b516-aef568790e66', 'x509CertificateData': {'commonName': 'db', - 'sans': ['db', 'db.internal']}}, {'endpointConfigurationID': '1f42f5fe- - eda0-4300-bb7f-462afe483ae1', 'id': '99e45a28-36b9-4dd0-ac57-2d43aac9f36e', - 'sshCertificateData': {'keyID': 'abc123', 'principals': ['ops', 'eng']}}], 'name': 'My - Server'}. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[Any, ManagedConfiguration] - """ - - return ( - await asyncio_detailed( - managed_configuration_host_id=managed_configuration_host_id, - client=client, - json_body=json_body, - x_request_id=x_request_id, - accept=accept, - ) - ).parsed diff --git a/smallstep/api_client/api/managed_workloads/put_platform.py b/smallstep/api_client/api/managed_workloads/put_platform.py new file mode 100644 index 0000000..89c762d --- /dev/null +++ b/smallstep/api_client/api/managed_workloads/put_platform.py @@ -0,0 +1,221 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.new_platform import NewPlatform +from ...models.platform import Platform +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + platform_slug: str, + *, + body: NewPlatform, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + if not isinstance(x_request_id, Unset): + headers["X-Request-Id"] = x_request_id + + if not isinstance(accept, Unset): + headers["Accept"] = accept + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/platforms/{platform_slug}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, Platform]]: + if response.status_code == HTTPStatus.OK: + response_200 = Platform.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = cast(Any, None) + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, Platform]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + platform_slug: str, + *, + client: Union[AuthenticatedClient, Client], + body: NewPlatform, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Response[Union[Any, Platform]]: + """Create Platform + + Create a new platform or update an existing platform. + + Args: + platform_slug (str): + x_request_id (Union[Unset, str]): + accept (Union[Unset, str]): + body (NewPlatform): Configuration to create a new platform. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, Platform]] + """ + + kwargs = _get_kwargs( + platform_slug=platform_slug, + body=body, + x_request_id=x_request_id, + accept=accept, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + platform_slug: str, + *, + client: Union[AuthenticatedClient, Client], + body: NewPlatform, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Optional[Union[Any, Platform]]: + """Create Platform + + Create a new platform or update an existing platform. + + Args: + platform_slug (str): + x_request_id (Union[Unset, str]): + accept (Union[Unset, str]): + body (NewPlatform): Configuration to create a new platform. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, Platform] + """ + + return sync_detailed( + platform_slug=platform_slug, + client=client, + body=body, + x_request_id=x_request_id, + accept=accept, + ).parsed + + +async def asyncio_detailed( + platform_slug: str, + *, + client: Union[AuthenticatedClient, Client], + body: NewPlatform, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Response[Union[Any, Platform]]: + """Create Platform + + Create a new platform or update an existing platform. + + Args: + platform_slug (str): + x_request_id (Union[Unset, str]): + accept (Union[Unset, str]): + body (NewPlatform): Configuration to create a new platform. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, Platform]] + """ + + kwargs = _get_kwargs( + platform_slug=platform_slug, + body=body, + x_request_id=x_request_id, + accept=accept, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + platform_slug: str, + *, + client: Union[AuthenticatedClient, Client], + body: NewPlatform, + x_request_id: Union[Unset, str] = UNSET, + accept: Union[Unset, str] = UNSET, +) -> Optional[Union[Any, Platform]]: + """Create Platform + + Create a new platform or update an existing platform. + + Args: + platform_slug (str): + x_request_id (Union[Unset, str]): + accept (Union[Unset, str]): + body (NewPlatform): Configuration to create a new platform. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, Platform] + """ + + return ( + await asyncio_detailed( + platform_slug=platform_slug, + client=client, + body=body, + x_request_id=x_request_id, + accept=accept, + ) + ).parsed diff --git a/smallstep/api_client/api/managed_workloads/put_workload.py b/smallstep/api_client/api/managed_workloads/put_workload.py index 911cc9d..f9e4b65 100644 --- a/smallstep/api_client/api/managed_workloads/put_workload.py +++ b/smallstep/api_client/api/managed_workloads/put_workload.py @@ -13,29 +13,30 @@ def _get_kwargs( collection_slug: str, workload_slug: str, *, - json_body: Workload, + body: Workload, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "put", - "url": "/device-collections/{collectionSlug}/workloads/{workloadSlug}".format( - collectionSlug=collection_slug, - workloadSlug=workload_slug, - ), - "json": json_json_body, - "headers": headers, + "url": f"/device-collections/{collection_slug}/workloads/{workload_slug}", } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -81,20 +82,24 @@ def sync_detailed( workload_slug: str, *, client: Union[AuthenticatedClient, Client], - json_body: Workload, + body: Workload, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, Workload]]: - """Create Workload + """Create or Update Workload - Add a workload to a device collection or update the workload if it already exists. + Create or update a workload in a device collection. + When you create a workload, you'll provide a workload type and Smallstep will configure sane + defaults for that type of workload. + When you create your first workload, Smallstep will create a few foundational components (CAs, + provisioners, and webhooks) for you. Args: collection_slug (str): workload_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (Workload): A workload represents anything that uses a certificate. + body (Workload): A workload represents anything that uses a certificate. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -107,7 +112,7 @@ def sync_detailed( kwargs = _get_kwargs( collection_slug=collection_slug, workload_slug=workload_slug, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -115,6 +120,7 @@ def sync_detailed( response = client.get_httpx_client().request( **kwargs, ) + return _build_response(client=client, response=response) @@ -123,20 +129,24 @@ def sync( workload_slug: str, *, client: Union[AuthenticatedClient, Client], - json_body: Workload, + body: Workload, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, Workload]]: - """Create Workload + """Create or Update Workload - Add a workload to a device collection or update the workload if it already exists. + Create or update a workload in a device collection. + When you create a workload, you'll provide a workload type and Smallstep will configure sane + defaults for that type of workload. + When you create your first workload, Smallstep will create a few foundational components (CAs, + provisioners, and webhooks) for you. Args: collection_slug (str): workload_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (Workload): A workload represents anything that uses a certificate. + body (Workload): A workload represents anything that uses a certificate. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,7 +160,7 @@ def sync( collection_slug=collection_slug, workload_slug=workload_slug, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ).parsed @@ -161,20 +171,24 @@ async def asyncio_detailed( workload_slug: str, *, client: Union[AuthenticatedClient, Client], - json_body: Workload, + body: Workload, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, Workload]]: - """Create Workload + """Create or Update Workload - Add a workload to a device collection or update the workload if it already exists. + Create or update a workload in a device collection. + When you create a workload, you'll provide a workload type and Smallstep will configure sane + defaults for that type of workload. + When you create your first workload, Smallstep will create a few foundational components (CAs, + provisioners, and webhooks) for you. Args: collection_slug (str): workload_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (Workload): A workload represents anything that uses a certificate. + body (Workload): A workload represents anything that uses a certificate. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,7 +201,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( collection_slug=collection_slug, workload_slug=workload_slug, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -202,20 +216,24 @@ async def asyncio( workload_slug: str, *, client: Union[AuthenticatedClient, Client], - json_body: Workload, + body: Workload, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, Workload]]: - """Create Workload + """Create or Update Workload - Add a workload to a device collection or update the workload if it already exists. + Create or update a workload in a device collection. + When you create a workload, you'll provide a workload type and Smallstep will configure sane + defaults for that type of workload. + When you create your first workload, Smallstep will create a few foundational components (CAs, + provisioners, and webhooks) for you. Args: collection_slug (str): workload_slug (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (Workload): A workload represents anything that uses a certificate. + body (Workload): A workload represents anything that uses a certificate. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -230,7 +248,7 @@ async def asyncio( collection_slug=collection_slug, workload_slug=workload_slug, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/provisioners/delete_provisioner.py b/smallstep/api_client/api/provisioners/delete_provisioner.py index c4d191e..8b4c9fd 100644 --- a/smallstep/api_client/api/provisioners/delete_provisioner.py +++ b/smallstep/api_client/api/provisioners/delete_provisioner.py @@ -15,22 +15,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "delete", - "url": "/authorities/{authorityID}/provisioners/{provisionerNameOrID}".format( - authorityID=authority_id, - provisionerNameOrID=provisioner_name_or_id, - ), - "headers": headers, + "url": f"/authorities/{authority_id}/provisioners/{provisioner_name_or_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == HTTPStatus.NO_CONTENT: @@ -39,6 +38,8 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None if response.status_code == HTTPStatus.UNAUTHORIZED: return None + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: + return None if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: return None if client.raise_on_unexpected_status: diff --git a/smallstep/api_client/api/provisioners/delete_webhook.py b/smallstep/api_client/api/provisioners/delete_webhook.py index 2d10551..32711df 100644 --- a/smallstep/api_client/api/provisioners/delete_webhook.py +++ b/smallstep/api_client/api/provisioners/delete_webhook.py @@ -16,23 +16,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "delete", - "url": "/authorities/{authorityID}/provisioners/{provisionerNameOrID}/webhooks/{webhookNameOrID}".format( - authorityID=authority_id, - provisionerNameOrID=provisioner_name_or_id, - webhookNameOrID=webhook_name_or_id, - ), - "headers": headers, + "url": f"/authorities/{authority_id}/provisioners/{provisioner_name_or_id}/webhooks/{webhook_name_or_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == HTTPStatus.NO_CONTENT: @@ -41,6 +39,8 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None if response.status_code == HTTPStatus.UNAUTHORIZED: return None + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: + return None if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: return None if client.raise_on_unexpected_status: diff --git a/smallstep/api_client/api/provisioners/get_provisioner.py b/smallstep/api_client/api/provisioners/get_provisioner.py index 760a6ec..846b736 100644 --- a/smallstep/api_client/api/provisioners/get_provisioner.py +++ b/smallstep/api_client/api/provisioners/get_provisioner.py @@ -16,22 +16,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/authorities/{authorityID}/provisioners/{provisionerNameOrID}".format( - authorityID=authority_id, - provisionerNameOrID=provisioner_name_or_id, - ), - "headers": headers, + "url": f"/authorities/{authority_id}/provisioners/{provisioner_name_or_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/provisioners/get_webhook.py b/smallstep/api_client/api/provisioners/get_webhook.py index 7034675..c375e99 100644 --- a/smallstep/api_client/api/provisioners/get_webhook.py +++ b/smallstep/api_client/api/provisioners/get_webhook.py @@ -17,23 +17,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/authorities/{authorityID}/provisioners/{provisionerNameOrID}/webhooks/{webhookNameOrID}".format( - authorityID=authority_id, - provisionerNameOrID=provisioner_name_or_id, - webhookNameOrID=webhook_name_or_id, - ), - "headers": headers, + "url": f"/authorities/{authority_id}/provisioners/{provisioner_name_or_id}/webhooks/{webhook_name_or_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/provisioners/list_authority_provisioners.py b/smallstep/api_client/api/provisioners/list_authority_provisioners.py index a90e278..1aeac40 100644 --- a/smallstep/api_client/api/provisioners/list_authority_provisioners.py +++ b/smallstep/api_client/api/provisioners/list_authority_provisioners.py @@ -15,21 +15,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/authorities/{authorityID}/provisioners".format( - authorityID=authority_id, - ), - "headers": headers, + "url": f"/authorities/{authority_id}/provisioners", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/provisioners/post_authority_provisioners.py b/smallstep/api_client/api/provisioners/post_authority_provisioners.py index bb70fe1..9eb288c 100644 --- a/smallstep/api_client/api/provisioners/post_authority_provisioners.py +++ b/smallstep/api_client/api/provisioners/post_authority_provisioners.py @@ -12,28 +12,30 @@ def _get_kwargs( authority_id: str, *, - json_body: Provisioner, + body: Provisioner, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", - "url": "/authorities/{authorityID}/provisioners".format( - authorityID=authority_id, - ), - "json": json_json_body, - "headers": headers, + "url": f"/authorities/{authority_id}/provisioners", } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -54,6 +56,9 @@ def _parse_response( if response.status_code == HTTPStatus.CONFLICT: response_409 = cast(Any, None) return response_409 + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: + response_422 = cast(Any, None) + return response_422 if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: response_500 = cast(Any, None) return response_500 @@ -78,7 +83,7 @@ def sync_detailed( authority_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: Provisioner, + body: Provisioner, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, Provisioner]]: @@ -90,8 +95,8 @@ def sync_detailed( authority_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (Provisioner): [Provisioners](https://smallstep.com/docs/step-ca/provisioners/) - are methods of using the CA to get certificates with different modes of authorization. + body (Provisioner): [Provisioners](https://smallstep.com/docs/step-ca/provisioners/) are + methods of using the CA to get certificates with different modes of authorization. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -103,7 +108,7 @@ def sync_detailed( kwargs = _get_kwargs( authority_id=authority_id, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -119,7 +124,7 @@ def sync( authority_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: Provisioner, + body: Provisioner, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, Provisioner]]: @@ -131,8 +136,8 @@ def sync( authority_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (Provisioner): [Provisioners](https://smallstep.com/docs/step-ca/provisioners/) - are methods of using the CA to get certificates with different modes of authorization. + body (Provisioner): [Provisioners](https://smallstep.com/docs/step-ca/provisioners/) are + methods of using the CA to get certificates with different modes of authorization. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -145,7 +150,7 @@ def sync( return sync_detailed( authority_id=authority_id, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ).parsed @@ -155,7 +160,7 @@ async def asyncio_detailed( authority_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: Provisioner, + body: Provisioner, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, Provisioner]]: @@ -167,8 +172,8 @@ async def asyncio_detailed( authority_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (Provisioner): [Provisioners](https://smallstep.com/docs/step-ca/provisioners/) - are methods of using the CA to get certificates with different modes of authorization. + body (Provisioner): [Provisioners](https://smallstep.com/docs/step-ca/provisioners/) are + methods of using the CA to get certificates with different modes of authorization. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -180,7 +185,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( authority_id=authority_id, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -194,7 +199,7 @@ async def asyncio( authority_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: Provisioner, + body: Provisioner, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, Provisioner]]: @@ -206,8 +211,8 @@ async def asyncio( authority_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (Provisioner): [Provisioners](https://smallstep.com/docs/step-ca/provisioners/) - are methods of using the CA to get certificates with different modes of authorization. + body (Provisioner): [Provisioners](https://smallstep.com/docs/step-ca/provisioners/) are + methods of using the CA to get certificates with different modes of authorization. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -221,7 +226,7 @@ async def asyncio( await asyncio_detailed( authority_id=authority_id, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/provisioners/post_webhooks.py b/smallstep/api_client/api/provisioners/post_webhooks.py index e277070..e962ddb 100644 --- a/smallstep/api_client/api/provisioners/post_webhooks.py +++ b/smallstep/api_client/api/provisioners/post_webhooks.py @@ -13,29 +13,30 @@ def _get_kwargs( authority_id: str, provisioner_name_or_id: str, *, - json_body: ProvisionerWebhook, + body: ProvisionerWebhook, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", - "url": "/authorities/{authorityID}/provisioners/{provisionerNameOrID}/webhooks".format( - authorityID=authority_id, - provisionerNameOrID=provisioner_name_or_id, - ), - "json": json_json_body, - "headers": headers, + "url": f"/authorities/{authority_id}/provisioners/{provisioner_name_or_id}/webhooks", } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -59,6 +60,9 @@ def _parse_response( if response.status_code == HTTPStatus.PRECONDITION_FAILED: response_412 = cast(Any, None) return response_412 + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: + response_422 = cast(Any, None) + return response_422 if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: response_500 = cast(Any, None) return response_500 @@ -84,7 +88,7 @@ def sync_detailed( provisioner_name_or_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: ProvisionerWebhook, + body: ProvisionerWebhook, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, ProvisionerWebhook]]: @@ -97,8 +101,8 @@ def sync_detailed( provisioner_name_or_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (ProvisionerWebhook): A [webhook](https://smallstep.com/docs/step-ca/webhooks/) - to call when a certificate request is being processed. + body (ProvisionerWebhook): A [webhook](https://smallstep.com/docs/step-ca/webhooks/) to + call when a certificate request is being processed. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -111,7 +115,7 @@ def sync_detailed( kwargs = _get_kwargs( authority_id=authority_id, provisioner_name_or_id=provisioner_name_or_id, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -128,7 +132,7 @@ def sync( provisioner_name_or_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: ProvisionerWebhook, + body: ProvisionerWebhook, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, ProvisionerWebhook]]: @@ -141,8 +145,8 @@ def sync( provisioner_name_or_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (ProvisionerWebhook): A [webhook](https://smallstep.com/docs/step-ca/webhooks/) - to call when a certificate request is being processed. + body (ProvisionerWebhook): A [webhook](https://smallstep.com/docs/step-ca/webhooks/) to + call when a certificate request is being processed. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -156,7 +160,7 @@ def sync( authority_id=authority_id, provisioner_name_or_id=provisioner_name_or_id, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ).parsed @@ -167,7 +171,7 @@ async def asyncio_detailed( provisioner_name_or_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: ProvisionerWebhook, + body: ProvisionerWebhook, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, ProvisionerWebhook]]: @@ -180,8 +184,8 @@ async def asyncio_detailed( provisioner_name_or_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (ProvisionerWebhook): A [webhook](https://smallstep.com/docs/step-ca/webhooks/) - to call when a certificate request is being processed. + body (ProvisionerWebhook): A [webhook](https://smallstep.com/docs/step-ca/webhooks/) to + call when a certificate request is being processed. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -194,7 +198,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( authority_id=authority_id, provisioner_name_or_id=provisioner_name_or_id, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -209,7 +213,7 @@ async def asyncio( provisioner_name_or_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: ProvisionerWebhook, + body: ProvisionerWebhook, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, ProvisionerWebhook]]: @@ -222,8 +226,8 @@ async def asyncio( provisioner_name_or_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (ProvisionerWebhook): A [webhook](https://smallstep.com/docs/step-ca/webhooks/) - to call when a certificate request is being processed. + body (ProvisionerWebhook): A [webhook](https://smallstep.com/docs/step-ca/webhooks/) to + call when a certificate request is being processed. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -238,7 +242,7 @@ async def asyncio( authority_id=authority_id, provisioner_name_or_id=provisioner_name_or_id, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/ssh/delete_ssh_grant.py b/smallstep/api_client/api/ssh/delete_ssh_grant.py index b23554c..e34f0ea 100644 --- a/smallstep/api_client/api/ssh/delete_ssh_grant.py +++ b/smallstep/api_client/api/ssh/delete_ssh_grant.py @@ -14,21 +14,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "delete", - "url": "/grants/{grantID}".format( - grantID=grant_id, - ), - "headers": headers, + "url": f"/grants/{grant_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == HTTPStatus.NO_CONTENT: diff --git a/smallstep/api_client/api/ssh/get_ssh_grant.py b/smallstep/api_client/api/ssh/get_ssh_grant.py index 6b63bdf..4682ec6 100644 --- a/smallstep/api_client/api/ssh/get_ssh_grant.py +++ b/smallstep/api_client/api/ssh/get_ssh_grant.py @@ -15,21 +15,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/grants/{grantID}".format( - grantID=grant_id, - ), - "headers": headers, + "url": f"/grants/{grant_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/ssh/get_ssh_grants.py b/smallstep/api_client/api/ssh/get_ssh_grants.py index 9115016..c48c579 100644 --- a/smallstep/api_client/api/ssh/get_ssh_grants.py +++ b/smallstep/api_client/api/ssh/get_ssh_grants.py @@ -14,19 +14,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", "url": "/grants", - "headers": headers, } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/ssh/get_ssh_group.py b/smallstep/api_client/api/ssh/get_ssh_group.py index 8eca942..6fa5177 100644 --- a/smallstep/api_client/api/ssh/get_ssh_group.py +++ b/smallstep/api_client/api/ssh/get_ssh_group.py @@ -15,21 +15,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/groups/{groupID}".format( - groupID=group_id, - ), - "headers": headers, + "url": f"/groups/{group_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/ssh/get_ssh_groups.py b/smallstep/api_client/api/ssh/get_ssh_groups.py index 55896f1..99876a5 100644 --- a/smallstep/api_client/api/ssh/get_ssh_groups.py +++ b/smallstep/api_client/api/ssh/get_ssh_groups.py @@ -5,18 +5,18 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.get_ssh_groups_pagination import GetSshGroupsPagination +from ...models.get_ssh_groups_pagination_type_0 import GetSshGroupsPaginationType0 from ...models.ssh_group import SSHGroup from ...types import UNSET, Response, Unset def _get_kwargs( *, - pagination: Union[Unset, None, "GetSshGroupsPagination"] = UNSET, + pagination: Union["GetSshGroupsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id @@ -24,22 +24,27 @@ def _get_kwargs( headers["Accept"] = accept params: Dict[str, Any] = {} - json_pagination: Union[Unset, None, Dict[str, Any]] = UNSET - if not isinstance(pagination, Unset): - json_pagination = pagination.to_dict() if pagination else None - if not isinstance(json_pagination, Unset) and json_pagination is not None: - params.update(json_pagination) + json_pagination: Union[Dict[str, Any], None, Unset] + if isinstance(pagination, Unset): + json_pagination = UNSET + elif isinstance(pagination, GetSshGroupsPaginationType0): + json_pagination = pagination.to_dict() + else: + json_pagination = pagination + params["pagination"] = json_pagination params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { + _kwargs: Dict[str, Any] = { "method": "get", "url": "/groups", "params": params, - "headers": headers, } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -82,7 +87,7 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshGroupsPagination"] = UNSET, + pagination: Union["GetSshGroupsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, List["SSHGroup"]]]: @@ -93,7 +98,7 @@ def sync_detailed( default directory managed by Smallstep. Args: - pagination (Union[Unset, None, GetSshGroupsPagination]): + pagination (Union['GetSshGroupsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -121,7 +126,7 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshGroupsPagination"] = UNSET, + pagination: Union["GetSshGroupsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, List["SSHGroup"]]]: @@ -132,7 +137,7 @@ def sync( default directory managed by Smallstep. Args: - pagination (Union[Unset, None, GetSshGroupsPagination]): + pagination (Union['GetSshGroupsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -155,7 +160,7 @@ def sync( async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshGroupsPagination"] = UNSET, + pagination: Union["GetSshGroupsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, List["SSHGroup"]]]: @@ -166,7 +171,7 @@ async def asyncio_detailed( default directory managed by Smallstep. Args: - pagination (Union[Unset, None, GetSshGroupsPagination]): + pagination (Union['GetSshGroupsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -192,7 +197,7 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshGroupsPagination"] = UNSET, + pagination: Union["GetSshGroupsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, List["SSHGroup"]]]: @@ -203,7 +208,7 @@ async def asyncio( default directory managed by Smallstep. Args: - pagination (Union[Unset, None, GetSshGroupsPagination]): + pagination (Union['GetSshGroupsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): diff --git a/smallstep/api_client/api/ssh/get_ssh_host.py b/smallstep/api_client/api/ssh/get_ssh_host.py index c2aa8a7..9810da9 100644 --- a/smallstep/api_client/api/ssh/get_ssh_host.py +++ b/smallstep/api_client/api/ssh/get_ssh_host.py @@ -15,21 +15,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/hosts/{hostID}".format( - hostID=host_id, - ), - "headers": headers, + "url": f"/hosts/{host_id}", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/api/ssh/get_ssh_host_tags.py b/smallstep/api_client/api/ssh/get_ssh_host_tags.py index c89fb72..dc402bb 100644 --- a/smallstep/api_client/api/ssh/get_ssh_host_tags.py +++ b/smallstep/api_client/api/ssh/get_ssh_host_tags.py @@ -5,18 +5,18 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.get_ssh_host_tags_pagination import GetSshHostTagsPagination +from ...models.get_ssh_host_tags_pagination_type_0 import GetSshHostTagsPaginationType0 from ...models.ssh_host_tag import SSHHostTag from ...types import UNSET, Response, Unset def _get_kwargs( *, - pagination: Union[Unset, None, "GetSshHostTagsPagination"] = UNSET, + pagination: Union["GetSshHostTagsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id @@ -24,22 +24,27 @@ def _get_kwargs( headers["Accept"] = accept params: Dict[str, Any] = {} - json_pagination: Union[Unset, None, Dict[str, Any]] = UNSET - if not isinstance(pagination, Unset): - json_pagination = pagination.to_dict() if pagination else None - if not isinstance(json_pagination, Unset) and json_pagination is not None: - params.update(json_pagination) + json_pagination: Union[Dict[str, Any], None, Unset] + if isinstance(pagination, Unset): + json_pagination = UNSET + elif isinstance(pagination, GetSshHostTagsPaginationType0): + json_pagination = pagination.to_dict() + else: + json_pagination = pagination + params["pagination"] = json_pagination params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { + _kwargs: Dict[str, Any] = { "method": "get", "url": "/tags", "params": params, - "headers": headers, } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -82,7 +87,7 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshHostTagsPagination"] = UNSET, + pagination: Union["GetSshHostTagsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, List["SSHHostTag"]]]: @@ -91,7 +96,7 @@ def sync_detailed( Paginate over all of your team's SSH host tags. Args: - pagination (Union[Unset, None, GetSshHostTagsPagination]): + pagination (Union['GetSshHostTagsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -119,7 +124,7 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshHostTagsPagination"] = UNSET, + pagination: Union["GetSshHostTagsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, List["SSHHostTag"]]]: @@ -128,7 +133,7 @@ def sync( Paginate over all of your team's SSH host tags. Args: - pagination (Union[Unset, None, GetSshHostTagsPagination]): + pagination (Union['GetSshHostTagsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -151,7 +156,7 @@ def sync( async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshHostTagsPagination"] = UNSET, + pagination: Union["GetSshHostTagsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, List["SSHHostTag"]]]: @@ -160,7 +165,7 @@ async def asyncio_detailed( Paginate over all of your team's SSH host tags. Args: - pagination (Union[Unset, None, GetSshHostTagsPagination]): + pagination (Union['GetSshHostTagsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -186,7 +191,7 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshHostTagsPagination"] = UNSET, + pagination: Union["GetSshHostTagsPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, List["SSHHostTag"]]]: @@ -195,7 +200,7 @@ async def asyncio( Paginate over all of your team's SSH host tags. Args: - pagination (Union[Unset, None, GetSshHostTagsPagination]): + pagination (Union['GetSshHostTagsPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): diff --git a/smallstep/api_client/api/ssh/get_ssh_hosts.py b/smallstep/api_client/api/ssh/get_ssh_hosts.py index 6b24e7b..8091907 100644 --- a/smallstep/api_client/api/ssh/get_ssh_hosts.py +++ b/smallstep/api_client/api/ssh/get_ssh_hosts.py @@ -5,20 +5,20 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.get_ssh_hosts_pagination import GetSshHostsPagination +from ...models.get_ssh_hosts_pagination_type_0 import GetSshHostsPaginationType0 from ...models.ssh_host import SSHHost from ...types import UNSET, Response, Unset def _get_kwargs( *, - pagination: Union[Unset, None, "GetSshHostsPagination"] = UNSET, - active: Union[Unset, None, bool] = UNSET, - bastion: Union[Unset, None, bool] = UNSET, + pagination: Union["GetSshHostsPaginationType0", None, Unset] = UNSET, + active: Union[Unset, bool] = UNSET, + bastion: Union[Unset, bool] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id @@ -26,12 +26,15 @@ def _get_kwargs( headers["Accept"] = accept params: Dict[str, Any] = {} - json_pagination: Union[Unset, None, Dict[str, Any]] = UNSET - if not isinstance(pagination, Unset): - json_pagination = pagination.to_dict() if pagination else None - if not isinstance(json_pagination, Unset) and json_pagination is not None: - params.update(json_pagination) + json_pagination: Union[Dict[str, Any], None, Unset] + if isinstance(pagination, Unset): + json_pagination = UNSET + elif isinstance(pagination, GetSshHostsPaginationType0): + json_pagination = pagination.to_dict() + else: + json_pagination = pagination + params["pagination"] = json_pagination params["active"] = active @@ -39,13 +42,15 @@ def _get_kwargs( params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { + _kwargs: Dict[str, Any] = { "method": "get", "url": "/hosts", "params": params, - "headers": headers, } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -88,9 +93,9 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshHostsPagination"] = UNSET, - active: Union[Unset, None, bool] = UNSET, - bastion: Union[Unset, None, bool] = UNSET, + pagination: Union["GetSshHostsPaginationType0", None, Unset] = UNSET, + active: Union[Unset, bool] = UNSET, + bastion: Union[Unset, bool] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, List["SSHHost"]]]: @@ -99,9 +104,9 @@ def sync_detailed( Get a page of SSH hosts. Args: - pagination (Union[Unset, None, GetSshHostsPagination]): - active (Union[Unset, None, bool]): - bastion (Union[Unset, None, bool]): + pagination (Union['GetSshHostsPaginationType0', None, Unset]): + active (Union[Unset, bool]): + bastion (Union[Unset, bool]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -131,9 +136,9 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshHostsPagination"] = UNSET, - active: Union[Unset, None, bool] = UNSET, - bastion: Union[Unset, None, bool] = UNSET, + pagination: Union["GetSshHostsPaginationType0", None, Unset] = UNSET, + active: Union[Unset, bool] = UNSET, + bastion: Union[Unset, bool] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, List["SSHHost"]]]: @@ -142,9 +147,9 @@ def sync( Get a page of SSH hosts. Args: - pagination (Union[Unset, None, GetSshHostsPagination]): - active (Union[Unset, None, bool]): - bastion (Union[Unset, None, bool]): + pagination (Union['GetSshHostsPaginationType0', None, Unset]): + active (Union[Unset, bool]): + bastion (Union[Unset, bool]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -169,9 +174,9 @@ def sync( async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshHostsPagination"] = UNSET, - active: Union[Unset, None, bool] = UNSET, - bastion: Union[Unset, None, bool] = UNSET, + pagination: Union["GetSshHostsPaginationType0", None, Unset] = UNSET, + active: Union[Unset, bool] = UNSET, + bastion: Union[Unset, bool] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, List["SSHHost"]]]: @@ -180,9 +185,9 @@ async def asyncio_detailed( Get a page of SSH hosts. Args: - pagination (Union[Unset, None, GetSshHostsPagination]): - active (Union[Unset, None, bool]): - bastion (Union[Unset, None, bool]): + pagination (Union['GetSshHostsPaginationType0', None, Unset]): + active (Union[Unset, bool]): + bastion (Union[Unset, bool]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -210,9 +215,9 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshHostsPagination"] = UNSET, - active: Union[Unset, None, bool] = UNSET, - bastion: Union[Unset, None, bool] = UNSET, + pagination: Union["GetSshHostsPaginationType0", None, Unset] = UNSET, + active: Union[Unset, bool] = UNSET, + bastion: Union[Unset, bool] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, List["SSHHost"]]]: @@ -221,9 +226,9 @@ async def asyncio( Get a page of SSH hosts. Args: - pagination (Union[Unset, None, GetSshHostsPagination]): - active (Union[Unset, None, bool]): - bastion (Union[Unset, None, bool]): + pagination (Union['GetSshHostsPaginationType0', None, Unset]): + active (Union[Unset, bool]): + bastion (Union[Unset, bool]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): diff --git a/smallstep/api_client/api/ssh/get_ssh_users.py b/smallstep/api_client/api/ssh/get_ssh_users.py index 187d742..94aab82 100644 --- a/smallstep/api_client/api/ssh/get_ssh_users.py +++ b/smallstep/api_client/api/ssh/get_ssh_users.py @@ -5,18 +5,18 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.get_ssh_users_pagination import GetSshUsersPagination +from ...models.get_ssh_users_pagination_type_0 import GetSshUsersPaginationType0 from ...models.ssh_user import SSHUser from ...types import UNSET, Response, Unset def _get_kwargs( *, - pagination: Union[Unset, None, "GetSshUsersPagination"] = UNSET, + pagination: Union["GetSshUsersPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id @@ -24,22 +24,27 @@ def _get_kwargs( headers["Accept"] = accept params: Dict[str, Any] = {} - json_pagination: Union[Unset, None, Dict[str, Any]] = UNSET - if not isinstance(pagination, Unset): - json_pagination = pagination.to_dict() if pagination else None - if not isinstance(json_pagination, Unset) and json_pagination is not None: - params.update(json_pagination) + json_pagination: Union[Dict[str, Any], None, Unset] + if isinstance(pagination, Unset): + json_pagination = UNSET + elif isinstance(pagination, GetSshUsersPaginationType0): + json_pagination = pagination.to_dict() + else: + json_pagination = pagination + params["pagination"] = json_pagination params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { + _kwargs: Dict[str, Any] = { "method": "get", "url": "/users", "params": params, - "headers": headers, } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -82,7 +87,7 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshUsersPagination"] = UNSET, + pagination: Union["GetSshUsersPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, List["SSHUser"]]]: @@ -93,7 +98,7 @@ def sync_detailed( default directory managed by Smallstep. Args: - pagination (Union[Unset, None, GetSshUsersPagination]): + pagination (Union['GetSshUsersPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -121,7 +126,7 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshUsersPagination"] = UNSET, + pagination: Union["GetSshUsersPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, List["SSHUser"]]]: @@ -132,7 +137,7 @@ def sync( default directory managed by Smallstep. Args: - pagination (Union[Unset, None, GetSshUsersPagination]): + pagination (Union['GetSshUsersPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -155,7 +160,7 @@ def sync( async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshUsersPagination"] = UNSET, + pagination: Union["GetSshUsersPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, List["SSHUser"]]]: @@ -166,7 +171,7 @@ async def asyncio_detailed( default directory managed by Smallstep. Args: - pagination (Union[Unset, None, GetSshUsersPagination]): + pagination (Union['GetSshUsersPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): @@ -192,7 +197,7 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - pagination: Union[Unset, None, "GetSshUsersPagination"] = UNSET, + pagination: Union["GetSshUsersPaginationType0", None, Unset] = UNSET, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, List["SSHUser"]]]: @@ -203,7 +208,7 @@ async def asyncio( default directory managed by Smallstep. Args: - pagination (Union[Unset, None, GetSshUsersPagination]): + pagination (Union['GetSshUsersPaginationType0', None, Unset]): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): diff --git a/smallstep/api_client/api/ssh/post_hosts_host_id_tags.py b/smallstep/api_client/api/ssh/post_hosts_host_id_tags.py index e3ca634..2f51bcb 100644 --- a/smallstep/api_client/api/ssh/post_hosts_host_id_tags.py +++ b/smallstep/api_client/api/ssh/post_hosts_host_id_tags.py @@ -13,28 +13,30 @@ def _get_kwargs( host_id: str, *, - json_body: NewSSHHostTag, + body: NewSSHHostTag, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", - "url": "/hosts/{hostID}/tags".format( - hostID=host_id, - ), - "json": json_json_body, - "headers": headers, + "url": f"/hosts/{host_id}/tags", } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -76,7 +78,7 @@ def sync_detailed( host_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: NewSSHHostTag, + body: NewSSHHostTag, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, SSHHostTag]]: @@ -88,7 +90,7 @@ def sync_detailed( host_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewSSHHostTag): The body of a request to add a tag to a host. + body (NewSSHHostTag): The body of a request to add a tag to a host. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -100,7 +102,7 @@ def sync_detailed( kwargs = _get_kwargs( host_id=host_id, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -116,7 +118,7 @@ def sync( host_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: NewSSHHostTag, + body: NewSSHHostTag, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, SSHHostTag]]: @@ -128,7 +130,7 @@ def sync( host_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewSSHHostTag): The body of a request to add a tag to a host. + body (NewSSHHostTag): The body of a request to add a tag to a host. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,7 +143,7 @@ def sync( return sync_detailed( host_id=host_id, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ).parsed @@ -151,7 +153,7 @@ async def asyncio_detailed( host_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: NewSSHHostTag, + body: NewSSHHostTag, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, SSHHostTag]]: @@ -163,7 +165,7 @@ async def asyncio_detailed( host_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewSSHHostTag): The body of a request to add a tag to a host. + body (NewSSHHostTag): The body of a request to add a tag to a host. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -175,7 +177,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( host_id=host_id, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -189,7 +191,7 @@ async def asyncio( host_id: str, *, client: Union[AuthenticatedClient, Client], - json_body: NewSSHHostTag, + body: NewSSHHostTag, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, SSHHostTag]]: @@ -201,7 +203,7 @@ async def asyncio( host_id (str): x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewSSHHostTag): The body of a request to add a tag to a host. + body (NewSSHHostTag): The body of a request to add a tag to a host. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -215,7 +217,7 @@ async def asyncio( await asyncio_detailed( host_id=host_id, client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/ssh/post_ssh_grants.py b/smallstep/api_client/api/ssh/post_ssh_grants.py index f8158ca..5b21a6d 100644 --- a/smallstep/api_client/api/ssh/post_ssh_grants.py +++ b/smallstep/api_client/api/ssh/post_ssh_grants.py @@ -12,26 +12,30 @@ def _get_kwargs( *, - json_body: NewSSHGrant, + body: NewSSHGrant, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", "url": "/grants", - "json": json_json_body, - "headers": headers, } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response @@ -69,7 +73,7 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: NewSSHGrant, + body: NewSSHGrant, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, SSHHostGrant]]: @@ -80,7 +84,7 @@ def sync_detailed( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewSSHGrant): The body of a request to add a grant to a group. + body (NewSSHGrant): The body of a request to add a grant to a group. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -91,7 +95,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -106,7 +110,7 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - json_body: NewSSHGrant, + body: NewSSHGrant, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, SSHHostGrant]]: @@ -117,7 +121,7 @@ def sync( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewSSHGrant): The body of a request to add a grant to a group. + body (NewSSHGrant): The body of a request to add a grant to a group. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -129,7 +133,7 @@ def sync( return sync_detailed( client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ).parsed @@ -138,7 +142,7 @@ def sync( async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: NewSSHGrant, + body: NewSSHGrant, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Response[Union[Any, SSHHostGrant]]: @@ -149,7 +153,7 @@ async def asyncio_detailed( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewSSHGrant): The body of a request to add a grant to a group. + body (NewSSHGrant): The body of a request to add a grant to a group. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -160,7 +164,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) @@ -173,7 +177,7 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - json_body: NewSSHGrant, + body: NewSSHGrant, x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Optional[Union[Any, SSHHostGrant]]: @@ -184,7 +188,7 @@ async def asyncio( Args: x_request_id (Union[Unset, str]): accept (Union[Unset, str]): - json_body (NewSSHGrant): The body of a request to add a grant to a group. + body (NewSSHGrant): The body of a request to add a grant to a group. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -197,7 +201,7 @@ async def asyncio( return ( await asyncio_detailed( client=client, - json_body=json_body, + body=body, x_request_id=x_request_id, accept=accept, ) diff --git a/smallstep/api_client/api/ssh/unregister_ssh_host.py b/smallstep/api_client/api/ssh/unregister_ssh_host.py index 1aaa089..778f5c0 100644 --- a/smallstep/api_client/api/ssh/unregister_ssh_host.py +++ b/smallstep/api_client/api/ssh/unregister_ssh_host.py @@ -15,21 +15,21 @@ def _get_kwargs( x_request_id: Union[Unset, str] = UNSET, accept: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: - headers = {} + headers: Dict[str, Any] = {} if not isinstance(x_request_id, Unset): headers["X-Request-Id"] = x_request_id if not isinstance(accept, Unset): headers["Accept"] = accept - return { + _kwargs: Dict[str, Any] = { "method": "post", - "url": "/hosts/{hostID}/unregister".format( - hostID=host_id, - ), - "headers": headers, + "url": f"/hosts/{host_id}/unregister", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response diff --git a/smallstep/api_client/client.py b/smallstep/api_client/client.py index 74b476c..63a2493 100644 --- a/smallstep/api_client/client.py +++ b/smallstep/api_client/client.py @@ -35,13 +35,13 @@ class Client: """ raise_on_unexpected_status: bool = field(default=False, kw_only=True) - _base_url: str - _cookies: Dict[str, str] = field(factory=dict, kw_only=True) - _headers: Dict[str, str] = field(factory=dict, kw_only=True) - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True) - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True) - _follow_redirects: bool = field(default=False, kw_only=True) - _httpx_args: Dict[str, Any] = field(factory=dict, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: Dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: Dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: Dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -165,13 +165,13 @@ class AuthenticatedClient: """ raise_on_unexpected_status: bool = field(default=False, kw_only=True) - _base_url: str - _cookies: Dict[str, str] = field(factory=dict, kw_only=True) - _headers: Dict[str, str] = field(factory=dict, kw_only=True) - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True) - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True) - _follow_redirects: bool = field(default=False, kw_only=True) - _httpx_args: Dict[str, Any] = field(factory=dict, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: Dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: Dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: Dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) diff --git a/smallstep/api_client/errors.py b/smallstep/api_client/errors.py index 426f8a2..5f92e76 100644 --- a/smallstep/api_client/errors.py +++ b/smallstep/api_client/errors.py @@ -1,4 +1,4 @@ -""" Contains shared errors types that can be raised from API functions """ +"""Contains shared errors types that can be raised from API functions""" class UnexpectedStatus(Exception): @@ -8,7 +8,9 @@ def __init__(self, status_code: int, content: bytes): self.status_code = status_code self.content = content - super().__init__(f"Unexpected status code: {status_code}") + super().__init__( + f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" + ) __all__ = ["UnexpectedStatus"] diff --git a/smallstep/api_client/models/__init__.py b/smallstep/api_client/models/__init__.py index 587f759..5f38f21 100644 --- a/smallstep/api_client/models/__init__.py +++ b/smallstep/api_client/models/__init__.py @@ -1,12 +1,14 @@ -""" Contains all the data models used in inputs/outputs """ +"""Contains all the data models used in inputs/outputs""" +from .account import Account +from .account_type import AccountType from .acme_device_attestation_provisioner import ACMEDeviceAttestationProvisioner from .acme_device_attestation_provisioner_attestation_formats_item import ( ACMEDeviceAttestationProvisionerAttestationFormatsItem, ) from .acme_provisioner import ACMEProvisioner from .acme_provisioner_challenges_item import ACMEProvisionerChallengesItem -from .agent_configuration import AgentConfiguration +from .amazon_web_services import AmazonWebServices from .attestation_authority import AttestationAuthority from .authority import Authority from .authority_csr import AuthorityCSR @@ -16,54 +18,66 @@ from .azure_provisioner import AzureProvisioner from .azure_vm_device_type import AzureVMDeviceType from .basic_auth import BasicAuth +from .basic_constraints import BasicConstraints +from .browser import Browser +from .certificate_field_device_metadata import CertificateFieldDeviceMetadata +from .certificate_field_list import CertificateFieldList +from .certificate_field_static import CertificateFieldStatic from .collection import Collection from .collection_instance import CollectionInstance from .device_collection import DeviceCollection +from .device_collection_account import DeviceCollectionAccount from .device_collection_device_type import DeviceCollectionDeviceType from .device_enrollment_token import DeviceEnrollmentToken from .distinguished_name import DistinguishedName from .email import Email -from .endpoint_configuration import EndpointConfiguration -from .endpoint_configuration_kind import EndpointConfigurationKind from .error import Error +from .ethernet import Ethernet +from .extra_name import ExtraName from .gcp_provisioner import GCPProvisioner from .gcpvm_device_type import GCPVMDeviceType -from .get_ssh_groups_pagination import GetSshGroupsPagination -from .get_ssh_host_tags_pagination import GetSshHostTagsPagination -from .get_ssh_hosts_pagination import GetSshHostsPagination -from .get_ssh_users_pagination import GetSshUsersPagination +from .get_platforms_pagination_type_0 import GetPlatformsPaginationType0 +from .get_ssh_groups_pagination_type_0 import GetSshGroupsPaginationType0 +from .get_ssh_host_tags_pagination_type_0 import GetSshHostTagsPaginationType0 +from .get_ssh_hosts_pagination_type_0 import GetSshHostsPaginationType0 +from .get_ssh_users_pagination_type_0 import GetSshUsersPaginationType0 +from .google_cloud_platform import GoogleCloudPlatform +from .ike_v2_config import IkeV2Config from .jwk_provisioner import JWKProvisioner -from .list_agent_configurations_pagination import ListAgentConfigurationsPagination -from .list_collection_instances_pagination import ListCollectionInstancesPagination -from .list_collections_pagination import ListCollectionsPagination -from .list_endpoint_configurations_pagination import ListEndpointConfigurationsPagination -from .list_managed_configurations_pagination import ListManagedConfigurationsPagination -from .managed_configuration import ManagedConfiguration -from .managed_endpoint import ManagedEndpoint +from .list_accounts_pagination_type_0 import ListAccountsPaginationType0 +from .list_certificates_pagination_type_0 import ListCertificatesPaginationType0 +from .list_collection_instances_pagination_type_0 import ListCollectionInstancesPaginationType0 +from .list_collections_pagination_type_0 import ListCollectionsPaginationType0 from .managed_endpoint_certificate_info import ManagedEndpointCertificateInfo from .managed_endpoint_certificate_info_type import ManagedEndpointCertificateInfoType from .managed_endpoint_hook import ManagedEndpointHook from .managed_endpoint_hooks import ManagedEndpointHooks from .managed_endpoint_key_info import ManagedEndpointKeyInfo from .managed_endpoint_key_info_format import ManagedEndpointKeyInfoFormat +from .managed_endpoint_key_info_protection import ManagedEndpointKeyInfoProtection from .managed_endpoint_key_info_type import ManagedEndpointKeyInfoType from .managed_endpoint_reload_info import ManagedEndpointReloadInfo from .managed_endpoint_reload_info_method import ManagedEndpointReloadInfoMethod +from .microsoft_azure_platform import MicrosoftAzurePlatform from .name_constraints import NameConstraints from .new_authority_csr import NewAuthorityCSR from .new_collection import NewCollection from .new_device_enrollment_token import NewDeviceEnrollmentToken from .new_hosted_authority import NewHostedAuthority from .new_hosted_authority_type import NewHostedAuthorityType +from .new_platform import NewPlatform +from .new_platform_platform_type import NewPlatformPlatformType from .new_ssh_grant import NewSSHGrant from .new_ssh_host_tag import NewSSHHostTag from .oidc_provisioner import OIDCProvisioner +from .platform import Platform +from .platform_platform_type import PlatformPlatformType from .posix_group import POSIXGroup from .posix_user import POSIXUser -from .post_auth_json_body import PostAuthJsonBody -from .post_auth_json_body_audience import PostAuthJsonBodyAudience +from .post_auth_body import PostAuthBody +from .post_auth_body_audience import PostAuthBodyAudience from .post_auth_response_201 import PostAuthResponse201 -from .post_authority_root_json_body import PostAuthorityRootJsonBody +from .post_authority_root_body import PostAuthorityRootBody from .provisioner import Provisioner from .provisioner_claims import ProvisionerClaims from .provisioner_options import ProvisionerOptions @@ -74,26 +88,36 @@ from .provisioner_webhook_kind import ProvisionerWebhookKind from .provisioner_webhook_server_type import ProvisionerWebhookServerType from .provisioner_x509_options import ProvisionerX509Options -from .put_collection_instance_json_body import PutCollectionInstanceJsonBody -from .ssh_certificate_data import SSHCertificateData +from .put_collection_instance_body import PutCollectionInstanceBody +from .scep_provisioner import SCEPProvisioner +from .scep_provisioner_encryption_algorithm_identifier import SCEPProvisionerEncryptionAlgorithmIdentifier from .ssh_group import SSHGroup from .ssh_host import SSHHost from .ssh_host_grant import SSHHostGrant from .ssh_host_tag import SSHHostTag from .ssh_user import SSHUser +from .subject import Subject from .tpm_device_type import TPMDeviceType +from .vpn import VPN +from .vpn_connection_type import VPNConnectionType +from .vpn_vendor import VPNVendor +from .wi_fi import WiFi from .workload import Workload from .x5c_provisioner import X5CProvisioner -from .x509_certificate_data import X509CertificateData +from .x509_certificate import X509Certificate +from .x509_certificate_revocation_reason import X509CertificateRevocationReason +from .x509_fields import X509Fields from .x509_issuer import X509Issuer from .x509_issuer_key_version import X509IssuerKeyVersion __all__ = ( + "Account", + "AccountType", "ACMEDeviceAttestationProvisioner", "ACMEDeviceAttestationProvisionerAttestationFormatsItem", "ACMEProvisioner", "ACMEProvisionerChallengesItem", - "AgentConfiguration", + "AmazonWebServices", "AttestationAuthority", "Authority", "AuthorityCSR", @@ -103,53 +127,65 @@ "AzureProvisioner", "AzureVMDeviceType", "BasicAuth", + "BasicConstraints", + "Browser", + "CertificateFieldDeviceMetadata", + "CertificateFieldList", + "CertificateFieldStatic", "Collection", "CollectionInstance", "DeviceCollection", + "DeviceCollectionAccount", "DeviceCollectionDeviceType", "DeviceEnrollmentToken", "DistinguishedName", "Email", - "EndpointConfiguration", - "EndpointConfigurationKind", "Error", + "Ethernet", + "ExtraName", "GCPProvisioner", "GCPVMDeviceType", - "GetSshGroupsPagination", - "GetSshHostsPagination", - "GetSshHostTagsPagination", - "GetSshUsersPagination", + "GetPlatformsPaginationType0", + "GetSshGroupsPaginationType0", + "GetSshHostsPaginationType0", + "GetSshHostTagsPaginationType0", + "GetSshUsersPaginationType0", + "GoogleCloudPlatform", + "IkeV2Config", "JWKProvisioner", - "ListAgentConfigurationsPagination", - "ListCollectionInstancesPagination", - "ListCollectionsPagination", - "ListEndpointConfigurationsPagination", - "ListManagedConfigurationsPagination", - "ManagedConfiguration", - "ManagedEndpoint", + "ListAccountsPaginationType0", + "ListCertificatesPaginationType0", + "ListCollectionInstancesPaginationType0", + "ListCollectionsPaginationType0", "ManagedEndpointCertificateInfo", "ManagedEndpointCertificateInfoType", "ManagedEndpointHook", "ManagedEndpointHooks", "ManagedEndpointKeyInfo", "ManagedEndpointKeyInfoFormat", + "ManagedEndpointKeyInfoProtection", "ManagedEndpointKeyInfoType", "ManagedEndpointReloadInfo", "ManagedEndpointReloadInfoMethod", + "MicrosoftAzurePlatform", "NameConstraints", "NewAuthorityCSR", "NewCollection", "NewDeviceEnrollmentToken", "NewHostedAuthority", "NewHostedAuthorityType", + "NewPlatform", + "NewPlatformPlatformType", "NewSSHGrant", "NewSSHHostTag", "OIDCProvisioner", + "Platform", + "PlatformPlatformType", "POSIXGroup", "POSIXUser", - "PostAuthJsonBody", - "PostAuthJsonBodyAudience", - "PostAuthorityRootJsonBody", + "PostAuthBody", + "PostAuthBodyAudience", + "PostAuthorityRootBody", "PostAuthResponse201", "Provisioner", "ProvisionerClaims", @@ -161,16 +197,24 @@ "ProvisionerWebhookKind", "ProvisionerWebhookServerType", "ProvisionerX509Options", - "PutCollectionInstanceJsonBody", - "SSHCertificateData", + "PutCollectionInstanceBody", + "SCEPProvisioner", + "SCEPProvisionerEncryptionAlgorithmIdentifier", "SSHGroup", "SSHHost", "SSHHostGrant", "SSHHostTag", "SSHUser", + "Subject", "TPMDeviceType", + "VPN", + "VPNConnectionType", + "VPNVendor", + "WiFi", "Workload", - "X509CertificateData", + "X509Certificate", + "X509CertificateRevocationReason", + "X509Fields", "X509Issuer", "X509IssuerKeyVersion", "X5CProvisioner", diff --git a/smallstep/api_client/models/ssh_certificate_data.py b/smallstep/api_client/models/account.py similarity index 53% rename from smallstep/api_client/models/ssh_certificate_data.py rename to smallstep/api_client/models/account.py index 346208e..c06d5c6 100644 --- a/smallstep/api_client/models/ssh_certificate_data.py +++ b/smallstep/api_client/models/account.py @@ -1,56 +1,65 @@ -from typing import Any, Dict, List, Type, TypeVar, cast +from typing import Any, Dict, List, Type, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="SSHCertificateData") +from ..models.account_type import AccountType +from ..types import UNSET, Unset +T = TypeVar("T", bound="Account") -@_attrs_define -class SSHCertificateData: - """Contains the information to include when granting an SSH certificate to a managed endpoint. - - Example: - {'keyID': 'abc123', 'principals': ['ops', 'eng']} +@_attrs_define +class Account: + """ Attributes: - key_id (str): The key ID to include in the endpoint certificate. - principals (List[str]): The principals to include in the endpoint certificate. + name (str): + type (AccountType): + id (Union[Unset, str]): """ - key_id: str - principals: List[str] + name: str + type: AccountType + id: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - key_id = self.key_id - principals = self.principals + name = self.name + + type = self.type.value + + id = self.id field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "keyID": key_id, - "principals": principals, + "name": name, + "type": type, } ) + if id is not UNSET: + field_dict["id"] = id return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - key_id = d.pop("keyID") + name = d.pop("name") + + type = AccountType(d.pop("type")) - principals = cast(List[str], d.pop("principals")) + id = d.pop("id", UNSET) - ssh_certificate_data = cls( - key_id=key_id, - principals=principals, + account = cls( + name=name, + type=type, + id=id, ) - ssh_certificate_data.additional_properties = d - return ssh_certificate_data + account.additional_properties = d + return account @property def additional_keys(self) -> List[str]: diff --git a/smallstep/api_client/models/account_type.py b/smallstep/api_client/models/account_type.py new file mode 100644 index 0000000..a4ab2a3 --- /dev/null +++ b/smallstep/api_client/models/account_type.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class AccountType(str, Enum): + BROWSER = "browser" + ETHERNET = "ethernet" + VPN = "vpn" + WIFI = "wifi" + + def __str__(self) -> str: + return str(self.value) diff --git a/smallstep/api_client/models/acme_device_attestation_provisioner.py b/smallstep/api_client/models/acme_device_attestation_provisioner.py index d49c9a0..ea93ca4 100644 --- a/smallstep/api_client/models/acme_device_attestation_provisioner.py +++ b/smallstep/api_client/models/acme_device_attestation_provisioner.py @@ -42,7 +42,6 @@ def to_dict(self) -> Dict[str, Any]: attestation_formats = [] for attestation_formats_item_data in self.attestation_formats: attestation_formats_item = attestation_formats_item_data.value - attestation_formats.append(attestation_formats_item) attestation_roots: Union[Unset, List[str]] = UNSET @@ -50,6 +49,7 @@ def to_dict(self) -> Dict[str, Any]: attestation_roots = self.attestation_roots force_cn = self.force_cn + require_eab = self.require_eab field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/acme_provisioner.py b/smallstep/api_client/models/acme_provisioner.py index 88f0361..3dce941 100644 --- a/smallstep/api_client/models/acme_provisioner.py +++ b/smallstep/api_client/models/acme_provisioner.py @@ -31,10 +31,10 @@ def to_dict(self) -> Dict[str, Any]: challenges = [] for challenges_item_data in self.challenges: challenges_item = challenges_item_data.value - challenges.append(challenges_item) require_eab = self.require_eab + force_cn = self.force_cn field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/agent_configuration.py b/smallstep/api_client/models/agent_configuration.py deleted file mode 100644 index 5e6be19..0000000 --- a/smallstep/api_client/models/agent_configuration.py +++ /dev/null @@ -1,98 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="AgentConfiguration") - - -@_attrs_define -class AgentConfiguration: - """The agent configuration describes the attestation authority used by the agent to grant workload certificates. This - object is experimental and subject to change. - - Example: - {'attestationSlug': 'teamfooattestationca', 'authorityID': '60bba807-d3dc-414f-90c9-968a0e3b28c3', 'id': - '59b4489d-f731-4ae2-8339-16cf829d143d', 'name': 'Agent 1', 'provisioner': 'agentsattestor'} - - Attributes: - authority_id (str): UUID identifying the authority the agent uses to generate endpoint certificates. - name (str): The name of this agent configuration. - provisioner (str): The name of the provisioner on the authority the agent uses to generate endpoint - certificates. - attestation_slug (Union[Unset, str]): The slug of the attestation authority the agent connects to to get a - certificate. - id (Union[Unset, str]): A UUID identifying this agent configuration. Read only. - """ - - authority_id: str - name: str - provisioner: str - attestation_slug: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - authority_id = self.authority_id - name = self.name - provisioner = self.provisioner - attestation_slug = self.attestation_slug - id = self.id - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "authorityID": authority_id, - "name": name, - "provisioner": provisioner, - } - ) - if attestation_slug is not UNSET: - field_dict["attestationSlug"] = attestation_slug - if id is not UNSET: - field_dict["id"] = id - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - authority_id = d.pop("authorityID") - - name = d.pop("name") - - provisioner = d.pop("provisioner") - - attestation_slug = d.pop("attestationSlug", UNSET) - - id = d.pop("id", UNSET) - - agent_configuration = cls( - authority_id=authority_id, - name=name, - provisioner=provisioner, - attestation_slug=attestation_slug, - id=id, - ) - - agent_configuration.additional_properties = d - return agent_configuration - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/smallstep/api_client/models/get_ssh_groups_pagination.py b/smallstep/api_client/models/amazon_web_services.py similarity index 51% rename from smallstep/api_client/models/get_ssh_groups_pagination.py rename to smallstep/api_client/models/amazon_web_services.py index 88f6109..9b4a9f2 100644 --- a/smallstep/api_client/models/get_ssh_groups_pagination.py +++ b/smallstep/api_client/models/amazon_web_services.py @@ -5,53 +5,61 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="GetSshGroupsPagination") +T = TypeVar("T", bound="AmazonWebServices") @_attrs_define -class GetSshGroupsPagination: - """ +class AmazonWebServices: + """Configuration for an AWS platform. + Attributes: - after (Union[Unset, None, str]): Fetch a page of results other than the first page. - Must be copied from a previously returned X-Next-Cursor header. - Example: MTIzNA==. - first (Union[Unset, None, int]): Limits the number of results returned. - Defaults to 100. - Example: 30. + account_id (str): + name (str): A friendly name for this AWS account. + role_arn (Union[Unset, str]): A role ARN that allows the Smallstep Platform to manage resources on your behalf. """ - after: Union[Unset, None, str] = UNSET - first: Union[Unset, None, int] = UNSET + account_id: str + name: str + role_arn: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - after = self.after - first = self.first + account_id = self.account_id + + name = self.name + + role_arn = self.role_arn field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({}) - if after is not UNSET: - field_dict["after"] = after - if first is not UNSET: - field_dict["first"] = first + field_dict.update( + { + "accountId": account_id, + "name": name, + } + ) + if role_arn is not UNSET: + field_dict["roleArn"] = role_arn return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - after = d.pop("after", UNSET) + account_id = d.pop("accountId") + + name = d.pop("name") - first = d.pop("first", UNSET) + role_arn = d.pop("roleArn", UNSET) - get_ssh_groups_pagination = cls( - after=after, - first=first, + amazon_web_services = cls( + account_id=account_id, + name=name, + role_arn=role_arn, ) - get_ssh_groups_pagination.additional_properties = d - return get_ssh_groups_pagination + amazon_web_services.additional_properties = d + return amazon_web_services @property def additional_keys(self) -> List[str]: diff --git a/smallstep/api_client/models/attestation_authority.py b/smallstep/api_client/models/attestation_authority.py index f6b05cf..0cf84a5 100644 --- a/smallstep/api_client/models/attestation_authority.py +++ b/smallstep/api_client/models/attestation_authority.py @@ -47,14 +47,19 @@ class AttestationAuthority: def to_dict(self) -> Dict[str, Any]: attestor_roots = self.attestor_roots + name = self.name + attestor_intermediates = self.attestor_intermediates + created_at: Union[Unset, str] = UNSET if not isinstance(self.created_at, Unset): created_at = self.created_at.isoformat() id = self.id + root = self.root + slug = self.slug field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/authority.py b/smallstep/api_client/models/authority.py index 1afbebb..f6e09d1 100644 --- a/smallstep/api_client/models/authority.py +++ b/smallstep/api_client/models/authority.py @@ -42,16 +42,21 @@ def to_dict(self) -> Dict[str, Any]: created_at = self.created_at.isoformat() domain = self.domain + id = self.id + name = self.name + type = self.type.value active_revocation = self.active_revocation + admin_emails: Union[Unset, List[str]] = UNSET if not isinstance(self.admin_emails, Unset): admin_emails = self.admin_emails fingerprint = self.fingerprint + root = self.root field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/authority_csr.py b/smallstep/api_client/models/authority_csr.py index 1859d66..3acc177 100644 --- a/smallstep/api_client/models/authority_csr.py +++ b/smallstep/api_client/models/authority_csr.py @@ -23,7 +23,9 @@ class AuthorityCSR: def to_dict(self) -> Dict[str, Any]: authority_id = self.authority_id + csr = self.csr + id = self.id field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/aws_provisioner.py b/smallstep/api_client/models/aws_provisioner.py index 24b4f8e..80eade4 100644 --- a/smallstep/api_client/models/aws_provisioner.py +++ b/smallstep/api_client/models/aws_provisioner.py @@ -36,7 +36,9 @@ def to_dict(self) -> Dict[str, Any]: accounts = self.accounts disable_custom_sans = self.disable_custom_sans + disable_trust_on_first_use = self.disable_trust_on_first_use + instance_age = self.instance_age field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/azure_provisioner.py b/smallstep/api_client/models/azure_provisioner.py index 2052031..2d74b2c 100644 --- a/smallstep/api_client/models/azure_provisioner.py +++ b/smallstep/api_client/models/azure_provisioner.py @@ -36,8 +36,11 @@ def to_dict(self) -> Dict[str, Any]: resource_groups = self.resource_groups tenant_id = self.tenant_id + audience = self.audience + disable_custom_sans = self.disable_custom_sans + disable_trust_on_first_use = self.disable_trust_on_first_use field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/azure_vm_device_type.py b/smallstep/api_client/models/azure_vm_device_type.py index b2d732e..e1e6286 100644 --- a/smallstep/api_client/models/azure_vm_device_type.py +++ b/smallstep/api_client/models/azure_vm_device_type.py @@ -30,7 +30,9 @@ def to_dict(self) -> Dict[str, Any]: resource_groups = self.resource_groups tenant_id = self.tenant_id + audience = self.audience + disable_custom_sans = self.disable_custom_sans field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/basic_auth.py b/smallstep/api_client/models/basic_auth.py index 541ac73..7da3109 100644 --- a/smallstep/api_client/models/basic_auth.py +++ b/smallstep/api_client/models/basic_auth.py @@ -26,6 +26,7 @@ class BasicAuth: def to_dict(self) -> Dict[str, Any]: password = self.password + username = self.username field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/x509_certificate_data.py b/smallstep/api_client/models/basic_constraints.py similarity index 53% rename from smallstep/api_client/models/x509_certificate_data.py rename to smallstep/api_client/models/basic_constraints.py index 6f75410..40583f8 100644 --- a/smallstep/api_client/models/x509_certificate_data.py +++ b/smallstep/api_client/models/basic_constraints.py @@ -1,37 +1,34 @@ -from typing import Any, Dict, List, Type, TypeVar, cast +from typing import Any, Dict, List, Type, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="X509CertificateData") +T = TypeVar("T", bound="BasicConstraints") @_attrs_define -class X509CertificateData: - """Contains the information to include when granting an x509 certificate to a managed endpoint. - - Example: - {'commonName': 'db', 'sans': ['db', 'db.internal']} - +class BasicConstraints: + """ Attributes: - common_name (str): The Common Name to be used in the subject of the endpoint certificate. - sans (List[str]): The list of SANs to include in the endpoint certificate. + is_ca (bool): + max_path_len (int): """ - common_name: str - sans: List[str] + is_ca: bool + max_path_len: int additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - common_name = self.common_name - sans = self.sans + is_ca = self.is_ca + + max_path_len = self.max_path_len field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "commonName": common_name, - "sans": sans, + "isCA": is_ca, + "maxPathLen": max_path_len, } ) @@ -40,17 +37,17 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - common_name = d.pop("commonName") + is_ca = d.pop("isCA") - sans = cast(List[str], d.pop("sans")) + max_path_len = d.pop("maxPathLen") - x509_certificate_data = cls( - common_name=common_name, - sans=sans, + basic_constraints = cls( + is_ca=is_ca, + max_path_len=max_path_len, ) - x509_certificate_data.additional_properties = d - return x509_certificate_data + basic_constraints.additional_properties = d + return basic_constraints @property def additional_keys(self) -> List[str]: diff --git a/smallstep/api_client/models/browser.py b/smallstep/api_client/models/browser.py new file mode 100644 index 0000000..91027e7 --- /dev/null +++ b/smallstep/api_client/models/browser.py @@ -0,0 +1,43 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="Browser") + + +@_attrs_define +class Browser: + """Configuration to use a client certificate.""" + + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + browser = cls() + + browser.additional_properties = d + return browser + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/certificate_field_device_metadata.py b/smallstep/api_client/models/certificate_field_device_metadata.py new file mode 100644 index 0000000..b65980d --- /dev/null +++ b/smallstep/api_client/models/certificate_field_device_metadata.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CertificateFieldDeviceMetadata") + + +@_attrs_define +class CertificateFieldDeviceMetadata: + """ + Attributes: + device_metadata (str): + """ + + device_metadata: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + device_metadata = self.device_metadata + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "deviceMetadata": device_metadata, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + device_metadata = d.pop("deviceMetadata") + + certificate_field_device_metadata = cls( + device_metadata=device_metadata, + ) + + certificate_field_device_metadata.additional_properties = d + return certificate_field_device_metadata + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/certificate_field_list.py b/smallstep/api_client/models/certificate_field_list.py new file mode 100644 index 0000000..5965931 --- /dev/null +++ b/smallstep/api_client/models/certificate_field_list.py @@ -0,0 +1,72 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CertificateFieldList") + + +@_attrs_define +class CertificateFieldList: + """A certificate field that accepts multiple string values, e.g. SANs. + + Attributes: + device_metadata (Union[Unset, List[str]]): A value populated from a key in the device's metadata. + static (Union[Unset, List[str]]): A literal value. + """ + + device_metadata: Union[Unset, List[str]] = UNSET + static: Union[Unset, List[str]] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + device_metadata: Union[Unset, List[str]] = UNSET + if not isinstance(self.device_metadata, Unset): + device_metadata = self.device_metadata + + static: Union[Unset, List[str]] = UNSET + if not isinstance(self.static, Unset): + static = self.static + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if device_metadata is not UNSET: + field_dict["deviceMetadata"] = device_metadata + if static is not UNSET: + field_dict["static"] = static + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + device_metadata = cast(List[str], d.pop("deviceMetadata", UNSET)) + + static = cast(List[str], d.pop("static", UNSET)) + + certificate_field_list = cls( + device_metadata=device_metadata, + static=static, + ) + + certificate_field_list.additional_properties = d + return certificate_field_list + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/certificate_field_static.py b/smallstep/api_client/models/certificate_field_static.py new file mode 100644 index 0000000..886acaf --- /dev/null +++ b/smallstep/api_client/models/certificate_field_static.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CertificateFieldStatic") + + +@_attrs_define +class CertificateFieldStatic: + """ + Attributes: + static (str): + """ + + static: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + static = self.static + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "static": static, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + static = d.pop("static") + + certificate_field_static = cls( + static=static, + ) + + certificate_field_static.additional_properties = d + return certificate_field_static + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/collection.py b/smallstep/api_client/models/collection.py index 6466077..587311b 100644 --- a/smallstep/api_client/models/collection.py +++ b/smallstep/api_client/models/collection.py @@ -39,8 +39,11 @@ def to_dict(self) -> Dict[str, Any]: created_at = self.created_at.isoformat() display_name = self.display_name + instance_count = self.instance_count + slug = self.slug + updated_at = self.updated_at.isoformat() schema_uri = self.schema_uri diff --git a/smallstep/api_client/models/collection_instance.py b/smallstep/api_client/models/collection_instance.py index b17dc4c..c612e88 100644 --- a/smallstep/api_client/models/collection_instance.py +++ b/smallstep/api_client/models/collection_instance.py @@ -29,7 +29,9 @@ def to_dict(self) -> Dict[str, Any]: created_at = self.created_at.isoformat() data = self.data + id = self.id + updated_at = self.updated_at.isoformat() field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/device_collection.py b/smallstep/api_client/models/device_collection.py index 1201e6f..bae738e 100644 --- a/smallstep/api_client/models/device_collection.py +++ b/smallstep/api_client/models/device_collection.py @@ -45,21 +45,19 @@ def to_dict(self) -> Dict[str, Any]: device_type = self.device_type.value device_type_configuration: Dict[str, Any] - if isinstance(self.device_type_configuration, AWSVMDeviceType): device_type_configuration = self.device_type_configuration.to_dict() - elif isinstance(self.device_type_configuration, AzureVMDeviceType): device_type_configuration = self.device_type_configuration.to_dict() - elif isinstance(self.device_type_configuration, GCPVMDeviceType): device_type_configuration = self.device_type_configuration.to_dict() - else: device_type_configuration = self.device_type_configuration.to_dict() display_name = self.display_name + slug = self.slug + admin_emails: Union[Unset, List[str]] = UNSET if not isinstance(self.admin_emails, Unset): admin_emails = self.admin_emails diff --git a/smallstep/api_client/models/endpoint_configuration.py b/smallstep/api_client/models/device_collection_account.py similarity index 57% rename from smallstep/api_client/models/endpoint_configuration.py rename to smallstep/api_client/models/device_collection_account.py index 7e1e59d..b08d488 100644 --- a/smallstep/api_client/models/endpoint_configuration.py +++ b/smallstep/api_client/models/device_collection_account.py @@ -1,9 +1,8 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..models.endpoint_configuration_kind import EndpointConfigurationKind from ..types import UNSET, Unset if TYPE_CHECKING: @@ -13,64 +12,66 @@ from ..models.managed_endpoint_reload_info import ManagedEndpointReloadInfo -T = TypeVar("T", bound="EndpointConfiguration") +T = TypeVar("T", bound="DeviceCollectionAccount") @_attrs_define -class EndpointConfiguration: - """Configuration for a managed endpoint. This object is experimental and subject to change. - - Example: - {'authorityID': '8e3ff498-2059-4859-9053-c334ceab5f83', 'certificateInfo': {'crtFile': '/etc/db.crt', - 'duration': '24h0m0s', 'gid': 999, 'keyFile': '/etc/db.key', 'mode': 256, 'rootFile': '/etc/ca.crt', 'type': - 'X509', 'uid': 1001}, 'hooks': {'renew': {'after': ['echo renewed'], 'before': ['echo renewing'], 'onError': - ['echo failed to renew'], 'shell': '/bin/bash'}, 'sign': {'after': ['echo signed'], 'before': ['echo signing'], - 'onError': ['echo failed to sign'], 'shell': '/bin/bash'}}, 'id': 'd9dd9ca8-8624-4eca-84e9-ee3dd74c1786', - 'keyInfo': {'format': 'DER', 'pubFile': '/etc/db.csr', 'type': 'ECDSA_P256'}, 'kind': 'WORKLOAD', 'name': 'My - Database Server', 'provisioner': 'Endpoints Provisioner', 'reloadInfo': {'method': 'SIGNAL', 'pidFile': - '/var/run/db.pid', 'signal': 1}} +class DeviceCollectionAccount: + """The certificate details binding an account to a device collection. Attributes: - authority_id (str): UUID identifying the authority that will issue certificates for the endpoint. - certificate_info (ManagedEndpointCertificateInfo): Details on a managed certificate. Example: {'crtFile': - '/etc/db.crt', 'duration': '24h0m0s', 'gid': 999, 'keyFile': '/etc/db.key', 'mode': 256, 'rootFile': + account_id (str): Identifier of the account. + display_name (str): A friendly name for the device collection account. Also used as the Common Name, if no + static SANs are provided. + slug (str): Used as the identifier for the device collection account. + admin_emails (Union[Unset, List[str]]): Users that will have admin access to manage the workloads authority, + which will be created if it does not already exist. Ignored if the workloads authority already exists. Never + returned in responses. + authority_id (Union[Unset, str]): A UUID identifying the authority. Defaults to the accounts authority if not + set. + certificate_info (Union[Unset, ManagedEndpointCertificateInfo]): Details on a managed certificate. Example: + {'crtFile': '/etc/db.crt', 'duration': '24h0m0s', 'gid': 999, 'keyFile': '/etc/db.key', 'mode': 256, 'rootFile': '/etc/ca.crt', 'type': 'X509', 'uid': 1001}. - kind (EndpointConfigurationKind): The kind of endpoint this configuration applies to. - name (str): The name of the endpoint configuration. - provisioner (str): Name of the provisioner on the authority that will authorize certificates for the endpoint. hooks (Union[Unset, ManagedEndpointHooks]): The collection of commands to run when a certificate for a managed endpoint is signed or renewed. - id (Union[Unset, str]): A UUID identifying this endpoint configuration. Read only. key_info (Union[Unset, ManagedEndpointKeyInfo]): The attributes of the cryptographic key. Example: {'format': - 'DER', 'pubFile': '/etc/db.csr', 'type': 'ECDSA_P256'}. + 'PKCS8', 'protection': 'NONE', 'pubFile': '/etc/db.csr', 'type': 'ECDSA_P256'}. reload_info (Union[Unset, ManagedEndpointReloadInfo]): The properties used to reload a service. Example: {'method': 'SIGNAL', 'pidFile': '/var/run/db.pid', 'signal': 1}. """ - authority_id: str - certificate_info: "ManagedEndpointCertificateInfo" - kind: EndpointConfigurationKind - name: str - provisioner: str + account_id: str + display_name: str + slug: str + admin_emails: Union[Unset, List[str]] = UNSET + authority_id: Union[Unset, str] = UNSET + certificate_info: Union[Unset, "ManagedEndpointCertificateInfo"] = UNSET hooks: Union[Unset, "ManagedEndpointHooks"] = UNSET - id: Union[Unset, str] = UNSET key_info: Union[Unset, "ManagedEndpointKeyInfo"] = UNSET reload_info: Union[Unset, "ManagedEndpointReloadInfo"] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + account_id = self.account_id + + display_name = self.display_name + + slug = self.slug + + admin_emails: Union[Unset, List[str]] = UNSET + if not isinstance(self.admin_emails, Unset): + admin_emails = self.admin_emails + authority_id = self.authority_id - certificate_info = self.certificate_info.to_dict() - kind = self.kind.value + certificate_info: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.certificate_info, Unset): + certificate_info = self.certificate_info.to_dict() - name = self.name - provisioner = self.provisioner hooks: Union[Unset, Dict[str, Any]] = UNSET if not isinstance(self.hooks, Unset): hooks = self.hooks.to_dict() - id = self.id key_info: Union[Unset, Dict[str, Any]] = UNSET if not isinstance(self.key_info, Unset): key_info = self.key_info.to_dict() @@ -83,17 +84,19 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update(self.additional_properties) field_dict.update( { - "authorityID": authority_id, - "certificateInfo": certificate_info, - "kind": kind, - "name": name, - "provisioner": provisioner, + "accountID": account_id, + "displayName": display_name, + "slug": slug, } ) + if admin_emails is not UNSET: + field_dict["adminEmails"] = admin_emails + if authority_id is not UNSET: + field_dict["authorityID"] = authority_id + if certificate_info is not UNSET: + field_dict["certificateInfo"] = certificate_info if hooks is not UNSET: field_dict["hooks"] = hooks - if id is not UNSET: - field_dict["id"] = id if key_info is not UNSET: field_dict["keyInfo"] = key_info if reload_info is not UNSET: @@ -109,15 +112,22 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from ..models.managed_endpoint_reload_info import ManagedEndpointReloadInfo d = src_dict.copy() - authority_id = d.pop("authorityID") + account_id = d.pop("accountID") - certificate_info = ManagedEndpointCertificateInfo.from_dict(d.pop("certificateInfo")) + display_name = d.pop("displayName") - kind = EndpointConfigurationKind(d.pop("kind")) + slug = d.pop("slug") - name = d.pop("name") + admin_emails = cast(List[str], d.pop("adminEmails", UNSET)) - provisioner = d.pop("provisioner") + authority_id = d.pop("authorityID", UNSET) + + _certificate_info = d.pop("certificateInfo", UNSET) + certificate_info: Union[Unset, ManagedEndpointCertificateInfo] + if isinstance(_certificate_info, Unset): + certificate_info = UNSET + else: + certificate_info = ManagedEndpointCertificateInfo.from_dict(_certificate_info) _hooks = d.pop("hooks", UNSET) hooks: Union[Unset, ManagedEndpointHooks] @@ -126,8 +136,6 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: hooks = ManagedEndpointHooks.from_dict(_hooks) - id = d.pop("id", UNSET) - _key_info = d.pop("keyInfo", UNSET) key_info: Union[Unset, ManagedEndpointKeyInfo] if isinstance(_key_info, Unset): @@ -142,20 +150,20 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: reload_info = ManagedEndpointReloadInfo.from_dict(_reload_info) - endpoint_configuration = cls( + device_collection_account = cls( + account_id=account_id, + display_name=display_name, + slug=slug, + admin_emails=admin_emails, authority_id=authority_id, certificate_info=certificate_info, - kind=kind, - name=name, - provisioner=provisioner, hooks=hooks, - id=id, key_info=key_info, reload_info=reload_info, ) - endpoint_configuration.additional_properties = d - return endpoint_configuration + device_collection_account.additional_properties = d + return device_collection_account @property def additional_keys(self) -> List[str]: diff --git a/smallstep/api_client/models/device_enrollment_token.py b/smallstep/api_client/models/device_enrollment_token.py index 1c38b18..43a982e 100644 --- a/smallstep/api_client/models/device_enrollment_token.py +++ b/smallstep/api_client/models/device_enrollment_token.py @@ -30,7 +30,9 @@ class DeviceEnrollmentToken: def to_dict(self) -> Dict[str, Any]: id = self.id + secret = self.secret + title = self.title field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/distinguished_name.py b/smallstep/api_client/models/distinguished_name.py index 3c83b57..7f6fd70 100644 --- a/smallstep/api_client/models/distinguished_name.py +++ b/smallstep/api_client/models/distinguished_name.py @@ -42,14 +42,23 @@ class DistinguishedName: def to_dict(self) -> Dict[str, Any]: common_name = self.common_name + country = self.country + email_address = self.email_address + locality = self.locality + organization = self.organization + organizational_unit = self.organizational_unit + postal_code = self.postal_code + province = self.province + serial_number = self.serial_number + street_address = self.street_address field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/email.py b/smallstep/api_client/models/email.py index ff88b35..6db3c88 100644 --- a/smallstep/api_client/models/email.py +++ b/smallstep/api_client/models/email.py @@ -26,6 +26,7 @@ class Email: def to_dict(self) -> Dict[str, Any]: email = self.email + primary = self.primary field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/endpoint_configuration_kind.py b/smallstep/api_client/models/endpoint_configuration_kind.py deleted file mode 100644 index ed94008..0000000 --- a/smallstep/api_client/models/endpoint_configuration_kind.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class EndpointConfigurationKind(str, Enum): - DEVICE = "DEVICE" - PEOPLE = "PEOPLE" - WORKLOAD = "WORKLOAD" - - def __str__(self) -> str: - return str(self.value) diff --git a/smallstep/api_client/models/ethernet.py b/smallstep/api_client/models/ethernet.py new file mode 100644 index 0000000..9646a78 --- /dev/null +++ b/smallstep/api_client/models/ethernet.py @@ -0,0 +1,86 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Ethernet") + + +@_attrs_define +class Ethernet: + """Configuration to connect a device to a protected LAN. + + Attributes: + autojoin (Union[Unset, bool]): + ca_chain (Union[Unset, str]): + external_radius_server (Union[Unset, bool]): + network_access_server_ip (Union[Unset, str]): + """ + + autojoin: Union[Unset, bool] = UNSET + ca_chain: Union[Unset, str] = UNSET + external_radius_server: Union[Unset, bool] = UNSET + network_access_server_ip: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + autojoin = self.autojoin + + ca_chain = self.ca_chain + + external_radius_server = self.external_radius_server + + network_access_server_ip = self.network_access_server_ip + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if autojoin is not UNSET: + field_dict["autojoin"] = autojoin + if ca_chain is not UNSET: + field_dict["caChain"] = ca_chain + if external_radius_server is not UNSET: + field_dict["externalRadiusServer"] = external_radius_server + if network_access_server_ip is not UNSET: + field_dict["networkAccessServerIP"] = network_access_server_ip + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + autojoin = d.pop("autojoin", UNSET) + + ca_chain = d.pop("caChain", UNSET) + + external_radius_server = d.pop("externalRadiusServer", UNSET) + + network_access_server_ip = d.pop("networkAccessServerIP", UNSET) + + ethernet = cls( + autojoin=autojoin, + ca_chain=ca_chain, + external_radius_server=external_radius_server, + network_access_server_ip=network_access_server_ip, + ) + + ethernet.additional_properties = d + return ethernet + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/extra_name.py b/smallstep/api_client/models/extra_name.py new file mode 100644 index 0000000..f8b55a5 --- /dev/null +++ b/smallstep/api_client/models/extra_name.py @@ -0,0 +1,66 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ExtraName") + + +@_attrs_define +class ExtraName: + """ + Attributes: + type (str): + value (Any): + """ + + type: str + value: Any + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + type = self.type + + value = self.value + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type, + "value": value, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + type = d.pop("type") + + value = d.pop("value") + + extra_name = cls( + type=type, + value=value, + ) + + extra_name.additional_properties = d + return extra_name + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/gcp_provisioner.py b/smallstep/api_client/models/gcp_provisioner.py index d894078..21c1f4f 100644 --- a/smallstep/api_client/models/gcp_provisioner.py +++ b/smallstep/api_client/models/gcp_provisioner.py @@ -38,8 +38,11 @@ class GCPProvisioner: def to_dict(self) -> Dict[str, Any]: disable_custom_sans = self.disable_custom_sans + disable_trust_on_first_use = self.disable_trust_on_first_use + instance_age = self.instance_age + project_ids: Union[Unset, List[str]] = UNSET if not isinstance(self.project_ids, Unset): project_ids = self.project_ids diff --git a/smallstep/api_client/models/gcpvm_device_type.py b/smallstep/api_client/models/gcpvm_device_type.py index ce7503f..cf5973f 100644 --- a/smallstep/api_client/models/gcpvm_device_type.py +++ b/smallstep/api_client/models/gcpvm_device_type.py @@ -30,6 +30,7 @@ class GCPVMDeviceType: def to_dict(self) -> Dict[str, Any]: disable_custom_sans = self.disable_custom_sans + project_ids: Union[Unset, List[str]] = UNSET if not isinstance(self.project_ids, Unset): project_ids = self.project_ids diff --git a/smallstep/api_client/models/get_platforms_pagination_type_0.py b/smallstep/api_client/models/get_platforms_pagination_type_0.py new file mode 100644 index 0000000..6090d99 --- /dev/null +++ b/smallstep/api_client/models/get_platforms_pagination_type_0.py @@ -0,0 +1,94 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="GetPlatformsPaginationType0") + + +@_attrs_define +class GetPlatformsPaginationType0: + """ + Attributes: + after (Union[None, Unset, str]): Fetch a page of results other than the first page. + Must be copied from a previously returned X-Next-Cursor header. + Example: MTIzNA==. + first (Union[None, Unset, int]): Limits the number of results returned. + Defaults to 100. + Example: 30. + """ + + after: Union[None, Unset, str] = UNSET + first: Union[None, Unset, int] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + after: Union[None, Unset, str] + if isinstance(self.after, Unset): + after = UNSET + else: + after = self.after + + first: Union[None, Unset, int] + if isinstance(self.first, Unset): + first = UNSET + else: + first = self.first + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if after is not UNSET: + field_dict["after"] = after + if first is not UNSET: + field_dict["first"] = first + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + + def _parse_after(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + after = _parse_after(d.pop("after", UNSET)) + + def _parse_first(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + first = _parse_first(d.pop("first", UNSET)) + + get_platforms_pagination_type_0 = cls( + after=after, + first=first, + ) + + get_platforms_pagination_type_0.additional_properties = d + return get_platforms_pagination_type_0 + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/get_ssh_groups_pagination_type_0.py b/smallstep/api_client/models/get_ssh_groups_pagination_type_0.py new file mode 100644 index 0000000..6802a48 --- /dev/null +++ b/smallstep/api_client/models/get_ssh_groups_pagination_type_0.py @@ -0,0 +1,94 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="GetSshGroupsPaginationType0") + + +@_attrs_define +class GetSshGroupsPaginationType0: + """ + Attributes: + after (Union[None, Unset, str]): Fetch a page of results other than the first page. + Must be copied from a previously returned X-Next-Cursor header. + Example: MTIzNA==. + first (Union[None, Unset, int]): Limits the number of results returned. + Defaults to 100. + Example: 30. + """ + + after: Union[None, Unset, str] = UNSET + first: Union[None, Unset, int] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + after: Union[None, Unset, str] + if isinstance(self.after, Unset): + after = UNSET + else: + after = self.after + + first: Union[None, Unset, int] + if isinstance(self.first, Unset): + first = UNSET + else: + first = self.first + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if after is not UNSET: + field_dict["after"] = after + if first is not UNSET: + field_dict["first"] = first + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + + def _parse_after(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + after = _parse_after(d.pop("after", UNSET)) + + def _parse_first(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + first = _parse_first(d.pop("first", UNSET)) + + get_ssh_groups_pagination_type_0 = cls( + after=after, + first=first, + ) + + get_ssh_groups_pagination_type_0.additional_properties = d + return get_ssh_groups_pagination_type_0 + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/get_ssh_host_tags_pagination_type_0.py b/smallstep/api_client/models/get_ssh_host_tags_pagination_type_0.py new file mode 100644 index 0000000..f761fb7 --- /dev/null +++ b/smallstep/api_client/models/get_ssh_host_tags_pagination_type_0.py @@ -0,0 +1,94 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="GetSshHostTagsPaginationType0") + + +@_attrs_define +class GetSshHostTagsPaginationType0: + """ + Attributes: + after (Union[None, Unset, str]): Fetch a page of results other than the first page. + Must be copied from a previously returned X-Next-Cursor header. + Example: MTIzNA==. + first (Union[None, Unset, int]): Limits the number of results returned. + Defaults to 100. + Example: 30. + """ + + after: Union[None, Unset, str] = UNSET + first: Union[None, Unset, int] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + after: Union[None, Unset, str] + if isinstance(self.after, Unset): + after = UNSET + else: + after = self.after + + first: Union[None, Unset, int] + if isinstance(self.first, Unset): + first = UNSET + else: + first = self.first + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if after is not UNSET: + field_dict["after"] = after + if first is not UNSET: + field_dict["first"] = first + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + + def _parse_after(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + after = _parse_after(d.pop("after", UNSET)) + + def _parse_first(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + first = _parse_first(d.pop("first", UNSET)) + + get_ssh_host_tags_pagination_type_0 = cls( + after=after, + first=first, + ) + + get_ssh_host_tags_pagination_type_0.additional_properties = d + return get_ssh_host_tags_pagination_type_0 + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/get_ssh_host_tags_pagination.py b/smallstep/api_client/models/get_ssh_hosts_pagination_type_0.py similarity index 50% rename from smallstep/api_client/models/get_ssh_host_tags_pagination.py rename to smallstep/api_client/models/get_ssh_hosts_pagination_type_0.py index 1215f59..0948295 100644 --- a/smallstep/api_client/models/get_ssh_host_tags_pagination.py +++ b/smallstep/api_client/models/get_ssh_hosts_pagination_type_0.py @@ -1,32 +1,41 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, Dict, List, Type, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset -T = TypeVar("T", bound="GetSshHostTagsPagination") +T = TypeVar("T", bound="GetSshHostsPaginationType0") @_attrs_define -class GetSshHostTagsPagination: +class GetSshHostsPaginationType0: """ Attributes: - after (Union[Unset, None, str]): Fetch a page of results other than the first page. + after (Union[None, Unset, str]): Fetch a page of results other than the first page. Must be copied from a previously returned X-Next-Cursor header. Example: MTIzNA==. - first (Union[Unset, None, int]): Limits the number of results returned. + first (Union[None, Unset, int]): Limits the number of results returned. Defaults to 100. Example: 30. """ - after: Union[Unset, None, str] = UNSET - first: Union[Unset, None, int] = UNSET + after: Union[None, Unset, str] = UNSET + first: Union[None, Unset, int] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - after = self.after - first = self.first + after: Union[None, Unset, str] + if isinstance(self.after, Unset): + after = UNSET + else: + after = self.after + + first: Union[None, Unset, int] + if isinstance(self.first, Unset): + first = UNSET + else: + first = self.first field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -41,17 +50,32 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - after = d.pop("after", UNSET) - first = d.pop("first", UNSET) + def _parse_after(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - get_ssh_host_tags_pagination = cls( + after = _parse_after(d.pop("after", UNSET)) + + def _parse_first(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + first = _parse_first(d.pop("first", UNSET)) + + get_ssh_hosts_pagination_type_0 = cls( after=after, first=first, ) - get_ssh_host_tags_pagination.additional_properties = d - return get_ssh_host_tags_pagination + get_ssh_hosts_pagination_type_0.additional_properties = d + return get_ssh_hosts_pagination_type_0 @property def additional_keys(self) -> List[str]: diff --git a/smallstep/api_client/models/get_ssh_users_pagination.py b/smallstep/api_client/models/get_ssh_users_pagination_type_0.py similarity index 50% rename from smallstep/api_client/models/get_ssh_users_pagination.py rename to smallstep/api_client/models/get_ssh_users_pagination_type_0.py index 684b025..dd87a18 100644 --- a/smallstep/api_client/models/get_ssh_users_pagination.py +++ b/smallstep/api_client/models/get_ssh_users_pagination_type_0.py @@ -1,32 +1,41 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, Dict, List, Type, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset -T = TypeVar("T", bound="GetSshUsersPagination") +T = TypeVar("T", bound="GetSshUsersPaginationType0") @_attrs_define -class GetSshUsersPagination: +class GetSshUsersPaginationType0: """ Attributes: - after (Union[Unset, None, str]): Fetch a page of results other than the first page. + after (Union[None, Unset, str]): Fetch a page of results other than the first page. Must be copied from a previously returned X-Next-Cursor header. Example: MTIzNA==. - first (Union[Unset, None, int]): Limits the number of results returned. + first (Union[None, Unset, int]): Limits the number of results returned. Defaults to 100. Example: 30. """ - after: Union[Unset, None, str] = UNSET - first: Union[Unset, None, int] = UNSET + after: Union[None, Unset, str] = UNSET + first: Union[None, Unset, int] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - after = self.after - first = self.first + after: Union[None, Unset, str] + if isinstance(self.after, Unset): + after = UNSET + else: + after = self.after + + first: Union[None, Unset, int] + if isinstance(self.first, Unset): + first = UNSET + else: + first = self.first field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -41,17 +50,32 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - after = d.pop("after", UNSET) - first = d.pop("first", UNSET) + def _parse_after(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - get_ssh_users_pagination = cls( + after = _parse_after(d.pop("after", UNSET)) + + def _parse_first(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + first = _parse_first(d.pop("first", UNSET)) + + get_ssh_users_pagination_type_0 = cls( after=after, first=first, ) - get_ssh_users_pagination.additional_properties = d - return get_ssh_users_pagination + get_ssh_users_pagination_type_0.additional_properties = d + return get_ssh_users_pagination_type_0 @property def additional_keys(self) -> List[str]: diff --git a/smallstep/api_client/models/google_cloud_platform.py b/smallstep/api_client/models/google_cloud_platform.py new file mode 100644 index 0000000..21a5651 --- /dev/null +++ b/smallstep/api_client/models/google_cloud_platform.py @@ -0,0 +1,91 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="GoogleCloudPlatform") + + +@_attrs_define +class GoogleCloudPlatform: + """Google Cloud Platform + + Attributes: + name (str): A friendly name for this GCP connection + project_ids (List[str]): The project IDs where the resources are located. + service_account_key (Union[Unset, str]): A JSON-formatted service account key that allows the Smallstep Platform + to manage resources on your behalf. + service_accounts (Union[Unset, List[str]]): GCE service accounts that are allowed to enroll with the Smallstep + Platform. + """ + + name: str + project_ids: List[str] + service_account_key: Union[Unset, str] = UNSET + service_accounts: Union[Unset, List[str]] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + name = self.name + + project_ids = self.project_ids + + service_account_key = self.service_account_key + + service_accounts: Union[Unset, List[str]] = UNSET + if not isinstance(self.service_accounts, Unset): + service_accounts = self.service_accounts + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "projectIds": project_ids, + } + ) + if service_account_key is not UNSET: + field_dict["serviceAccountKey"] = service_account_key + if service_accounts is not UNSET: + field_dict["serviceAccounts"] = service_accounts + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = d.pop("name") + + project_ids = cast(List[str], d.pop("projectIds")) + + service_account_key = d.pop("serviceAccountKey", UNSET) + + service_accounts = cast(List[str], d.pop("serviceAccounts", UNSET)) + + google_cloud_platform = cls( + name=name, + project_ids=project_ids, + service_account_key=service_account_key, + service_accounts=service_accounts, + ) + + google_cloud_platform.additional_properties = d + return google_cloud_platform + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/get_ssh_hosts_pagination.py b/smallstep/api_client/models/ike_v2_config.py similarity index 52% rename from smallstep/api_client/models/get_ssh_hosts_pagination.py rename to smallstep/api_client/models/ike_v2_config.py index da5fdf7..c779c3b 100644 --- a/smallstep/api_client/models/get_ssh_hosts_pagination.py +++ b/smallstep/api_client/models/ike_v2_config.py @@ -5,53 +5,59 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="GetSshHostsPagination") +T = TypeVar("T", bound="IkeV2Config") @_attrs_define -class GetSshHostsPagination: +class IkeV2Config: """ Attributes: - after (Union[Unset, None, str]): Fetch a page of results other than the first page. - Must be copied from a previously returned X-Next-Cursor header. - Example: MTIzNA==. - first (Union[Unset, None, int]): Limits the number of results returned. - Defaults to 100. - Example: 30. + ca_chain (Union[Unset, str]): + eap (Union[Unset, bool]): + remote_id (Union[Unset, str]): Typically, the common name of the remote server. Defaults to the remote address. """ - after: Union[Unset, None, str] = UNSET - first: Union[Unset, None, int] = UNSET + ca_chain: Union[Unset, str] = UNSET + eap: Union[Unset, bool] = UNSET + remote_id: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - after = self.after - first = self.first + ca_chain = self.ca_chain + + eap = self.eap + + remote_id = self.remote_id field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if after is not UNSET: - field_dict["after"] = after - if first is not UNSET: - field_dict["first"] = first + if ca_chain is not UNSET: + field_dict["caChain"] = ca_chain + if eap is not UNSET: + field_dict["eap"] = eap + if remote_id is not UNSET: + field_dict["remoteID"] = remote_id return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - after = d.pop("after", UNSET) + ca_chain = d.pop("caChain", UNSET) + + eap = d.pop("eap", UNSET) - first = d.pop("first", UNSET) + remote_id = d.pop("remoteID", UNSET) - get_ssh_hosts_pagination = cls( - after=after, - first=first, + ike_v2_config = cls( + ca_chain=ca_chain, + eap=eap, + remote_id=remote_id, ) - get_ssh_hosts_pagination.additional_properties = d - return get_ssh_hosts_pagination + ike_v2_config.additional_properties = d + return ike_v2_config @property def additional_keys(self) -> List[str]: diff --git a/smallstep/api_client/models/jwk_provisioner.py b/smallstep/api_client/models/jwk_provisioner.py index 3755fa3..3d852a6 100644 --- a/smallstep/api_client/models/jwk_provisioner.py +++ b/smallstep/api_client/models/jwk_provisioner.py @@ -24,6 +24,7 @@ class JWKProvisioner: def to_dict(self) -> Dict[str, Any]: key = self.key + encrypted_key = self.encrypted_key field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/list_accounts_pagination_type_0.py b/smallstep/api_client/models/list_accounts_pagination_type_0.py new file mode 100644 index 0000000..9e0fcca --- /dev/null +++ b/smallstep/api_client/models/list_accounts_pagination_type_0.py @@ -0,0 +1,94 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ListAccountsPaginationType0") + + +@_attrs_define +class ListAccountsPaginationType0: + """ + Attributes: + after (Union[None, Unset, str]): Fetch a page of results other than the first page. + Must be copied from a previously returned X-Next-Cursor header. + Example: MTIzNA==. + first (Union[None, Unset, int]): Limits the number of results returned. + Defaults to 100. + Example: 30. + """ + + after: Union[None, Unset, str] = UNSET + first: Union[None, Unset, int] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + after: Union[None, Unset, str] + if isinstance(self.after, Unset): + after = UNSET + else: + after = self.after + + first: Union[None, Unset, int] + if isinstance(self.first, Unset): + first = UNSET + else: + first = self.first + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if after is not UNSET: + field_dict["after"] = after + if first is not UNSET: + field_dict["first"] = first + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + + def _parse_after(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + after = _parse_after(d.pop("after", UNSET)) + + def _parse_first(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + first = _parse_first(d.pop("first", UNSET)) + + list_accounts_pagination_type_0 = cls( + after=after, + first=first, + ) + + list_accounts_pagination_type_0.additional_properties = d + return list_accounts_pagination_type_0 + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/list_agent_configurations_pagination.py b/smallstep/api_client/models/list_agent_configurations_pagination.py deleted file mode 100644 index 8bf11ae..0000000 --- a/smallstep/api_client/models/list_agent_configurations_pagination.py +++ /dev/null @@ -1,70 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ListAgentConfigurationsPagination") - - -@_attrs_define -class ListAgentConfigurationsPagination: - """ - Attributes: - after (Union[Unset, None, str]): Fetch a page of results other than the first page. - Must be copied from a previously returned X-Next-Cursor header. - Example: MTIzNA==. - first (Union[Unset, None, int]): Limits the number of results returned. - Defaults to 100. - Example: 30. - """ - - after: Union[Unset, None, str] = UNSET - first: Union[Unset, None, int] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - after = self.after - first = self.first - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if after is not UNSET: - field_dict["after"] = after - if first is not UNSET: - field_dict["first"] = first - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - after = d.pop("after", UNSET) - - first = d.pop("first", UNSET) - - list_agent_configurations_pagination = cls( - after=after, - first=first, - ) - - list_agent_configurations_pagination.additional_properties = d - return list_agent_configurations_pagination - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/smallstep/api_client/models/list_certificates_pagination_type_0.py b/smallstep/api_client/models/list_certificates_pagination_type_0.py new file mode 100644 index 0000000..ef88998 --- /dev/null +++ b/smallstep/api_client/models/list_certificates_pagination_type_0.py @@ -0,0 +1,94 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ListCertificatesPaginationType0") + + +@_attrs_define +class ListCertificatesPaginationType0: + """ + Attributes: + after (Union[None, Unset, str]): Fetch a page of results other than the first page. + Must be copied from a previously returned X-Next-Cursor header. + Example: MTIzNA==. + first (Union[None, Unset, int]): Limits the number of results returned. + Defaults to 100. + Example: 30. + """ + + after: Union[None, Unset, str] = UNSET + first: Union[None, Unset, int] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + after: Union[None, Unset, str] + if isinstance(self.after, Unset): + after = UNSET + else: + after = self.after + + first: Union[None, Unset, int] + if isinstance(self.first, Unset): + first = UNSET + else: + first = self.first + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if after is not UNSET: + field_dict["after"] = after + if first is not UNSET: + field_dict["first"] = first + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + + def _parse_after(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + after = _parse_after(d.pop("after", UNSET)) + + def _parse_first(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + first = _parse_first(d.pop("first", UNSET)) + + list_certificates_pagination_type_0 = cls( + after=after, + first=first, + ) + + list_certificates_pagination_type_0.additional_properties = d + return list_certificates_pagination_type_0 + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/list_collection_instances_pagination.py b/smallstep/api_client/models/list_collection_instances_pagination.py deleted file mode 100644 index c34807d..0000000 --- a/smallstep/api_client/models/list_collection_instances_pagination.py +++ /dev/null @@ -1,70 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ListCollectionInstancesPagination") - - -@_attrs_define -class ListCollectionInstancesPagination: - """ - Attributes: - after (Union[Unset, None, str]): Fetch a page of results other than the first page. - Must be copied from a previously returned X-Next-Cursor header. - Example: MTIzNA==. - first (Union[Unset, None, int]): Limits the number of results returned. - Defaults to 100. - Example: 30. - """ - - after: Union[Unset, None, str] = UNSET - first: Union[Unset, None, int] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - after = self.after - first = self.first - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if after is not UNSET: - field_dict["after"] = after - if first is not UNSET: - field_dict["first"] = first - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - after = d.pop("after", UNSET) - - first = d.pop("first", UNSET) - - list_collection_instances_pagination = cls( - after=after, - first=first, - ) - - list_collection_instances_pagination.additional_properties = d - return list_collection_instances_pagination - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/smallstep/api_client/models/list_collection_instances_pagination_type_0.py b/smallstep/api_client/models/list_collection_instances_pagination_type_0.py new file mode 100644 index 0000000..82bfc4d --- /dev/null +++ b/smallstep/api_client/models/list_collection_instances_pagination_type_0.py @@ -0,0 +1,94 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ListCollectionInstancesPaginationType0") + + +@_attrs_define +class ListCollectionInstancesPaginationType0: + """ + Attributes: + after (Union[None, Unset, str]): Fetch a page of results other than the first page. + Must be copied from a previously returned X-Next-Cursor header. + Example: MTIzNA==. + first (Union[None, Unset, int]): Limits the number of results returned. + Defaults to 100. + Example: 30. + """ + + after: Union[None, Unset, str] = UNSET + first: Union[None, Unset, int] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + after: Union[None, Unset, str] + if isinstance(self.after, Unset): + after = UNSET + else: + after = self.after + + first: Union[None, Unset, int] + if isinstance(self.first, Unset): + first = UNSET + else: + first = self.first + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if after is not UNSET: + field_dict["after"] = after + if first is not UNSET: + field_dict["first"] = first + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + + def _parse_after(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + after = _parse_after(d.pop("after", UNSET)) + + def _parse_first(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + first = _parse_first(d.pop("first", UNSET)) + + list_collection_instances_pagination_type_0 = cls( + after=after, + first=first, + ) + + list_collection_instances_pagination_type_0.additional_properties = d + return list_collection_instances_pagination_type_0 + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/list_collections_pagination.py b/smallstep/api_client/models/list_collections_pagination.py deleted file mode 100644 index e21cf19..0000000 --- a/smallstep/api_client/models/list_collections_pagination.py +++ /dev/null @@ -1,70 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ListCollectionsPagination") - - -@_attrs_define -class ListCollectionsPagination: - """ - Attributes: - after (Union[Unset, None, str]): Fetch a page of results other than the first page. - Must be copied from a previously returned X-Next-Cursor header. - Example: MTIzNA==. - first (Union[Unset, None, int]): Limits the number of results returned. - Defaults to 100. - Example: 30. - """ - - after: Union[Unset, None, str] = UNSET - first: Union[Unset, None, int] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - after = self.after - first = self.first - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if after is not UNSET: - field_dict["after"] = after - if first is not UNSET: - field_dict["first"] = first - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - after = d.pop("after", UNSET) - - first = d.pop("first", UNSET) - - list_collections_pagination = cls( - after=after, - first=first, - ) - - list_collections_pagination.additional_properties = d - return list_collections_pagination - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/smallstep/api_client/models/list_collections_pagination_type_0.py b/smallstep/api_client/models/list_collections_pagination_type_0.py new file mode 100644 index 0000000..8b9d967 --- /dev/null +++ b/smallstep/api_client/models/list_collections_pagination_type_0.py @@ -0,0 +1,94 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ListCollectionsPaginationType0") + + +@_attrs_define +class ListCollectionsPaginationType0: + """ + Attributes: + after (Union[None, Unset, str]): Fetch a page of results other than the first page. + Must be copied from a previously returned X-Next-Cursor header. + Example: MTIzNA==. + first (Union[None, Unset, int]): Limits the number of results returned. + Defaults to 100. + Example: 30. + """ + + after: Union[None, Unset, str] = UNSET + first: Union[None, Unset, int] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + after: Union[None, Unset, str] + if isinstance(self.after, Unset): + after = UNSET + else: + after = self.after + + first: Union[None, Unset, int] + if isinstance(self.first, Unset): + first = UNSET + else: + first = self.first + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if after is not UNSET: + field_dict["after"] = after + if first is not UNSET: + field_dict["first"] = first + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + + def _parse_after(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + after = _parse_after(d.pop("after", UNSET)) + + def _parse_first(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + first = _parse_first(d.pop("first", UNSET)) + + list_collections_pagination_type_0 = cls( + after=after, + first=first, + ) + + list_collections_pagination_type_0.additional_properties = d + return list_collections_pagination_type_0 + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/list_endpoint_configurations_pagination.py b/smallstep/api_client/models/list_endpoint_configurations_pagination.py deleted file mode 100644 index a0ca7b9..0000000 --- a/smallstep/api_client/models/list_endpoint_configurations_pagination.py +++ /dev/null @@ -1,70 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ListEndpointConfigurationsPagination") - - -@_attrs_define -class ListEndpointConfigurationsPagination: - """ - Attributes: - after (Union[Unset, None, str]): Fetch a page of results other than the first page. - Must be copied from a previously returned X-Next-Cursor header. - Example: MTIzNA==. - first (Union[Unset, None, int]): Limits the number of results returned. - Defaults to 100. - Example: 30. - """ - - after: Union[Unset, None, str] = UNSET - first: Union[Unset, None, int] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - after = self.after - first = self.first - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if after is not UNSET: - field_dict["after"] = after - if first is not UNSET: - field_dict["first"] = first - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - after = d.pop("after", UNSET) - - first = d.pop("first", UNSET) - - list_endpoint_configurations_pagination = cls( - after=after, - first=first, - ) - - list_endpoint_configurations_pagination.additional_properties = d - return list_endpoint_configurations_pagination - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/smallstep/api_client/models/list_managed_configurations_pagination.py b/smallstep/api_client/models/list_managed_configurations_pagination.py deleted file mode 100644 index c1391a2..0000000 --- a/smallstep/api_client/models/list_managed_configurations_pagination.py +++ /dev/null @@ -1,70 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ListManagedConfigurationsPagination") - - -@_attrs_define -class ListManagedConfigurationsPagination: - """ - Attributes: - after (Union[Unset, None, str]): Fetch a page of results other than the first page. - Must be copied from a previously returned X-Next-Cursor header. - Example: MTIzNA==. - first (Union[Unset, None, int]): Limits the number of results returned. - Defaults to 100. - Example: 30. - """ - - after: Union[Unset, None, str] = UNSET - first: Union[Unset, None, int] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - after = self.after - first = self.first - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if after is not UNSET: - field_dict["after"] = after - if first is not UNSET: - field_dict["first"] = first - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - after = d.pop("after", UNSET) - - first = d.pop("first", UNSET) - - list_managed_configurations_pagination = cls( - after=after, - first=first, - ) - - list_managed_configurations_pagination.additional_properties = d - return list_managed_configurations_pagination - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/smallstep/api_client/models/managed_configuration.py b/smallstep/api_client/models/managed_configuration.py deleted file mode 100644 index 721f292..0000000 --- a/smallstep/api_client/models/managed_configuration.py +++ /dev/null @@ -1,117 +0,0 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.managed_endpoint import ManagedEndpoint - - -T = TypeVar("T", bound="ManagedConfiguration") - - -@_attrs_define -class ManagedConfiguration: - """The agent and managed endpoints used in one host. This object is experimental and subject to change. - - Example: - {'agentConfigurationID': '12d6f7a3-2096-4ed6-b4e7-53e7f925facd', 'hostID': - '8d996786-29c8-4fcd-999a-4a625be60616', 'id': 'aad6ad55-866b-4988-a51e-58a7225db66c', 'managedEndpoints': - [{'endpointConfigurationID': '3b872b88-bb2f-4575-b3fe-69cf92ae57f6', 'id': - '5bad10b3-32fe-44da-b516-aef568790e66', 'x509CertificateData': {'commonName': 'db', 'sans': ['db', - 'db.internal']}}, {'endpointConfigurationID': '1f42f5fe-eda0-4300-bb7f-462afe483ae1', 'id': - '99e45a28-36b9-4dd0-ac57-2d43aac9f36e', 'sshCertificateData': {'keyID': 'abc123', 'principals': ['ops', - 'eng']}}], 'name': 'My Server'} - - Attributes: - agent_configuration_id (str): UUID identifying the agent configuration. - managed_endpoints (List['ManagedEndpoint']): The list of endpoints managed by this configuration. - name (str): The name of this managed configuration. - host_id (Union[Unset, str]): UUID identifying the host this managed configuration is for. Will be generated on - server-side if not provided. - id (Union[Unset, str]): UUID identifying this managed configuration. Read only. - """ - - agent_configuration_id: str - managed_endpoints: List["ManagedEndpoint"] - name: str - host_id: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - agent_configuration_id = self.agent_configuration_id - managed_endpoints = [] - for managed_endpoints_item_data in self.managed_endpoints: - managed_endpoints_item = managed_endpoints_item_data.to_dict() - - managed_endpoints.append(managed_endpoints_item) - - name = self.name - host_id = self.host_id - id = self.id - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agentConfigurationID": agent_configuration_id, - "managedEndpoints": managed_endpoints, - "name": name, - } - ) - if host_id is not UNSET: - field_dict["hostID"] = host_id - if id is not UNSET: - field_dict["id"] = id - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.managed_endpoint import ManagedEndpoint - - d = src_dict.copy() - agent_configuration_id = d.pop("agentConfigurationID") - - managed_endpoints = [] - _managed_endpoints = d.pop("managedEndpoints") - for managed_endpoints_item_data in _managed_endpoints: - managed_endpoints_item = ManagedEndpoint.from_dict(managed_endpoints_item_data) - - managed_endpoints.append(managed_endpoints_item) - - name = d.pop("name") - - host_id = d.pop("hostID", UNSET) - - id = d.pop("id", UNSET) - - managed_configuration = cls( - agent_configuration_id=agent_configuration_id, - managed_endpoints=managed_endpoints, - name=name, - host_id=host_id, - id=id, - ) - - managed_configuration.additional_properties = d - return managed_configuration - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/smallstep/api_client/models/managed_endpoint.py b/smallstep/api_client/models/managed_endpoint.py deleted file mode 100644 index 9f6ee15..0000000 --- a/smallstep/api_client/models/managed_endpoint.py +++ /dev/null @@ -1,112 +0,0 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.ssh_certificate_data import SSHCertificateData - from ..models.x509_certificate_data import X509CertificateData - - -T = TypeVar("T", bound="ManagedEndpoint") - - -@_attrs_define -class ManagedEndpoint: - """All the information used by an agent to grant a certificate to an endpoint. Exactly one of `x509CertificateData` or - `sshCertificateData` must be set and must match the endpoint configuration certificate info type. This object is - experimental and subject to change. - - Attributes: - endpoint_configuration_id (str): UUID identifying the endpoint configuration. - id (Union[Unset, str]): UUID identifying this managed endpoint. Read only. - ssh_certificate_data (Union[Unset, SSHCertificateData]): Contains the information to include when granting an - SSH certificate to a managed endpoint. Example: {'keyID': 'abc123', 'principals': ['ops', 'eng']}. - x_509_certificate_data (Union[Unset, X509CertificateData]): Contains the information to include when granting an - x509 certificate to a managed endpoint. Example: {'commonName': 'db', 'sans': ['db', 'db.internal']}. - """ - - endpoint_configuration_id: str - id: Union[Unset, str] = UNSET - ssh_certificate_data: Union[Unset, "SSHCertificateData"] = UNSET - x_509_certificate_data: Union[Unset, "X509CertificateData"] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - endpoint_configuration_id = self.endpoint_configuration_id - id = self.id - ssh_certificate_data: Union[Unset, Dict[str, Any]] = UNSET - if not isinstance(self.ssh_certificate_data, Unset): - ssh_certificate_data = self.ssh_certificate_data.to_dict() - - x_509_certificate_data: Union[Unset, Dict[str, Any]] = UNSET - if not isinstance(self.x_509_certificate_data, Unset): - x_509_certificate_data = self.x_509_certificate_data.to_dict() - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "endpointConfigurationID": endpoint_configuration_id, - } - ) - if id is not UNSET: - field_dict["id"] = id - if ssh_certificate_data is not UNSET: - field_dict["sshCertificateData"] = ssh_certificate_data - if x_509_certificate_data is not UNSET: - field_dict["x509CertificateData"] = x_509_certificate_data - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.ssh_certificate_data import SSHCertificateData - from ..models.x509_certificate_data import X509CertificateData - - d = src_dict.copy() - endpoint_configuration_id = d.pop("endpointConfigurationID") - - id = d.pop("id", UNSET) - - _ssh_certificate_data = d.pop("sshCertificateData", UNSET) - ssh_certificate_data: Union[Unset, SSHCertificateData] - if isinstance(_ssh_certificate_data, Unset): - ssh_certificate_data = UNSET - else: - ssh_certificate_data = SSHCertificateData.from_dict(_ssh_certificate_data) - - _x_509_certificate_data = d.pop("x509CertificateData", UNSET) - x_509_certificate_data: Union[Unset, X509CertificateData] - if isinstance(_x_509_certificate_data, Unset): - x_509_certificate_data = UNSET - else: - x_509_certificate_data = X509CertificateData.from_dict(_x_509_certificate_data) - - managed_endpoint = cls( - endpoint_configuration_id=endpoint_configuration_id, - id=id, - ssh_certificate_data=ssh_certificate_data, - x_509_certificate_data=x_509_certificate_data, - ) - - managed_endpoint.additional_properties = d - return managed_endpoint - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/smallstep/api_client/models/managed_endpoint_certificate_info.py b/smallstep/api_client/models/managed_endpoint_certificate_info.py index f628898..b2c2576 100644 --- a/smallstep/api_client/models/managed_endpoint_certificate_info.py +++ b/smallstep/api_client/models/managed_endpoint_certificate_info.py @@ -43,11 +43,17 @@ def to_dict(self) -> Dict[str, Any]: type = self.type.value crt_file = self.crt_file + duration = self.duration + gid = self.gid + key_file = self.key_file + mode = self.mode + root_file = self.root_file + uid = self.uid field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/managed_endpoint_key_info.py b/smallstep/api_client/models/managed_endpoint_key_info.py index a761157..787cac7 100644 --- a/smallstep/api_client/models/managed_endpoint_key_info.py +++ b/smallstep/api_client/models/managed_endpoint_key_info.py @@ -4,6 +4,7 @@ from attrs import field as _attrs_field from ..models.managed_endpoint_key_info_format import ManagedEndpointKeyInfoFormat +from ..models.managed_endpoint_key_info_protection import ManagedEndpointKeyInfoProtection from ..models.managed_endpoint_key_info_type import ManagedEndpointKeyInfoType from ..types import UNSET, Unset @@ -15,17 +16,23 @@ class ManagedEndpointKeyInfo: """The attributes of the cryptographic key. Example: - {'format': 'DER', 'pubFile': '/etc/db.csr', 'type': 'ECDSA_P256'} + {'format': 'PKCS8', 'protection': 'NONE', 'pubFile': '/etc/db.csr', 'type': 'ECDSA_P256'} Attributes: format_ (Union[Unset, ManagedEndpointKeyInfoFormat]): The format used to encode the private key. For X509 keys - the default format is SEC 1 for ECDSA keys, PKCS#1 for RSA keys and PKCS#8 for ED25519 keys. For SSH keys the - default format is always the OPENSSH format. + the default format is PKCS#8. The classic format is PKCS#1 for RSA keys, SEC 1 for ECDSA keys, and PKCS#8 for + ED25519 keys. For SSH keys the default format is always the OPENSSH format. When a hardware module is used to + store the keys the default will be a JSON representation of the key, except on Linux where tss2 will be used. + protection (Union[Unset, ManagedEndpointKeyInfoProtection]): Whether to use a hardware module to store the + private key for a workload certificate. If set to `NONE` no hardware module will be used. If set to `DEFAULT` a + hardware module will only be used with format `TSS2`. `HARDWARE_WITH_FALLBACK` can only be used with the key + format `DEFAULT`. pub_file (Union[Unset, str]): A CSR or SSH public key to use instead of generating one. type (Union[Unset, ManagedEndpointKeyInfoType]): The key type used. The current DEFAULT type is ECDSA_P256. """ format_: Union[Unset, ManagedEndpointKeyInfoFormat] = UNSET + protection: Union[Unset, ManagedEndpointKeyInfoProtection] = UNSET pub_file: Union[Unset, str] = UNSET type: Union[Unset, ManagedEndpointKeyInfoType] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -35,7 +42,12 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.format_, Unset): format_ = self.format_.value + protection: Union[Unset, str] = UNSET + if not isinstance(self.protection, Unset): + protection = self.protection.value + pub_file = self.pub_file + type: Union[Unset, str] = UNSET if not isinstance(self.type, Unset): type = self.type.value @@ -45,6 +57,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update({}) if format_ is not UNSET: field_dict["format"] = format_ + if protection is not UNSET: + field_dict["protection"] = protection if pub_file is not UNSET: field_dict["pubFile"] = pub_file if type is not UNSET: @@ -62,6 +76,13 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: format_ = ManagedEndpointKeyInfoFormat(_format_) + _protection = d.pop("protection", UNSET) + protection: Union[Unset, ManagedEndpointKeyInfoProtection] + if isinstance(_protection, Unset): + protection = UNSET + else: + protection = ManagedEndpointKeyInfoProtection(_protection) + pub_file = d.pop("pubFile", UNSET) _type = d.pop("type", UNSET) @@ -73,6 +94,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: managed_endpoint_key_info = cls( format_=format_, + protection=protection, pub_file=pub_file, type=type, ) diff --git a/smallstep/api_client/models/managed_endpoint_key_info_format.py b/smallstep/api_client/models/managed_endpoint_key_info_format.py index 592637c..deb1c45 100644 --- a/smallstep/api_client/models/managed_endpoint_key_info_format.py +++ b/smallstep/api_client/models/managed_endpoint_key_info_format.py @@ -2,10 +2,11 @@ class ManagedEndpointKeyInfoFormat(str, Enum): + CLASSIC = "CLASSIC" DEFAULT = "DEFAULT" - DER = "DER" OPENSSH = "OPENSSH" PKCS8 = "PKCS8" + TSS2 = "TSS2" def __str__(self) -> str: return str(self.value) diff --git a/smallstep/api_client/models/managed_endpoint_key_info_protection.py b/smallstep/api_client/models/managed_endpoint_key_info_protection.py new file mode 100644 index 0000000..c2b5e0b --- /dev/null +++ b/smallstep/api_client/models/managed_endpoint_key_info_protection.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class ManagedEndpointKeyInfoProtection(str, Enum): + DEFAULT = "DEFAULT" + HARDWARE = "HARDWARE" + HARDWARE_ATTESTED = "HARDWARE_ATTESTED" + HARDWARE_WITH_FALLBACK = "HARDWARE_WITH_FALLBACK" + NONE = "NONE" + + def __str__(self) -> str: + return str(self.value) diff --git a/smallstep/api_client/models/managed_endpoint_reload_info.py b/smallstep/api_client/models/managed_endpoint_reload_info.py index 92caff7..0231fa4 100644 --- a/smallstep/api_client/models/managed_endpoint_reload_info.py +++ b/smallstep/api_client/models/managed_endpoint_reload_info.py @@ -21,7 +21,7 @@ class ManagedEndpointReloadInfo: process is able to detect and reload new certificates automatically. `CUSTOM` means a custom command must be run to trigger the workload to reload the certificates. `SIGNAL` will configure the agent to send a signal to the process in `pidFile`. `DBUS` will use the systemd system bus to issue a `try-reload-or-restart` job for unit - specified by `unitName`. + specified by `unitName`. `PLATFORM` uses a method specific to the operating system. pid_file (Union[Unset, str]): File that holds the pid of the process to signal. Required when method is SIGNAL. signal (Union[Unset, int]): The signal to send to a process when a certificate should be reloaded. Required when method is SIGNAL. @@ -39,7 +39,9 @@ def to_dict(self) -> Dict[str, Any]: method = self.method.value pid_file = self.pid_file + signal = self.signal + unit_name = self.unit_name field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/managed_endpoint_reload_info_method.py b/smallstep/api_client/models/managed_endpoint_reload_info_method.py index 582c329..c79324b 100644 --- a/smallstep/api_client/models/managed_endpoint_reload_info_method.py +++ b/smallstep/api_client/models/managed_endpoint_reload_info_method.py @@ -5,6 +5,7 @@ class ManagedEndpointReloadInfoMethod(str, Enum): AUTOMATIC = "AUTOMATIC" CUSTOM = "CUSTOM" DBUS = "DBUS" + PLATFORM = "PLATFORM" SIGNAL = "SIGNAL" def __str__(self) -> str: diff --git a/smallstep/api_client/models/microsoft_azure_platform.py b/smallstep/api_client/models/microsoft_azure_platform.py new file mode 100644 index 0000000..cc518ba --- /dev/null +++ b/smallstep/api_client/models/microsoft_azure_platform.py @@ -0,0 +1,97 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MicrosoftAzurePlatform") + + +@_attrs_define +class MicrosoftAzurePlatform: + """Microsoft Azure + + Attributes: + name (str): A friendly name for this Azure connection + resource_groups (List[str]): A list of resource groups that are allowed to enroll with the Smallstep Platform. + tenant_id (str): The Azure Entra tenant ID + client_id (Union[Unset, str]): The client ID of an Azure Service Principal that allows the Smallstep Platform to + manage resources on your behalf. + client_secret (Union[Unset, str]): The client secret of an Azure Service Principal that allows the Smallstep + Platform to manage resources on your behalf. + """ + + name: str + resource_groups: List[str] + tenant_id: str + client_id: Union[Unset, str] = UNSET + client_secret: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + name = self.name + + resource_groups = self.resource_groups + + tenant_id = self.tenant_id + + client_id = self.client_id + + client_secret = self.client_secret + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "resourceGroups": resource_groups, + "tenantId": tenant_id, + } + ) + if client_id is not UNSET: + field_dict["clientId"] = client_id + if client_secret is not UNSET: + field_dict["clientSecret"] = client_secret + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = d.pop("name") + + resource_groups = cast(List[str], d.pop("resourceGroups")) + + tenant_id = d.pop("tenantId") + + client_id = d.pop("clientId", UNSET) + + client_secret = d.pop("clientSecret", UNSET) + + microsoft_azure_platform = cls( + name=name, + resource_groups=resource_groups, + tenant_id=tenant_id, + client_id=client_id, + client_secret=client_secret, + ) + + microsoft_azure_platform.additional_properties = d + return microsoft_azure_platform + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/name_constraints.py b/smallstep/api_client/models/name_constraints.py index 72ec2a4..6dca82b 100644 --- a/smallstep/api_client/models/name_constraints.py +++ b/smallstep/api_client/models/name_constraints.py @@ -10,7 +10,7 @@ @_attrs_define class NameConstraints: - """X509 certificate name constratins. + """X509 certificate name constraints. Attributes: critical (Union[Unset, bool]): Whether or not name constraints are marked critical. @@ -37,6 +37,7 @@ class NameConstraints: def to_dict(self) -> Dict[str, Any]: critical = self.critical + excluded_dns_domains: Union[Unset, List[str]] = UNSET if not isinstance(self.excluded_dns_domains, Unset): excluded_dns_domains = self.excluded_dns_domains diff --git a/smallstep/api_client/models/new_authority_csr.py b/smallstep/api_client/models/new_authority_csr.py index 9cf3336..5b5c41a 100644 --- a/smallstep/api_client/models/new_authority_csr.py +++ b/smallstep/api_client/models/new_authority_csr.py @@ -33,7 +33,9 @@ def to_dict(self) -> Dict[str, Any]: intermediate_issuer = self.intermediate_issuer.to_dict() name = self.name + subdomain = self.subdomain + active_revocation = self.active_revocation field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/new_collection.py b/smallstep/api_client/models/new_collection.py index 899b034..5927019 100644 --- a/smallstep/api_client/models/new_collection.py +++ b/smallstep/api_client/models/new_collection.py @@ -28,7 +28,9 @@ class NewCollection: def to_dict(self) -> Dict[str, Any]: slug = self.slug + display_name = self.display_name + schema_uri = self.schema_uri field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/new_hosted_authority.py b/smallstep/api_client/models/new_hosted_authority.py index f29f956..88a65db 100644 --- a/smallstep/api_client/models/new_hosted_authority.py +++ b/smallstep/api_client/models/new_hosted_authority.py @@ -40,10 +40,13 @@ def to_dict(self) -> Dict[str, Any]: admin_emails = self.admin_emails name = self.name + subdomain = self.subdomain + type = self.type.value active_revocation = self.active_revocation + intermediate_issuer: Union[Unset, Dict[str, Any]] = UNSET if not isinstance(self.intermediate_issuer, Unset): intermediate_issuer = self.intermediate_issuer.to_dict() diff --git a/smallstep/api_client/models/new_platform.py b/smallstep/api_client/models/new_platform.py new file mode 100644 index 0000000..0ee49e2 --- /dev/null +++ b/smallstep/api_client/models/new_platform.py @@ -0,0 +1,130 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.new_platform_platform_type import NewPlatformPlatformType + +if TYPE_CHECKING: + from ..models.amazon_web_services import AmazonWebServices + from ..models.google_cloud_platform import GoogleCloudPlatform + from ..models.microsoft_azure_platform import MicrosoftAzurePlatform + + +T = TypeVar("T", bound="NewPlatform") + + +@_attrs_define +class NewPlatform: + """Configuration to create a new platform. + + Attributes: + display_name (str): + platform_configuration (Union['AmazonWebServices', 'GoogleCloudPlatform', 'MicrosoftAzurePlatform']): + platform_type (NewPlatformPlatformType): Determines which set of fields to use in platformConfiguration. Cannot + be changed. + slug (str): + """ + + display_name: str + platform_configuration: Union["AmazonWebServices", "GoogleCloudPlatform", "MicrosoftAzurePlatform"] + platform_type: NewPlatformPlatformType + slug: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + from ..models.amazon_web_services import AmazonWebServices + from ..models.microsoft_azure_platform import MicrosoftAzurePlatform + + display_name = self.display_name + + platform_configuration: Dict[str, Any] + if isinstance(self.platform_configuration, AmazonWebServices): + platform_configuration = self.platform_configuration.to_dict() + elif isinstance(self.platform_configuration, MicrosoftAzurePlatform): + platform_configuration = self.platform_configuration.to_dict() + else: + platform_configuration = self.platform_configuration.to_dict() + + platform_type = self.platform_type.value + + slug = self.slug + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "displayName": display_name, + "platformConfiguration": platform_configuration, + "platformType": platform_type, + "slug": slug, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.amazon_web_services import AmazonWebServices + from ..models.google_cloud_platform import GoogleCloudPlatform + from ..models.microsoft_azure_platform import MicrosoftAzurePlatform + + d = src_dict.copy() + display_name = d.pop("displayName") + + def _parse_platform_configuration( + data: object, + ) -> Union["AmazonWebServices", "GoogleCloudPlatform", "MicrosoftAzurePlatform"]: + try: + if not isinstance(data, dict): + raise TypeError() + platform_configuration_type_0 = AmazonWebServices.from_dict(data) + + return platform_configuration_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + platform_configuration_type_1 = MicrosoftAzurePlatform.from_dict(data) + + return platform_configuration_type_1 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + platform_configuration_type_2 = GoogleCloudPlatform.from_dict(data) + + return platform_configuration_type_2 + + platform_configuration = _parse_platform_configuration(d.pop("platformConfiguration")) + + platform_type = NewPlatformPlatformType(d.pop("platformType")) + + slug = d.pop("slug") + + new_platform = cls( + display_name=display_name, + platform_configuration=platform_configuration, + platform_type=platform_type, + slug=slug, + ) + + new_platform.additional_properties = d + return new_platform + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/new_platform_platform_type.py b/smallstep/api_client/models/new_platform_platform_type.py new file mode 100644 index 0000000..b05b804 --- /dev/null +++ b/smallstep/api_client/models/new_platform_platform_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class NewPlatformPlatformType(str, Enum): + AWS = "aws" + AZURE = "azure" + GCP = "gcp" + + def __str__(self) -> str: + return str(self.value) diff --git a/smallstep/api_client/models/new_ssh_grant.py b/smallstep/api_client/models/new_ssh_grant.py index 231438e..4af4917 100644 --- a/smallstep/api_client/models/new_ssh_grant.py +++ b/smallstep/api_client/models/new_ssh_grant.py @@ -27,8 +27,11 @@ class NewSSHGrant: def to_dict(self) -> Dict[str, Any]: group_id = self.group_id + name = self.name + sudo = self.sudo + value = self.value field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/new_ssh_host_tag.py b/smallstep/api_client/models/new_ssh_host_tag.py index c461755..182f81d 100644 --- a/smallstep/api_client/models/new_ssh_host_tag.py +++ b/smallstep/api_client/models/new_ssh_host_tag.py @@ -23,6 +23,7 @@ class NewSSHHostTag: def to_dict(self) -> Dict[str, Any]: name = self.name + value = self.value field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/oidc_provisioner.py b/smallstep/api_client/models/oidc_provisioner.py index 4a3b293..1855f4a 100644 --- a/smallstep/api_client/models/oidc_provisioner.py +++ b/smallstep/api_client/models/oidc_provisioner.py @@ -42,8 +42,11 @@ class OIDCProvisioner: def to_dict(self) -> Dict[str, Any]: client_id = self.client_id + client_secret = self.client_secret + configuration_endpoint = self.configuration_endpoint + admins: Union[Unset, List[str]] = UNSET if not isinstance(self.admins, Unset): admins = self.admins @@ -57,6 +60,7 @@ def to_dict(self) -> Dict[str, Any]: groups = self.groups listen_address = self.listen_address + tenant_id = self.tenant_id field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/platform.py b/smallstep/api_client/models/platform.py new file mode 100644 index 0000000..a4f8e0b --- /dev/null +++ b/smallstep/api_client/models/platform.py @@ -0,0 +1,139 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.platform_platform_type import PlatformPlatformType + +if TYPE_CHECKING: + from ..models.amazon_web_services import AmazonWebServices + from ..models.google_cloud_platform import GoogleCloudPlatform + from ..models.microsoft_azure_platform import MicrosoftAzurePlatform + + +T = TypeVar("T", bound="Platform") + + +@_attrs_define +class Platform: + """A platform with a list of configurations. + + Attributes: + display_name (str): + platform_configurations (List[Union['AmazonWebServices', 'GoogleCloudPlatform', 'MicrosoftAzurePlatform']]): + platform_type (PlatformPlatformType): The type used in platformConfiguration. + slug (str): + """ + + display_name: str + platform_configurations: List[Union["AmazonWebServices", "GoogleCloudPlatform", "MicrosoftAzurePlatform"]] + platform_type: PlatformPlatformType + slug: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + from ..models.amazon_web_services import AmazonWebServices + from ..models.microsoft_azure_platform import MicrosoftAzurePlatform + + display_name = self.display_name + + platform_configurations = [] + for platform_configurations_item_data in self.platform_configurations: + platform_configurations_item: Dict[str, Any] + if isinstance(platform_configurations_item_data, AmazonWebServices): + platform_configurations_item = platform_configurations_item_data.to_dict() + elif isinstance(platform_configurations_item_data, MicrosoftAzurePlatform): + platform_configurations_item = platform_configurations_item_data.to_dict() + else: + platform_configurations_item = platform_configurations_item_data.to_dict() + + platform_configurations.append(platform_configurations_item) + + platform_type = self.platform_type.value + + slug = self.slug + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "displayName": display_name, + "platformConfigurations": platform_configurations, + "platformType": platform_type, + "slug": slug, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.amazon_web_services import AmazonWebServices + from ..models.google_cloud_platform import GoogleCloudPlatform + from ..models.microsoft_azure_platform import MicrosoftAzurePlatform + + d = src_dict.copy() + display_name = d.pop("displayName") + + platform_configurations = [] + _platform_configurations = d.pop("platformConfigurations") + for platform_configurations_item_data in _platform_configurations: + + def _parse_platform_configurations_item( + data: object, + ) -> Union["AmazonWebServices", "GoogleCloudPlatform", "MicrosoftAzurePlatform"]: + try: + if not isinstance(data, dict): + raise TypeError() + platform_configurations_item_type_0 = AmazonWebServices.from_dict(data) + + return platform_configurations_item_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + platform_configurations_item_type_1 = MicrosoftAzurePlatform.from_dict(data) + + return platform_configurations_item_type_1 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + platform_configurations_item_type_2 = GoogleCloudPlatform.from_dict(data) + + return platform_configurations_item_type_2 + + platform_configurations_item = _parse_platform_configurations_item(platform_configurations_item_data) + + platform_configurations.append(platform_configurations_item) + + platform_type = PlatformPlatformType(d.pop("platformType")) + + slug = d.pop("slug") + + platform = cls( + display_name=display_name, + platform_configurations=platform_configurations, + platform_type=platform_type, + slug=slug, + ) + + platform.additional_properties = d + return platform + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/platform_platform_type.py b/smallstep/api_client/models/platform_platform_type.py new file mode 100644 index 0000000..5479da3 --- /dev/null +++ b/smallstep/api_client/models/platform_platform_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class PlatformPlatformType(str, Enum): + AWS = "aws" + AZURE = "azure" + GCP = "gcp" + + def __str__(self) -> str: + return str(self.value) diff --git a/smallstep/api_client/models/posix_group.py b/smallstep/api_client/models/posix_group.py index fbb2dac..50926cd 100644 --- a/smallstep/api_client/models/posix_group.py +++ b/smallstep/api_client/models/posix_group.py @@ -32,8 +32,11 @@ class POSIXGroup: def to_dict(self) -> Dict[str, Any]: gid = self.gid + id = self.id + managed = self.managed + name = self.name field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/posix_user.py b/smallstep/api_client/models/posix_user.py index fbc044a..46d62e0 100644 --- a/smallstep/api_client/models/posix_user.py +++ b/smallstep/api_client/models/posix_user.py @@ -30,9 +30,13 @@ class POSIXUser: def to_dict(self) -> Dict[str, Any]: gid = self.gid + home_dir = self.home_dir + shell = self.shell + uid = self.uid + username = self.username field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/post_auth_json_body.py b/smallstep/api_client/models/post_auth_body.py similarity index 84% rename from smallstep/api_client/models/post_auth_json_body.py rename to smallstep/api_client/models/post_auth_body.py index a19e3c1..abab0f6 100644 --- a/smallstep/api_client/models/post_auth_json_body.py +++ b/smallstep/api_client/models/post_auth_body.py @@ -4,23 +4,23 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..models.post_auth_json_body_audience import PostAuthJsonBodyAudience +from ..models.post_auth_body_audience import PostAuthBodyAudience from ..types import UNSET, File, FileJsonType, Unset -T = TypeVar("T", bound="PostAuthJsonBody") +T = TypeVar("T", bound="PostAuthBody") @_attrs_define -class PostAuthJsonBody: +class PostAuthBody: """ Attributes: - audience (Union[Unset, PostAuthJsonBodyAudience]): + audience (Union[Unset, PostAuthBodyAudience]): bundle (Union[Unset, List[File]]): team_id (Union[Unset, str]): team_slug (Union[Unset, str]): """ - audience: Union[Unset, PostAuthJsonBodyAudience] = UNSET + audience: Union[Unset, PostAuthBodyAudience] = UNSET bundle: Union[Unset, List[File]] = UNSET team_id: Union[Unset, str] = UNSET team_slug: Union[Unset, str] = UNSET @@ -40,6 +40,7 @@ def to_dict(self) -> Dict[str, Any]: bundle.append(bundle_item) team_id = self.team_id + team_slug = self.team_slug field_dict: Dict[str, Any] = {} @@ -60,11 +61,11 @@ def to_dict(self) -> Dict[str, Any]: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() _audience = d.pop("audience", UNSET) - audience: Union[Unset, PostAuthJsonBodyAudience] + audience: Union[Unset, PostAuthBodyAudience] if isinstance(_audience, Unset): audience = UNSET else: - audience = PostAuthJsonBodyAudience(_audience) + audience = PostAuthBodyAudience(_audience) bundle = [] _bundle = d.pop("bundle", UNSET) @@ -77,15 +78,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: team_slug = d.pop("teamSlug", UNSET) - post_auth_json_body = cls( + post_auth_body = cls( audience=audience, bundle=bundle, team_id=team_id, team_slug=team_slug, ) - post_auth_json_body.additional_properties = d - return post_auth_json_body + post_auth_body.additional_properties = d + return post_auth_body @property def additional_keys(self) -> List[str]: diff --git a/smallstep/api_client/models/post_auth_json_body_audience.py b/smallstep/api_client/models/post_auth_body_audience.py similarity index 72% rename from smallstep/api_client/models/post_auth_json_body_audience.py rename to smallstep/api_client/models/post_auth_body_audience.py index 339010c..e94affe 100644 --- a/smallstep/api_client/models/post_auth_json_body_audience.py +++ b/smallstep/api_client/models/post_auth_body_audience.py @@ -1,7 +1,7 @@ from enum import Enum -class PostAuthJsonBodyAudience(str, Enum): +class PostAuthBodyAudience(str, Enum): STEP_AGENT = "step-agent" def __str__(self) -> str: diff --git a/smallstep/api_client/models/post_authority_root_json_body.py b/smallstep/api_client/models/post_authority_root_body.py similarity index 90% rename from smallstep/api_client/models/post_authority_root_json_body.py rename to smallstep/api_client/models/post_authority_root_body.py index 14797e2..cb02542 100644 --- a/smallstep/api_client/models/post_authority_root_json_body.py +++ b/smallstep/api_client/models/post_authority_root_body.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="PostAuthorityRootJsonBody") +T = TypeVar("T", bound="PostAuthorityRootBody") @_attrs_define -class PostAuthorityRootJsonBody: +class PostAuthorityRootBody: """ Attributes: admin_emails (List[str]): Users that will have admin access to manage the authority @@ -28,8 +28,11 @@ def to_dict(self) -> Dict[str, Any]: admin_emails = self.admin_emails id = self.id + intermediate_pem = self.intermediate_pem + root_name = self.root_name + root_pem = self.root_pem field_dict: Dict[str, Any] = {} @@ -59,7 +62,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: root_pem = d.pop("rootPEM") - post_authority_root_json_body = cls( + post_authority_root_body = cls( admin_emails=admin_emails, id=id, intermediate_pem=intermediate_pem, @@ -67,8 +70,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: root_pem=root_pem, ) - post_authority_root_json_body.additional_properties = d - return post_authority_root_json_body + post_authority_root_body.additional_properties = d + return post_authority_root_body @property def additional_keys(self) -> List[str]: diff --git a/smallstep/api_client/models/provisioner.py b/smallstep/api_client/models/provisioner.py index e00d939..0369dbc 100644 --- a/smallstep/api_client/models/provisioner.py +++ b/smallstep/api_client/models/provisioner.py @@ -46,6 +46,7 @@ class Provisioner: def to_dict(self) -> Dict[str, Any]: name = self.name + type = self.type.value claims: Union[Unset, Dict[str, Any]] = UNSET @@ -57,6 +58,7 @@ def to_dict(self) -> Dict[str, Any]: created_at = self.created_at.isoformat() id = self.id + options: Union[Unset, Dict[str, Any]] = UNSET if not isinstance(self.options, Unset): options = self.options.to_dict() diff --git a/smallstep/api_client/models/provisioner_claims.py b/smallstep/api_client/models/provisioner_claims.py index a75defc..399091d 100644 --- a/smallstep/api_client/models/provisioner_claims.py +++ b/smallstep/api_client/models/provisioner_claims.py @@ -59,16 +59,27 @@ class ProvisionerClaims: def to_dict(self) -> Dict[str, Any]: allow_renewal_after_expiry = self.allow_renewal_after_expiry + default_host_ssh_cert_duration = self.default_host_ssh_cert_duration + default_tls_cert_duration = self.default_tls_cert_duration + default_user_ssh_cert_duration = self.default_user_ssh_cert_duration + disable_renewal = self.disable_renewal + enable_sshca = self.enable_sshca + max_host_ssh_cert_duration = self.max_host_ssh_cert_duration + max_tls_cert_duration = self.max_tls_cert_duration + max_user_ssh_cert_duration = self.max_user_ssh_cert_duration + min_host_ssh_cert_duration = self.min_host_ssh_cert_duration + min_tls_cert_duration = self.min_tls_cert_duration + min_user_ssh_cert_duration = self.min_user_ssh_cert_duration field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/provisioner_options.py b/smallstep/api_client/models/provisioner_options.py index 4246368..e13e719 100644 --- a/smallstep/api_client/models/provisioner_options.py +++ b/smallstep/api_client/models/provisioner_options.py @@ -44,7 +44,6 @@ def to_dict(self) -> Dict[str, Any]: webhooks = [] for webhooks_item_data in self.webhooks: webhooks_item = webhooks_item_data.to_dict() - webhooks.append(webhooks_item) x509: Union[Unset, Dict[str, Any]] = UNSET diff --git a/smallstep/api_client/models/provisioner_ssh_options.py b/smallstep/api_client/models/provisioner_ssh_options.py index 8199fa6..c238fb7 100644 --- a/smallstep/api_client/models/provisioner_ssh_options.py +++ b/smallstep/api_client/models/provisioner_ssh_options.py @@ -29,6 +29,7 @@ class ProvisionerSSHOptions: def to_dict(self) -> Dict[str, Any]: template = self.template + template_data = self.template_data field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/provisioner_type.py b/smallstep/api_client/models/provisioner_type.py index 365af12..5a3a07d 100644 --- a/smallstep/api_client/models/provisioner_type.py +++ b/smallstep/api_client/models/provisioner_type.py @@ -9,6 +9,7 @@ class ProvisionerType(str, Enum): GCP = "GCP" JWK = "JWK" OIDC = "OIDC" + SCEP = "SCEP" X5C = "X5C" def __str__(self) -> str: diff --git a/smallstep/api_client/models/provisioner_webhook.py b/smallstep/api_client/models/provisioner_webhook.py index 651d42d..1dacb69 100644 --- a/smallstep/api_client/models/provisioner_webhook.py +++ b/smallstep/api_client/models/provisioner_webhook.py @@ -75,6 +75,7 @@ def to_dict(self) -> Dict[str, Any]: kind = self.kind.value name = self.name + server_type = self.server_type.value basic_auth: Union[Unset, Dict[str, Any]] = UNSET @@ -82,10 +83,15 @@ def to_dict(self) -> Dict[str, Any]: basic_auth = self.basic_auth.to_dict() bearer_token = self.bearer_token + collection_slug = self.collection_slug + disable_tls_client_auth = self.disable_tls_client_auth + id = self.id + secret = self.secret + url = self.url field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/provisioner_x509_options.py b/smallstep/api_client/models/provisioner_x509_options.py index 9f38580..8dce39e 100644 --- a/smallstep/api_client/models/provisioner_x509_options.py +++ b/smallstep/api_client/models/provisioner_x509_options.py @@ -28,6 +28,7 @@ class ProvisionerX509Options: def to_dict(self) -> Dict[str, Any]: template = self.template + template_data = self.template_data field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/put_collection_instance_json_body.py b/smallstep/api_client/models/put_collection_instance_body.py similarity index 82% rename from smallstep/api_client/models/put_collection_instance_json_body.py rename to smallstep/api_client/models/put_collection_instance_body.py index a017d84..a6398d0 100644 --- a/smallstep/api_client/models/put_collection_instance_json_body.py +++ b/smallstep/api_client/models/put_collection_instance_body.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="PutCollectionInstanceJsonBody") +T = TypeVar("T", bound="PutCollectionInstanceBody") @_attrs_define -class PutCollectionInstanceJsonBody: +class PutCollectionInstanceBody: """ Attributes: data (Any): @@ -34,12 +34,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() data = d.pop("data") - put_collection_instance_json_body = cls( + put_collection_instance_body = cls( data=data, ) - put_collection_instance_json_body.additional_properties = d - return put_collection_instance_json_body + put_collection_instance_body.additional_properties = d + return put_collection_instance_body @property def additional_keys(self) -> List[str]: diff --git a/smallstep/api_client/models/scep_provisioner.py b/smallstep/api_client/models/scep_provisioner.py new file mode 100644 index 0000000..4902ae4 --- /dev/null +++ b/smallstep/api_client/models/scep_provisioner.py @@ -0,0 +1,168 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.scep_provisioner_encryption_algorithm_identifier import SCEPProvisionerEncryptionAlgorithmIdentifier +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SCEPProvisioner") + + +@_attrs_define +class SCEPProvisioner: + """The [SCEP provisioner](https://smallstep.com/docs/step-ca/provisioners/#scep) grants certificates to clients using + the SCEP protocol. This type is currently experimental and subject to change. + + Attributes: + autogenerate_decrypter (Union[Unset, bool]): Automatically generate a new RSA decrypter instead of providing + one. + challenge (Union[Unset, str]): A static challenge secret. + decrypter_certificate (Union[Unset, str]): A pem-encoded certificate for an RSA public key. + decrypter_key (Union[Unset, str]): The pem-encoded RSA private key, corresponding to the certificate public key. + decrypter_key_password (Union[Unset, str]): The password for the pem-encoded RSA private key, if any. + encryption_algorithm_identifier (Union[Unset, SCEPProvisionerEncryptionAlgorithmIdentifier]): The encryption + algorithm used for encrypting responses to the SCEP client: + * `DES_CBC` - [DES in CBC mode](https://www.rfc-editor.org/rfc/rfc8018.html#appendix-B.2.1) - `1.3.14.3.2.7` + * `AES_128_CBC` - [AES-128 in CBC mode](https://www.rfc-editor.org/rfc/rfc8018.html#appendix-B.2.5) - + `2.16.840.1.101.3.4.1.2` + * `AES_128_GCM` - [AES-128 in GCM mode](https://www.rfc-editor.org/rfc/rfc5084.html#section-3.2) - + `2.16.840.1.101.3.4.1.6` + * `AES_256_CBC` - [AES-256 in CBC mode](https://www.rfc-editor.org/rfc/rfc3565.html#section-4.1) - + `2.16.840.1.101.3.4.1.42` + * `AES_256_GCM` - [AES-256 in GCM mode](https://www.rfc-editor.org/rfc/rfc5084.html#section-3.2) - + `2.16.840.1.101.3.4.1.46` + Default: SCEPProvisionerEncryptionAlgorithmIdentifier.AES_256_CBC. + exclude_intermediate (Union[Unset, bool]): Exclude the intermediate CA certificate in SCEP responses. Default: + False. + force_cn (Union[Unset, bool]): Force one of the SANs to become the Common Name, if a Common Name is not + provided. + include_root (Union[Unset, bool]): Include the root CA certificate in SCEP responses. Default: False. + minimum_public_key_length (Union[Unset, int]): The minimum number of bits for RSA public keys accepted in SCEP + requests. Default: 2048. + """ + + autogenerate_decrypter: Union[Unset, bool] = UNSET + challenge: Union[Unset, str] = UNSET + decrypter_certificate: Union[Unset, str] = UNSET + decrypter_key: Union[Unset, str] = UNSET + decrypter_key_password: Union[Unset, str] = UNSET + encryption_algorithm_identifier: Union[ + Unset, SCEPProvisionerEncryptionAlgorithmIdentifier + ] = SCEPProvisionerEncryptionAlgorithmIdentifier.AES_256_CBC + exclude_intermediate: Union[Unset, bool] = False + force_cn: Union[Unset, bool] = UNSET + include_root: Union[Unset, bool] = False + minimum_public_key_length: Union[Unset, int] = 2048 + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + autogenerate_decrypter = self.autogenerate_decrypter + + challenge = self.challenge + + decrypter_certificate = self.decrypter_certificate + + decrypter_key = self.decrypter_key + + decrypter_key_password = self.decrypter_key_password + + encryption_algorithm_identifier: Union[Unset, str] = UNSET + if not isinstance(self.encryption_algorithm_identifier, Unset): + encryption_algorithm_identifier = self.encryption_algorithm_identifier.value + + exclude_intermediate = self.exclude_intermediate + + force_cn = self.force_cn + + include_root = self.include_root + + minimum_public_key_length = self.minimum_public_key_length + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if autogenerate_decrypter is not UNSET: + field_dict["autogenerateDecrypter"] = autogenerate_decrypter + if challenge is not UNSET: + field_dict["challenge"] = challenge + if decrypter_certificate is not UNSET: + field_dict["decrypterCertificate"] = decrypter_certificate + if decrypter_key is not UNSET: + field_dict["decrypterKey"] = decrypter_key + if decrypter_key_password is not UNSET: + field_dict["decrypterKeyPassword"] = decrypter_key_password + if encryption_algorithm_identifier is not UNSET: + field_dict["encryptionAlgorithmIdentifier"] = encryption_algorithm_identifier + if exclude_intermediate is not UNSET: + field_dict["excludeIntermediate"] = exclude_intermediate + if force_cn is not UNSET: + field_dict["forceCN"] = force_cn + if include_root is not UNSET: + field_dict["includeRoot"] = include_root + if minimum_public_key_length is not UNSET: + field_dict["minimumPublicKeyLength"] = minimum_public_key_length + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + autogenerate_decrypter = d.pop("autogenerateDecrypter", UNSET) + + challenge = d.pop("challenge", UNSET) + + decrypter_certificate = d.pop("decrypterCertificate", UNSET) + + decrypter_key = d.pop("decrypterKey", UNSET) + + decrypter_key_password = d.pop("decrypterKeyPassword", UNSET) + + _encryption_algorithm_identifier = d.pop("encryptionAlgorithmIdentifier", UNSET) + encryption_algorithm_identifier: Union[Unset, SCEPProvisionerEncryptionAlgorithmIdentifier] + if isinstance(_encryption_algorithm_identifier, Unset): + encryption_algorithm_identifier = UNSET + else: + encryption_algorithm_identifier = SCEPProvisionerEncryptionAlgorithmIdentifier( + _encryption_algorithm_identifier + ) + + exclude_intermediate = d.pop("excludeIntermediate", UNSET) + + force_cn = d.pop("forceCN", UNSET) + + include_root = d.pop("includeRoot", UNSET) + + minimum_public_key_length = d.pop("minimumPublicKeyLength", UNSET) + + scep_provisioner = cls( + autogenerate_decrypter=autogenerate_decrypter, + challenge=challenge, + decrypter_certificate=decrypter_certificate, + decrypter_key=decrypter_key, + decrypter_key_password=decrypter_key_password, + encryption_algorithm_identifier=encryption_algorithm_identifier, + exclude_intermediate=exclude_intermediate, + force_cn=force_cn, + include_root=include_root, + minimum_public_key_length=minimum_public_key_length, + ) + + scep_provisioner.additional_properties = d + return scep_provisioner + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/scep_provisioner_encryption_algorithm_identifier.py b/smallstep/api_client/models/scep_provisioner_encryption_algorithm_identifier.py new file mode 100644 index 0000000..7f46bc1 --- /dev/null +++ b/smallstep/api_client/models/scep_provisioner_encryption_algorithm_identifier.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class SCEPProvisionerEncryptionAlgorithmIdentifier(str, Enum): + AES_128_CBC = "AES_128_CBC" + AES_128_GCM = "AES_128_GCM" + AES_256_CBC = "AES_256_CBC" + AES_256_GCM = "AES_256_GCM" + DES_CBC = "DES_CBC" + + def __str__(self) -> str: + return str(self.value) diff --git a/smallstep/api_client/models/ssh_group.py b/smallstep/api_client/models/ssh_group.py index b5ae321..5a7beed 100644 --- a/smallstep/api_client/models/ssh_group.py +++ b/smallstep/api_client/models/ssh_group.py @@ -39,17 +39,17 @@ def to_dict(self) -> Dict[str, Any]: host_grants = [] for host_grants_item_data in self.host_grants: host_grants_item = host_grants_item_data.to_dict() - host_grants.append(host_grants_item) id = self.id + name = self.name + posix_groups: Union[Unset, List[Dict[str, Any]]] = UNSET if not isinstance(self.posix_groups, Unset): posix_groups = [] for posix_groups_item_data in self.posix_groups: posix_groups_item = posix_groups_item_data.to_dict() - posix_groups.append(posix_groups_item) principals: Union[Unset, List[str]] = UNSET diff --git a/smallstep/api_client/models/ssh_host.py b/smallstep/api_client/models/ssh_host.py index 2b376c0..cbd9de3 100644 --- a/smallstep/api_client/models/ssh_host.py +++ b/smallstep/api_client/models/ssh_host.py @@ -41,20 +41,24 @@ class SSHHost: def to_dict(self) -> Dict[str, Any]: active = self.active + bastion = self.bastion + bastion_hostname = self.bastion_hostname + created_at: Union[Unset, str] = UNSET if not isinstance(self.created_at, Unset): created_at = self.created_at.isoformat() hostname = self.hostname + id = self.id + tags: Union[Unset, List[Dict[str, Any]]] = UNSET if not isinstance(self.tags, Unset): tags = [] for tags_item_data in self.tags: tags_item = tags_item_data.to_dict() - tags.append(tags_item) updated_at: Union[Unset, str] = UNSET diff --git a/smallstep/api_client/models/ssh_host_grant.py b/smallstep/api_client/models/ssh_host_grant.py index f333015..cdd7057 100644 --- a/smallstep/api_client/models/ssh_host_grant.py +++ b/smallstep/api_client/models/ssh_host_grant.py @@ -29,9 +29,13 @@ class SSHHostGrant: def to_dict(self) -> Dict[str, Any]: group_id = self.group_id + id = self.id + name = self.name + sudo = self.sudo + value = self.value field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/ssh_host_tag.py b/smallstep/api_client/models/ssh_host_tag.py index 49b5fbd..8bb5958 100644 --- a/smallstep/api_client/models/ssh_host_tag.py +++ b/smallstep/api_client/models/ssh_host_tag.py @@ -26,7 +26,9 @@ class SSHHostTag: def to_dict(self) -> Dict[str, Any]: id = self.id + name = self.name + value = self.value field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/ssh_user.py b/smallstep/api_client/models/ssh_user.py index 21531da..71b0d8e 100644 --- a/smallstep/api_client/models/ssh_user.py +++ b/smallstep/api_client/models/ssh_user.py @@ -42,32 +42,34 @@ class SSHUser: def to_dict(self) -> Dict[str, Any]: active = self.active + display_name = self.display_name + emails: Union[Unset, List[Dict[str, Any]]] = UNSET if not isinstance(self.emails, Unset): emails = [] for emails_item_data in self.emails: emails_item = emails_item_data.to_dict() - emails.append(emails_item) family_name = self.family_name + given_name = self.given_name + groups: Union[Unset, List[Dict[str, Any]]] = UNSET if not isinstance(self.groups, Unset): groups = [] for groups_item_data in self.groups: groups_item = groups_item_data.to_dict() - groups.append(groups_item) id = self.id + posix_users: Union[Unset, List[Dict[str, Any]]] = UNSET if not isinstance(self.posix_users, Unset): posix_users = [] for posix_users_item_data in self.posix_users: posix_users_item = posix_users_item_data.to_dict() - posix_users.append(posix_users_item) field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/subject.py b/smallstep/api_client/models/subject.py new file mode 100644 index 0000000..bd241c2 --- /dev/null +++ b/smallstep/api_client/models/subject.py @@ -0,0 +1,181 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.extra_name import ExtraName + + +T = TypeVar("T", bound="Subject") + + +@_attrs_define +class Subject: + """Name used in x509 certificates + + Attributes: + common_name (Union[Unset, str]): + country (Union[Unset, List[str]]): + email_address (Union[Unset, List[str]]): + extra_names (Union[Unset, List['ExtraName']]): + locality (Union[Unset, List[str]]): + organization (Union[Unset, List[str]]): + organizational_unit (Union[Unset, List[str]]): + postal_code (Union[Unset, List[str]]): + province (Union[Unset, List[str]]): + serial_number (Union[Unset, str]): + street_address (Union[Unset, List[str]]): + """ + + common_name: Union[Unset, str] = UNSET + country: Union[Unset, List[str]] = UNSET + email_address: Union[Unset, List[str]] = UNSET + extra_names: Union[Unset, List["ExtraName"]] = UNSET + locality: Union[Unset, List[str]] = UNSET + organization: Union[Unset, List[str]] = UNSET + organizational_unit: Union[Unset, List[str]] = UNSET + postal_code: Union[Unset, List[str]] = UNSET + province: Union[Unset, List[str]] = UNSET + serial_number: Union[Unset, str] = UNSET + street_address: Union[Unset, List[str]] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + common_name = self.common_name + + country: Union[Unset, List[str]] = UNSET + if not isinstance(self.country, Unset): + country = self.country + + email_address: Union[Unset, List[str]] = UNSET + if not isinstance(self.email_address, Unset): + email_address = self.email_address + + extra_names: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.extra_names, Unset): + extra_names = [] + for extra_names_item_data in self.extra_names: + extra_names_item = extra_names_item_data.to_dict() + extra_names.append(extra_names_item) + + locality: Union[Unset, List[str]] = UNSET + if not isinstance(self.locality, Unset): + locality = self.locality + + organization: Union[Unset, List[str]] = UNSET + if not isinstance(self.organization, Unset): + organization = self.organization + + organizational_unit: Union[Unset, List[str]] = UNSET + if not isinstance(self.organizational_unit, Unset): + organizational_unit = self.organizational_unit + + postal_code: Union[Unset, List[str]] = UNSET + if not isinstance(self.postal_code, Unset): + postal_code = self.postal_code + + province: Union[Unset, List[str]] = UNSET + if not isinstance(self.province, Unset): + province = self.province + + serial_number = self.serial_number + + street_address: Union[Unset, List[str]] = UNSET + if not isinstance(self.street_address, Unset): + street_address = self.street_address + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if common_name is not UNSET: + field_dict["commonName"] = common_name + if country is not UNSET: + field_dict["country"] = country + if email_address is not UNSET: + field_dict["emailAddress"] = email_address + if extra_names is not UNSET: + field_dict["extraNames"] = extra_names + if locality is not UNSET: + field_dict["locality"] = locality + if organization is not UNSET: + field_dict["organization"] = organization + if organizational_unit is not UNSET: + field_dict["organizationalUnit"] = organizational_unit + if postal_code is not UNSET: + field_dict["postalCode"] = postal_code + if province is not UNSET: + field_dict["province"] = province + if serial_number is not UNSET: + field_dict["serialNumber"] = serial_number + if street_address is not UNSET: + field_dict["streetAddress"] = street_address + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.extra_name import ExtraName + + d = src_dict.copy() + common_name = d.pop("commonName", UNSET) + + country = cast(List[str], d.pop("country", UNSET)) + + email_address = cast(List[str], d.pop("emailAddress", UNSET)) + + extra_names = [] + _extra_names = d.pop("extraNames", UNSET) + for extra_names_item_data in _extra_names or []: + extra_names_item = ExtraName.from_dict(extra_names_item_data) + + extra_names.append(extra_names_item) + + locality = cast(List[str], d.pop("locality", UNSET)) + + organization = cast(List[str], d.pop("organization", UNSET)) + + organizational_unit = cast(List[str], d.pop("organizationalUnit", UNSET)) + + postal_code = cast(List[str], d.pop("postalCode", UNSET)) + + province = cast(List[str], d.pop("province", UNSET)) + + serial_number = d.pop("serialNumber", UNSET) + + street_address = cast(List[str], d.pop("streetAddress", UNSET)) + + subject = cls( + common_name=common_name, + country=country, + email_address=email_address, + extra_names=extra_names, + locality=locality, + organization=organization, + organizational_unit=organizational_unit, + postal_code=postal_code, + province=province, + serial_number=serial_number, + street_address=street_address, + ) + + subject.additional_properties = d + return subject + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/tpm_device_type.py b/smallstep/api_client/models/tpm_device_type.py index eb3d11d..9cccbd5 100644 --- a/smallstep/api_client/models/tpm_device_type.py +++ b/smallstep/api_client/models/tpm_device_type.py @@ -33,8 +33,11 @@ class TPMDeviceType: def to_dict(self) -> Dict[str, Any]: attestor_intermediates = self.attestor_intermediates + attestor_roots = self.attestor_roots + force_cn = self.force_cn + require_eab = self.require_eab field_dict: Dict[str, Any] = {} diff --git a/smallstep/api_client/models/vpn.py b/smallstep/api_client/models/vpn.py new file mode 100644 index 0000000..d69099f --- /dev/null +++ b/smallstep/api_client/models/vpn.py @@ -0,0 +1,118 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.vpn_connection_type import VPNConnectionType +from ..models.vpn_vendor import VPNVendor +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.ike_v2_config import IkeV2Config + + +T = TypeVar("T", bound="VPN") + + +@_attrs_define +class VPN: + """Configuration to connect a device to a VPN. + + Attributes: + connection_type (VPNConnectionType): + remote_address (str): + autojoin (Union[Unset, bool]): + ike (Union[Unset, IkeV2Config]): + vendor (Union[Unset, VPNVendor]): + """ + + connection_type: VPNConnectionType + remote_address: str + autojoin: Union[Unset, bool] = UNSET + ike: Union[Unset, "IkeV2Config"] = UNSET + vendor: Union[Unset, VPNVendor] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + connection_type = self.connection_type.value + + remote_address = self.remote_address + + autojoin = self.autojoin + + ike: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.ike, Unset): + ike = self.ike.to_dict() + + vendor: Union[Unset, str] = UNSET + if not isinstance(self.vendor, Unset): + vendor = self.vendor.value + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "connectionType": connection_type, + "remoteAddress": remote_address, + } + ) + if autojoin is not UNSET: + field_dict["autojoin"] = autojoin + if ike is not UNSET: + field_dict["ike"] = ike + if vendor is not UNSET: + field_dict["vendor"] = vendor + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.ike_v2_config import IkeV2Config + + d = src_dict.copy() + connection_type = VPNConnectionType(d.pop("connectionType")) + + remote_address = d.pop("remoteAddress") + + autojoin = d.pop("autojoin", UNSET) + + _ike = d.pop("ike", UNSET) + ike: Union[Unset, IkeV2Config] + if isinstance(_ike, Unset): + ike = UNSET + else: + ike = IkeV2Config.from_dict(_ike) + + _vendor = d.pop("vendor", UNSET) + vendor: Union[Unset, VPNVendor] + if isinstance(_vendor, Unset): + vendor = UNSET + else: + vendor = VPNVendor(_vendor) + + vpn = cls( + connection_type=connection_type, + remote_address=remote_address, + autojoin=autojoin, + ike=ike, + vendor=vendor, + ) + + vpn.additional_properties = d + return vpn + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/vpn_connection_type.py b/smallstep/api_client/models/vpn_connection_type.py new file mode 100644 index 0000000..a98811b --- /dev/null +++ b/smallstep/api_client/models/vpn_connection_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class VPNConnectionType(str, Enum): + IKEV2 = "IKEv2" + IPSEC = "IPSec" + SSL = "SSL" + + def __str__(self) -> str: + return str(self.value) diff --git a/smallstep/api_client/models/vpn_vendor.py b/smallstep/api_client/models/vpn_vendor.py new file mode 100644 index 0000000..30ef596 --- /dev/null +++ b/smallstep/api_client/models/vpn_vendor.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class VPNVendor(str, Enum): + CISCO = "Cisco" + F5 = "F5" + JUNIPER = "Juniper" + + def __str__(self) -> str: + return str(self.value) diff --git a/smallstep/api_client/models/wi_fi.py b/smallstep/api_client/models/wi_fi.py new file mode 100644 index 0000000..18dd955 --- /dev/null +++ b/smallstep/api_client/models/wi_fi.py @@ -0,0 +1,106 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="WiFi") + + +@_attrs_define +class WiFi: + """Configuration to connect a device to a protected WiFi network. + + Attributes: + ssid (str): + autojoin (Union[Unset, bool]): + ca_chain (Union[Unset, str]): + external_radius_server (Union[Unset, bool]): + hidden (Union[Unset, bool]): + network_access_server_ip (Union[Unset, str]): + """ + + ssid: str + autojoin: Union[Unset, bool] = UNSET + ca_chain: Union[Unset, str] = UNSET + external_radius_server: Union[Unset, bool] = UNSET + hidden: Union[Unset, bool] = UNSET + network_access_server_ip: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + ssid = self.ssid + + autojoin = self.autojoin + + ca_chain = self.ca_chain + + external_radius_server = self.external_radius_server + + hidden = self.hidden + + network_access_server_ip = self.network_access_server_ip + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "ssid": ssid, + } + ) + if autojoin is not UNSET: + field_dict["autojoin"] = autojoin + if ca_chain is not UNSET: + field_dict["caChain"] = ca_chain + if external_radius_server is not UNSET: + field_dict["externalRadiusServer"] = external_radius_server + if hidden is not UNSET: + field_dict["hidden"] = hidden + if network_access_server_ip is not UNSET: + field_dict["networkAccessServerIP"] = network_access_server_ip + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + ssid = d.pop("ssid") + + autojoin = d.pop("autojoin", UNSET) + + ca_chain = d.pop("caChain", UNSET) + + external_radius_server = d.pop("externalRadiusServer", UNSET) + + hidden = d.pop("hidden", UNSET) + + network_access_server_ip = d.pop("networkAccessServerIP", UNSET) + + wi_fi = cls( + ssid=ssid, + autojoin=autojoin, + ca_chain=ca_chain, + external_radius_server=external_radius_server, + hidden=hidden, + network_access_server_ip=network_access_server_ip, + ) + + wi_fi.additional_properties = d + return wi_fi + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/workload.py b/smallstep/api_client/models/workload.py index 1ef3c96..8cf8e33 100644 --- a/smallstep/api_client/models/workload.py +++ b/smallstep/api_client/models/workload.py @@ -20,30 +20,25 @@ class Workload: """A workload represents anything that uses a certificate. Attributes: - display_name (str): A friendly name for the workload. Also used as the Common Name if no static SANs are - provide. + display_name (str): A friendly name for the workload. Also used as the Common Name, if no static SANs are + provided. slug (str): Used as the identifier for the workload. - workload_type (str): + workload_type (str): The type of workload being deployed. + Possible values are `etcd` `generic` `git` `grafana` `haproxy` `httpd` `kafka` `mysql` `nginx` `nodejs` + `postgres` `redis` `tomcat` and `zookeeper`. + Use `generic` for a basic certificate workload. admin_emails (Union[Unset, List[str]]): Users that will have admin access to manage the workloads authority, which will be created if it does not already exist. Ignored if the workloads authority already exists. Never returned in responses. certificate_info (Union[Unset, ManagedEndpointCertificateInfo]): Details on a managed certificate. Example: {'crtFile': '/etc/db.crt', 'duration': '24h0m0s', 'gid': 999, 'keyFile': '/etc/db.key', 'mode': 256, 'rootFile': '/etc/ca.crt', 'type': 'X509', 'uid': 1001}. - device_metadata_key_sans (Union[Unset, List[str]]): SANs that will be populated from the instance data of the - device in the device collection. - For example, if the device instance data in the collection is `{"internal_host": "foo.internal", - "external_host", "foo.example.com"}` at the time the workload certificate is issued and this field is set to - `["internal_host", "external_host"]`, then the certificate would include the SANs `foo.internal` and - `foo.example.com`. hooks (Union[Unset, ManagedEndpointHooks]): The collection of commands to run when a certificate for a managed endpoint is signed or renewed. key_info (Union[Unset, ManagedEndpointKeyInfo]): The attributes of the cryptographic key. Example: {'format': - 'DER', 'pubFile': '/etc/db.csr', 'type': 'ECDSA_P256'}. + 'PKCS8', 'protection': 'NONE', 'pubFile': '/etc/db.csr', 'type': 'ECDSA_P256'}. reload_info (Union[Unset, ManagedEndpointReloadInfo]): The properties used to reload a service. Example: {'method': 'SIGNAL', 'pidFile': '/var/run/db.pid', 'signal': 1}. - static_sans (Union[Unset, List[str]]): SANs that will be added to every certificate issued for this workload. - The first will be used as the default Common Name. """ display_name: str @@ -51,17 +46,18 @@ class Workload: workload_type: str admin_emails: Union[Unset, List[str]] = UNSET certificate_info: Union[Unset, "ManagedEndpointCertificateInfo"] = UNSET - device_metadata_key_sans: Union[Unset, List[str]] = UNSET hooks: Union[Unset, "ManagedEndpointHooks"] = UNSET key_info: Union[Unset, "ManagedEndpointKeyInfo"] = UNSET reload_info: Union[Unset, "ManagedEndpointReloadInfo"] = UNSET - static_sans: Union[Unset, List[str]] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: display_name = self.display_name + slug = self.slug + workload_type = self.workload_type + admin_emails: Union[Unset, List[str]] = UNSET if not isinstance(self.admin_emails, Unset): admin_emails = self.admin_emails @@ -70,10 +66,6 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.certificate_info, Unset): certificate_info = self.certificate_info.to_dict() - device_metadata_key_sans: Union[Unset, List[str]] = UNSET - if not isinstance(self.device_metadata_key_sans, Unset): - device_metadata_key_sans = self.device_metadata_key_sans - hooks: Union[Unset, Dict[str, Any]] = UNSET if not isinstance(self.hooks, Unset): hooks = self.hooks.to_dict() @@ -86,10 +78,6 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.reload_info, Unset): reload_info = self.reload_info.to_dict() - static_sans: Union[Unset, List[str]] = UNSET - if not isinstance(self.static_sans, Unset): - static_sans = self.static_sans - field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -103,16 +91,12 @@ def to_dict(self) -> Dict[str, Any]: field_dict["adminEmails"] = admin_emails if certificate_info is not UNSET: field_dict["certificateInfo"] = certificate_info - if device_metadata_key_sans is not UNSET: - field_dict["deviceMetadataKeySANs"] = device_metadata_key_sans if hooks is not UNSET: field_dict["hooks"] = hooks if key_info is not UNSET: field_dict["keyInfo"] = key_info if reload_info is not UNSET: field_dict["reloadInfo"] = reload_info - if static_sans is not UNSET: - field_dict["staticSANs"] = static_sans return field_dict @@ -139,8 +123,6 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: certificate_info = ManagedEndpointCertificateInfo.from_dict(_certificate_info) - device_metadata_key_sans = cast(List[str], d.pop("deviceMetadataKeySANs", UNSET)) - _hooks = d.pop("hooks", UNSET) hooks: Union[Unset, ManagedEndpointHooks] if isinstance(_hooks, Unset): @@ -162,19 +144,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: reload_info = ManagedEndpointReloadInfo.from_dict(_reload_info) - static_sans = cast(List[str], d.pop("staticSANs", UNSET)) - workload = cls( display_name=display_name, slug=slug, workload_type=workload_type, admin_emails=admin_emails, certificate_info=certificate_info, - device_metadata_key_sans=device_metadata_key_sans, hooks=hooks, key_info=key_info, reload_info=reload_info, - static_sans=static_sans, ) workload.additional_properties = d diff --git a/smallstep/api_client/models/x509_certificate.py b/smallstep/api_client/models/x509_certificate.py new file mode 100644 index 0000000..915f1c9 --- /dev/null +++ b/smallstep/api_client/models/x509_certificate.py @@ -0,0 +1,283 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.x509_certificate_revocation_reason import X509CertificateRevocationReason +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.basic_constraints import BasicConstraints + from ..models.name_constraints import NameConstraints + from ..models.subject import Subject + + +T = TypeVar("T", bound="X509Certificate") + + +@_attrs_define +class X509Certificate: + """ + Attributes: + authority_key_id (str): + basic_constraints (BasicConstraints): + issuer (Subject): Name used in x509 certificates + key_usage (List[str]): + pem (str): + serial_number (str): + signature_algorithm (str): + subject (Subject): Name used in x509 certificates + subject_key_id (str): + version (int): + crl_distribution_points (Union[Unset, List[str]]): + dns_names (Union[Unset, List[str]]): + email_addresses (Union[Unset, List[str]]): + ext_key_usage (Union[Unset, List[str]]): + ip_addresses (Union[Unset, List[str]]): + issuing_certificate_url (Union[Unset, List[str]]): + name_constraints (Union[Unset, NameConstraints]): X509 certificate name constraints. + ocsp_server (Union[Unset, List[str]]): + policy_identifiers (Union[Unset, List[str]]): + revocation_reason (Union[Unset, X509CertificateRevocationReason]): + revoked (Union[Unset, bool]): + uris (Union[Unset, List[str]]): + """ + + authority_key_id: str + basic_constraints: "BasicConstraints" + issuer: "Subject" + key_usage: List[str] + pem: str + serial_number: str + signature_algorithm: str + subject: "Subject" + subject_key_id: str + version: int + crl_distribution_points: Union[Unset, List[str]] = UNSET + dns_names: Union[Unset, List[str]] = UNSET + email_addresses: Union[Unset, List[str]] = UNSET + ext_key_usage: Union[Unset, List[str]] = UNSET + ip_addresses: Union[Unset, List[str]] = UNSET + issuing_certificate_url: Union[Unset, List[str]] = UNSET + name_constraints: Union[Unset, "NameConstraints"] = UNSET + ocsp_server: Union[Unset, List[str]] = UNSET + policy_identifiers: Union[Unset, List[str]] = UNSET + revocation_reason: Union[Unset, X509CertificateRevocationReason] = UNSET + revoked: Union[Unset, bool] = UNSET + uris: Union[Unset, List[str]] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + authority_key_id = self.authority_key_id + + basic_constraints = self.basic_constraints.to_dict() + + issuer = self.issuer.to_dict() + + key_usage = self.key_usage + + pem = self.pem + + serial_number = self.serial_number + + signature_algorithm = self.signature_algorithm + + subject = self.subject.to_dict() + + subject_key_id = self.subject_key_id + + version = self.version + + crl_distribution_points: Union[Unset, List[str]] = UNSET + if not isinstance(self.crl_distribution_points, Unset): + crl_distribution_points = self.crl_distribution_points + + dns_names: Union[Unset, List[str]] = UNSET + if not isinstance(self.dns_names, Unset): + dns_names = self.dns_names + + email_addresses: Union[Unset, List[str]] = UNSET + if not isinstance(self.email_addresses, Unset): + email_addresses = self.email_addresses + + ext_key_usage: Union[Unset, List[str]] = UNSET + if not isinstance(self.ext_key_usage, Unset): + ext_key_usage = self.ext_key_usage + + ip_addresses: Union[Unset, List[str]] = UNSET + if not isinstance(self.ip_addresses, Unset): + ip_addresses = self.ip_addresses + + issuing_certificate_url: Union[Unset, List[str]] = UNSET + if not isinstance(self.issuing_certificate_url, Unset): + issuing_certificate_url = self.issuing_certificate_url + + name_constraints: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.name_constraints, Unset): + name_constraints = self.name_constraints.to_dict() + + ocsp_server: Union[Unset, List[str]] = UNSET + if not isinstance(self.ocsp_server, Unset): + ocsp_server = self.ocsp_server + + policy_identifiers: Union[Unset, List[str]] = UNSET + if not isinstance(self.policy_identifiers, Unset): + policy_identifiers = self.policy_identifiers + + revocation_reason: Union[Unset, str] = UNSET + if not isinstance(self.revocation_reason, Unset): + revocation_reason = self.revocation_reason.value + + revoked = self.revoked + + uris: Union[Unset, List[str]] = UNSET + if not isinstance(self.uris, Unset): + uris = self.uris + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "authorityKeyId": authority_key_id, + "basicConstraints": basic_constraints, + "issuer": issuer, + "keyUsage": key_usage, + "pem": pem, + "serialNumber": serial_number, + "signatureAlgorithm": signature_algorithm, + "subject": subject, + "subjectKeyId": subject_key_id, + "version": version, + } + ) + if crl_distribution_points is not UNSET: + field_dict["crlDistributionPoints"] = crl_distribution_points + if dns_names is not UNSET: + field_dict["dnsNames"] = dns_names + if email_addresses is not UNSET: + field_dict["emailAddresses"] = email_addresses + if ext_key_usage is not UNSET: + field_dict["extKeyUsage"] = ext_key_usage + if ip_addresses is not UNSET: + field_dict["ipAddresses"] = ip_addresses + if issuing_certificate_url is not UNSET: + field_dict["issuingCertificateURL"] = issuing_certificate_url + if name_constraints is not UNSET: + field_dict["nameConstraints"] = name_constraints + if ocsp_server is not UNSET: + field_dict["ocspServer"] = ocsp_server + if policy_identifiers is not UNSET: + field_dict["policyIdentifiers"] = policy_identifiers + if revocation_reason is not UNSET: + field_dict["revocationReason"] = revocation_reason + if revoked is not UNSET: + field_dict["revoked"] = revoked + if uris is not UNSET: + field_dict["uris"] = uris + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.basic_constraints import BasicConstraints + from ..models.name_constraints import NameConstraints + from ..models.subject import Subject + + d = src_dict.copy() + authority_key_id = d.pop("authorityKeyId") + + basic_constraints = BasicConstraints.from_dict(d.pop("basicConstraints")) + + issuer = Subject.from_dict(d.pop("issuer")) + + key_usage = cast(List[str], d.pop("keyUsage")) + + pem = d.pop("pem") + + serial_number = d.pop("serialNumber") + + signature_algorithm = d.pop("signatureAlgorithm") + + subject = Subject.from_dict(d.pop("subject")) + + subject_key_id = d.pop("subjectKeyId") + + version = d.pop("version") + + crl_distribution_points = cast(List[str], d.pop("crlDistributionPoints", UNSET)) + + dns_names = cast(List[str], d.pop("dnsNames", UNSET)) + + email_addresses = cast(List[str], d.pop("emailAddresses", UNSET)) + + ext_key_usage = cast(List[str], d.pop("extKeyUsage", UNSET)) + + ip_addresses = cast(List[str], d.pop("ipAddresses", UNSET)) + + issuing_certificate_url = cast(List[str], d.pop("issuingCertificateURL", UNSET)) + + _name_constraints = d.pop("nameConstraints", UNSET) + name_constraints: Union[Unset, NameConstraints] + if isinstance(_name_constraints, Unset): + name_constraints = UNSET + else: + name_constraints = NameConstraints.from_dict(_name_constraints) + + ocsp_server = cast(List[str], d.pop("ocspServer", UNSET)) + + policy_identifiers = cast(List[str], d.pop("policyIdentifiers", UNSET)) + + _revocation_reason = d.pop("revocationReason", UNSET) + revocation_reason: Union[Unset, X509CertificateRevocationReason] + if isinstance(_revocation_reason, Unset): + revocation_reason = UNSET + else: + revocation_reason = X509CertificateRevocationReason(_revocation_reason) + + revoked = d.pop("revoked", UNSET) + + uris = cast(List[str], d.pop("uris", UNSET)) + + x509_certificate = cls( + authority_key_id=authority_key_id, + basic_constraints=basic_constraints, + issuer=issuer, + key_usage=key_usage, + pem=pem, + serial_number=serial_number, + signature_algorithm=signature_algorithm, + subject=subject, + subject_key_id=subject_key_id, + version=version, + crl_distribution_points=crl_distribution_points, + dns_names=dns_names, + email_addresses=email_addresses, + ext_key_usage=ext_key_usage, + ip_addresses=ip_addresses, + issuing_certificate_url=issuing_certificate_url, + name_constraints=name_constraints, + ocsp_server=ocsp_server, + policy_identifiers=policy_identifiers, + revocation_reason=revocation_reason, + revoked=revoked, + uris=uris, + ) + + x509_certificate.additional_properties = d + return x509_certificate + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/x509_certificate_revocation_reason.py b/smallstep/api_client/models/x509_certificate_revocation_reason.py new file mode 100644 index 0000000..1d8ed45 --- /dev/null +++ b/smallstep/api_client/models/x509_certificate_revocation_reason.py @@ -0,0 +1,16 @@ +from enum import Enum + + +class X509CertificateRevocationReason(str, Enum): + AA_COMPROMISE = "AA_COMPROMISE" + AFFILIATION_CHANGED = "AFFILIATION_CHANGED" + CA_COMPROMISE = "CA_COMPROMISE" + CERTIFICATE_HOLD = "CERTIFICATE_HOLD" + CESSATION_OF_OPERATION = "CESSATION_OF_OPERATION" + KEY_COMPROMISE = "KEY_COMPROMISE" + PRIVILEGE_WITHDRAWN = "PRIVILEGE_WITHDRAWN" + SUPERSEDED = "SUPERSEDED" + UNSPECIFIED = "UNSPECIFIED" + + def __str__(self) -> str: + return str(self.value) diff --git a/smallstep/api_client/models/x509_fields.py b/smallstep/api_client/models/x509_fields.py new file mode 100644 index 0000000..8cab1fe --- /dev/null +++ b/smallstep/api_client/models/x509_fields.py @@ -0,0 +1,232 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.certificate_field_device_metadata import CertificateFieldDeviceMetadata + from ..models.certificate_field_list import CertificateFieldList + from ..models.certificate_field_static import CertificateFieldStatic + + +T = TypeVar("T", bound="X509Fields") + + +@_attrs_define +class X509Fields: + """ + Attributes: + common_name (Union['CertificateFieldDeviceMetadata', 'CertificateFieldStatic', Unset]): A certificate field that + takes a single string value, e.g. Common Name. + country (Union[Unset, CertificateFieldList]): A certificate field that accepts multiple string values, e.g. + SANs. + locality (Union[Unset, CertificateFieldList]): A certificate field that accepts multiple string values, e.g. + SANs. + organization (Union[Unset, CertificateFieldList]): A certificate field that accepts multiple string values, e.g. + SANs. + organizational_unit (Union[Unset, CertificateFieldList]): A certificate field that accepts multiple string + values, e.g. SANs. + postal_code (Union[Unset, CertificateFieldList]): A certificate field that accepts multiple string values, e.g. + SANs. + province (Union[Unset, CertificateFieldList]): A certificate field that accepts multiple string values, e.g. + SANs. + sans (Union[Unset, CertificateFieldList]): A certificate field that accepts multiple string values, e.g. SANs. + street_address (Union[Unset, CertificateFieldList]): A certificate field that accepts multiple string values, + e.g. SANs. + """ + + common_name: Union["CertificateFieldDeviceMetadata", "CertificateFieldStatic", Unset] = UNSET + country: Union[Unset, "CertificateFieldList"] = UNSET + locality: Union[Unset, "CertificateFieldList"] = UNSET + organization: Union[Unset, "CertificateFieldList"] = UNSET + organizational_unit: Union[Unset, "CertificateFieldList"] = UNSET + postal_code: Union[Unset, "CertificateFieldList"] = UNSET + province: Union[Unset, "CertificateFieldList"] = UNSET + sans: Union[Unset, "CertificateFieldList"] = UNSET + street_address: Union[Unset, "CertificateFieldList"] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + from ..models.certificate_field_static import CertificateFieldStatic + + common_name: Union[Dict[str, Any], Unset] + if isinstance(self.common_name, Unset): + common_name = UNSET + elif isinstance(self.common_name, CertificateFieldStatic): + common_name = self.common_name.to_dict() + else: + common_name = self.common_name.to_dict() + + country: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.country, Unset): + country = self.country.to_dict() + + locality: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.locality, Unset): + locality = self.locality.to_dict() + + organization: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.organization, Unset): + organization = self.organization.to_dict() + + organizational_unit: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.organizational_unit, Unset): + organizational_unit = self.organizational_unit.to_dict() + + postal_code: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.postal_code, Unset): + postal_code = self.postal_code.to_dict() + + province: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.province, Unset): + province = self.province.to_dict() + + sans: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.sans, Unset): + sans = self.sans.to_dict() + + street_address: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.street_address, Unset): + street_address = self.street_address.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if common_name is not UNSET: + field_dict["commonName"] = common_name + if country is not UNSET: + field_dict["country"] = country + if locality is not UNSET: + field_dict["locality"] = locality + if organization is not UNSET: + field_dict["organization"] = organization + if organizational_unit is not UNSET: + field_dict["organizationalUnit"] = organizational_unit + if postal_code is not UNSET: + field_dict["postalCode"] = postal_code + if province is not UNSET: + field_dict["province"] = province + if sans is not UNSET: + field_dict["sans"] = sans + if street_address is not UNSET: + field_dict["streetAddress"] = street_address + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.certificate_field_device_metadata import CertificateFieldDeviceMetadata + from ..models.certificate_field_list import CertificateFieldList + from ..models.certificate_field_static import CertificateFieldStatic + + d = src_dict.copy() + + def _parse_common_name( + data: object, + ) -> Union["CertificateFieldDeviceMetadata", "CertificateFieldStatic", Unset]: + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemascertificate_field_type_0 = CertificateFieldStatic.from_dict(data) + + return componentsschemascertificate_field_type_0 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + componentsschemascertificate_field_type_1 = CertificateFieldDeviceMetadata.from_dict(data) + + return componentsschemascertificate_field_type_1 + + common_name = _parse_common_name(d.pop("commonName", UNSET)) + + _country = d.pop("country", UNSET) + country: Union[Unset, CertificateFieldList] + if isinstance(_country, Unset): + country = UNSET + else: + country = CertificateFieldList.from_dict(_country) + + _locality = d.pop("locality", UNSET) + locality: Union[Unset, CertificateFieldList] + if isinstance(_locality, Unset): + locality = UNSET + else: + locality = CertificateFieldList.from_dict(_locality) + + _organization = d.pop("organization", UNSET) + organization: Union[Unset, CertificateFieldList] + if isinstance(_organization, Unset): + organization = UNSET + else: + organization = CertificateFieldList.from_dict(_organization) + + _organizational_unit = d.pop("organizationalUnit", UNSET) + organizational_unit: Union[Unset, CertificateFieldList] + if isinstance(_organizational_unit, Unset): + organizational_unit = UNSET + else: + organizational_unit = CertificateFieldList.from_dict(_organizational_unit) + + _postal_code = d.pop("postalCode", UNSET) + postal_code: Union[Unset, CertificateFieldList] + if isinstance(_postal_code, Unset): + postal_code = UNSET + else: + postal_code = CertificateFieldList.from_dict(_postal_code) + + _province = d.pop("province", UNSET) + province: Union[Unset, CertificateFieldList] + if isinstance(_province, Unset): + province = UNSET + else: + province = CertificateFieldList.from_dict(_province) + + _sans = d.pop("sans", UNSET) + sans: Union[Unset, CertificateFieldList] + if isinstance(_sans, Unset): + sans = UNSET + else: + sans = CertificateFieldList.from_dict(_sans) + + _street_address = d.pop("streetAddress", UNSET) + street_address: Union[Unset, CertificateFieldList] + if isinstance(_street_address, Unset): + street_address = UNSET + else: + street_address = CertificateFieldList.from_dict(_street_address) + + x509_fields = cls( + common_name=common_name, + country=country, + locality=locality, + organization=organization, + organizational_unit=organizational_unit, + postal_code=postal_code, + province=province, + sans=sans, + street_address=street_address, + ) + + x509_fields.additional_properties = d + return x509_fields + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/smallstep/api_client/models/x509_issuer.py b/smallstep/api_client/models/x509_issuer.py index 804fa64..b537079 100644 --- a/smallstep/api_client/models/x509_issuer.py +++ b/smallstep/api_client/models/x509_issuer.py @@ -24,7 +24,7 @@ class X509Issuer: duration (Union[Unset, str]): The certificate lifetime. Parsed as a [Golang duration](https://pkg.go.dev/time#ParseDuration). max_path_length (Union[Unset, int]): - name_constraints (Union[Unset, NameConstraints]): X509 certificate name constratins. + name_constraints (Union[Unset, NameConstraints]): X509 certificate name constraints. subject (Union[Unset, DistinguishedName]): Name used in x509 certificates Example: [{'organization': 'admins'}]. """ @@ -41,8 +41,11 @@ def to_dict(self) -> Dict[str, Any]: key_version = self.key_version.value name = self.name + duration = self.duration + max_path_length = self.max_path_length + name_constraints: Union[Unset, Dict[str, Any]] = UNSET if not isinstance(self.name_constraints, Unset): name_constraints = self.name_constraints.to_dict() diff --git a/smallstep/api_client/types.py b/smallstep/api_client/types.py index 15700b8..21fac10 100644 --- a/smallstep/api_client/types.py +++ b/smallstep/api_client/types.py @@ -1,4 +1,5 @@ -""" Contains some shared types for properties """ +"""Contains some shared types for properties""" + from http import HTTPStatus from typing import BinaryIO, Generic, Literal, MutableMapping, Optional, Tuple, TypeVar @@ -41,4 +42,4 @@ class Response(Generic[T]): parsed: Optional[T] -__all__ = ["File", "Response", "FileJsonType"] +__all__ = ["File", "Response", "FileJsonType", "Unset", "UNSET"]