diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml
index 325b9c23..d34250e8 100644
--- a/.github/workflows/checks.yaml
+++ b/.github/workflows/checks.yaml
@@ -18,4 +18,6 @@ jobs:
with:
cache: true
- run: pdm install
+ - run: pdm run typecheck:all
+ - run: pdm run format --check
- run: pdm run test:unit
diff --git a/pdm.lock b/pdm.lock
index 698fabf6..6a9453da 100644
--- a/pdm.lock
+++ b/pdm.lock
@@ -5,7 +5,7 @@
groups = ["default", "chat", "test"]
strategy = ["inherit_metadata"]
lock_version = "4.5.0"
-content_hash = "sha256:797a6cf550f6ec6264f8e851a84dff73bd155ed75264cf80adf458c4a3ecb832"
+content_hash = "sha256:d469eb562d3f96a3079869d51794332527ddd78c05882b68bb6572a7cf796b43"
[[metadata.targets]]
requires_python = ">=3.10"
@@ -260,6 +260,135 @@ files = [
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
]
+[[package]]
+name = "coverage"
+version = "7.8.0"
+requires_python = ">=3.9"
+summary = "Code coverage measurement for Python"
+groups = ["test"]
+files = [
+ {file = "coverage-7.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2931f66991175369859b5fd58529cd4b73582461877ecfd859b6549869287ffe"},
+ {file = "coverage-7.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:52a523153c568d2c0ef8826f6cc23031dc86cffb8c6aeab92c4ff776e7951b28"},
+ {file = "coverage-7.8.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c8a5c139aae4c35cbd7cadca1df02ea8cf28a911534fc1b0456acb0b14234f3"},
+ {file = "coverage-7.8.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5a26c0c795c3e0b63ec7da6efded5f0bc856d7c0b24b2ac84b4d1d7bc578d676"},
+ {file = "coverage-7.8.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:821f7bcbaa84318287115d54becb1915eece6918136c6f91045bb84e2f88739d"},
+ {file = "coverage-7.8.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a321c61477ff8ee705b8a5fed370b5710c56b3a52d17b983d9215861e37b642a"},
+ {file = "coverage-7.8.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:ed2144b8a78f9d94d9515963ed273d620e07846acd5d4b0a642d4849e8d91a0c"},
+ {file = "coverage-7.8.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:042e7841a26498fff7a37d6fda770d17519982f5b7d8bf5278d140b67b61095f"},
+ {file = "coverage-7.8.0-cp310-cp310-win32.whl", hash = "sha256:f9983d01d7705b2d1f7a95e10bbe4091fabc03a46881a256c2787637b087003f"},
+ {file = "coverage-7.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:5a570cd9bd20b85d1a0d7b009aaf6c110b52b5755c17be6962f8ccd65d1dbd23"},
+ {file = "coverage-7.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e7ac22a0bb2c7c49f441f7a6d46c9c80d96e56f5a8bc6972529ed43c8b694e27"},
+ {file = "coverage-7.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bf13d564d310c156d1c8e53877baf2993fb3073b2fc9f69790ca6a732eb4bfea"},
+ {file = "coverage-7.8.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5761c70c017c1b0d21b0815a920ffb94a670c8d5d409d9b38857874c21f70d7"},
+ {file = "coverage-7.8.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e5ff52d790c7e1628241ffbcaeb33e07d14b007b6eb00a19320c7b8a7024c040"},
+ {file = "coverage-7.8.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d39fc4817fd67b3915256af5dda75fd4ee10621a3d484524487e33416c6f3543"},
+ {file = "coverage-7.8.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b44674870709017e4b4036e3d0d6c17f06a0e6d4436422e0ad29b882c40697d2"},
+ {file = "coverage-7.8.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8f99eb72bf27cbb167b636eb1726f590c00e1ad375002230607a844d9e9a2318"},
+ {file = "coverage-7.8.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b571bf5341ba8c6bc02e0baeaf3b061ab993bf372d982ae509807e7f112554e9"},
+ {file = "coverage-7.8.0-cp311-cp311-win32.whl", hash = "sha256:e75a2ad7b647fd8046d58c3132d7eaf31b12d8a53c0e4b21fa9c4d23d6ee6d3c"},
+ {file = "coverage-7.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:3043ba1c88b2139126fc72cb48574b90e2e0546d4c78b5299317f61b7f718b78"},
+ {file = "coverage-7.8.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:bbb5cc845a0292e0c520656d19d7ce40e18d0e19b22cb3e0409135a575bf79fc"},
+ {file = "coverage-7.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4dfd9a93db9e78666d178d4f08a5408aa3f2474ad4d0e0378ed5f2ef71640cb6"},
+ {file = "coverage-7.8.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f017a61399f13aa6d1039f75cd467be388d157cd81f1a119b9d9a68ba6f2830d"},
+ {file = "coverage-7.8.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0915742f4c82208ebf47a2b154a5334155ed9ef9fe6190674b8a46c2fb89cb05"},
+ {file = "coverage-7.8.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a40fcf208e021eb14b0fac6bdb045c0e0cab53105f93ba0d03fd934c956143a"},
+ {file = "coverage-7.8.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a1f406a8e0995d654b2ad87c62caf6befa767885301f3b8f6f73e6f3c31ec3a6"},
+ {file = "coverage-7.8.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:77af0f6447a582fdc7de5e06fa3757a3ef87769fbb0fdbdeba78c23049140a47"},
+ {file = "coverage-7.8.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:f2d32f95922927186c6dbc8bc60df0d186b6edb828d299ab10898ef3f40052fe"},
+ {file = "coverage-7.8.0-cp312-cp312-win32.whl", hash = "sha256:769773614e676f9d8e8a0980dd7740f09a6ea386d0f383db6821df07d0f08545"},
+ {file = "coverage-7.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:e5d2b9be5b0693cf21eb4ce0ec8d211efb43966f6657807f6859aab3814f946b"},
+ {file = "coverage-7.8.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5ac46d0c2dd5820ce93943a501ac5f6548ea81594777ca585bf002aa8854cacd"},
+ {file = "coverage-7.8.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:771eb7587a0563ca5bb6f622b9ed7f9d07bd08900f7589b4febff05f469bea00"},
+ {file = "coverage-7.8.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42421e04069fb2cbcbca5a696c4050b84a43b05392679d4068acbe65449b5c64"},
+ {file = "coverage-7.8.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:554fec1199d93ab30adaa751db68acec2b41c5602ac944bb19187cb9a41a8067"},
+ {file = "coverage-7.8.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5aaeb00761f985007b38cf463b1d160a14a22c34eb3f6a39d9ad6fc27cb73008"},
+ {file = "coverage-7.8.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:581a40c7b94921fffd6457ffe532259813fc68eb2bdda60fa8cc343414ce3733"},
+ {file = "coverage-7.8.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:f319bae0321bc838e205bf9e5bc28f0a3165f30c203b610f17ab5552cff90323"},
+ {file = "coverage-7.8.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:04bfec25a8ef1c5f41f5e7e5c842f6b615599ca8ba8391ec33a9290d9d2db3a3"},
+ {file = "coverage-7.8.0-cp313-cp313-win32.whl", hash = "sha256:dd19608788b50eed889e13a5d71d832edc34fc9dfce606f66e8f9f917eef910d"},
+ {file = "coverage-7.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:a9abbccd778d98e9c7e85038e35e91e67f5b520776781d9a1e2ee9d400869487"},
+ {file = "coverage-7.8.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:18c5ae6d061ad5b3e7eef4363fb27a0576012a7447af48be6c75b88494c6cf25"},
+ {file = "coverage-7.8.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:95aa6ae391a22bbbce1b77ddac846c98c5473de0372ba5c463480043a07bff42"},
+ {file = "coverage-7.8.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e013b07ba1c748dacc2a80e69a46286ff145935f260eb8c72df7185bf048f502"},
+ {file = "coverage-7.8.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d766a4f0e5aa1ba056ec3496243150698dc0481902e2b8559314368717be82b1"},
+ {file = "coverage-7.8.0-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad80e6b4a0c3cb6f10f29ae4c60e991f424e6b14219d46f1e7d442b938ee68a4"},
+ {file = "coverage-7.8.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:b87eb6fc9e1bb8f98892a2458781348fa37e6925f35bb6ceb9d4afd54ba36c73"},
+ {file = "coverage-7.8.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:d1ba00ae33be84066cfbe7361d4e04dec78445b2b88bdb734d0d1cbab916025a"},
+ {file = "coverage-7.8.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:f3c38e4e5ccbdc9198aecc766cedbb134b2d89bf64533973678dfcf07effd883"},
+ {file = "coverage-7.8.0-cp313-cp313t-win32.whl", hash = "sha256:379fe315e206b14e21db5240f89dc0774bdd3e25c3c58c2c733c99eca96f1ada"},
+ {file = "coverage-7.8.0-cp313-cp313t-win_amd64.whl", hash = "sha256:2e4b6b87bb0c846a9315e3ab4be2d52fac905100565f4b92f02c445c8799e257"},
+ {file = "coverage-7.8.0-pp39.pp310.pp311-none-any.whl", hash = "sha256:b8194fb8e50d556d5849753de991d390c5a1edeeba50f68e3a9253fbd8bf8ccd"},
+ {file = "coverage-7.8.0-py3-none-any.whl", hash = "sha256:dbf364b4c5e7bae9250528167dfe40219b62e2d573c854d74be213e1e52069f7"},
+ {file = "coverage-7.8.0.tar.gz", hash = "sha256:7a3d62b3b03b4b6fd41a085f3574874cf946cb4604d2b4d3e8dca8cd570ca501"},
+]
+
+[[package]]
+name = "coverage"
+version = "7.8.0"
+extras = ["toml"]
+requires_python = ">=3.9"
+summary = "Code coverage measurement for Python"
+groups = ["test"]
+dependencies = [
+ "coverage==7.8.0",
+ "tomli; python_full_version <= \"3.11.0a6\"",
+]
+files = [
+ {file = "coverage-7.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2931f66991175369859b5fd58529cd4b73582461877ecfd859b6549869287ffe"},
+ {file = "coverage-7.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:52a523153c568d2c0ef8826f6cc23031dc86cffb8c6aeab92c4ff776e7951b28"},
+ {file = "coverage-7.8.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c8a5c139aae4c35cbd7cadca1df02ea8cf28a911534fc1b0456acb0b14234f3"},
+ {file = "coverage-7.8.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5a26c0c795c3e0b63ec7da6efded5f0bc856d7c0b24b2ac84b4d1d7bc578d676"},
+ {file = "coverage-7.8.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:821f7bcbaa84318287115d54becb1915eece6918136c6f91045bb84e2f88739d"},
+ {file = "coverage-7.8.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a321c61477ff8ee705b8a5fed370b5710c56b3a52d17b983d9215861e37b642a"},
+ {file = "coverage-7.8.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:ed2144b8a78f9d94d9515963ed273d620e07846acd5d4b0a642d4849e8d91a0c"},
+ {file = "coverage-7.8.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:042e7841a26498fff7a37d6fda770d17519982f5b7d8bf5278d140b67b61095f"},
+ {file = "coverage-7.8.0-cp310-cp310-win32.whl", hash = "sha256:f9983d01d7705b2d1f7a95e10bbe4091fabc03a46881a256c2787637b087003f"},
+ {file = "coverage-7.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:5a570cd9bd20b85d1a0d7b009aaf6c110b52b5755c17be6962f8ccd65d1dbd23"},
+ {file = "coverage-7.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e7ac22a0bb2c7c49f441f7a6d46c9c80d96e56f5a8bc6972529ed43c8b694e27"},
+ {file = "coverage-7.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bf13d564d310c156d1c8e53877baf2993fb3073b2fc9f69790ca6a732eb4bfea"},
+ {file = "coverage-7.8.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5761c70c017c1b0d21b0815a920ffb94a670c8d5d409d9b38857874c21f70d7"},
+ {file = "coverage-7.8.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e5ff52d790c7e1628241ffbcaeb33e07d14b007b6eb00a19320c7b8a7024c040"},
+ {file = "coverage-7.8.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d39fc4817fd67b3915256af5dda75fd4ee10621a3d484524487e33416c6f3543"},
+ {file = "coverage-7.8.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b44674870709017e4b4036e3d0d6c17f06a0e6d4436422e0ad29b882c40697d2"},
+ {file = "coverage-7.8.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8f99eb72bf27cbb167b636eb1726f590c00e1ad375002230607a844d9e9a2318"},
+ {file = "coverage-7.8.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b571bf5341ba8c6bc02e0baeaf3b061ab993bf372d982ae509807e7f112554e9"},
+ {file = "coverage-7.8.0-cp311-cp311-win32.whl", hash = "sha256:e75a2ad7b647fd8046d58c3132d7eaf31b12d8a53c0e4b21fa9c4d23d6ee6d3c"},
+ {file = "coverage-7.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:3043ba1c88b2139126fc72cb48574b90e2e0546d4c78b5299317f61b7f718b78"},
+ {file = "coverage-7.8.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:bbb5cc845a0292e0c520656d19d7ce40e18d0e19b22cb3e0409135a575bf79fc"},
+ {file = "coverage-7.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4dfd9a93db9e78666d178d4f08a5408aa3f2474ad4d0e0378ed5f2ef71640cb6"},
+ {file = "coverage-7.8.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f017a61399f13aa6d1039f75cd467be388d157cd81f1a119b9d9a68ba6f2830d"},
+ {file = "coverage-7.8.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0915742f4c82208ebf47a2b154a5334155ed9ef9fe6190674b8a46c2fb89cb05"},
+ {file = "coverage-7.8.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a40fcf208e021eb14b0fac6bdb045c0e0cab53105f93ba0d03fd934c956143a"},
+ {file = "coverage-7.8.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a1f406a8e0995d654b2ad87c62caf6befa767885301f3b8f6f73e6f3c31ec3a6"},
+ {file = "coverage-7.8.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:77af0f6447a582fdc7de5e06fa3757a3ef87769fbb0fdbdeba78c23049140a47"},
+ {file = "coverage-7.8.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:f2d32f95922927186c6dbc8bc60df0d186b6edb828d299ab10898ef3f40052fe"},
+ {file = "coverage-7.8.0-cp312-cp312-win32.whl", hash = "sha256:769773614e676f9d8e8a0980dd7740f09a6ea386d0f383db6821df07d0f08545"},
+ {file = "coverage-7.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:e5d2b9be5b0693cf21eb4ce0ec8d211efb43966f6657807f6859aab3814f946b"},
+ {file = "coverage-7.8.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5ac46d0c2dd5820ce93943a501ac5f6548ea81594777ca585bf002aa8854cacd"},
+ {file = "coverage-7.8.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:771eb7587a0563ca5bb6f622b9ed7f9d07bd08900f7589b4febff05f469bea00"},
+ {file = "coverage-7.8.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42421e04069fb2cbcbca5a696c4050b84a43b05392679d4068acbe65449b5c64"},
+ {file = "coverage-7.8.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:554fec1199d93ab30adaa751db68acec2b41c5602ac944bb19187cb9a41a8067"},
+ {file = "coverage-7.8.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5aaeb00761f985007b38cf463b1d160a14a22c34eb3f6a39d9ad6fc27cb73008"},
+ {file = "coverage-7.8.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:581a40c7b94921fffd6457ffe532259813fc68eb2bdda60fa8cc343414ce3733"},
+ {file = "coverage-7.8.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:f319bae0321bc838e205bf9e5bc28f0a3165f30c203b610f17ab5552cff90323"},
+ {file = "coverage-7.8.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:04bfec25a8ef1c5f41f5e7e5c842f6b615599ca8ba8391ec33a9290d9d2db3a3"},
+ {file = "coverage-7.8.0-cp313-cp313-win32.whl", hash = "sha256:dd19608788b50eed889e13a5d71d832edc34fc9dfce606f66e8f9f917eef910d"},
+ {file = "coverage-7.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:a9abbccd778d98e9c7e85038e35e91e67f5b520776781d9a1e2ee9d400869487"},
+ {file = "coverage-7.8.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:18c5ae6d061ad5b3e7eef4363fb27a0576012a7447af48be6c75b88494c6cf25"},
+ {file = "coverage-7.8.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:95aa6ae391a22bbbce1b77ddac846c98c5473de0372ba5c463480043a07bff42"},
+ {file = "coverage-7.8.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e013b07ba1c748dacc2a80e69a46286ff145935f260eb8c72df7185bf048f502"},
+ {file = "coverage-7.8.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d766a4f0e5aa1ba056ec3496243150698dc0481902e2b8559314368717be82b1"},
+ {file = "coverage-7.8.0-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad80e6b4a0c3cb6f10f29ae4c60e991f424e6b14219d46f1e7d442b938ee68a4"},
+ {file = "coverage-7.8.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:b87eb6fc9e1bb8f98892a2458781348fa37e6925f35bb6ceb9d4afd54ba36c73"},
+ {file = "coverage-7.8.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:d1ba00ae33be84066cfbe7361d4e04dec78445b2b88bdb734d0d1cbab916025a"},
+ {file = "coverage-7.8.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:f3c38e4e5ccbdc9198aecc766cedbb134b2d89bf64533973678dfcf07effd883"},
+ {file = "coverage-7.8.0-cp313-cp313t-win32.whl", hash = "sha256:379fe315e206b14e21db5240f89dc0774bdd3e25c3c58c2c733c99eca96f1ada"},
+ {file = "coverage-7.8.0-cp313-cp313t-win_amd64.whl", hash = "sha256:2e4b6b87bb0c846a9315e3ab4be2d52fac905100565f4b92f02c445c8799e257"},
+ {file = "coverage-7.8.0-pp39.pp310.pp311-none-any.whl", hash = "sha256:b8194fb8e50d556d5849753de991d390c5a1edeeba50f68e3a9253fbd8bf8ccd"},
+ {file = "coverage-7.8.0-py3-none-any.whl", hash = "sha256:dbf364b4c5e7bae9250528167dfe40219b62e2d573c854d74be213e1e52069f7"},
+ {file = "coverage-7.8.0.tar.gz", hash = "sha256:7a3d62b3b03b4b6fd41a085f3574874cf946cb4604d2b4d3e8dca8cd570ca501"},
+]
+
[[package]]
name = "distro"
version = "1.9.0"
@@ -364,12 +493,26 @@ files = [
{file = "gradio_client-1.8.0.tar.gz", hash = "sha256:a58c520c73fa7ff8bef54e41b19df2cd9071fd9d0cc00475eb397842baed19c8"},
]
+[[package]]
+name = "grpc-stubs"
+version = "1.53.0.6"
+requires_python = ">=3.6"
+summary = "Mypy stubs for gRPC"
+groups = ["test"]
+dependencies = [
+ "grpcio",
+]
+files = [
+ {file = "grpc_stubs-1.53.0.6-py3-none-any.whl", hash = "sha256:3ffc5a6b5bd84ac46f3d84e2434e97936c1262b47b71b462bdedc43caaf227e1"},
+ {file = "grpc_stubs-1.53.0.6.tar.gz", hash = "sha256:70a0840747bd73c2c82fe819699bbf4fcf6d59bd0ed27a4713a240e0c697e1ff"},
+]
+
[[package]]
name = "grpcio"
version = "1.71.0"
requires_python = ">=3.9"
summary = "HTTP/2-based RPC framework"
-groups = ["default"]
+groups = ["default", "test"]
files = [
{file = "grpcio-1.71.0-cp310-cp310-linux_armv7l.whl", hash = "sha256:c200cb6f2393468142eb50ab19613229dcc7829b5ccee8b658a36005f6669fdd"},
{file = "grpcio-1.71.0-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:b2266862c5ad664a380fbbcdbdb8289d71464c42a8c29053820ee78ba0119e5d"},
@@ -761,6 +904,46 @@ files = [
{file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"},
]
+[[package]]
+name = "mypy"
+version = "1.15.0"
+requires_python = ">=3.9"
+summary = "Optional static typing for Python"
+groups = ["test"]
+dependencies = [
+ "mypy-extensions>=1.0.0",
+ "tomli>=1.1.0; python_version < \"3.11\"",
+ "typing-extensions>=4.6.0",
+]
+files = [
+ {file = "mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13"},
+ {file = "mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559"},
+ {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b"},
+ {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3"},
+ {file = "mypy-1.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b"},
+ {file = "mypy-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828"},
+ {file = "mypy-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f"},
+ {file = "mypy-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5"},
+ {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e"},
+ {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c"},
+ {file = "mypy-1.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f"},
+ {file = "mypy-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f"},
+ {file = "mypy-1.15.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd"},
+ {file = "mypy-1.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f"},
+ {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464"},
+ {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee"},
+ {file = "mypy-1.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e"},
+ {file = "mypy-1.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22"},
+ {file = "mypy-1.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445"},
+ {file = "mypy-1.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d"},
+ {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5"},
+ {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036"},
+ {file = "mypy-1.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357"},
+ {file = "mypy-1.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf"},
+ {file = "mypy-1.15.0-py3-none-any.whl", hash = "sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e"},
+ {file = "mypy-1.15.0.tar.gz", hash = "sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43"},
+]
+
[[package]]
name = "mypy-extensions"
version = "1.0.0"
@@ -1049,6 +1232,19 @@ files = [
{file = "protobuf-5.29.4.tar.gz", hash = "sha256:4f1dfcd7997b31ef8f53ec82781ff434a28bf71d9102ddde14d076adcfc78c99"},
]
+[[package]]
+name = "py-machineid"
+version = "0.7.0"
+summary = "Get the unique machine ID of any host (without admin privileges)"
+groups = ["default"]
+dependencies = [
+ "winregistry<3.0.0,>=2.0.1; sys_platform == \"win32\"",
+]
+files = [
+ {file = "py-machineid-0.7.0.tar.gz", hash = "sha256:5a74a810e38b57b043b145c756c1e6ac161529cb7d83fe20099fcb986acc577b"},
+ {file = "py_machineid-0.7.0-py3-none-any.whl", hash = "sha256:3dacc322b0511383d79f1e817a2710b19bcfb820a4c7cea34aaa329775fef468"},
+]
+
[[package]]
name = "pyarrow"
version = "19.0.1"
@@ -1093,19 +1289,6 @@ files = [
{file = "pyarrow-19.0.1.tar.gz", hash = "sha256:3bf266b485df66a400f282ac0b6d1b500b9d2ae73314a153dbe97d6d5cc8a99e"},
]
-[[package]]
-name = "py-machineid"
-version = "0.7.0"
-summary = "Get the unique machine ID of any host (without admin privileges)"
-groups = ["default"]
-dependencies = [
- "winregistry<3.0.0,>=2.0.1; sys_platform == \"win32\"",
-]
-files = [
- {file = "py-machineid-0.7.0.tar.gz", hash = "sha256:5a74a810e38b57b043b145c756c1e6ac161529cb7d83fe20099fcb986acc577b"},
- {file = "py_machineid-0.7.0-py3-none-any.whl", hash = "sha256:3dacc322b0511383d79f1e817a2710b19bcfb820a4c7cea34aaa329775fef468"},
-]
-
[[package]]
name = "pydantic"
version = "2.11.2"
@@ -1292,6 +1475,21 @@ files = [
{file = "pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845"},
]
+[[package]]
+name = "pytest-cov"
+version = "6.1.1"
+requires_python = ">=3.9"
+summary = "Pytest plugin for measuring coverage."
+groups = ["test"]
+dependencies = [
+ "coverage[toml]>=7.5",
+ "pytest>=4.6",
+]
+files = [
+ {file = "pytest_cov-6.1.1-py3-none-any.whl", hash = "sha256:bddf29ed2d0ab6f4df17b4c55b0a657287db8684af9c42ea546b21b1041b3dde"},
+ {file = "pytest_cov-6.1.1.tar.gz", hash = "sha256:46935f7aaefba760e716c2ebfbe1c216240b9592966e7da99ea8292d4d3e2a0a"},
+]
+
[[package]]
name = "pytest-mock"
version = "3.14.0"
@@ -1766,6 +1964,64 @@ files = [
{file = "tqdm-4.67.1.tar.gz", hash = "sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2"},
]
+[[package]]
+name = "types-pillow"
+version = "10.2.0.20240822"
+requires_python = ">=3.8"
+summary = "Typing stubs for Pillow"
+groups = ["test"]
+files = [
+ {file = "types-Pillow-10.2.0.20240822.tar.gz", hash = "sha256:559fb52a2ef991c326e4a0d20accb3bb63a7ba8d40eb493e0ecb0310ba52f0d3"},
+ {file = "types_Pillow-10.2.0.20240822-py3-none-any.whl", hash = "sha256:d9dab025aba07aeb12fd50a6799d4eac52a9603488eca09d7662543983f16c5d"},
+]
+
+[[package]]
+name = "types-protobuf"
+version = "5.29.1.20250403"
+requires_python = ">=3.9"
+summary = "Typing stubs for protobuf"
+groups = ["test"]
+files = [
+ {file = "types_protobuf-5.29.1.20250403-py3-none-any.whl", hash = "sha256:c71de04106a2d54e5b2173d0a422058fae0ef2d058d70cf369fb797bf61ffa59"},
+ {file = "types_protobuf-5.29.1.20250403.tar.gz", hash = "sha256:7ff44f15022119c9d7558ce16e78b2d485bf7040b4fadced4dd069bb5faf77a2"},
+]
+
+[[package]]
+name = "types-pyperclip"
+version = "1.9.0.20250218"
+requires_python = ">=3.9"
+summary = "Typing stubs for pyperclip"
+groups = ["test"]
+files = [
+ {file = "types_pyperclip-1.9.0.20250218-py3-none-any.whl", hash = "sha256:305afab7efb6fbcc77d9690bf660cf24baa06e30c2db7d12dd1f1602b2094a27"},
+ {file = "types_pyperclip-1.9.0.20250218.tar.gz", hash = "sha256:8c03a16c17fae2b1e527e4b3505d711a77d9aa9961763026cc75fba4d32469e5"},
+]
+
+[[package]]
+name = "types-python-dateutil"
+version = "2.9.0.20241206"
+requires_python = ">=3.8"
+summary = "Typing stubs for python-dateutil"
+groups = ["test"]
+files = [
+ {file = "types_python_dateutil-2.9.0.20241206-py3-none-any.whl", hash = "sha256:e248a4bc70a486d3e3ec84d0dc30eec3a5f979d6e7ee4123ae043eedbb987f53"},
+ {file = "types_python_dateutil-2.9.0.20241206.tar.gz", hash = "sha256:18f493414c26ffba692a72369fea7a154c502646301ebfe3d56a04b3767284cb"},
+]
+
+[[package]]
+name = "types-requests"
+version = "2.32.0.20250328"
+requires_python = ">=3.9"
+summary = "Typing stubs for requests"
+groups = ["test"]
+dependencies = [
+ "urllib3>=2",
+]
+files = [
+ {file = "types_requests-2.32.0.20250328-py3-none-any.whl", hash = "sha256:72ff80f84b15eb3aa7a8e2625fffb6a93f2ad5a0c20215fc1dcfa61117bcb2a2"},
+ {file = "types_requests-2.32.0.20250328.tar.gz", hash = "sha256:c9e67228ea103bd811c96984fac36ed2ae8da87a36a633964a21f199d60baf32"},
+]
+
[[package]]
name = "typing-extensions"
version = "4.13.1"
@@ -1807,7 +2063,7 @@ name = "urllib3"
version = "2.3.0"
requires_python = ">=3.9"
summary = "HTTP library with thread-safe connection pooling, file post, and more."
-groups = ["default", "chat"]
+groups = ["default", "chat", "test"]
files = [
{file = "urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df"},
{file = "urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d"},
diff --git a/pyproject.toml b/pyproject.toml
index e3cc885a..b6471ce9 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -43,22 +43,146 @@ test = "pytest -n auto"
"test:e2e" = "pytest -n auto tests/e2e"
"test:integration" = "pytest -n auto tests/integration"
"test:unit" = "pytest -n auto tests/unit"
-sort = "isort ."
-format = "black ."
-lint = "ruff check ."
-checks = {composite = ["sort . -c", "format . --check"]}
-fix = {composite = ["sort", "format", "lint"]}
+"test:cov:view" = "python -m http.server --directory htmlcov"
+format = "ruff format src tests"
+lint = "ruff check src tests"
+"lint:fix" = "ruff check --fix src tests"
+typecheck = "mypy"
+"typecheck:all" = "mypy src tests"
chat = "streamlit run src/askui/chat/__main__.py"
[dependency-groups]
test = [
"pytest>=8.3.4",
- "isort>=6.0.0",
- "black>=25.1.0",
"ruff>=0.9.5",
"pytest-mock>=3.14.0",
"pytest-xdist>=3.6.1",
+ "pytest-cov>=4.1.0",
+ "mypy>=1.9.0",
+ "types-requests>=2.31.0.20240311",
+ "types-python-dateutil>=2.8.19.20240106",
+ "types-Pillow>=10.2.0.20240311",
+ "types-protobuf>=4.24.0.20240311",
+ "grpc-stubs>=1.53.0.3",
+ "types-pyperclip>=1.8.2.20240311",
]
chat = [
"streamlit>=1.42.0",
]
+
+[tool.pytest.ini_options]
+addopts = "--cov=src/askui --cov-report=html"
+testpaths = ["tests"]
+python_files = ["test_*.py"]
+python_classes = ["Test*"]
+python_functions = ["test_*"]
+
+[tool.mypy]
+python_version = "3.10"
+warn_return_any = true
+warn_unused_configs = true
+disallow_untyped_defs = true
+disallow_incomplete_defs = true
+check_untyped_defs = true
+disallow_untyped_decorators = true
+no_implicit_optional = true
+warn_redundant_casts = true
+warn_unused_ignores = true
+warn_no_return = true
+warn_unreachable = true
+strict_optional = true
+plugins = ["pydantic.mypy"]
+exclude = [
+ "src/askui/chat/.*",
+ "src/askui/models/ui_tars_ep/ui_tars_api.py",
+ "src/askui/tools/anthropic/computer.py",
+ "src/askui/tools/askui/askui_ui_controller_grpc/.*",
+ "src/askui/tools/askui/askui_workspaces/.*",
+]
+mypy_path = "src"
+explicit_package_bases = true
+namespace_packages = true
+
+[tool.ruff]
+# Exclude a variety of commonly ignored directories.
+exclude = [
+ ".bzr",
+ ".direnv",
+ ".eggs",
+ ".git",
+ ".git-rewrite",
+ ".hg",
+ ".mypy_cache",
+ ".nox",
+ ".pants.d",
+ ".pytype",
+ ".ruff_cache",
+ ".svn",
+ ".tox",
+ ".venv",
+ "__pypackages__",
+ "_build",
+ "buck-out",
+ "build",
+ "dist",
+ "node_modules",
+ "venv",
+]
+
+# Same as Black.
+line-length = 88
+
+# Assume Python 3.10
+target-version = "py310"
+
+[tool.ruff.format]
+quote-style = "double"
+indent-style = "space"
+skip-magic-trailing-comma = false
+line-ending = "auto"
+
+[tool.ruff.lint]
+# Enable all rules
+select = ["ALL"]
+ignore = [
+ "ANN", # Type annotations - handled by mypy
+ "COM812", # Unused import
+ "D", # Documentation - we'll handle this separately
+ "ERA", # Commented out code
+ "FBT", # Boolean trap
+ "ICN", # Import conventions
+ "ISC", # Implicit string concatenation
+ "N", # Naming
+ "PGH", # PyGithub
+ "PL", # Pylint
+ "PT", # Pytest
+ "Q", # Quotes
+ "RUF", # Ruff-specific rules
+ "S", # Bandit
+ "SIM", # Simplify
+ "T", # Pycodestyle
+ "TID", # isort
+ "UP", # Pyupgrade
+ "W", # Pycodestyle
+ "YTT", # flake8-2020
+]
+
+# Allow autofix for all enabled rules
+fixable = ["ALL"]
+unfixable = []
+
+# Allow unused variables when underscore-prefixed.
+dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
+
+[tool.ruff.lint.per-file-ignores]
+"tests/*" = ["S101", "PLR2004"]
+"src/askui/chat/*" = ["F401", "F403"]
+
+[tool.ruff.lint.flake8-quotes]
+docstring-quotes = "double"
+inline-quotes = "double"
+multiline-quotes = "double"
+
+[tool.ruff.lint.isort]
+known-first-party = ["askui"]
+known-third-party = ["pytest", "mypy"]
diff --git a/src/askui/agent.py b/src/askui/agent.py
index 2f72af64..ddaecc8b 100644
--- a/src/askui/agent.py
+++ b/src/askui/agent.py
@@ -1,24 +1,26 @@
import logging
import subprocess
-from typing import Annotated, Any, Literal, Optional, Type, overload
+import time
+import types
+from typing import Annotated, Literal, Optional, Type, overload
+
+from dotenv import load_dotenv
from pydantic import ConfigDict, Field, validate_call
from askui.container import telemetry
from askui.locators.locators import Locator
from askui.utils.image_utils import ImageSource, Img
+from .logger import configure_logging, logger
+from .models import ModelComposition
+from .models.router import ModelRouter, Point
+from .models.types.response_schemas import ResponseSchema
+from .reporting import CompositeReporter, Reporter
+from .tools import AgentToolbox, ModifierKey, PcKey
from .tools.askui import (
AskUiControllerClient,
AskUiControllerServer,
)
-from .logger import logger, configure_logging
-from .tools import AgentToolbox, ModifierKey, PcKey
-from .models import ModelComposition
-from .models.router import ModelRouter, Point
-from .reporting import CompositeReporter, Reporter
-import time
-from dotenv import load_dotenv
-from .models.types.response_schemas import ResponseSchema
class VisionAgent:
@@ -39,13 +41,14 @@ class VisionAgent:
Example:
```python
from askui import VisionAgent
-
+
with VisionAgent() as agent:
agent.click("Submit button")
agent.type("Hello World")
agent.act("Open settings menu")
```
"""
+
@telemetry.record_call(exclude={"model_router", "reporters", "tools"})
@validate_call(config=ConfigDict(arbitrary_types_allowed=True))
def __init__(
@@ -63,12 +66,14 @@ def __init__(
self.tools = tools or AgentToolbox(
agent_os=AskUiControllerClient(
display=display,
- reporter=self._reporter,
- controller_server=AskUiControllerServer()
+ reporter=self._reporter,
+ controller_server=AskUiControllerServer(),
),
)
self.model_router = (
- ModelRouter(tools=self.tools, reporter=self._reporter) if model_router is None else model_router
+ ModelRouter(tools=self.tools, reporter=self._reporter)
+ if model_router is None
+ else model_router
)
self._model = model
@@ -77,7 +82,7 @@ def __init__(
def click(
self,
locator: Optional[str | Locator] = None,
- button: Literal['left', 'middle', 'right'] = 'left',
+ button: Literal["left", "middle", "right"] = "left",
repeat: Annotated[int, Field(gt=0)] = 1,
model: ModelComposition | str | None = None,
) -> None:
@@ -93,7 +98,7 @@ def click(
Example:
```python
from askui import VisionAgent
-
+
with VisionAgent() as agent:
agent.click() # Left click on current position
agent.click("Edit") # Left click on text "Edit"
@@ -102,25 +107,34 @@ def click(
agent.click("Edit", button="middle", repeat=4) # 4x middle click on text "Edit"
```
"""
- msg = 'click'
- if button != 'left':
- msg = f'{button} ' + msg
+ msg = "click"
+ if button != "left":
+ msg = f"{button} " + msg
if repeat > 1:
- msg += f' {repeat}x times'
+ msg += f" {repeat}x times"
if locator is not None:
- msg += f' on {locator}'
+ msg += f" on {locator}"
self._reporter.add_message("User", msg)
if locator is not None:
logger.debug("VisionAgent received instruction to click on %s", locator)
self._mouse_move(locator, model or self._model)
- self.tools.agent_os.click(button, repeat) # type: ignore
-
- def _locate(self, locator: str | Locator, screenshot: Optional[Img] = None, model: ModelComposition | str | None = None) -> Point:
- _screenshot = ImageSource(self.tools.agent_os.screenshot() if screenshot is None else screenshot)
- point = self.model_router.locate(_screenshot.root, locator, model or self._model)
+ self.tools.agent_os.click(button, repeat)
+
+ def _locate(
+ self,
+ locator: str | Locator,
+ screenshot: Optional[Img] = None,
+ model: ModelComposition | str | None = None,
+ ) -> Point:
+ _screenshot = ImageSource(
+ self.tools.agent_os.screenshot() if screenshot is None else screenshot
+ )
+ point = self.model_router.locate(
+ _screenshot.root, locator, model or self._model
+ )
self._reporter.add_message("ModelRouter", f"locate: ({point[0]}, {point[1]})")
return point
-
+
@validate_call(config=ConfigDict(arbitrary_types_allowed=True))
def locate(
self,
@@ -142,7 +156,7 @@ def locate(
Example:
```python
from askui import VisionAgent
-
+
with VisionAgent() as agent:
point = agent.locate("Submit button")
print(f"Element found at coordinates: {point}")
@@ -152,9 +166,11 @@ def locate(
logger.debug("VisionAgent received instruction to locate %s", locator)
return self._locate(locator, screenshot, model or self._model)
- def _mouse_move(self, locator: str | Locator, model: ModelComposition | str | None = None) -> None:
+ def _mouse_move(
+ self, locator: str | Locator, model: ModelComposition | str | None = None
+ ) -> None:
point = self._locate(locator=locator, model=model or self._model)
- self.tools.agent_os.mouse(point[0], point[1]) # type: ignore
+ self.tools.agent_os.mouse(point[0], point[1])
@telemetry.record_call(exclude={"locator"})
@validate_call(config=ConfigDict(arbitrary_types_allowed=True))
@@ -180,7 +196,7 @@ def mouse_move(
agent.mouse_move("Profile picture", model="custom_model") # Uses specific model
```
"""
- self._reporter.add_message("User", f'mouse_move: {locator}')
+ self._reporter.add_message("User", f"mouse_move: {locator}")
logger.debug("VisionAgent received instruction to mouse_move to %s", locator)
self._mouse_move(locator, model or self._model)
@@ -201,7 +217,7 @@ def mouse_scroll(
Note:
The actual scroll direction depends on the operating system's configuration.
Some systems may have "natural scrolling" enabled, which reverses the traditional direction.
-
+
The meaning of scroll units varies across operating systems and applications.
A scroll value of `10` might result in different distances depending on the application and system settings.
@@ -242,23 +258,22 @@ def type(
"""
self._reporter.add_message("User", f'type: "{text}"')
logger.debug("VisionAgent received instruction to type '%s'", text)
- self.tools.agent_os.type(text) # type: ignore
-
+ self.tools.agent_os.type(text)
@overload
def get(
self,
query: Annotated[str, Field(min_length=1)],
- response_schema: None = None,
image: Optional[Img] = None,
+ response_schema: None = None,
model: ModelComposition | str | None = None,
) -> str: ...
@overload
def get(
self,
query: Annotated[str, Field(min_length=1)],
+ image: Optional[Img],
response_schema: Type[ResponseSchema],
- image: Optional[Img] = None,
model: ModelComposition | str | None = None,
) -> ResponseSchema: ...
@@ -298,7 +313,7 @@ class UrlResponse(JsonSchemaBase):
with VisionAgent() as agent:
# Get URL as string
url = agent.get("What is the current url shown in the url bar?")
-
+
# Get URL as Pydantic model from image at (relative) path
response = agent.get(
"What is the current url shown in the url bar?",
@@ -328,7 +343,9 @@ class UrlResponse(JsonSchemaBase):
```
"""
logger.debug("VisionAgent received instruction to get '%s'", query)
- _image = ImageSource(self.tools.agent_os.screenshot() if image is None else image) # type: ignore
+ _image = ImageSource(
+ self.tools.agent_os.screenshot() if image is None else image
+ )
self._reporter.add_message("User", f'get: "{query}"', image=_image.root)
response = self.model_router.get_inference(
image=_image,
@@ -337,10 +354,14 @@ class UrlResponse(JsonSchemaBase):
response_schema=response_schema,
)
if self._reporter is not None:
- message_content = str(response) if isinstance(response, (str, bool, int, float)) else response.model_dump()
+ message_content = (
+ str(response)
+ if isinstance(response, (str, bool, int, float))
+ else response.model_dump()
+ )
self._reporter.add_message("Agent", message_content)
return response
-
+
@telemetry.record_call()
@validate_call
def wait(
@@ -474,7 +495,7 @@ def keyboard(
```
"""
logger.debug("VisionAgent received instruction to press '%s'", key)
- self.tools.agent_os.keyboard_tap(key, modifier_keys) # type: ignore
+ self.tools.agent_os.keyboard_tap(key, modifier_keys)
@telemetry.record_call(exclude={"command"})
@validate_call
@@ -508,7 +529,7 @@ def cli(
def close(self) -> None:
self.tools.agent_os.disconnect()
self._reporter.generate()
-
+
@telemetry.record_call()
def open(self) -> None:
self.tools.agent_os.connect()
@@ -521,8 +542,8 @@ def __enter__(self) -> "VisionAgent":
@telemetry.record_call(exclude={"exc_value", "traceback"})
def __exit__(
self,
- exc_type: Optional[Type[BaseException]],
- exc_value: Optional[BaseException],
- traceback: Optional[Any],
+ exc_type: Type[BaseException] | None,
+ exc_value: BaseException | None,
+ traceback: types.TracebackType | None,
) -> None:
self.close()
diff --git a/src/askui/chat/__main__.py b/src/askui/chat/__main__.py
index 97cf18b2..a270dfe3 100644
--- a/src/askui/chat/__main__.py
+++ b/src/askui/chat/__main__.py
@@ -1,22 +1,21 @@
+import glob
+import json
+import logging
+import os
+import re
+from datetime import datetime
from random import randint
-from PIL import Image, ImageDraw
from typing import Union
-from typing_extensions import override, TypedDict
+
import streamlit as st
+from PIL import Image, ImageDraw
+from typing_extensions import TypedDict, override
+
from askui import VisionAgent
-import logging
from askui.chat.click_recorder import ClickRecorder
from askui.models import ModelName
from askui.reporting import Reporter
-from askui.utils.image_utils import base64_to_image
-import json
-from datetime import datetime
-import os
-import glob
-import re
-
-from askui.utils.image_utils import draw_point_on_image
-
+from askui.utils.image_utils import base64_to_image, draw_point_on_image
st.set_page_config(
page_title="Vision Agent Chat",
@@ -70,13 +69,22 @@ def write_message(
role: str,
content: str | dict | list,
timestamp: str,
- image: Image.Image | str | list[str | Image.Image] | list[str] | list[Image.Image] | None = None,
+ image: Image.Image
+ | str
+ | list[str | Image.Image]
+ | list[str]
+ | list[Image.Image]
+ | None = None,
):
_role = ROLE_MAP.get(role.lower(), UNKNOWN_ROLE)
avatar = None if _role != UNKNOWN_ROLE else "❔"
with st.chat_message(_role, avatar=avatar):
st.markdown(f"*{timestamp}* - **{role}**\n\n")
- st.markdown(json.dumps(content, indent=2) if isinstance(content, (dict, list)) else content)
+ st.markdown(
+ json.dumps(content, indent=2)
+ if isinstance(content, (dict, list))
+ else content
+ )
if image:
if isinstance(image, list):
for img in image:
@@ -106,7 +114,12 @@ def __init__(self, session_id: str) -> None:
self._session_id = session_id
@override
- def add_message(self, role: str, content: Union[str, dict, list], image: Image.Image | list[Image.Image] | None = None) -> None:
+ def add_message(
+ self,
+ role: str,
+ content: Union[str, dict, list],
+ image: Image.Image | list[Image.Image] | None = None,
+ ) -> None:
image_paths: list[str] = []
if image is None:
_images = []
@@ -202,7 +215,7 @@ def rerun():
if message.get("content") == "screenshot()":
screenshot = get_image(message["image"])
continue
- elif message.get("content"):
+ if message.get("content"):
if match := re.match(
r"mouse\((\d+),\s*(\d+)\)", message["content"]
):
diff --git a/src/askui/chat/click_recorder.py b/src/askui/chat/click_recorder.py
index 10f6af96..90fb7c05 100644
--- a/src/askui/chat/click_recorder.py
+++ b/src/askui/chat/click_recorder.py
@@ -4,15 +4,12 @@
import subprocess
import sys
import tempfile
-
+from datetime import datetime
from typing import List, Tuple
+from PIL import Image
from pydantic import UUID4, BaseModel, ConfigDict
from pydantic.alias_generators import to_camel
-from datetime import datetime
-
-from PIL import Image
-
Coordinate = Tuple[int, int]
@@ -22,7 +19,7 @@ class Rectangle(BaseModel):
ymin: int
xmax: int
ymax: int
-
+
@property
def center(self) -> Coordinate:
x = (self.xmin + self.xmax) // 2
@@ -34,14 +31,17 @@ class Annotation(BaseModel):
id: UUID4
rectangle: Rectangle
+
class Size(BaseModel):
width: int
height: int
+
class AskUIImage(BaseModel):
size: Size
-class AnnoationContainer(BaseModel):
+
+class AnnoationContainer(BaseModel):
model_config = ConfigDict(
alias_generator=lambda field_name: to_camel(field_name),
)
@@ -53,25 +53,29 @@ class AnnoationContainer(BaseModel):
annotations: List[Annotation]
-class AskUiSnippingTool():
+class AskUiSnippingTool:
def __init__(self) -> None:
self.process = None
def __find_remote_device_controller(self) -> str:
- if sys.platform == 'darwin':
+ if sys.platform == "darwin":
return f"{os.environ['ASKUI_INSTALLATION_DIRECTORY']}/DependencyCache/AskUIRemoteDeviceSnippingTool-0.2.0/AskuiRemoteDeviceSnippingTool"
- raise NotImplementedError("Snipping tool not supported on this platform, yet, as the path was unknown at the time of writing")
-
- def __start_process(self, binary_path, output_directory):
- self.process = subprocess.check_output((binary_path, "-Annotate", "-OneShot", "-OutDirectory", output_directory))
-
+ raise NotImplementedError(
+ "Snipping tool not supported on this platform, yet, as the path was unknown at the time of writing"
+ )
+
+ def __start_process(self, binary_path: str, output_directory: str) -> None:
+ self.process = subprocess.check_output(
+ (binary_path, "-Annotate", "-OneShot", "-OutDirectory", output_directory)
+ )
+
def annotate(self) -> Tuple[Image.Image, AnnoationContainer]:
with tempfile.TemporaryDirectory() as tempdir:
- self.__start_process(self.__find_remote_device_controller(), tempdir)
+ self.__start_process(self.__find_remote_device_controller(), tempdir)
json_files = glob.glob(tempdir + "/*.json")
png_files = glob.glob(tempdir + "/*.png")
-
+
if len(json_files) != 1 or len(png_files) != 1:
raise Exception("No annotation Done!")
json_file = json_files[0]
@@ -82,13 +86,16 @@ def annotate(self) -> Tuple[Image.Image, AnnoationContainer]:
return Image.open(png_files[0]).copy(), annotation
-class ClickRecorder():
+class ClickRecorder:
def __init__(self) -> None:
self.snipping_tool = AskUiSnippingTool()
def record(self) -> Tuple[Image.Image, Coordinate]:
image, annotation_container = self.snipping_tool.annotate()
- assert annotation_container.annotations is not None and len(annotation_container.annotations) == 1
+ assert (
+ annotation_container.annotations is not None
+ and len(annotation_container.annotations) == 1
+ )
annotation = annotation_container.annotations[0]
center = annotation.rectangle.center
return image, center
diff --git a/src/askui/container.py b/src/askui/container.py
index 9af51ea2..5a4a2dbf 100644
--- a/src/askui/container.py
+++ b/src/askui/container.py
@@ -2,7 +2,6 @@
from askui.telemetry import Telemetry
from askui.telemetry.processors import Segment
-
telemetry = Telemetry(settings.telemetry)
if settings.telemetry.segment:
diff --git a/src/askui/exceptions.py b/src/askui/exceptions.py
index 3f215206..048f5f1d 100644
--- a/src/askui/exceptions.py
+++ b/src/askui/exceptions.py
@@ -1,11 +1,15 @@
+from typing import Any
+
from .models.askui.ai_element_utils import AiElementNotFound
+
class AutomationError(Exception):
"""Exception raised when the automation step cannot complete.
-
+
Args:
message (str): The error message.
"""
+
def __init__(self, message: str):
self.message = message
super().__init__(self.message)
@@ -13,16 +17,49 @@ def __init__(self, message: str):
class ElementNotFoundError(AutomationError):
"""Exception raised when an element cannot be located.
-
+
Args:
message (str): The error message.
"""
+
def __init__(self, message: str):
super().__init__(message)
+class NoResponseToQueryError(AutomationError):
+ """Exception raised when a query does not return a response.
+
+ Args:
+ message (str): The error message.
+ query (str): The query that was made.
+ """
+
+ def __init__(self, message: str, query: str):
+ self.message = message
+ self.query = query
+ super().__init__(self.message)
+
+
+class UnexpectedResponseToQueryError(AutomationError):
+ """Exception raised when a query returns an unexpected response.
+
+ Args:
+ message (str): The error message.
+ query (str): The query that was made.
+ response (Any): The response that was received.
+ """
+
+ def __init__(self, message: str, query: str, response: Any):
+ self.message = message
+ self.query = query
+ self.response = response
+ super().__init__(self.message)
+
+
__all__ = [
"AiElementNotFound",
"AutomationError",
"ElementNotFoundError",
+ "NoResponseToQueryError",
+ "UnexpectedResponseToQueryError",
]
diff --git a/src/askui/locators/__init__.py b/src/askui/locators/__init__.py
index 2dd749b2..5bc155ed 100644
--- a/src/askui/locators/__init__.py
+++ b/src/askui/locators/__init__.py
@@ -1,5 +1,5 @@
-from .locators import AiElement, Element, Prompt, Image, Text, TextMatchType, Locator
-from .relatable import CircularDependencyError, ReferencePoint, RelationIndex, Relatable
+from .locators import AiElement, Element, Image, Locator, Prompt, Text, TextMatchType
+from .relatable import CircularDependencyError, ReferencePoint, Relatable, RelationIndex
__all__ = [
"AiElement",
diff --git a/src/askui/locators/locators.py b/src/askui/locators/locators.py
index 76bf5d51..bcaf8a50 100644
--- a/src/askui/locators/locators.py
+++ b/src/askui/locators/locators.py
@@ -1,14 +1,13 @@
-from abc import ABC
import pathlib
-from typing import Annotated, Literal, Union
import uuid
+from abc import ABC
+from typing import Annotated, Literal, Union
from PIL import Image as PILImage
from pydantic import ConfigDict, Field, validate_call
-from askui.utils.image_utils import ImageSource
from askui.locators.relatable import Relatable
-
+from askui.utils.image_utils import ImageSource
TextMatchType = Literal["similar", "exact", "contains", "regex"]
"""The type of match to use.
@@ -27,14 +26,12 @@
class Locator(Relatable, ABC):
- """Abstract base class for all locators. Cannot be instantiated directly.
+ """Abstract base class for all locators. Cannot be instantiated directly.
Subclassed by all locators, e.g., `Prompt`, `Text`, `Image`, etc."""
-
+
def _str(self) -> str:
return "locator"
- pass
-
class Prompt(Locator):
"""Locator for finding ui elements by a textual prompt / description of a ui element, e.g., "green sign up button".
@@ -59,12 +56,12 @@ def __init__(
self,
prompt: Annotated[
str,
- Field(),
+ Field(min_length=1),
],
) -> None:
super().__init__()
self._prompt = prompt
-
+
def _str(self) -> str:
return f'element with prompt "{self._prompt}"'
@@ -74,11 +71,11 @@ class Element(Locator):
Args:
class_name (Literal["text", "textfield"] | None, optional): The class of the ui element, e.g., `'text'` or `'textfield'`. Defaults to `None`.
-
+
Examples:
```python
from askui import locators as loc
- # locates a text elementAdd
+ # locates a text elementAdd
text = loc.Element(class_name="text")
# locates a textfield element
textfield = loc.Element(class_name="textfield")
@@ -100,7 +97,9 @@ def __init__(
def _str(self) -> str:
return (
- f'element with class "{self._class_name}"' if self._class_name else "element"
+ f'element with class "{self._class_name}"'
+ if self._class_name
+ else "element"
)
@@ -108,14 +107,14 @@ class Text(Element):
"""Locator for finding text elements by their textual content.
Args:
- text (str | None, optional): The text content of the ui element, e.g., `'Sign up'`. Defaults to `None`.
+ text (str | None, optional): The text content of the ui element, e.g., `'Sign up'`. Defaults to `None`.
If `None`, the locator will match any text element.
match_type (TextMatchType, optional): The type of match to use. Defaults to `"similar"`.
- similarity_threshold (int, optional): A threshold for how similar the actual text content of the ui element
- needs to be to the specified text to be considered a match when `match_type` is `"similar"`.
+ similarity_threshold (int, optional): A threshold for how similar the actual text content of the ui element
+ needs to be to the specified text to be considered a match when `match_type` is `"similar"`.
Takes values between `0` and `100` (inclusive, higher is more similar).
Defaults to `70`.
-
+
Examples:
```python
from askui import locators as loc
@@ -198,25 +197,24 @@ def __init__(
self._rotation_degree_per_step = rotation_degree_per_step
self._name = name
self._image_compare_format = image_compare_format
-
+
def _params_str(self) -> str:
return (
"("
- + ", ".join([
- f"threshold: {self._threshold}",
- f"stop_threshold: {self._stop_threshold}",
- f"rotation_degree_per_step: {self._rotation_degree_per_step}",
- f"image_compare_format: {self._image_compare_format}",
- f"mask: {self._mask}"
- ])
+ + ", ".join(
+ [
+ f"threshold: {self._threshold}",
+ f"stop_threshold: {self._stop_threshold}",
+ f"rotation_degree_per_step: {self._rotation_degree_per_step}",
+ f"image_compare_format: {self._image_compare_format}",
+ f"mask: {self._mask}",
+ ]
+ )
+ ")"
)
-
+
def _str(self) -> str:
- return (
- f'element "{self._name}" located by image '
- + self._params_str()
- )
+ return f'element "{self._name}" located by image ' + self._params_str()
def _generate_name() -> str:
@@ -241,11 +239,11 @@ class Image(ImageBase):
until 360° is exceeded. Range is between `0°` - `360°`. Defaults to `0°`. Important: This increases the
prediction time quite a bit. So only use it when absolutely necessary.
name (str | None, optional): Name for the image. Defaults to random name.
- image_compare_format (Literal["RGB", "grayscale", "edges"], optional): A color compare style. Defaults to `'grayscale'`. **Important**:
- The `image_compare_format` impacts the prediction time as well as quality. As a rule of thumb,
- `'edges'` is likely to be faster than `'grayscale'` and `'grayscale'` is likely to be faster than `'RGB'`.
+ image_compare_format (Literal["RGB", "grayscale", "edges"], optional): A color compare style. Defaults to `'grayscale'`. **Important**:
+ The `image_compare_format` impacts the prediction time as well as quality. As a rule of thumb,
+ `'edges'` is likely to be faster than `'grayscale'` and `'grayscale'` is likely to be faster than `'RGB'`.
For quality it is most often the other way around.
-
+
Examples:
```python
from askui import locators as loc
@@ -308,14 +306,14 @@ def __init__(
rotation_degree_per_step=rotation_degree_per_step,
image_compare_format=image_compare_format,
name=_generate_name() if name is None else name,
- ) # type: ignore
+ )
self._image = ImageSource(image)
class AiElement(ImageBase):
"""
Locator for finding ui elements by data (e.g., image) collected with the [AskUIRemoteDeviceSnippingTool](http://localhost:3000/02-api-reference/02-askui-suite/02-askui-suite/AskUIRemoteDeviceSnippingTool/Public/AskUI-NewAIElement) using the `name` assigned to the AI element during *snipping* to retrieve the data used for locating the ui element(s).
-
+
Args:
name (str): Name of the AI element
threshold (float, optional): A threshold for how similar UI elements need to be to the image to be considered a match.
@@ -331,9 +329,9 @@ class AiElement(ImageBase):
until 360° is exceeded. Range is between `0°` - `360°`. Defaults to `0°`. Important: This increases the
prediction time quite a bit. So only use it when absolutely necessary.
name (str | None, optional): Name for the image. Defaults to random name.
- image_compare_format (Literal["RGB", "grayscale", "edges"], optional): A color compare style. Defaults to `'grayscale'`. **Important**:
- The `image_compare_format` impacts the prediction time as well as quality. As a rule of thumb,
- `'edges'` is likely to be faster than `'grayscale'` and `'grayscale'` is likely to be faster than `'RGB'`.
+ image_compare_format (Literal["RGB", "grayscale", "edges"], optional): A color compare style. Defaults to `'grayscale'`. **Important**:
+ The `image_compare_format` impacts the prediction time as well as quality. As a rule of thumb,
+ `'edges'` is likely to be faster than `'grayscale'` and `'grayscale'` is likely to be faster than `'RGB'`.
For quality it is most often the other way around.
"""
@@ -380,10 +378,7 @@ def __init__(
mask=mask,
rotation_degree_per_step=rotation_degree_per_step,
image_compare_format=image_compare_format,
- ) # type: ignore
+ )
def _str(self) -> str:
- return (
- f'ai element named "{self._name}" '
- + self._params_str()
- )
+ return f'ai element named "{self._name}" ' + self._params_str()
diff --git a/src/askui/locators/relatable.py b/src/askui/locators/relatable.py
index 1827d186..87e8b564 100644
--- a/src/askui/locators/relatable.py
+++ b/src/askui/locators/relatable.py
@@ -1,9 +1,9 @@
from abc import ABC
from typing import Annotated, Literal
+
from pydantic import BaseModel, ConfigDict, Field
from typing_extensions import Self
-
ReferencePoint = Literal["center", "boundary", "any"]
"""
Defines under which conditions an element *A* is considered to be above, below, right or left of another element *B*.
@@ -216,7 +216,7 @@ class RelationBase(BaseModel):
"nearest_to",
]
- def __str__(self):
+ def __str__(self) -> str:
return f"{RelationTypeMapping[self.type]} {self.other_locator._str_with_relation()}"
@@ -225,7 +225,7 @@ class NeighborRelation(RelationBase):
index: RelationIndex
reference_point: ReferencePoint
- def __str__(self):
+ def __str__(self) -> str:
i = self.index + 1
if i == 11 or i == 12 or i == 13:
index_str = f"{i}th"
@@ -233,12 +233,18 @@ def __str__(self):
index_str = (
f"{i}st"
if i % 10 == 1
- else f"{i}nd" if i % 10 == 2 else f"{i}rd" if i % 10 == 3 else f"{i}th"
+ else f"{i}nd"
+ if i % 10 == 2
+ else f"{i}rd"
+ if i % 10 == 3
+ else f"{i}th"
)
reference_point_str = (
" center of"
if self.reference_point == "center"
- else " boundary of" if self.reference_point == "boundary" else ""
+ else " boundary of"
+ if self.reference_point == "boundary"
+ else ""
)
return f"{RelationTypeMapping[self.type]}{reference_point_str} the {index_str} {self.other_locator._str_with_relation()}"
@@ -273,7 +279,7 @@ def __init__(
class Relatable(ABC):
- """Abstract base class for locators that can be related to other locators, e.g., spatially, logically etc. Cannot be instantiated directly.
+ """Abstract base class for locators that can be related to other locators, e.g., spatially, logically etc. Cannot be instantiated directly.
Subclassed by all (relatable) locators, e.g., `Prompt`, `Text`, `Image`, etc."""
def __init__(self) -> None:
@@ -302,7 +308,7 @@ def above_of(
index (RelationIndex, optional): Index of the element (located by *self*) above the other element(s)
(located by *other_locator*), e.g., the first (`0`), second (`1`), third (`2`) etc. element above the other element(s).
Elements' (relative) position is determined by the **bottom border**
- (*y*-coordinate) of their bounding box.
+ (*y*-coordinate) of their bounding box.
We don't guarantee the order of elements with the same bottom border
(*y*-coordinate). Defaults to `0`.
reference_point (ReferencePoint, optional): Defines which element (located by *self*) is considered to be above the
@@ -327,7 +333,7 @@ def above_of(
# text "B"
text = loc.Text().above_of(loc.Text("B"), reference_point="center")
```
-
+
```text
===========
@@ -340,11 +346,11 @@ def above_of(
```python
from askui import locators as loc
# locates text "A" as it is the first (index 0) element above
- # ("boundary" of / any point of) text "B"
+ # ("boundary" of / any point of) text "B"
# (reference point "center" won't work here)
text = loc.Text().above_of(loc.Text("B"), reference_point="boundary")
```
-
+
```text
===========
@@ -356,11 +362,11 @@ def above_of(
```
```python
from askui import locators as loc
- # locates text "A" as it is the first (index 0) element above text "B"
+ # locates text "A" as it is the first (index 0) element above text "B"
# (reference point "center" or "boundary" won't work here)
text = loc.Text().above_of(loc.Text("B"), reference_point="any")
```
-
+
```text
===========
@@ -375,11 +381,11 @@ def above_of(
```
```python
from askui import locators as loc
- # locates text "A" as it is the second (index 1) element above text "C"
+ # locates text "A" as it is the second (index 1) element above text "C"
# (reference point "center" or "boundary" won't work here)
text = loc.Text().above_of(loc.Text("C"), index=1, reference_point="any")
```
-
+
```text
===========
@@ -435,7 +441,7 @@ def below_of(
index (RelationIndex, optional): Index of the element (located by *self*) **below** the other
element(s) (located by *other_locator*), e.g., the first (`0`), second (`1`), third (`2`) etc. element below the other
element(s). Elements' (relative) position is determined by the **top
- border** (*y*-coordinate) of their bounding box.
+ border** (*y*-coordinate) of their bounding box.
We don't guarantee the order of elements with the same top border
(*y*-coordinate). Defaults to `0`.
reference_point (ReferencePoint, optional): Defines which element (located by *self*) is considered to be
@@ -472,8 +478,8 @@ def below_of(
```
```python
from askui import locators as loc
- # locates text "A" as it is the first (index 0) element below
- # ("boundary" of / any point of) text "B"
+ # locates text "A" as it is the first (index 0) element below
+ # ("boundary" of / any point of) text "B"
# (reference point "center" won't work here)
text = loc.Text().below_of(loc.Text("B"), reference_point="boundary")
```
@@ -493,7 +499,7 @@ def below_of(
# (reference point "center" or "boundary won't work here)
text = loc.Text().below_of(loc.Text("B"), reference_point="any")
```
-
+
```text
===========
@@ -508,15 +514,15 @@ def below_of(
```
```python
from askui import locators as loc
- # locates text "A" as it is the second (index 1) element below text "C"
+ # locates text "A" as it is the second (index 1) element below text "C"
# (reference point "center" or "boundary" won't work here)
text = loc.Text().below_of(loc.Text("C"), index=1, reference_point="any")
```
-
+
```text
- ===========
- | |
+ ===========
+ | |
| C |
| |===========
===========| B |
@@ -568,7 +574,7 @@ def right_of(
index (RelationIndex, optional): Index of the element (located by *self*) **right of** the other
element(s) (located by *other_locator*), e.g., the first (`0`), second (`1`), third (`2`) etc. element right of the other
element(s). Elements' (relative) position is determined by the **left
- border** (*x*-coordinate) of their bounding box.
+ border** (*x*-coordinate) of their bounding box.
We don't guarantee the order of elements with the same left border
(*x*-coordinate). Defaults to `0`.
reference_point (ReferencePoint, optional): Defines which element (located by *self*) is considered to be
@@ -593,23 +599,23 @@ def right_of(
```text
- ===========
- | B |
+ ===========
+ | B |
=========== ===========
| A |
===========
```
```python
from askui import locators as loc
- # locates text "A" as it is the first (index 0) element right of
- # ("boundary" of / any point of) text "B"
+ # locates text "A" as it is the first (index 0) element right of
+ # ("boundary" of / any point of) text "B"
# (reference point "center" won't work here)
text = loc.Text().right_of(loc.Text("B"), reference_point="boundary")
```
```text
- ===========
+ ===========
| B |
===========
===========
@@ -618,13 +624,13 @@ def right_of(
```
```python
from askui import locators as loc
- # locates text "A" as it is the first (index 0) element right of text "B"
+ # locates text "A" as it is the first (index 0) element right of text "B"
# (reference point "center" or "boundary" won't work here)
text = loc.Text().right_of(loc.Text("B"), reference_point="any")
```
-
+
```text
-
+
===========
| A |
===========
@@ -634,13 +640,13 @@ def right_of(
```
```python
from askui import locators as loc
- # locates text "A" as it is the second (index 1) element right of text "C"
+ # locates text "A" as it is the second (index 1) element right of text "C"
# (reference point "center" or "boundary" won't work here)
text = loc.Text().right_of(loc.Text("C"), index=1, reference_point="any")
```
-
+
```text
-
+
===========
| B |
=========== ===========
@@ -691,7 +697,7 @@ def left_of(
index (RelationIndex, optional): Index of the element (located by *self*) **left of** the other
element(s) (located by *other_locator*), e.g., the first (`0`), second (`1`), third (`2`) etc. element left of the other
element(s). Elements' (relative) position is determined by the **right
- border** (*x*-coordinate) of their bounding box.
+ border** (*x*-coordinate) of their bounding box.
We don't guarantee the order of elements with the same right border
(*x*-coordinate). Defaults to `0`.
reference_point (ReferencePoint, optional): Defines which element (located by *self*) is considered to be
@@ -716,9 +722,9 @@ def left_of(
```text
- ===========
+ ===========
=========== | B |
- | A | ===========
+ | A | ===========
===========
```
```python
@@ -731,22 +737,22 @@ def left_of(
```text
- ===========
+ ===========
| B |
- ===========
- ===========
+ ===========
+ ===========
| A |
- ===========
+ ===========
```
```python
from askui import locators as loc
- # locates text "A" as it is the first (index 0) element left of text "B"
+ # locates text "A" as it is the first (index 0) element left of text "B"
# (reference point "center" or "boundary won't work here)
text = loc.Text().left_of(loc.Text("B"), reference_point="any")
```
```text
-
+
===========
| A |
===========
@@ -756,18 +762,18 @@ def left_of(
```
```python
from askui import locators as loc
- # locates text "A" as it is the second (index 1) element left of text "C"
+ # locates text "A" as it is the second (index 1) element left of text "C"
# (reference point "center" or "boundary" won't work here)
text = loc.Text().left_of(loc.Text("C"), index=1, reference_point="any")
```
-
+
```text
-
+
===========
| B |
- =========== ===========
- | A | ===========
- =========== | C |
+ =========== ===========
+ | A | ===========
+ =========== | C |
===========
```
```python
@@ -981,14 +987,14 @@ def _relations_str(self) -> str:
for nested_relation_str in nested_relation_strs:
result.append(f" {nested_relation_str}")
return "\n" + "\n".join(result)
-
+
def _str_with_relation(self) -> str:
return self._str() + self._relations_str()
def raise_if_cycle(self) -> None:
"""Raises CircularDependencyError if the relations form a cycle (see [Cycle (graph theory)](https://en.wikipedia.org/wiki/Cycle_(graph_theory)))."""
if self._has_cycle():
- raise CircularDependencyError()
+ raise CircularDependencyError
def _has_cycle(self) -> bool:
"""Check if the relations form a cycle (see [Cycle (graph theory)](https://en.wikipedia.org/wiki/Cycle_(graph_theory)))."""
diff --git a/src/askui/locators/serializers.py b/src/askui/locators/serializers.py
index 2378d763..b9dad21c 100644
--- a/src/askui/locators/serializers.py
+++ b/src/askui/locators/serializers.py
@@ -1,18 +1,21 @@
from typing_extensions import NotRequired, TypedDict
+from askui.models.askui.ai_element_utils import AiElementCollection
from askui.reporting import Reporter
from askui.utils.image_utils import ImageSource
-from askui.models.askui.ai_element_utils import AiElementCollection
+
from .locators import (
DEFAULT_SIMILARITY_THRESHOLD,
DEFAULT_TEXT_MATCH_TYPE,
- ImageBase,
- AiElement as AiElementLocator,
Element,
- Prompt,
Image,
+ ImageBase,
+ Prompt,
Text,
)
+from .locators import (
+ AiElement as AiElementLocator,
+)
from .relatable import (
BoundingRelation,
LogicalRelation,
@@ -34,26 +37,24 @@ def serialize(self, locator: Relatable) -> str:
if isinstance(locator, Text):
return self._serialize_text(locator)
- elif isinstance(locator, Element):
+ if isinstance(locator, Element):
return self._serialize_class(locator)
- elif isinstance(locator, Prompt):
+ if isinstance(locator, Prompt):
return self._serialize_prompt(locator)
- elif isinstance(locator, Image):
+ if isinstance(locator, Image):
raise NotImplementedError(
"Serializing image locators is not yet supported for VLMs"
)
- elif isinstance(locator, AiElementLocator):
+ if isinstance(locator, AiElementLocator):
raise NotImplementedError(
"Serializing AI element locators is not yet supported for VLMs"
)
- else:
- raise ValueError(f"Unsupported locator type: {type(locator)}")
+ raise ValueError(f"Unsupported locator type: {type(locator)}")
def _serialize_class(self, class_: Element) -> str:
if class_._class_name:
return f"an arbitrary {class_._class_name} shown"
- else:
- return "an arbitrary ui element (e.g., text, button, textfield, etc.)"
+ return "an arbitrary ui element (e.g., text, button, textfield, etc.)"
def _serialize_prompt(self, prompt: Prompt) -> str:
return prompt._prompt
@@ -227,7 +228,7 @@ def _serialize_image_base(
instruction=f"custom element with text {self._TEXT_DELIMITER}{image_locator._name}{self._TEXT_DELIMITER}",
customElements=custom_elements,
)
-
+
def _serialize_image(
self,
image: Image,
diff --git a/src/askui/logger.py b/src/askui/logger.py
index 2038ecf9..097c7015 100644
--- a/src/askui/logger.py
+++ b/src/askui/logger.py
@@ -1,21 +1,22 @@
import logging
-
from pathlib import Path
-from rich.logging import RichHandler
+from rich.logging import RichHandler
logger = logging.getLogger("askui")
if not logger.hasHandlers():
- handler = RichHandler(rich_tracebacks=True, show_level=True, show_time=True, show_path=True)
+ handler = RichHandler(
+ rich_tracebacks=True, show_level=True, show_time=True, show_path=True
+ )
logger.addHandler(handler)
logger.setLevel(logging.INFO)
-def configure_logging(level: str | int = logging.INFO):
+def configure_logging(level: str | int = logging.INFO) -> None:
logger.setLevel(level)
-def add_file_log(path: str = "./"):
+def add_file_log(path: str = "./") -> None:
file_handler = logging.FileHandler(Path(path, "vision_agent.log"))
file_formatter = logging.Formatter("%(message)s")
file_handler.setFormatter(file_formatter)
diff --git a/src/askui/models/__init__.py b/src/askui/models/__init__.py
index efc2755c..ec35ea3c 100644
--- a/src/askui/models/__init__.py
+++ b/src/askui/models/__init__.py
@@ -1,4 +1,4 @@
-from .models import ModelName, ModelComposition, ModelDefinition
+from .models import ModelComposition, ModelDefinition, ModelName
__all__ = [
"ModelName",
diff --git a/src/askui/models/anthropic/claude.py b/src/askui/models/anthropic/claude.py
index 4d54f8e8..89ea6d22 100644
--- a/src/askui/models/anthropic/claude.py
+++ b/src/askui/models/anthropic/claude.py
@@ -1,16 +1,26 @@
import os
+
import anthropic
from PIL import Image
-from askui.utils.image_utils import ImageSource, image_to_base64, scale_coordinates_back, scale_image_with_padding
+from askui.utils.image_utils import (
+ ImageSource,
+ image_to_base64,
+ scale_coordinates_back,
+ scale_image_with_padding,
+)
+from ...exceptions import (
+ ElementNotFoundError,
+ NoResponseToQueryError,
+ UnexpectedResponseToQueryError,
+)
from ...logger import logger
-from ...exceptions import ElementNotFoundError
from .utils import extract_click_coordinates
class ClaudeHandler:
- def __init__(self):
+ def __init__(self) -> None:
self.model = "claude-3-5-sonnet-20241022"
self.client = anthropic.Anthropic()
self.resolution = (1280, 800)
@@ -18,7 +28,9 @@ def __init__(self):
if os.getenv("ANTHROPIC_API_KEY") is None:
self.authenticated = False
- def _inference(self, base64_image: str, prompt: str, system_prompt: str) -> list[anthropic.types.ContentBlock]:
+ def _inference(
+ self, base64_image: str, prompt: str, system_prompt: str
+ ) -> list[anthropic.types.ContentBlock]:
message = self.client.messages.create(
model=self.model,
max_tokens=1000,
@@ -34,31 +46,32 @@ def _inference(self, base64_image: str, prompt: str, system_prompt: str) -> list
"type": "base64",
"media_type": "image/png",
"data": base64_image,
- }
+ },
},
- {
- "type": "text",
- "text": prompt
- }
- ]
+ {"type": "text", "text": prompt},
+ ],
}
- ]
+ ],
)
return message.content
-
+
def locate_inference(self, image: Image.Image, locator: str) -> tuple[int, int]:
prompt = f"Click on {locator}"
screen_width, screen_height = self.resolution[0], self.resolution[1]
system_prompt = f"Use a mouse and keyboard to interact with a computer, and take screenshots.\n* This is an interface to a desktop GUI. You do not have access to a terminal or applications menu. You must click on desktop icons to start applications.\n* Some applications may take time to start or process actions, so you may need to wait and take successive screenshots to see the results of your actions. E.g. if you click on Firefox and a window doesn't open, try taking another screenshot.\n* The screen's resolution is {screen_width}x{screen_height}.\n* The display number is 0\n* Whenever you intend to move the cursor to click on an element like an icon, you should consult a screenshot to determine the coordinates of the element before moving the cursor.\n* If you tried clicking on a program or link but it failed to load, even after waiting, try adjusting your cursor position so that the tip of the cursor visually falls on the element that you want to click.\n* Make sure to click any buttons, links, icons, etc with the cursor tip in the center of the element. Don't click boxes on their edges unless asked.\n"
scaled_image = scale_image_with_padding(image, screen_width, screen_height)
response = self._inference(image_to_base64(scaled_image), prompt, system_prompt)
- response = response[0].text
- logger.debug("ClaudeHandler received locator: %s", response)
+ assert len(response) > 0
+ r = response[0]
+ assert r.type == "text"
+ logger.debug("ClaudeHandler received locator: %s", r.text)
try:
- scaled_x, scaled_y = extract_click_coordinates(response)
- except Exception as e:
+ scaled_x, scaled_y = extract_click_coordinates(r.text)
+ except Exception:
raise ElementNotFoundError(f"Element not found: {locator}")
- x, y = scale_coordinates_back(scaled_x, scaled_y, image.width, image.height, screen_width, screen_height)
+ x, y = scale_coordinates_back(
+ scaled_x, scaled_y, image.width, image.height, screen_width, screen_height
+ )
return int(x), int(y)
def get_inference(self, image: ImageSource, query: str) -> str:
@@ -71,7 +84,15 @@ def get_inference(self, image: ImageSource, query: str) -> str:
response = self._inference(
base64_image=image_to_base64(scaled_image),
prompt=query,
- system_prompt=system_prompt
+ system_prompt=system_prompt,
+ )
+ if len(response) == 0:
+ raise NoResponseToQueryError(
+ f"No response from Claude to query: {query}", query
+ )
+ r = response[0]
+ if r.type == "text":
+ return r.text
+ raise UnexpectedResponseToQueryError(
+ f"Unexpected response from Claude: {r}", query, r
)
- response = response[0].text
- return response
diff --git a/src/askui/models/anthropic/claude_agent.py b/src/askui/models/anthropic/claude_agent.py
index 05599433..4a15df08 100644
--- a/src/askui/models/anthropic/claude_agent.py
+++ b/src/askui/models/anthropic/claude_agent.py
@@ -1,7 +1,7 @@
-import sys
import platform
+import sys
from datetime import datetime
-from typing import Any, cast, Literal
+from typing import Any, cast
from anthropic import (
Anthropic,
@@ -20,30 +20,137 @@
BetaToolUseBlockParam,
)
+from askui.reporting import Reporter
from askui.tools.agent_os import AgentOs
-from ...tools.anthropic import ComputerTool, ToolCollection, ToolResult
from ...logger import logger
+from ...tools.anthropic import ComputerTool, ToolCollection, ToolResult
from ...utils.str_utils import truncate_long_strings
-from askui.reporting import Reporter
-
COMPUTER_USE_BETA_FLAG = "computer-use-2024-10-22"
PROMPT_CACHING_BETA_FLAG = "prompt-caching-2024-07-31"
-PC_KEY = Literal['backspace', 'delete', 'enter', 'tab', 'escape', 'up', 'down', 'right', 'left', 'home', 'end', 'pageup', 'pagedown', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12', 'space', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~']
-
-
-# class APIProvider(StrEnum):
-# ANTHROPIC = "anthropic"
-# BEDROCK = "bedrock"
-# VERTEX = "vertex"
-
-
-# PROVIDER_TO_DEFAULT_MODEL_NAME: dict[APIProvider, str] = {
-# APIProvider.ANTHROPIC: "claude-3-5-sonnet-20241022",
-# APIProvider.BEDROCK: "anthropic.claude-3-5-sonnet-20241022-v2:0",
-# APIProvider.VERTEX: "claude-3-5-sonnet-v2@20241022",
-# }
+PC_KEY = [
+ "backspace",
+ "delete",
+ "enter",
+ "tab",
+ "escape",
+ "up",
+ "down",
+ "right",
+ "left",
+ "home",
+ "end",
+ "pageup",
+ "pagedown",
+ "f1",
+ "f2",
+ "f3",
+ "f4",
+ "f5",
+ "f6",
+ "f7",
+ "f8",
+ "f9",
+ "f10",
+ "f11",
+ "f12",
+ "space",
+ "0",
+ "1",
+ "2",
+ "3",
+ "4",
+ "5",
+ "6",
+ "7",
+ "8",
+ "9",
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "!",
+ '"',
+ "#",
+ "$",
+ "%",
+ "&",
+ "'",
+ "(",
+ ")",
+ "*",
+ "+",
+ ",",
+ "-",
+ ".",
+ "/",
+ ":",
+ ";",
+ "<",
+ "=",
+ ">",
+ "?",
+ "@",
+ "[",
+ "\\",
+ "]",
+ "^",
+ "_",
+ "`",
+ "{",
+ "|",
+ "}",
+ "~",
+]
SYSTEM_PROMPT = f"""
@@ -51,8 +158,8 @@
* When asked to perform web tasks try to open the browser (firefox, chrome, safari, ...) if not already open. Often you can find the browser icons in the toolbars of the operating systems.
* When viewing a page it can be helpful to zoom out so that you can see everything on the page. Either that, or make sure you scroll down to see everything before deciding something isn't available.
* When using your computer function calls, they take a while to run and send back to you. Where possible/feasible, try to chain multiple of these calls all into one function calls request.
-* Valid keyboard keys available are {', '.join(list(PC_KEY.__args__))}
-* The current date is {datetime.today().strftime('%A, %B %d, %Y').replace(' 0', ' ')}.
+* Valid keyboard keys available are {", ".join(PC_KEY)}
+* The current date is {datetime.today().strftime("%A, %B %d, %Y").replace(" 0", " ")}.
@@ -79,7 +186,7 @@ def __init__(self, agent_os: AgentOs, reporter: Reporter) -> None:
self.client = Anthropic()
self.model = "claude-3-5-sonnet-20241022"
- def step(self, messages: list):
+ def step(self, messages: list) -> list:
if self.only_n_most_recent_images:
self._maybe_filter_to_n_most_recent_images(
messages,
@@ -102,7 +209,7 @@ def step(self, messages: list):
except APIError as e:
logger.error(e)
return messages
-
+
response = raw_response.parse()
response_params = self._response_to_params(response)
new_message = {
@@ -111,7 +218,7 @@ def step(self, messages: list):
}
logger.debug(new_message)
messages.append(new_message)
- if self._reporter is not None:
+ if self._reporter is not None:
self._reporter.add_message("Anthropic Computer Use", response_params)
tool_result_content: list[BetaToolResultBlockParam] = []
@@ -119,31 +226,29 @@ def step(self, messages: list):
if content_block["type"] == "tool_use":
result = self.tool_collection.run(
name=content_block["name"],
- tool_input=cast(dict[str, Any], content_block["input"]),
+ tool_input=cast("dict[str, Any]", content_block["input"]),
)
tool_result_content.append(
self._make_api_tool_result(result, content_block["id"])
)
if len(tool_result_content) > 0:
- new_message = {"content": tool_result_content, "role": "user"}
- logger.debug(truncate_long_strings(new_message, max_length=200))
- messages.append(new_message)
+ another_new_message = {"content": tool_result_content, "role": "user"}
+ logger.debug(truncate_long_strings(another_new_message, max_length=200))
+ messages.append(another_new_message)
return messages
-
- def run(self, goal: str):
+ def run(self, goal: str) -> None:
messages = [{"role": "user", "content": goal}]
logger.debug(messages[0])
while messages[-1]["role"] == "user":
messages = self.step(messages)
-
@staticmethod
def _maybe_filter_to_n_most_recent_images(
messages: list[BetaMessageParam],
- images_to_keep: int,
+ images_to_keep: int | None,
min_removal_threshold: int,
- ):
+ ) -> list[BetaMessageParam] | None:
"""
With the assumption that images are screenshots that are of diminishing value as
the conversation progresses, remove all but the final `images_to_keep` tool_result
@@ -154,7 +259,7 @@ def _maybe_filter_to_n_most_recent_images(
return messages
tool_result_blocks = cast(
- list[BetaToolResultBlockParam],
+ "list[BetaToolResultBlockParam]",
[
item
for message in messages
@@ -164,18 +269,15 @@ def _maybe_filter_to_n_most_recent_images(
if isinstance(item, dict) and item.get("type") == "tool_result"
],
)
-
total_images = sum(
1
for tool_result in tool_result_blocks
for content in tool_result.get("content", [])
if isinstance(content, dict) and content.get("type") == "image"
)
-
images_to_remove = total_images - images_to_keep
# for better cache behavior, we want to remove in chunks
images_to_remove -= images_to_remove % min_removal_threshold
-
for tool_result in tool_result_blocks:
if isinstance(tool_result.get("content"), list):
new_content = []
@@ -185,7 +287,8 @@ def _maybe_filter_to_n_most_recent_images(
images_to_remove -= 1
continue
new_content.append(content)
- tool_result["content"] = new_content
+ tool_result["content"] = new_content # type: ignore
+ return None
@staticmethod
def _response_to_params(
@@ -196,13 +299,13 @@ def _response_to_params(
if isinstance(block, BetaTextBlock):
res.append({"type": "text", "text": block.text})
else:
- res.append(cast(BetaToolUseBlockParam, block.model_dump()))
+ res.append(cast("BetaToolUseBlockParam", block.model_dump()))
return res
@staticmethod
def _inject_prompt_caching(
messages: list[BetaMessageParam],
- ):
+ ) -> None:
"""
Set cache breakpoints for the 3 most recent turns
one cache breakpoint is left for tools/system prompt, to be shared across sessions
@@ -231,13 +334,18 @@ def _make_api_tool_result(
is_error = False
if result.error:
is_error = True
- tool_result_content = self._maybe_prepend_system_tool_result(result, result.error)
+ tool_result_content = self._maybe_prepend_system_tool_result(
+ result, result.error
+ )
else:
+ assert isinstance(tool_result_content, list)
if result.output:
tool_result_content.append(
{
"type": "text",
- "text": self._maybe_prepend_system_tool_result(result, result.output),
+ "text": self._maybe_prepend_system_tool_result(
+ result, result.output
+ ),
}
)
if result.base64_image:
@@ -259,7 +367,7 @@ def _make_api_tool_result(
}
@staticmethod
- def _maybe_prepend_system_tool_result(result: ToolResult, result_text: str):
+ def _maybe_prepend_system_tool_result(result: ToolResult, result_text: str) -> str:
if result.system:
result_text = f"{result.system}\n{result_text}"
return result_text
diff --git a/src/askui/models/anthropic/utils.py b/src/askui/models/anthropic/utils.py
index 7b27a065..219aee34 100644
--- a/src/askui/models/anthropic/utils.py
+++ b/src/askui/models/anthropic/utils.py
@@ -1,8 +1,8 @@
import re
-def extract_click_coordinates(text: str):
- pattern = r'(\d+),\s*(\d+)'
+def extract_click_coordinates(text: str) -> tuple[int, int]:
+ pattern = r"(\d+),\s*(\d+)"
matches = re.findall(pattern, text)
x, y = matches[-1]
return int(x), int(y)
diff --git a/src/askui/models/askui/ai_element_utils.py b/src/askui/models/askui/ai_element_utils.py
index 78c2649a..cfb182a4 100644
--- a/src/askui/models/askui/ai_element_utils.py
+++ b/src/askui/models/askui/ai_element_utils.py
@@ -1,35 +1,40 @@
-from datetime import datetime
+import json
import os
import pathlib
+from datetime import datetime
from typing import List, Optional
+
+from PIL import Image
from pydantic import UUID4, BaseModel, ConfigDict, Field
from pydantic.alias_generators import to_camel
-from PIL import Image
-from askui.logger import logger
+from askui.logger import logger
class Rectangle(BaseModel):
xmin: int
ymin: int
+ xmax: int
ymax: int
- ymax: int
+
class Annotation(BaseModel):
id: UUID4
rectangle: Rectangle
+
class Size(BaseModel):
width: int
height: int
+
class AskUIImageMetadata(BaseModel):
size: Size
-class AiElementMetadata(BaseModel):
+
+class AiElementMetadata(BaseModel):
model_config = ConfigDict(
alias_generator=to_camel,
- serialization_alias=to_camel,
)
version: int
@@ -38,65 +43,73 @@ class AiElementMetadata(BaseModel):
creation_date_time: datetime
image_metadata: AskUIImageMetadata = Field(alias="image")
-class AiElement():
- image_path: pathlib.Path
+
+class AiElement(BaseModel):
+ model_config = ConfigDict(
+ alias_generator=to_camel,
+ arbitrary_types_allowed=True,
+ populate_by_name=True,
+ )
+
image: Image.Image
+ image_path: pathlib.Path
json_path: pathlib.Path
metadata: AiElementMetadata
- def __init__(self, image_path: pathlib.Path, image: Image.Image, metadata_path: pathlib.Path, metadata: AiElementMetadata):
- self.image_path = image_path
- self.image = image
- self.metadata_path = metadata_path
- self.metadata = metadata
-
@classmethod
def from_json_file(cls, json_file_path: pathlib.Path) -> "AiElement":
- image_path = json_file_path.parent / (json_file_path.stem + ".png")
- with open(json_file_path) as f:
- return cls(
- metadata_path= json_file_path,
- image_path= image_path,
- metadata = AiElementMetadata.model_validate_json(f.read()),
- image = Image.open(image_path))
+ image_path = json_file_path.parent / (json_file_path.stem + ".png")
+ return cls(
+ image=Image.open(image_path),
+ image_path=image_path,
+ json_path=json_file_path,
+ metadata=json.loads(json_file_path.read_text()),
+ )
class AiElementNotFound(ValueError):
"""Exception raised when an AI element is not found.
-
+
Args:
name (str): The name of the AI element that was not found.
locations (list[pathlib.Path]): The locations that were searched for the AI element.
"""
+
def __init__(self, name: str, locations: list[pathlib.Path]):
self.name = name
self.locations = locations
locations_str = ", ".join([str(location) for location in locations])
super().__init__(
f'AI element "{name}" not found in {locations_str}\n'
- 'Solutions:\n'
- '1. Verify the element exists in these locations and try again if you are sure it is present\n'
- '2. Add location to ASKUI_AI_ELEMENT_LOCATIONS env var (paths, comma separated)\n'
- '3. Create new AI element (see https://docs.askui.com/02-api-reference/02-askui-suite/02-askui-suite/AskUIRemoteDeviceSnippingTool/Public/AskUI-NewAIElement)'
+ "Solutions:\n"
+ "1. Verify the element exists in these locations and try again if you are sure it is present\n"
+ "2. Add location to ASKUI_AI_ELEMENT_LOCATIONS env var (paths, comma separated)\n"
+ "3. Create new AI element (see https://docs.askui.com/02-api-reference/02-askui-suite/02-askui-suite/AskUIRemoteDeviceSnippingTool/Public/AskUI-NewAIElement)"
)
class AiElementCollection:
- def __init__(self, additional_ai_element_locations: Optional[List[pathlib.Path]] = None):
+ def __init__(
+ self, additional_ai_element_locations: Optional[List[pathlib.Path]] = None
+ ):
additional_ai_element_locations = additional_ai_element_locations or []
workspace_id = os.getenv("ASKUI_WORKSPACE_ID")
if workspace_id is None:
raise ValueError("ASKUI_WORKSPACE_ID is not set")
-
+
locations_from_env: list[pathlib.Path] = []
if locations_env := os.getenv("ASKUI_AI_ELEMENT_LOCATIONS"):
locations_from_env = [pathlib.Path(loc) for loc in locations_env.split(",")]
-
+
self._ai_element_locations = [
- pathlib.Path.home() / ".askui" / "SnippingTool" / "AIElement" / workspace_id,
+ pathlib.Path.home()
+ / ".askui"
+ / "SnippingTool"
+ / "AIElement"
+ / workspace_id,
*locations_from_env,
- *additional_ai_element_locations
+ *additional_ai_element_locations,
]
logger.debug("AI Element locations: %s", self._ai_element_locations)
diff --git a/src/askui/models/askui/api.py b/src/askui/models/askui/api.py
index cc39cc8a..e7eac320 100644
--- a/src/askui/models/askui/api.py
+++ b/src/askui/models/askui/api.py
@@ -1,25 +1,28 @@
-import os
import base64
+import json as json_lib
+import os
import pathlib
-from pydantic import RootModel
+from typing import Any, Type, Union
+
import requests
-import json as json_lib
from PIL import Image
-from typing import Any, Type, Union
-from askui.models.models import ModelComposition
-from askui.utils.image_utils import ImageSource
-from askui.locators.serializers import AskUiLocatorSerializer
+from pydantic import RootModel
+
from askui.locators.locators import Locator
-from askui.utils.image_utils import image_to_base64
+from askui.locators.serializers import AskUiLocatorSerializer
from askui.logger import logger
-from ..types.response_schemas import ResponseSchema, to_response_schema
+from askui.models.models import ModelComposition
+from askui.utils.image_utils import ImageSource, image_to_base64
+from ..types.response_schemas import ResponseSchema, to_response_schema
class AskUiInferenceApi:
def __init__(self, locator_serializer: AskUiLocatorSerializer):
self._locator_serializer = locator_serializer
- self.inference_endpoint = os.getenv("ASKUI_INFERENCE_ENDPOINT", "https://inference.askui.com")
+ self.inference_endpoint = os.getenv(
+ "ASKUI_INFERENCE_ENDPOINT", "https://inference.askui.com"
+ )
self.workspace_id = os.getenv("ASKUI_WORKSPACE_ID")
self.token = os.getenv("ASKUI_TOKEN")
self.authenticated = True
@@ -27,7 +30,9 @@ def __init__(self, locator_serializer: AskUiLocatorSerializer):
logger.warning("ASKUI_WORKSPACE_ID or ASKUI_TOKEN missing.")
self.authenticated = False
- def _build_askui_token_auth_header(self, bearer_token: str | None = None) -> dict[str, str]:
+ def _build_askui_token_auth_header(
+ self, bearer_token: str | None = None
+ ) -> dict[str, str]:
if bearer_token is not None:
return {"Authorization": f"Bearer {bearer_token}"}
@@ -43,15 +48,25 @@ def _request(self, endpoint: str, json: dict[str, Any] | None = None) -> Any:
response = requests.post(
self._build_base_url(endpoint),
json=json,
- headers={"Content-Type": "application/json", **self._build_askui_token_auth_header()},
+ headers={
+ "Content-Type": "application/json",
+ **self._build_askui_token_auth_header(),
+ },
timeout=30,
)
if response.status_code != 200:
- raise Exception(f"{response.status_code}: Unknown Status Code\n", response.text)
+ raise Exception(
+ f"{response.status_code}: Unknown Status Code\n", response.text
+ )
return response.json()
- def predict(self, image: Union[pathlib.Path, Image.Image], locator: Locator, model: ModelComposition | None = None) -> tuple[int | None, int | None]:
+ def predict(
+ self,
+ image: Union[pathlib.Path, Image.Image],
+ locator: Locator,
+ model: ModelComposition | None = None,
+ ) -> tuple[int | None, int | None]:
serialized_locator = self._locator_serializer.serialize(locator=locator)
logger.debug(f"serialized_locator:\n{json_lib.dumps(serialized_locator)}")
json: dict[str, Any] = {
@@ -62,10 +77,16 @@ def predict(self, image: Union[pathlib.Path, Image.Image], locator: Locator, mod
json["customElements"] = serialized_locator["customElements"]
if model is not None:
json["modelComposition"] = model.model_dump(by_alias=True)
- logger.debug(f"modelComposition:\n{json_lib.dumps(json['modelComposition'])}")
+ logger.debug(
+ f"modelComposition:\n{json_lib.dumps(json['modelComposition'])}"
+ )
content = self._request(endpoint="inference", json=json)
- assert content["type"] == "COMMANDS", f"Received unknown content type {content['type']}"
- actions = [el for el in content["data"]["actions"] if el["inputEvent"] == "MOUSE_MOVE"]
+ assert content["type"] == "COMMANDS", (
+ f"Received unknown content type {content['type']}"
+ )
+ actions = [
+ el for el in content["data"]["actions"] if el["inputEvent"] == "MOUSE_MOVE"
+ ]
if len(actions) == 0:
return None, None
@@ -73,19 +94,17 @@ def predict(self, image: Union[pathlib.Path, Image.Image], locator: Locator, mod
return int(position["x"]), int(position["y"])
def get_inference(
- self,
- image: ImageSource,
- query: str,
- response_schema: Type[ResponseSchema] | None = None
+ self,
+ image: ImageSource,
+ query: str,
+ response_schema: Type[ResponseSchema] | None = None,
) -> ResponseSchema | str:
json: dict[str, Any] = {
"image": image.to_data_url(),
"prompt": query,
}
_response_schema = to_response_schema(response_schema)
- json["config"] = {
- "json_schema": _response_schema.model_json_schema()
- }
+ json["config"] = {"json_schema": _response_schema.model_json_schema()}
logger.debug(f"json_schema:\n{json_lib.dumps(json['config']['json_schema'])}")
content = self._request(endpoint="vqa/inference", json=json)
response = content["data"]["response"]
diff --git a/src/askui/models/huggingface/spaces_api.py b/src/askui/models/huggingface/spaces_api.py
index f8499206..d3ece418 100644
--- a/src/askui/models/huggingface/spaces_api.py
+++ b/src/askui/models/huggingface/spaces_api.py
@@ -1,32 +1,43 @@
import json
import tempfile
+from typing import Callable
+
+from gradio_client import Client, handle_file # type: ignore
+from PIL import Image
-from gradio_client import Client, handle_file
from askui.exceptions import AutomationError
class HFSpacesHandler:
- def __init__(self):
- self.clients = {}
- self.spaces = {
+ def __init__(self) -> None:
+ self.clients: dict[str, Client] = {}
+ self.spaces: dict[
+ str, Callable[[Image.Image, str, str | None], tuple[int, int]]
+ ] = {
"AskUI/PTA-1": self.predict_askui_pta1,
"Qwen/Qwen2-VL-7B-Instruct": self.predict_qwen2_vl,
"Qwen/Qwen2-VL-2B-Instruct": self.predict_qwen2_vl,
"OS-Copilot/OS-Atlas-Base-7B": self.predict_os_atlas,
- "showlab/ShowUI-2B": self.predict_showui
+ "showlab/ShowUI-2B": self.predict_showui,
}
- def get_spaces_names(self):
+ def get_spaces_names(self) -> list[str]:
return list(self.spaces.keys())
-
- def get_space_client(self, space_name: str):
+
+ def get_space_client(self, space_name: str) -> Client:
if space_name in list(self.clients.keys()):
return self.clients[space_name]
self.clients[space_name] = Client(space_name)
return self.clients[space_name]
-
+
@staticmethod
- def rescale_bounding_boxes(bounding_boxes, original_width, original_height, scaled_width=1000, scaled_height=1000):
+ def _rescale_bounding_boxes( # type: ignore
+ bounding_boxes,
+ original_width,
+ original_height,
+ scaled_width=1000,
+ scaled_height=1000,
+ ):
x_scale = original_width / scaled_width
y_scale = original_height / scaled_height
rescaled_boxes = []
@@ -36,27 +47,31 @@ def rescale_bounding_boxes(bounding_boxes, original_width, original_height, scal
xmin * x_scale,
ymin * y_scale,
xmax * x_scale,
- ymax * y_scale
+ ymax * y_scale,
]
rescaled_boxes.append(rescaled_box)
return rescaled_boxes
- def predict(self, screenshot, locator: str, model_name: str = "AskUI/PTA-1"):
+ def predict(
+ self, screenshot: Image.Image, locator: str, model_name: str = "AskUI/PTA-1"
+ ) -> tuple[int, int]:
try:
return self.spaces[model_name](screenshot, locator, model_name)
except Exception as e:
raise AutomationError(f"Hugging Face Spaces Exception: {e}")
- def predict_askui_pta1(self, screenshot, locator: str, model_name: str = None):
+ def predict_askui_pta1(
+ self, screenshot: Image.Image, locator: str, model_name: str | None = None
+ ) -> tuple[int, int]:
client = self.get_space_client("AskUI/PTA-1")
- with tempfile.NamedTemporaryFile(suffix='.png', delete=False) as temp_file:
- screenshot.save(temp_file, format='PNG')
+ with tempfile.NamedTemporaryFile(suffix=".png", delete=False) as temp_file:
+ screenshot.save(temp_file, format="PNG")
temp_file_path = temp_file.name
result = client.predict(
image=handle_file(temp_file_path),
text_input=locator,
model_id=model_name,
- api_name="/run_example"
+ api_name="/run_example",
)
target_box = json.loads(result[0])
assert len(target_box) == 4, f"Malformed box: {target_box}"
@@ -64,17 +79,19 @@ def predict_askui_pta1(self, screenshot, locator: str, model_name: str = None):
x = int((x1 + x2) / 2)
y = int((y1 + y2) / 2)
return x, y
-
- def predict_os_atlas(self, screenshot, locator: str, model_name: str = None):
+
+ def predict_os_atlas(
+ self, screenshot: Image.Image, locator: str, model_name: str | None = None
+ ) -> tuple[int, int]:
client = self.get_space_client("maxiw/OS-ATLAS")
- with tempfile.NamedTemporaryFile(suffix='.png', delete=False) as temp_file:
- screenshot.save(temp_file, format='PNG')
+ with tempfile.NamedTemporaryFile(suffix=".png", delete=False) as temp_file:
+ screenshot.save(temp_file, format="PNG")
temp_file_path = temp_file.name
result = client.predict(
image=handle_file(temp_file_path),
text_input=locator,
model_id=model_name,
- api_name="/run_example"
+ api_name="/run_example",
)
target_box = json.loads(result[1])[0]
assert len(target_box) == 4, f"Malformed box: {target_box}"
@@ -82,37 +99,41 @@ def predict_os_atlas(self, screenshot, locator: str, model_name: str = None):
x = int((x1 + x2) / 2)
y = int((y1 + y2) / 2)
return x, y
-
- def predict_qwen2_vl(self, screenshot, locator: str, model_name: str = None):
+
+ def predict_qwen2_vl(
+ self, screenshot: Image.Image, locator: str, model_name: str | None = None
+ ) -> tuple[int, int]:
client = self.get_space_client("maxiw/Qwen2-VL-Detection")
system_prompt = "You are a helpfull assistant to detect objects in images. When asked to detect elements based on a description you return bounding boxes for all elements in the form of [xmin, ymin, xmax, ymax] whith the values beeing scaled to 1000 by 1000 pixels. When there are more than one result, answer with a list of bounding boxes in the form of [[xmin, ymin, xmax, ymax], [xmin, ymin, xmax, ymax], ...]."
- with tempfile.NamedTemporaryFile(suffix='.png', delete=False) as temp_file:
- screenshot.save(temp_file, format='PNG')
+ with tempfile.NamedTemporaryFile(suffix=".png", delete=False) as temp_file:
+ screenshot.save(temp_file, format="PNG")
temp_file_path = temp_file.name
result = client.predict(
image=handle_file(temp_file_path),
text_input=locator,
system_prompt=system_prompt,
model_id=model_name,
- api_name="/run_example"
+ api_name="/run_example",
)
target_box = json.loads(result[1])
- target_box = self.rescale_bounding_boxes(target_box, screenshot.width, screenshot.height)[0]
+ target_box = self._rescale_bounding_boxes(
+ target_box, screenshot.width, screenshot.height
+ )[0]
assert len(target_box) == 4, f"Malformed box: {target_box}"
x1, y1, x2, y2 = target_box
x = int((x1 + x2) / 2)
y = int((y1 + y2) / 2)
return x, y
-
- def predict_showui(self, screenshot, locator: str, model_name: str = None):
+
+ def predict_showui(
+ self, screenshot: Image.Image, locator: str, model_name: str | None = None
+ ) -> tuple[int, int]:
client = self.get_space_client("showlab/ShowUI")
- with tempfile.NamedTemporaryFile(suffix='.png', delete=False) as temp_file:
- screenshot.save(temp_file, format='PNG')
+ with tempfile.NamedTemporaryFile(suffix=".png", delete=False) as temp_file:
+ screenshot.save(temp_file, format="PNG")
temp_file_path = temp_file.name
result = client.predict(
- image=handle_file(temp_file_path),
- query=locator,
- api_name="/on_submit"
+ image=handle_file(temp_file_path), query=locator, api_name="/on_submit"
)
output_value = json.loads(result[1])
relative_x, relative_y = output_value
diff --git a/src/askui/models/models.py b/src/askui/models/models.py
index f28dc667..961c9a48 100644
--- a/src/askui/models/models.py
+++ b/src/askui/models/models.py
@@ -1,7 +1,8 @@
+import re
from collections.abc import Iterator
from enum import Enum
-import re
from typing import Annotated
+
from pydantic import BaseModel, ConfigDict, Field, RootModel
@@ -89,7 +90,7 @@ class ModelComposition(RootModel[list[ModelDefinition]]):
A composition of models (list of `ModelDefinition`) to be used for a task, e.g., locating an element on the screen to be able to click on it or extracting text from an image.
"""
- def __iter__(self):
+ def __iter__(self) -> Iterator[ModelDefinition]: # type: ignore
return iter(self.root)
def __getitem__(self, index: int) -> ModelDefinition:
diff --git a/src/askui/models/router.py b/src/askui/models/router.py
index d9aaadcc..45836c5f 100644
--- a/src/askui/models/router.py
+++ b/src/askui/models/router.py
@@ -1,26 +1,26 @@
+from abc import ABC, abstractmethod
from typing import Type
-from typing_extensions import override
+
from PIL import Image
+from typing_extensions import override
from askui.container import telemetry
-from askui.locators.locators import AiElement, Prompt, Text
+from askui.locators.locators import AiElement, Locator, Prompt, Text
from askui.locators.serializers import AskUiLocatorSerializer, VlmLocatorSerializer
-from askui.locators.locators import Locator
from askui.models.askui.ai_element_utils import AiElementCollection
from askui.models.models import ModelComposition, ModelName
from askui.models.types.response_schemas import ResponseSchema
from askui.reporting import CompositeReporter, Reporter
from askui.tools.toolbox import AgentToolbox
from askui.utils.image_utils import ImageSource
-from .askui.api import AskUiInferenceApi
-from .anthropic.claude import ClaudeHandler
-from .huggingface.spaces_api import HFSpacesHandler
+
from ..exceptions import AutomationError, ElementNotFoundError
from ..logger import logger
-from .ui_tars_ep.ui_tars_api import UITarsAPIHandler
+from .anthropic.claude import ClaudeHandler
from .anthropic.claude_agent import ClaudeComputerAgent
-from abc import ABC, abstractmethod
-
+from .askui.api import AskUiInferenceApi
+from .huggingface.spaces_api import HFSpacesHandler
+from .ui_tars_ep.ui_tars_api import UITarsAPIHandler
Point = tuple[int, int]
"""
@@ -28,10 +28,13 @@
"""
-def handle_response(response: tuple[int | None, int | None], locator: str | Locator):
- if response[0] is None or response[1] is None:
+def handle_response(
+ response: tuple[int | None, int | None], locator: str | Locator
+) -> tuple[int, int]:
+ x, y = response
+ if x is None or y is None:
raise ElementNotFoundError(f"Element not found: {locator}")
- return response
+ return x, y
class GroundingModelRouter(ABC):
@@ -56,8 +59,10 @@ def is_authenticated(self) -> bool:
class AskUiModelRouter(GroundingModelRouter):
def __init__(self, inference_api: AskUiInferenceApi):
self._inference_api = inference_api
-
- def _locate_with_askui_ocr(self, screenshot: Image.Image, locator: str | Text) -> Point:
+
+ def _locate_with_askui_ocr(
+ self, screenshot: Image.Image, locator: str | Text
+ ) -> Point:
locator = Text(locator) if isinstance(locator, str) else locator
x, y = self._inference_api.predict(screenshot, locator)
return handle_response((x, y), locator)
@@ -127,18 +132,26 @@ def __init__(
reporter=_reporter,
),
)
- self._grounding_model_routers = grounding_model_routers or [AskUiModelRouter(inference_api=self._askui)]
+ self._grounding_model_routers = grounding_model_routers or [
+ AskUiModelRouter(inference_api=self._askui)
+ ]
self._claude = ClaudeHandler()
self._huggingface_spaces = HFSpacesHandler()
self._tars = UITarsAPIHandler(agent_os=tools.agent_os, reporter=_reporter)
- self._claude_computer_agent = ClaudeComputerAgent(agent_os=tools.agent_os, reporter=_reporter)
+ self._claude_computer_agent = ClaudeComputerAgent(
+ agent_os=tools.agent_os, reporter=_reporter
+ )
self._locator_serializer = VlmLocatorSerializer()
- def act(self, goal: str, model: ModelComposition | str | None = None):
+ def act(self, goal: str, model: ModelComposition | str | None = None) -> None:
if self._tars.authenticated and model == ModelName.TARS:
- return self._tars.act(goal)
- if self._claude.authenticated and (model is None or isinstance(model, str) and model.startswith(ModelName.ANTHROPIC)):
- return self._claude_computer_agent.run(goal)
+ self._tars.act(goal)
+ if self._claude.authenticated and (
+ model is None
+ or isinstance(model, str)
+ and model.startswith(ModelName.ANTHROPIC)
+ ):
+ self._claude_computer_agent.run(goal)
raise AutomationError(f"Invalid model for act: {model}")
def get_inference(
@@ -150,13 +163,17 @@ def get_inference(
) -> ResponseSchema | str:
if self._tars.authenticated and model == ModelName.TARS:
if response_schema not in [str, None]:
- raise NotImplementedError("(Non-String) Response schema is not yet supported for UI-TARS models.")
+ raise NotImplementedError(
+ "(Non-String) Response schema is not yet supported for UI-TARS models."
+ )
return self._tars.get_inference(image=image, query=query)
if self._claude.authenticated and (
isinstance(model, str) and model.startswith(ModelName.ANTHROPIC)
):
if response_schema not in [str, None]:
- raise NotImplementedError("(Non-String) Response schema is not yet supported for Anthropic models.")
+ raise NotImplementedError(
+ "(Non-String) Response schema is not yet supported for Anthropic models."
+ )
return self._claude.get_inference(image=image, query=query)
if self._askui.authenticated and (model == ModelName.ASKUI or model is None):
return self._askui.get_inference(
@@ -180,6 +197,8 @@ def locate(
locator: str | Locator,
model: ModelComposition | str | None = None,
) -> Point:
+ x: int | None = None
+ y: int | None = None
if (
isinstance(model, str)
and model in self._huggingface_spaces.get_spaces_names()
@@ -206,7 +225,8 @@ def locate(
return handle_response((x, y), locator)
if (
self._claude.authenticated
- and isinstance(model, str) and model.startswith(ModelName.ANTHROPIC)
+ and isinstance(model, str)
+ and model.startswith(ModelName.ANTHROPIC)
):
logger.debug("Routing locate prediction to Anthropic")
x, y = self._claude.locate_inference(
diff --git a/src/askui/models/types/response_schemas.py b/src/askui/models/types/response_schemas.py
index c75472af..1191ffb5 100644
--- a/src/askui/models/types/response_schemas.py
+++ b/src/askui/models/types/response_schemas.py
@@ -1,4 +1,5 @@
from typing import Type, TypeVar, overload
+
from pydantic import BaseModel, ConfigDict, RootModel
@@ -11,16 +12,17 @@ class ResponseSchemaBase(BaseModel):
```python
class UrlResponse(ResponseSchemaBase):
url: str
-
+
# nested models should also extend ResponseSchemaBase
class NestedResponse(ResponseSchemaBase):
nested: UrlResponse
-
+
# metadata, e.g., `examples` or `description` of `Field`, is generally also passed to and considered by the models
class UrlResponse(ResponseSchemaBase):
url: str = Field(description="The URL of the response. Should used `\"https\"` scheme.", examples=["https://www.example.com"])
```
"""
+
model_config = ConfigDict(extra="forbid")
@@ -30,7 +32,7 @@ class UrlResponse(ResponseSchemaBase):
Float = RootModel[float]
-ResponseSchema = TypeVar('ResponseSchema', ResponseSchemaBase, str, bool, int, float)
+ResponseSchema = TypeVar("ResponseSchema", ResponseSchemaBase, str, bool, int, float)
"""Type of the responses of data extracted, e.g., using `askui.VisionAgent.get()`.
The following types are allowed:
@@ -56,8 +58,23 @@ def to_response_schema(response_schema: Type[int]) -> Type[Integer]: ...
@overload
def to_response_schema(response_schema: Type[float]) -> Type[Float]: ...
@overload
-def to_response_schema(response_schema: Type[ResponseSchemaBase]) -> Type[ResponseSchemaBase]: ...
-def to_response_schema(response_schema: Type[ResponseSchemaBase] | Type[str] | Type[bool] | Type[int] | Type[float] | None = None) -> Type[ResponseSchemaBase] | Type[String] | Type[Boolean] | Type[Integer] | Type[Float]:
+def to_response_schema(
+ response_schema: Type[ResponseSchemaBase],
+) -> Type[ResponseSchemaBase]: ...
+def to_response_schema(
+ response_schema: Type[ResponseSchemaBase]
+ | Type[str]
+ | Type[bool]
+ | Type[int]
+ | Type[float]
+ | None = None,
+) -> (
+ Type[ResponseSchemaBase]
+ | Type[String]
+ | Type[Boolean]
+ | Type[Integer]
+ | Type[Float]
+):
if response_schema is None:
return String
if response_schema is str:
diff --git a/src/askui/models/ui_tars_ep/parser.py b/src/askui/models/ui_tars_ep/parser.py
index 052d9da7..39371c0d 100644
--- a/src/askui/models/ui_tars_ep/parser.py
+++ b/src/askui/models/ui_tars_ep/parser.py
@@ -1,81 +1,111 @@
-from pydantic import BaseModel, Field
-from typing import Optional, Literal, Union, Tuple
import re
+from typing import Literal, Union
+
+from pydantic import BaseModel, Field
+
class BoxCoordinate(BaseModel):
"""Represents a box coordinate in the format (x,y)."""
+
x: int
y: int
@classmethod
def parse(cls, coord_str: str) -> "BoxCoordinate":
"""Parse a coordinate string in the format (x,y)."""
- match = re.match(r'\((\d+),(\d+)\)', coord_str)
+ match = re.match(r"\((\d+),(\d+)\)", coord_str)
if not match:
raise ValueError(f"Invalid coordinate format: {coord_str}")
return cls(x=int(match.group(1)), y=int(match.group(2)))
+
class ClickAction(BaseModel):
"""Click action with start box coordinates."""
+
action_type: Literal["click"] = "click"
start_box: BoxCoordinate
+
class DoubleClickAction(BaseModel):
"""Double left click action with start box coordinates."""
+
action_type: Literal["left_double"] = "left_double"
start_box: BoxCoordinate
+
class RightClickAction(BaseModel):
"""Right click action with start box coordinates."""
+
action_type: Literal["right_single"] = "right_single"
start_box: BoxCoordinate
+
class DragAction(BaseModel):
"""Drag action with start and end box coordinates."""
+
action_type: Literal["drag"] = "drag"
start_box: BoxCoordinate
end_box: BoxCoordinate
+
class HotkeyAction(BaseModel):
"""Hotkey action with key combination."""
+
action_type: Literal["hotkey"] = "hotkey"
key: str
+
class TypeAction(BaseModel):
"""Type action with content."""
+
action_type: Literal["type"] = "type"
content: str
+
class ScrollAction(BaseModel):
"""Scroll action with direction and start box."""
+
action_type: Literal["scroll"] = "scroll"
start_box: BoxCoordinate
direction: Literal["up", "down", "left", "right"]
+
class WaitAction(BaseModel):
"""Wait action."""
+
action_type: Literal["wait"] = "wait"
+
class FinishedAction(BaseModel):
"""Finished action."""
+
action_type: Literal["finished"] = "finished"
+
class CallUserAction(BaseModel):
"""Call user action."""
+
action_type: Literal["call_user"] = "call_user"
+
ActionType = Union[
- ClickAction, DoubleClickAction, RightClickAction, DragAction,
- HotkeyAction, TypeAction, ScrollAction, WaitAction,
- FinishedAction, CallUserAction
+ ClickAction,
+ DoubleClickAction,
+ RightClickAction,
+ DragAction,
+ HotkeyAction,
+ TypeAction,
+ ScrollAction,
+ WaitAction,
+ FinishedAction,
+ CallUserAction,
]
+
class UITarsEPMessage(BaseModel):
"""Pydantic model for parsing messages from UI-TARS-EP model."""
-
- thought: str = Field(
- description="The reasoning/thought process behind the action"
- )
+
+ thought: str = Field(description="The reasoning/thought process behind the action")
raw_action: str = Field(
description="The raw action string as received from the model"
)
@@ -87,70 +117,65 @@ class UITarsEPMessage(BaseModel):
def parse_message(cls, message: str) -> "UITarsEPMessage":
"""Parse a message string into a UITarsEPMessage object."""
# Split on actual newlines or escaped newlines
- parts = re.split(r'\n|\\n', message)
-
+ parts = re.split(r"\n|\\n", message)
+
thought = ""
action = ""
-
+
for part in parts:
if part.startswith("Thought:"):
thought = part.replace("Thought:", "").strip()
elif part.startswith("Action:"):
action = part.replace("Action:", "").strip()
-
+
parsed_action = cls.parse_action(action)
-
- return cls(
- thought=thought,
- raw_action=action,
- parsed_action=parsed_action
- )
+
+ return cls(thought=thought, raw_action=action, parsed_action=parsed_action)
@staticmethod
def parse_action(action_str: str) -> ActionType:
"""Parse the action string into the appropriate action type."""
# Extract action type and parameters
- match = re.match(r'(\w+)\((.*)\)', action_str)
+ match = re.match(r"(\w+)\((.*)\)", action_str)
if not match:
raise ValueError(f"Invalid action format: {action_str}")
-
+
action_type, params_str = match.groups()
-
+
# Handle parameters more robustly
params = {}
if params_str:
# Split by = but preserve the rest of the string
- key_value = params_str.split('=', 1)
+ key_value = params_str.split("=", 1)
if len(key_value) == 2:
key = key_value[0].strip()
value = key_value[1].strip("'\"")
params[key] = value
-
+
if action_type == "click":
return ClickAction(start_box=BoxCoordinate.parse(params["start_box"]))
- elif action_type == "left_double":
+ if action_type == "left_double":
return DoubleClickAction(start_box=BoxCoordinate.parse(params["start_box"]))
- elif action_type == "right_single":
+ if action_type == "right_single":
return RightClickAction(start_box=BoxCoordinate.parse(params["start_box"]))
- elif action_type == "drag":
+ if action_type == "drag":
return DragAction(
start_box=BoxCoordinate.parse(params["start_box"]),
- end_box=BoxCoordinate.parse(params["end_box"])
+ end_box=BoxCoordinate.parse(params["end_box"]),
)
- elif action_type == "hotkey":
+ if action_type == "hotkey":
return HotkeyAction(key=params["key"])
- elif action_type == "type":
+ if action_type == "type":
return TypeAction(content=params["content"])
- elif action_type == "scroll":
+ if action_type == "scroll":
return ScrollAction(
start_box=BoxCoordinate.parse(params["start_box"]),
- direction=params["direction"]
+ direction=params["direction"],
)
- elif action_type == "wait":
+ if action_type == "wait":
return WaitAction()
- elif action_type == "finished":
+ if action_type == "finished":
return FinishedAction()
- elif action_type == "call_user":
+ if action_type == "call_user":
return CallUserAction()
- else:
- raise ValueError(f"Unknown action type: {action_type}")
+ raise ValueError(f"Unknown action type: {action_type}")
diff --git a/src/askui/models/ui_tars_ep/ui_tars_api.py b/src/askui/models/ui_tars_ep/ui_tars_api.py
index dd7135ea..00df480d 100644
--- a/src/askui/models/ui_tars_ep/ui_tars_api.py
+++ b/src/askui/models/ui_tars_ep/ui_tars_api.py
@@ -1,21 +1,23 @@
-import re
import os
import pathlib
+import re
+import time
from typing import Any, Union
+
from openai import OpenAI
+from PIL import Image
+
+from askui.exceptions import NoResponseToQueryError
from askui.reporting import Reporter
from askui.tools.agent_os import AgentOs
-from askui.utils.image_utils import image_to_base64
-from PIL import Image
+from askui.utils.image_utils import ImageSource, image_to_base64
-from askui.utils.image_utils import ImageSource
-from .prompts import PROMPT, PROMPT_QA
from .parser import UITarsEPMessage
-import time
+from .prompts import PROMPT, PROMPT_QA
class UITarsAPIHandler:
- def __init__(self, agent_os: AgentOs, reporter: Reporter):
+ def __init__(self, agent_os: AgentOs, reporter: Reporter) -> None:
self._agent_os = agent_os
self._reporter = reporter
if os.getenv("TARS_URL") is None or os.getenv("TARS_API_KEY") is None:
@@ -23,30 +25,26 @@ def __init__(self, agent_os: AgentOs, reporter: Reporter):
else:
self.authenticated = True
self.client = OpenAI(
- base_url=os.getenv("TARS_URL"),
- api_key=os.getenv("TARS_API_KEY")
+ base_url=os.getenv("TARS_URL"), api_key=os.getenv("TARS_API_KEY")
)
- def _predict(self, image_url: str, instruction: str, prompt: str) -> Any:
+ def _predict(self, image_url: str, instruction: str, prompt: str) -> str | None:
chat_completion = self.client.chat.completions.create(
- model="tgi",
- messages=[
- {
- "role": "user",
- "content": [
- {
- "type": "image_url",
- "image_url": {
- "url": image_url,
- }
- },
- {
- "type": "text",
- "text": prompt + instruction
- }
- ]
- }
- ],
+ model="tgi",
+ messages=[
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "image_url",
+ "image_url": {
+ "url": image_url,
+ },
+ },
+ {"type": "text", "text": prompt + instruction},
+ ],
+ }
+ ],
top_p=None,
temperature=None,
max_tokens=150,
@@ -54,11 +52,13 @@ def _predict(self, image_url: str, instruction: str, prompt: str) -> Any:
seed=None,
stop=None,
frequency_penalty=None,
- presence_penalty=None
+ presence_penalty=None,
)
return chat_completion.choices[0].message.content
- def locate_prediction(self, image: Union[pathlib.Path, Image.Image], locator: str) -> tuple[int | None, int | None]:
+ def locate_prediction(
+ self, image: Union[pathlib.Path, Image.Image], locator: str
+ ) -> tuple[int | None, int | None]:
askui_locator = f'Click on "{locator}"'
prediction = self._predict(
image_url=f"data:image/png;base64,{image_to_base64(image)}",
@@ -79,11 +79,16 @@ def locate_prediction(self, image: Union[pathlib.Path, Image.Image], locator: st
return None, None
def get_inference(self, image: ImageSource, query: str) -> str:
- return self._predict(
+ response = self._predict(
image_url=image.to_data_url(),
instruction=query,
prompt=PROMPT_QA,
)
+ if response is None:
+ raise NoResponseToQueryError(
+ f"No response from UI-TARS to query: {query}", query
+ )
+ return response
def act(self, goal: str) -> None:
screenshot = self._agent_os.screenshot()
@@ -95,18 +100,15 @@ def act(self, goal: str) -> None:
"type": "image_url",
"image_url": {
"url": f"data:image/png;base64,{image_to_base64(screenshot)}"
- }
+ },
},
- {
- "type": "text",
- "text": PROMPT + goal
- }
- ]
+ {"type": "text", "text": PROMPT + goal},
+ ],
}
]
self.execute_act(self.act_history)
- def add_screenshot_to_history(self, message_history):
+ def add_screenshot_to_history(self, message_history: list[dict[str, Any]]) -> None:
screenshot = self._agent_os.screenshot()
message_history.append(
{
@@ -116,54 +118,57 @@ def add_screenshot_to_history(self, message_history):
"type": "image_url",
"image_url": {
"url": f"data:image/png;base64,{image_to_base64(screenshot)}"
- }
+ },
}
- ]
+ ],
}
)
- def filter_message_thread(self, message_history, max_screenshots=3):
+ def filter_message_thread(
+ self, message_history: list[dict[str, Any]], max_screenshots: int = 3
+ ) -> list[dict[str, Any]]:
"""
Filter message history to keep only the last n screenshots while preserving all text content.
-
+
Args:
message_history: List of message dictionaries
max_screenshots: Maximum number of screenshots to keep (default: 5)
"""
# Count screenshots from the end to keep track of the most recent ones
screenshot_count = 0
- filtered_messages = []
-
+ filtered_messages: list[dict[str, Any]] = []
+
# Iterate through messages in reverse to keep the most recent screenshots
for message in reversed(message_history):
- content = message['content']
-
+ content = message["content"]
+
if isinstance(content, list):
# Check if message contains an image
- has_image = any(item.get('type') == 'image_url' for item in content)
-
+ has_image = any(item.get("type") == "image_url" for item in content)
+
if has_image:
screenshot_count += 1
if screenshot_count <= max_screenshots:
filtered_messages.insert(0, message)
else:
# Keep only text content if screenshot limit exceeded
- text_content = [item for item in content if item.get('type') == 'text']
+ text_content = [
+ item for item in content if item.get("type") == "text"
+ ]
if text_content:
- filtered_messages.insert(0, {
- 'role': message['role'],
- 'content': text_content
- })
+ filtered_messages.insert(
+ 0, {"role": message["role"], "content": text_content}
+ )
else:
filtered_messages.insert(0, message)
else:
filtered_messages.insert(0, message)
-
+
return filtered_messages
- def execute_act(self, message_history):
+ def execute_act(self, message_history: list[dict[str, Any]]) -> None:
message_history = self.filter_message_thread(message_history)
-
+
chat_completion = self.client.chat.completions.create(
model="tgi",
messages=message_history,
@@ -174,12 +179,12 @@ def execute_act(self, message_history):
seed=None,
stop=None,
frequency_penalty=None,
- presence_penalty=None
+ presence_penalty=None,
)
raw_message = chat_completion.choices[-1].message.content
print(raw_message)
- if self._reporter is not None:
+ if self._reporter is not None:
self._reporter.add_message("UI-TARS", raw_message)
try:
@@ -187,15 +192,7 @@ def execute_act(self, message_history):
print(message)
except Exception as e:
message_history.append(
- {
- "role": "user",
- "content": [
- {
- "type": "text",
- "text": str(e)
- }
- ]
- }
+ {"role": "user", "content": [{"type": "text", "text": str(e)}]}
)
self.execute_act(message_history)
return
@@ -222,3 +219,8 @@ def execute_act(self, message_history):
self.add_screenshot_to_history(message_history)
self.execute_act(message_history)
+
+ def _filter_messages(
+ self, messages: list[UITarsEPMessage], max_messages: int
+ ) -> list[UITarsEPMessage]:
+ return messages[-max_messages:]
diff --git a/src/askui/reporting.py b/src/askui/reporting.py
index d3f78ce2..cdb04040 100644
--- a/src/askui/reporting.py
+++ b/src/askui/reporting.py
@@ -1,22 +1,23 @@
-from abc import ABC, abstractmethod
-from pathlib import Path
-import random
-from jinja2 import Template
-from datetime import datetime
-from typing import List, Dict, Optional, Union
-from typing_extensions import override
+import base64
+import json
import platform
+import random
import sys
+from abc import ABC, abstractmethod
+from datetime import datetime
from importlib.metadata import distributions
-import base64
from io import BytesIO
+from pathlib import Path
+from typing import Dict, List, Optional, Union
+
+from jinja2 import Template
from PIL import Image
-import json
+from typing_extensions import TypedDict, override
class Reporter(ABC):
"""Abstract base class for reporters. Cannot be instantiated directly.
-
+
Defines the interface that all reporters must implement to be used with `askui.VisionAgent`.
"""
@@ -28,30 +29,29 @@ def add_message(
image: Optional[Image.Image | list[Image.Image]] = None,
) -> None:
"""Add a message to the report.
-
+
Args:
role (str): The role of the message sender (e.g., `"User"`, `"Assistant"`, `"System"`)
content (Union[str, dict, list]): The message content, which can be a string, dictionary, or list, e.g. `'click 2x times on text "Edit"'`
image (Optional[PIL.Image.Image | list[PIL.Image.Image]], optional): PIL Image or list of PIL Images to include with the message
"""
- raise NotImplementedError()
+ raise NotImplementedError
@abstractmethod
def generate(self) -> None:
"""Generates the final report.
-
+
Implementing this method is only required if the report is not generated in "real-time", e.g., on calls of `add_message()`, but must be generated at the end of the execution.
-
+
This method is called when the `askui.VisionAgent` context is exited or `askui.VisionAgent.close()` is called.
"""
- pass
class CompositeReporter(Reporter):
"""A reporter that combines multiple reporters.
-
+
Allows generating different reports simultaneously. Each message added will be forwarded to all reporters passed to the constructor. The reporters are called (`add_message()`, `generate()`) in the order they are ordered in the `reporters` list.
-
+
Args:
reporters (list[Reporter] | None, optional): List of reporters to combine
"""
@@ -77,9 +77,15 @@ def generate(self) -> None:
report.generate()
+class SystemInfo(TypedDict):
+ platform: str
+ python_version: str
+ packages: list[str]
+
+
class SimpleHtmlReporter(Reporter):
"""A reporter that generates HTML reports with conversation logs and system information.
-
+
Args:
report_dir (str, optional): Directory where reports will be saved. Defaults to `reports`.
"""
@@ -90,7 +96,7 @@ def __init__(self, report_dir: str = "reports") -> None:
self.messages: List[Dict] = []
self.system_info = self._collect_system_info()
- def _collect_system_info(self) -> Dict[str, str]:
+ def _collect_system_info(self) -> SystemInfo:
"""Collect system and Python information"""
return {
"platform": platform.platform(),
@@ -137,7 +143,7 @@ def add_message(
@override
def generate(self) -> None:
"""Generate an HTML report file.
-
+
Creates a timestamped HTML file in the `report_dir` containing:
- System information
- All collected messages with their content and images
@@ -299,5 +305,8 @@ def generate(self) -> None:
system_info=self.system_info,
)
- report_path = self.report_dir / f"report_{datetime.now():%Y%m%d%H%M%S%f}{random.randint(0, 1000):03}.html"
+ report_path = (
+ self.report_dir
+ / f"report_{datetime.now():%Y%m%d%H%M%S%f}{random.randint(0, 1000):03}.html"
+ )
report_path.write_text(html)
diff --git a/src/askui/settings.py b/src/askui/settings.py
index bc69bf80..addd0ec6 100644
--- a/src/askui/settings.py
+++ b/src/askui/settings.py
@@ -5,6 +5,7 @@
class Settings(BaseSettings):
"""Main settings class"""
+
telemetry: TelemetrySettings = TelemetrySettings()
model_config = SettingsConfigDict(
@@ -16,4 +17,5 @@ class Settings(BaseSettings):
extra="ignore",
)
-settings = Settings() # type: ignore
+
+settings = Settings()
diff --git a/src/askui/telemetry/__init__.py b/src/askui/telemetry/__init__.py
index 36dab1e2..60ad44ea 100644
--- a/src/askui/telemetry/__init__.py
+++ b/src/askui/telemetry/__init__.py
@@ -1,6 +1,12 @@
+from .context import (
+ AppContext,
+ DeviceContext,
+ OSContext,
+ PlatformContext,
+ TelemetryContext,
+)
+from .processors import InMemoryProcessor, Segment, TelemetryEvent, TelemetryProcessor
from .telemetry import Telemetry, TelemetrySettings
-from .processors import InMemoryProcessor, TelemetryEvent, TelemetryProcessor, Segment
-from .context import AppContext, DeviceContext, OSContext, PlatformContext, TelemetryContext
__all__ = [
"AppContext",
diff --git a/src/askui/telemetry/anonymous_id.py b/src/askui/telemetry/anonymous_id.py
index 22706af3..996bd77d 100644
--- a/src/askui/telemetry/anonymous_id.py
+++ b/src/askui/telemetry/anonymous_id.py
@@ -4,12 +4,12 @@
from askui.logger import logger
from askui.telemetry.device_id import get_device_id
-from askui.telemetry.utils import is_valid_uuid4, hash_to_uuid4
-
+from askui.telemetry.utils import hash_to_uuid4, is_valid_uuid4
_ANONYMOUS_ID_FILE_PATH = Path.home() / ".askui" / "ADK" / "anonymous_id"
_anonymous_id: str | None = None
+
def _read_anonymous_id_from_file() -> str | None:
"""Read anonymous ID from file if it exists."""
try:
@@ -33,7 +33,7 @@ def _write_anonymous_id_to_file(anonymous_id: str) -> bool:
logger.warning(f"Failed to write anonymous ID to file: {str(e)}")
return False
-
+
def get_anonymous_id() -> str:
"""Get an anonymous (user) ID for telemetry purposes.
diff --git a/src/askui/telemetry/context.py b/src/askui/telemetry/context.py
index 1620956a..e58447db 100644
--- a/src/askui/telemetry/context.py
+++ b/src/askui/telemetry/context.py
@@ -1,14 +1,14 @@
import os
from typing import TypedDict
-from typing_extensions import NotRequired
from pydantic import ConfigDict
+from typing_extensions import NotRequired
class AppContext(TypedDict, total=False):
"""App (askui SDK/library/package) context information."""
- __pydantic_config__ = ConfigDict(extra="allow")
+ __pydantic_config__ = ConfigDict(extra="allow") # type: ignore
name: str
version: str
@@ -17,7 +17,7 @@ class AppContext(TypedDict, total=False):
class OSContext(TypedDict, total=False):
"""OS context information."""
- __pydantic_config__ = ConfigDict(extra="allow")
+ __pydantic_config__ = ConfigDict(extra="allow") # type: ignore
name: str
version: str
@@ -27,7 +27,7 @@ class OSContext(TypedDict, total=False):
class PlatformContext(TypedDict, total=False):
"""Platform context information."""
- __pydantic_config__ = ConfigDict(extra="allow")
+ __pydantic_config__ = ConfigDict(extra="allow") # type: ignore
arch: str
python_version: str
@@ -36,7 +36,7 @@ class PlatformContext(TypedDict, total=False):
class DeviceContext(TypedDict, total=False):
"""Device context information."""
- __pydantic_config__ = ConfigDict(extra="allow")
+ __pydantic_config__ = ConfigDict(extra="allow") # type: ignore
id: str
@@ -44,7 +44,7 @@ class DeviceContext(TypedDict, total=False):
class TelemetryContext(TypedDict, total=False):
"""Context information."""
- __pydantic_config__ = ConfigDict(extra="allow")
+ __pydantic_config__ = ConfigDict(extra="allow") # type: ignore
app: AppContext
user_id: NotRequired[str]
diff --git a/src/askui/telemetry/device_id.py b/src/askui/telemetry/device_id.py
index 04eed219..5970d4db 100644
--- a/src/askui/telemetry/device_id.py
+++ b/src/askui/telemetry/device_id.py
@@ -9,7 +9,7 @@
def get_device_id() -> str | None:
"""Get the device ID (hashed) of the host device
-
+
Returns None if the device ID is not found.
"""
global _device_id
diff --git a/src/askui/telemetry/pkg_version.py b/src/askui/telemetry/pkg_version.py
index a46da04a..4d52aefc 100644
--- a/src/askui/telemetry/pkg_version.py
+++ b/src/askui/telemetry/pkg_version.py
@@ -1,4 +1,4 @@
-from importlib.metadata import Distribution, distribution, PackageNotFoundError, version
+from importlib.metadata import Distribution, PackageNotFoundError, distribution, version
from askui.logger import logger
@@ -7,13 +7,14 @@ def _get_module_name() -> str:
"""Return the top-level package name from the module path."""
if __name__ == "__main__":
raise RuntimeError("This module is not meant to be run directly.")
-
+
parts = __name__.split(".")
if not parts:
raise RuntimeError("Failed to determine the module name - empty module path")
-
+
return parts[0]
+
def _get_distribution() -> Distribution | None:
"""Get the distribution for the current package safely."""
try:
@@ -23,14 +24,15 @@ def _get_distribution() -> Distribution | None:
logger.warning(f"Failed to get distribution: {str(e)}")
return None
+
def get_pkg_version() -> str:
"""Return the package version or 'unknown' if version cannot be determined."""
dist = _get_distribution()
if dist is None:
return "unknown"
-
+
try:
return version(dist.name)
except PackageNotFoundError:
- logger.debug(f"Package \"{dist.name}\" not found. Setting version to \"unknown\".")
+ logger.debug(f'Package "{dist.name}" not found. Setting version to "unknown".')
return "unknown"
diff --git a/src/askui/telemetry/processors.py b/src/askui/telemetry/processors.py
index 48fc2459..a38f86eb 100644
--- a/src/askui/telemetry/processors.py
+++ b/src/askui/telemetry/processors.py
@@ -1,9 +1,9 @@
import abc
-
from datetime import datetime, timezone
from typing import Any, TypedDict
from pydantic import BaseModel, HttpUrl
+
from askui.logger import logger
from askui.telemetry.context import TelemetryContext
@@ -37,7 +37,7 @@ class Segment(TelemetryProcessor):
def __init__(self, settings: SegmentSettings) -> None:
self._settings = settings
- from segment import analytics
+ from segment import analytics # type: ignore
self._analytics = analytics
self._analytics.write_key = settings.write_key
@@ -62,7 +62,7 @@ def record_event(
"platform": context["platform"],
"session_id": context["session_id"],
"call_stack": context["call_stack"],
- }
+ },
},
context={
"app": context["app"],
@@ -77,7 +77,7 @@ def record_event(
)
except Exception as e:
logger.debug(f'Failed to track event "{name}" using Segment: {e}')
-
+
def flush(self) -> None:
self._analytics.flush()
diff --git a/src/askui/telemetry/telemetry.py b/src/askui/telemetry/telemetry.py
index 5ddc61c4..502a1b17 100644
--- a/src/askui/telemetry/telemetry.py
+++ b/src/askui/telemetry/telemetry.py
@@ -2,21 +2,23 @@
import os
import platform
import time
-from functools import wraps
-from typing import Any, Callable
import uuid
+from collections.abc import Callable
+from functools import wraps
+from typing import Any
from pydantic import BaseModel, Field
+from typing_extensions import ParamSpec, TypeVar
from askui.logger import logger
from askui.telemetry.anonymous_id import get_anonymous_id
from askui.telemetry.context import (
+ AppContext,
CallStack,
DeviceContext,
- TelemetryContext,
- AppContext,
OSContext,
PlatformContext,
+ TelemetryContext,
)
from askui.telemetry.device_id import get_device_id
from askui.telemetry.pkg_version import get_pkg_version
@@ -26,6 +28,9 @@
UserIdentificationSettings,
)
+P = ParamSpec("P")
+R = TypeVar("R")
+
class TelemetrySettings(BaseModel):
"""Settings for telemetry configuration"""
@@ -48,7 +53,7 @@ class TelemetrySettings(BaseModel):
description=(
"The device ID of the host machine. "
"This is used to identify the device and the user (if anynomous) across AskUI components. "
- 'We hash it with an AskUI specific salt to avoid user tracking across (non-AskUI) '
+ "We hash it with an AskUI specific salt to avoid user tracking across (non-AskUI) "
"applications or exposing the actual machine ID. This is the trade-off we chose for now to "
"protect user privacy while still being able to improve the UX across components."
),
@@ -129,38 +134,38 @@ def record_call(
exclude_exception: bool = False,
exclude_start: bool = True,
flush: bool = False,
- ) -> Callable:
+ ) -> Callable[[Callable[P, R]], Callable[P, R]]:
"""Decorator to record calls to functions and methods
-
- IMPORTANT: Parameters, responses and exceptions recorded must be serializable to JSON. Either make
- sure that they are serializable or exclude them using the `exclude` parameter or use the
+
+ IMPORTANT: Parameters, responses and exceptions recorded must be serializable to JSON. Either make
+ sure that they are serializable or exclude them using the `exclude` parameter or use the
`exclude_response` and `exclude_exception` parameters.
Args:
- exclude: Set of parameters whose values are to be excluded from tracking (masked to retain
+ exclude: Set of parameters whose values are to be excluded from tracking (masked to retain
structure of the call)
- exclude_first_arg: Whether to exclude the first argument, e.g., self or cls for instance and
- class methods. Defaults to `True`, for functions and static methods, it should be set to
+ exclude_first_arg: Whether to exclude the first argument, e.g., self or cls for instance and
+ class methods. Defaults to `True`, for functions and static methods, it should be set to
`False`
- exclude_response: Whether to exclude the response of the function in the telemetry event.
+ exclude_response: Whether to exclude the response of the function in the telemetry event.
Defaults to `True`
- exclude_exception: Whether to exclude the exception if one is raised in the telemetry event.
+ exclude_exception: Whether to exclude the exception if one is raised in the telemetry event.
Defaults to `False`
- exclude_start: Whether to exclude the start of the function call as a telemetry event.
+ exclude_start: Whether to exclude the start of the function call as a telemetry event.
Defaults to `True`
- flush: Whether to flush the telemetry data to the backend(s) after recording an event.
- Defaults to `False`. Should be set to `True` if the process is expected to exit afterwards.
- Setting it to `True` can have a slightly negative impact on performance but ensures that
+ flush: Whether to flush the telemetry data to the backend(s) after recording an event.
+ Defaults to `False`. Should be set to `True` if the process is expected to exit afterwards.
+ Setting it to `True` can have a slightly negative impact on performance but ensures that
telemetry data is not lost in case of a crash.
"""
_exclude = exclude or set()
- def decorator(func: Callable) -> Callable:
+ def decorator(func: Callable[P, R]) -> Callable[P, R]:
param_names_sorted = list(inspect.signature(func).parameters.keys())
@wraps(func)
- def wrapper(*args: Any, **kwargs: Any) -> Any:
+ def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
if not self._settings.enabled:
return func(*args, **kwargs)
@@ -174,7 +179,10 @@ def wrapper(*args: Any, **kwargs: Any) -> Any:
)
if exclude_first_arg:
processed_args = processed_args[1:] if processed_args else ()
- processed_args = tuple(arg.model_dump() if isinstance(arg, BaseModel) else arg for arg in processed_args)
+ processed_args = tuple(
+ arg.model_dump() if isinstance(arg, BaseModel) else arg
+ for arg in processed_args
+ )
processed_kwargs = {
k: v if k not in _exclude else self._EXCLUDE_MASK
for k, v in kwargs.items()
diff --git a/src/askui/telemetry/user_identification.py b/src/askui/telemetry/user_identification.py
index 4c6651da..dee7dffa 100644
--- a/src/askui/telemetry/user_identification.py
+++ b/src/askui/telemetry/user_identification.py
@@ -1,8 +1,13 @@
import base64
-from functools import cached_property
import os
+import types
+from functools import cached_property
+from typing import Type, cast
+
import httpx
from pydantic import BaseModel, Field, HttpUrl, SecretStr
+from typing_extensions import Self
+
from askui.logger import logger
@@ -15,6 +20,7 @@ def get_askui_token_from_env() -> SecretStr | None:
class UserIdentificationSettings(BaseModel):
"""Settings for user identification"""
+
api_url: HttpUrl = HttpUrl("https://workspaces.askui.com/api/v1")
# retrieving directly through environment variable to circumvent pydantic-settings env_prefix
askui_token: SecretStr | None = Field(default=get_askui_token_from_env())
@@ -40,10 +46,15 @@ def __init__(self, settings: UserIdentificationSettings):
self._client = httpx.Client(timeout=30.0)
- def __enter__(self):
+ def __enter__(self) -> Self:
return self
- def __exit__(self, exc_type, exc_value, traceback):
+ def __exit__(
+ self,
+ exc_type: Type[BaseException] | None,
+ exc_value: BaseException | None,
+ traceback: types.TracebackType | None,
+ ) -> None:
self._client.close()
def get_user_id(self) -> str | None:
@@ -59,11 +70,14 @@ def get_user_id(self) -> str | None:
},
headers={
"Authorization": f"Basic {self._settings.askui_token_encoded}",
- "Content-Type": "application/json"
- }
+ "Content-Type": "application/json",
+ },
)
response.raise_for_status()
- return response.json()["data"][0]["user"]["id"]
+ return cast(
+ "str | None",
+ response.json().get("data", [{}])[0].get("user", {}).get("id"),
+ )
except httpx.HTTPError as e:
logger.debug(f"Failed to identify user: {e}")
except Exception as e:
diff --git a/src/askui/tools/__init__.py b/src/askui/tools/__init__.py
index 3b1a761f..e6232162 100644
--- a/src/askui/tools/__init__.py
+++ b/src/askui/tools/__init__.py
@@ -6,4 +6,4 @@
"AgentToolbox",
"ModifierKey",
"PcKey",
-]
\ No newline at end of file
+]
diff --git a/src/askui/tools/agent_os.py b/src/askui/tools/agent_os.py
index e6b2614d..7b63afce 100644
--- a/src/askui/tools/agent_os.py
+++ b/src/askui/tools/agent_os.py
@@ -1,5 +1,6 @@
from abc import ABC, abstractmethod
from typing import Literal
+
from PIL import Image
ModifierKey = Literal["command", "alt", "control", "shift", "right_shift"]
@@ -133,32 +134,30 @@
class AgentOs(ABC):
"""
Abstract base class for Agent OS. Cannot be instantiated directly.
-
+
This class defines the interface for operating system interactions including mouse control,
keyboard input, and screen capture functionality. Implementations should provide concrete
functionality for these abstract methods.
"""
-
+
@abstractmethod
def connect(self) -> None:
"""
Establishes a connection to the Agent OS.
-
+
This method is called before performing any OS-level operations.
It handles any necessary setup or initialization required for the OS interaction.
"""
- pass
-
+
@abstractmethod
def disconnect(self) -> None:
"""
Terminates the connection to the Agent OS.
-
+
This method is called after all OS-level operations are complete.
It handles any necessary cleanup or resource release.
"""
- pass
-
+
@abstractmethod
def screenshot(self, report: bool = True) -> Image.Image:
"""
@@ -170,7 +169,7 @@ def screenshot(self, report: bool = True) -> Image.Image:
Returns:
Image.Image: A PIL Image object containing the screenshot.
"""
- raise NotImplementedError()
+ raise NotImplementedError
@abstractmethod
def mouse(self, x: int, y: int) -> None:
@@ -181,7 +180,7 @@ def mouse(self, x: int, y: int) -> None:
x (int): The horizontal coordinate (in pixels) to move to.
y (int): The vertical coordinate (in pixels) to move to.
"""
- raise NotImplementedError()
+ raise NotImplementedError
@abstractmethod
def type(self, text: str, typing_speed: int = 50) -> None:
@@ -192,7 +191,7 @@ def type(self, text: str, typing_speed: int = 50) -> None:
text (str): The text to be typed.
typing_speed (int, optional): The speed of typing in characters per minute. Defaults to `50`.
"""
- raise NotImplementedError()
+ raise NotImplementedError
@abstractmethod
def click(
@@ -205,7 +204,7 @@ def click(
button (Literal["left", "middle", "right"], optional): The mouse button to click. Defaults to `"left"`.
count (int, optional): Number of times to click. Defaults to `1`.
"""
- raise NotImplementedError()
+ raise NotImplementedError
@abstractmethod
def mouse_down(self, button: Literal["left", "middle", "right"] = "left") -> None:
@@ -215,7 +214,7 @@ def mouse_down(self, button: Literal["left", "middle", "right"] = "left") -> Non
Args:
button (Literal["left", "middle", "right"], optional): The mouse button to press. Defaults to `"left"`.
"""
- raise NotImplementedError()
+ raise NotImplementedError
@abstractmethod
def mouse_up(self, button: Literal["left", "middle", "right"] = "left") -> None:
@@ -225,7 +224,7 @@ def mouse_up(self, button: Literal["left", "middle", "right"] = "left") -> None:
Args:
button (Literal["left", "middle", "right"], optional): The mouse button to release. Defaults to `"left"`.
"""
- raise NotImplementedError()
+ raise NotImplementedError
@abstractmethod
def mouse_scroll(self, x: int, y: int) -> None:
@@ -236,7 +235,7 @@ def mouse_scroll(self, x: int, y: int) -> None:
x (int): The horizontal scroll amount. Positive values scroll right, negative values scroll left.
y (int): The vertical scroll amount. Positive values scroll down, negative values scroll up.
"""
- raise NotImplementedError()
+ raise NotImplementedError
@abstractmethod
def keyboard_pressed(
@@ -249,7 +248,7 @@ def keyboard_pressed(
key (PcKey | ModifierKey): The key to press.
modifier_keys (list[ModifierKey] | None, optional): List of modifier keys to press along with the main key. Defaults to `None`.
"""
- raise NotImplementedError()
+ raise NotImplementedError
@abstractmethod
def keyboard_release(
@@ -262,7 +261,7 @@ def keyboard_release(
key (PcKey | ModifierKey): The key to release.
modifier_keys (list[ModifierKey] | None, optional): List of modifier keys to release along with the main key. Defaults to `None`.
"""
- raise NotImplementedError()
+ raise NotImplementedError
@abstractmethod
def keyboard_tap(
@@ -275,7 +274,7 @@ def keyboard_tap(
key (PcKey | ModifierKey): The key to tap.
modifier_keys (list[ModifierKey] | None, optional): List of modifier keys to press along with the main key. Defaults to `None`.
"""
- raise NotImplementedError()
+ raise NotImplementedError
@abstractmethod
def set_display(self, displayNumber: int = 1) -> None:
@@ -285,4 +284,4 @@ def set_display(self, displayNumber: int = 1) -> None:
Args:
displayNumber (int, optional): The display number to set as active. Defaults to `1`.
"""
- raise NotImplementedError()
+ raise NotImplementedError
diff --git a/src/askui/tools/anthropic/base.py b/src/askui/tools/anthropic/base.py
index 565209b9..c6c290cb 100644
--- a/src/askui/tools/anthropic/base.py
+++ b/src/askui/tools/anthropic/base.py
@@ -9,7 +9,7 @@ class BaseAnthropicTool(metaclass=ABCMeta):
"""Abstract base class for Anthropic-defined tools."""
@abstractmethod
- def __call__(self, **kwargs) -> Any:
+ def __call__(self, **kwargs: Any) -> Any:
"""Executes the tool with the given arguments."""
...
@@ -23,7 +23,7 @@ def to_params(
@dataclass(kw_only=True, frozen=True)
class ToolResult:
"""Represents the result of a tool execution.
-
+
Args:
output (str | None, optional): The output of the tool.
error (str | None, optional): The error message of the tool.
@@ -36,13 +36,13 @@ class ToolResult:
base64_image: str | None = None
system: str | None = None
- def __bool__(self):
+ def __bool__(self) -> bool:
return any(getattr(self, field.name) for field in fields(self))
- def __add__(self, other: "ToolResult"):
+ def __add__(self, other: "ToolResult") -> "ToolResult":
def combine_fields(
field: str | None, other_field: str | None, concatenate: bool = True
- ):
+ ) -> str | None:
if field and other_field:
if concatenate:
return field + other_field
@@ -56,7 +56,7 @@ def combine_fields(
system=combine_fields(self.system, other.system),
)
- def replace(self, **kwargs):
+ def replace(self, **kwargs: Any) -> "ToolResult":
"""Returns a new ToolResult with the given fields replaced."""
return replace(self, **kwargs)
@@ -71,7 +71,7 @@ class ToolFailure(ToolResult):
class ToolError(Exception):
"""Raised when a tool encounters an error.
-
+
Args:
message (str): The error message.
result (ToolResult): The ToolResult that caused the error.
diff --git a/src/askui/tools/anthropic/collection.py b/src/askui/tools/anthropic/collection.py
index 49a47f35..2141c8fa 100644
--- a/src/askui/tools/anthropic/collection.py
+++ b/src/askui/tools/anthropic/collection.py
@@ -1,6 +1,6 @@
"""Collection classes for managing multiple tools."""
-from typing import Any
+from typing import Any, cast
from anthropic.types.beta import BetaToolUnionParam
@@ -29,6 +29,6 @@ def run(self, *, name: str, tool_input: dict[str, Any]) -> ToolResult:
if not tool:
return ToolFailure(error=f"Tool {name} is invalid")
try:
- return tool(**tool_input)
+ return cast("ToolResult", tool(**tool_input))
except ToolError as e:
return ToolFailure(error=e.message)
diff --git a/src/askui/tools/anthropic/computer.py b/src/askui/tools/anthropic/computer.py
index 082ff10f..6b279da7 100644
--- a/src/askui/tools/anthropic/computer.py
+++ b/src/askui/tools/anthropic/computer.py
@@ -1,12 +1,15 @@
-from typing import Literal, TypedDict
+from typing import Any, Literal, TypedDict
from anthropic.types.beta import BetaToolComputerUse20241022Param
-from ...utils.image_utils import image_to_base64, scale_coordinates_back, scale_image_with_padding
-
+from ...tools.agent_os import AgentOs
+from ...utils.image_utils import (
+ image_to_base64,
+ scale_coordinates_back,
+ scale_image_with_padding,
+)
from .base import BaseAnthropicTool, ToolError, ToolResult
-
Action = Literal[
"key",
"type",
@@ -21,7 +24,128 @@
]
-PC_KEY = Literal['backspace', 'delete', 'enter', 'tab', 'escape', 'up', 'down', 'right', 'left', 'home', 'end', 'pageup', 'pagedown', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12', 'space', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~']
+PC_KEY = Literal[
+ "backspace",
+ "delete",
+ "enter",
+ "tab",
+ "escape",
+ "up",
+ "down",
+ "right",
+ "left",
+ "home",
+ "end",
+ "pageup",
+ "pagedown",
+ "f1",
+ "f2",
+ "f3",
+ "f4",
+ "f5",
+ "f6",
+ "f7",
+ "f8",
+ "f9",
+ "f10",
+ "f11",
+ "f12",
+ "space",
+ "0",
+ "1",
+ "2",
+ "3",
+ "4",
+ "5",
+ "6",
+ "7",
+ "8",
+ "9",
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "!",
+ '"',
+ "#",
+ "$",
+ "%",
+ "&",
+ "'",
+ "(",
+ ")",
+ "*",
+ "+",
+ ",",
+ "-",
+ ".",
+ "/",
+ ":",
+ ";",
+ "<",
+ "=",
+ ">",
+ "?",
+ "@",
+ "[",
+ "\\",
+ "]",
+ "^",
+ "_",
+ "`",
+ "{",
+ "|",
+ "}",
+ "~",
+]
KEYSYM_MAP = {
@@ -37,8 +161,8 @@
"Left": "left",
"Home": "home",
"End": "end",
- "Page_Up": 'pageup',
- "Page_Down": 'pagedown',
+ "Page_Up": "pageup",
+ "Page_Down": "pagedown",
"F1": "f1",
"F2": "f2",
"F3": "f3",
@@ -50,7 +174,7 @@
"F9": "f9",
"F10": "f10",
"F11": "f11",
- "F12": "f12"
+ "F12": "f12",
}
@@ -90,17 +214,15 @@ class ComputerTool(BaseAnthropicTool):
@property
def options(self) -> ComputerToolOptions:
- width = self.width
- height = self.height
return {
- "display_width_px": width,
- "display_height_px": height,
+ "display_width_px": self.width,
+ "display_height_px": self.height,
}
def to_params(self) -> BetaToolComputerUse20241022Param:
return {"name": self.name, "type": self.api_type, **self.options}
- def __init__(self, controller_client):
+ def __init__(self, controller_client: AgentOs) -> None:
super().__init__()
self.controller_client = controller_client
@@ -116,11 +238,11 @@ def __call__(
action: Action | None = None,
text: str | None = None,
coordinate: tuple[int, int] | None = None,
- **kwargs,
- ):
+ **kwargs: Any,
+ ) -> ToolResult:
if action is None:
raise ToolError("Action is missing")
-
+
if action in ("mouse_move", "left_click_drag"):
if coordinate is None:
raise ToolError(f"coordinate is required for {action}")
@@ -131,13 +253,20 @@ def __call__(
if not all(isinstance(i, int) and i >= 0 for i in coordinate):
raise ToolError(f"{coordinate} must be a tuple of non-negative ints")
- x, y = scale_coordinates_back(coordinate[0], coordinate[1], self.real_screen_width, self.real_screen_height, self.width, self.height)
+ x, y = scale_coordinates_back(
+ coordinate[0],
+ coordinate[1],
+ self.real_screen_width,
+ self.real_screen_height,
+ self.width,
+ self.height,
+ )
x, y = int(x), int(y)
if action == "mouse_move":
self.controller_client.mouse(x, y)
return ToolResult()
- elif action == "left_click_drag":
+ if action == "left_click_drag":
self.controller_client.mouse_down("left")
self.controller_client.mouse(x, y)
self.controller_client.mouse_up("left")
@@ -156,11 +285,13 @@ def __call__(
text = KEYSYM_MAP[text]
if text not in PC_KEY.__args__:
- raise ToolError(f"Key {text} is not a valid PC_KEY from {', '.join(list(PC_KEY.__args__))}")
+ raise ToolError(
+ f"Key {text} is not a valid PC_KEY from {', '.join(list(PC_KEY.__args__))}"
+ )
self.controller_client.keyboard_pressed(text)
self.controller_client.keyboard_release(text)
return ToolResult()
- elif action == "type":
+ if action == "type":
self.controller_client.type(text)
return ToolResult()
@@ -179,25 +310,25 @@ def __call__(
if action == "screenshot":
return self.screenshot()
- elif action == "cursor_position":
+ if action == "cursor_position":
# TODO: Implement in the future
return ToolError("cursor_position is not implemented by this agent")
- elif action == "left_click":
+ if action == "left_click":
self.controller_client.click("left")
return ToolResult()
- elif action == "right_click":
+ if action == "right_click":
self.controller_client.click("right")
return ToolResult()
- elif action == "middle_click":
+ if action == "middle_click":
self.controller_client.click("middle")
return ToolResult()
- elif action == "double_click":
+ if action == "double_click":
self.controller_client.click("left", 2)
return ToolResult()
raise ToolError(f"Invalid action: {action}")
- def screenshot(self):
+ def screenshot(self) -> ToolResult:
"""Take a screenshot of the current screen, scale it and return the base64 encoded image."""
screenshot = self.controller_client.screenshot()
self.real_screen_width = screenshot.width
diff --git a/src/askui/tools/askui/askui_controller.py b/src/askui/tools/askui/askui_controller.py
index 56845f09..338fb5b4 100644
--- a/src/askui/tools/askui/askui_controller.py
+++ b/src/askui/tools/askui/askui_controller.py
@@ -1,40 +1,45 @@
-import pathlib
-from typing import Literal
-from typing_extensions import Self, override
-import grpc
import os
-
-import time
-from PIL import Image
-
+import pathlib
import subprocess
-import uuid
import sys
+import time
+import types
+import uuid
+from typing import Literal, Type
-from askui.tools.agent_os import ModifierKey, PcKey, AgentOs
+import grpc
+from PIL import Image
+from pydantic import BaseModel, Field, model_validator
+from pydantic_settings import BaseSettings, SettingsConfigDict
+from typing_extensions import Self, override
-from ..utils import process_exists, wait_for_port
+import askui.tools.askui.askui_ui_controller_grpc.Controller_V1_pb2 as controller_v1_pbs
+import askui.tools.askui.askui_ui_controller_grpc.Controller_V1_pb2_grpc as controller_v1
from askui.container import telemetry
from askui.logger import logger
from askui.reporting import Reporter
+from askui.tools.agent_os import AgentOs, ModifierKey, PcKey
from askui.utils.image_utils import draw_point_on_image
-import askui.tools.askui.askui_ui_controller_grpc.Controller_V1_pb2_grpc as controller_v1
-import askui.tools.askui.askui_ui_controller_grpc.Controller_V1_pb2 as controller_v1_pbs
-
-from pydantic import BaseModel, Field, model_validator
-from pydantic_settings import BaseSettings, SettingsConfigDict
+from ..utils import process_exists, wait_for_port
class RemoteDeviceController(BaseModel):
- askui_remote_device_controller: pathlib.Path = Field(alias="AskUIRemoteDeviceController")
+ askui_remote_device_controller: pathlib.Path = Field(
+ alias="AskUIRemoteDeviceController"
+ )
+
class Executables(BaseModel):
- executables: RemoteDeviceController = Field(alias="Executables")
+ executables: RemoteDeviceController = Field(alias="Executables")
+
class InstalledPackages(BaseModel):
- remote_device_controller_uuid: Executables = Field(alias="{aed1b543-e856-43ad-b1bc-19365d35c33e}")
-
+ remote_device_controller_uuid: Executables = Field(
+ alias="{aed1b543-e856-43ad-b1bc-19365d35c33e}"
+ )
+
+
class AskUiComponentRegistry(BaseModel):
definition_version: int = Field(alias="DefinitionVersion")
installed_packages: InstalledPackages = Field(alias="InstalledPackages")
@@ -44,14 +49,18 @@ class AskUiControllerSettings(BaseSettings):
model_config = SettingsConfigDict(
env_prefix="ASKUI_",
)
-
+
component_registry_file: pathlib.Path | None = None
installation_directory: pathlib.Path | None = None
@model_validator(mode="after")
- def validate_either_component_registry_or_installation_directory_is_set(self) -> "AskUiControllerSettings":
+ def validate_either_component_registry_or_installation_directory_is_set(
+ self,
+ ) -> "AskUiControllerSettings":
if self.component_registry_file is None and self.installation_directory is None:
- raise ValueError("Either ASKUI_COMPONENT_REGISTRY_FILE or ASKUI_INSTALLATION_DIRECTORY environment variable must be set")
+ raise ValueError(
+ "Either ASKUI_COMPONENT_REGISTRY_FILE or ASKUI_INSTALLATION_DIRECTORY environment variable must be set"
+ )
return self
@@ -60,41 +69,90 @@ class AskUiControllerServer:
Concrete implementation of `ControllerServer` for managing the AskUI Remote Device Controller process.
Handles process discovery, startup, and shutdown for the native controller binary.
"""
+
def __init__(self) -> None:
- self._process = None
- self._settings = AskUiControllerSettings() # type: ignore
+ self._process: subprocess.Popen[bytes] | None = None
+ self._settings = AskUiControllerSettings()
def _find_remote_device_controller(self) -> pathlib.Path:
- if self._settings.installation_directory is not None and self._settings.component_registry_file is None:
- logger.warning("Outdated AskUI Suite detected. Please update to the latest version.")
- askui_remote_device_controller_path = self._find_remote_device_controller_by_legacy_path()
+ if (
+ self._settings.installation_directory is not None
+ and self._settings.component_registry_file is None
+ ):
+ logger.warning(
+ "Outdated AskUI Suite detected. Please update to the latest version."
+ )
+ askui_remote_device_controller_path = (
+ self._find_remote_device_controller_by_legacy_path()
+ )
if not os.path.isfile(askui_remote_device_controller_path):
- raise FileNotFoundError(f"AskUIRemoteDeviceController executable does not exits under '{askui_remote_device_controller_path}'")
+ raise FileNotFoundError(
+ f"AskUIRemoteDeviceController executable does not exits under '{askui_remote_device_controller_path}'"
+ )
return askui_remote_device_controller_path
return self._find_remote_device_controller_by_component_registry()
-
+
def _find_remote_device_controller_by_component_registry(self) -> pathlib.Path:
- assert self._settings.component_registry_file is not None, "Component registry file is not set"
- component_registry = AskUiComponentRegistry.model_validate_json(self._settings.component_registry_file.read_text())
+ assert self._settings.component_registry_file is not None, (
+ "Component registry file is not set"
+ )
+ component_registry = AskUiComponentRegistry.model_validate_json(
+ self._settings.component_registry_file.read_text()
+ )
askui_remote_device_controller_path = component_registry.installed_packages.remote_device_controller_uuid.executables.askui_remote_device_controller
if not os.path.isfile(askui_remote_device_controller_path):
- raise FileNotFoundError(f"AskUIRemoteDeviceController executable does not exits under '{askui_remote_device_controller_path}'")
+ raise FileNotFoundError(
+ f"AskUIRemoteDeviceController executable does not exits under '{askui_remote_device_controller_path}'"
+ )
return askui_remote_device_controller_path
-
+
def _find_remote_device_controller_by_legacy_path(self) -> pathlib.Path:
- assert self._settings.installation_directory is not None, "Installation directory is not set"
+ assert self._settings.installation_directory is not None, (
+ "Installation directory is not set"
+ )
match sys.platform:
- case 'win32':
- return pathlib.Path(os.path.join(self._settings.installation_directory, "Binaries", "resources", "assets", "binaries", "AskuiRemoteDeviceController.exe"))
- case 'darwin':
- return pathlib.Path(os.path.join(self._settings.installation_directory, "Binaries", "askui-ui-controller.app", "Contents", "Resources", "assets", "binaries", "AskuiRemoteDeviceController"))
- case 'linux':
- return pathlib.Path(os.path.join(self._settings.installation_directory, "Binaries", "resources", "assets", "binaries", "AskuiRemoteDeviceController"))
+ case "win32":
+ return pathlib.Path(
+ os.path.join(
+ self._settings.installation_directory,
+ "Binaries",
+ "resources",
+ "assets",
+ "binaries",
+ "AskuiRemoteDeviceController.exe",
+ )
+ )
+ case "darwin":
+ return pathlib.Path(
+ os.path.join(
+ self._settings.installation_directory,
+ "Binaries",
+ "askui-ui-controller.app",
+ "Contents",
+ "Resources",
+ "assets",
+ "binaries",
+ "AskuiRemoteDeviceController",
+ )
+ )
+ case "linux":
+ return pathlib.Path(
+ os.path.join(
+ self._settings.installation_directory,
+ "Binaries",
+ "resources",
+ "assets",
+ "binaries",
+ "AskuiRemoteDeviceController",
+ )
+ )
case _:
- raise NotImplementedError(f"Platform {sys.platform} not supported by AskUI Remote Device Controller")
-
- def __start_process(self, path):
- self.process = subprocess.Popen(path)
+ raise NotImplementedError(
+ f"Platform {sys.platform} not supported by AskUI Remote Device Controller"
+ )
+
+ def __start_process(self, path: pathlib.Path) -> None:
+ self._process = subprocess.Popen(path)
wait_for_port(23000)
def start(self, clean_up: bool = False) -> None:
@@ -104,14 +162,22 @@ def start(self, clean_up: bool = False) -> None:
Args:
clean_up (bool, optional): Whether to clean up existing processes (only on Windows) before starting. Defaults to `False`.
"""
- if sys.platform == 'win32' and clean_up and process_exists("AskuiRemoteDeviceController.exe"):
+ if (
+ sys.platform == "win32"
+ and clean_up
+ and process_exists("AskuiRemoteDeviceController.exe")
+ ):
self.clean_up()
remote_device_controller_path = self._find_remote_device_controller()
- logger.debug("Starting AskUI Remote Device Controller: %s", remote_device_controller_path)
+ logger.debug(
+ "Starting AskUI Remote Device Controller: %s", remote_device_controller_path
+ )
self.__start_process(remote_device_controller_path)
- time.sleep(0.5) # TODO Find better way to do this, e.g., waiting for something to be logged or port to be opened
+ time.sleep(
+ 0.5
+ ) # TODO Find better way to do this, e.g., waiting for something to be logged or port to be opened
- def clean_up(self):
+ def clean_up(self) -> None:
subprocess.run("taskkill.exe /IM AskUI*")
time.sleep(0.1)
@@ -122,21 +188,20 @@ def stop(self, force: bool = False) -> None:
Args:
force (bool, optional): Whether to forcefully terminate the process. Defaults to `False`.
"""
- if not hasattr(self, "process") or self.process is None:
+ if not hasattr(self, "process") or self._process is None:
return # Nothing to stop
try:
if force:
- self.process.kill()
+ self._process.kill()
if sys.platform == "win32":
self.clean_up()
else:
- self.process.terminate()
+ self._process.terminate()
except Exception as e:
logger.error("Failed to stop AskUI Remote Device Controller: %s", e)
- pass
finally:
- self.process = None
+ self._process = None
class AskUiControllerClient(AgentOs):
@@ -148,15 +213,21 @@ class AskUiControllerClient(AgentOs):
display (int, optional): Display number to use. Defaults to `1`.
controller_server (AskUiControllerServer | None, optional): Custom controller server. Defaults to `ControllerServer`.
"""
+
@telemetry.record_call(exclude={"reporter", "controller_server"})
- def __init__(self, reporter: Reporter, display: int = 1, controller_server: AskUiControllerServer | None = None) -> None:
- self.stub = None
- self.channel = None
- self.session_info = None
- self.pre_action_wait = 0
- self.post_action_wait = 0.05
- self.max_retries = 10
- self.display = display
+ def __init__(
+ self,
+ reporter: Reporter,
+ display: int = 1,
+ controller_server: AskUiControllerServer | None = None,
+ ) -> None:
+ self._stub: controller_v1.ControllerAPIStub | None = None
+ self._channel: grpc.Channel | None = None
+ self._session_info: controller_v1_pbs.SessionInfo | None = None
+ self._pre_action_wait = 0
+ self._post_action_wait = 0.05
+ self._max_retries = 10
+ self._display = display
self._reporter = reporter
self._controller_server = controller_server or AskUiControllerServer()
@@ -165,66 +236,100 @@ def __init__(self, reporter: Reporter, display: int = 1, controller_server: AskU
def connect(self) -> None:
"""
Establishes a connection to the AskUI Remote Device Controller.
-
+
This method starts the controller server, establishes a gRPC channel,
creates a session, and sets up the initial display.
"""
self._controller_server.start()
- self.channel = grpc.insecure_channel('localhost:23000', options=[
- ('grpc.max_send_message_length', 2**30 ),
- ('grpc.max_receive_message_length', 2**30 ),
- ('grpc.default_deadline', 300000)])
- self.stub = controller_v1.ControllerAPIStub(self.channel)
+ self._channel = grpc.insecure_channel(
+ "localhost:23000",
+ options=[
+ ("grpc.max_send_message_length", 2**30),
+ ("grpc.max_receive_message_length", 2**30),
+ ("grpc.default_deadline", 300000),
+ ],
+ )
+ self._stub = controller_v1.ControllerAPIStub(self._channel)
self._start_session()
self._start_execution()
- self.set_display(self.display)
-
- def _run_recorder_action(self, acion_class_id: controller_v1_pbs.ActionClassID, action_parameters: controller_v1_pbs.ActionParameters):
- time.sleep(self.pre_action_wait)
- assert isinstance(self.stub, controller_v1.ControllerAPIStub), "Stub is not initialized"
- response: controller_v1_pbs.Response_RunRecordedAction = self.stub.RunRecordedAction(controller_v1_pbs.Request_RunRecordedAction(sessionInfo=self.session_info, actionClassID=acion_class_id, actionParameters=action_parameters))
-
- time.sleep((response.requiredMilliseconds / 1000))
- for num_retries in range(self.max_retries):
- assert isinstance(self.stub, controller_v1.ControllerAPIStub), "Stub is not initialized"
- poll_response: controller_v1_pbs.Response_Poll = self.stub.Poll(controller_v1_pbs.Request_Poll(sessionInfo=self.session_info, pollEventID=controller_v1_pbs.PollEventID.PollEventID_ActionFinished))
- if poll_response.pollEventParameters.actionFinished.actionID == response.actionID:
+ self.set_display(self._display)
+
+ def _run_recorder_action(
+ self,
+ acion_class_id: controller_v1_pbs.ActionClassID,
+ action_parameters: controller_v1_pbs.ActionParameters,
+ ) -> controller_v1_pbs.Response_RunRecordedAction:
+ time.sleep(self._pre_action_wait)
+ assert isinstance(self._stub, controller_v1.ControllerAPIStub), (
+ "Stub is not initialized"
+ )
+ response: controller_v1_pbs.Response_RunRecordedAction = (
+ self._stub.RunRecordedAction(
+ controller_v1_pbs.Request_RunRecordedAction(
+ sessionInfo=self._session_info,
+ actionClassID=acion_class_id,
+ actionParameters=action_parameters,
+ )
+ )
+ )
+
+ time.sleep((response.requiredMilliseconds / 1000))
+ for num_retries in range(self._max_retries):
+ assert isinstance(self._stub, controller_v1.ControllerAPIStub), (
+ "Stub is not initialized"
+ )
+ poll_response: controller_v1_pbs.Response_Poll = self._stub.Poll(
+ controller_v1_pbs.Request_Poll(
+ sessionInfo=self._session_info,
+ pollEventID=controller_v1_pbs.PollEventID.PollEventID_ActionFinished,
+ )
+ )
+ if (
+ poll_response.pollEventParameters.actionFinished.actionID
+ == response.actionID
+ ):
break
- time.sleep(self.post_action_wait)
- if num_retries == self.max_retries - 1:
+ time.sleep(self._post_action_wait)
+ if num_retries == self._max_retries - 1:
raise Exception("Action not yet done")
return response
-
+
@telemetry.record_call()
@override
def disconnect(self) -> None:
"""
Terminates the connection to the AskUI Remote Device Controller.
-
+
This method stops the execution, ends the session, closes the gRPC channel,
and stops the controller server.
"""
self._stop_execution()
self._stop_session()
- self.channel.close()
+ if self._channel is not None:
+ self._channel.close()
self._controller_server.stop()
@telemetry.record_call()
def __enter__(self) -> Self:
"""
Context manager entry point that establishes the connection.
-
+
Returns:
Self: The instance of AskUiControllerClient.
"""
self.connect()
return self
-
+
@telemetry.record_call(exclude={"exc_value", "traceback"})
- def __exit__(self, exc_type, exc_value, traceback) -> None:
+ def __exit__(
+ self,
+ exc_type: Type[BaseException] | None,
+ exc_value: BaseException | None,
+ traceback: types.TracebackType | None,
+ ) -> None:
"""
Context manager exit point that disconnects the client.
-
+
Args:
exc_type: The exception type if an exception was raised.
exc_value: The exception value if an exception was raised.
@@ -232,18 +337,40 @@ def __exit__(self, exc_type, exc_value, traceback) -> None:
"""
self.disconnect()
- def _start_session(self):
- response = self.stub.StartSession(controller_v1_pbs.Request_StartSession(sessionGUID="{" + str(uuid.uuid4()) + "}", immediateExecution=True))
- self.session_info = response.sessionInfo
-
- def _stop_session(self):
- self.stub.EndSession(controller_v1_pbs.Request_EndSession(sessionInfo = self.session_info))
-
- def _start_execution(self):
- self.stub.StartExecution(controller_v1_pbs.Request_StartExecution(sessionInfo=self.session_info))
-
- def _stop_execution(self):
- self.stub.StopExecution(controller_v1_pbs.Request_StopExecution(sessionInfo=self.session_info))
+ def _start_session(self) -> None:
+ assert isinstance(self._stub, controller_v1.ControllerAPIStub), (
+ "Stub is not initialized"
+ )
+ response = self._stub.StartSession(
+ controller_v1_pbs.Request_StartSession(
+ sessionGUID="{" + str(uuid.uuid4()) + "}", immediateExecution=True
+ )
+ )
+ self._session_info = response.sessionInfo
+
+ def _stop_session(self) -> None:
+ assert isinstance(self._stub, controller_v1.ControllerAPIStub), (
+ "Stub is not initialized"
+ )
+ self._stub.EndSession(
+ controller_v1_pbs.Request_EndSession(sessionInfo=self._session_info)
+ )
+
+ def _start_execution(self) -> None:
+ assert isinstance(self._stub, controller_v1.ControllerAPIStub), (
+ "Stub is not initialized"
+ )
+ self._stub.StartExecution(
+ controller_v1_pbs.Request_StartExecution(sessionInfo=self._session_info)
+ )
+
+ def _stop_execution(self) -> None:
+ assert isinstance(self._stub, controller_v1.ControllerAPIStub), (
+ "Stub is not initialized"
+ )
+ self._stub.StopExecution(
+ controller_v1_pbs.Request_StopExecution(sessionInfo=self._session_info)
+ )
@telemetry.record_call()
@override
@@ -257,9 +384,22 @@ def screenshot(self, report: bool = True) -> Image.Image:
Returns:
Image.Image: A PIL Image object containing the screenshot.
"""
- assert isinstance(self.stub, controller_v1.ControllerAPIStub), "Stub is not initialized"
- screenResponse = self.stub.CaptureScreen(controller_v1_pbs.Request_CaptureScreen(sessionInfo=self.session_info, captureParameters=controller_v1_pbs.CaptureParameters(displayID=self.display)))
- r, g, b, _ = Image.frombytes('RGBA', (screenResponse.bitmap.width, screenResponse.bitmap.height), screenResponse.bitmap.data).split()
+ assert isinstance(self._stub, controller_v1.ControllerAPIStub), (
+ "Stub is not initialized"
+ )
+ screenResponse = self._stub.CaptureScreen(
+ controller_v1_pbs.Request_CaptureScreen(
+ sessionInfo=self._session_info,
+ captureParameters=controller_v1_pbs.CaptureParameters(
+ displayID=self._display
+ ),
+ )
+ )
+ r, g, b, _ = Image.frombytes(
+ "RGBA",
+ (screenResponse.bitmap.width, screenResponse.bitmap.height),
+ screenResponse.bitmap.data,
+ ).split()
image = Image.merge("RGB", (b, g, r))
self._reporter.add_message("AgentOS", "screenshot()", image)
return image
@@ -274,8 +414,19 @@ def mouse(self, x: int, y: int) -> None:
x (int): The horizontal coordinate (in pixels) to move to.
y (int): The vertical coordinate (in pixels) to move to.
"""
- self._reporter.add_message("AgentOS", f"mouse({x}, {y})", draw_point_on_image(self.screenshot(report=False), x, y, size=5))
- self._run_recorder_action(acion_class_id=controller_v1_pbs.ActionClassID_MouseMove, action_parameters=controller_v1_pbs.ActionParameters(mouseMove=controller_v1_pbs.ActionParameters_MouseMove(position=controller_v1_pbs.Coordinate2(x=x, y=y))))
+ self._reporter.add_message(
+ "AgentOS",
+ f"mouse({x}, {y})",
+ draw_point_on_image(self.screenshot(report=False), x, y, size=5),
+ )
+ self._run_recorder_action(
+ acion_class_id=controller_v1_pbs.ActionClassID_MouseMove,
+ action_parameters=controller_v1_pbs.ActionParameters(
+ mouseMove=controller_v1_pbs.ActionParameters_MouseMove(
+ position=controller_v1_pbs.Coordinate2(x=x, y=y)
+ )
+ ),
+ )
@telemetry.record_call(exclude={"text"})
@override
@@ -287,12 +438,23 @@ def type(self, text: str, typing_speed: int = 50) -> None:
text (str): The text to be typed.
typing_speed (int, optional): The speed of typing in characters per second. Defaults to `50`.
"""
- self._reporter.add_message("AgentOS", f"type(\"{text}\", {typing_speed})")
- self._run_recorder_action(acion_class_id=controller_v1_pbs.ActionClassID_KeyboardType_UnicodeText, action_parameters=controller_v1_pbs.ActionParameters(keyboardTypeUnicodeText=controller_v1_pbs.ActionParameters_KeyboardType_UnicodeText(text=text.encode('utf-16-le'), typingSpeed=typing_speed, typingSpeedValue=controller_v1_pbs.TypingSpeedValue.TypingSpeedValue_CharactersPerSecond)))
-
+ self._reporter.add_message("AgentOS", f'type("{text}", {typing_speed})')
+ self._run_recorder_action(
+ acion_class_id=controller_v1_pbs.ActionClassID_KeyboardType_UnicodeText,
+ action_parameters=controller_v1_pbs.ActionParameters(
+ keyboardTypeUnicodeText=controller_v1_pbs.ActionParameters_KeyboardType_UnicodeText(
+ text=text.encode("utf-16-le"),
+ typingSpeed=typing_speed,
+ typingSpeedValue=controller_v1_pbs.TypingSpeedValue.TypingSpeedValue_CharactersPerSecond,
+ )
+ ),
+ )
+
@telemetry.record_call()
@override
- def click(self, button: Literal['left', 'middle', 'right'] = 'left', count: int = 1) -> None:
+ def click(
+ self, button: Literal["left", "middle", "right"] = "left", count: int = 1
+ ) -> None:
"""
Simulates clicking a mouse button.
@@ -300,56 +462,77 @@ def click(self, button: Literal['left', 'middle', 'right'] = 'left', count: int
button (Literal["left", "middle", "right"], optional): The mouse button to click. Defaults to `"left"`.
count (int, optional): Number of times to click. Defaults to `1`.
"""
- self._reporter.add_message("AgentOS", f"click(\"{button}\", {count})")
+ self._reporter.add_message("AgentOS", f'click("{button}", {count})')
mouse_button = None
match button:
- case 'left':
+ case "left":
mouse_button = controller_v1_pbs.MouseButton_Left
- case 'middle':
+ case "middle":
mouse_button = controller_v1_pbs.MouseButton_Middle
- case 'right':
- mouse_button = controller_v1_pbs.MouseButton_Right
- self._run_recorder_action(acion_class_id=controller_v1_pbs.ActionClassID_MouseButton_PressAndRelease, action_parameters=controller_v1_pbs.ActionParameters(mouseButtonPressAndRelease=controller_v1_pbs.ActionParameters_MouseButton_PressAndRelease(mouseButton=mouse_button, count=count)))
-
+ case "right":
+ mouse_button = controller_v1_pbs.MouseButton_Right
+ self._run_recorder_action(
+ acion_class_id=controller_v1_pbs.ActionClassID_MouseButton_PressAndRelease,
+ action_parameters=controller_v1_pbs.ActionParameters(
+ mouseButtonPressAndRelease=controller_v1_pbs.ActionParameters_MouseButton_PressAndRelease(
+ mouseButton=mouse_button, count=count
+ )
+ ),
+ )
+
@telemetry.record_call()
@override
- def mouse_down(self, button: Literal['left', 'middle', 'right'] = 'left') -> None:
+ def mouse_down(self, button: Literal["left", "middle", "right"] = "left") -> None:
"""
Simulates pressing and holding a mouse button.
Args:
button (Literal["left", "middle", "right"], optional): The mouse button to press. Defaults to `"left"`.
"""
- self._reporter.add_message("AgentOS", f"mouse_down(\"{button}\")")
+ self._reporter.add_message("AgentOS", f'mouse_down("{button}")')
mouse_button = None
match button:
- case 'left':
+ case "left":
mouse_button = controller_v1_pbs.MouseButton_Left
- case 'middle':
+ case "middle":
mouse_button = controller_v1_pbs.MouseButton_Middle
- case 'right':
- mouse_button = controller_v1_pbs.MouseButton_Right
- self._run_recorder_action(acion_class_id=controller_v1_pbs.ActionClassID_MouseButton_Press, action_parameters=controller_v1_pbs.ActionParameters(mouseButtonPress=controller_v1_pbs.ActionParameters_MouseButton_Press(mouseButton=mouse_button)))
+ case "right":
+ mouse_button = controller_v1_pbs.MouseButton_Right
+ self._run_recorder_action(
+ acion_class_id=controller_v1_pbs.ActionClassID_MouseButton_Press,
+ action_parameters=controller_v1_pbs.ActionParameters(
+ mouseButtonPress=controller_v1_pbs.ActionParameters_MouseButton_Press(
+ mouseButton=mouse_button
+ )
+ ),
+ )
@telemetry.record_call()
@override
- def mouse_up(self, button: Literal['left', 'middle', 'right'] = 'left') -> None:
+ def mouse_up(self, button: Literal["left", "middle", "right"] = "left") -> None:
"""
Simulates releasing a mouse button.
Args:
button (Literal["left", "middle", "right"], optional): The mouse button to release. Defaults to `"left"`.
"""
- self._reporter.add_message("AgentOS", f"mouse_up(\"{button}\")")
+ self._reporter.add_message("AgentOS", f'mouse_up("{button}")')
mouse_button = None
match button:
- case 'left':
+ case "left":
mouse_button = controller_v1_pbs.MouseButton_Left
- case 'middle':
+ case "middle":
mouse_button = controller_v1_pbs.MouseButton_Middle
- case 'right':
+ case "right":
mouse_button = controller_v1_pbs.MouseButton_Right
- self._run_recorder_action(acion_class_id=controller_v1_pbs.ActionClassID_MouseButton_Release, action_parameters=controller_v1_pbs.ActionParameters(mouseButtonRelease=controller_v1_pbs.ActionParameters_MouseButton_Release(mouseButton=mouse_button)))
+ self._run_recorder_action(
+ acion_class_id=controller_v1_pbs.ActionClassID_MouseButton_Release,
+ action_parameters=controller_v1_pbs.ActionParameters(
+ mouseButtonRelease=controller_v1_pbs.ActionParameters_MouseButton_Release(
+ mouseButton=mouse_button
+ )
+ ),
+ )
@telemetry.record_call()
@override
@@ -363,23 +546,35 @@ def mouse_scroll(self, x: int, y: int) -> None:
"""
self._reporter.add_message("AgentOS", f"mouse_scroll({x}, {y})")
if x != 0:
- self._run_recorder_action(acion_class_id=controller_v1_pbs.ActionClassID_MouseWheelScroll, action_parameters=controller_v1_pbs.ActionParameters(mouseWheelScroll=controller_v1_pbs.ActionParameters_MouseWheelScroll(
- direction = controller_v1_pbs.MouseWheelScrollDirection.MouseWheelScrollDirection_Horizontal,
- deltaType = controller_v1_pbs.MouseWheelDeltaType.MouseWheelDelta_Raw,
- delta = x,
- milliseconds = 50
- )))
+ self._run_recorder_action(
+ acion_class_id=controller_v1_pbs.ActionClassID_MouseWheelScroll,
+ action_parameters=controller_v1_pbs.ActionParameters(
+ mouseWheelScroll=controller_v1_pbs.ActionParameters_MouseWheelScroll(
+ direction=controller_v1_pbs.MouseWheelScrollDirection.MouseWheelScrollDirection_Horizontal,
+ deltaType=controller_v1_pbs.MouseWheelDeltaType.MouseWheelDelta_Raw,
+ delta=x,
+ milliseconds=50,
+ )
+ ),
+ )
if y != 0:
- self._run_recorder_action(acion_class_id=controller_v1_pbs.ActionClassID_MouseWheelScroll, action_parameters=controller_v1_pbs.ActionParameters(mouseWheelScroll=controller_v1_pbs.ActionParameters_MouseWheelScroll(
- direction = controller_v1_pbs.MouseWheelScrollDirection.MouseWheelScrollDirection_Vertical,
- deltaType = controller_v1_pbs.MouseWheelDeltaType.MouseWheelDelta_Raw,
- delta = y,
- milliseconds = 50
- )))
+ self._run_recorder_action(
+ acion_class_id=controller_v1_pbs.ActionClassID_MouseWheelScroll,
+ action_parameters=controller_v1_pbs.ActionParameters(
+ mouseWheelScroll=controller_v1_pbs.ActionParameters_MouseWheelScroll(
+ direction=controller_v1_pbs.MouseWheelScrollDirection.MouseWheelScrollDirection_Vertical,
+ deltaType=controller_v1_pbs.MouseWheelDeltaType.MouseWheelDelta_Raw,
+ delta=y,
+ milliseconds=50,
+ )
+ ),
+ )
@telemetry.record_call()
@override
- def keyboard_pressed(self, key: PcKey | ModifierKey, modifier_keys: list[ModifierKey] | None = None) -> None:
+ def keyboard_pressed(
+ self, key: PcKey | ModifierKey, modifier_keys: list[ModifierKey] | None = None
+ ) -> None:
"""
Simulates pressing and holding a keyboard key.
@@ -387,14 +582,25 @@ def keyboard_pressed(self, key: PcKey | ModifierKey, modifier_keys: list[Modifi
key (PcKey | ModifierKey): The key to press.
modifier_keys (list[ModifierKey] | None, optional): List of modifier keys to press along with the main key. Defaults to `None`.
"""
- self._reporter.add_message("AgentOS", f"keyboard_pressed(\"{key}\", {modifier_keys})")
+ self._reporter.add_message(
+ "AgentOS", f'keyboard_pressed("{key}", {modifier_keys})'
+ )
if modifier_keys is None:
- modifier_keys = []
- self._run_recorder_action(acion_class_id=controller_v1_pbs.ActionClassID_KeyboardKey_Press, action_parameters=controller_v1_pbs.ActionParameters(keyboardKeyPress=controller_v1_pbs.ActionParameters_KeyboardKey_Press(keyName=key, modifierKeyNames=modifier_keys)))
+ modifier_keys = []
+ self._run_recorder_action(
+ acion_class_id=controller_v1_pbs.ActionClassID_KeyboardKey_Press,
+ action_parameters=controller_v1_pbs.ActionParameters(
+ keyboardKeyPress=controller_v1_pbs.ActionParameters_KeyboardKey_Press(
+ keyName=key, modifierKeyNames=modifier_keys
+ )
+ ),
+ )
@telemetry.record_call()
@override
- def keyboard_release(self, key: PcKey | ModifierKey, modifier_keys: list[ModifierKey] | None = None) -> None:
+ def keyboard_release(
+ self, key: PcKey | ModifierKey, modifier_keys: list[ModifierKey] | None = None
+ ) -> None:
"""
Simulates releasing a keyboard key.
@@ -402,14 +608,25 @@ def keyboard_release(self, key: PcKey | ModifierKey, modifier_keys: list[Modifi
key (PcKey | ModifierKey): The key to release.
modifier_keys (list[ModifierKey] | None, optional): List of modifier keys to release along with the main key. Defaults to `None`.
"""
- self._reporter.add_message("AgentOS", f"keyboard_release(\"{key}\", {modifier_keys})")
+ self._reporter.add_message(
+ "AgentOS", f'keyboard_release("{key}", {modifier_keys})'
+ )
if modifier_keys is None:
- modifier_keys = []
- self._run_recorder_action(acion_class_id=controller_v1_pbs.ActionClassID_KeyboardKey_Release, action_parameters=controller_v1_pbs.ActionParameters(keyboardKeyRelease=controller_v1_pbs.ActionParameters_KeyboardKey_Release(keyName=key, modifierKeyNames=modifier_keys)))
+ modifier_keys = []
+ self._run_recorder_action(
+ acion_class_id=controller_v1_pbs.ActionClassID_KeyboardKey_Release,
+ action_parameters=controller_v1_pbs.ActionParameters(
+ keyboardKeyRelease=controller_v1_pbs.ActionParameters_KeyboardKey_Release(
+ keyName=key, modifierKeyNames=modifier_keys
+ )
+ ),
+ )
@telemetry.record_call()
@override
- def keyboard_tap(self, key: PcKey | ModifierKey, modifier_keys: list[ModifierKey] | None = None) -> None:
+ def keyboard_tap(
+ self, key: PcKey | ModifierKey, modifier_keys: list[ModifierKey] | None = None
+ ) -> None:
"""
Simulates pressing and immediately releasing a keyboard key.
@@ -417,10 +634,17 @@ def keyboard_tap(self, key: PcKey | ModifierKey, modifier_keys: list[ModifierKe
key (PcKey | ModifierKey): The key to tap.
modifier_keys (list[ModifierKey] | None, optional): List of modifier keys to press along with the main key. Defaults to `None`.
"""
- self._reporter.add_message("AgentOS", f"keyboard_tap(\"{key}\", {modifier_keys})")
+ self._reporter.add_message("AgentOS", f'keyboard_tap("{key}", {modifier_keys})')
if modifier_keys is None:
- modifier_keys = []
- self._run_recorder_action(acion_class_id=controller_v1_pbs.ActionClassID_KeyboardKey_PressAndRelease, action_parameters=controller_v1_pbs.ActionParameters(keyboardKeyPressAndRelease=controller_v1_pbs.ActionParameters_KeyboardKey_PressAndRelease(keyName=key, modifierKeyNames=modifier_keys)))
+ modifier_keys = []
+ self._run_recorder_action(
+ acion_class_id=controller_v1_pbs.ActionClassID_KeyboardKey_PressAndRelease,
+ action_parameters=controller_v1_pbs.ActionParameters(
+ keyboardKeyPressAndRelease=controller_v1_pbs.ActionParameters_KeyboardKey_PressAndRelease(
+ keyName=key, modifierKeyNames=modifier_keys
+ )
+ ),
+ )
@telemetry.record_call()
@override
@@ -431,7 +655,11 @@ def set_display(self, displayNumber: int = 1) -> None:
Args:
displayNumber (int, optional): The display number to set as active. Defaults to `1`.
"""
- assert isinstance(self.stub, controller_v1.ControllerAPIStub), "Stub is not initialized"
+ assert isinstance(self._stub, controller_v1.ControllerAPIStub), (
+ "Stub is not initialized"
+ )
self._reporter.add_message("AgentOS", f"set_display({displayNumber})")
- self.stub.SetActiveDisplay(controller_v1_pbs.Request_SetActiveDisplay(displayID=displayNumber))
- self.display = displayNumber
+ self._stub.SetActiveDisplay(
+ controller_v1_pbs.Request_SetActiveDisplay(displayID=displayNumber)
+ )
+ self._display = displayNumber
diff --git a/src/askui/tools/askui/askui_hub.py b/src/askui/tools/askui/askui_hub.py
index 63c3c8ac..c1469a65 100644
--- a/src/askui/tools/askui/askui_hub.py
+++ b/src/askui/tools/askui/askui_hub.py
@@ -4,31 +4,36 @@
from urllib.parse import urlencode, urljoin
from uuid import UUID
-from askui.tools.askui.askui_workspaces.models.extract_data_command import ExtractDataCommand
-from askui.tools.askui.askui_workspaces.models.extract_data_response import ExtractDataResponse
+import requests
+from pydantic import BaseModel, Field, HttpUrl
+from pydantic_settings import BaseSettings, SettingsConfigDict
+from tenacity import retry, stop_after_attempt, wait_exponential
+
+from askui.tools.askui.askui_workspaces.models.extract_data_command import (
+ ExtractDataCommand,
+)
+from askui.tools.askui.askui_workspaces.models.extract_data_response import (
+ ExtractDataResponse,
+)
from .askui_workspaces import (
- AgentsApi,
- AgentExecutionsApi,
- SchedulesApi,
- ToolsApi,
- AgentExecutionUpdateCommand,
Agent,
AgentExecution,
+ AgentExecutionsApi,
AgentExecutionStateCanceled,
AgentExecutionStateConfirmed,
AgentExecutionStateDeliveredToDestinationInput,
AgentExecutionStatePendingReview,
+ AgentExecutionUpdateCommand,
+ AgentsApi,
ApiClient,
Configuration,
CreateScheduleRequestDto,
CreateScheduleResponseDto,
+ SchedulesApi,
State1,
+ ToolsApi,
)
-from pydantic import BaseModel, Field, HttpUrl
-from pydantic_settings import BaseSettings, SettingsConfigDict
-import requests
-from tenacity import retry, stop_after_attempt, wait_exponential
class AskUIHubSettings(BaseSettings):
@@ -37,8 +42,10 @@ class AskUIHubSettings(BaseSettings):
)
workspace_id: str | None = Field(default=None)
token: str | None = Field(default=None)
- workspaces_endpoint: HttpUrl | None = Field(default=HttpUrl("https://workspaces.askui.com"))
-
+ workspaces_endpoint: HttpUrl | None = Field(
+ default=HttpUrl("https://workspaces.askui.com")
+ )
+
@property
def workspaces_host(self) -> str:
if self.workspaces_endpoint is None:
@@ -48,22 +55,21 @@ def workspaces_host(self) -> str:
@property
def authenticated(self) -> bool:
return self.workspace_id is not None and self.token is not None
-
+
@property
def token_base64(self) -> str:
if self.token is None:
raise ValueError("Token is not set")
return base64.b64encode(self.token.encode()).decode()
-
+
@property
def files_base_url(self) -> str:
return urljoin(self.workspaces_host, "/api/v1/files")
-
+
@property
def authorization_header_value(self) -> str:
return f"Basic {self.token_base64}"
-
-
+
ScheduleRunCommand = CreateScheduleRequestDto
ScheduleRunResponse = CreateScheduleResponseDto
@@ -80,19 +86,19 @@ class FilesListResponseDto(BaseModel):
next_continuation_token: Optional[str] = Field(default=None)
-REQUEST_TIMEOUT_IN_S=60
-UPLOAD_REQUEST_TIMEOUT_IN_S=3600 # allows for uploading large files
-EXTRACT_DATA_REQUEST_TIMEOUT_IN_S=300.0
+REQUEST_TIMEOUT_IN_S = 60
+UPLOAD_REQUEST_TIMEOUT_IN_S = 3600 # allows for uploading large files
+EXTRACT_DATA_REQUEST_TIMEOUT_IN_S = 300.0
class AskUIHub:
- def __init__(self):
+ def __init__(self) -> None:
self._settings = AskUIHubSettings()
self.disabled = False
if not self._settings.authenticated:
self.disabled = True
return
-
+
api_client_config = Configuration(
host=self._settings.workspaces_host,
api_key={"Basic": self._settings.authorization_header_value},
@@ -111,7 +117,9 @@ def retrieve_agent(self, agent_id: UUID | str) -> Agent:
raise ValueError(f"Agent {agent_id} not found")
return response.data[0]
- def retrieve_agent_execution(self, agent_execution_id: UUID | str) -> AgentExecution:
+ def retrieve_agent_execution(
+ self, agent_execution_id: UUID | str
+ ) -> AgentExecution:
response = self._agent_executions_api.list_agent_executions_api_v1_agent_executions_get(
agent_execution_id=[str(agent_execution_id)]
)
@@ -129,30 +137,28 @@ def update_agent_execution(
AgentExecutionStateDeliveredToDestinationInput,
],
) -> AgentExecution:
- command = AgentExecutionUpdateCommand(state=State1(state.model_dump())) # type: ignore
+ command = AgentExecutionUpdateCommand(state=State1(state.model_dump()))
return self._agent_executions_api.update_agent_execution_api_v1_agent_executions_agent_execution_id_patch(
agent_execution_id=str(agent_execution_id),
agent_execution_update_command=command,
)
def schedule_run(self, command: ScheduleRunCommand) -> ScheduleRunResponse:
+ if self._settings.workspace_id is None:
+ raise ValueError("`ASKUI_WORKSPACE_ID` environment variable is not set")
return self._schedules_api.create_schedule_api_v1_workspaces_workspace_id_schedules_post(
workspace_id=self._settings.workspace_id,
create_schedule_request_dto=command,
)
-
+
def extract_data(self, command: ExtractDataCommand) -> ExtractDataResponse:
return self._tools_api.extract_data_api_v1_tools_extract_data_post(
extract_data_command=command,
_request_timeout=EXTRACT_DATA_REQUEST_TIMEOUT_IN_S,
)
- @retry(
- stop=stop_after_attempt(5), wait=wait_exponential(), reraise=True
- )
- def _upload_file(
- self, local_file_path: str, remote_file_path: str
- ) -> None:
+ @retry(stop=stop_after_attempt(5), wait=wait_exponential(), reraise=True)
+ def _upload_file(self, local_file_path: str, remote_file_path: str) -> None:
with open(local_file_path, "rb") as f:
url = urljoin(
base=self._settings.files_base_url,
@@ -161,7 +167,7 @@ def _upload_file(
with requests.put(
url,
files={"file": f},
- headers=self._settings.authorization_header_value,
+ headers={"Authorization": self._settings.authorization_header_value},
timeout=UPLOAD_REQUEST_TIMEOUT_IN_S,
stream=True,
) as response:
@@ -172,7 +178,10 @@ def _upload_dir(self, local_dir_path: str, remote_dir_path: str) -> None:
for root, _, files in os.walk(local_dir_path):
for file in files:
file_path = os.path.join(root, file)
- relative_file_path = os.path.relpath(file_path, start=local_dir_path, )
+ relative_file_path = os.path.relpath(
+ file_path,
+ start=local_dir_path,
+ )
remote_file_path = (
remote_dir_path
+ ("/" if remote_dir_path != "" else "")
@@ -185,17 +194,15 @@ def upload(self, local_path: str, remote_dir_path: str = "") -> None:
if os.path.isdir(local_path):
self._upload_dir(local_path, r_dir_path)
else:
- self._upload_file(local_path, f"{r_dir_path}/{os.path.basename(local_path)}")
+ self._upload_file(
+ local_path, f"{r_dir_path}/{os.path.basename(local_path)}"
+ )
- @retry(
- stop=stop_after_attempt(5), wait=wait_exponential(), reraise=True
- )
- def _download_file(
- self, url: str, local_file_path: str
- ) -> None:
+ @retry(stop=stop_after_attempt(5), wait=wait_exponential(), reraise=True)
+ def _download_file(self, url: str, local_file_path: str) -> None:
response = requests.get(
url,
- headers=self._settings.authorization_header_value,
+ headers={"Authorization": self._settings.authorization_header_value},
timeout=REQUEST_TIMEOUT_IN_S,
stream=True,
)
@@ -214,7 +221,11 @@ def _list_objects(
if continuation_token is not None:
params["continuation_token"] = continuation_token
list_url = f"{self._settings.files_base_url}?{urlencode(params)}"
- response = requests.get(list_url, headers=self._settings.authorization_header_value, timeout=REQUEST_TIMEOUT_IN_S)
+ response = requests.get(
+ list_url,
+ headers={"Authorization": self._settings.authorization_header_value},
+ timeout=REQUEST_TIMEOUT_IN_S,
+ )
if response.status_code != 200:
response.raise_for_status()
return FilesListResponseDto(**response.json())
@@ -224,10 +235,10 @@ def download(self, local_dir_path: str, remote_path: str = "") -> None:
prefix = remote_path.lstrip("/")
while True:
list_objects_response = self._list_objects(prefix, continuation_token)
- for content in list_objects_response.data:
- if prefix == content.path: # is a file
+ for content in list_objects_response.data:
+ if prefix == content.path: # is a file
relative_remote_path = content.name
- else: # is a prefix, e.g., folder
+ else: # is a prefix, e.g., folder
relative_remote_path = content.path[len(prefix) :].lstrip("/")
local_file_path = os.path.join(
local_dir_path, *relative_remote_path.split("/")
diff --git a/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2.py b/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2.py
index 712614f3..e0eb6a50 100644
--- a/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2.py
+++ b/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2.py
@@ -3,168 +3,170 @@
# source: Controller_V1.proto
# Protobuf Python Version: 5.26.1
"""Generated protocol buffer code."""
+
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
+
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13\x43ontroller_V1.proto\x12\x0f\x41skui.API.TDKv1\"\x06\n\x04Void\"\x0e\n\x0cRequest_Void\"\x0f\n\rResponse_Void\"&\n\x05Size2\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\r\"\x1e\n\x06\x44\x65lta2\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"#\n\x0b\x43oordinate2\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"E\n\tRectangle\x12\x0c\n\x04left\x18\x01 \x01(\x05\x12\x0b\n\x03top\x18\x02 \x01(\x05\x12\r\n\x05right\x18\x03 \x01(\x05\x12\x0e\n\x06\x62ottom\x18\x04 \x01(\x05\"u\n\x06\x42itmap\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\r\x12\x11\n\tlineWidth\x18\x03 \x01(\r\x12\x14\n\x0c\x62itsPerPixel\x18\x04 \x01(\r\x12\x15\n\rbytesPerPixel\x18\x05 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x06 \x01(\x0c\"(\n\x05\x43olor\x12\t\n\x01r\x18\x01 \x01(\r\x12\t\n\x01g\x18\x02 \x01(\r\x12\t\n\x01\x62\x18\x03 \x01(\r\")\n\x04GUID\x12\x10\n\x08highPart\x18\x01 \x01(\x04\x12\x0f\n\x07lowPart\x18\x02 \x01(\x04\"L\n\x0bSessionInfo\x12*\n\x0bsessionGUID\x18\x01 \x01(\x0b\x32\x15.Askui.API.TDKv1.GUID\x12\x11\n\tsessionID\x18\x02 \x01(\x04\"e\n\x0b\x43\x61ptureArea\x12$\n\x04size\x18\x03 \x01(\x0b\x32\x16.Askui.API.TDKv1.Size2\x12\x30\n\ncoordinate\x18\x02 \x01(\x0b\x32\x1c.Askui.API.TDKv1.Coordinate2\"\x81\x01\n\x11\x43\x61ptureParameters\x12\x16\n\tdisplayID\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x36\n\x0b\x63\x61ptureArea\x18\x02 \x01(\x0b\x32\x1c.Askui.API.TDKv1.CaptureAreaH\x01\x88\x01\x01\x42\x0c\n\n_displayIDB\x0e\n\x0c_captureArea\"6\n\"PollEventParameters_ActionFinished\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r\"n\n\x13PollEventParameters\x12M\n\x0e\x61\x63tionFinished\x18\x01 \x01(\x0b\x32\x33.Askui.API.TDKv1.PollEventParameters_ActionFinishedH\x00\x42\x08\n\x06\x64\x61taOf\"-\n\x15\x41\x63tionParameters_Wait\x12\x14\n\x0cmilliseconds\x18\x01 \x01(\r\"W\n\"ActionParameters_MouseButton_Press\x12\x31\n\x0bmouseButton\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.MouseButton\"Y\n$ActionParameters_MouseButton_Release\x12\x31\n\x0bmouseButton\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.MouseButton\"p\n,ActionParameters_MouseButton_PressAndRelease\x12\x31\n\x0bmouseButton\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.MouseButton\x12\r\n\x05\x63ount\x18\x02 \x01(\r\"\xc0\x01\n!ActionParameters_MouseWheelScroll\x12=\n\tdirection\x18\x01 \x01(\x0e\x32*.Askui.API.TDKv1.MouseWheelScrollDirection\x12\x37\n\tdeltaType\x18\x02 \x01(\x0e\x32$.Askui.API.TDKv1.MouseWheelDeltaType\x12\r\n\x05\x64\x65lta\x18\x03 \x01(\x05\x12\x14\n\x0cmilliseconds\x18\x04 \x01(\x05\"x\n\x1a\x41\x63tionParameters_MouseMove\x12.\n\x08position\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.Coordinate2\x12\x19\n\x0cmilliseconds\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\x0f\n\r_milliseconds\"v\n ActionParameters_MouseMove_Delta\x12&\n\x05\x64\x65lta\x18\x01 \x01(\x0b\x32\x17.Askui.API.TDKv1.Delta2\x12\x19\n\x0cmilliseconds\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\x0f\n\r_milliseconds\"O\n\"ActionParameters_KeyboardKey_Press\x12\x0f\n\x07keyName\x18\x01 \x01(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t\"Q\n$ActionParameters_KeyboardKey_Release\x12\x0f\n\x07keyName\x18\x01 \x01(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t\"Y\n,ActionParameters_KeyboardKey_PressAndRelease\x12\x0f\n\x07keyName\x18\x01 \x01(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t\"Q\n#ActionParameters_KeyboardKeys_Press\x12\x10\n\x08keyNames\x18\x01 \x03(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t\"S\n%ActionParameters_KeyboardKeys_Release\x12\x10\n\x08keyNames\x18\x01 \x03(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t\"[\n-ActionParameters_KeyboardKeys_PressAndRelease\x12\x10\n\x08keyNames\x18\x01 \x03(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t\"\x99\x01\n\"ActionParameters_KeyboardType_Text\x12\x0c\n\x04text\x18\x01 \x01(\t\x12;\n\x10typingSpeedValue\x18\x02 \x01(\x0e\x32!.Askui.API.TDKv1.TypingSpeedValue\x12\x18\n\x0btypingSpeed\x18\x03 \x01(\rH\x00\x88\x01\x01\x42\x0e\n\x0c_typingSpeed\"\xa0\x01\n)ActionParameters_KeyboardType_UnicodeText\x12\x0c\n\x04text\x18\x01 \x01(\x0c\x12;\n\x10typingSpeedValue\x18\x02 \x01(\x0e\x32!.Askui.API.TDKv1.TypingSpeedValue\x12\x18\n\x0btypingSpeed\x18\x03 \x01(\rH\x00\x88\x01\x01\x42\x0e\n\x0c_typingSpeed\"l\n\x1b\x41\x63tionParameters_RunCommand\x12\x0f\n\x07\x63ommand\x18\x01 \x01(\t\x12\"\n\x15timeoutInMilliseconds\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\x18\n\x16_timeoutInMilliseconds\"\xf5\n\n\x10\x41\x63tionParameters\x12%\n\x04none\x18\x01 \x01(\x0b\x32\x15.Askui.API.TDKv1.VoidH\x00\x12\x36\n\x04wait\x18\x02 \x01(\x0b\x32&.Askui.API.TDKv1.ActionParameters_WaitH\x00\x12O\n\x10mouseButtonPress\x18\x03 \x01(\x0b\x32\x33.Askui.API.TDKv1.ActionParameters_MouseButton_PressH\x00\x12S\n\x12mouseButtonRelease\x18\x04 \x01(\x0b\x32\x35.Askui.API.TDKv1.ActionParameters_MouseButton_ReleaseH\x00\x12\x63\n\x1amouseButtonPressAndRelease\x18\x05 \x01(\x0b\x32=.Askui.API.TDKv1.ActionParameters_MouseButton_PressAndReleaseH\x00\x12N\n\x10mouseWheelScroll\x18\x06 \x01(\x0b\x32\x32.Askui.API.TDKv1.ActionParameters_MouseWheelScrollH\x00\x12@\n\tmouseMove\x18\x07 \x01(\x0b\x32+.Askui.API.TDKv1.ActionParameters_MouseMoveH\x00\x12K\n\x0emouseMoveDelta\x18\x08 \x01(\x0b\x32\x31.Askui.API.TDKv1.ActionParameters_MouseMove_DeltaH\x00\x12O\n\x10keyboardKeyPress\x18\t \x01(\x0b\x32\x33.Askui.API.TDKv1.ActionParameters_KeyboardKey_PressH\x00\x12S\n\x12keyboardKeyRelease\x18\n \x01(\x0b\x32\x35.Askui.API.TDKv1.ActionParameters_KeyboardKey_ReleaseH\x00\x12\x63\n\x1akeyboardKeyPressAndRelease\x18\x0b \x01(\x0b\x32=.Askui.API.TDKv1.ActionParameters_KeyboardKey_PressAndReleaseH\x00\x12Q\n\x11keyboardKeysPress\x18\x0c \x01(\x0b\x32\x34.Askui.API.TDKv1.ActionParameters_KeyboardKeys_PressH\x00\x12U\n\x13keyboardKeysRelease\x18\r \x01(\x0b\x32\x36.Askui.API.TDKv1.ActionParameters_KeyboardKeys_ReleaseH\x00\x12\x65\n\x1bkeyboardKeysPressAndRelease\x18\x0e \x01(\x0b\x32>.Askui.API.TDKv1.ActionParameters_KeyboardKeys_PressAndReleaseH\x00\x12O\n\x10keyboardTypeText\x18\x0f \x01(\x0b\x32\x33.Askui.API.TDKv1.ActionParameters_KeyboardType_TextH\x00\x12]\n\x17keyboardTypeUnicodeText\x18\x10 \x01(\x0b\x32:.Askui.API.TDKv1.ActionParameters_KeyboardType_UnicodeTextH\x00\x12\x42\n\nruncommand\x18\x11 \x01(\x0b\x32,.Askui.API.TDKv1.ActionParameters_RunCommandH\x00\x42\x08\n\x06\x64\x61taOf\"G\n\x14Request_StartSession\x12\x13\n\x0bsessionGUID\x18\x01 \x01(\t\x12\x1a\n\x12immediateExecution\x18\x02 \x01(\x08\"J\n\x15Response_StartSession\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\"G\n\x12Request_EndSession\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\"t\n\x0cRequest_Poll\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x31\n\x0bpollEventID\x18\x02 \x01(\x0e\x32\x1c.Askui.API.TDKv1.PollEventID\"K\n\x16Request_StartExecution\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\"J\n\x15Request_StopExecution\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\"\x85\x01\n\rResponse_Poll\x12\x31\n\x0bpollEventID\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.PollEventID\x12\x41\n\x13pollEventParameters\x18\x02 \x01(\x0b\x32$.Askui.API.TDKv1.PollEventParameters\"\xc2\x01\n\x19Request_RunRecordedAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x35\n\ractionClassID\x18\x02 \x01(\x0e\x32\x1e.Askui.API.TDKv1.ActionClassID\x12;\n\x10\x61\x63tionParameters\x18\x03 \x01(\x0b\x32!.Askui.API.TDKv1.ActionParameters\"L\n\x1aResponse_RunRecordedAction\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r\x12\x1c\n\x14requiredMilliseconds\x18\x02 \x01(\r\"\xc6\x01\n\x1dRequest_ScheduleBatchedAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x35\n\ractionClassID\x18\x02 \x01(\x0e\x32\x1e.Askui.API.TDKv1.ActionClassID\x12;\n\x10\x61\x63tionParameters\x18\x03 \x01(\x0b\x32!.Askui.API.TDKv1.ActionParameters\"2\n\x1eResponse_ScheduleBatchedAction\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r\"K\n\x16Request_GetActionCount\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\".\n\x17Response_GetActionCount\x12\x13\n\x0b\x61\x63tionCount\x18\x01 \x01(\r\"[\n\x11Request_GetAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x13\n\x0b\x61\x63tionIndex\x18\x02 \x01(\r\"\x9a\x01\n\x12Response_GetAction\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r\x12\x35\n\ractionClassID\x18\x02 \x01(\x0e\x32\x1e.Askui.API.TDKv1.ActionClassID\x12;\n\x10\x61\x63tionParameters\x18\x03 \x01(\x0b\x32!.Askui.API.TDKv1.ActionParameters\"[\n\x14Request_RemoveAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x10\n\x08\x61\x63tionID\x18\x02 \x01(\r\"M\n\x18Request_RemoveAllActions\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\"J\n\x15Request_StartBatchRun\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\"I\n\x14Request_StopBatchRun\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\"\xa4\x01\n\x15Request_CaptureScreen\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x42\n\x11\x63\x61ptureParameters\x18\x02 \x01(\x0b\x32\".Askui.API.TDKv1.CaptureParametersH\x00\x88\x01\x01\x42\x14\n\x12_captureParameters\"A\n\x16Response_CaptureScreen\x12\'\n\x06\x62itmap\x18\x01 \x01(\x0b\x32\x17.Askui.API.TDKv1.Bitmap\"O\n$Response_GetContinuousCapturedScreen\x12\'\n\x06\x62itmap\x18\x01 \x01(\x0b\x32\x17.Askui.API.TDKv1.Bitmap\"\xde\x01\n\x1cReuqest_SetTestConfiguration\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x44\n\x18\x64\x65\x66\x61ultCaptureParameters\x18\x02 \x01(\x0b\x32\".Askui.API.TDKv1.CaptureParameters\x12 \n\x18mouseDelayInMilliseconds\x18\x03 \x01(\r\x12#\n\x1bkeyboardDelayInMilliseconds\x18\x04 \x01(\r\"g\n\x15Request_SetMouseDelay\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x1b\n\x13\x64\x65layInMilliseconds\x18\x02 \x01(\r\"j\n\x18Request_SetKeyboardDelay\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x1b\n\x13\x64\x65layInMilliseconds\x18\x02 \x01(\r\"\x9f\x01\n\x12\x44isplayInformation\x12\x11\n\tdisplayID\x18\x01 \x01(\r\x12\x0c\n\x04name\x18\x02 \x01(\t\x12,\n\x0csizeInPixels\x18\x03 \x01(\x0b\x32\x16.Askui.API.TDKv1.Size2\x12:\n\x16virtualScreenRectangle\x18\x04 \x01(\x0b\x32\x1a.Askui.API.TDKv1.Rectangle\"\x93\x01\n\x1eResponse_GetDisplayInformation\x12\x35\n\x08\x64isplays\x18\x01 \x03(\x0b\x32#.Askui.API.TDKv1.DisplayInformation\x12:\n\x16virtualScreenRectangle\x18\x02 \x01(\x0b\x32\x1a.Askui.API.TDKv1.Rectangle\"1\n\x19Response_GetMousePosition\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"-\n\x18Request_SetActiveDisplay\x12\x11\n\tdisplayID\x18\x01 \x01(\r\"Q\n\x10Request_GetColor\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\x12\'\n\x06\x62itmap\x18\x03 \x01(\x0b\x32\x17.Askui.API.TDKv1.Bitmap\":\n\x11Response_GetColor\x12%\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x16.Askui.API.TDKv1.Color\"-\n\x15Request_GetPixelColor\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"?\n\x16Response_GetPixelColor\x12%\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x16.Askui.API.TDKv1.Color\"n\n\x17Request_SetDisplayLabel\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x11\n\tdisplayID\x18\x02 \x01(\r\x12\r\n\x05label\x18\x03 \x01(\t*N\n\x0bPollEventID\x12\x19\n\x15PollEventID_Undefined\x10\x00\x12\x1e\n\x1aPollEventID_ActionFinished\x10\x02\"\x04\x08\x01\x10\x01*m\n\x0bMouseButton\x12\x19\n\x15MouseButton_Undefined\x10\x00\x12\x14\n\x10MouseButton_Left\x10\x01\x12\x15\n\x11MouseButton_Right\x10\x02\x12\x16\n\x12MouseButton_Middle\x10\x03*\x8b\x05\n\rActionClassID\x12\x1b\n\x17\x41\x63tionClassID_Undefined\x10\x00\x12\x16\n\x12\x41\x63tionClassID_Wait\x10\x01\x12#\n\x1f\x41\x63tionClassID_MouseButton_Press\x10\x08\x12%\n!ActionClassID_MouseButton_Release\x10\t\x12-\n)ActionClassID_MouseButton_PressAndRelease\x10\n\x12\"\n\x1e\x41\x63tionClassID_MouseWheelScroll\x10\x0b\x12\x1b\n\x17\x41\x63tionClassID_MouseMove\x10\x0c\x12!\n\x1d\x41\x63tionClassID_MouseMove_Delta\x10\r\x12#\n\x1f\x41\x63tionClassID_KeyboardKey_Press\x10\x0e\x12%\n!ActionClassID_KeyboardKey_Release\x10\x0f\x12-\n)ActionClassID_KeyboardKey_PressAndRelease\x10\x10\x12$\n ActionClassID_KeyboardKeys_Press\x10\x11\x12&\n\"ActionClassID_KeyboardKeys_Release\x10\x12\x12.\n*ActionClassID_KeyboardKeys_PressAndRelease\x10\x13\x12#\n\x1f\x41\x63tionClassID_KeyboardType_Text\x10\x14\x12*\n&ActionClassID_KeyboardType_UnicodeText\x10\x15\x12\x1c\n\x18\x41\x63tionClassID_RunCommand\x10\x16*i\n\x13MouseWheelDeltaType\x12\x1d\n\x19MouseWheelDelta_Undefined\x10\x00\x12\x17\n\x13MouseWheelDelta_Raw\x10\x01\x12\x1a\n\x16MouseWheelDelta_Detent\x10\x02*\x96\x01\n\x19MouseWheelScrollDirection\x12\'\n#MouseWheelScrollDirection_Undefined\x10\x00\x12&\n\"MouseWheelScrollDirection_Vertical\x10\x01\x12(\n$MouseWheelScrollDirection_Horizontal\x10\x02*z\n\x10TypingSpeedValue\x12\x1e\n\x1aTypingSpeedValue_Undefined\x10\x00\x12(\n$TypingSpeedValue_CharactersPerSecond\x10\x01\x12\x1c\n\x18TypingSpeedValue_Seconds\x10\x02\x32\xad\x11\n\rControllerAPI\x12_\n\x0cStartSession\x12%.Askui.API.TDKv1.Request_StartSession\x1a&.Askui.API.TDKv1.Response_StartSession\"\x00\x12S\n\nEndSession\x12#.Askui.API.TDKv1.Request_EndSession\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12G\n\x04Poll\x12\x1d.Askui.API.TDKv1.Request_Poll\x1a\x1e.Askui.API.TDKv1.Response_Poll\"\x00\x12[\n\x0eStartExecution\x12\'.Askui.API.TDKv1.Request_StartExecution\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12Y\n\rStopExecution\x12&.Askui.API.TDKv1.Request_StopExecution\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12n\n\x11RunRecordedAction\x12*.Askui.API.TDKv1.Request_RunRecordedAction\x1a+.Askui.API.TDKv1.Response_RunRecordedAction\"\x00\x12z\n\x15ScheduleBatchedAction\x12..Askui.API.TDKv1.Request_ScheduleBatchedAction\x1a/.Askui.API.TDKv1.Response_ScheduleBatchedAction\"\x00\x12Y\n\rStartBatchRun\x12&.Askui.API.TDKv1.Request_StartBatchRun\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12W\n\x0cStopBatchRun\x12%.Askui.API.TDKv1.Request_StopBatchRun\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12\x65\n\x0eGetActionCount\x12\'.Askui.API.TDKv1.Request_GetActionCount\x1a(.Askui.API.TDKv1.Response_GetActionCount\"\x00\x12V\n\tGetAction\x12\".Askui.API.TDKv1.Request_GetAction\x1a#.Askui.API.TDKv1.Response_GetAction\"\x00\x12W\n\x0cRemoveAction\x12%.Askui.API.TDKv1.Request_RemoveAction\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12_\n\x10RemoveAllActions\x12).Askui.API.TDKv1.Request_RemoveAllActions\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12\x62\n\rCaptureScreen\x12&.Askui.API.TDKv1.Request_CaptureScreen\x1a\'.Askui.API.TDKv1.Response_CaptureScreen\"\x00\x12g\n\x14SetTestConfiguration\x12-.Askui.API.TDKv1.Reuqest_SetTestConfiguration\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12Y\n\rSetMouseDelay\x12&.Askui.API.TDKv1.Request_SetMouseDelay\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12_\n\x10SetKeyboardDelay\x12).Askui.API.TDKv1.Request_SetKeyboardDelay\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12i\n\x15GetDisplayInformation\x12\x1d.Askui.API.TDKv1.Request_Void\x1a/.Askui.API.TDKv1.Response_GetDisplayInformation\"\x00\x12_\n\x10GetMousePosition\x12\x1d.Askui.API.TDKv1.Request_Void\x1a*.Askui.API.TDKv1.Response_GetMousePosition\"\x00\x12_\n\x10SetActiveDisplay\x12).Askui.API.TDKv1.Request_SetActiveDisplay\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12S\n\x08GetColor\x12!.Askui.API.TDKv1.Request_GetColor\x1a\".Askui.API.TDKv1.Response_GetColor\"\x00\x12\x62\n\rGetPixelColor\x12&.Askui.API.TDKv1.Request_GetPixelColor\x1a\'.Askui.API.TDKv1.Response_GetPixelColor\"\x00\x12]\n\x0fSetDisplayLabel\x12(.Askui.API.TDKv1.Request_SetDisplayLabel\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x62\x06proto3')
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
+ b'\n\x13\x43ontroller_V1.proto\x12\x0f\x41skui.API.TDKv1"\x06\n\x04Void"\x0e\n\x0cRequest_Void"\x0f\n\rResponse_Void"&\n\x05Size2\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\r"\x1e\n\x06\x44\x65lta2\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"#\n\x0b\x43oordinate2\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"E\n\tRectangle\x12\x0c\n\x04left\x18\x01 \x01(\x05\x12\x0b\n\x03top\x18\x02 \x01(\x05\x12\r\n\x05right\x18\x03 \x01(\x05\x12\x0e\n\x06\x62ottom\x18\x04 \x01(\x05"u\n\x06\x42itmap\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\r\x12\x11\n\tlineWidth\x18\x03 \x01(\r\x12\x14\n\x0c\x62itsPerPixel\x18\x04 \x01(\r\x12\x15\n\rbytesPerPixel\x18\x05 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x06 \x01(\x0c"(\n\x05\x43olor\x12\t\n\x01r\x18\x01 \x01(\r\x12\t\n\x01g\x18\x02 \x01(\r\x12\t\n\x01\x62\x18\x03 \x01(\r")\n\x04GUID\x12\x10\n\x08highPart\x18\x01 \x01(\x04\x12\x0f\n\x07lowPart\x18\x02 \x01(\x04"L\n\x0bSessionInfo\x12*\n\x0bsessionGUID\x18\x01 \x01(\x0b\x32\x15.Askui.API.TDKv1.GUID\x12\x11\n\tsessionID\x18\x02 \x01(\x04"e\n\x0b\x43\x61ptureArea\x12$\n\x04size\x18\x03 \x01(\x0b\x32\x16.Askui.API.TDKv1.Size2\x12\x30\n\ncoordinate\x18\x02 \x01(\x0b\x32\x1c.Askui.API.TDKv1.Coordinate2"\x81\x01\n\x11\x43\x61ptureParameters\x12\x16\n\tdisplayID\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x36\n\x0b\x63\x61ptureArea\x18\x02 \x01(\x0b\x32\x1c.Askui.API.TDKv1.CaptureAreaH\x01\x88\x01\x01\x42\x0c\n\n_displayIDB\x0e\n\x0c_captureArea"6\n"PollEventParameters_ActionFinished\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r"n\n\x13PollEventParameters\x12M\n\x0e\x61\x63tionFinished\x18\x01 \x01(\x0b\x32\x33.Askui.API.TDKv1.PollEventParameters_ActionFinishedH\x00\x42\x08\n\x06\x64\x61taOf"-\n\x15\x41\x63tionParameters_Wait\x12\x14\n\x0cmilliseconds\x18\x01 \x01(\r"W\n"ActionParameters_MouseButton_Press\x12\x31\n\x0bmouseButton\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.MouseButton"Y\n$ActionParameters_MouseButton_Release\x12\x31\n\x0bmouseButton\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.MouseButton"p\n,ActionParameters_MouseButton_PressAndRelease\x12\x31\n\x0bmouseButton\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.MouseButton\x12\r\n\x05\x63ount\x18\x02 \x01(\r"\xc0\x01\n!ActionParameters_MouseWheelScroll\x12=\n\tdirection\x18\x01 \x01(\x0e\x32*.Askui.API.TDKv1.MouseWheelScrollDirection\x12\x37\n\tdeltaType\x18\x02 \x01(\x0e\x32$.Askui.API.TDKv1.MouseWheelDeltaType\x12\r\n\x05\x64\x65lta\x18\x03 \x01(\x05\x12\x14\n\x0cmilliseconds\x18\x04 \x01(\x05"x\n\x1a\x41\x63tionParameters_MouseMove\x12.\n\x08position\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.Coordinate2\x12\x19\n\x0cmilliseconds\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\x0f\n\r_milliseconds"v\n ActionParameters_MouseMove_Delta\x12&\n\x05\x64\x65lta\x18\x01 \x01(\x0b\x32\x17.Askui.API.TDKv1.Delta2\x12\x19\n\x0cmilliseconds\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\x0f\n\r_milliseconds"O\n"ActionParameters_KeyboardKey_Press\x12\x0f\n\x07keyName\x18\x01 \x01(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t"Q\n$ActionParameters_KeyboardKey_Release\x12\x0f\n\x07keyName\x18\x01 \x01(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t"Y\n,ActionParameters_KeyboardKey_PressAndRelease\x12\x0f\n\x07keyName\x18\x01 \x01(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t"Q\n#ActionParameters_KeyboardKeys_Press\x12\x10\n\x08keyNames\x18\x01 \x03(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t"S\n%ActionParameters_KeyboardKeys_Release\x12\x10\n\x08keyNames\x18\x01 \x03(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t"[\n-ActionParameters_KeyboardKeys_PressAndRelease\x12\x10\n\x08keyNames\x18\x01 \x03(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t"\x99\x01\n"ActionParameters_KeyboardType_Text\x12\x0c\n\x04text\x18\x01 \x01(\t\x12;\n\x10typingSpeedValue\x18\x02 \x01(\x0e\x32!.Askui.API.TDKv1.TypingSpeedValue\x12\x18\n\x0btypingSpeed\x18\x03 \x01(\rH\x00\x88\x01\x01\x42\x0e\n\x0c_typingSpeed"\xa0\x01\n)ActionParameters_KeyboardType_UnicodeText\x12\x0c\n\x04text\x18\x01 \x01(\x0c\x12;\n\x10typingSpeedValue\x18\x02 \x01(\x0e\x32!.Askui.API.TDKv1.TypingSpeedValue\x12\x18\n\x0btypingSpeed\x18\x03 \x01(\rH\x00\x88\x01\x01\x42\x0e\n\x0c_typingSpeed"l\n\x1b\x41\x63tionParameters_RunCommand\x12\x0f\n\x07\x63ommand\x18\x01 \x01(\t\x12"\n\x15timeoutInMilliseconds\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\x18\n\x16_timeoutInMilliseconds"\xf5\n\n\x10\x41\x63tionParameters\x12%\n\x04none\x18\x01 \x01(\x0b\x32\x15.Askui.API.TDKv1.VoidH\x00\x12\x36\n\x04wait\x18\x02 \x01(\x0b\x32&.Askui.API.TDKv1.ActionParameters_WaitH\x00\x12O\n\x10mouseButtonPress\x18\x03 \x01(\x0b\x32\x33.Askui.API.TDKv1.ActionParameters_MouseButton_PressH\x00\x12S\n\x12mouseButtonRelease\x18\x04 \x01(\x0b\x32\x35.Askui.API.TDKv1.ActionParameters_MouseButton_ReleaseH\x00\x12\x63\n\x1amouseButtonPressAndRelease\x18\x05 \x01(\x0b\x32=.Askui.API.TDKv1.ActionParameters_MouseButton_PressAndReleaseH\x00\x12N\n\x10mouseWheelScroll\x18\x06 \x01(\x0b\x32\x32.Askui.API.TDKv1.ActionParameters_MouseWheelScrollH\x00\x12@\n\tmouseMove\x18\x07 \x01(\x0b\x32+.Askui.API.TDKv1.ActionParameters_MouseMoveH\x00\x12K\n\x0emouseMoveDelta\x18\x08 \x01(\x0b\x32\x31.Askui.API.TDKv1.ActionParameters_MouseMove_DeltaH\x00\x12O\n\x10keyboardKeyPress\x18\t \x01(\x0b\x32\x33.Askui.API.TDKv1.ActionParameters_KeyboardKey_PressH\x00\x12S\n\x12keyboardKeyRelease\x18\n \x01(\x0b\x32\x35.Askui.API.TDKv1.ActionParameters_KeyboardKey_ReleaseH\x00\x12\x63\n\x1akeyboardKeyPressAndRelease\x18\x0b \x01(\x0b\x32=.Askui.API.TDKv1.ActionParameters_KeyboardKey_PressAndReleaseH\x00\x12Q\n\x11keyboardKeysPress\x18\x0c \x01(\x0b\x32\x34.Askui.API.TDKv1.ActionParameters_KeyboardKeys_PressH\x00\x12U\n\x13keyboardKeysRelease\x18\r \x01(\x0b\x32\x36.Askui.API.TDKv1.ActionParameters_KeyboardKeys_ReleaseH\x00\x12\x65\n\x1bkeyboardKeysPressAndRelease\x18\x0e \x01(\x0b\x32>.Askui.API.TDKv1.ActionParameters_KeyboardKeys_PressAndReleaseH\x00\x12O\n\x10keyboardTypeText\x18\x0f \x01(\x0b\x32\x33.Askui.API.TDKv1.ActionParameters_KeyboardType_TextH\x00\x12]\n\x17keyboardTypeUnicodeText\x18\x10 \x01(\x0b\x32:.Askui.API.TDKv1.ActionParameters_KeyboardType_UnicodeTextH\x00\x12\x42\n\nruncommand\x18\x11 \x01(\x0b\x32,.Askui.API.TDKv1.ActionParameters_RunCommandH\x00\x42\x08\n\x06\x64\x61taOf"G\n\x14Request_StartSession\x12\x13\n\x0bsessionGUID\x18\x01 \x01(\t\x12\x1a\n\x12immediateExecution\x18\x02 \x01(\x08"J\n\x15Response_StartSession\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo"G\n\x12Request_EndSession\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo"t\n\x0cRequest_Poll\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x31\n\x0bpollEventID\x18\x02 \x01(\x0e\x32\x1c.Askui.API.TDKv1.PollEventID"K\n\x16Request_StartExecution\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo"J\n\x15Request_StopExecution\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo"\x85\x01\n\rResponse_Poll\x12\x31\n\x0bpollEventID\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.PollEventID\x12\x41\n\x13pollEventParameters\x18\x02 \x01(\x0b\x32$.Askui.API.TDKv1.PollEventParameters"\xc2\x01\n\x19Request_RunRecordedAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x35\n\ractionClassID\x18\x02 \x01(\x0e\x32\x1e.Askui.API.TDKv1.ActionClassID\x12;\n\x10\x61\x63tionParameters\x18\x03 \x01(\x0b\x32!.Askui.API.TDKv1.ActionParameters"L\n\x1aResponse_RunRecordedAction\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r\x12\x1c\n\x14requiredMilliseconds\x18\x02 \x01(\r"\xc6\x01\n\x1dRequest_ScheduleBatchedAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x35\n\ractionClassID\x18\x02 \x01(\x0e\x32\x1e.Askui.API.TDKv1.ActionClassID\x12;\n\x10\x61\x63tionParameters\x18\x03 \x01(\x0b\x32!.Askui.API.TDKv1.ActionParameters"2\n\x1eResponse_ScheduleBatchedAction\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r"K\n\x16Request_GetActionCount\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo".\n\x17Response_GetActionCount\x12\x13\n\x0b\x61\x63tionCount\x18\x01 \x01(\r"[\n\x11Request_GetAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x13\n\x0b\x61\x63tionIndex\x18\x02 \x01(\r"\x9a\x01\n\x12Response_GetAction\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r\x12\x35\n\ractionClassID\x18\x02 \x01(\x0e\x32\x1e.Askui.API.TDKv1.ActionClassID\x12;\n\x10\x61\x63tionParameters\x18\x03 \x01(\x0b\x32!.Askui.API.TDKv1.ActionParameters"[\n\x14Request_RemoveAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x10\n\x08\x61\x63tionID\x18\x02 \x01(\r"M\n\x18Request_RemoveAllActions\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo"J\n\x15Request_StartBatchRun\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo"I\n\x14Request_StopBatchRun\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo"\xa4\x01\n\x15Request_CaptureScreen\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x42\n\x11\x63\x61ptureParameters\x18\x02 \x01(\x0b\x32".Askui.API.TDKv1.CaptureParametersH\x00\x88\x01\x01\x42\x14\n\x12_captureParameters"A\n\x16Response_CaptureScreen\x12\'\n\x06\x62itmap\x18\x01 \x01(\x0b\x32\x17.Askui.API.TDKv1.Bitmap"O\n$Response_GetContinuousCapturedScreen\x12\'\n\x06\x62itmap\x18\x01 \x01(\x0b\x32\x17.Askui.API.TDKv1.Bitmap"\xde\x01\n\x1cReuqest_SetTestConfiguration\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x44\n\x18\x64\x65\x66\x61ultCaptureParameters\x18\x02 \x01(\x0b\x32".Askui.API.TDKv1.CaptureParameters\x12 \n\x18mouseDelayInMilliseconds\x18\x03 \x01(\r\x12#\n\x1bkeyboardDelayInMilliseconds\x18\x04 \x01(\r"g\n\x15Request_SetMouseDelay\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x1b\n\x13\x64\x65layInMilliseconds\x18\x02 \x01(\r"j\n\x18Request_SetKeyboardDelay\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x1b\n\x13\x64\x65layInMilliseconds\x18\x02 \x01(\r"\x9f\x01\n\x12\x44isplayInformation\x12\x11\n\tdisplayID\x18\x01 \x01(\r\x12\x0c\n\x04name\x18\x02 \x01(\t\x12,\n\x0csizeInPixels\x18\x03 \x01(\x0b\x32\x16.Askui.API.TDKv1.Size2\x12:\n\x16virtualScreenRectangle\x18\x04 \x01(\x0b\x32\x1a.Askui.API.TDKv1.Rectangle"\x93\x01\n\x1eResponse_GetDisplayInformation\x12\x35\n\x08\x64isplays\x18\x01 \x03(\x0b\x32#.Askui.API.TDKv1.DisplayInformation\x12:\n\x16virtualScreenRectangle\x18\x02 \x01(\x0b\x32\x1a.Askui.API.TDKv1.Rectangle"1\n\x19Response_GetMousePosition\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"-\n\x18Request_SetActiveDisplay\x12\x11\n\tdisplayID\x18\x01 \x01(\r"Q\n\x10Request_GetColor\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\x12\'\n\x06\x62itmap\x18\x03 \x01(\x0b\x32\x17.Askui.API.TDKv1.Bitmap":\n\x11Response_GetColor\x12%\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x16.Askui.API.TDKv1.Color"-\n\x15Request_GetPixelColor\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"?\n\x16Response_GetPixelColor\x12%\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x16.Askui.API.TDKv1.Color"n\n\x17Request_SetDisplayLabel\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x11\n\tdisplayID\x18\x02 \x01(\r\x12\r\n\x05label\x18\x03 \x01(\t*N\n\x0bPollEventID\x12\x19\n\x15PollEventID_Undefined\x10\x00\x12\x1e\n\x1aPollEventID_ActionFinished\x10\x02"\x04\x08\x01\x10\x01*m\n\x0bMouseButton\x12\x19\n\x15MouseButton_Undefined\x10\x00\x12\x14\n\x10MouseButton_Left\x10\x01\x12\x15\n\x11MouseButton_Right\x10\x02\x12\x16\n\x12MouseButton_Middle\x10\x03*\x8b\x05\n\rActionClassID\x12\x1b\n\x17\x41\x63tionClassID_Undefined\x10\x00\x12\x16\n\x12\x41\x63tionClassID_Wait\x10\x01\x12#\n\x1f\x41\x63tionClassID_MouseButton_Press\x10\x08\x12%\n!ActionClassID_MouseButton_Release\x10\t\x12-\n)ActionClassID_MouseButton_PressAndRelease\x10\n\x12"\n\x1e\x41\x63tionClassID_MouseWheelScroll\x10\x0b\x12\x1b\n\x17\x41\x63tionClassID_MouseMove\x10\x0c\x12!\n\x1d\x41\x63tionClassID_MouseMove_Delta\x10\r\x12#\n\x1f\x41\x63tionClassID_KeyboardKey_Press\x10\x0e\x12%\n!ActionClassID_KeyboardKey_Release\x10\x0f\x12-\n)ActionClassID_KeyboardKey_PressAndRelease\x10\x10\x12$\n ActionClassID_KeyboardKeys_Press\x10\x11\x12&\n"ActionClassID_KeyboardKeys_Release\x10\x12\x12.\n*ActionClassID_KeyboardKeys_PressAndRelease\x10\x13\x12#\n\x1f\x41\x63tionClassID_KeyboardType_Text\x10\x14\x12*\n&ActionClassID_KeyboardType_UnicodeText\x10\x15\x12\x1c\n\x18\x41\x63tionClassID_RunCommand\x10\x16*i\n\x13MouseWheelDeltaType\x12\x1d\n\x19MouseWheelDelta_Undefined\x10\x00\x12\x17\n\x13MouseWheelDelta_Raw\x10\x01\x12\x1a\n\x16MouseWheelDelta_Detent\x10\x02*\x96\x01\n\x19MouseWheelScrollDirection\x12\'\n#MouseWheelScrollDirection_Undefined\x10\x00\x12&\n"MouseWheelScrollDirection_Vertical\x10\x01\x12(\n$MouseWheelScrollDirection_Horizontal\x10\x02*z\n\x10TypingSpeedValue\x12\x1e\n\x1aTypingSpeedValue_Undefined\x10\x00\x12(\n$TypingSpeedValue_CharactersPerSecond\x10\x01\x12\x1c\n\x18TypingSpeedValue_Seconds\x10\x02\x32\xad\x11\n\rControllerAPI\x12_\n\x0cStartSession\x12%.Askui.API.TDKv1.Request_StartSession\x1a&.Askui.API.TDKv1.Response_StartSession"\x00\x12S\n\nEndSession\x12#.Askui.API.TDKv1.Request_EndSession\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12G\n\x04Poll\x12\x1d.Askui.API.TDKv1.Request_Poll\x1a\x1e.Askui.API.TDKv1.Response_Poll"\x00\x12[\n\x0eStartExecution\x12\'.Askui.API.TDKv1.Request_StartExecution\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12Y\n\rStopExecution\x12&.Askui.API.TDKv1.Request_StopExecution\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12n\n\x11RunRecordedAction\x12*.Askui.API.TDKv1.Request_RunRecordedAction\x1a+.Askui.API.TDKv1.Response_RunRecordedAction"\x00\x12z\n\x15ScheduleBatchedAction\x12..Askui.API.TDKv1.Request_ScheduleBatchedAction\x1a/.Askui.API.TDKv1.Response_ScheduleBatchedAction"\x00\x12Y\n\rStartBatchRun\x12&.Askui.API.TDKv1.Request_StartBatchRun\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12W\n\x0cStopBatchRun\x12%.Askui.API.TDKv1.Request_StopBatchRun\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12\x65\n\x0eGetActionCount\x12\'.Askui.API.TDKv1.Request_GetActionCount\x1a(.Askui.API.TDKv1.Response_GetActionCount"\x00\x12V\n\tGetAction\x12".Askui.API.TDKv1.Request_GetAction\x1a#.Askui.API.TDKv1.Response_GetAction"\x00\x12W\n\x0cRemoveAction\x12%.Askui.API.TDKv1.Request_RemoveAction\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12_\n\x10RemoveAllActions\x12).Askui.API.TDKv1.Request_RemoveAllActions\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12\x62\n\rCaptureScreen\x12&.Askui.API.TDKv1.Request_CaptureScreen\x1a\'.Askui.API.TDKv1.Response_CaptureScreen"\x00\x12g\n\x14SetTestConfiguration\x12-.Askui.API.TDKv1.Reuqest_SetTestConfiguration\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12Y\n\rSetMouseDelay\x12&.Askui.API.TDKv1.Request_SetMouseDelay\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12_\n\x10SetKeyboardDelay\x12).Askui.API.TDKv1.Request_SetKeyboardDelay\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12i\n\x15GetDisplayInformation\x12\x1d.Askui.API.TDKv1.Request_Void\x1a/.Askui.API.TDKv1.Response_GetDisplayInformation"\x00\x12_\n\x10GetMousePosition\x12\x1d.Askui.API.TDKv1.Request_Void\x1a*.Askui.API.TDKv1.Response_GetMousePosition"\x00\x12_\n\x10SetActiveDisplay\x12).Askui.API.TDKv1.Request_SetActiveDisplay\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12S\n\x08GetColor\x12!.Askui.API.TDKv1.Request_GetColor\x1a".Askui.API.TDKv1.Response_GetColor"\x00\x12\x62\n\rGetPixelColor\x12&.Askui.API.TDKv1.Request_GetPixelColor\x1a\'.Askui.API.TDKv1.Response_GetPixelColor"\x00\x12]\n\x0fSetDisplayLabel\x12(.Askui.API.TDKv1.Request_SetDisplayLabel\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x62\x06proto3'
+)
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
-_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'Controller_V1_pb2', _globals)
+_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "Controller_V1_pb2", _globals)
if not _descriptor._USE_C_DESCRIPTORS:
- DESCRIPTOR._loaded_options = None
- _globals['_POLLEVENTID']._serialized_start=7454
- _globals['_POLLEVENTID']._serialized_end=7532
- _globals['_MOUSEBUTTON']._serialized_start=7534
- _globals['_MOUSEBUTTON']._serialized_end=7643
- _globals['_ACTIONCLASSID']._serialized_start=7646
- _globals['_ACTIONCLASSID']._serialized_end=8297
- _globals['_MOUSEWHEELDELTATYPE']._serialized_start=8299
- _globals['_MOUSEWHEELDELTATYPE']._serialized_end=8404
- _globals['_MOUSEWHEELSCROLLDIRECTION']._serialized_start=8407
- _globals['_MOUSEWHEELSCROLLDIRECTION']._serialized_end=8557
- _globals['_TYPINGSPEEDVALUE']._serialized_start=8559
- _globals['_TYPINGSPEEDVALUE']._serialized_end=8681
- _globals['_VOID']._serialized_start=40
- _globals['_VOID']._serialized_end=46
- _globals['_REQUEST_VOID']._serialized_start=48
- _globals['_REQUEST_VOID']._serialized_end=62
- _globals['_RESPONSE_VOID']._serialized_start=64
- _globals['_RESPONSE_VOID']._serialized_end=79
- _globals['_SIZE2']._serialized_start=81
- _globals['_SIZE2']._serialized_end=119
- _globals['_DELTA2']._serialized_start=121
- _globals['_DELTA2']._serialized_end=151
- _globals['_COORDINATE2']._serialized_start=153
- _globals['_COORDINATE2']._serialized_end=188
- _globals['_RECTANGLE']._serialized_start=190
- _globals['_RECTANGLE']._serialized_end=259
- _globals['_BITMAP']._serialized_start=261
- _globals['_BITMAP']._serialized_end=378
- _globals['_COLOR']._serialized_start=380
- _globals['_COLOR']._serialized_end=420
- _globals['_GUID']._serialized_start=422
- _globals['_GUID']._serialized_end=463
- _globals['_SESSIONINFO']._serialized_start=465
- _globals['_SESSIONINFO']._serialized_end=541
- _globals['_CAPTUREAREA']._serialized_start=543
- _globals['_CAPTUREAREA']._serialized_end=644
- _globals['_CAPTUREPARAMETERS']._serialized_start=647
- _globals['_CAPTUREPARAMETERS']._serialized_end=776
- _globals['_POLLEVENTPARAMETERS_ACTIONFINISHED']._serialized_start=778
- _globals['_POLLEVENTPARAMETERS_ACTIONFINISHED']._serialized_end=832
- _globals['_POLLEVENTPARAMETERS']._serialized_start=834
- _globals['_POLLEVENTPARAMETERS']._serialized_end=944
- _globals['_ACTIONPARAMETERS_WAIT']._serialized_start=946
- _globals['_ACTIONPARAMETERS_WAIT']._serialized_end=991
- _globals['_ACTIONPARAMETERS_MOUSEBUTTON_PRESS']._serialized_start=993
- _globals['_ACTIONPARAMETERS_MOUSEBUTTON_PRESS']._serialized_end=1080
- _globals['_ACTIONPARAMETERS_MOUSEBUTTON_RELEASE']._serialized_start=1082
- _globals['_ACTIONPARAMETERS_MOUSEBUTTON_RELEASE']._serialized_end=1171
- _globals['_ACTIONPARAMETERS_MOUSEBUTTON_PRESSANDRELEASE']._serialized_start=1173
- _globals['_ACTIONPARAMETERS_MOUSEBUTTON_PRESSANDRELEASE']._serialized_end=1285
- _globals['_ACTIONPARAMETERS_MOUSEWHEELSCROLL']._serialized_start=1288
- _globals['_ACTIONPARAMETERS_MOUSEWHEELSCROLL']._serialized_end=1480
- _globals['_ACTIONPARAMETERS_MOUSEMOVE']._serialized_start=1482
- _globals['_ACTIONPARAMETERS_MOUSEMOVE']._serialized_end=1602
- _globals['_ACTIONPARAMETERS_MOUSEMOVE_DELTA']._serialized_start=1604
- _globals['_ACTIONPARAMETERS_MOUSEMOVE_DELTA']._serialized_end=1722
- _globals['_ACTIONPARAMETERS_KEYBOARDKEY_PRESS']._serialized_start=1724
- _globals['_ACTIONPARAMETERS_KEYBOARDKEY_PRESS']._serialized_end=1803
- _globals['_ACTIONPARAMETERS_KEYBOARDKEY_RELEASE']._serialized_start=1805
- _globals['_ACTIONPARAMETERS_KEYBOARDKEY_RELEASE']._serialized_end=1886
- _globals['_ACTIONPARAMETERS_KEYBOARDKEY_PRESSANDRELEASE']._serialized_start=1888
- _globals['_ACTIONPARAMETERS_KEYBOARDKEY_PRESSANDRELEASE']._serialized_end=1977
- _globals['_ACTIONPARAMETERS_KEYBOARDKEYS_PRESS']._serialized_start=1979
- _globals['_ACTIONPARAMETERS_KEYBOARDKEYS_PRESS']._serialized_end=2060
- _globals['_ACTIONPARAMETERS_KEYBOARDKEYS_RELEASE']._serialized_start=2062
- _globals['_ACTIONPARAMETERS_KEYBOARDKEYS_RELEASE']._serialized_end=2145
- _globals['_ACTIONPARAMETERS_KEYBOARDKEYS_PRESSANDRELEASE']._serialized_start=2147
- _globals['_ACTIONPARAMETERS_KEYBOARDKEYS_PRESSANDRELEASE']._serialized_end=2238
- _globals['_ACTIONPARAMETERS_KEYBOARDTYPE_TEXT']._serialized_start=2241
- _globals['_ACTIONPARAMETERS_KEYBOARDTYPE_TEXT']._serialized_end=2394
- _globals['_ACTIONPARAMETERS_KEYBOARDTYPE_UNICODETEXT']._serialized_start=2397
- _globals['_ACTIONPARAMETERS_KEYBOARDTYPE_UNICODETEXT']._serialized_end=2557
- _globals['_ACTIONPARAMETERS_RUNCOMMAND']._serialized_start=2559
- _globals['_ACTIONPARAMETERS_RUNCOMMAND']._serialized_end=2667
- _globals['_ACTIONPARAMETERS']._serialized_start=2670
- _globals['_ACTIONPARAMETERS']._serialized_end=4067
- _globals['_REQUEST_STARTSESSION']._serialized_start=4069
- _globals['_REQUEST_STARTSESSION']._serialized_end=4140
- _globals['_RESPONSE_STARTSESSION']._serialized_start=4142
- _globals['_RESPONSE_STARTSESSION']._serialized_end=4216
- _globals['_REQUEST_ENDSESSION']._serialized_start=4218
- _globals['_REQUEST_ENDSESSION']._serialized_end=4289
- _globals['_REQUEST_POLL']._serialized_start=4291
- _globals['_REQUEST_POLL']._serialized_end=4407
- _globals['_REQUEST_STARTEXECUTION']._serialized_start=4409
- _globals['_REQUEST_STARTEXECUTION']._serialized_end=4484
- _globals['_REQUEST_STOPEXECUTION']._serialized_start=4486
- _globals['_REQUEST_STOPEXECUTION']._serialized_end=4560
- _globals['_RESPONSE_POLL']._serialized_start=4563
- _globals['_RESPONSE_POLL']._serialized_end=4696
- _globals['_REQUEST_RUNRECORDEDACTION']._serialized_start=4699
- _globals['_REQUEST_RUNRECORDEDACTION']._serialized_end=4893
- _globals['_RESPONSE_RUNRECORDEDACTION']._serialized_start=4895
- _globals['_RESPONSE_RUNRECORDEDACTION']._serialized_end=4971
- _globals['_REQUEST_SCHEDULEBATCHEDACTION']._serialized_start=4974
- _globals['_REQUEST_SCHEDULEBATCHEDACTION']._serialized_end=5172
- _globals['_RESPONSE_SCHEDULEBATCHEDACTION']._serialized_start=5174
- _globals['_RESPONSE_SCHEDULEBATCHEDACTION']._serialized_end=5224
- _globals['_REQUEST_GETACTIONCOUNT']._serialized_start=5226
- _globals['_REQUEST_GETACTIONCOUNT']._serialized_end=5301
- _globals['_RESPONSE_GETACTIONCOUNT']._serialized_start=5303
- _globals['_RESPONSE_GETACTIONCOUNT']._serialized_end=5349
- _globals['_REQUEST_GETACTION']._serialized_start=5351
- _globals['_REQUEST_GETACTION']._serialized_end=5442
- _globals['_RESPONSE_GETACTION']._serialized_start=5445
- _globals['_RESPONSE_GETACTION']._serialized_end=5599
- _globals['_REQUEST_REMOVEACTION']._serialized_start=5601
- _globals['_REQUEST_REMOVEACTION']._serialized_end=5692
- _globals['_REQUEST_REMOVEALLACTIONS']._serialized_start=5694
- _globals['_REQUEST_REMOVEALLACTIONS']._serialized_end=5771
- _globals['_REQUEST_STARTBATCHRUN']._serialized_start=5773
- _globals['_REQUEST_STARTBATCHRUN']._serialized_end=5847
- _globals['_REQUEST_STOPBATCHRUN']._serialized_start=5849
- _globals['_REQUEST_STOPBATCHRUN']._serialized_end=5922
- _globals['_REQUEST_CAPTURESCREEN']._serialized_start=5925
- _globals['_REQUEST_CAPTURESCREEN']._serialized_end=6089
- _globals['_RESPONSE_CAPTURESCREEN']._serialized_start=6091
- _globals['_RESPONSE_CAPTURESCREEN']._serialized_end=6156
- _globals['_RESPONSE_GETCONTINUOUSCAPTUREDSCREEN']._serialized_start=6158
- _globals['_RESPONSE_GETCONTINUOUSCAPTUREDSCREEN']._serialized_end=6237
- _globals['_REUQEST_SETTESTCONFIGURATION']._serialized_start=6240
- _globals['_REUQEST_SETTESTCONFIGURATION']._serialized_end=6462
- _globals['_REQUEST_SETMOUSEDELAY']._serialized_start=6464
- _globals['_REQUEST_SETMOUSEDELAY']._serialized_end=6567
- _globals['_REQUEST_SETKEYBOARDDELAY']._serialized_start=6569
- _globals['_REQUEST_SETKEYBOARDDELAY']._serialized_end=6675
- _globals['_DISPLAYINFORMATION']._serialized_start=6678
- _globals['_DISPLAYINFORMATION']._serialized_end=6837
- _globals['_RESPONSE_GETDISPLAYINFORMATION']._serialized_start=6840
- _globals['_RESPONSE_GETDISPLAYINFORMATION']._serialized_end=6987
- _globals['_RESPONSE_GETMOUSEPOSITION']._serialized_start=6989
- _globals['_RESPONSE_GETMOUSEPOSITION']._serialized_end=7038
- _globals['_REQUEST_SETACTIVEDISPLAY']._serialized_start=7040
- _globals['_REQUEST_SETACTIVEDISPLAY']._serialized_end=7085
- _globals['_REQUEST_GETCOLOR']._serialized_start=7087
- _globals['_REQUEST_GETCOLOR']._serialized_end=7168
- _globals['_RESPONSE_GETCOLOR']._serialized_start=7170
- _globals['_RESPONSE_GETCOLOR']._serialized_end=7228
- _globals['_REQUEST_GETPIXELCOLOR']._serialized_start=7230
- _globals['_REQUEST_GETPIXELCOLOR']._serialized_end=7275
- _globals['_RESPONSE_GETPIXELCOLOR']._serialized_start=7277
- _globals['_RESPONSE_GETPIXELCOLOR']._serialized_end=7340
- _globals['_REQUEST_SETDISPLAYLABEL']._serialized_start=7342
- _globals['_REQUEST_SETDISPLAYLABEL']._serialized_end=7452
- _globals['_CONTROLLERAPI']._serialized_start=8684
- _globals['_CONTROLLERAPI']._serialized_end=10905
+ DESCRIPTOR._loaded_options = None
+ _globals["_POLLEVENTID"]._serialized_start = 7454
+ _globals["_POLLEVENTID"]._serialized_end = 7532
+ _globals["_MOUSEBUTTON"]._serialized_start = 7534
+ _globals["_MOUSEBUTTON"]._serialized_end = 7643
+ _globals["_ACTIONCLASSID"]._serialized_start = 7646
+ _globals["_ACTIONCLASSID"]._serialized_end = 8297
+ _globals["_MOUSEWHEELDELTATYPE"]._serialized_start = 8299
+ _globals["_MOUSEWHEELDELTATYPE"]._serialized_end = 8404
+ _globals["_MOUSEWHEELSCROLLDIRECTION"]._serialized_start = 8407
+ _globals["_MOUSEWHEELSCROLLDIRECTION"]._serialized_end = 8557
+ _globals["_TYPINGSPEEDVALUE"]._serialized_start = 8559
+ _globals["_TYPINGSPEEDVALUE"]._serialized_end = 8681
+ _globals["_VOID"]._serialized_start = 40
+ _globals["_VOID"]._serialized_end = 46
+ _globals["_REQUEST_VOID"]._serialized_start = 48
+ _globals["_REQUEST_VOID"]._serialized_end = 62
+ _globals["_RESPONSE_VOID"]._serialized_start = 64
+ _globals["_RESPONSE_VOID"]._serialized_end = 79
+ _globals["_SIZE2"]._serialized_start = 81
+ _globals["_SIZE2"]._serialized_end = 119
+ _globals["_DELTA2"]._serialized_start = 121
+ _globals["_DELTA2"]._serialized_end = 151
+ _globals["_COORDINATE2"]._serialized_start = 153
+ _globals["_COORDINATE2"]._serialized_end = 188
+ _globals["_RECTANGLE"]._serialized_start = 190
+ _globals["_RECTANGLE"]._serialized_end = 259
+ _globals["_BITMAP"]._serialized_start = 261
+ _globals["_BITMAP"]._serialized_end = 378
+ _globals["_COLOR"]._serialized_start = 380
+ _globals["_COLOR"]._serialized_end = 420
+ _globals["_GUID"]._serialized_start = 422
+ _globals["_GUID"]._serialized_end = 463
+ _globals["_SESSIONINFO"]._serialized_start = 465
+ _globals["_SESSIONINFO"]._serialized_end = 541
+ _globals["_CAPTUREAREA"]._serialized_start = 543
+ _globals["_CAPTUREAREA"]._serialized_end = 644
+ _globals["_CAPTUREPARAMETERS"]._serialized_start = 647
+ _globals["_CAPTUREPARAMETERS"]._serialized_end = 776
+ _globals["_POLLEVENTPARAMETERS_ACTIONFINISHED"]._serialized_start = 778
+ _globals["_POLLEVENTPARAMETERS_ACTIONFINISHED"]._serialized_end = 832
+ _globals["_POLLEVENTPARAMETERS"]._serialized_start = 834
+ _globals["_POLLEVENTPARAMETERS"]._serialized_end = 944
+ _globals["_ACTIONPARAMETERS_WAIT"]._serialized_start = 946
+ _globals["_ACTIONPARAMETERS_WAIT"]._serialized_end = 991
+ _globals["_ACTIONPARAMETERS_MOUSEBUTTON_PRESS"]._serialized_start = 993
+ _globals["_ACTIONPARAMETERS_MOUSEBUTTON_PRESS"]._serialized_end = 1080
+ _globals["_ACTIONPARAMETERS_MOUSEBUTTON_RELEASE"]._serialized_start = 1082
+ _globals["_ACTIONPARAMETERS_MOUSEBUTTON_RELEASE"]._serialized_end = 1171
+ _globals["_ACTIONPARAMETERS_MOUSEBUTTON_PRESSANDRELEASE"]._serialized_start = 1173
+ _globals["_ACTIONPARAMETERS_MOUSEBUTTON_PRESSANDRELEASE"]._serialized_end = 1285
+ _globals["_ACTIONPARAMETERS_MOUSEWHEELSCROLL"]._serialized_start = 1288
+ _globals["_ACTIONPARAMETERS_MOUSEWHEELSCROLL"]._serialized_end = 1480
+ _globals["_ACTIONPARAMETERS_MOUSEMOVE"]._serialized_start = 1482
+ _globals["_ACTIONPARAMETERS_MOUSEMOVE"]._serialized_end = 1602
+ _globals["_ACTIONPARAMETERS_MOUSEMOVE_DELTA"]._serialized_start = 1604
+ _globals["_ACTIONPARAMETERS_MOUSEMOVE_DELTA"]._serialized_end = 1722
+ _globals["_ACTIONPARAMETERS_KEYBOARDKEY_PRESS"]._serialized_start = 1724
+ _globals["_ACTIONPARAMETERS_KEYBOARDKEY_PRESS"]._serialized_end = 1803
+ _globals["_ACTIONPARAMETERS_KEYBOARDKEY_RELEASE"]._serialized_start = 1805
+ _globals["_ACTIONPARAMETERS_KEYBOARDKEY_RELEASE"]._serialized_end = 1886
+ _globals["_ACTIONPARAMETERS_KEYBOARDKEY_PRESSANDRELEASE"]._serialized_start = 1888
+ _globals["_ACTIONPARAMETERS_KEYBOARDKEY_PRESSANDRELEASE"]._serialized_end = 1977
+ _globals["_ACTIONPARAMETERS_KEYBOARDKEYS_PRESS"]._serialized_start = 1979
+ _globals["_ACTIONPARAMETERS_KEYBOARDKEYS_PRESS"]._serialized_end = 2060
+ _globals["_ACTIONPARAMETERS_KEYBOARDKEYS_RELEASE"]._serialized_start = 2062
+ _globals["_ACTIONPARAMETERS_KEYBOARDKEYS_RELEASE"]._serialized_end = 2145
+ _globals["_ACTIONPARAMETERS_KEYBOARDKEYS_PRESSANDRELEASE"]._serialized_start = 2147
+ _globals["_ACTIONPARAMETERS_KEYBOARDKEYS_PRESSANDRELEASE"]._serialized_end = 2238
+ _globals["_ACTIONPARAMETERS_KEYBOARDTYPE_TEXT"]._serialized_start = 2241
+ _globals["_ACTIONPARAMETERS_KEYBOARDTYPE_TEXT"]._serialized_end = 2394
+ _globals["_ACTIONPARAMETERS_KEYBOARDTYPE_UNICODETEXT"]._serialized_start = 2397
+ _globals["_ACTIONPARAMETERS_KEYBOARDTYPE_UNICODETEXT"]._serialized_end = 2557
+ _globals["_ACTIONPARAMETERS_RUNCOMMAND"]._serialized_start = 2559
+ _globals["_ACTIONPARAMETERS_RUNCOMMAND"]._serialized_end = 2667
+ _globals["_ACTIONPARAMETERS"]._serialized_start = 2670
+ _globals["_ACTIONPARAMETERS"]._serialized_end = 4067
+ _globals["_REQUEST_STARTSESSION"]._serialized_start = 4069
+ _globals["_REQUEST_STARTSESSION"]._serialized_end = 4140
+ _globals["_RESPONSE_STARTSESSION"]._serialized_start = 4142
+ _globals["_RESPONSE_STARTSESSION"]._serialized_end = 4216
+ _globals["_REQUEST_ENDSESSION"]._serialized_start = 4218
+ _globals["_REQUEST_ENDSESSION"]._serialized_end = 4289
+ _globals["_REQUEST_POLL"]._serialized_start = 4291
+ _globals["_REQUEST_POLL"]._serialized_end = 4407
+ _globals["_REQUEST_STARTEXECUTION"]._serialized_start = 4409
+ _globals["_REQUEST_STARTEXECUTION"]._serialized_end = 4484
+ _globals["_REQUEST_STOPEXECUTION"]._serialized_start = 4486
+ _globals["_REQUEST_STOPEXECUTION"]._serialized_end = 4560
+ _globals["_RESPONSE_POLL"]._serialized_start = 4563
+ _globals["_RESPONSE_POLL"]._serialized_end = 4696
+ _globals["_REQUEST_RUNRECORDEDACTION"]._serialized_start = 4699
+ _globals["_REQUEST_RUNRECORDEDACTION"]._serialized_end = 4893
+ _globals["_RESPONSE_RUNRECORDEDACTION"]._serialized_start = 4895
+ _globals["_RESPONSE_RUNRECORDEDACTION"]._serialized_end = 4971
+ _globals["_REQUEST_SCHEDULEBATCHEDACTION"]._serialized_start = 4974
+ _globals["_REQUEST_SCHEDULEBATCHEDACTION"]._serialized_end = 5172
+ _globals["_RESPONSE_SCHEDULEBATCHEDACTION"]._serialized_start = 5174
+ _globals["_RESPONSE_SCHEDULEBATCHEDACTION"]._serialized_end = 5224
+ _globals["_REQUEST_GETACTIONCOUNT"]._serialized_start = 5226
+ _globals["_REQUEST_GETACTIONCOUNT"]._serialized_end = 5301
+ _globals["_RESPONSE_GETACTIONCOUNT"]._serialized_start = 5303
+ _globals["_RESPONSE_GETACTIONCOUNT"]._serialized_end = 5349
+ _globals["_REQUEST_GETACTION"]._serialized_start = 5351
+ _globals["_REQUEST_GETACTION"]._serialized_end = 5442
+ _globals["_RESPONSE_GETACTION"]._serialized_start = 5445
+ _globals["_RESPONSE_GETACTION"]._serialized_end = 5599
+ _globals["_REQUEST_REMOVEACTION"]._serialized_start = 5601
+ _globals["_REQUEST_REMOVEACTION"]._serialized_end = 5692
+ _globals["_REQUEST_REMOVEALLACTIONS"]._serialized_start = 5694
+ _globals["_REQUEST_REMOVEALLACTIONS"]._serialized_end = 5771
+ _globals["_REQUEST_STARTBATCHRUN"]._serialized_start = 5773
+ _globals["_REQUEST_STARTBATCHRUN"]._serialized_end = 5847
+ _globals["_REQUEST_STOPBATCHRUN"]._serialized_start = 5849
+ _globals["_REQUEST_STOPBATCHRUN"]._serialized_end = 5922
+ _globals["_REQUEST_CAPTURESCREEN"]._serialized_start = 5925
+ _globals["_REQUEST_CAPTURESCREEN"]._serialized_end = 6089
+ _globals["_RESPONSE_CAPTURESCREEN"]._serialized_start = 6091
+ _globals["_RESPONSE_CAPTURESCREEN"]._serialized_end = 6156
+ _globals["_RESPONSE_GETCONTINUOUSCAPTUREDSCREEN"]._serialized_start = 6158
+ _globals["_RESPONSE_GETCONTINUOUSCAPTUREDSCREEN"]._serialized_end = 6237
+ _globals["_REUQEST_SETTESTCONFIGURATION"]._serialized_start = 6240
+ _globals["_REUQEST_SETTESTCONFIGURATION"]._serialized_end = 6462
+ _globals["_REQUEST_SETMOUSEDELAY"]._serialized_start = 6464
+ _globals["_REQUEST_SETMOUSEDELAY"]._serialized_end = 6567
+ _globals["_REQUEST_SETKEYBOARDDELAY"]._serialized_start = 6569
+ _globals["_REQUEST_SETKEYBOARDDELAY"]._serialized_end = 6675
+ _globals["_DISPLAYINFORMATION"]._serialized_start = 6678
+ _globals["_DISPLAYINFORMATION"]._serialized_end = 6837
+ _globals["_RESPONSE_GETDISPLAYINFORMATION"]._serialized_start = 6840
+ _globals["_RESPONSE_GETDISPLAYINFORMATION"]._serialized_end = 6987
+ _globals["_RESPONSE_GETMOUSEPOSITION"]._serialized_start = 6989
+ _globals["_RESPONSE_GETMOUSEPOSITION"]._serialized_end = 7038
+ _globals["_REQUEST_SETACTIVEDISPLAY"]._serialized_start = 7040
+ _globals["_REQUEST_SETACTIVEDISPLAY"]._serialized_end = 7085
+ _globals["_REQUEST_GETCOLOR"]._serialized_start = 7087
+ _globals["_REQUEST_GETCOLOR"]._serialized_end = 7168
+ _globals["_RESPONSE_GETCOLOR"]._serialized_start = 7170
+ _globals["_RESPONSE_GETCOLOR"]._serialized_end = 7228
+ _globals["_REQUEST_GETPIXELCOLOR"]._serialized_start = 7230
+ _globals["_REQUEST_GETPIXELCOLOR"]._serialized_end = 7275
+ _globals["_RESPONSE_GETPIXELCOLOR"]._serialized_start = 7277
+ _globals["_RESPONSE_GETPIXELCOLOR"]._serialized_end = 7340
+ _globals["_REQUEST_SETDISPLAYLABEL"]._serialized_start = 7342
+ _globals["_REQUEST_SETDISPLAYLABEL"]._serialized_end = 7452
+ _globals["_CONTROLLERAPI"]._serialized_start = 8684
+ _globals["_CONTROLLERAPI"]._serialized_end = 10905
# @@protoc_insertion_point(module_scope)
diff --git a/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2.pyi b/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2.pyi
index b7ff2127..58bb9f9e 100644
--- a/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2.pyi
+++ b/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2.pyi
@@ -1,8 +1,23 @@
-from google.protobuf.internal import containers as _containers
-from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
+from typing import (
+ ClassVar as _ClassVar,
+)
+from typing import (
+ Iterable as _Iterable,
+)
+from typing import (
+ Mapping as _Mapping,
+)
+from typing import (
+ Optional as _Optional,
+)
+from typing import (
+ Union as _Union,
+)
+
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
-from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
+from google.protobuf.internal import containers as _containers
+from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
DESCRIPTOR: _descriptor.FileDescriptor
@@ -55,6 +70,7 @@ class TypingSpeedValue(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
TypingSpeedValue_Undefined: _ClassVar[TypingSpeedValue]
TypingSpeedValue_CharactersPerSecond: _ClassVar[TypingSpeedValue]
TypingSpeedValue_Seconds: _ClassVar[TypingSpeedValue]
+
PollEventID_Undefined: PollEventID
PollEventID_ActionFinished: PollEventID
MouseButton_Undefined: MouseButton
@@ -106,7 +122,9 @@ class Size2(_message.Message):
HEIGHT_FIELD_NUMBER: _ClassVar[int]
width: int
height: int
- def __init__(self, width: _Optional[int] = ..., height: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self, width: _Optional[int] = ..., height: _Optional[int] = ...
+ ) -> None: ...
class Delta2(_message.Message):
__slots__ = ("x", "y")
@@ -134,10 +152,23 @@ class Rectangle(_message.Message):
top: int
right: int
bottom: int
- def __init__(self, left: _Optional[int] = ..., top: _Optional[int] = ..., right: _Optional[int] = ..., bottom: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self,
+ left: _Optional[int] = ...,
+ top: _Optional[int] = ...,
+ right: _Optional[int] = ...,
+ bottom: _Optional[int] = ...,
+ ) -> None: ...
class Bitmap(_message.Message):
- __slots__ = ("width", "height", "lineWidth", "bitsPerPixel", "bytesPerPixel", "data")
+ __slots__ = (
+ "width",
+ "height",
+ "lineWidth",
+ "bitsPerPixel",
+ "bytesPerPixel",
+ "data",
+ )
WIDTH_FIELD_NUMBER: _ClassVar[int]
HEIGHT_FIELD_NUMBER: _ClassVar[int]
LINEWIDTH_FIELD_NUMBER: _ClassVar[int]
@@ -150,7 +181,15 @@ class Bitmap(_message.Message):
bitsPerPixel: int
bytesPerPixel: int
data: bytes
- def __init__(self, width: _Optional[int] = ..., height: _Optional[int] = ..., lineWidth: _Optional[int] = ..., bitsPerPixel: _Optional[int] = ..., bytesPerPixel: _Optional[int] = ..., data: _Optional[bytes] = ...) -> None: ...
+ def __init__(
+ self,
+ width: _Optional[int] = ...,
+ height: _Optional[int] = ...,
+ lineWidth: _Optional[int] = ...,
+ bitsPerPixel: _Optional[int] = ...,
+ bytesPerPixel: _Optional[int] = ...,
+ data: _Optional[bytes] = ...,
+ ) -> None: ...
class Color(_message.Message):
__slots__ = ("r", "g", "b")
@@ -160,7 +199,9 @@ class Color(_message.Message):
r: int
g: int
b: int
- def __init__(self, r: _Optional[int] = ..., g: _Optional[int] = ..., b: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self, r: _Optional[int] = ..., g: _Optional[int] = ..., b: _Optional[int] = ...
+ ) -> None: ...
class GUID(_message.Message):
__slots__ = ("highPart", "lowPart")
@@ -168,7 +209,9 @@ class GUID(_message.Message):
LOWPART_FIELD_NUMBER: _ClassVar[int]
highPart: int
lowPart: int
- def __init__(self, highPart: _Optional[int] = ..., lowPart: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self, highPart: _Optional[int] = ..., lowPart: _Optional[int] = ...
+ ) -> None: ...
class SessionInfo(_message.Message):
__slots__ = ("sessionGUID", "sessionID")
@@ -176,7 +219,11 @@ class SessionInfo(_message.Message):
SESSIONID_FIELD_NUMBER: _ClassVar[int]
sessionGUID: GUID
sessionID: int
- def __init__(self, sessionGUID: _Optional[_Union[GUID, _Mapping]] = ..., sessionID: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self,
+ sessionGUID: _Optional[_Union[GUID, _Mapping]] = ...,
+ sessionID: _Optional[int] = ...,
+ ) -> None: ...
class CaptureArea(_message.Message):
__slots__ = ("size", "coordinate")
@@ -184,7 +231,11 @@ class CaptureArea(_message.Message):
COORDINATE_FIELD_NUMBER: _ClassVar[int]
size: Size2
coordinate: Coordinate2
- def __init__(self, size: _Optional[_Union[Size2, _Mapping]] = ..., coordinate: _Optional[_Union[Coordinate2, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self,
+ size: _Optional[_Union[Size2, _Mapping]] = ...,
+ coordinate: _Optional[_Union[Coordinate2, _Mapping]] = ...,
+ ) -> None: ...
class CaptureParameters(_message.Message):
__slots__ = ("displayID", "captureArea")
@@ -192,7 +243,11 @@ class CaptureParameters(_message.Message):
CAPTUREAREA_FIELD_NUMBER: _ClassVar[int]
displayID: int
captureArea: CaptureArea
- def __init__(self, displayID: _Optional[int] = ..., captureArea: _Optional[_Union[CaptureArea, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self,
+ displayID: _Optional[int] = ...,
+ captureArea: _Optional[_Union[CaptureArea, _Mapping]] = ...,
+ ) -> None: ...
class PollEventParameters_ActionFinished(_message.Message):
__slots__ = ("actionID",)
@@ -204,7 +259,12 @@ class PollEventParameters(_message.Message):
__slots__ = ("actionFinished",)
ACTIONFINISHED_FIELD_NUMBER: _ClassVar[int]
actionFinished: PollEventParameters_ActionFinished
- def __init__(self, actionFinished: _Optional[_Union[PollEventParameters_ActionFinished, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self,
+ actionFinished: _Optional[
+ _Union[PollEventParameters_ActionFinished, _Mapping]
+ ] = ...,
+ ) -> None: ...
class ActionParameters_Wait(_message.Message):
__slots__ = ("milliseconds",)
@@ -216,13 +276,17 @@ class ActionParameters_MouseButton_Press(_message.Message):
__slots__ = ("mouseButton",)
MOUSEBUTTON_FIELD_NUMBER: _ClassVar[int]
mouseButton: MouseButton
- def __init__(self, mouseButton: _Optional[_Union[MouseButton, str]] = ...) -> None: ...
+ def __init__(
+ self, mouseButton: _Optional[_Union[MouseButton, str]] = ...
+ ) -> None: ...
class ActionParameters_MouseButton_Release(_message.Message):
__slots__ = ("mouseButton",)
MOUSEBUTTON_FIELD_NUMBER: _ClassVar[int]
mouseButton: MouseButton
- def __init__(self, mouseButton: _Optional[_Union[MouseButton, str]] = ...) -> None: ...
+ def __init__(
+ self, mouseButton: _Optional[_Union[MouseButton, str]] = ...
+ ) -> None: ...
class ActionParameters_MouseButton_PressAndRelease(_message.Message):
__slots__ = ("mouseButton", "count")
@@ -230,7 +294,11 @@ class ActionParameters_MouseButton_PressAndRelease(_message.Message):
COUNT_FIELD_NUMBER: _ClassVar[int]
mouseButton: MouseButton
count: int
- def __init__(self, mouseButton: _Optional[_Union[MouseButton, str]] = ..., count: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self,
+ mouseButton: _Optional[_Union[MouseButton, str]] = ...,
+ count: _Optional[int] = ...,
+ ) -> None: ...
class ActionParameters_MouseWheelScroll(_message.Message):
__slots__ = ("direction", "deltaType", "delta", "milliseconds")
@@ -242,7 +310,13 @@ class ActionParameters_MouseWheelScroll(_message.Message):
deltaType: MouseWheelDeltaType
delta: int
milliseconds: int
- def __init__(self, direction: _Optional[_Union[MouseWheelScrollDirection, str]] = ..., deltaType: _Optional[_Union[MouseWheelDeltaType, str]] = ..., delta: _Optional[int] = ..., milliseconds: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self,
+ direction: _Optional[_Union[MouseWheelScrollDirection, str]] = ...,
+ deltaType: _Optional[_Union[MouseWheelDeltaType, str]] = ...,
+ delta: _Optional[int] = ...,
+ milliseconds: _Optional[int] = ...,
+ ) -> None: ...
class ActionParameters_MouseMove(_message.Message):
__slots__ = ("position", "milliseconds")
@@ -250,7 +324,11 @@ class ActionParameters_MouseMove(_message.Message):
MILLISECONDS_FIELD_NUMBER: _ClassVar[int]
position: Coordinate2
milliseconds: int
- def __init__(self, position: _Optional[_Union[Coordinate2, _Mapping]] = ..., milliseconds: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self,
+ position: _Optional[_Union[Coordinate2, _Mapping]] = ...,
+ milliseconds: _Optional[int] = ...,
+ ) -> None: ...
class ActionParameters_MouseMove_Delta(_message.Message):
__slots__ = ("delta", "milliseconds")
@@ -258,7 +336,11 @@ class ActionParameters_MouseMove_Delta(_message.Message):
MILLISECONDS_FIELD_NUMBER: _ClassVar[int]
delta: Delta2
milliseconds: int
- def __init__(self, delta: _Optional[_Union[Delta2, _Mapping]] = ..., milliseconds: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self,
+ delta: _Optional[_Union[Delta2, _Mapping]] = ...,
+ milliseconds: _Optional[int] = ...,
+ ) -> None: ...
class ActionParameters_KeyboardKey_Press(_message.Message):
__slots__ = ("keyName", "modifierKeyNames")
@@ -266,7 +348,11 @@ class ActionParameters_KeyboardKey_Press(_message.Message):
MODIFIERKEYNAMES_FIELD_NUMBER: _ClassVar[int]
keyName: str
modifierKeyNames: _containers.RepeatedScalarFieldContainer[str]
- def __init__(self, keyName: _Optional[str] = ..., modifierKeyNames: _Optional[_Iterable[str]] = ...) -> None: ...
+ def __init__(
+ self,
+ keyName: _Optional[str] = ...,
+ modifierKeyNames: _Optional[_Iterable[str]] = ...,
+ ) -> None: ...
class ActionParameters_KeyboardKey_Release(_message.Message):
__slots__ = ("keyName", "modifierKeyNames")
@@ -274,7 +360,11 @@ class ActionParameters_KeyboardKey_Release(_message.Message):
MODIFIERKEYNAMES_FIELD_NUMBER: _ClassVar[int]
keyName: str
modifierKeyNames: _containers.RepeatedScalarFieldContainer[str]
- def __init__(self, keyName: _Optional[str] = ..., modifierKeyNames: _Optional[_Iterable[str]] = ...) -> None: ...
+ def __init__(
+ self,
+ keyName: _Optional[str] = ...,
+ modifierKeyNames: _Optional[_Iterable[str]] = ...,
+ ) -> None: ...
class ActionParameters_KeyboardKey_PressAndRelease(_message.Message):
__slots__ = ("keyName", "modifierKeyNames")
@@ -282,7 +372,11 @@ class ActionParameters_KeyboardKey_PressAndRelease(_message.Message):
MODIFIERKEYNAMES_FIELD_NUMBER: _ClassVar[int]
keyName: str
modifierKeyNames: _containers.RepeatedScalarFieldContainer[str]
- def __init__(self, keyName: _Optional[str] = ..., modifierKeyNames: _Optional[_Iterable[str]] = ...) -> None: ...
+ def __init__(
+ self,
+ keyName: _Optional[str] = ...,
+ modifierKeyNames: _Optional[_Iterable[str]] = ...,
+ ) -> None: ...
class ActionParameters_KeyboardKeys_Press(_message.Message):
__slots__ = ("keyNames", "modifierKeyNames")
@@ -290,7 +384,11 @@ class ActionParameters_KeyboardKeys_Press(_message.Message):
MODIFIERKEYNAMES_FIELD_NUMBER: _ClassVar[int]
keyNames: _containers.RepeatedScalarFieldContainer[str]
modifierKeyNames: _containers.RepeatedScalarFieldContainer[str]
- def __init__(self, keyNames: _Optional[_Iterable[str]] = ..., modifierKeyNames: _Optional[_Iterable[str]] = ...) -> None: ...
+ def __init__(
+ self,
+ keyNames: _Optional[_Iterable[str]] = ...,
+ modifierKeyNames: _Optional[_Iterable[str]] = ...,
+ ) -> None: ...
class ActionParameters_KeyboardKeys_Release(_message.Message):
__slots__ = ("keyNames", "modifierKeyNames")
@@ -298,7 +396,11 @@ class ActionParameters_KeyboardKeys_Release(_message.Message):
MODIFIERKEYNAMES_FIELD_NUMBER: _ClassVar[int]
keyNames: _containers.RepeatedScalarFieldContainer[str]
modifierKeyNames: _containers.RepeatedScalarFieldContainer[str]
- def __init__(self, keyNames: _Optional[_Iterable[str]] = ..., modifierKeyNames: _Optional[_Iterable[str]] = ...) -> None: ...
+ def __init__(
+ self,
+ keyNames: _Optional[_Iterable[str]] = ...,
+ modifierKeyNames: _Optional[_Iterable[str]] = ...,
+ ) -> None: ...
class ActionParameters_KeyboardKeys_PressAndRelease(_message.Message):
__slots__ = ("keyNames", "modifierKeyNames")
@@ -306,7 +408,11 @@ class ActionParameters_KeyboardKeys_PressAndRelease(_message.Message):
MODIFIERKEYNAMES_FIELD_NUMBER: _ClassVar[int]
keyNames: _containers.RepeatedScalarFieldContainer[str]
modifierKeyNames: _containers.RepeatedScalarFieldContainer[str]
- def __init__(self, keyNames: _Optional[_Iterable[str]] = ..., modifierKeyNames: _Optional[_Iterable[str]] = ...) -> None: ...
+ def __init__(
+ self,
+ keyNames: _Optional[_Iterable[str]] = ...,
+ modifierKeyNames: _Optional[_Iterable[str]] = ...,
+ ) -> None: ...
class ActionParameters_KeyboardType_Text(_message.Message):
__slots__ = ("text", "typingSpeedValue", "typingSpeed")
@@ -316,7 +422,12 @@ class ActionParameters_KeyboardType_Text(_message.Message):
text: str
typingSpeedValue: TypingSpeedValue
typingSpeed: int
- def __init__(self, text: _Optional[str] = ..., typingSpeedValue: _Optional[_Union[TypingSpeedValue, str]] = ..., typingSpeed: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self,
+ text: _Optional[str] = ...,
+ typingSpeedValue: _Optional[_Union[TypingSpeedValue, str]] = ...,
+ typingSpeed: _Optional[int] = ...,
+ ) -> None: ...
class ActionParameters_KeyboardType_UnicodeText(_message.Message):
__slots__ = ("text", "typingSpeedValue", "typingSpeed")
@@ -326,7 +437,12 @@ class ActionParameters_KeyboardType_UnicodeText(_message.Message):
text: bytes
typingSpeedValue: TypingSpeedValue
typingSpeed: int
- def __init__(self, text: _Optional[bytes] = ..., typingSpeedValue: _Optional[_Union[TypingSpeedValue, str]] = ..., typingSpeed: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self,
+ text: _Optional[bytes] = ...,
+ typingSpeedValue: _Optional[_Union[TypingSpeedValue, str]] = ...,
+ typingSpeed: _Optional[int] = ...,
+ ) -> None: ...
class ActionParameters_RunCommand(_message.Message):
__slots__ = ("command", "timeoutInMilliseconds")
@@ -334,10 +450,30 @@ class ActionParameters_RunCommand(_message.Message):
TIMEOUTINMILLISECONDS_FIELD_NUMBER: _ClassVar[int]
command: str
timeoutInMilliseconds: int
- def __init__(self, command: _Optional[str] = ..., timeoutInMilliseconds: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self, command: _Optional[str] = ..., timeoutInMilliseconds: _Optional[int] = ...
+ ) -> None: ...
class ActionParameters(_message.Message):
- __slots__ = ("none", "wait", "mouseButtonPress", "mouseButtonRelease", "mouseButtonPressAndRelease", "mouseWheelScroll", "mouseMove", "mouseMoveDelta", "keyboardKeyPress", "keyboardKeyRelease", "keyboardKeyPressAndRelease", "keyboardKeysPress", "keyboardKeysRelease", "keyboardKeysPressAndRelease", "keyboardTypeText", "keyboardTypeUnicodeText", "runcommand")
+ __slots__ = (
+ "none",
+ "wait",
+ "mouseButtonPress",
+ "mouseButtonRelease",
+ "mouseButtonPressAndRelease",
+ "mouseWheelScroll",
+ "mouseMove",
+ "mouseMoveDelta",
+ "keyboardKeyPress",
+ "keyboardKeyRelease",
+ "keyboardKeyPressAndRelease",
+ "keyboardKeysPress",
+ "keyboardKeysRelease",
+ "keyboardKeysPressAndRelease",
+ "keyboardTypeText",
+ "keyboardTypeUnicodeText",
+ "runcommand",
+ )
NONE_FIELD_NUMBER: _ClassVar[int]
WAIT_FIELD_NUMBER: _ClassVar[int]
MOUSEBUTTONPRESS_FIELD_NUMBER: _ClassVar[int]
@@ -372,7 +508,52 @@ class ActionParameters(_message.Message):
keyboardTypeText: ActionParameters_KeyboardType_Text
keyboardTypeUnicodeText: ActionParameters_KeyboardType_UnicodeText
runcommand: ActionParameters_RunCommand
- def __init__(self, none: _Optional[_Union[Void, _Mapping]] = ..., wait: _Optional[_Union[ActionParameters_Wait, _Mapping]] = ..., mouseButtonPress: _Optional[_Union[ActionParameters_MouseButton_Press, _Mapping]] = ..., mouseButtonRelease: _Optional[_Union[ActionParameters_MouseButton_Release, _Mapping]] = ..., mouseButtonPressAndRelease: _Optional[_Union[ActionParameters_MouseButton_PressAndRelease, _Mapping]] = ..., mouseWheelScroll: _Optional[_Union[ActionParameters_MouseWheelScroll, _Mapping]] = ..., mouseMove: _Optional[_Union[ActionParameters_MouseMove, _Mapping]] = ..., mouseMoveDelta: _Optional[_Union[ActionParameters_MouseMove_Delta, _Mapping]] = ..., keyboardKeyPress: _Optional[_Union[ActionParameters_KeyboardKey_Press, _Mapping]] = ..., keyboardKeyRelease: _Optional[_Union[ActionParameters_KeyboardKey_Release, _Mapping]] = ..., keyboardKeyPressAndRelease: _Optional[_Union[ActionParameters_KeyboardKey_PressAndRelease, _Mapping]] = ..., keyboardKeysPress: _Optional[_Union[ActionParameters_KeyboardKeys_Press, _Mapping]] = ..., keyboardKeysRelease: _Optional[_Union[ActionParameters_KeyboardKeys_Release, _Mapping]] = ..., keyboardKeysPressAndRelease: _Optional[_Union[ActionParameters_KeyboardKeys_PressAndRelease, _Mapping]] = ..., keyboardTypeText: _Optional[_Union[ActionParameters_KeyboardType_Text, _Mapping]] = ..., keyboardTypeUnicodeText: _Optional[_Union[ActionParameters_KeyboardType_UnicodeText, _Mapping]] = ..., runcommand: _Optional[_Union[ActionParameters_RunCommand, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self,
+ none: _Optional[_Union[Void, _Mapping]] = ...,
+ wait: _Optional[_Union[ActionParameters_Wait, _Mapping]] = ...,
+ mouseButtonPress: _Optional[
+ _Union[ActionParameters_MouseButton_Press, _Mapping]
+ ] = ...,
+ mouseButtonRelease: _Optional[
+ _Union[ActionParameters_MouseButton_Release, _Mapping]
+ ] = ...,
+ mouseButtonPressAndRelease: _Optional[
+ _Union[ActionParameters_MouseButton_PressAndRelease, _Mapping]
+ ] = ...,
+ mouseWheelScroll: _Optional[
+ _Union[ActionParameters_MouseWheelScroll, _Mapping]
+ ] = ...,
+ mouseMove: _Optional[_Union[ActionParameters_MouseMove, _Mapping]] = ...,
+ mouseMoveDelta: _Optional[
+ _Union[ActionParameters_MouseMove_Delta, _Mapping]
+ ] = ...,
+ keyboardKeyPress: _Optional[
+ _Union[ActionParameters_KeyboardKey_Press, _Mapping]
+ ] = ...,
+ keyboardKeyRelease: _Optional[
+ _Union[ActionParameters_KeyboardKey_Release, _Mapping]
+ ] = ...,
+ keyboardKeyPressAndRelease: _Optional[
+ _Union[ActionParameters_KeyboardKey_PressAndRelease, _Mapping]
+ ] = ...,
+ keyboardKeysPress: _Optional[
+ _Union[ActionParameters_KeyboardKeys_Press, _Mapping]
+ ] = ...,
+ keyboardKeysRelease: _Optional[
+ _Union[ActionParameters_KeyboardKeys_Release, _Mapping]
+ ] = ...,
+ keyboardKeysPressAndRelease: _Optional[
+ _Union[ActionParameters_KeyboardKeys_PressAndRelease, _Mapping]
+ ] = ...,
+ keyboardTypeText: _Optional[
+ _Union[ActionParameters_KeyboardType_Text, _Mapping]
+ ] = ...,
+ keyboardTypeUnicodeText: _Optional[
+ _Union[ActionParameters_KeyboardType_UnicodeText, _Mapping]
+ ] = ...,
+ runcommand: _Optional[_Union[ActionParameters_RunCommand, _Mapping]] = ...,
+ ) -> None: ...
class Request_StartSession(_message.Message):
__slots__ = ("sessionGUID", "immediateExecution")
@@ -380,19 +561,25 @@ class Request_StartSession(_message.Message):
IMMEDIATEEXECUTION_FIELD_NUMBER: _ClassVar[int]
sessionGUID: str
immediateExecution: bool
- def __init__(self, sessionGUID: _Optional[str] = ..., immediateExecution: bool = ...) -> None: ...
+ def __init__(
+ self, sessionGUID: _Optional[str] = ..., immediateExecution: bool = ...
+ ) -> None: ...
class Response_StartSession(_message.Message):
__slots__ = ("sessionInfo",)
SESSIONINFO_FIELD_NUMBER: _ClassVar[int]
sessionInfo: SessionInfo
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...
+ ) -> None: ...
class Request_EndSession(_message.Message):
__slots__ = ("sessionInfo",)
SESSIONINFO_FIELD_NUMBER: _ClassVar[int]
sessionInfo: SessionInfo
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...
+ ) -> None: ...
class Request_Poll(_message.Message):
__slots__ = ("sessionInfo", "pollEventID")
@@ -400,19 +587,27 @@ class Request_Poll(_message.Message):
POLLEVENTID_FIELD_NUMBER: _ClassVar[int]
sessionInfo: SessionInfo
pollEventID: PollEventID
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., pollEventID: _Optional[_Union[PollEventID, str]] = ...) -> None: ...
+ def __init__(
+ self,
+ sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...,
+ pollEventID: _Optional[_Union[PollEventID, str]] = ...,
+ ) -> None: ...
class Request_StartExecution(_message.Message):
__slots__ = ("sessionInfo",)
SESSIONINFO_FIELD_NUMBER: _ClassVar[int]
sessionInfo: SessionInfo
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...
+ ) -> None: ...
class Request_StopExecution(_message.Message):
__slots__ = ("sessionInfo",)
SESSIONINFO_FIELD_NUMBER: _ClassVar[int]
sessionInfo: SessionInfo
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...
+ ) -> None: ...
class Response_Poll(_message.Message):
__slots__ = ("pollEventID", "pollEventParameters")
@@ -420,7 +615,11 @@ class Response_Poll(_message.Message):
POLLEVENTPARAMETERS_FIELD_NUMBER: _ClassVar[int]
pollEventID: PollEventID
pollEventParameters: PollEventParameters
- def __init__(self, pollEventID: _Optional[_Union[PollEventID, str]] = ..., pollEventParameters: _Optional[_Union[PollEventParameters, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self,
+ pollEventID: _Optional[_Union[PollEventID, str]] = ...,
+ pollEventParameters: _Optional[_Union[PollEventParameters, _Mapping]] = ...,
+ ) -> None: ...
class Request_RunRecordedAction(_message.Message):
__slots__ = ("sessionInfo", "actionClassID", "actionParameters")
@@ -430,7 +629,12 @@ class Request_RunRecordedAction(_message.Message):
sessionInfo: SessionInfo
actionClassID: ActionClassID
actionParameters: ActionParameters
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., actionClassID: _Optional[_Union[ActionClassID, str]] = ..., actionParameters: _Optional[_Union[ActionParameters, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self,
+ sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...,
+ actionClassID: _Optional[_Union[ActionClassID, str]] = ...,
+ actionParameters: _Optional[_Union[ActionParameters, _Mapping]] = ...,
+ ) -> None: ...
class Response_RunRecordedAction(_message.Message):
__slots__ = ("actionID", "requiredMilliseconds")
@@ -438,7 +642,9 @@ class Response_RunRecordedAction(_message.Message):
REQUIREDMILLISECONDS_FIELD_NUMBER: _ClassVar[int]
actionID: int
requiredMilliseconds: int
- def __init__(self, actionID: _Optional[int] = ..., requiredMilliseconds: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self, actionID: _Optional[int] = ..., requiredMilliseconds: _Optional[int] = ...
+ ) -> None: ...
class Request_ScheduleBatchedAction(_message.Message):
__slots__ = ("sessionInfo", "actionClassID", "actionParameters")
@@ -448,7 +654,12 @@ class Request_ScheduleBatchedAction(_message.Message):
sessionInfo: SessionInfo
actionClassID: ActionClassID
actionParameters: ActionParameters
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., actionClassID: _Optional[_Union[ActionClassID, str]] = ..., actionParameters: _Optional[_Union[ActionParameters, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self,
+ sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...,
+ actionClassID: _Optional[_Union[ActionClassID, str]] = ...,
+ actionParameters: _Optional[_Union[ActionParameters, _Mapping]] = ...,
+ ) -> None: ...
class Response_ScheduleBatchedAction(_message.Message):
__slots__ = ("actionID",)
@@ -460,7 +671,9 @@ class Request_GetActionCount(_message.Message):
__slots__ = ("sessionInfo",)
SESSIONINFO_FIELD_NUMBER: _ClassVar[int]
sessionInfo: SessionInfo
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...
+ ) -> None: ...
class Response_GetActionCount(_message.Message):
__slots__ = ("actionCount",)
@@ -474,7 +687,11 @@ class Request_GetAction(_message.Message):
ACTIONINDEX_FIELD_NUMBER: _ClassVar[int]
sessionInfo: SessionInfo
actionIndex: int
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., actionIndex: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self,
+ sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...,
+ actionIndex: _Optional[int] = ...,
+ ) -> None: ...
class Response_GetAction(_message.Message):
__slots__ = ("actionID", "actionClassID", "actionParameters")
@@ -484,7 +701,12 @@ class Response_GetAction(_message.Message):
actionID: int
actionClassID: ActionClassID
actionParameters: ActionParameters
- def __init__(self, actionID: _Optional[int] = ..., actionClassID: _Optional[_Union[ActionClassID, str]] = ..., actionParameters: _Optional[_Union[ActionParameters, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self,
+ actionID: _Optional[int] = ...,
+ actionClassID: _Optional[_Union[ActionClassID, str]] = ...,
+ actionParameters: _Optional[_Union[ActionParameters, _Mapping]] = ...,
+ ) -> None: ...
class Request_RemoveAction(_message.Message):
__slots__ = ("sessionInfo", "actionID")
@@ -492,25 +714,35 @@ class Request_RemoveAction(_message.Message):
ACTIONID_FIELD_NUMBER: _ClassVar[int]
sessionInfo: SessionInfo
actionID: int
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., actionID: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self,
+ sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...,
+ actionID: _Optional[int] = ...,
+ ) -> None: ...
class Request_RemoveAllActions(_message.Message):
__slots__ = ("sessionInfo",)
SESSIONINFO_FIELD_NUMBER: _ClassVar[int]
sessionInfo: SessionInfo
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...
+ ) -> None: ...
class Request_StartBatchRun(_message.Message):
__slots__ = ("sessionInfo",)
SESSIONINFO_FIELD_NUMBER: _ClassVar[int]
sessionInfo: SessionInfo
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...
+ ) -> None: ...
class Request_StopBatchRun(_message.Message):
__slots__ = ("sessionInfo",)
SESSIONINFO_FIELD_NUMBER: _ClassVar[int]
sessionInfo: SessionInfo
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...
+ ) -> None: ...
class Request_CaptureScreen(_message.Message):
__slots__ = ("sessionInfo", "captureParameters")
@@ -518,7 +750,11 @@ class Request_CaptureScreen(_message.Message):
CAPTUREPARAMETERS_FIELD_NUMBER: _ClassVar[int]
sessionInfo: SessionInfo
captureParameters: CaptureParameters
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., captureParameters: _Optional[_Union[CaptureParameters, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self,
+ sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...,
+ captureParameters: _Optional[_Union[CaptureParameters, _Mapping]] = ...,
+ ) -> None: ...
class Response_CaptureScreen(_message.Message):
__slots__ = ("bitmap",)
@@ -533,7 +769,12 @@ class Response_GetContinuousCapturedScreen(_message.Message):
def __init__(self, bitmap: _Optional[_Union[Bitmap, _Mapping]] = ...) -> None: ...
class Reuqest_SetTestConfiguration(_message.Message):
- __slots__ = ("sessionInfo", "defaultCaptureParameters", "mouseDelayInMilliseconds", "keyboardDelayInMilliseconds")
+ __slots__ = (
+ "sessionInfo",
+ "defaultCaptureParameters",
+ "mouseDelayInMilliseconds",
+ "keyboardDelayInMilliseconds",
+ )
SESSIONINFO_FIELD_NUMBER: _ClassVar[int]
DEFAULTCAPTUREPARAMETERS_FIELD_NUMBER: _ClassVar[int]
MOUSEDELAYINMILLISECONDS_FIELD_NUMBER: _ClassVar[int]
@@ -542,7 +783,13 @@ class Reuqest_SetTestConfiguration(_message.Message):
defaultCaptureParameters: CaptureParameters
mouseDelayInMilliseconds: int
keyboardDelayInMilliseconds: int
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., defaultCaptureParameters: _Optional[_Union[CaptureParameters, _Mapping]] = ..., mouseDelayInMilliseconds: _Optional[int] = ..., keyboardDelayInMilliseconds: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self,
+ sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...,
+ defaultCaptureParameters: _Optional[_Union[CaptureParameters, _Mapping]] = ...,
+ mouseDelayInMilliseconds: _Optional[int] = ...,
+ keyboardDelayInMilliseconds: _Optional[int] = ...,
+ ) -> None: ...
class Request_SetMouseDelay(_message.Message):
__slots__ = ("sessionInfo", "delayInMilliseconds")
@@ -550,7 +797,11 @@ class Request_SetMouseDelay(_message.Message):
DELAYINMILLISECONDS_FIELD_NUMBER: _ClassVar[int]
sessionInfo: SessionInfo
delayInMilliseconds: int
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., delayInMilliseconds: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self,
+ sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...,
+ delayInMilliseconds: _Optional[int] = ...,
+ ) -> None: ...
class Request_SetKeyboardDelay(_message.Message):
__slots__ = ("sessionInfo", "delayInMilliseconds")
@@ -558,7 +809,11 @@ class Request_SetKeyboardDelay(_message.Message):
DELAYINMILLISECONDS_FIELD_NUMBER: _ClassVar[int]
sessionInfo: SessionInfo
delayInMilliseconds: int
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., delayInMilliseconds: _Optional[int] = ...) -> None: ...
+ def __init__(
+ self,
+ sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...,
+ delayInMilliseconds: _Optional[int] = ...,
+ ) -> None: ...
class DisplayInformation(_message.Message):
__slots__ = ("displayID", "name", "sizeInPixels", "virtualScreenRectangle")
@@ -570,7 +825,13 @@ class DisplayInformation(_message.Message):
name: str
sizeInPixels: Size2
virtualScreenRectangle: Rectangle
- def __init__(self, displayID: _Optional[int] = ..., name: _Optional[str] = ..., sizeInPixels: _Optional[_Union[Size2, _Mapping]] = ..., virtualScreenRectangle: _Optional[_Union[Rectangle, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self,
+ displayID: _Optional[int] = ...,
+ name: _Optional[str] = ...,
+ sizeInPixels: _Optional[_Union[Size2, _Mapping]] = ...,
+ virtualScreenRectangle: _Optional[_Union[Rectangle, _Mapping]] = ...,
+ ) -> None: ...
class Response_GetDisplayInformation(_message.Message):
__slots__ = ("displays", "virtualScreenRectangle")
@@ -578,7 +839,11 @@ class Response_GetDisplayInformation(_message.Message):
VIRTUALSCREENRECTANGLE_FIELD_NUMBER: _ClassVar[int]
displays: _containers.RepeatedCompositeFieldContainer[DisplayInformation]
virtualScreenRectangle: Rectangle
- def __init__(self, displays: _Optional[_Iterable[_Union[DisplayInformation, _Mapping]]] = ..., virtualScreenRectangle: _Optional[_Union[Rectangle, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self,
+ displays: _Optional[_Iterable[_Union[DisplayInformation, _Mapping]]] = ...,
+ virtualScreenRectangle: _Optional[_Union[Rectangle, _Mapping]] = ...,
+ ) -> None: ...
class Response_GetMousePosition(_message.Message):
__slots__ = ("x", "y")
@@ -602,7 +867,12 @@ class Request_GetColor(_message.Message):
x: int
y: int
bitmap: Bitmap
- def __init__(self, x: _Optional[int] = ..., y: _Optional[int] = ..., bitmap: _Optional[_Union[Bitmap, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self,
+ x: _Optional[int] = ...,
+ y: _Optional[int] = ...,
+ bitmap: _Optional[_Union[Bitmap, _Mapping]] = ...,
+ ) -> None: ...
class Response_GetColor(_message.Message):
__slots__ = ("color",)
@@ -632,4 +902,9 @@ class Request_SetDisplayLabel(_message.Message):
sessionInfo: SessionInfo
displayID: int
label: str
- def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., displayID: _Optional[int] = ..., label: _Optional[str] = ...) -> None: ...
+ def __init__(
+ self,
+ sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...,
+ displayID: _Optional[int] = ...,
+ label: _Optional[str] = ...,
+ ) -> None: ...
diff --git a/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2_grpc.py b/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2_grpc.py
index f7ef8d00..ecac6ac1 100644
--- a/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2_grpc.py
+++ b/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2_grpc.py
@@ -1,32 +1,37 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
-import grpc
+
import warnings
+import grpc
+
import askui.tools.askui.askui_ui_controller_grpc.Controller_V1_pb2 as Controller__V1__pb2
-GRPC_GENERATED_VERSION = '1.64.1'
+GRPC_GENERATED_VERSION = "1.64.1"
GRPC_VERSION = grpc.__version__
-EXPECTED_ERROR_RELEASE = '1.65.0'
-SCHEDULED_RELEASE_DATE = 'June 25, 2024'
+EXPECTED_ERROR_RELEASE = "1.65.0"
+SCHEDULED_RELEASE_DATE = "June 25, 2024"
_version_not_supported = False
try:
from grpc._utilities import first_version_is_lower
- _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
+
+ _version_not_supported = first_version_is_lower(
+ GRPC_VERSION, GRPC_GENERATED_VERSION
+ )
except ImportError:
_version_not_supported = True
if _version_not_supported:
warnings.warn(
- f'The grpc package installed is at version {GRPC_VERSION},'
- + f' but the generated code in Controller_V1_pb2_grpc.py depends on'
- + f' grpcio>={GRPC_GENERATED_VERSION}.'
- + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
- + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
- + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
- + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
- RuntimeWarning
+ f"The grpc package installed is at version {GRPC_VERSION},"
+ + " but the generated code in Controller_V1_pb2_grpc.py depends on"
+ + f" grpcio>={GRPC_GENERATED_VERSION}."
+ + f" Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}"
+ + f" or downgrade your generated code using grpcio-tools<={GRPC_VERSION}."
+ + f" This warning will become an error in {EXPECTED_ERROR_RELEASE},"
+ + f" scheduled for release on {SCHEDULED_RELEASE_DATE}.",
+ RuntimeWarning,
)
@@ -40,419 +45,435 @@ def __init__(self, channel):
channel: A grpc.Channel.
"""
self.StartSession = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/StartSession',
- request_serializer=Controller__V1__pb2.Request_StartSession.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_StartSession.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/StartSession",
+ request_serializer=Controller__V1__pb2.Request_StartSession.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_StartSession.FromString,
+ _registered_method=True,
+ )
self.EndSession = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/EndSession',
- request_serializer=Controller__V1__pb2.Request_EndSession.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_Void.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/EndSession",
+ request_serializer=Controller__V1__pb2.Request_EndSession.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_Void.FromString,
+ _registered_method=True,
+ )
self.Poll = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/Poll',
- request_serializer=Controller__V1__pb2.Request_Poll.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_Poll.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/Poll",
+ request_serializer=Controller__V1__pb2.Request_Poll.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_Poll.FromString,
+ _registered_method=True,
+ )
self.StartExecution = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/StartExecution',
- request_serializer=Controller__V1__pb2.Request_StartExecution.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_Void.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/StartExecution",
+ request_serializer=Controller__V1__pb2.Request_StartExecution.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_Void.FromString,
+ _registered_method=True,
+ )
self.StopExecution = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/StopExecution',
- request_serializer=Controller__V1__pb2.Request_StopExecution.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_Void.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/StopExecution",
+ request_serializer=Controller__V1__pb2.Request_StopExecution.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_Void.FromString,
+ _registered_method=True,
+ )
self.RunRecordedAction = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/RunRecordedAction',
- request_serializer=Controller__V1__pb2.Request_RunRecordedAction.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_RunRecordedAction.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/RunRecordedAction",
+ request_serializer=Controller__V1__pb2.Request_RunRecordedAction.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_RunRecordedAction.FromString,
+ _registered_method=True,
+ )
self.ScheduleBatchedAction = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/ScheduleBatchedAction',
- request_serializer=Controller__V1__pb2.Request_ScheduleBatchedAction.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_ScheduleBatchedAction.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/ScheduleBatchedAction",
+ request_serializer=Controller__V1__pb2.Request_ScheduleBatchedAction.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_ScheduleBatchedAction.FromString,
+ _registered_method=True,
+ )
self.StartBatchRun = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/StartBatchRun',
- request_serializer=Controller__V1__pb2.Request_StartBatchRun.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_Void.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/StartBatchRun",
+ request_serializer=Controller__V1__pb2.Request_StartBatchRun.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_Void.FromString,
+ _registered_method=True,
+ )
self.StopBatchRun = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/StopBatchRun',
- request_serializer=Controller__V1__pb2.Request_StopBatchRun.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_Void.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/StopBatchRun",
+ request_serializer=Controller__V1__pb2.Request_StopBatchRun.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_Void.FromString,
+ _registered_method=True,
+ )
self.GetActionCount = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/GetActionCount',
- request_serializer=Controller__V1__pb2.Request_GetActionCount.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_GetActionCount.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/GetActionCount",
+ request_serializer=Controller__V1__pb2.Request_GetActionCount.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_GetActionCount.FromString,
+ _registered_method=True,
+ )
self.GetAction = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/GetAction',
- request_serializer=Controller__V1__pb2.Request_GetAction.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_GetAction.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/GetAction",
+ request_serializer=Controller__V1__pb2.Request_GetAction.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_GetAction.FromString,
+ _registered_method=True,
+ )
self.RemoveAction = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/RemoveAction',
- request_serializer=Controller__V1__pb2.Request_RemoveAction.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_Void.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/RemoveAction",
+ request_serializer=Controller__V1__pb2.Request_RemoveAction.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_Void.FromString,
+ _registered_method=True,
+ )
self.RemoveAllActions = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/RemoveAllActions',
- request_serializer=Controller__V1__pb2.Request_RemoveAllActions.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_Void.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/RemoveAllActions",
+ request_serializer=Controller__V1__pb2.Request_RemoveAllActions.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_Void.FromString,
+ _registered_method=True,
+ )
self.CaptureScreen = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/CaptureScreen',
- request_serializer=Controller__V1__pb2.Request_CaptureScreen.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_CaptureScreen.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/CaptureScreen",
+ request_serializer=Controller__V1__pb2.Request_CaptureScreen.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_CaptureScreen.FromString,
+ _registered_method=True,
+ )
self.SetTestConfiguration = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/SetTestConfiguration',
- request_serializer=Controller__V1__pb2.Reuqest_SetTestConfiguration.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_Void.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/SetTestConfiguration",
+ request_serializer=Controller__V1__pb2.Reuqest_SetTestConfiguration.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_Void.FromString,
+ _registered_method=True,
+ )
self.SetMouseDelay = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/SetMouseDelay',
- request_serializer=Controller__V1__pb2.Request_SetMouseDelay.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_Void.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/SetMouseDelay",
+ request_serializer=Controller__V1__pb2.Request_SetMouseDelay.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_Void.FromString,
+ _registered_method=True,
+ )
self.SetKeyboardDelay = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/SetKeyboardDelay',
- request_serializer=Controller__V1__pb2.Request_SetKeyboardDelay.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_Void.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/SetKeyboardDelay",
+ request_serializer=Controller__V1__pb2.Request_SetKeyboardDelay.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_Void.FromString,
+ _registered_method=True,
+ )
self.GetDisplayInformation = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/GetDisplayInformation',
- request_serializer=Controller__V1__pb2.Request_Void.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_GetDisplayInformation.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/GetDisplayInformation",
+ request_serializer=Controller__V1__pb2.Request_Void.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_GetDisplayInformation.FromString,
+ _registered_method=True,
+ )
self.GetMousePosition = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/GetMousePosition',
- request_serializer=Controller__V1__pb2.Request_Void.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_GetMousePosition.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/GetMousePosition",
+ request_serializer=Controller__V1__pb2.Request_Void.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_GetMousePosition.FromString,
+ _registered_method=True,
+ )
self.SetActiveDisplay = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/SetActiveDisplay',
- request_serializer=Controller__V1__pb2.Request_SetActiveDisplay.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_Void.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/SetActiveDisplay",
+ request_serializer=Controller__V1__pb2.Request_SetActiveDisplay.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_Void.FromString,
+ _registered_method=True,
+ )
self.GetColor = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/GetColor',
- request_serializer=Controller__V1__pb2.Request_GetColor.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_GetColor.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/GetColor",
+ request_serializer=Controller__V1__pb2.Request_GetColor.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_GetColor.FromString,
+ _registered_method=True,
+ )
self.GetPixelColor = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/GetPixelColor',
- request_serializer=Controller__V1__pb2.Request_GetPixelColor.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_GetPixelColor.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/GetPixelColor",
+ request_serializer=Controller__V1__pb2.Request_GetPixelColor.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_GetPixelColor.FromString,
+ _registered_method=True,
+ )
self.SetDisplayLabel = channel.unary_unary(
- '/Askui.API.TDKv1.ControllerAPI/SetDisplayLabel',
- request_serializer=Controller__V1__pb2.Request_SetDisplayLabel.SerializeToString,
- response_deserializer=Controller__V1__pb2.Response_Void.FromString,
- _registered_method=True)
+ "/Askui.API.TDKv1.ControllerAPI/SetDisplayLabel",
+ request_serializer=Controller__V1__pb2.Request_SetDisplayLabel.SerializeToString,
+ response_deserializer=Controller__V1__pb2.Response_Void.FromString,
+ _registered_method=True,
+ )
class ControllerAPIServicer(object):
"""Missing associated documentation comment in .proto file."""
def StartSession(self, request, context):
- """General
- """
+ """General"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def EndSession(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def Poll(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def StartExecution(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def StopExecution(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def RunRecordedAction(self, request, context):
- """Run action and record it
- """
+ """Run action and record it"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def ScheduleBatchedAction(self, request, context):
- """Schedule an action
- """
+ """Schedule an action"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def StartBatchRun(self, request, context):
- """Start and stop batched execution
- """
+ """Start and stop batched execution"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def StopBatchRun(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def GetActionCount(self, request, context):
- """Recorded or batched actions access
- """
+ """Recorded or batched actions access"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def GetAction(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def RemoveAction(self, request, context):
- """Modify acvtions batch
- """
+ """Modify acvtions batch"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def RemoveAllActions(self, request, context):
- """Clear all batched or recorded actions
- """
+ """Clear all batched or recorded actions"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def CaptureScreen(self, request, context):
- """Capturing
- """
+ """Capturing"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def SetTestConfiguration(self, request, context):
- """Configuration
- """
+ """Configuration"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def SetMouseDelay(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def SetKeyboardDelay(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def GetDisplayInformation(self, request, context):
- """Device Information
- """
+ """Device Information"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def GetMousePosition(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def SetActiveDisplay(self, request, context):
- """Device Configuration
- """
+ """Device Configuration"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def GetColor(self, request, context):
- """Deprecated Utilities
- """
+ """Deprecated Utilities"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def GetPixelColor(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def SetDisplayLabel(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
+ context.set_details("Method not implemented!")
+ raise NotImplementedError("Method not implemented!")
def add_ControllerAPIServicer_to_server(servicer, server):
rpc_method_handlers = {
- 'StartSession': grpc.unary_unary_rpc_method_handler(
- servicer.StartSession,
- request_deserializer=Controller__V1__pb2.Request_StartSession.FromString,
- response_serializer=Controller__V1__pb2.Response_StartSession.SerializeToString,
- ),
- 'EndSession': grpc.unary_unary_rpc_method_handler(
- servicer.EndSession,
- request_deserializer=Controller__V1__pb2.Request_EndSession.FromString,
- response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
- ),
- 'Poll': grpc.unary_unary_rpc_method_handler(
- servicer.Poll,
- request_deserializer=Controller__V1__pb2.Request_Poll.FromString,
- response_serializer=Controller__V1__pb2.Response_Poll.SerializeToString,
- ),
- 'StartExecution': grpc.unary_unary_rpc_method_handler(
- servicer.StartExecution,
- request_deserializer=Controller__V1__pb2.Request_StartExecution.FromString,
- response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
- ),
- 'StopExecution': grpc.unary_unary_rpc_method_handler(
- servicer.StopExecution,
- request_deserializer=Controller__V1__pb2.Request_StopExecution.FromString,
- response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
- ),
- 'RunRecordedAction': grpc.unary_unary_rpc_method_handler(
- servicer.RunRecordedAction,
- request_deserializer=Controller__V1__pb2.Request_RunRecordedAction.FromString,
- response_serializer=Controller__V1__pb2.Response_RunRecordedAction.SerializeToString,
- ),
- 'ScheduleBatchedAction': grpc.unary_unary_rpc_method_handler(
- servicer.ScheduleBatchedAction,
- request_deserializer=Controller__V1__pb2.Request_ScheduleBatchedAction.FromString,
- response_serializer=Controller__V1__pb2.Response_ScheduleBatchedAction.SerializeToString,
- ),
- 'StartBatchRun': grpc.unary_unary_rpc_method_handler(
- servicer.StartBatchRun,
- request_deserializer=Controller__V1__pb2.Request_StartBatchRun.FromString,
- response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
- ),
- 'StopBatchRun': grpc.unary_unary_rpc_method_handler(
- servicer.StopBatchRun,
- request_deserializer=Controller__V1__pb2.Request_StopBatchRun.FromString,
- response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
- ),
- 'GetActionCount': grpc.unary_unary_rpc_method_handler(
- servicer.GetActionCount,
- request_deserializer=Controller__V1__pb2.Request_GetActionCount.FromString,
- response_serializer=Controller__V1__pb2.Response_GetActionCount.SerializeToString,
- ),
- 'GetAction': grpc.unary_unary_rpc_method_handler(
- servicer.GetAction,
- request_deserializer=Controller__V1__pb2.Request_GetAction.FromString,
- response_serializer=Controller__V1__pb2.Response_GetAction.SerializeToString,
- ),
- 'RemoveAction': grpc.unary_unary_rpc_method_handler(
- servicer.RemoveAction,
- request_deserializer=Controller__V1__pb2.Request_RemoveAction.FromString,
- response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
- ),
- 'RemoveAllActions': grpc.unary_unary_rpc_method_handler(
- servicer.RemoveAllActions,
- request_deserializer=Controller__V1__pb2.Request_RemoveAllActions.FromString,
- response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
- ),
- 'CaptureScreen': grpc.unary_unary_rpc_method_handler(
- servicer.CaptureScreen,
- request_deserializer=Controller__V1__pb2.Request_CaptureScreen.FromString,
- response_serializer=Controller__V1__pb2.Response_CaptureScreen.SerializeToString,
- ),
- 'SetTestConfiguration': grpc.unary_unary_rpc_method_handler(
- servicer.SetTestConfiguration,
- request_deserializer=Controller__V1__pb2.Reuqest_SetTestConfiguration.FromString,
- response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
- ),
- 'SetMouseDelay': grpc.unary_unary_rpc_method_handler(
- servicer.SetMouseDelay,
- request_deserializer=Controller__V1__pb2.Request_SetMouseDelay.FromString,
- response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
- ),
- 'SetKeyboardDelay': grpc.unary_unary_rpc_method_handler(
- servicer.SetKeyboardDelay,
- request_deserializer=Controller__V1__pb2.Request_SetKeyboardDelay.FromString,
- response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
- ),
- 'GetDisplayInformation': grpc.unary_unary_rpc_method_handler(
- servicer.GetDisplayInformation,
- request_deserializer=Controller__V1__pb2.Request_Void.FromString,
- response_serializer=Controller__V1__pb2.Response_GetDisplayInformation.SerializeToString,
- ),
- 'GetMousePosition': grpc.unary_unary_rpc_method_handler(
- servicer.GetMousePosition,
- request_deserializer=Controller__V1__pb2.Request_Void.FromString,
- response_serializer=Controller__V1__pb2.Response_GetMousePosition.SerializeToString,
- ),
- 'SetActiveDisplay': grpc.unary_unary_rpc_method_handler(
- servicer.SetActiveDisplay,
- request_deserializer=Controller__V1__pb2.Request_SetActiveDisplay.FromString,
- response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
- ),
- 'GetColor': grpc.unary_unary_rpc_method_handler(
- servicer.GetColor,
- request_deserializer=Controller__V1__pb2.Request_GetColor.FromString,
- response_serializer=Controller__V1__pb2.Response_GetColor.SerializeToString,
- ),
- 'GetPixelColor': grpc.unary_unary_rpc_method_handler(
- servicer.GetPixelColor,
- request_deserializer=Controller__V1__pb2.Request_GetPixelColor.FromString,
- response_serializer=Controller__V1__pb2.Response_GetPixelColor.SerializeToString,
- ),
- 'SetDisplayLabel': grpc.unary_unary_rpc_method_handler(
- servicer.SetDisplayLabel,
- request_deserializer=Controller__V1__pb2.Request_SetDisplayLabel.FromString,
- response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
- ),
+ "StartSession": grpc.unary_unary_rpc_method_handler(
+ servicer.StartSession,
+ request_deserializer=Controller__V1__pb2.Request_StartSession.FromString,
+ response_serializer=Controller__V1__pb2.Response_StartSession.SerializeToString,
+ ),
+ "EndSession": grpc.unary_unary_rpc_method_handler(
+ servicer.EndSession,
+ request_deserializer=Controller__V1__pb2.Request_EndSession.FromString,
+ response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
+ ),
+ "Poll": grpc.unary_unary_rpc_method_handler(
+ servicer.Poll,
+ request_deserializer=Controller__V1__pb2.Request_Poll.FromString,
+ response_serializer=Controller__V1__pb2.Response_Poll.SerializeToString,
+ ),
+ "StartExecution": grpc.unary_unary_rpc_method_handler(
+ servicer.StartExecution,
+ request_deserializer=Controller__V1__pb2.Request_StartExecution.FromString,
+ response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
+ ),
+ "StopExecution": grpc.unary_unary_rpc_method_handler(
+ servicer.StopExecution,
+ request_deserializer=Controller__V1__pb2.Request_StopExecution.FromString,
+ response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
+ ),
+ "RunRecordedAction": grpc.unary_unary_rpc_method_handler(
+ servicer.RunRecordedAction,
+ request_deserializer=Controller__V1__pb2.Request_RunRecordedAction.FromString,
+ response_serializer=Controller__V1__pb2.Response_RunRecordedAction.SerializeToString,
+ ),
+ "ScheduleBatchedAction": grpc.unary_unary_rpc_method_handler(
+ servicer.ScheduleBatchedAction,
+ request_deserializer=Controller__V1__pb2.Request_ScheduleBatchedAction.FromString,
+ response_serializer=Controller__V1__pb2.Response_ScheduleBatchedAction.SerializeToString,
+ ),
+ "StartBatchRun": grpc.unary_unary_rpc_method_handler(
+ servicer.StartBatchRun,
+ request_deserializer=Controller__V1__pb2.Request_StartBatchRun.FromString,
+ response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
+ ),
+ "StopBatchRun": grpc.unary_unary_rpc_method_handler(
+ servicer.StopBatchRun,
+ request_deserializer=Controller__V1__pb2.Request_StopBatchRun.FromString,
+ response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
+ ),
+ "GetActionCount": grpc.unary_unary_rpc_method_handler(
+ servicer.GetActionCount,
+ request_deserializer=Controller__V1__pb2.Request_GetActionCount.FromString,
+ response_serializer=Controller__V1__pb2.Response_GetActionCount.SerializeToString,
+ ),
+ "GetAction": grpc.unary_unary_rpc_method_handler(
+ servicer.GetAction,
+ request_deserializer=Controller__V1__pb2.Request_GetAction.FromString,
+ response_serializer=Controller__V1__pb2.Response_GetAction.SerializeToString,
+ ),
+ "RemoveAction": grpc.unary_unary_rpc_method_handler(
+ servicer.RemoveAction,
+ request_deserializer=Controller__V1__pb2.Request_RemoveAction.FromString,
+ response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
+ ),
+ "RemoveAllActions": grpc.unary_unary_rpc_method_handler(
+ servicer.RemoveAllActions,
+ request_deserializer=Controller__V1__pb2.Request_RemoveAllActions.FromString,
+ response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
+ ),
+ "CaptureScreen": grpc.unary_unary_rpc_method_handler(
+ servicer.CaptureScreen,
+ request_deserializer=Controller__V1__pb2.Request_CaptureScreen.FromString,
+ response_serializer=Controller__V1__pb2.Response_CaptureScreen.SerializeToString,
+ ),
+ "SetTestConfiguration": grpc.unary_unary_rpc_method_handler(
+ servicer.SetTestConfiguration,
+ request_deserializer=Controller__V1__pb2.Reuqest_SetTestConfiguration.FromString,
+ response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
+ ),
+ "SetMouseDelay": grpc.unary_unary_rpc_method_handler(
+ servicer.SetMouseDelay,
+ request_deserializer=Controller__V1__pb2.Request_SetMouseDelay.FromString,
+ response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
+ ),
+ "SetKeyboardDelay": grpc.unary_unary_rpc_method_handler(
+ servicer.SetKeyboardDelay,
+ request_deserializer=Controller__V1__pb2.Request_SetKeyboardDelay.FromString,
+ response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
+ ),
+ "GetDisplayInformation": grpc.unary_unary_rpc_method_handler(
+ servicer.GetDisplayInformation,
+ request_deserializer=Controller__V1__pb2.Request_Void.FromString,
+ response_serializer=Controller__V1__pb2.Response_GetDisplayInformation.SerializeToString,
+ ),
+ "GetMousePosition": grpc.unary_unary_rpc_method_handler(
+ servicer.GetMousePosition,
+ request_deserializer=Controller__V1__pb2.Request_Void.FromString,
+ response_serializer=Controller__V1__pb2.Response_GetMousePosition.SerializeToString,
+ ),
+ "SetActiveDisplay": grpc.unary_unary_rpc_method_handler(
+ servicer.SetActiveDisplay,
+ request_deserializer=Controller__V1__pb2.Request_SetActiveDisplay.FromString,
+ response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
+ ),
+ "GetColor": grpc.unary_unary_rpc_method_handler(
+ servicer.GetColor,
+ request_deserializer=Controller__V1__pb2.Request_GetColor.FromString,
+ response_serializer=Controller__V1__pb2.Response_GetColor.SerializeToString,
+ ),
+ "GetPixelColor": grpc.unary_unary_rpc_method_handler(
+ servicer.GetPixelColor,
+ request_deserializer=Controller__V1__pb2.Request_GetPixelColor.FromString,
+ response_serializer=Controller__V1__pb2.Response_GetPixelColor.SerializeToString,
+ ),
+ "SetDisplayLabel": grpc.unary_unary_rpc_method_handler(
+ servicer.SetDisplayLabel,
+ request_deserializer=Controller__V1__pb2.Request_SetDisplayLabel.FromString,
+ response_serializer=Controller__V1__pb2.Response_Void.SerializeToString,
+ ),
}
generic_handler = grpc.method_handlers_generic_handler(
- 'Askui.API.TDKv1.ControllerAPI', rpc_method_handlers)
+ "Askui.API.TDKv1.ControllerAPI", rpc_method_handlers
+ )
server.add_generic_rpc_handlers((generic_handler,))
- server.add_registered_method_handlers('Askui.API.TDKv1.ControllerAPI', rpc_method_handlers)
+ server.add_registered_method_handlers(
+ "Askui.API.TDKv1.ControllerAPI", rpc_method_handlers
+ )
- # This class is part of an EXPERIMENTAL API.
+# This class is part of an EXPERIMENTAL API.
class ControllerAPI(object):
"""Missing associated documentation comment in .proto file."""
@staticmethod
- def StartSession(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def StartSession(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/StartSession',
+ "/Askui.API.TDKv1.ControllerAPI/StartSession",
Controller__V1__pb2.Request_StartSession.SerializeToString,
Controller__V1__pb2.Response_StartSession.FromString,
options,
@@ -463,23 +484,26 @@ def StartSession(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def EndSession(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def EndSession(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/EndSession',
+ "/Askui.API.TDKv1.ControllerAPI/EndSession",
Controller__V1__pb2.Request_EndSession.SerializeToString,
Controller__V1__pb2.Response_Void.FromString,
options,
@@ -490,23 +514,26 @@ def EndSession(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def Poll(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def Poll(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/Poll',
+ "/Askui.API.TDKv1.ControllerAPI/Poll",
Controller__V1__pb2.Request_Poll.SerializeToString,
Controller__V1__pb2.Response_Poll.FromString,
options,
@@ -517,23 +544,26 @@ def Poll(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def StartExecution(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def StartExecution(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/StartExecution',
+ "/Askui.API.TDKv1.ControllerAPI/StartExecution",
Controller__V1__pb2.Request_StartExecution.SerializeToString,
Controller__V1__pb2.Response_Void.FromString,
options,
@@ -544,23 +574,26 @@ def StartExecution(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def StopExecution(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def StopExecution(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/StopExecution',
+ "/Askui.API.TDKv1.ControllerAPI/StopExecution",
Controller__V1__pb2.Request_StopExecution.SerializeToString,
Controller__V1__pb2.Response_Void.FromString,
options,
@@ -571,23 +604,26 @@ def StopExecution(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def RunRecordedAction(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def RunRecordedAction(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/RunRecordedAction',
+ "/Askui.API.TDKv1.ControllerAPI/RunRecordedAction",
Controller__V1__pb2.Request_RunRecordedAction.SerializeToString,
Controller__V1__pb2.Response_RunRecordedAction.FromString,
options,
@@ -598,23 +634,26 @@ def RunRecordedAction(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def ScheduleBatchedAction(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def ScheduleBatchedAction(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/ScheduleBatchedAction',
+ "/Askui.API.TDKv1.ControllerAPI/ScheduleBatchedAction",
Controller__V1__pb2.Request_ScheduleBatchedAction.SerializeToString,
Controller__V1__pb2.Response_ScheduleBatchedAction.FromString,
options,
@@ -625,23 +664,26 @@ def ScheduleBatchedAction(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def StartBatchRun(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def StartBatchRun(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/StartBatchRun',
+ "/Askui.API.TDKv1.ControllerAPI/StartBatchRun",
Controller__V1__pb2.Request_StartBatchRun.SerializeToString,
Controller__V1__pb2.Response_Void.FromString,
options,
@@ -652,23 +694,26 @@ def StartBatchRun(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def StopBatchRun(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def StopBatchRun(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/StopBatchRun',
+ "/Askui.API.TDKv1.ControllerAPI/StopBatchRun",
Controller__V1__pb2.Request_StopBatchRun.SerializeToString,
Controller__V1__pb2.Response_Void.FromString,
options,
@@ -679,23 +724,26 @@ def StopBatchRun(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def GetActionCount(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def GetActionCount(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/GetActionCount',
+ "/Askui.API.TDKv1.ControllerAPI/GetActionCount",
Controller__V1__pb2.Request_GetActionCount.SerializeToString,
Controller__V1__pb2.Response_GetActionCount.FromString,
options,
@@ -706,23 +754,26 @@ def GetActionCount(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def GetAction(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def GetAction(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/GetAction',
+ "/Askui.API.TDKv1.ControllerAPI/GetAction",
Controller__V1__pb2.Request_GetAction.SerializeToString,
Controller__V1__pb2.Response_GetAction.FromString,
options,
@@ -733,23 +784,26 @@ def GetAction(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def RemoveAction(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def RemoveAction(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/RemoveAction',
+ "/Askui.API.TDKv1.ControllerAPI/RemoveAction",
Controller__V1__pb2.Request_RemoveAction.SerializeToString,
Controller__V1__pb2.Response_Void.FromString,
options,
@@ -760,23 +814,26 @@ def RemoveAction(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def RemoveAllActions(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def RemoveAllActions(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/RemoveAllActions',
+ "/Askui.API.TDKv1.ControllerAPI/RemoveAllActions",
Controller__V1__pb2.Request_RemoveAllActions.SerializeToString,
Controller__V1__pb2.Response_Void.FromString,
options,
@@ -787,23 +844,26 @@ def RemoveAllActions(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def CaptureScreen(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def CaptureScreen(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/CaptureScreen',
+ "/Askui.API.TDKv1.ControllerAPI/CaptureScreen",
Controller__V1__pb2.Request_CaptureScreen.SerializeToString,
Controller__V1__pb2.Response_CaptureScreen.FromString,
options,
@@ -814,23 +874,26 @@ def CaptureScreen(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def SetTestConfiguration(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def SetTestConfiguration(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/SetTestConfiguration',
+ "/Askui.API.TDKv1.ControllerAPI/SetTestConfiguration",
Controller__V1__pb2.Reuqest_SetTestConfiguration.SerializeToString,
Controller__V1__pb2.Response_Void.FromString,
options,
@@ -841,23 +904,26 @@ def SetTestConfiguration(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def SetMouseDelay(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def SetMouseDelay(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/SetMouseDelay',
+ "/Askui.API.TDKv1.ControllerAPI/SetMouseDelay",
Controller__V1__pb2.Request_SetMouseDelay.SerializeToString,
Controller__V1__pb2.Response_Void.FromString,
options,
@@ -868,23 +934,26 @@ def SetMouseDelay(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def SetKeyboardDelay(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def SetKeyboardDelay(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/SetKeyboardDelay',
+ "/Askui.API.TDKv1.ControllerAPI/SetKeyboardDelay",
Controller__V1__pb2.Request_SetKeyboardDelay.SerializeToString,
Controller__V1__pb2.Response_Void.FromString,
options,
@@ -895,23 +964,26 @@ def SetKeyboardDelay(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def GetDisplayInformation(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def GetDisplayInformation(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/GetDisplayInformation',
+ "/Askui.API.TDKv1.ControllerAPI/GetDisplayInformation",
Controller__V1__pb2.Request_Void.SerializeToString,
Controller__V1__pb2.Response_GetDisplayInformation.FromString,
options,
@@ -922,23 +994,26 @@ def GetDisplayInformation(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def GetMousePosition(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def GetMousePosition(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/GetMousePosition',
+ "/Askui.API.TDKv1.ControllerAPI/GetMousePosition",
Controller__V1__pb2.Request_Void.SerializeToString,
Controller__V1__pb2.Response_GetMousePosition.FromString,
options,
@@ -949,23 +1024,26 @@ def GetMousePosition(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def SetActiveDisplay(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def SetActiveDisplay(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/SetActiveDisplay',
+ "/Askui.API.TDKv1.ControllerAPI/SetActiveDisplay",
Controller__V1__pb2.Request_SetActiveDisplay.SerializeToString,
Controller__V1__pb2.Response_Void.FromString,
options,
@@ -976,23 +1054,26 @@ def SetActiveDisplay(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def GetColor(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def GetColor(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/GetColor',
+ "/Askui.API.TDKv1.ControllerAPI/GetColor",
Controller__V1__pb2.Request_GetColor.SerializeToString,
Controller__V1__pb2.Response_GetColor.FromString,
options,
@@ -1003,23 +1084,26 @@ def GetColor(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def GetPixelColor(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def GetPixelColor(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/GetPixelColor',
+ "/Askui.API.TDKv1.ControllerAPI/GetPixelColor",
Controller__V1__pb2.Request_GetPixelColor.SerializeToString,
Controller__V1__pb2.Response_GetPixelColor.FromString,
options,
@@ -1030,23 +1114,26 @@ def GetPixelColor(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
@staticmethod
- def SetDisplayLabel(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
+ def SetDisplayLabel(
+ request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None,
+ ):
return grpc.experimental.unary_unary(
request,
target,
- '/Askui.API.TDKv1.ControllerAPI/SetDisplayLabel',
+ "/Askui.API.TDKv1.ControllerAPI/SetDisplayLabel",
Controller__V1__pb2.Request_SetDisplayLabel.SerializeToString,
Controller__V1__pb2.Response_Void.FromString,
options,
@@ -1057,4 +1144,5 @@ def SetDisplayLabel(request,
wait_for_ready,
timeout,
metadata,
- _registered_method=True)
+ _registered_method=True,
+ )
diff --git a/src/askui/tools/askui/askui_workspaces/__init__.py b/src/askui/tools/askui/askui_workspaces/__init__.py
index 190ef187..521b1f2a 100644
--- a/src/askui/tools/askui/askui_workspaces/__init__.py
+++ b/src/askui/tools/askui/askui_workspaces/__init__.py
@@ -3,22 +3,23 @@
# flake8: noqa
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
__version__ = "0.1.2"
# import apis into sdk package
from askui.tools.askui.askui_workspaces.api.access_tokens_api import AccessTokensApi
-from askui.tools.askui.askui_workspaces.api.agent_executions_api import AgentExecutionsApi
+from askui.tools.askui.askui_workspaces.api.agent_executions_api import (
+ AgentExecutionsApi,
+)
from askui.tools.askui.askui_workspaces.api.agents_api import AgentsApi
from askui.tools.askui.askui_workspaces.api.billing_api import BillingApi
from askui.tools.askui.askui_workspaces.api.files_api import FilesApi
@@ -27,7 +28,9 @@
from askui.tools.askui.askui_workspaces.api.schedules_api import SchedulesApi
from askui.tools.askui.askui_workspaces.api.tools_api import ToolsApi
from askui.tools.askui.askui_workspaces.api.usage_api import UsageApi
-from askui.tools.askui.askui_workspaces.api.workspace_memberships_api import WorkspaceMembershipsApi
+from askui.tools.askui.askui_workspaces.api.workspace_memberships_api import (
+ WorkspaceMembershipsApi,
+)
from askui.tools.askui.askui_workspaces.api.workspaces_api import WorkspacesApi
# import ApiClient
@@ -42,99 +45,251 @@
from askui.tools.askui.askui_workspaces.exceptions import ApiException
# import models into sdk package
-from askui.tools.askui.askui_workspaces.models.access_token_response_dto import AccessTokenResponseDto
+from askui.tools.askui.askui_workspaces.models.access_token_response_dto import (
+ AccessTokenResponseDto,
+)
from askui.tools.askui.askui_workspaces.models.agent import Agent
-from askui.tools.askui.askui_workspaces.models.agent_create_command import AgentCreateCommand
-from askui.tools.askui.askui_workspaces.models.agent_create_command_data_destinations_inner import AgentCreateCommandDataDestinationsInner
-from askui.tools.askui.askui_workspaces.models.agent_data_destinations_inner import AgentDataDestinationsInner
+from askui.tools.askui.askui_workspaces.models.agent_create_command import (
+ AgentCreateCommand,
+)
+from askui.tools.askui.askui_workspaces.models.agent_create_command_data_destinations_inner import (
+ AgentCreateCommandDataDestinationsInner,
+)
+from askui.tools.askui.askui_workspaces.models.agent_data_destinations_inner import (
+ AgentDataDestinationsInner,
+)
from askui.tools.askui.askui_workspaces.models.agent_execution import AgentExecution
-from askui.tools.askui.askui_workspaces.models.agent_execution_cancel import AgentExecutionCancel
-from askui.tools.askui.askui_workspaces.models.agent_execution_confirm import AgentExecutionConfirm
-from askui.tools.askui.askui_workspaces.models.agent_execution_pending_review import AgentExecutionPendingReview
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_canceled import AgentExecutionStateCanceled
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_confirmed import AgentExecutionStateConfirmed
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input import AgentExecutionStateDeliveredToDestinationInput
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input_deliveries_inner import AgentExecutionStateDeliveredToDestinationInputDeliveriesInner
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_output import AgentExecutionStateDeliveredToDestinationOutput
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_data_extraction import AgentExecutionStatePendingDataExtraction
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_inputs import AgentExecutionStatePendingInputs
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_review import AgentExecutionStatePendingReview
-from askui.tools.askui.askui_workspaces.models.agent_execution_update_command import AgentExecutionUpdateCommand
-from askui.tools.askui.askui_workspaces.models.agent_executions_list_response import AgentExecutionsListResponse
-from askui.tools.askui.askui_workspaces.models.agent_update_command import AgentUpdateCommand
-from askui.tools.askui.askui_workspaces.models.agents_list_response import AgentsListResponse
+from askui.tools.askui.askui_workspaces.models.agent_execution_cancel import (
+ AgentExecutionCancel,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_confirm import (
+ AgentExecutionConfirm,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_pending_review import (
+ AgentExecutionPendingReview,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_canceled import (
+ AgentExecutionStateCanceled,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_confirmed import (
+ AgentExecutionStateConfirmed,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input import (
+ AgentExecutionStateDeliveredToDestinationInput,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input_deliveries_inner import (
+ AgentExecutionStateDeliveredToDestinationInputDeliveriesInner,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_output import (
+ AgentExecutionStateDeliveredToDestinationOutput,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_data_extraction import (
+ AgentExecutionStatePendingDataExtraction,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_inputs import (
+ AgentExecutionStatePendingInputs,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_review import (
+ AgentExecutionStatePendingReview,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_update_command import (
+ AgentExecutionUpdateCommand,
+)
+from askui.tools.askui.askui_workspaces.models.agent_executions_list_response import (
+ AgentExecutionsListResponse,
+)
+from askui.tools.askui.askui_workspaces.models.agent_update_command import (
+ AgentUpdateCommand,
+)
+from askui.tools.askui.askui_workspaces.models.agents_list_response import (
+ AgentsListResponse,
+)
from askui.tools.askui.askui_workspaces.models.ask_ui_runner_host import AskUiRunnerHost
-from askui.tools.askui.askui_workspaces.models.complete_runner_job_request_dto import CompleteRunnerJobRequestDto
-from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_request_dto import CreateCustomerPortalSessionRequestDto
-from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_response_dto import CreateCustomerPortalSessionResponseDto
-from askui.tools.askui.askui_workspaces.models.create_schedule_request_dto import CreateScheduleRequestDto
-from askui.tools.askui.askui_workspaces.models.create_schedule_response_dto import CreateScheduleResponseDto
-from askui.tools.askui.askui_workspaces.models.create_subject_access_token_command import CreateSubjectAccessTokenCommand
-from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_input import CreateSubjectAccessTokenResponseDtoInput
-from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_output import CreateSubjectAccessTokenResponseDtoOutput
-from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_request_dto import CreateWorkspaceAccessTokenRequestDto
-from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_response_dto import CreateWorkspaceAccessTokenResponseDto
-from askui.tools.askui.askui_workspaces.models.create_workspace_membership_request_dto import CreateWorkspaceMembershipRequestDto
-from askui.tools.askui.askui_workspaces.models.create_workspace_membership_response_dto import CreateWorkspaceMembershipResponseDto
-from askui.tools.askui.askui_workspaces.models.create_workspace_request_dto import CreateWorkspaceRequestDto
-from askui.tools.askui.askui_workspaces.models.create_workspace_response_dto import CreateWorkspaceResponseDto
-from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow import DataDestinationAskUiWorkflow
-from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow_create import DataDestinationAskUiWorkflowCreate
-from askui.tools.askui.askui_workspaces.models.data_destination_delivery_ask_ui_workflow import DataDestinationDeliveryAskUiWorkflow
-from askui.tools.askui.askui_workspaces.models.data_destination_delivery_webhook import DataDestinationDeliveryWebhook
-from askui.tools.askui.askui_workspaces.models.data_destination_webhook import DataDestinationWebhook
-from askui.tools.askui.askui_workspaces.models.data_destination_webhook_create import DataDestinationWebhookCreate
-from askui.tools.askui.askui_workspaces.models.email_agent_trigger import EmailAgentTrigger
-from askui.tools.askui.askui_workspaces.models.email_agent_trigger_create import EmailAgentTriggerCreate
-from askui.tools.askui.askui_workspaces.models.email_agent_trigger_update import EmailAgentTriggerUpdate
-from askui.tools.askui.askui_workspaces.models.extract_data_command import ExtractDataCommand
-from askui.tools.askui.askui_workspaces.models.extract_data_response import ExtractDataResponse
+from askui.tools.askui.askui_workspaces.models.complete_runner_job_request_dto import (
+ CompleteRunnerJobRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_request_dto import (
+ CreateCustomerPortalSessionRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_response_dto import (
+ CreateCustomerPortalSessionResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_schedule_request_dto import (
+ CreateScheduleRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_schedule_response_dto import (
+ CreateScheduleResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_subject_access_token_command import (
+ CreateSubjectAccessTokenCommand,
+)
+from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_input import (
+ CreateSubjectAccessTokenResponseDtoInput,
+)
+from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_output import (
+ CreateSubjectAccessTokenResponseDtoOutput,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_request_dto import (
+ CreateWorkspaceAccessTokenRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_response_dto import (
+ CreateWorkspaceAccessTokenResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_membership_request_dto import (
+ CreateWorkspaceMembershipRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_membership_response_dto import (
+ CreateWorkspaceMembershipResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_request_dto import (
+ CreateWorkspaceRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_response_dto import (
+ CreateWorkspaceResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow import (
+ DataDestinationAskUiWorkflow,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow_create import (
+ DataDestinationAskUiWorkflowCreate,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_delivery_ask_ui_workflow import (
+ DataDestinationDeliveryAskUiWorkflow,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_delivery_webhook import (
+ DataDestinationDeliveryWebhook,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_webhook import (
+ DataDestinationWebhook,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_webhook_create import (
+ DataDestinationWebhookCreate,
+)
+from askui.tools.askui.askui_workspaces.models.email_agent_trigger import (
+ EmailAgentTrigger,
+)
+from askui.tools.askui.askui_workspaces.models.email_agent_trigger_create import (
+ EmailAgentTriggerCreate,
+)
+from askui.tools.askui.askui_workspaces.models.email_agent_trigger_update import (
+ EmailAgentTriggerUpdate,
+)
+from askui.tools.askui.askui_workspaces.models.extract_data_command import (
+ ExtractDataCommand,
+)
+from askui.tools.askui.askui_workspaces.models.extract_data_response import (
+ ExtractDataResponse,
+)
from askui.tools.askui.askui_workspaces.models.file_dto import FileDto
-from askui.tools.askui.askui_workspaces.models.files_list_response_dto import FilesListResponseDto
-from askui.tools.askui.askui_workspaces.models.files_list_response_dto_data_inner import FilesListResponseDtoDataInner
+from askui.tools.askui.askui_workspaces.models.files_list_response_dto import (
+ FilesListResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.files_list_response_dto_data_inner import (
+ FilesListResponseDtoDataInner,
+)
from askui.tools.askui.askui_workspaces.models.folder_dto import FolderDto
-from askui.tools.askui.askui_workspaces.models.generate_signed_cookies_command import GenerateSignedCookiesCommand
-from askui.tools.askui.askui_workspaces.models.get_subscription_response_dto import GetSubscriptionResponseDto
-from askui.tools.askui.askui_workspaces.models.http_validation_error import HTTPValidationError
+from askui.tools.askui.askui_workspaces.models.generate_signed_cookies_command import (
+ GenerateSignedCookiesCommand,
+)
+from askui.tools.askui.askui_workspaces.models.get_subscription_response_dto import (
+ GetSubscriptionResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.http_validation_error import (
+ HTTPValidationError,
+)
from askui.tools.askui.askui_workspaces.models.json_schema import JsonSchema
-from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto import LeaseRunnerJobResponseDto
-from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data import LeaseRunnerJobResponseDtoData
-from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data_credentials import LeaseRunnerJobResponseDtoDataCredentials
-from askui.tools.askui.askui_workspaces.models.list_access_token_response_dto import ListAccessTokenResponseDto
-from askui.tools.askui.askui_workspaces.models.list_runs_response_dto import ListRunsResponseDto
-from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_input import ListSubjectAccessTokensResponseDtoInput
-from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_output import ListSubjectAccessTokensResponseDtoOutput
-from askui.tools.askui.askui_workspaces.models.lookup_access_token_command import LookupAccessTokenCommand
-from askui.tools.askui.askui_workspaces.models.lookup_access_token_response_dto import LookupAccessTokenResponseDto
-from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_command import LookupWorkspaceAccessTokenCommand
-from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_response_dto import LookupWorkspaceAccessTokenResponseDto
-from askui.tools.askui.askui_workspaces.models.ping_runner_job_response_dto import PingRunnerJobResponseDto
+from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto import (
+ LeaseRunnerJobResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data import (
+ LeaseRunnerJobResponseDtoData,
+)
+from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data_credentials import (
+ LeaseRunnerJobResponseDtoDataCredentials,
+)
+from askui.tools.askui.askui_workspaces.models.list_access_token_response_dto import (
+ ListAccessTokenResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.list_runs_response_dto import (
+ ListRunsResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_input import (
+ ListSubjectAccessTokensResponseDtoInput,
+)
+from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_output import (
+ ListSubjectAccessTokensResponseDtoOutput,
+)
+from askui.tools.askui.askui_workspaces.models.lookup_access_token_command import (
+ LookupAccessTokenCommand,
+)
+from askui.tools.askui.askui_workspaces.models.lookup_access_token_response_dto import (
+ LookupAccessTokenResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_command import (
+ LookupWorkspaceAccessTokenCommand,
+)
+from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_response_dto import (
+ LookupWorkspaceAccessTokenResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.ping_runner_job_response_dto import (
+ PingRunnerJobResponseDto,
+)
from askui.tools.askui.askui_workspaces.models.run_response_dto import RunResponseDto
from askui.tools.askui.askui_workspaces.models.run_status import RunStatus
from askui.tools.askui.askui_workspaces.models.run_template import RunTemplate
from askui.tools.askui.askui_workspaces.models.runner_assignment import RunnerAssignment
from askui.tools.askui.askui_workspaces.models.runner_host import RunnerHost
from askui.tools.askui.askui_workspaces.models.runner_job_status import RunnerJobStatus
-from askui.tools.askui.askui_workspaces.models.schedule_reponse_dto import ScheduleReponseDto
+from askui.tools.askui.askui_workspaces.models.schedule_reponse_dto import (
+ ScheduleReponseDto,
+)
from askui.tools.askui.askui_workspaces.models.schedule_status import ScheduleStatus
from askui.tools.askui.askui_workspaces.models.state import State
from askui.tools.askui.askui_workspaces.models.state1 import State1
-from askui.tools.askui.askui_workspaces.models.string_error_response import StringErrorResponse
-from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_input import SubjectAccessTokenResponseDtoInput
-from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_output import SubjectAccessTokenResponseDtoOutput
-from askui.tools.askui.askui_workspaces.models.update_workspace_name_request_dto import UpdateWorkspaceNameRequestDto
-from askui.tools.askui.askui_workspaces.models.update_workspace_name_response_dto import UpdateWorkspaceNameResponseDto
-from askui.tools.askui.askui_workspaces.models.upload_file_response import UploadFileResponse
+from askui.tools.askui.askui_workspaces.models.string_error_response import (
+ StringErrorResponse,
+)
+from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_input import (
+ SubjectAccessTokenResponseDtoInput,
+)
+from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_output import (
+ SubjectAccessTokenResponseDtoOutput,
+)
+from askui.tools.askui.askui_workspaces.models.update_workspace_name_request_dto import (
+ UpdateWorkspaceNameRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.update_workspace_name_response_dto import (
+ UpdateWorkspaceNameResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.upload_file_response import (
+ UploadFileResponse,
+)
from askui.tools.askui.askui_workspaces.models.usage_event import UsageEvent
-from askui.tools.askui.askui_workspaces.models.usage_events_list_response import UsageEventsListResponse
+from askui.tools.askui.askui_workspaces.models.usage_events_list_response import (
+ UsageEventsListResponse,
+)
from askui.tools.askui.askui_workspaces.models.user_dto import UserDto
from askui.tools.askui.askui_workspaces.models.validation_error import ValidationError
-from askui.tools.askui.askui_workspaces.models.validation_error_loc_inner import ValidationErrorLocInner
+from askui.tools.askui.askui_workspaces.models.validation_error_loc_inner import (
+ ValidationErrorLocInner,
+)
from askui.tools.askui.askui_workspaces.models.webhook_response import WebhookResponse
-from askui.tools.askui.askui_workspaces.models.workspace_access_token import WorkspaceAccessToken
+from askui.tools.askui.askui_workspaces.models.workspace_access_token import (
+ WorkspaceAccessToken,
+)
from askui.tools.askui.askui_workspaces.models.workspace_dto import WorkspaceDto
-from askui.tools.askui.askui_workspaces.models.workspace_memberships_list_response import WorkspaceMembershipsListResponse
-from askui.tools.askui.askui_workspaces.models.workspace_privilege import WorkspacePrivilege
-from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto import WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto
-from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto import WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto
-from askui.tools.askui.askui_workspaces.models.workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto import WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto
+from askui.tools.askui.askui_workspaces.models.workspace_memberships_list_response import (
+ WorkspaceMembershipsListResponse,
+)
+from askui.tools.askui.askui_workspaces.models.workspace_privilege import (
+ WorkspacePrivilege,
+)
+from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto import (
+ WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto,
+)
+from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto import (
+ WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto,
+)
+from askui.tools.askui.askui_workspaces.models.workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto import (
+ WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto,
+)
diff --git a/src/askui/tools/askui/askui_workspaces/api/__init__.py b/src/askui/tools/askui/askui_workspaces/api/__init__.py
index f39c60c1..4fd127ff 100644
--- a/src/askui/tools/askui/askui_workspaces/api/__init__.py
+++ b/src/askui/tools/askui/askui_workspaces/api/__init__.py
@@ -2,7 +2,9 @@
# import apis into api package
from askui.tools.askui.askui_workspaces.api.access_tokens_api import AccessTokensApi
-from askui.tools.askui.askui_workspaces.api.agent_executions_api import AgentExecutionsApi
+from askui.tools.askui.askui_workspaces.api.agent_executions_api import (
+ AgentExecutionsApi,
+)
from askui.tools.askui.askui_workspaces.api.agents_api import AgentsApi
from askui.tools.askui.askui_workspaces.api.billing_api import BillingApi
from askui.tools.askui.askui_workspaces.api.files_api import FilesApi
@@ -11,6 +13,7 @@
from askui.tools.askui.askui_workspaces.api.schedules_api import SchedulesApi
from askui.tools.askui.askui_workspaces.api.tools_api import ToolsApi
from askui.tools.askui.askui_workspaces.api.usage_api import UsageApi
-from askui.tools.askui.askui_workspaces.api.workspace_memberships_api import WorkspaceMembershipsApi
+from askui.tools.askui.askui_workspaces.api.workspace_memberships_api import (
+ WorkspaceMembershipsApi,
+)
from askui.tools.askui.askui_workspaces.api.workspaces_api import WorkspacesApi
-
diff --git a/src/askui/tools/askui/askui_workspaces/api/access_tokens_api.py b/src/askui/tools/askui/askui_workspaces/api/access_tokens_api.py
index 560bac3c..3a427691 100644
--- a/src/askui/tools/askui/askui_workspaces/api/access_tokens_api.py
+++ b/src/askui/tools/askui/askui_workspaces/api/access_tokens_api.py
@@ -1,37 +1,53 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-import warnings
-from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
-from typing_extensions import Annotated
-from pydantic import Field, StrictStr
-from typing import List, Optional
+from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
from typing_extensions import Annotated
-from askui.tools.askui.askui_workspaces.models.create_subject_access_token_command import CreateSubjectAccessTokenCommand
-from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_input import CreateSubjectAccessTokenResponseDtoInput
-from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_request_dto import CreateWorkspaceAccessTokenRequestDto
-from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_response_dto import CreateWorkspaceAccessTokenResponseDto
-from askui.tools.askui.askui_workspaces.models.list_access_token_response_dto import ListAccessTokenResponseDto
-from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_input import ListSubjectAccessTokensResponseDtoInput
-from askui.tools.askui.askui_workspaces.models.lookup_access_token_command import LookupAccessTokenCommand
-from askui.tools.askui.askui_workspaces.models.lookup_access_token_response_dto import LookupAccessTokenResponseDto
-from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_command import LookupWorkspaceAccessTokenCommand
-from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_response_dto import LookupWorkspaceAccessTokenResponseDto
from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized
from askui.tools.askui.askui_workspaces.api_response import ApiResponse
+from askui.tools.askui.askui_workspaces.models.create_subject_access_token_command import (
+ CreateSubjectAccessTokenCommand,
+)
+from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_input import (
+ CreateSubjectAccessTokenResponseDtoInput,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_request_dto import (
+ CreateWorkspaceAccessTokenRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_response_dto import (
+ CreateWorkspaceAccessTokenResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.list_access_token_response_dto import (
+ ListAccessTokenResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_input import (
+ ListSubjectAccessTokensResponseDtoInput,
+)
+from askui.tools.askui.askui_workspaces.models.lookup_access_token_command import (
+ LookupAccessTokenCommand,
+)
+from askui.tools.askui.askui_workspaces.models.lookup_access_token_response_dto import (
+ LookupAccessTokenResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_command import (
+ LookupWorkspaceAccessTokenCommand,
+)
+from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_response_dto import (
+ LookupWorkspaceAccessTokenResponseDto,
+)
from askui.tools.askui.askui_workspaces.rest import RESTResponseType
@@ -47,7 +63,6 @@ def __init__(self, api_client=None) -> None:
api_client = ApiClient.get_default()
self.api_client = api_client
-
@validate_call
def create_access_token_api_v1_access_tokens_post(
self,
@@ -56,9 +71,8 @@ def create_access_token_api_v1_access_tokens_post(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -90,26 +104,25 @@ def create_access_token_api_v1_access_tokens_post(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_access_token_api_v1_access_tokens_post_serialize(
create_subject_access_token_command=create_subject_access_token_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "CreateSubjectAccessTokenResponseDtoInput",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "201": "CreateSubjectAccessTokenResponseDtoInput",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -117,7 +130,6 @@ def create_access_token_api_v1_access_tokens_post(
response_types_map=_response_types_map,
).data
-
@validate_call
def create_access_token_api_v1_access_tokens_post_with_http_info(
self,
@@ -126,9 +138,8 @@ def create_access_token_api_v1_access_tokens_post_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -160,26 +171,25 @@ def create_access_token_api_v1_access_tokens_post_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_access_token_api_v1_access_tokens_post_serialize(
create_subject_access_token_command=create_subject_access_token_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "CreateSubjectAccessTokenResponseDtoInput",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "201": "CreateSubjectAccessTokenResponseDtoInput",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -187,7 +197,6 @@ def create_access_token_api_v1_access_tokens_post_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def create_access_token_api_v1_access_tokens_post_without_preload_content(
self,
@@ -196,9 +205,8 @@ def create_access_token_api_v1_access_tokens_post_without_preload_content(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -230,30 +238,28 @@ def create_access_token_api_v1_access_tokens_post_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_access_token_api_v1_access_tokens_post_serialize(
create_subject_access_token_command=create_subject_access_token_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "CreateSubjectAccessTokenResponseDtoInput",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "201": "CreateSubjectAccessTokenResponseDtoInput",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _create_access_token_api_v1_access_tokens_post_serialize(
self,
create_subject_access_token_command,
@@ -262,11 +268,9 @@ def _create_access_token_api_v1_access_tokens_post_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -283,38 +287,28 @@ def _create_access_token_api_v1_access_tokens_post_serialize(
if create_subject_access_token_command is not None:
_body_params = create_subject_access_token_command
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/access-tokens',
+ method="POST",
+ resource_path="/api/v1/access-tokens",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -324,12 +318,9 @@ def _create_access_token_api_v1_access_tokens_post_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post(
self,
@@ -339,9 +330,8 @@ def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -375,7 +365,7 @@ def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_serialize(
workspace_id=workspace_id,
@@ -383,17 +373,16 @@ def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "CreateWorkspaceAccessTokenResponseDto",
- '404': None,
- '422': "HTTPValidationError",
+ "201": "CreateWorkspaceAccessTokenResponseDto",
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -401,7 +390,6 @@ def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post(
response_types_map=_response_types_map,
).data
-
@validate_call
def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_with_http_info(
self,
@@ -411,9 +399,8 @@ def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_with_h
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -447,7 +434,7 @@ def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_with_h
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_serialize(
workspace_id=workspace_id,
@@ -455,17 +442,16 @@ def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_with_h
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "CreateWorkspaceAccessTokenResponseDto",
- '404': None,
- '422': "HTTPValidationError",
+ "201": "CreateWorkspaceAccessTokenResponseDto",
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -473,7 +459,6 @@ def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_with_h
response_types_map=_response_types_map,
)
-
@validate_call
def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_without_preload_content(
self,
@@ -483,9 +468,8 @@ def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_withou
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -519,7 +503,7 @@ def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_withou
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_serialize(
workspace_id=workspace_id,
@@ -527,21 +511,19 @@ def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_withou
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "CreateWorkspaceAccessTokenResponseDto",
- '404': None,
- '422': "HTTPValidationError",
+ "201": "CreateWorkspaceAccessTokenResponseDto",
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_serialize(
self,
workspace_id,
@@ -551,11 +533,9 @@ def _create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_seria
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -566,7 +546,7 @@ def _create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_seria
# process the path parameters
if workspace_id is not None:
- _path_params['workspace_id'] = workspace_id
+ _path_params["workspace_id"] = workspace_id
# process the query parameters
# process the header parameters
# process the form parameters
@@ -574,38 +554,28 @@ def _create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_seria
if create_workspace_access_token_request_dto is not None:
_body_params = create_workspace_access_token_request_dto
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/workspaces/{workspace_id}/access-tokens',
+ method="POST",
+ resource_path="/api/v1/workspaces/{workspace_id}/access-tokens",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -615,12 +585,9 @@ def _create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_seria
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def delete_access_token_api_v1_access_tokens_token_id_delete(
self,
@@ -629,9 +596,8 @@ def delete_access_token_api_v1_access_tokens_token_id_delete(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -663,27 +629,28 @@ def delete_access_token_api_v1_access_tokens_token_id_delete(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
-
- _param = self._delete_access_token_api_v1_access_tokens_token_id_delete_serialize(
- token_id=token_id,
- _request_auth=_request_auth,
- _content_type=_content_type,
- _headers=_headers,
- _host_index=_host_index
+ """ # noqa: E501
+
+ _param = (
+ self._delete_access_token_api_v1_access_tokens_token_id_delete_serialize(
+ token_id=token_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index,
+ )
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '404': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "204": None,
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "404": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -691,7 +658,6 @@ def delete_access_token_api_v1_access_tokens_token_id_delete(
response_types_map=_response_types_map,
).data
-
@validate_call
def delete_access_token_api_v1_access_tokens_token_id_delete_with_http_info(
self,
@@ -700,9 +666,8 @@ def delete_access_token_api_v1_access_tokens_token_id_delete_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -734,27 +699,28 @@ def delete_access_token_api_v1_access_tokens_token_id_delete_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
-
- _param = self._delete_access_token_api_v1_access_tokens_token_id_delete_serialize(
- token_id=token_id,
- _request_auth=_request_auth,
- _content_type=_content_type,
- _headers=_headers,
- _host_index=_host_index
+ """ # noqa: E501
+
+ _param = (
+ self._delete_access_token_api_v1_access_tokens_token_id_delete_serialize(
+ token_id=token_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index,
+ )
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '404': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "204": None,
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "404": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -762,7 +728,6 @@ def delete_access_token_api_v1_access_tokens_token_id_delete_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def delete_access_token_api_v1_access_tokens_token_id_delete_without_preload_content(
self,
@@ -771,9 +736,8 @@ def delete_access_token_api_v1_access_tokens_token_id_delete_without_preload_con
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -805,31 +769,31 @@ def delete_access_token_api_v1_access_tokens_token_id_delete_without_preload_con
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
-
- _param = self._delete_access_token_api_v1_access_tokens_token_id_delete_serialize(
- token_id=token_id,
- _request_auth=_request_auth,
- _content_type=_content_type,
- _headers=_headers,
- _host_index=_host_index
+ """ # noqa: E501
+
+ _param = (
+ self._delete_access_token_api_v1_access_tokens_token_id_delete_serialize(
+ token_id=token_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index,
+ )
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '404': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "204": None,
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "404": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _delete_access_token_api_v1_access_tokens_token_id_delete_serialize(
self,
token_id,
@@ -838,11 +802,9 @@ def _delete_access_token_api_v1_access_tokens_token_id_delete_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -853,31 +815,24 @@ def _delete_access_token_api_v1_access_tokens_token_id_delete_serialize(
# process the path parameters
if token_id is not None:
- _path_params['token_id'] = token_id
+ _path_params["token_id"] = token_id
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='DELETE',
- resource_path='/api/v1/access-tokens/{token_id}',
+ method="DELETE",
+ resource_path="/api/v1/access-tokens/{token_id}",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -887,12 +842,9 @@ def _delete_access_token_api_v1_access_tokens_token_id_delete_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_delete(
self,
@@ -902,9 +854,8 @@ def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_de
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -938,7 +889,7 @@ def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_de
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_delete_serialize(
workspace_id=workspace_id,
@@ -946,17 +897,16 @@ def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_de
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '404': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -964,7 +914,6 @@ def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_de
response_types_map=_response_types_map,
).data
-
@validate_call
def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_delete_with_http_info(
self,
@@ -974,9 +923,8 @@ def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_de
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -1010,7 +958,7 @@ def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_de
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_delete_serialize(
workspace_id=workspace_id,
@@ -1018,17 +966,16 @@ def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_de
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '404': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -1036,7 +983,6 @@ def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_de
response_types_map=_response_types_map,
)
-
@validate_call
def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_delete_without_preload_content(
self,
@@ -1046,9 +992,8 @@ def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_de
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -1082,7 +1027,7 @@ def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_de
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_delete_serialize(
workspace_id=workspace_id,
@@ -1090,21 +1035,19 @@ def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_de
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '404': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_delete_serialize(
self,
workspace_id,
@@ -1114,11 +1057,9 @@ def _delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_d
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -1129,33 +1070,26 @@ def _delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_d
# process the path parameters
if workspace_id is not None:
- _path_params['workspace_id'] = workspace_id
+ _path_params["workspace_id"] = workspace_id
if token_id is not None:
- _path_params['token_id'] = token_id
+ _path_params["token_id"] = token_id
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='DELETE',
- resource_path='/api/v1/workspaces/{workspace_id}/access-tokens/{token_id}',
+ method="DELETE",
+ resource_path="/api/v1/workspaces/{workspace_id}/access-tokens/{token_id}",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -1165,12 +1099,9 @@ def _delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_d
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def list_access_tokens_api_v1_access_tokens_get(
self,
@@ -1181,9 +1112,8 @@ def list_access_tokens_api_v1_access_tokens_get(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -1219,7 +1149,7 @@ def list_access_tokens_api_v1_access_tokens_get(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_access_tokens_api_v1_access_tokens_get_serialize(
subject_id=subject_id,
@@ -1228,18 +1158,17 @@ def list_access_tokens_api_v1_access_tokens_get(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "ListSubjectAccessTokensResponseDtoInput",
- '401': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "ListSubjectAccessTokensResponseDtoInput",
+ "401": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -1247,7 +1176,6 @@ def list_access_tokens_api_v1_access_tokens_get(
response_types_map=_response_types_map,
).data
-
@validate_call
def list_access_tokens_api_v1_access_tokens_get_with_http_info(
self,
@@ -1258,9 +1186,8 @@ def list_access_tokens_api_v1_access_tokens_get_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -1296,7 +1223,7 @@ def list_access_tokens_api_v1_access_tokens_get_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_access_tokens_api_v1_access_tokens_get_serialize(
subject_id=subject_id,
@@ -1305,18 +1232,17 @@ def list_access_tokens_api_v1_access_tokens_get_with_http_info(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "ListSubjectAccessTokensResponseDtoInput",
- '401': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "ListSubjectAccessTokensResponseDtoInput",
+ "401": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -1324,7 +1250,6 @@ def list_access_tokens_api_v1_access_tokens_get_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def list_access_tokens_api_v1_access_tokens_get_without_preload_content(
self,
@@ -1335,9 +1260,8 @@ def list_access_tokens_api_v1_access_tokens_get_without_preload_content(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -1373,7 +1297,7 @@ def list_access_tokens_api_v1_access_tokens_get_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_access_tokens_api_v1_access_tokens_get_serialize(
subject_id=subject_id,
@@ -1382,22 +1306,20 @@ def list_access_tokens_api_v1_access_tokens_get_without_preload_content(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "ListSubjectAccessTokensResponseDtoInput",
- '401': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "ListSubjectAccessTokensResponseDtoInput",
+ "401": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _list_access_tokens_api_v1_access_tokens_get_serialize(
self,
subject_id,
@@ -1408,11 +1330,9 @@ def _list_access_tokens_api_v1_access_tokens_get_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -1424,40 +1344,30 @@ def _list_access_tokens_api_v1_access_tokens_get_serialize(
# process the path parameters
# process the query parameters
if subject_id is not None:
-
- _query_params.append(('subject_id', subject_id))
-
+ _query_params.append(("subject_id", subject_id))
+
if skip is not None:
-
- _query_params.append(('skip', skip))
-
+ _query_params.append(("skip", skip))
+
if limit is not None:
-
- _query_params.append(('limit', limit))
-
+ _query_params.append(("limit", limit))
+
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='GET',
- resource_path='/api/v1/access-tokens',
+ method="GET",
+ resource_path="/api/v1/access-tokens",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -1467,12 +1377,9 @@ def _list_access_tokens_api_v1_access_tokens_get_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get(
self,
@@ -1481,9 +1388,8 @@ def list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -1515,24 +1421,23 @@ def list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_serialize(
workspace_id=workspace_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "List[ListAccessTokenResponseDto]",
- '404': None,
- '422': "HTTPValidationError",
+ "200": "List[ListAccessTokenResponseDto]",
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -1540,7 +1445,6 @@ def list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get(
response_types_map=_response_types_map,
).data
-
@validate_call
def list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_with_http_info(
self,
@@ -1549,9 +1453,8 @@ def list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_with_htt
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -1583,24 +1486,23 @@ def list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_with_htt
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_serialize(
workspace_id=workspace_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "List[ListAccessTokenResponseDto]",
- '404': None,
- '422': "HTTPValidationError",
+ "200": "List[ListAccessTokenResponseDto]",
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -1608,7 +1510,6 @@ def list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_with_htt
response_types_map=_response_types_map,
)
-
@validate_call
def list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_without_preload_content(
self,
@@ -1617,9 +1518,8 @@ def list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_without_
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -1651,28 +1551,26 @@ def list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_without_
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_serialize(
workspace_id=workspace_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "List[ListAccessTokenResponseDto]",
- '404': None,
- '422': "HTTPValidationError",
+ "200": "List[ListAccessTokenResponseDto]",
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_serialize(
self,
workspace_id,
@@ -1681,11 +1579,9 @@ def _list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_seriali
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -1696,31 +1592,24 @@ def _list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_seriali
# process the path parameters
if workspace_id is not None:
- _path_params['workspace_id'] = workspace_id
+ _path_params["workspace_id"] = workspace_id
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='GET',
- resource_path='/api/v1/workspaces/{workspace_id}/access-tokens',
+ method="GET",
+ resource_path="/api/v1/workspaces/{workspace_id}/access-tokens",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -1730,12 +1619,9 @@ def _list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_seriali
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def lookup_access_token_api_v1_access_tokens_lookup_post(
self,
@@ -1744,9 +1630,8 @@ def lookup_access_token_api_v1_access_tokens_lookup_post(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -1779,26 +1664,25 @@ def lookup_access_token_api_v1_access_tokens_lookup_post(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._lookup_access_token_api_v1_access_tokens_lookup_post_serialize(
lookup_access_token_command=lookup_access_token_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "LookupAccessTokenResponseDto",
- '401': "StringErrorResponse",
- '404': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "LookupAccessTokenResponseDto",
+ "401": "StringErrorResponse",
+ "404": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -1806,7 +1690,6 @@ def lookup_access_token_api_v1_access_tokens_lookup_post(
response_types_map=_response_types_map,
).data
-
@validate_call
def lookup_access_token_api_v1_access_tokens_lookup_post_with_http_info(
self,
@@ -1815,9 +1698,8 @@ def lookup_access_token_api_v1_access_tokens_lookup_post_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -1850,26 +1732,25 @@ def lookup_access_token_api_v1_access_tokens_lookup_post_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._lookup_access_token_api_v1_access_tokens_lookup_post_serialize(
lookup_access_token_command=lookup_access_token_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "LookupAccessTokenResponseDto",
- '401': "StringErrorResponse",
- '404': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "LookupAccessTokenResponseDto",
+ "401": "StringErrorResponse",
+ "404": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -1877,7 +1758,6 @@ def lookup_access_token_api_v1_access_tokens_lookup_post_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def lookup_access_token_api_v1_access_tokens_lookup_post_without_preload_content(
self,
@@ -1886,9 +1766,8 @@ def lookup_access_token_api_v1_access_tokens_lookup_post_without_preload_content
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -1921,30 +1800,28 @@ def lookup_access_token_api_v1_access_tokens_lookup_post_without_preload_content
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._lookup_access_token_api_v1_access_tokens_lookup_post_serialize(
lookup_access_token_command=lookup_access_token_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "LookupAccessTokenResponseDto",
- '401': "StringErrorResponse",
- '404': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "LookupAccessTokenResponseDto",
+ "401": "StringErrorResponse",
+ "404": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _lookup_access_token_api_v1_access_tokens_lookup_post_serialize(
self,
lookup_access_token_command,
@@ -1953,11 +1830,9 @@ def _lookup_access_token_api_v1_access_tokens_lookup_post_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -1974,38 +1849,28 @@ def _lookup_access_token_api_v1_access_tokens_lookup_post_serialize(
if lookup_access_token_command is not None:
_body_params = lookup_access_token_command
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/access-tokens/lookup',
+ method="POST",
+ resource_path="/api/v1/access-tokens/lookup",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -2015,12 +1880,9 @@ def _lookup_access_token_api_v1_access_tokens_lookup_post_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_lookup_post(
self,
@@ -2030,9 +1892,8 @@ def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_l
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -2067,7 +1928,7 @@ def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_l
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_lookup_post_serialize(
workspace_id=workspace_id,
@@ -2075,20 +1936,19 @@ def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_l
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "LookupWorkspaceAccessTokenResponseDto",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '404': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "LookupWorkspaceAccessTokenResponseDto",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "404": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -2096,7 +1956,6 @@ def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_l
response_types_map=_response_types_map,
).data
-
@validate_call
def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_lookup_post_with_http_info(
self,
@@ -2106,9 +1965,8 @@ def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_l
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -2143,7 +2001,7 @@ def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_l
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_lookup_post_serialize(
workspace_id=workspace_id,
@@ -2151,20 +2009,19 @@ def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_l
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "LookupWorkspaceAccessTokenResponseDto",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '404': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "LookupWorkspaceAccessTokenResponseDto",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "404": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -2172,7 +2029,6 @@ def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_l
response_types_map=_response_types_map,
)
-
@validate_call
def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_lookup_post_without_preload_content(
self,
@@ -2182,9 +2038,8 @@ def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_l
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -2219,7 +2074,7 @@ def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_l
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_lookup_post_serialize(
workspace_id=workspace_id,
@@ -2227,24 +2082,22 @@ def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_l
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "LookupWorkspaceAccessTokenResponseDto",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '404': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "LookupWorkspaceAccessTokenResponseDto",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "404": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_lookup_post_serialize(
self,
workspace_id,
@@ -2254,11 +2107,9 @@ def _lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -2269,7 +2120,7 @@ def _lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_
# process the path parameters
if workspace_id is not None:
- _path_params['workspace_id'] = workspace_id
+ _path_params["workspace_id"] = workspace_id
# process the query parameters
# process the header parameters
# process the form parameters
@@ -2277,38 +2128,28 @@ def _lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_
if lookup_workspace_access_token_command is not None:
_body_params = lookup_workspace_access_token_command
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/workspaces/{workspace_id}/access-tokens/lookup',
+ method="POST",
+ resource_path="/api/v1/workspaces/{workspace_id}/access-tokens/lookup",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -2318,7 +2159,5 @@ def _lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/api/agent_executions_api.py b/src/askui/tools/askui/askui_workspaces/api/agent_executions_api.py
index 3f302128..cc486540 100644
--- a/src/askui/tools/askui/askui_workspaces/api/agent_executions_api.py
+++ b/src/askui/tools/askui/askui_workspaces/api/agent_executions_api.py
@@ -1,30 +1,37 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-import warnings
-from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
-from typing_extensions import Annotated
-from pydantic import Field, StrictBytes, StrictStr, field_validator
-from typing import List, Optional, Union
+from pydantic import (
+ Field,
+ StrictBytes,
+ StrictFloat,
+ StrictInt,
+ StrictStr,
+ validate_call,
+)
from typing_extensions import Annotated
-from askui.tools.askui.askui_workspaces.models.agent_execution import AgentExecution
-from askui.tools.askui.askui_workspaces.models.agent_execution_update_command import AgentExecutionUpdateCommand
-from askui.tools.askui.askui_workspaces.models.agent_executions_list_response import AgentExecutionsListResponse
from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized
from askui.tools.askui.askui_workspaces.api_response import ApiResponse
+from askui.tools.askui.askui_workspaces.models.agent_execution import AgentExecution
+from askui.tools.askui.askui_workspaces.models.agent_execution_update_command import (
+ AgentExecutionUpdateCommand,
+)
+from askui.tools.askui.askui_workspaces.models.agent_executions_list_response import (
+ AgentExecutionsListResponse,
+)
from askui.tools.askui.askui_workspaces.rest import RESTResponseType
@@ -40,19 +47,23 @@ def __init__(self, api_client=None) -> None:
api_client = ApiClient.get_default()
self.api_client = api_client
-
@validate_call
def create_agent_execution_api_v1_agent_executions_post(
self,
agent_id: StrictStr,
- input_files: Annotated[List[Union[StrictBytes, StrictStr]], Field(min_length=1, description="Files to extract data from. Supported file extensions: {'.gif', '.eml', '.webp', '.png', '.jpeg', '.pdf', '.jpg', '.txt'}. Maximum total size: 100 MiB. We process the .eml files as text files, i.e., we don't process non-textual attachments and content properly. For that, extract them from the .eml files separating them into different files.")],
+ input_files: Annotated[
+ List[Union[StrictBytes, StrictStr]],
+ Field(
+ min_length=1,
+ description="Files to extract data from. Supported file extensions: {'.gif', '.eml', '.webp', '.png', '.jpeg', '.pdf', '.jpg', '.txt'}. Maximum total size: 100 MiB. We process the .eml files as text files, i.e., we don't process non-textual attachments and content properly. For that, extract them from the .eml files separating them into different files.",
+ ),
+ ],
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -86,7 +97,7 @@ def create_agent_execution_api_v1_agent_executions_post(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_agent_execution_api_v1_agent_executions_post_serialize(
agent_id=agent_id,
@@ -94,16 +105,15 @@ def create_agent_execution_api_v1_agent_executions_post(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "AgentExecution",
- '422': "HTTPValidationError",
+ "201": "AgentExecution",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -111,19 +121,23 @@ def create_agent_execution_api_v1_agent_executions_post(
response_types_map=_response_types_map,
).data
-
@validate_call
def create_agent_execution_api_v1_agent_executions_post_with_http_info(
self,
agent_id: StrictStr,
- input_files: Annotated[List[Union[StrictBytes, StrictStr]], Field(min_length=1, description="Files to extract data from. Supported file extensions: {'.gif', '.eml', '.webp', '.png', '.jpeg', '.pdf', '.jpg', '.txt'}. Maximum total size: 100 MiB. We process the .eml files as text files, i.e., we don't process non-textual attachments and content properly. For that, extract them from the .eml files separating them into different files.")],
+ input_files: Annotated[
+ List[Union[StrictBytes, StrictStr]],
+ Field(
+ min_length=1,
+ description="Files to extract data from. Supported file extensions: {'.gif', '.eml', '.webp', '.png', '.jpeg', '.pdf', '.jpg', '.txt'}. Maximum total size: 100 MiB. We process the .eml files as text files, i.e., we don't process non-textual attachments and content properly. For that, extract them from the .eml files separating them into different files.",
+ ),
+ ],
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -157,7 +171,7 @@ def create_agent_execution_api_v1_agent_executions_post_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_agent_execution_api_v1_agent_executions_post_serialize(
agent_id=agent_id,
@@ -165,16 +179,15 @@ def create_agent_execution_api_v1_agent_executions_post_with_http_info(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "AgentExecution",
- '422': "HTTPValidationError",
+ "201": "AgentExecution",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -182,19 +195,23 @@ def create_agent_execution_api_v1_agent_executions_post_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def create_agent_execution_api_v1_agent_executions_post_without_preload_content(
self,
agent_id: StrictStr,
- input_files: Annotated[List[Union[StrictBytes, StrictStr]], Field(min_length=1, description="Files to extract data from. Supported file extensions: {'.gif', '.eml', '.webp', '.png', '.jpeg', '.pdf', '.jpg', '.txt'}. Maximum total size: 100 MiB. We process the .eml files as text files, i.e., we don't process non-textual attachments and content properly. For that, extract them from the .eml files separating them into different files.")],
+ input_files: Annotated[
+ List[Union[StrictBytes, StrictStr]],
+ Field(
+ min_length=1,
+ description="Files to extract data from. Supported file extensions: {'.gif', '.eml', '.webp', '.png', '.jpeg', '.pdf', '.jpg', '.txt'}. Maximum total size: 100 MiB. We process the .eml files as text files, i.e., we don't process non-textual attachments and content properly. For that, extract them from the .eml files separating them into different files.",
+ ),
+ ],
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -228,7 +245,7 @@ def create_agent_execution_api_v1_agent_executions_post_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_agent_execution_api_v1_agent_executions_post_serialize(
agent_id=agent_id,
@@ -236,20 +253,18 @@ def create_agent_execution_api_v1_agent_executions_post_without_preload_content(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "AgentExecution",
- '422': "HTTPValidationError",
+ "201": "AgentExecution",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _create_agent_execution_api_v1_agent_executions_post_serialize(
self,
agent_id,
@@ -259,11 +274,10 @@ def _create_agent_execution_api_v1_agent_executions_post_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
_collection_formats: Dict[str, str] = {
- 'input_files': 'csv',
+ "input_files": "csv",
}
_path_params: Dict[str, str] = {}
@@ -276,47 +290,36 @@ def _create_agent_execution_api_v1_agent_executions_post_serialize(
# process the path parameters
# process the query parameters
if agent_id is not None:
-
- _query_params.append(('agent_id', agent_id))
-
+ _query_params.append(("agent_id", agent_id))
+
# process the header parameters
# process the form parameters
if input_files is not None:
- _files['input_files'] = input_files
+ _files["input_files"] = input_files
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'multipart/form-data'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["multipart/form-data"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/agent-executions',
+ method="POST",
+ resource_path="/api/v1/agent-executions",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -326,12 +329,9 @@ def _create_agent_execution_api_v1_agent_executions_post_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def list_agent_executions_api_v1_agent_executions_get(
self,
@@ -341,14 +341,18 @@ def list_agent_executions_api_v1_agent_executions_get(
status: Optional[List[StrictStr]] = None,
skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
- expand: Annotated[Optional[List[StrictStr]], Field(description="total_count: Include the total number of agent executions that match the query, only accurate up to 100.")] = None,
+ expand: Annotated[
+ Optional[List[StrictStr]],
+ Field(
+ description="total_count: Include the total number of agent executions that match the query, only accurate up to 100."
+ ),
+ ] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -393,7 +397,7 @@ def list_agent_executions_api_v1_agent_executions_get(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_agent_executions_api_v1_agent_executions_get_serialize(
agent_execution_id=agent_execution_id,
@@ -406,16 +410,15 @@ def list_agent_executions_api_v1_agent_executions_get(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "AgentExecutionsListResponse",
- '422': "HTTPValidationError",
+ "200": "AgentExecutionsListResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -423,7 +426,6 @@ def list_agent_executions_api_v1_agent_executions_get(
response_types_map=_response_types_map,
).data
-
@validate_call
def list_agent_executions_api_v1_agent_executions_get_with_http_info(
self,
@@ -433,14 +435,18 @@ def list_agent_executions_api_v1_agent_executions_get_with_http_info(
status: Optional[List[StrictStr]] = None,
skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
- expand: Annotated[Optional[List[StrictStr]], Field(description="total_count: Include the total number of agent executions that match the query, only accurate up to 100.")] = None,
+ expand: Annotated[
+ Optional[List[StrictStr]],
+ Field(
+ description="total_count: Include the total number of agent executions that match the query, only accurate up to 100."
+ ),
+ ] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -485,7 +491,7 @@ def list_agent_executions_api_v1_agent_executions_get_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_agent_executions_api_v1_agent_executions_get_serialize(
agent_execution_id=agent_execution_id,
@@ -498,16 +504,15 @@ def list_agent_executions_api_v1_agent_executions_get_with_http_info(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "AgentExecutionsListResponse",
- '422': "HTTPValidationError",
+ "200": "AgentExecutionsListResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -515,7 +520,6 @@ def list_agent_executions_api_v1_agent_executions_get_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def list_agent_executions_api_v1_agent_executions_get_without_preload_content(
self,
@@ -525,14 +529,18 @@ def list_agent_executions_api_v1_agent_executions_get_without_preload_content(
status: Optional[List[StrictStr]] = None,
skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
- expand: Annotated[Optional[List[StrictStr]], Field(description="total_count: Include the total number of agent executions that match the query, only accurate up to 100.")] = None,
+ expand: Annotated[
+ Optional[List[StrictStr]],
+ Field(
+ description="total_count: Include the total number of agent executions that match the query, only accurate up to 100."
+ ),
+ ] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -577,7 +585,7 @@ def list_agent_executions_api_v1_agent_executions_get_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_agent_executions_api_v1_agent_executions_get_serialize(
agent_execution_id=agent_execution_id,
@@ -590,20 +598,18 @@ def list_agent_executions_api_v1_agent_executions_get_without_preload_content(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "AgentExecutionsListResponse",
- '422': "HTTPValidationError",
+ "200": "AgentExecutionsListResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _list_agent_executions_api_v1_agent_executions_get_serialize(
self,
agent_execution_id,
@@ -618,15 +624,14 @@ def _list_agent_executions_api_v1_agent_executions_get_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
_collection_formats: Dict[str, str] = {
- 'agent_execution_id': 'multi',
- 'agent_id': 'multi',
- 'workspace_id': 'multi',
- 'status': 'multi',
- 'expand': 'multi',
+ "agent_execution_id": "multi",
+ "agent_id": "multi",
+ "workspace_id": "multi",
+ "status": "multi",
+ "expand": "multi",
}
_path_params: Dict[str, str] = {}
@@ -639,56 +644,42 @@ def _list_agent_executions_api_v1_agent_executions_get_serialize(
# process the path parameters
# process the query parameters
if agent_execution_id is not None:
-
- _query_params.append(('agent_execution_id', agent_execution_id))
-
+ _query_params.append(("agent_execution_id", agent_execution_id))
+
if agent_id is not None:
-
- _query_params.append(('agent_id', agent_id))
-
+ _query_params.append(("agent_id", agent_id))
+
if workspace_id is not None:
-
- _query_params.append(('workspace_id', workspace_id))
-
+ _query_params.append(("workspace_id", workspace_id))
+
if status is not None:
-
- _query_params.append(('status', status))
-
+ _query_params.append(("status", status))
+
if skip is not None:
-
- _query_params.append(('skip', skip))
-
+ _query_params.append(("skip", skip))
+
if limit is not None:
-
- _query_params.append(('limit', limit))
-
+ _query_params.append(("limit", limit))
+
if expand is not None:
-
- _query_params.append(('expand', expand))
-
+ _query_params.append(("expand", expand))
+
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='GET',
- resource_path='/api/v1/agent-executions',
+ method="GET",
+ resource_path="/api/v1/agent-executions",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -698,12 +689,9 @@ def _list_agent_executions_api_v1_agent_executions_get_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch(
self,
@@ -713,9 +701,8 @@ def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -749,7 +736,7 @@ def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_serialize(
agent_execution_id=agent_execution_id,
@@ -757,16 +744,15 @@ def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "AgentExecution",
- '422': "HTTPValidationError",
+ "200": "AgentExecution",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -774,7 +760,6 @@ def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch(
response_types_map=_response_types_map,
).data
-
@validate_call
def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_with_http_info(
self,
@@ -784,9 +769,8 @@ def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_with
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -820,7 +804,7 @@ def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_with
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_serialize(
agent_execution_id=agent_execution_id,
@@ -828,16 +812,15 @@ def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_with
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "AgentExecution",
- '422': "HTTPValidationError",
+ "200": "AgentExecution",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -845,7 +828,6 @@ def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_with
response_types_map=_response_types_map,
)
-
@validate_call
def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_without_preload_content(
self,
@@ -855,9 +837,8 @@ def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_with
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -891,7 +872,7 @@ def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_with
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_serialize(
agent_execution_id=agent_execution_id,
@@ -899,20 +880,18 @@ def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_with
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "AgentExecution",
- '422': "HTTPValidationError",
+ "200": "AgentExecution",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_serialize(
self,
agent_execution_id,
@@ -922,11 +901,9 @@ def _update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_ser
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -937,7 +914,7 @@ def _update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_ser
# process the path parameters
if agent_execution_id is not None:
- _path_params['agent_execution_id'] = agent_execution_id
+ _path_params["agent_execution_id"] = agent_execution_id
# process the query parameters
# process the header parameters
# process the form parameters
@@ -945,38 +922,28 @@ def _update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_ser
if agent_execution_update_command is not None:
_body_params = agent_execution_update_command
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='PATCH',
- resource_path='/api/v1/agent-executions/{agent_execution_id}',
+ method="PATCH",
+ resource_path="/api/v1/agent-executions/{agent_execution_id}",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -986,7 +953,5 @@ def _update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_ser
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/api/agents_api.py b/src/askui/tools/askui/askui_workspaces/api/agents_api.py
index a4be88e9..8df7dcc3 100644
--- a/src/askui/tools/askui/askui_workspaces/api/agents_api.py
+++ b/src/askui/tools/askui/askui_workspaces/api/agents_api.py
@@ -1,31 +1,33 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-import warnings
-from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
-from typing_extensions import Annotated
-from pydantic import Field, StrictStr, field_validator
-from typing import List, Optional
+from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
from typing_extensions import Annotated
-from askui.tools.askui.askui_workspaces.models.agent import Agent
-from askui.tools.askui.askui_workspaces.models.agent_create_command import AgentCreateCommand
-from askui.tools.askui.askui_workspaces.models.agent_update_command import AgentUpdateCommand
-from askui.tools.askui.askui_workspaces.models.agents_list_response import AgentsListResponse
from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized
from askui.tools.askui.askui_workspaces.api_response import ApiResponse
+from askui.tools.askui.askui_workspaces.models.agent import Agent
+from askui.tools.askui.askui_workspaces.models.agent_create_command import (
+ AgentCreateCommand,
+)
+from askui.tools.askui.askui_workspaces.models.agent_update_command import (
+ AgentUpdateCommand,
+)
+from askui.tools.askui.askui_workspaces.models.agents_list_response import (
+ AgentsListResponse,
+)
from askui.tools.askui.askui_workspaces.rest import RESTResponseType
@@ -41,7 +43,6 @@ def __init__(self, api_client=None) -> None:
api_client = ApiClient.get_default()
self.api_client = api_client
-
@validate_call
def create_agent_api_v1_agents_post(
self,
@@ -50,9 +51,8 @@ def create_agent_api_v1_agents_post(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -84,23 +84,22 @@ def create_agent_api_v1_agents_post(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_agent_api_v1_agents_post_serialize(
agent_create_command=agent_create_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "Agent",
- '422': "HTTPValidationError",
+ "201": "Agent",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -108,7 +107,6 @@ def create_agent_api_v1_agents_post(
response_types_map=_response_types_map,
).data
-
@validate_call
def create_agent_api_v1_agents_post_with_http_info(
self,
@@ -117,9 +115,8 @@ def create_agent_api_v1_agents_post_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -151,23 +148,22 @@ def create_agent_api_v1_agents_post_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_agent_api_v1_agents_post_serialize(
agent_create_command=agent_create_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "Agent",
- '422': "HTTPValidationError",
+ "201": "Agent",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -175,7 +171,6 @@ def create_agent_api_v1_agents_post_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def create_agent_api_v1_agents_post_without_preload_content(
self,
@@ -184,9 +179,8 @@ def create_agent_api_v1_agents_post_without_preload_content(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -218,27 +212,25 @@ def create_agent_api_v1_agents_post_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_agent_api_v1_agents_post_serialize(
agent_create_command=agent_create_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "Agent",
- '422': "HTTPValidationError",
+ "201": "Agent",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _create_agent_api_v1_agents_post_serialize(
self,
agent_create_command,
@@ -247,11 +239,9 @@ def _create_agent_api_v1_agents_post_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -268,38 +258,28 @@ def _create_agent_api_v1_agents_post_serialize(
if agent_create_command is not None:
_body_params = agent_create_command
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/agents',
+ method="POST",
+ resource_path="/api/v1/agents",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -309,12 +289,9 @@ def _create_agent_api_v1_agents_post_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def list_agents_api_v1_agents_get(
self,
@@ -323,14 +300,18 @@ def list_agents_api_v1_agents_get(
status: Optional[List[StrictStr]] = None,
skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
- expand: Annotated[Optional[List[StrictStr]], Field(description="total_count: Include the total number of agents that match the query, only accurate up to 100.")] = None,
+ expand: Annotated[
+ Optional[List[StrictStr]],
+ Field(
+ description="total_count: Include the total number of agents that match the query, only accurate up to 100."
+ ),
+ ] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -373,7 +354,7 @@ def list_agents_api_v1_agents_get(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_agents_api_v1_agents_get_serialize(
agent_id=agent_id,
@@ -385,16 +366,15 @@ def list_agents_api_v1_agents_get(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "AgentsListResponse",
- '422': "HTTPValidationError",
+ "200": "AgentsListResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -402,7 +382,6 @@ def list_agents_api_v1_agents_get(
response_types_map=_response_types_map,
).data
-
@validate_call
def list_agents_api_v1_agents_get_with_http_info(
self,
@@ -411,14 +390,18 @@ def list_agents_api_v1_agents_get_with_http_info(
status: Optional[List[StrictStr]] = None,
skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
- expand: Annotated[Optional[List[StrictStr]], Field(description="total_count: Include the total number of agents that match the query, only accurate up to 100.")] = None,
+ expand: Annotated[
+ Optional[List[StrictStr]],
+ Field(
+ description="total_count: Include the total number of agents that match the query, only accurate up to 100."
+ ),
+ ] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -461,7 +444,7 @@ def list_agents_api_v1_agents_get_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_agents_api_v1_agents_get_serialize(
agent_id=agent_id,
@@ -473,16 +456,15 @@ def list_agents_api_v1_agents_get_with_http_info(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "AgentsListResponse",
- '422': "HTTPValidationError",
+ "200": "AgentsListResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -490,7 +472,6 @@ def list_agents_api_v1_agents_get_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def list_agents_api_v1_agents_get_without_preload_content(
self,
@@ -499,14 +480,18 @@ def list_agents_api_v1_agents_get_without_preload_content(
status: Optional[List[StrictStr]] = None,
skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
- expand: Annotated[Optional[List[StrictStr]], Field(description="total_count: Include the total number of agents that match the query, only accurate up to 100.")] = None,
+ expand: Annotated[
+ Optional[List[StrictStr]],
+ Field(
+ description="total_count: Include the total number of agents that match the query, only accurate up to 100."
+ ),
+ ] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -549,7 +534,7 @@ def list_agents_api_v1_agents_get_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_agents_api_v1_agents_get_serialize(
agent_id=agent_id,
@@ -561,20 +546,18 @@ def list_agents_api_v1_agents_get_without_preload_content(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "AgentsListResponse",
- '422': "HTTPValidationError",
+ "200": "AgentsListResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _list_agents_api_v1_agents_get_serialize(
self,
agent_id,
@@ -588,14 +571,13 @@ def _list_agents_api_v1_agents_get_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
_collection_formats: Dict[str, str] = {
- 'agent_id': 'multi',
- 'workspace_id': 'multi',
- 'status': 'multi',
- 'expand': 'multi',
+ "agent_id": "multi",
+ "workspace_id": "multi",
+ "status": "multi",
+ "expand": "multi",
}
_path_params: Dict[str, str] = {}
@@ -608,52 +590,39 @@ def _list_agents_api_v1_agents_get_serialize(
# process the path parameters
# process the query parameters
if agent_id is not None:
-
- _query_params.append(('agent_id', agent_id))
-
+ _query_params.append(("agent_id", agent_id))
+
if workspace_id is not None:
-
- _query_params.append(('workspace_id', workspace_id))
-
+ _query_params.append(("workspace_id", workspace_id))
+
if status is not None:
-
- _query_params.append(('status', status))
-
+ _query_params.append(("status", status))
+
if skip is not None:
-
- _query_params.append(('skip', skip))
-
+ _query_params.append(("skip", skip))
+
if limit is not None:
-
- _query_params.append(('limit', limit))
-
+ _query_params.append(("limit", limit))
+
if expand is not None:
-
- _query_params.append(('expand', expand))
-
+ _query_params.append(("expand", expand))
+
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='GET',
- resource_path='/api/v1/agents',
+ method="GET",
+ resource_path="/api/v1/agents",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -663,12 +632,9 @@ def _list_agents_api_v1_agents_get_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def update_agent_api_v1_agents_agent_id_patch(
self,
@@ -678,9 +644,8 @@ def update_agent_api_v1_agents_agent_id_patch(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -714,7 +679,7 @@ def update_agent_api_v1_agents_agent_id_patch(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._update_agent_api_v1_agents_agent_id_patch_serialize(
agent_id=agent_id,
@@ -722,16 +687,15 @@ def update_agent_api_v1_agents_agent_id_patch(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "Agent",
- '422': "HTTPValidationError",
+ "200": "Agent",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -739,7 +703,6 @@ def update_agent_api_v1_agents_agent_id_patch(
response_types_map=_response_types_map,
).data
-
@validate_call
def update_agent_api_v1_agents_agent_id_patch_with_http_info(
self,
@@ -749,9 +712,8 @@ def update_agent_api_v1_agents_agent_id_patch_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -785,7 +747,7 @@ def update_agent_api_v1_agents_agent_id_patch_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._update_agent_api_v1_agents_agent_id_patch_serialize(
agent_id=agent_id,
@@ -793,16 +755,15 @@ def update_agent_api_v1_agents_agent_id_patch_with_http_info(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "Agent",
- '422': "HTTPValidationError",
+ "200": "Agent",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -810,7 +771,6 @@ def update_agent_api_v1_agents_agent_id_patch_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def update_agent_api_v1_agents_agent_id_patch_without_preload_content(
self,
@@ -820,9 +780,8 @@ def update_agent_api_v1_agents_agent_id_patch_without_preload_content(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -856,7 +815,7 @@ def update_agent_api_v1_agents_agent_id_patch_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._update_agent_api_v1_agents_agent_id_patch_serialize(
agent_id=agent_id,
@@ -864,20 +823,18 @@ def update_agent_api_v1_agents_agent_id_patch_without_preload_content(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "Agent",
- '422': "HTTPValidationError",
+ "200": "Agent",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _update_agent_api_v1_agents_agent_id_patch_serialize(
self,
agent_id,
@@ -887,11 +844,9 @@ def _update_agent_api_v1_agents_agent_id_patch_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -902,7 +857,7 @@ def _update_agent_api_v1_agents_agent_id_patch_serialize(
# process the path parameters
if agent_id is not None:
- _path_params['agent_id'] = agent_id
+ _path_params["agent_id"] = agent_id
# process the query parameters
# process the header parameters
# process the form parameters
@@ -910,38 +865,28 @@ def _update_agent_api_v1_agents_agent_id_patch_serialize(
if agent_update_command is not None:
_body_params = agent_update_command
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='PATCH',
- resource_path='/api/v1/agents/{agent_id}',
+ method="PATCH",
+ resource_path="/api/v1/agents/{agent_id}",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -951,7 +896,5 @@ def _update_agent_api_v1_agents_agent_id_patch_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/api/billing_api.py b/src/askui/tools/askui/askui_workspaces/api/billing_api.py
index ef410556..064d24f5 100644
--- a/src/askui/tools/askui/askui_workspaces/api/billing_api.py
+++ b/src/askui/tools/askui/askui_workspaces/api/billing_api.py
@@ -1,28 +1,32 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-import warnings
-from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
-from typing_extensions import Annotated
-from pydantic import StrictStr
-from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_request_dto import CreateCustomerPortalSessionRequestDto
-from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_response_dto import CreateCustomerPortalSessionResponseDto
-from askui.tools.askui.askui_workspaces.models.get_subscription_response_dto import GetSubscriptionResponseDto
+from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
+from typing_extensions import Annotated
from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized
from askui.tools.askui.askui_workspaces.api_response import ApiResponse
+from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_request_dto import (
+ CreateCustomerPortalSessionRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_response_dto import (
+ CreateCustomerPortalSessionResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.get_subscription_response_dto import (
+ GetSubscriptionResponseDto,
+)
from askui.tools.askui.askui_workspaces.rest import RESTResponseType
@@ -38,7 +42,6 @@ def __init__(self, api_client=None) -> None:
api_client = ApiClient.get_default()
self.api_client = api_client
-
@validate_call
def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_customer_portal_session_post(
self,
@@ -48,9 +51,8 @@ def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custom
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -84,7 +86,7 @@ def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custom
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_customer_portal_session_api_v1_workspaces_workspace_id_billing_customer_portal_session_post_serialize(
workspace_id=workspace_id,
@@ -92,17 +94,16 @@ def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custom
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "CreateCustomerPortalSessionResponseDto",
- '404': None,
- '422': "HTTPValidationError",
+ "200": "CreateCustomerPortalSessionResponseDto",
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -110,7 +111,6 @@ def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custom
response_types_map=_response_types_map,
).data
-
@validate_call
def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_customer_portal_session_post_with_http_info(
self,
@@ -120,9 +120,8 @@ def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custom
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -156,7 +155,7 @@ def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custom
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_customer_portal_session_api_v1_workspaces_workspace_id_billing_customer_portal_session_post_serialize(
workspace_id=workspace_id,
@@ -164,17 +163,16 @@ def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custom
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "CreateCustomerPortalSessionResponseDto",
- '404': None,
- '422': "HTTPValidationError",
+ "200": "CreateCustomerPortalSessionResponseDto",
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -182,7 +180,6 @@ def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custom
response_types_map=_response_types_map,
)
-
@validate_call
def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_customer_portal_session_post_without_preload_content(
self,
@@ -192,9 +189,8 @@ def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custom
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -228,7 +224,7 @@ def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custom
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_customer_portal_session_api_v1_workspaces_workspace_id_billing_customer_portal_session_post_serialize(
workspace_id=workspace_id,
@@ -236,21 +232,19 @@ def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custom
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "CreateCustomerPortalSessionResponseDto",
- '404': None,
- '422': "HTTPValidationError",
+ "200": "CreateCustomerPortalSessionResponseDto",
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _create_customer_portal_session_api_v1_workspaces_workspace_id_billing_customer_portal_session_post_serialize(
self,
workspace_id,
@@ -260,11 +254,9 @@ def _create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custo
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -275,7 +267,7 @@ def _create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custo
# process the path parameters
if workspace_id is not None:
- _path_params['workspace_id'] = workspace_id
+ _path_params["workspace_id"] = workspace_id
# process the query parameters
# process the header parameters
# process the form parameters
@@ -283,38 +275,28 @@ def _create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custo
if create_customer_portal_session_request_dto is not None:
_body_params = create_customer_portal_session_request_dto
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/workspaces/{workspace_id}/billing/customer-portal-session',
+ method="POST",
+ resource_path="/api/v1/workspaces/{workspace_id}/billing/customer-portal-session",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -324,12 +306,9 @@ def _create_customer_portal_session_api_v1_workspaces_workspace_id_billing_custo
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscription_get(
self,
@@ -338,9 +317,8 @@ def get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscripti
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -372,23 +350,22 @@ def get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscripti
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscription_get_serialize(
workspace_id=workspace_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "GetSubscriptionResponseDto",
- '422': "HTTPValidationError",
+ "200": "GetSubscriptionResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -396,7 +373,6 @@ def get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscripti
response_types_map=_response_types_map,
).data
-
@validate_call
def get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscription_get_with_http_info(
self,
@@ -405,9 +381,8 @@ def get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscripti
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -439,23 +414,22 @@ def get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscripti
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscription_get_serialize(
workspace_id=workspace_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "GetSubscriptionResponseDto",
- '422': "HTTPValidationError",
+ "200": "GetSubscriptionResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -463,7 +437,6 @@ def get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscripti
response_types_map=_response_types_map,
)
-
@validate_call
def get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscription_get_without_preload_content(
self,
@@ -472,9 +445,8 @@ def get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscripti
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -506,27 +478,25 @@ def get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscripti
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscription_get_serialize(
workspace_id=workspace_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "GetSubscriptionResponseDto",
- '422': "HTTPValidationError",
+ "200": "GetSubscriptionResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscription_get_serialize(
self,
workspace_id,
@@ -535,11 +505,9 @@ def _get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscript
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -550,31 +518,24 @@ def _get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscript
# process the path parameters
if workspace_id is not None:
- _path_params['workspace_id'] = workspace_id
+ _path_params["workspace_id"] = workspace_id
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='GET',
- resource_path='/api/v1/workspaces/{workspace_id}/billing/subscription',
+ method="GET",
+ resource_path="/api/v1/workspaces/{workspace_id}/billing/subscription",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -584,7 +545,5 @@ def _get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscript
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/api/files_api.py b/src/askui/tools/askui/askui_workspaces/api/files_api.py
index c834fdec..761aba44 100644
--- a/src/askui/tools/askui/askui_workspaces/api/files_api.py
+++ b/src/askui/tools/askui/askui_workspaces/api/files_api.py
@@ -1,30 +1,39 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-import warnings
-from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
-from typing_extensions import Annotated
-from pydantic import Field, StrictBytes, StrictStr, field_validator
-from typing import Any, List, Optional, Union
+from pydantic import (
+ Field,
+ StrictBytes,
+ StrictFloat,
+ StrictInt,
+ StrictStr,
+ validate_call,
+)
from typing_extensions import Annotated
-from askui.tools.askui.askui_workspaces.models.files_list_response_dto import FilesListResponseDto
-from askui.tools.askui.askui_workspaces.models.generate_signed_cookies_command import GenerateSignedCookiesCommand
-from askui.tools.askui.askui_workspaces.models.upload_file_response import UploadFileResponse
from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized
from askui.tools.askui.askui_workspaces.api_response import ApiResponse
+from askui.tools.askui.askui_workspaces.models.files_list_response_dto import (
+ FilesListResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.generate_signed_cookies_command import (
+ GenerateSignedCookiesCommand,
+)
+from askui.tools.askui.askui_workspaces.models.upload_file_response import (
+ UploadFileResponse,
+)
from askui.tools.askui.askui_workspaces.rest import RESTResponseType
@@ -40,7 +49,6 @@ def __init__(self, api_client=None) -> None:
api_client = ApiClient.get_default()
self.api_client = api_client
-
@validate_call
def delete_file_api_v1_files_file_path_delete(
self,
@@ -49,9 +57,8 @@ def delete_file_api_v1_files_file_path_delete(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -84,27 +91,26 @@ def delete_file_api_v1_files_file_path_delete(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._delete_file_api_v1_files_file_path_delete_serialize(
file_path=file_path,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '404': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "204": None,
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "404": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -112,7 +118,6 @@ def delete_file_api_v1_files_file_path_delete(
response_types_map=_response_types_map,
).data
-
@validate_call
def delete_file_api_v1_files_file_path_delete_with_http_info(
self,
@@ -121,9 +126,8 @@ def delete_file_api_v1_files_file_path_delete_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -156,27 +160,26 @@ def delete_file_api_v1_files_file_path_delete_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._delete_file_api_v1_files_file_path_delete_serialize(
file_path=file_path,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '404': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "204": None,
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "404": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -184,7 +187,6 @@ def delete_file_api_v1_files_file_path_delete_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def delete_file_api_v1_files_file_path_delete_without_preload_content(
self,
@@ -193,9 +195,8 @@ def delete_file_api_v1_files_file_path_delete_without_preload_content(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -228,31 +229,29 @@ def delete_file_api_v1_files_file_path_delete_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._delete_file_api_v1_files_file_path_delete_serialize(
file_path=file_path,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '404': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "204": None,
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "404": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _delete_file_api_v1_files_file_path_delete_serialize(
self,
file_path,
@@ -261,11 +260,9 @@ def _delete_file_api_v1_files_file_path_delete_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -276,31 +273,24 @@ def _delete_file_api_v1_files_file_path_delete_serialize(
# process the path parameters
if file_path is not None:
- _path_params['file_path'] = file_path
+ _path_params["file_path"] = file_path
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='DELETE',
- resource_path='/api/v1/files/{file_path}',
+ method="DELETE",
+ resource_path="/api/v1/files/{file_path}",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -310,27 +300,44 @@ def _delete_file_api_v1_files_file_path_delete_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def list_files_api_v1_files_get(
self,
- prefix: Annotated[Optional[StrictStr], Field(description="Prefix (path) to filter the files by. For folders it should end with `/`. Note that it is currently not possible to list files across workspaces but only within one workspace, i.e., which means that the prefix should start with `workspaces/{workspace_id}/`.")] = None,
- delimiter: Annotated[Optional[StrictStr], Field(description="Delimiter to group keys, e.g., `/` to group by folders, i.e., get files of the root folder or the folder identified by the prefix. If not provided, no folders are included in the response.")] = None,
- limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Maximum number of files to return per page")] = None,
- continuation_token: Annotated[Optional[StrictStr], Field(description="Continuation token to get the next page of results (cursor-based pagination)")] = None,
- expand: Annotated[Optional[List[StrictStr]], Field(description="Expand the response with the signed URL to the file")] = None,
+ prefix: Annotated[
+ Optional[StrictStr],
+ Field(
+ description="Prefix (path) to filter the files by. For folders it should end with `/`. Note that it is currently not possible to list files across workspaces but only within one workspace, i.e., which means that the prefix should start with `workspaces/{workspace_id}/`."
+ ),
+ ] = None,
+ delimiter: Annotated[
+ Optional[StrictStr],
+ Field(
+ description="Delimiter to group keys, e.g., `/` to group by folders, i.e., get files of the root folder or the folder identified by the prefix. If not provided, no folders are included in the response."
+ ),
+ ] = None,
+ limit: Annotated[
+ Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
+ Field(description="Maximum number of files to return per page"),
+ ] = None,
+ continuation_token: Annotated[
+ Optional[StrictStr],
+ Field(
+ description="Continuation token to get the next page of results (cursor-based pagination)"
+ ),
+ ] = None,
+ expand: Annotated[
+ Optional[List[StrictStr]],
+ Field(description="Expand the response with the signed URL to the file"),
+ ] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -371,7 +378,7 @@ def list_files_api_v1_files_get(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_files_api_v1_files_get_serialize(
prefix=prefix,
@@ -382,18 +389,17 @@ def list_files_api_v1_files_get(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "FilesListResponseDto",
- '401': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "FilesListResponseDto",
+ "401": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -401,22 +407,41 @@ def list_files_api_v1_files_get(
response_types_map=_response_types_map,
).data
-
@validate_call
def list_files_api_v1_files_get_with_http_info(
self,
- prefix: Annotated[Optional[StrictStr], Field(description="Prefix (path) to filter the files by. For folders it should end with `/`. Note that it is currently not possible to list files across workspaces but only within one workspace, i.e., which means that the prefix should start with `workspaces/{workspace_id}/`.")] = None,
- delimiter: Annotated[Optional[StrictStr], Field(description="Delimiter to group keys, e.g., `/` to group by folders, i.e., get files of the root folder or the folder identified by the prefix. If not provided, no folders are included in the response.")] = None,
- limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Maximum number of files to return per page")] = None,
- continuation_token: Annotated[Optional[StrictStr], Field(description="Continuation token to get the next page of results (cursor-based pagination)")] = None,
- expand: Annotated[Optional[List[StrictStr]], Field(description="Expand the response with the signed URL to the file")] = None,
+ prefix: Annotated[
+ Optional[StrictStr],
+ Field(
+ description="Prefix (path) to filter the files by. For folders it should end with `/`. Note that it is currently not possible to list files across workspaces but only within one workspace, i.e., which means that the prefix should start with `workspaces/{workspace_id}/`."
+ ),
+ ] = None,
+ delimiter: Annotated[
+ Optional[StrictStr],
+ Field(
+ description="Delimiter to group keys, e.g., `/` to group by folders, i.e., get files of the root folder or the folder identified by the prefix. If not provided, no folders are included in the response."
+ ),
+ ] = None,
+ limit: Annotated[
+ Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
+ Field(description="Maximum number of files to return per page"),
+ ] = None,
+ continuation_token: Annotated[
+ Optional[StrictStr],
+ Field(
+ description="Continuation token to get the next page of results (cursor-based pagination)"
+ ),
+ ] = None,
+ expand: Annotated[
+ Optional[List[StrictStr]],
+ Field(description="Expand the response with the signed URL to the file"),
+ ] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -457,7 +482,7 @@ def list_files_api_v1_files_get_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_files_api_v1_files_get_serialize(
prefix=prefix,
@@ -468,18 +493,17 @@ def list_files_api_v1_files_get_with_http_info(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "FilesListResponseDto",
- '401': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "FilesListResponseDto",
+ "401": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -487,22 +511,41 @@ def list_files_api_v1_files_get_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def list_files_api_v1_files_get_without_preload_content(
self,
- prefix: Annotated[Optional[StrictStr], Field(description="Prefix (path) to filter the files by. For folders it should end with `/`. Note that it is currently not possible to list files across workspaces but only within one workspace, i.e., which means that the prefix should start with `workspaces/{workspace_id}/`.")] = None,
- delimiter: Annotated[Optional[StrictStr], Field(description="Delimiter to group keys, e.g., `/` to group by folders, i.e., get files of the root folder or the folder identified by the prefix. If not provided, no folders are included in the response.")] = None,
- limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Maximum number of files to return per page")] = None,
- continuation_token: Annotated[Optional[StrictStr], Field(description="Continuation token to get the next page of results (cursor-based pagination)")] = None,
- expand: Annotated[Optional[List[StrictStr]], Field(description="Expand the response with the signed URL to the file")] = None,
+ prefix: Annotated[
+ Optional[StrictStr],
+ Field(
+ description="Prefix (path) to filter the files by. For folders it should end with `/`. Note that it is currently not possible to list files across workspaces but only within one workspace, i.e., which means that the prefix should start with `workspaces/{workspace_id}/`."
+ ),
+ ] = None,
+ delimiter: Annotated[
+ Optional[StrictStr],
+ Field(
+ description="Delimiter to group keys, e.g., `/` to group by folders, i.e., get files of the root folder or the folder identified by the prefix. If not provided, no folders are included in the response."
+ ),
+ ] = None,
+ limit: Annotated[
+ Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
+ Field(description="Maximum number of files to return per page"),
+ ] = None,
+ continuation_token: Annotated[
+ Optional[StrictStr],
+ Field(
+ description="Continuation token to get the next page of results (cursor-based pagination)"
+ ),
+ ] = None,
+ expand: Annotated[
+ Optional[List[StrictStr]],
+ Field(description="Expand the response with the signed URL to the file"),
+ ] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -543,7 +586,7 @@ def list_files_api_v1_files_get_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_files_api_v1_files_get_serialize(
prefix=prefix,
@@ -554,22 +597,20 @@ def list_files_api_v1_files_get_without_preload_content(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "FilesListResponseDto",
- '401': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "FilesListResponseDto",
+ "401": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _list_files_api_v1_files_get_serialize(
self,
prefix,
@@ -582,11 +623,10 @@ def _list_files_api_v1_files_get_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
_collection_formats: Dict[str, str] = {
- 'expand': 'multi',
+ "expand": "multi",
}
_path_params: Dict[str, str] = {}
@@ -599,48 +639,36 @@ def _list_files_api_v1_files_get_serialize(
# process the path parameters
# process the query parameters
if prefix is not None:
-
- _query_params.append(('prefix', prefix))
-
+ _query_params.append(("prefix", prefix))
+
if delimiter is not None:
-
- _query_params.append(('delimiter', delimiter))
-
+ _query_params.append(("delimiter", delimiter))
+
if limit is not None:
-
- _query_params.append(('limit', limit))
-
+ _query_params.append(("limit", limit))
+
if continuation_token is not None:
-
- _query_params.append(('continuation_token', continuation_token))
-
+ _query_params.append(("continuation_token", continuation_token))
+
if expand is not None:
-
- _query_params.append(('expand', expand))
-
+ _query_params.append(("expand", expand))
+
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='GET',
- resource_path='/api/v1/files',
+ method="GET",
+ resource_path="/api/v1/files",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -650,12 +678,9 @@ def _list_files_api_v1_files_get_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def set_signed_cookies_api_v1_files_signed_cookies_post(
self,
@@ -664,9 +689,8 @@ def set_signed_cookies_api_v1_files_signed_cookies_post(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -699,25 +723,24 @@ def set_signed_cookies_api_v1_files_signed_cookies_post(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._set_signed_cookies_api_v1_files_signed_cookies_post_serialize(
generate_signed_cookies_command=generate_signed_cookies_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "object",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "object",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -725,7 +748,6 @@ def set_signed_cookies_api_v1_files_signed_cookies_post(
response_types_map=_response_types_map,
).data
-
@validate_call
def set_signed_cookies_api_v1_files_signed_cookies_post_with_http_info(
self,
@@ -734,9 +756,8 @@ def set_signed_cookies_api_v1_files_signed_cookies_post_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -769,25 +790,24 @@ def set_signed_cookies_api_v1_files_signed_cookies_post_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._set_signed_cookies_api_v1_files_signed_cookies_post_serialize(
generate_signed_cookies_command=generate_signed_cookies_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "object",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "object",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -795,7 +815,6 @@ def set_signed_cookies_api_v1_files_signed_cookies_post_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def set_signed_cookies_api_v1_files_signed_cookies_post_without_preload_content(
self,
@@ -804,9 +823,8 @@ def set_signed_cookies_api_v1_files_signed_cookies_post_without_preload_content(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -839,29 +857,27 @@ def set_signed_cookies_api_v1_files_signed_cookies_post_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._set_signed_cookies_api_v1_files_signed_cookies_post_serialize(
generate_signed_cookies_command=generate_signed_cookies_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "object",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "object",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _set_signed_cookies_api_v1_files_signed_cookies_post_serialize(
self,
generate_signed_cookies_command,
@@ -870,11 +886,9 @@ def _set_signed_cookies_api_v1_files_signed_cookies_post_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -891,38 +905,28 @@ def _set_signed_cookies_api_v1_files_signed_cookies_post_serialize(
if generate_signed_cookies_command is not None:
_body_params = generate_signed_cookies_command
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/files/signed-cookies',
+ method="POST",
+ resource_path="/api/v1/files/signed-cookies",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -932,12 +936,9 @@ def _set_signed_cookies_api_v1_files_signed_cookies_post_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def upload_file_api_v1_files_file_path_put(
self,
@@ -947,9 +948,8 @@ def upload_file_api_v1_files_file_path_put(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -984,7 +984,7 @@ def upload_file_api_v1_files_file_path_put(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._upload_file_api_v1_files_file_path_put_serialize(
file_path=file_path,
@@ -992,20 +992,19 @@ def upload_file_api_v1_files_file_path_put(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "UploadFileResponse",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '413': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "201": "UploadFileResponse",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "413": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -1013,7 +1012,6 @@ def upload_file_api_v1_files_file_path_put(
response_types_map=_response_types_map,
).data
-
@validate_call
def upload_file_api_v1_files_file_path_put_with_http_info(
self,
@@ -1023,9 +1021,8 @@ def upload_file_api_v1_files_file_path_put_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -1060,7 +1057,7 @@ def upload_file_api_v1_files_file_path_put_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._upload_file_api_v1_files_file_path_put_serialize(
file_path=file_path,
@@ -1068,20 +1065,19 @@ def upload_file_api_v1_files_file_path_put_with_http_info(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "UploadFileResponse",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '413': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "201": "UploadFileResponse",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "413": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -1089,7 +1085,6 @@ def upload_file_api_v1_files_file_path_put_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def upload_file_api_v1_files_file_path_put_without_preload_content(
self,
@@ -1099,9 +1094,8 @@ def upload_file_api_v1_files_file_path_put_without_preload_content(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -1136,7 +1130,7 @@ def upload_file_api_v1_files_file_path_put_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._upload_file_api_v1_files_file_path_put_serialize(
file_path=file_path,
@@ -1144,24 +1138,22 @@ def upload_file_api_v1_files_file_path_put_without_preload_content(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "UploadFileResponse",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '413': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "201": "UploadFileResponse",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "413": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _upload_file_api_v1_files_file_path_put_serialize(
self,
file_path,
@@ -1171,11 +1163,9 @@ def _upload_file_api_v1_files_file_path_put_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -1186,46 +1176,36 @@ def _upload_file_api_v1_files_file_path_put_serialize(
# process the path parameters
if file_path is not None:
- _path_params['file_path'] = file_path
+ _path_params["file_path"] = file_path
# process the query parameters
# process the header parameters
# process the form parameters
if file is not None:
- _files['file'] = file
+ _files["file"] = file
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'multipart/form-data'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["multipart/form-data"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='PUT',
- resource_path='/api/v1/files/{file_path}',
+ method="PUT",
+ resource_path="/api/v1/files/{file_path}",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -1235,7 +1215,5 @@ def _upload_file_api_v1_files_file_path_put_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/api/runner_jobs_api.py b/src/askui/tools/askui/askui_workspaces/api/runner_jobs_api.py
index 4f1b8bc8..189f4d6a 100644
--- a/src/askui/tools/askui/askui_workspaces/api/runner_jobs_api.py
+++ b/src/askui/tools/askui/askui_workspaces/api/runner_jobs_api.py
@@ -1,30 +1,33 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-import warnings
-from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
-from typing_extensions import Annotated
-from pydantic import StrictStr
-from typing import List, Optional
-from askui.tools.askui.askui_workspaces.models.complete_runner_job_request_dto import CompleteRunnerJobRequestDto
-from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto import LeaseRunnerJobResponseDto
-from askui.tools.askui.askui_workspaces.models.ping_runner_job_response_dto import PingRunnerJobResponseDto
-from askui.tools.askui.askui_workspaces.models.runner_host import RunnerHost
+from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
+from typing_extensions import Annotated
from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized
from askui.tools.askui.askui_workspaces.api_response import ApiResponse
+from askui.tools.askui.askui_workspaces.models.complete_runner_job_request_dto import (
+ CompleteRunnerJobRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto import (
+ LeaseRunnerJobResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.ping_runner_job_response_dto import (
+ PingRunnerJobResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.runner_host import RunnerHost
from askui.tools.askui.askui_workspaces.rest import RESTResponseType
@@ -40,7 +43,6 @@ def __init__(self, api_client=None) -> None:
api_client = ApiClient.get_default()
self.api_client = api_client
-
@validate_call
def complete_api_v1_runner_jobs_complete_post(
self,
@@ -50,9 +52,8 @@ def complete_api_v1_runner_jobs_complete_post(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -86,7 +87,7 @@ def complete_api_v1_runner_jobs_complete_post(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._complete_api_v1_runner_jobs_complete_post_serialize(
ack=ack,
@@ -94,16 +95,15 @@ def complete_api_v1_runner_jobs_complete_post(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -111,7 +111,6 @@ def complete_api_v1_runner_jobs_complete_post(
response_types_map=_response_types_map,
).data
-
@validate_call
def complete_api_v1_runner_jobs_complete_post_with_http_info(
self,
@@ -121,9 +120,8 @@ def complete_api_v1_runner_jobs_complete_post_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -157,7 +155,7 @@ def complete_api_v1_runner_jobs_complete_post_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._complete_api_v1_runner_jobs_complete_post_serialize(
ack=ack,
@@ -165,16 +163,15 @@ def complete_api_v1_runner_jobs_complete_post_with_http_info(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -182,7 +179,6 @@ def complete_api_v1_runner_jobs_complete_post_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def complete_api_v1_runner_jobs_complete_post_without_preload_content(
self,
@@ -192,9 +188,8 @@ def complete_api_v1_runner_jobs_complete_post_without_preload_content(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -228,7 +223,7 @@ def complete_api_v1_runner_jobs_complete_post_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._complete_api_v1_runner_jobs_complete_post_serialize(
ack=ack,
@@ -236,20 +231,18 @@ def complete_api_v1_runner_jobs_complete_post_without_preload_content(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _complete_api_v1_runner_jobs_complete_post_serialize(
self,
ack,
@@ -259,11 +252,9 @@ def _complete_api_v1_runner_jobs_complete_post_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -275,47 +266,36 @@ def _complete_api_v1_runner_jobs_complete_post_serialize(
# process the path parameters
# process the query parameters
if ack is not None:
-
- _query_params.append(('ack', ack))
-
+ _query_params.append(("ack", ack))
+
# process the header parameters
# process the form parameters
# process the body parameter
if complete_runner_job_request_dto is not None:
_body_params = complete_runner_job_request_dto
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/runner-jobs/complete',
+ method="POST",
+ resource_path="/api/v1/runner-jobs/complete",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -325,12 +305,9 @@ def _complete_api_v1_runner_jobs_complete_post_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def lease_api_v1_runner_jobs_lease_post(
self,
@@ -342,9 +319,8 @@ def lease_api_v1_runner_jobs_lease_post(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -382,7 +358,7 @@ def lease_api_v1_runner_jobs_lease_post(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._lease_api_v1_runner_jobs_lease_post_serialize(
runner_host=runner_host,
@@ -392,16 +368,15 @@ def lease_api_v1_runner_jobs_lease_post(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "LeaseRunnerJobResponseDto",
- '422': "HTTPValidationError",
+ "200": "LeaseRunnerJobResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -409,7 +384,6 @@ def lease_api_v1_runner_jobs_lease_post(
response_types_map=_response_types_map,
).data
-
@validate_call
def lease_api_v1_runner_jobs_lease_post_with_http_info(
self,
@@ -421,9 +395,8 @@ def lease_api_v1_runner_jobs_lease_post_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -461,7 +434,7 @@ def lease_api_v1_runner_jobs_lease_post_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._lease_api_v1_runner_jobs_lease_post_serialize(
runner_host=runner_host,
@@ -471,16 +444,15 @@ def lease_api_v1_runner_jobs_lease_post_with_http_info(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "LeaseRunnerJobResponseDto",
- '422': "HTTPValidationError",
+ "200": "LeaseRunnerJobResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -488,7 +460,6 @@ def lease_api_v1_runner_jobs_lease_post_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def lease_api_v1_runner_jobs_lease_post_without_preload_content(
self,
@@ -500,9 +471,8 @@ def lease_api_v1_runner_jobs_lease_post_without_preload_content(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -540,7 +510,7 @@ def lease_api_v1_runner_jobs_lease_post_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._lease_api_v1_runner_jobs_lease_post_serialize(
runner_host=runner_host,
@@ -550,20 +520,18 @@ def lease_api_v1_runner_jobs_lease_post_without_preload_content(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "LeaseRunnerJobResponseDto",
- '422': "HTTPValidationError",
+ "200": "LeaseRunnerJobResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _lease_api_v1_runner_jobs_lease_post_serialize(
self,
runner_host,
@@ -575,11 +543,10 @@ def _lease_api_v1_runner_jobs_lease_post_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
_collection_formats: Dict[str, str] = {
- 'tags': 'multi',
+ "tags": "multi",
}
_path_params: Dict[str, str] = {}
@@ -592,44 +559,33 @@ def _lease_api_v1_runner_jobs_lease_post_serialize(
# process the path parameters
# process the query parameters
if runner_host is not None:
-
- _query_params.append(('runner_host', runner_host.value))
-
+ _query_params.append(("runner_host", runner_host.value))
+
if runner_id is not None:
-
- _query_params.append(('runner_id', runner_id))
-
+ _query_params.append(("runner_id", runner_id))
+
if workspace_id is not None:
-
- _query_params.append(('workspace_id', workspace_id))
-
+ _query_params.append(("workspace_id", workspace_id))
+
if tags is not None:
-
- _query_params.append(('tags', tags))
-
+ _query_params.append(("tags", tags))
+
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/runner-jobs/lease',
+ method="POST",
+ resource_path="/api/v1/runner-jobs/lease",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -639,12 +595,9 @@ def _lease_api_v1_runner_jobs_lease_post_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def ping_api_v1_runner_jobs_ping_post(
self,
@@ -653,9 +606,8 @@ def ping_api_v1_runner_jobs_ping_post(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -687,23 +639,22 @@ def ping_api_v1_runner_jobs_ping_post(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._ping_api_v1_runner_jobs_ping_post_serialize(
ack=ack,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "PingRunnerJobResponseDto",
- '422': "HTTPValidationError",
+ "200": "PingRunnerJobResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -711,7 +662,6 @@ def ping_api_v1_runner_jobs_ping_post(
response_types_map=_response_types_map,
).data
-
@validate_call
def ping_api_v1_runner_jobs_ping_post_with_http_info(
self,
@@ -720,9 +670,8 @@ def ping_api_v1_runner_jobs_ping_post_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -754,23 +703,22 @@ def ping_api_v1_runner_jobs_ping_post_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._ping_api_v1_runner_jobs_ping_post_serialize(
ack=ack,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "PingRunnerJobResponseDto",
- '422': "HTTPValidationError",
+ "200": "PingRunnerJobResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -778,7 +726,6 @@ def ping_api_v1_runner_jobs_ping_post_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def ping_api_v1_runner_jobs_ping_post_without_preload_content(
self,
@@ -787,9 +734,8 @@ def ping_api_v1_runner_jobs_ping_post_without_preload_content(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -821,27 +767,25 @@ def ping_api_v1_runner_jobs_ping_post_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._ping_api_v1_runner_jobs_ping_post_serialize(
ack=ack,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "PingRunnerJobResponseDto",
- '422': "HTTPValidationError",
+ "200": "PingRunnerJobResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _ping_api_v1_runner_jobs_ping_post_serialize(
self,
ack,
@@ -850,11 +794,9 @@ def _ping_api_v1_runner_jobs_ping_post_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -866,32 +808,24 @@ def _ping_api_v1_runner_jobs_ping_post_serialize(
# process the path parameters
# process the query parameters
if ack is not None:
-
- _query_params.append(('ack', ack))
-
+ _query_params.append(("ack", ack))
+
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/runner-jobs/ping',
+ method="POST",
+ resource_path="/api/v1/runner-jobs/ping",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -901,7 +835,5 @@ def _ping_api_v1_runner_jobs_ping_post_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/api/runs_api.py b/src/askui/tools/askui/askui_workspaces/api/runs_api.py
index fd54cbe1..bae6fd6d 100644
--- a/src/askui/tools/askui/askui_workspaces/api/runs_api.py
+++ b/src/askui/tools/askui/askui_workspaces/api/runs_api.py
@@ -1,26 +1,26 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-import warnings
-from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
-from typing_extensions import Annotated
-from pydantic import StrictStr
-from askui.tools.askui.askui_workspaces.models.list_runs_response_dto import ListRunsResponseDto
+from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
+from typing_extensions import Annotated
from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized
from askui.tools.askui.askui_workspaces.api_response import ApiResponse
+from askui.tools.askui.askui_workspaces.models.list_runs_response_dto import (
+ ListRunsResponseDto,
+)
from askui.tools.askui.askui_workspaces.rest import RESTResponseType
@@ -36,7 +36,6 @@ def __init__(self, api_client=None) -> None:
api_client = ApiClient.get_default()
self.api_client = api_client
-
@validate_call
def list_runs_api_v1_workspaces_workspace_id_runs_get(
self,
@@ -45,9 +44,8 @@ def list_runs_api_v1_workspaces_workspace_id_runs_get(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -79,23 +77,22 @@ def list_runs_api_v1_workspaces_workspace_id_runs_get(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_runs_api_v1_workspaces_workspace_id_runs_get_serialize(
workspace_id=workspace_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "ListRunsResponseDto",
- '422': "HTTPValidationError",
+ "200": "ListRunsResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -103,7 +100,6 @@ def list_runs_api_v1_workspaces_workspace_id_runs_get(
response_types_map=_response_types_map,
).data
-
@validate_call
def list_runs_api_v1_workspaces_workspace_id_runs_get_with_http_info(
self,
@@ -112,9 +108,8 @@ def list_runs_api_v1_workspaces_workspace_id_runs_get_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -146,23 +141,22 @@ def list_runs_api_v1_workspaces_workspace_id_runs_get_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_runs_api_v1_workspaces_workspace_id_runs_get_serialize(
workspace_id=workspace_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "ListRunsResponseDto",
- '422': "HTTPValidationError",
+ "200": "ListRunsResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -170,7 +164,6 @@ def list_runs_api_v1_workspaces_workspace_id_runs_get_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def list_runs_api_v1_workspaces_workspace_id_runs_get_without_preload_content(
self,
@@ -179,9 +172,8 @@ def list_runs_api_v1_workspaces_workspace_id_runs_get_without_preload_content(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -213,27 +205,25 @@ def list_runs_api_v1_workspaces_workspace_id_runs_get_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_runs_api_v1_workspaces_workspace_id_runs_get_serialize(
workspace_id=workspace_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "ListRunsResponseDto",
- '422': "HTTPValidationError",
+ "200": "ListRunsResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _list_runs_api_v1_workspaces_workspace_id_runs_get_serialize(
self,
workspace_id,
@@ -242,11 +232,9 @@ def _list_runs_api_v1_workspaces_workspace_id_runs_get_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -257,31 +245,24 @@ def _list_runs_api_v1_workspaces_workspace_id_runs_get_serialize(
# process the path parameters
if workspace_id is not None:
- _path_params['workspace_id'] = workspace_id
+ _path_params["workspace_id"] = workspace_id
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='GET',
- resource_path='/api/v1/workspaces/{workspace_id}/runs',
+ method="GET",
+ resource_path="/api/v1/workspaces/{workspace_id}/runs",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -291,7 +272,5 @@ def _list_runs_api_v1_workspaces_workspace_id_runs_get_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/api/schedules_api.py b/src/askui/tools/askui/askui_workspaces/api/schedules_api.py
index fc5cb2ad..1d9fdae0 100644
--- a/src/askui/tools/askui/askui_workspaces/api/schedules_api.py
+++ b/src/askui/tools/askui/askui_workspaces/api/schedules_api.py
@@ -1,27 +1,29 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-import warnings
-from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
-from typing_extensions import Annotated
-from pydantic import StrictStr
-from askui.tools.askui.askui_workspaces.models.create_schedule_request_dto import CreateScheduleRequestDto
-from askui.tools.askui.askui_workspaces.models.create_schedule_response_dto import CreateScheduleResponseDto
+from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
+from typing_extensions import Annotated
from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized
from askui.tools.askui.askui_workspaces.api_response import ApiResponse
+from askui.tools.askui.askui_workspaces.models.create_schedule_request_dto import (
+ CreateScheduleRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_schedule_response_dto import (
+ CreateScheduleResponseDto,
+)
from askui.tools.askui.askui_workspaces.rest import RESTResponseType
@@ -37,7 +39,6 @@ def __init__(self, api_client=None) -> None:
api_client = ApiClient.get_default()
self.api_client = api_client
-
@validate_call
def create_schedule_api_v1_workspaces_workspace_id_schedules_post(
self,
@@ -47,9 +48,8 @@ def create_schedule_api_v1_workspaces_workspace_id_schedules_post(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -83,7 +83,7 @@ def create_schedule_api_v1_workspaces_workspace_id_schedules_post(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_schedule_api_v1_workspaces_workspace_id_schedules_post_serialize(
workspace_id=workspace_id,
@@ -91,16 +91,15 @@ def create_schedule_api_v1_workspaces_workspace_id_schedules_post(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "CreateScheduleResponseDto",
- '422': "HTTPValidationError",
+ "201": "CreateScheduleResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -108,7 +107,6 @@ def create_schedule_api_v1_workspaces_workspace_id_schedules_post(
response_types_map=_response_types_map,
).data
-
@validate_call
def create_schedule_api_v1_workspaces_workspace_id_schedules_post_with_http_info(
self,
@@ -118,9 +116,8 @@ def create_schedule_api_v1_workspaces_workspace_id_schedules_post_with_http_info
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -154,7 +151,7 @@ def create_schedule_api_v1_workspaces_workspace_id_schedules_post_with_http_info
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_schedule_api_v1_workspaces_workspace_id_schedules_post_serialize(
workspace_id=workspace_id,
@@ -162,16 +159,15 @@ def create_schedule_api_v1_workspaces_workspace_id_schedules_post_with_http_info
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "CreateScheduleResponseDto",
- '422': "HTTPValidationError",
+ "201": "CreateScheduleResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -179,7 +175,6 @@ def create_schedule_api_v1_workspaces_workspace_id_schedules_post_with_http_info
response_types_map=_response_types_map,
)
-
@validate_call
def create_schedule_api_v1_workspaces_workspace_id_schedules_post_without_preload_content(
self,
@@ -189,9 +184,8 @@ def create_schedule_api_v1_workspaces_workspace_id_schedules_post_without_preloa
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -225,7 +219,7 @@ def create_schedule_api_v1_workspaces_workspace_id_schedules_post_without_preloa
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_schedule_api_v1_workspaces_workspace_id_schedules_post_serialize(
workspace_id=workspace_id,
@@ -233,20 +227,18 @@ def create_schedule_api_v1_workspaces_workspace_id_schedules_post_without_preloa
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "CreateScheduleResponseDto",
- '422': "HTTPValidationError",
+ "201": "CreateScheduleResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _create_schedule_api_v1_workspaces_workspace_id_schedules_post_serialize(
self,
workspace_id,
@@ -256,11 +248,9 @@ def _create_schedule_api_v1_workspaces_workspace_id_schedules_post_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -271,7 +261,7 @@ def _create_schedule_api_v1_workspaces_workspace_id_schedules_post_serialize(
# process the path parameters
if workspace_id is not None:
- _path_params['workspace_id'] = workspace_id
+ _path_params["workspace_id"] = workspace_id
# process the query parameters
# process the header parameters
# process the form parameters
@@ -279,38 +269,28 @@ def _create_schedule_api_v1_workspaces_workspace_id_schedules_post_serialize(
if create_schedule_request_dto is not None:
_body_params = create_schedule_request_dto
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/workspaces/{workspace_id}/schedules',
+ method="POST",
+ resource_path="/api/v1/workspaces/{workspace_id}/schedules",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -320,12 +300,9 @@ def _create_schedule_api_v1_workspaces_workspace_id_schedules_post_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspend_post(
self,
@@ -335,9 +312,8 @@ def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspen
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -371,7 +347,7 @@ def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspen
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspend_post_serialize(
schedule_id=schedule_id,
@@ -379,16 +355,15 @@ def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspen
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -396,7 +371,6 @@ def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspen
response_types_map=_response_types_map,
).data
-
@validate_call
def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspend_post_with_http_info(
self,
@@ -406,9 +380,8 @@ def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspen
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -442,7 +415,7 @@ def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspen
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspend_post_serialize(
schedule_id=schedule_id,
@@ -450,16 +423,15 @@ def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspen
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -467,7 +439,6 @@ def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspen
response_types_map=_response_types_map,
)
-
@validate_call
def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspend_post_without_preload_content(
self,
@@ -477,9 +448,8 @@ def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspen
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -513,7 +483,7 @@ def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspen
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspend_post_serialize(
schedule_id=schedule_id,
@@ -521,20 +491,18 @@ def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspen
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspend_post_serialize(
self,
schedule_id,
@@ -544,11 +512,9 @@ def _suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspe
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -559,33 +525,26 @@ def _suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspe
# process the path parameters
if schedule_id is not None:
- _path_params['schedule_id'] = schedule_id
+ _path_params["schedule_id"] = schedule_id
if workspace_id is not None:
- _path_params['workspace_id'] = workspace_id
+ _path_params["workspace_id"] = workspace_id
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/workspaces/{workspace_id}/schedules/{schedule_id}/suspend',
+ method="POST",
+ resource_path="/api/v1/workspaces/{workspace_id}/schedules/{schedule_id}/suspend",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -595,7 +554,5 @@ def _suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspe
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/api/tools_api.py b/src/askui/tools/askui/askui_workspaces/api/tools_api.py
index 96d8d864..0d9220de 100644
--- a/src/askui/tools/askui/askui_workspaces/api/tools_api.py
+++ b/src/askui/tools/askui/askui_workspaces/api/tools_api.py
@@ -1,26 +1,29 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-import warnings
-from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
-from typing_extensions import Annotated
-from askui.tools.askui.askui_workspaces.models.extract_data_command import ExtractDataCommand
-from askui.tools.askui.askui_workspaces.models.extract_data_response import ExtractDataResponse
+from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
+from typing_extensions import Annotated
from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized
from askui.tools.askui.askui_workspaces.api_response import ApiResponse
+from askui.tools.askui.askui_workspaces.models.extract_data_command import (
+ ExtractDataCommand,
+)
+from askui.tools.askui.askui_workspaces.models.extract_data_response import (
+ ExtractDataResponse,
+)
from askui.tools.askui.askui_workspaces.rest import RESTResponseType
@@ -36,7 +39,6 @@ def __init__(self, api_client=None) -> None:
api_client = ApiClient.get_default()
self.api_client = api_client
-
@validate_call
def extract_data_api_v1_tools_extract_data_post(
self,
@@ -45,9 +47,8 @@ def extract_data_api_v1_tools_extract_data_post(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -80,27 +81,26 @@ def extract_data_api_v1_tools_extract_data_post(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._extract_data_api_v1_tools_extract_data_post_serialize(
extract_data_command=extract_data_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "ExtractDataResponse",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '409': "StringErrorResponse",
- '422': "StringErrorResponse",
- '500': "StringErrorResponse",
+ "200": "ExtractDataResponse",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "409": "StringErrorResponse",
+ "422": "StringErrorResponse",
+ "500": "StringErrorResponse",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -108,7 +108,6 @@ def extract_data_api_v1_tools_extract_data_post(
response_types_map=_response_types_map,
).data
-
@validate_call
def extract_data_api_v1_tools_extract_data_post_with_http_info(
self,
@@ -117,9 +116,8 @@ def extract_data_api_v1_tools_extract_data_post_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -152,27 +150,26 @@ def extract_data_api_v1_tools_extract_data_post_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._extract_data_api_v1_tools_extract_data_post_serialize(
extract_data_command=extract_data_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "ExtractDataResponse",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '409': "StringErrorResponse",
- '422': "StringErrorResponse",
- '500': "StringErrorResponse",
+ "200": "ExtractDataResponse",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "409": "StringErrorResponse",
+ "422": "StringErrorResponse",
+ "500": "StringErrorResponse",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -180,7 +177,6 @@ def extract_data_api_v1_tools_extract_data_post_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def extract_data_api_v1_tools_extract_data_post_without_preload_content(
self,
@@ -189,9 +185,8 @@ def extract_data_api_v1_tools_extract_data_post_without_preload_content(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -224,31 +219,29 @@ def extract_data_api_v1_tools_extract_data_post_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._extract_data_api_v1_tools_extract_data_post_serialize(
extract_data_command=extract_data_command,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "ExtractDataResponse",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '409': "StringErrorResponse",
- '422': "StringErrorResponse",
- '500': "StringErrorResponse",
+ "200": "ExtractDataResponse",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "409": "StringErrorResponse",
+ "422": "StringErrorResponse",
+ "500": "StringErrorResponse",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _extract_data_api_v1_tools_extract_data_post_serialize(
self,
extract_data_command,
@@ -257,11 +250,9 @@ def _extract_data_api_v1_tools_extract_data_post_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -278,38 +269,28 @@ def _extract_data_api_v1_tools_extract_data_post_serialize(
if extract_data_command is not None:
_body_params = extract_data_command
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/tools/extract-data',
+ method="POST",
+ resource_path="/api/v1/tools/extract-data",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -319,7 +300,5 @@ def _extract_data_api_v1_tools_extract_data_post_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/api/usage_api.py b/src/askui/tools/askui/askui_workspaces/api/usage_api.py
index 31cb7367..402305ab 100644
--- a/src/askui/tools/askui/askui_workspaces/api/usage_api.py
+++ b/src/askui/tools/askui/askui_workspaces/api/usage_api.py
@@ -1,29 +1,27 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-import warnings
-from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from datetime import datetime
from typing import Any, Dict, List, Optional, Tuple, Union
-from typing_extensions import Annotated
-from datetime import datetime
-from pydantic import Field, StrictStr, field_validator
-from typing import List, Optional
+from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
from typing_extensions import Annotated
-from askui.tools.askui.askui_workspaces.models.usage_events_list_response import UsageEventsListResponse
from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized
from askui.tools.askui.askui_workspaces.api_response import ApiResponse
+from askui.tools.askui.askui_workspaces.models.usage_events_list_response import (
+ UsageEventsListResponse,
+)
from askui.tools.askui.askui_workspaces.rest import RESTResponseType
@@ -39,25 +37,57 @@ def __init__(self, api_client=None) -> None:
api_client = ApiClient.get_default()
self.api_client = api_client
-
@validate_call
def list_usage_events_api_v1_usage_events_get(
self,
- workspace_id: Annotated[Optional[List[StrictStr]], Field(description="Filter by workspace IDs")] = None,
- user_id: Annotated[Optional[List[StrictStr]], Field(description="Filter by user IDs")] = None,
- access_token_id: Annotated[Optional[List[StrictStr]], Field(description="Filter events by access token IDs **IMPORTANT**: This is not the same as the access token used in the authorization header of the request as this would be insecure but the id of the token. The id can be look up using the access token lookup endpoint.")] = None,
- start_time: Annotated[Optional[datetime], Field(description="Include events starting from this time (inclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`")] = None,
- end_time: Annotated[Optional[datetime], Field(description="Include events until this time (exclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`")] = None,
- starting_after: Annotated[Optional[StrictStr], Field(description="Return events after this event ID; to be used for pagination, won't change the `total_count`")] = None,
- limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Maximum number of events to return (in the response). The lower the faster the response time (less memory consumption or bandwidth).")] = None,
- expand: Annotated[Optional[List[StrictStr]], Field(description="Include additional fields in the response. - The total count represents all the number of events that match the query, not only the ones returned in the response, but is only accurate up to 100000 events.")] = None,
+ workspace_id: Annotated[
+ Optional[List[StrictStr]], Field(description="Filter by workspace IDs")
+ ] = None,
+ user_id: Annotated[
+ Optional[List[StrictStr]], Field(description="Filter by user IDs")
+ ] = None,
+ access_token_id: Annotated[
+ Optional[List[StrictStr]],
+ Field(
+ description="Filter events by access token IDs **IMPORTANT**: This is not the same as the access token used in the authorization header of the request as this would be insecure but the id of the token. The id can be look up using the access token lookup endpoint."
+ ),
+ ] = None,
+ start_time: Annotated[
+ Optional[datetime],
+ Field(
+ description="Include events starting from this time (inclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`"
+ ),
+ ] = None,
+ end_time: Annotated[
+ Optional[datetime],
+ Field(
+ description="Include events until this time (exclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`"
+ ),
+ ] = None,
+ starting_after: Annotated[
+ Optional[StrictStr],
+ Field(
+ description="Return events after this event ID; to be used for pagination, won't change the `total_count`"
+ ),
+ ] = None,
+ limit: Annotated[
+ Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
+ Field(
+ description="Maximum number of events to return (in the response). The lower the faster the response time (less memory consumption or bandwidth)."
+ ),
+ ] = None,
+ expand: Annotated[
+ Optional[List[StrictStr]],
+ Field(
+ description="Include additional fields in the response. - The total count represents all the number of events that match the query, not only the ones returned in the response, but is only accurate up to 100000 events."
+ ),
+ ] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -104,7 +134,7 @@ def list_usage_events_api_v1_usage_events_get(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_usage_events_api_v1_usage_events_get_serialize(
workspace_id=workspace_id,
@@ -118,19 +148,18 @@ def list_usage_events_api_v1_usage_events_get(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "UsageEventsListResponse",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "UsageEventsListResponse",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -138,25 +167,57 @@ def list_usage_events_api_v1_usage_events_get(
response_types_map=_response_types_map,
).data
-
@validate_call
def list_usage_events_api_v1_usage_events_get_with_http_info(
self,
- workspace_id: Annotated[Optional[List[StrictStr]], Field(description="Filter by workspace IDs")] = None,
- user_id: Annotated[Optional[List[StrictStr]], Field(description="Filter by user IDs")] = None,
- access_token_id: Annotated[Optional[List[StrictStr]], Field(description="Filter events by access token IDs **IMPORTANT**: This is not the same as the access token used in the authorization header of the request as this would be insecure but the id of the token. The id can be look up using the access token lookup endpoint.")] = None,
- start_time: Annotated[Optional[datetime], Field(description="Include events starting from this time (inclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`")] = None,
- end_time: Annotated[Optional[datetime], Field(description="Include events until this time (exclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`")] = None,
- starting_after: Annotated[Optional[StrictStr], Field(description="Return events after this event ID; to be used for pagination, won't change the `total_count`")] = None,
- limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Maximum number of events to return (in the response). The lower the faster the response time (less memory consumption or bandwidth).")] = None,
- expand: Annotated[Optional[List[StrictStr]], Field(description="Include additional fields in the response. - The total count represents all the number of events that match the query, not only the ones returned in the response, but is only accurate up to 100000 events.")] = None,
+ workspace_id: Annotated[
+ Optional[List[StrictStr]], Field(description="Filter by workspace IDs")
+ ] = None,
+ user_id: Annotated[
+ Optional[List[StrictStr]], Field(description="Filter by user IDs")
+ ] = None,
+ access_token_id: Annotated[
+ Optional[List[StrictStr]],
+ Field(
+ description="Filter events by access token IDs **IMPORTANT**: This is not the same as the access token used in the authorization header of the request as this would be insecure but the id of the token. The id can be look up using the access token lookup endpoint."
+ ),
+ ] = None,
+ start_time: Annotated[
+ Optional[datetime],
+ Field(
+ description="Include events starting from this time (inclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`"
+ ),
+ ] = None,
+ end_time: Annotated[
+ Optional[datetime],
+ Field(
+ description="Include events until this time (exclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`"
+ ),
+ ] = None,
+ starting_after: Annotated[
+ Optional[StrictStr],
+ Field(
+ description="Return events after this event ID; to be used for pagination, won't change the `total_count`"
+ ),
+ ] = None,
+ limit: Annotated[
+ Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
+ Field(
+ description="Maximum number of events to return (in the response). The lower the faster the response time (less memory consumption or bandwidth)."
+ ),
+ ] = None,
+ expand: Annotated[
+ Optional[List[StrictStr]],
+ Field(
+ description="Include additional fields in the response. - The total count represents all the number of events that match the query, not only the ones returned in the response, but is only accurate up to 100000 events."
+ ),
+ ] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -203,7 +264,7 @@ def list_usage_events_api_v1_usage_events_get_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_usage_events_api_v1_usage_events_get_serialize(
workspace_id=workspace_id,
@@ -217,19 +278,18 @@ def list_usage_events_api_v1_usage_events_get_with_http_info(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "UsageEventsListResponse",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "UsageEventsListResponse",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -237,25 +297,57 @@ def list_usage_events_api_v1_usage_events_get_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def list_usage_events_api_v1_usage_events_get_without_preload_content(
self,
- workspace_id: Annotated[Optional[List[StrictStr]], Field(description="Filter by workspace IDs")] = None,
- user_id: Annotated[Optional[List[StrictStr]], Field(description="Filter by user IDs")] = None,
- access_token_id: Annotated[Optional[List[StrictStr]], Field(description="Filter events by access token IDs **IMPORTANT**: This is not the same as the access token used in the authorization header of the request as this would be insecure but the id of the token. The id can be look up using the access token lookup endpoint.")] = None,
- start_time: Annotated[Optional[datetime], Field(description="Include events starting from this time (inclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`")] = None,
- end_time: Annotated[Optional[datetime], Field(description="Include events until this time (exclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`")] = None,
- starting_after: Annotated[Optional[StrictStr], Field(description="Return events after this event ID; to be used for pagination, won't change the `total_count`")] = None,
- limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Maximum number of events to return (in the response). The lower the faster the response time (less memory consumption or bandwidth).")] = None,
- expand: Annotated[Optional[List[StrictStr]], Field(description="Include additional fields in the response. - The total count represents all the number of events that match the query, not only the ones returned in the response, but is only accurate up to 100000 events.")] = None,
+ workspace_id: Annotated[
+ Optional[List[StrictStr]], Field(description="Filter by workspace IDs")
+ ] = None,
+ user_id: Annotated[
+ Optional[List[StrictStr]], Field(description="Filter by user IDs")
+ ] = None,
+ access_token_id: Annotated[
+ Optional[List[StrictStr]],
+ Field(
+ description="Filter events by access token IDs **IMPORTANT**: This is not the same as the access token used in the authorization header of the request as this would be insecure but the id of the token. The id can be look up using the access token lookup endpoint."
+ ),
+ ] = None,
+ start_time: Annotated[
+ Optional[datetime],
+ Field(
+ description="Include events starting from this time (inclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`"
+ ),
+ ] = None,
+ end_time: Annotated[
+ Optional[datetime],
+ Field(
+ description="Include events until this time (exclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`"
+ ),
+ ] = None,
+ starting_after: Annotated[
+ Optional[StrictStr],
+ Field(
+ description="Return events after this event ID; to be used for pagination, won't change the `total_count`"
+ ),
+ ] = None,
+ limit: Annotated[
+ Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
+ Field(
+ description="Maximum number of events to return (in the response). The lower the faster the response time (less memory consumption or bandwidth)."
+ ),
+ ] = None,
+ expand: Annotated[
+ Optional[List[StrictStr]],
+ Field(
+ description="Include additional fields in the response. - The total count represents all the number of events that match the query, not only the ones returned in the response, but is only accurate up to 100000 events."
+ ),
+ ] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -302,7 +394,7 @@ def list_usage_events_api_v1_usage_events_get_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._list_usage_events_api_v1_usage_events_get_serialize(
workspace_id=workspace_id,
@@ -316,23 +408,21 @@ def list_usage_events_api_v1_usage_events_get_without_preload_content(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "UsageEventsListResponse",
- '401': "StringErrorResponse",
- '403': "StringErrorResponse",
- '500': "StringErrorResponse",
- '422': "HTTPValidationError",
+ "200": "UsageEventsListResponse",
+ "401": "StringErrorResponse",
+ "403": "StringErrorResponse",
+ "500": "StringErrorResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _list_usage_events_api_v1_usage_events_get_serialize(
self,
workspace_id,
@@ -348,14 +438,13 @@ def _list_usage_events_api_v1_usage_events_get_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
_collection_formats: Dict[str, str] = {
- 'workspace_id': 'multi',
- 'user_id': 'multi',
- 'access_token_id': 'multi',
- 'expand': 'multi',
+ "workspace_id": "multi",
+ "user_id": "multi",
+ "access_token_id": "multi",
+ "expand": "multi",
}
_path_params: Dict[str, str] = {}
@@ -368,78 +457,65 @@ def _list_usage_events_api_v1_usage_events_get_serialize(
# process the path parameters
# process the query parameters
if workspace_id is not None:
-
- _query_params.append(('workspace_id', workspace_id))
-
+ _query_params.append(("workspace_id", workspace_id))
+
if user_id is not None:
-
- _query_params.append(('user_id', user_id))
-
+ _query_params.append(("user_id", user_id))
+
if access_token_id is not None:
-
- _query_params.append(('access_token_id', access_token_id))
-
+ _query_params.append(("access_token_id", access_token_id))
+
if start_time is not None:
if isinstance(start_time, datetime):
_query_params.append(
(
- 'start_time',
+ "start_time",
start_time.strftime(
self.api_client.configuration.datetime_format
- )
+ ),
)
)
else:
- _query_params.append(('start_time', start_time))
-
+ _query_params.append(("start_time", start_time))
+
if end_time is not None:
if isinstance(end_time, datetime):
_query_params.append(
(
- 'end_time',
+ "end_time",
end_time.strftime(
self.api_client.configuration.datetime_format
- )
+ ),
)
)
else:
- _query_params.append(('end_time', end_time))
-
+ _query_params.append(("end_time", end_time))
+
if starting_after is not None:
-
- _query_params.append(('starting_after', starting_after))
-
+ _query_params.append(("starting_after", starting_after))
+
if limit is not None:
-
- _query_params.append(('limit', limit))
-
+ _query_params.append(("limit", limit))
+
if expand is not None:
-
- _query_params.append(('expand', expand))
-
+ _query_params.append(("expand", expand))
+
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='GET',
- resource_path='/api/v1/usage/events',
+ method="GET",
+ resource_path="/api/v1/usage/events",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -449,7 +525,5 @@ def _list_usage_events_api_v1_usage_events_get_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/api/workspace_memberships_api.py b/src/askui/tools/askui/askui_workspaces/api/workspace_memberships_api.py
index d34be958..cff76c1d 100644
--- a/src/askui/tools/askui/askui_workspaces/api/workspace_memberships_api.py
+++ b/src/askui/tools/askui/askui_workspaces/api/workspace_memberships_api.py
@@ -1,30 +1,42 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
import warnings
-from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
-from typing_extensions import Annotated
-from pydantic import StrictStr, field_validator
-from typing import List, Optional
-from askui.tools.askui.askui_workspaces.models.create_workspace_membership_request_dto import CreateWorkspaceMembershipRequestDto
-from askui.tools.askui.askui_workspaces.models.create_workspace_membership_response_dto import CreateWorkspaceMembershipResponseDto
-from askui.tools.askui.askui_workspaces.models.workspace_memberships_list_response import WorkspaceMembershipsListResponse
-from askui.tools.askui.askui_workspaces.models.workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto import WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto
+from pydantic import (
+ Field,
+ StrictFloat,
+ StrictInt,
+ StrictStr,
+ validate_call,
+)
+from typing_extensions import Annotated
from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized
from askui.tools.askui.askui_workspaces.api_response import ApiResponse
+from askui.tools.askui.askui_workspaces.models.create_workspace_membership_request_dto import (
+ CreateWorkspaceMembershipRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_membership_response_dto import (
+ CreateWorkspaceMembershipResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.workspace_memberships_list_response import (
+ WorkspaceMembershipsListResponse,
+)
+from askui.tools.askui.askui_workspaces.models.workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto import (
+ WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto,
+)
from askui.tools.askui.askui_workspaces.rest import RESTResponseType
@@ -40,7 +52,6 @@ def __init__(self, api_client=None) -> None:
api_client = ApiClient.get_default()
self.api_client = api_client
-
@validate_call
def create_workspace_membership_api_v1_workspace_memberships_post(
self,
@@ -49,9 +60,8 @@ def create_workspace_membership_api_v1_workspace_memberships_post(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -83,23 +93,22 @@ def create_workspace_membership_api_v1_workspace_memberships_post(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_workspace_membership_api_v1_workspace_memberships_post_serialize(
create_workspace_membership_request_dto=create_workspace_membership_request_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "CreateWorkspaceMembershipResponseDto",
- '422': "HTTPValidationError",
+ "200": "CreateWorkspaceMembershipResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -107,7 +116,6 @@ def create_workspace_membership_api_v1_workspace_memberships_post(
response_types_map=_response_types_map,
).data
-
@validate_call
def create_workspace_membership_api_v1_workspace_memberships_post_with_http_info(
self,
@@ -116,9 +124,8 @@ def create_workspace_membership_api_v1_workspace_memberships_post_with_http_info
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -150,23 +157,22 @@ def create_workspace_membership_api_v1_workspace_memberships_post_with_http_info
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_workspace_membership_api_v1_workspace_memberships_post_serialize(
create_workspace_membership_request_dto=create_workspace_membership_request_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "CreateWorkspaceMembershipResponseDto",
- '422': "HTTPValidationError",
+ "200": "CreateWorkspaceMembershipResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -174,7 +180,6 @@ def create_workspace_membership_api_v1_workspace_memberships_post_with_http_info
response_types_map=_response_types_map,
)
-
@validate_call
def create_workspace_membership_api_v1_workspace_memberships_post_without_preload_content(
self,
@@ -183,9 +188,8 @@ def create_workspace_membership_api_v1_workspace_memberships_post_without_preloa
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -217,27 +221,25 @@ def create_workspace_membership_api_v1_workspace_memberships_post_without_preloa
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_workspace_membership_api_v1_workspace_memberships_post_serialize(
create_workspace_membership_request_dto=create_workspace_membership_request_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "CreateWorkspaceMembershipResponseDto",
- '422': "HTTPValidationError",
+ "200": "CreateWorkspaceMembershipResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _create_workspace_membership_api_v1_workspace_memberships_post_serialize(
self,
create_workspace_membership_request_dto,
@@ -246,11 +248,9 @@ def _create_workspace_membership_api_v1_workspace_memberships_post_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -267,38 +267,28 @@ def _create_workspace_membership_api_v1_workspace_memberships_post_serialize(
if create_workspace_membership_request_dto is not None:
_body_params = create_workspace_membership_request_dto
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/workspace-memberships',
+ method="POST",
+ resource_path="/api/v1/workspace-memberships",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -308,12 +298,9 @@ def _create_workspace_membership_api_v1_workspace_memberships_post_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def delete_workspace_membership_api_v1_workspace_memberships_workspace_membership_id_delete(
self,
@@ -322,9 +309,8 @@ def delete_workspace_membership_api_v1_workspace_memberships_workspace_membershi
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -356,24 +342,23 @@ def delete_workspace_membership_api_v1_workspace_memberships_workspace_membershi
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._delete_workspace_membership_api_v1_workspace_memberships_workspace_membership_id_delete_serialize(
workspace_membership_id=workspace_membership_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '409': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "409": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -381,7 +366,6 @@ def delete_workspace_membership_api_v1_workspace_memberships_workspace_membershi
response_types_map=_response_types_map,
).data
-
@validate_call
def delete_workspace_membership_api_v1_workspace_memberships_workspace_membership_id_delete_with_http_info(
self,
@@ -390,9 +374,8 @@ def delete_workspace_membership_api_v1_workspace_memberships_workspace_membershi
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -424,24 +407,23 @@ def delete_workspace_membership_api_v1_workspace_memberships_workspace_membershi
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._delete_workspace_membership_api_v1_workspace_memberships_workspace_membership_id_delete_serialize(
workspace_membership_id=workspace_membership_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '409': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "409": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -449,7 +431,6 @@ def delete_workspace_membership_api_v1_workspace_memberships_workspace_membershi
response_types_map=_response_types_map,
)
-
@validate_call
def delete_workspace_membership_api_v1_workspace_memberships_workspace_membership_id_delete_without_preload_content(
self,
@@ -458,9 +439,8 @@ def delete_workspace_membership_api_v1_workspace_memberships_workspace_membershi
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -492,28 +472,26 @@ def delete_workspace_membership_api_v1_workspace_memberships_workspace_membershi
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._delete_workspace_membership_api_v1_workspace_memberships_workspace_membership_id_delete_serialize(
workspace_membership_id=workspace_membership_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '409': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "409": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _delete_workspace_membership_api_v1_workspace_memberships_workspace_membership_id_delete_serialize(
self,
workspace_membership_id,
@@ -522,11 +500,9 @@ def _delete_workspace_membership_api_v1_workspace_memberships_workspace_membersh
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -537,31 +513,24 @@ def _delete_workspace_membership_api_v1_workspace_memberships_workspace_membersh
# process the path parameters
if workspace_membership_id is not None:
- _path_params['workspace_membership_id'] = workspace_membership_id
+ _path_params["workspace_membership_id"] = workspace_membership_id
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='DELETE',
- resource_path='/api/v1/workspace-memberships/{workspace_membership_id}',
+ method="DELETE",
+ resource_path="/api/v1/workspace-memberships/{workspace_membership_id}",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -571,12 +540,9 @@ def _delete_workspace_membership_api_v1_workspace_memberships_workspace_membersh
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get(
self,
@@ -586,15 +552,16 @@ def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
- ) -> List[WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto]:
+ ) -> List[
+ WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto
+ ]:
"""(Deprecated) List Workspace Membership
@@ -622,8 +589,11 @@ def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
- warnings.warn("GET /api/v1/users/{user_id}/workspace-memberships is deprecated.", DeprecationWarning)
+ """ # noqa: E501
+ warnings.warn(
+ "GET /api/v1/users/{user_id}/workspace-memberships is deprecated.",
+ DeprecationWarning,
+ )
_param = self._list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_serialize(
user_id=user_id,
@@ -631,16 +601,15 @@ def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "List[WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto]",
- '422': "HTTPValidationError",
+ "200": "List[WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto]",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -648,7 +617,6 @@ def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get(
response_types_map=_response_types_map,
).data
-
@validate_call
def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_with_http_info(
self,
@@ -658,15 +626,18 @@ def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_wit
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
- ) -> ApiResponse[List[WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto]]:
+ ) -> ApiResponse[
+ List[
+ WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto
+ ]
+ ]:
"""(Deprecated) List Workspace Membership
@@ -694,8 +665,11 @@ def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_wit
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
- warnings.warn("GET /api/v1/users/{user_id}/workspace-memberships is deprecated.", DeprecationWarning)
+ """ # noqa: E501
+ warnings.warn(
+ "GET /api/v1/users/{user_id}/workspace-memberships is deprecated.",
+ DeprecationWarning,
+ )
_param = self._list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_serialize(
user_id=user_id,
@@ -703,16 +677,15 @@ def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_wit
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "List[WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto]",
- '422': "HTTPValidationError",
+ "200": "List[WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto]",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -720,7 +693,6 @@ def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_wit
response_types_map=_response_types_map,
)
-
@validate_call
def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_without_preload_content(
self,
@@ -730,9 +702,8 @@ def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_wit
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -766,8 +737,11 @@ def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_wit
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
- warnings.warn("GET /api/v1/users/{user_id}/workspace-memberships is deprecated.", DeprecationWarning)
+ """ # noqa: E501
+ warnings.warn(
+ "GET /api/v1/users/{user_id}/workspace-memberships is deprecated.",
+ DeprecationWarning,
+ )
_param = self._list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_serialize(
user_id=user_id,
@@ -775,20 +749,18 @@ def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_wit
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "List[WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto]",
- '422': "HTTPValidationError",
+ "200": "List[WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto]",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_serialize(
self,
user_id,
@@ -798,11 +770,9 @@ def _list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_se
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -813,35 +783,27 @@ def _list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_se
# process the path parameters
if user_id is not None:
- _path_params['user_id'] = user_id
+ _path_params["user_id"] = user_id
# process the query parameters
if expand is not None:
-
- _query_params.append(('expand', expand))
-
+ _query_params.append(("expand", expand))
+
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='GET',
- resource_path='/api/v1/users/{user_id}/workspace-memberships',
+ method="GET",
+ resource_path="/api/v1/users/{user_id}/workspace-memberships",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -851,12 +813,9 @@ def _list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_se
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def list_workspace_memberships_api_v1_workspace_memberships_get(
self,
@@ -867,9 +826,8 @@ def list_workspace_memberships_api_v1_workspace_memberships_get(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -905,25 +863,26 @@ def list_workspace_memberships_api_v1_workspace_memberships_get(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
-
- _param = self._list_workspace_memberships_api_v1_workspace_memberships_get_serialize(
- user_id=user_id,
- workspace_id=workspace_id,
- expand=expand,
- _request_auth=_request_auth,
- _content_type=_content_type,
- _headers=_headers,
- _host_index=_host_index
+ """ # noqa: E501
+
+ _param = (
+ self._list_workspace_memberships_api_v1_workspace_memberships_get_serialize(
+ user_id=user_id,
+ workspace_id=workspace_id,
+ expand=expand,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index,
+ )
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "WorkspaceMembershipsListResponse",
- '422': "HTTPValidationError",
+ "200": "WorkspaceMembershipsListResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -931,7 +890,6 @@ def list_workspace_memberships_api_v1_workspace_memberships_get(
response_types_map=_response_types_map,
).data
-
@validate_call
def list_workspace_memberships_api_v1_workspace_memberships_get_with_http_info(
self,
@@ -942,9 +900,8 @@ def list_workspace_memberships_api_v1_workspace_memberships_get_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -980,25 +937,26 @@ def list_workspace_memberships_api_v1_workspace_memberships_get_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
-
- _param = self._list_workspace_memberships_api_v1_workspace_memberships_get_serialize(
- user_id=user_id,
- workspace_id=workspace_id,
- expand=expand,
- _request_auth=_request_auth,
- _content_type=_content_type,
- _headers=_headers,
- _host_index=_host_index
+ """ # noqa: E501
+
+ _param = (
+ self._list_workspace_memberships_api_v1_workspace_memberships_get_serialize(
+ user_id=user_id,
+ workspace_id=workspace_id,
+ expand=expand,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index,
+ )
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "WorkspaceMembershipsListResponse",
- '422': "HTTPValidationError",
+ "200": "WorkspaceMembershipsListResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -1006,7 +964,6 @@ def list_workspace_memberships_api_v1_workspace_memberships_get_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def list_workspace_memberships_api_v1_workspace_memberships_get_without_preload_content(
self,
@@ -1017,9 +974,8 @@ def list_workspace_memberships_api_v1_workspace_memberships_get_without_preload_
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -1055,29 +1011,29 @@ def list_workspace_memberships_api_v1_workspace_memberships_get_without_preload_
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
-
- _param = self._list_workspace_memberships_api_v1_workspace_memberships_get_serialize(
- user_id=user_id,
- workspace_id=workspace_id,
- expand=expand,
- _request_auth=_request_auth,
- _content_type=_content_type,
- _headers=_headers,
- _host_index=_host_index
+ """ # noqa: E501
+
+ _param = (
+ self._list_workspace_memberships_api_v1_workspace_memberships_get_serialize(
+ user_id=user_id,
+ workspace_id=workspace_id,
+ expand=expand,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index,
+ )
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "WorkspaceMembershipsListResponse",
- '422': "HTTPValidationError",
+ "200": "WorkspaceMembershipsListResponse",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _list_workspace_memberships_api_v1_workspace_memberships_get_serialize(
self,
user_id,
@@ -1088,13 +1044,12 @@ def _list_workspace_memberships_api_v1_workspace_memberships_get_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
_collection_formats: Dict[str, str] = {
- 'user_id': 'multi',
- 'workspace_id': 'multi',
- 'expand': 'multi',
+ "user_id": "multi",
+ "workspace_id": "multi",
+ "expand": "multi",
}
_path_params: Dict[str, str] = {}
@@ -1107,40 +1062,30 @@ def _list_workspace_memberships_api_v1_workspace_memberships_get_serialize(
# process the path parameters
# process the query parameters
if user_id is not None:
-
- _query_params.append(('user_id', user_id))
-
+ _query_params.append(("user_id", user_id))
+
if workspace_id is not None:
-
- _query_params.append(('workspace_id', workspace_id))
-
+ _query_params.append(("workspace_id", workspace_id))
+
if expand is not None:
-
- _query_params.append(('expand', expand))
-
+ _query_params.append(("expand", expand))
+
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='GET',
- resource_path='/api/v1/workspace-memberships',
+ method="GET",
+ resource_path="/api/v1/workspace-memberships",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -1150,7 +1095,5 @@ def _list_workspace_memberships_api_v1_workspace_memberships_get_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/api/workspaces_api.py b/src/askui/tools/askui/askui_workspaces/api/workspaces_api.py
index 88977906..0b62346e 100644
--- a/src/askui/tools/askui/askui_workspaces/api/workspaces_api.py
+++ b/src/askui/tools/askui/askui_workspaces/api/workspaces_api.py
@@ -1,30 +1,35 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-import warnings
-from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
-from typing_extensions import Annotated
-from pydantic import StrictStr, field_validator
-from typing import Optional
-from askui.tools.askui.askui_workspaces.models.create_workspace_request_dto import CreateWorkspaceRequestDto
-from askui.tools.askui.askui_workspaces.models.create_workspace_response_dto import CreateWorkspaceResponseDto
-from askui.tools.askui.askui_workspaces.models.update_workspace_name_request_dto import UpdateWorkspaceNameRequestDto
-from askui.tools.askui.askui_workspaces.models.update_workspace_name_response_dto import UpdateWorkspaceNameResponseDto
+from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
+from typing_extensions import Annotated
from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized
from askui.tools.askui.askui_workspaces.api_response import ApiResponse
+from askui.tools.askui.askui_workspaces.models.create_workspace_request_dto import (
+ CreateWorkspaceRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_response_dto import (
+ CreateWorkspaceResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.update_workspace_name_request_dto import (
+ UpdateWorkspaceNameRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.update_workspace_name_response_dto import (
+ UpdateWorkspaceNameResponseDto,
+)
from askui.tools.askui.askui_workspaces.rest import RESTResponseType
@@ -40,7 +45,6 @@ def __init__(self, api_client=None) -> None:
api_client = ApiClient.get_default()
self.api_client = api_client
-
@validate_call
def create_workspace_api_v1_workspaces_post(
self,
@@ -49,9 +53,8 @@ def create_workspace_api_v1_workspaces_post(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -83,23 +86,22 @@ def create_workspace_api_v1_workspaces_post(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_workspace_api_v1_workspaces_post_serialize(
create_workspace_request_dto=create_workspace_request_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "CreateWorkspaceResponseDto",
- '422': "HTTPValidationError",
+ "201": "CreateWorkspaceResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -107,7 +109,6 @@ def create_workspace_api_v1_workspaces_post(
response_types_map=_response_types_map,
).data
-
@validate_call
def create_workspace_api_v1_workspaces_post_with_http_info(
self,
@@ -116,9 +117,8 @@ def create_workspace_api_v1_workspaces_post_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -150,23 +150,22 @@ def create_workspace_api_v1_workspaces_post_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_workspace_api_v1_workspaces_post_serialize(
create_workspace_request_dto=create_workspace_request_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "CreateWorkspaceResponseDto",
- '422': "HTTPValidationError",
+ "201": "CreateWorkspaceResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -174,7 +173,6 @@ def create_workspace_api_v1_workspaces_post_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def create_workspace_api_v1_workspaces_post_without_preload_content(
self,
@@ -183,9 +181,8 @@ def create_workspace_api_v1_workspaces_post_without_preload_content(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -217,27 +214,25 @@ def create_workspace_api_v1_workspaces_post_without_preload_content(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._create_workspace_api_v1_workspaces_post_serialize(
create_workspace_request_dto=create_workspace_request_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '201': "CreateWorkspaceResponseDto",
- '422': "HTTPValidationError",
+ "201": "CreateWorkspaceResponseDto",
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _create_workspace_api_v1_workspaces_post_serialize(
self,
create_workspace_request_dto,
@@ -246,11 +241,9 @@ def _create_workspace_api_v1_workspaces_post_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -267,38 +260,28 @@ def _create_workspace_api_v1_workspaces_post_serialize(
if create_workspace_request_dto is not None:
_body_params = create_workspace_request_dto
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='POST',
- resource_path='/api/v1/workspaces',
+ method="POST",
+ resource_path="/api/v1/workspaces",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -308,12 +291,9 @@ def _create_workspace_api_v1_workspaces_post_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def delete_workspace_api_v1_workspaces_workspace_id_delete(
self,
@@ -322,9 +302,8 @@ def delete_workspace_api_v1_workspaces_workspace_id_delete(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -356,23 +335,22 @@ def delete_workspace_api_v1_workspaces_workspace_id_delete(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._delete_workspace_api_v1_workspaces_workspace_id_delete_serialize(
workspace_id=workspace_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -380,7 +358,6 @@ def delete_workspace_api_v1_workspaces_workspace_id_delete(
response_types_map=_response_types_map,
).data
-
@validate_call
def delete_workspace_api_v1_workspaces_workspace_id_delete_with_http_info(
self,
@@ -389,9 +366,8 @@ def delete_workspace_api_v1_workspaces_workspace_id_delete_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -423,23 +399,22 @@ def delete_workspace_api_v1_workspaces_workspace_id_delete_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._delete_workspace_api_v1_workspaces_workspace_id_delete_serialize(
workspace_id=workspace_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -447,7 +422,6 @@ def delete_workspace_api_v1_workspaces_workspace_id_delete_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def delete_workspace_api_v1_workspaces_workspace_id_delete_without_preload_content(
self,
@@ -456,9 +430,8 @@ def delete_workspace_api_v1_workspaces_workspace_id_delete_without_preload_conte
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -490,27 +463,25 @@ def delete_workspace_api_v1_workspaces_workspace_id_delete_without_preload_conte
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
+ """ # noqa: E501
_param = self._delete_workspace_api_v1_workspaces_workspace_id_delete_serialize(
workspace_id=workspace_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
- _host_index=_host_index
+ _host_index=_host_index,
)
_response_types_map: Dict[str, Optional[str]] = {
- '204': None,
- '422': "HTTPValidationError",
+ "204": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _delete_workspace_api_v1_workspaces_workspace_id_delete_serialize(
self,
workspace_id,
@@ -519,11 +490,9 @@ def _delete_workspace_api_v1_workspaces_workspace_id_delete_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -534,31 +503,24 @@ def _delete_workspace_api_v1_workspaces_workspace_id_delete_serialize(
# process the path parameters
if workspace_id is not None:
- _path_params['workspace_id'] = workspace_id
+ _path_params["workspace_id"] = workspace_id
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
-
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='DELETE',
- resource_path='/api/v1/workspaces/{workspace_id}',
+ method="DELETE",
+ resource_path="/api/v1/workspaces/{workspace_id}",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -568,12 +530,9 @@ def _delete_workspace_api_v1_workspaces_workspace_id_delete_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
-
@validate_call
def update_workspace_name_api_v1_workspaces_workspace_id_patch(
self,
@@ -584,9 +543,8 @@ def update_workspace_name_api_v1_workspaces_workspace_id_patch(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -622,26 +580,27 @@ def update_workspace_name_api_v1_workspaces_workspace_id_patch(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
-
- _param = self._update_workspace_name_api_v1_workspaces_workspace_id_patch_serialize(
- workspace_id=workspace_id,
- update_workspace_name_request_dto=update_workspace_name_request_dto,
- expand=expand,
- _request_auth=_request_auth,
- _content_type=_content_type,
- _headers=_headers,
- _host_index=_host_index
+ """ # noqa: E501
+
+ _param = (
+ self._update_workspace_name_api_v1_workspaces_workspace_id_patch_serialize(
+ workspace_id=workspace_id,
+ update_workspace_name_request_dto=update_workspace_name_request_dto,
+ expand=expand,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index,
+ )
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "UpdateWorkspaceNameResponseDto",
- '404': None,
- '422': "HTTPValidationError",
+ "200": "UpdateWorkspaceNameResponseDto",
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -649,7 +608,6 @@ def update_workspace_name_api_v1_workspaces_workspace_id_patch(
response_types_map=_response_types_map,
).data
-
@validate_call
def update_workspace_name_api_v1_workspaces_workspace_id_patch_with_http_info(
self,
@@ -660,9 +618,8 @@ def update_workspace_name_api_v1_workspaces_workspace_id_patch_with_http_info(
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -698,26 +655,27 @@ def update_workspace_name_api_v1_workspaces_workspace_id_patch_with_http_info(
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
-
- _param = self._update_workspace_name_api_v1_workspaces_workspace_id_patch_serialize(
- workspace_id=workspace_id,
- update_workspace_name_request_dto=update_workspace_name_request_dto,
- expand=expand,
- _request_auth=_request_auth,
- _content_type=_content_type,
- _headers=_headers,
- _host_index=_host_index
+ """ # noqa: E501
+
+ _param = (
+ self._update_workspace_name_api_v1_workspaces_workspace_id_patch_serialize(
+ workspace_id=workspace_id,
+ update_workspace_name_request_dto=update_workspace_name_request_dto,
+ expand=expand,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index,
+ )
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "UpdateWorkspaceNameResponseDto",
- '404': None,
- '422': "HTTPValidationError",
+ "200": "UpdateWorkspaceNameResponseDto",
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
@@ -725,7 +683,6 @@ def update_workspace_name_api_v1_workspaces_workspace_id_patch_with_http_info(
response_types_map=_response_types_map,
)
-
@validate_call
def update_workspace_name_api_v1_workspaces_workspace_id_patch_without_preload_content(
self,
@@ -736,9 +693,8 @@ def update_workspace_name_api_v1_workspaces_workspace_id_patch_without_preload_c
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
- Annotated[StrictFloat, Field(gt=0)],
- Annotated[StrictFloat, Field(gt=0)]
- ]
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
@@ -774,30 +730,30 @@ def update_workspace_name_api_v1_workspaces_workspace_id_patch_without_preload_c
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
- """ # noqa: E501
-
- _param = self._update_workspace_name_api_v1_workspaces_workspace_id_patch_serialize(
- workspace_id=workspace_id,
- update_workspace_name_request_dto=update_workspace_name_request_dto,
- expand=expand,
- _request_auth=_request_auth,
- _content_type=_content_type,
- _headers=_headers,
- _host_index=_host_index
+ """ # noqa: E501
+
+ _param = (
+ self._update_workspace_name_api_v1_workspaces_workspace_id_patch_serialize(
+ workspace_id=workspace_id,
+ update_workspace_name_request_dto=update_workspace_name_request_dto,
+ expand=expand,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index,
+ )
)
_response_types_map: Dict[str, Optional[str]] = {
- '200': "UpdateWorkspaceNameResponseDto",
- '404': None,
- '422': "HTTPValidationError",
+ "200": "UpdateWorkspaceNameResponseDto",
+ "404": None,
+ "422": "HTTPValidationError",
}
response_data = self.api_client.call_api(
- *_param,
- _request_timeout=_request_timeout
+ *_param, _request_timeout=_request_timeout
)
return response_data.response
-
def _update_workspace_name_api_v1_workspaces_workspace_id_patch_serialize(
self,
workspace_id,
@@ -808,11 +764,9 @@ def _update_workspace_name_api_v1_workspaces_workspace_id_patch_serialize(
_headers,
_host_index,
) -> RequestSerialized:
-
_host = None
- _collection_formats: Dict[str, str] = {
- }
+ _collection_formats: Dict[str, str] = {}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
@@ -823,50 +777,39 @@ def _update_workspace_name_api_v1_workspaces_workspace_id_patch_serialize(
# process the path parameters
if workspace_id is not None:
- _path_params['workspace_id'] = workspace_id
+ _path_params["workspace_id"] = workspace_id
# process the query parameters
if expand is not None:
-
- _query_params.append(('expand', expand))
-
+ _query_params.append(("expand", expand))
+
# process the header parameters
# process the form parameters
# process the body parameter
if update_workspace_name_request_dto is not None:
_body_params = update_workspace_name_request_dto
-
# set the HTTP header `Accept`
- if 'Accept' not in _header_params:
- _header_params['Accept'] = self.api_client.select_header_accept(
- [
- 'application/json'
- ]
+ if "Accept" not in _header_params:
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
)
# set the HTTP header `Content-Type`
if _content_type:
- _header_params['Content-Type'] = _content_type
+ _header_params["Content-Type"] = _content_type
else:
- _default_content_type = (
- self.api_client.select_header_content_type(
- [
- 'application/json'
- ]
- )
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
)
if _default_content_type is not None:
- _header_params['Content-Type'] = _default_content_type
+ _header_params["Content-Type"] = _default_content_type
# authentication setting
- _auth_settings: List[str] = [
- 'Basic',
- 'Bearer'
- ]
+ _auth_settings: List[str] = ["Basic", "Bearer"]
return self.api_client.param_serialize(
- method='PATCH',
- resource_path='/api/v1/workspaces/{workspace_id}',
+ method="PATCH",
+ resource_path="/api/v1/workspaces/{workspace_id}",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
@@ -876,7 +819,5 @@ def _update_workspace_name_api_v1_workspaces_workspace_id_patch_serialize(
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
- _request_auth=_request_auth
+ _request_auth=_request_auth,
)
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/api_client.py b/src/askui/tools/askui/askui_workspaces/api_client.py
index 6f8c307b..667f915d 100644
--- a/src/askui/tools/askui/askui_workspaces/api_client.py
+++ b/src/askui/tools/askui/askui_workspaces/api_client.py
@@ -1,46 +1,47 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
import datetime
-from dateutil.parser import parse
-from enum import Enum
import json
import mimetypes
import os
import re
import tempfile
-
+import types
+from enum import Enum
+from typing import Dict, List, Optional, Tuple, Type, Union
from urllib.parse import quote
-from typing import Tuple, Optional, List, Dict, Union
+
+from dateutil.parser import parse
from pydantic import SecretStr
-from askui.tools.askui.askui_workspaces.configuration import Configuration
-from askui.tools.askui.askui_workspaces.api_response import ApiResponse, T as ApiResponseT
import askui.tools.askui.askui_workspaces.models
from askui.tools.askui.askui_workspaces import rest
+from askui.tools.askui.askui_workspaces.api_response import (
+ ApiResponse,
+)
+from askui.tools.askui.askui_workspaces.api_response import (
+ T as ApiResponseT,
+)
+from askui.tools.askui.askui_workspaces.configuration import Configuration
from askui.tools.askui.askui_workspaces.exceptions import (
- ApiValueError,
ApiException,
- BadRequestException,
- UnauthorizedException,
- ForbiddenException,
- NotFoundException,
- ServiceException
+ ApiValueError,
)
RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]]
+
class ApiClient:
"""Generic API client for OpenAPI client library builds.
@@ -59,23 +60,19 @@ class ApiClient:
PRIMITIVE_TYPES = (float, bool, bytes, str, int)
NATIVE_TYPES_MAPPING = {
- 'int': int,
- 'long': int, # TODO remove as only py3 is supported?
- 'float': float,
- 'str': str,
- 'bool': bool,
- 'date': datetime.date,
- 'datetime': datetime.datetime,
- 'object': object,
+ "int": int,
+ "long": int, # TODO remove as only py3 is supported?
+ "float": float,
+ "str": str,
+ "bool": bool,
+ "date": datetime.date,
+ "datetime": datetime.datetime,
+ "object": object,
}
_pool = None
def __init__(
- self,
- configuration=None,
- header_name=None,
- header_value=None,
- cookie=None
+ self, configuration=None, header_name=None, header_value=None, cookie=None
) -> None:
# use default configuration if none is provided
if configuration is None:
@@ -88,28 +85,32 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
- self.user_agent = 'OpenAPI-Generator/0.1.2/python'
+ self.user_agent = "OpenAPI-Generator/0.1.2/python"
self.client_side_validation = configuration.client_side_validation
def __enter__(self):
return self
- def __exit__(self, exc_type, exc_value, traceback):
+ def __exit__(
+ self,
+ exc_type: Type[BaseException] | None,
+ exc_value: BaseException | None,
+ traceback: types.TracebackType | None,
+ ) -> None:
pass
@property
def user_agent(self):
"""User agent for this API client"""
- return self.default_headers['User-Agent']
+ return self.default_headers["User-Agent"]
@user_agent.setter
def user_agent(self, value):
- self.default_headers['User-Agent'] = value
+ self.default_headers["User-Agent"] = value
def set_default_header(self, header_name, header_value):
self.default_headers[header_name] = header_value
-
_default = None
@classmethod
@@ -145,12 +146,12 @@ def param_serialize(
header_params=None,
body=None,
post_params=None,
- files=None, auth_settings=None,
+ files=None,
+ auth_settings=None,
collection_formats=None,
_host=None,
- _request_auth=None
+ _request_auth=None,
) -> RequestSerialized:
-
"""Builds the HTTP request params needed by the request.
:param method: Method to call.
:param resource_path: Path to method endpoint.
@@ -179,35 +180,28 @@ def param_serialize(
header_params = header_params or {}
header_params.update(self.default_headers)
if self.cookie:
- header_params['Cookie'] = self.cookie
+ header_params["Cookie"] = self.cookie
if header_params:
header_params = self.sanitize_for_serialization(header_params)
header_params = dict(
- self.parameters_to_tuples(header_params,collection_formats)
+ self.parameters_to_tuples(header_params, collection_formats)
)
# path parameters
if path_params:
path_params = self.sanitize_for_serialization(path_params)
- path_params = self.parameters_to_tuples(
- path_params,
- collection_formats
- )
+ path_params = self.parameters_to_tuples(path_params, collection_formats)
for k, v in path_params:
# specified safe chars, encode everything
resource_path = resource_path.replace(
- '{%s}' % k,
- quote(str(v), safe=config.safe_chars_for_path_param)
+ "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param)
)
# post parameters
if post_params or files:
post_params = post_params if post_params else []
post_params = self.sanitize_for_serialization(post_params)
- post_params = self.parameters_to_tuples(
- post_params,
- collection_formats
- )
+ post_params = self.parameters_to_tuples(post_params, collection_formats)
if files:
post_params.extend(self.files_parameters(files))
@@ -219,7 +213,7 @@ def param_serialize(
resource_path,
method,
body,
- request_auth=_request_auth
+ request_auth=_request_auth,
)
# body
@@ -236,15 +230,11 @@ def param_serialize(
# query parameters
if query_params:
query_params = self.sanitize_for_serialization(query_params)
- url_query = self.parameters_to_url_query(
- query_params,
- collection_formats
- )
+ url_query = self.parameters_to_url_query(query_params, collection_formats)
url += "?" + url_query
return method, url, header_params, body, post_params
-
def call_api(
self,
method,
@@ -252,7 +242,7 @@ def call_api(
header_params=None,
body=None,
post_params=None,
- _request_timeout=None
+ _request_timeout=None,
) -> rest.RESTResponse:
"""Makes the HTTP request (synchronous)
:param method: Method to call.
@@ -269,10 +259,12 @@ def call_api(
try:
# perform request and return response
response_data = self.rest_client.request(
- method, url,
+ method,
+ url,
headers=header_params,
- body=body, post_params=post_params,
- _request_timeout=_request_timeout
+ body=body,
+ post_params=post_params,
+ _request_timeout=_request_timeout,
)
except ApiException as e:
@@ -283,7 +275,7 @@ def call_api(
def response_deserialize(
self,
response_data: rest.RESTResponse,
- response_types_map: Optional[Dict[str, ApiResponseT]]=None
+ response_types_map: Optional[Dict[str, ApiResponseT]] = None,
) -> ApiResponse[ApiResponseT]:
"""Deserializes response into an object.
:param response_data: RESTResponse object to be deserialized.
@@ -295,9 +287,15 @@ def response_deserialize(
assert response_data.data is not None, msg
response_type = response_types_map.get(str(response_data.status), None)
- if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599:
+ if (
+ not response_type
+ and isinstance(response_data.status, int)
+ and 100 <= response_data.status <= 599
+ ):
# if not found, look for '1XX', '2XX', etc.
- response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
+ response_type = response_types_map.get(
+ str(response_data.status)[0] + "XX", None
+ )
# deserialize response data
response_text = None
@@ -309,12 +307,14 @@ def response_deserialize(
return_data = self.__deserialize_file(response_data)
elif response_type is not None:
match = None
- content_type = response_data.getheader('content-type')
+ content_type = response_data.getheader("content-type")
if content_type is not None:
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
encoding = match.group(1) if match else "utf-8"
response_text = response_data.data.decode(encoding)
- return_data = self.deserialize(response_text, response_type, content_type)
+ return_data = self.deserialize(
+ response_text, response_type, content_type
+ )
finally:
if not 200 <= response_data.status <= 299:
raise ApiException.from_response(
@@ -324,10 +324,10 @@ def response_deserialize(
)
return ApiResponse(
- status_code = response_data.status,
- data = return_data,
- headers = response_data.getheaders(),
- raw_data = response_data.data
+ status_code=response_data.status,
+ data=return_data,
+ headers=response_data.getheaders(),
+ raw_data=response_data.data,
)
def sanitize_for_serialization(self, obj):
@@ -347,24 +347,20 @@ def sanitize_for_serialization(self, obj):
"""
if obj is None:
return None
- elif isinstance(obj, Enum):
+ if isinstance(obj, Enum):
return obj.value
- elif isinstance(obj, SecretStr):
+ if isinstance(obj, SecretStr):
return obj.get_secret_value()
- elif isinstance(obj, self.PRIMITIVE_TYPES):
+ if isinstance(obj, self.PRIMITIVE_TYPES):
return obj
- elif isinstance(obj, list):
- return [
- self.sanitize_for_serialization(sub_obj) for sub_obj in obj
- ]
- elif isinstance(obj, tuple):
- return tuple(
- self.sanitize_for_serialization(sub_obj) for sub_obj in obj
- )
- elif isinstance(obj, (datetime.datetime, datetime.date)):
+ if isinstance(obj, list):
+ return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj]
+ if isinstance(obj, tuple):
+ return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj)
+ if isinstance(obj, (datetime.datetime, datetime.date)):
return obj.isoformat()
- elif isinstance(obj, dict):
+ if isinstance(obj, dict):
obj_dict = obj
else:
# Convert model obj to dict except
@@ -372,17 +368,18 @@ def sanitize_for_serialization(self, obj):
# and attributes which value is not None.
# Convert attribute name to json key in
# model definition for request.
- if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')):
+ if hasattr(obj, "to_dict") and callable(obj.to_dict):
obj_dict = obj.to_dict()
else:
obj_dict = obj.__dict__
return {
- key: self.sanitize_for_serialization(val)
- for key, val in obj_dict.items()
+ key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()
}
- def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
+ def deserialize(
+ self, response_text: str, response_type: str, content_type: Optional[str]
+ ):
"""Deserializes response into an object.
:param response: RESTResponse object to be deserialized.
@@ -408,8 +405,7 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti
data = response_text
else:
raise ApiException(
- status=0,
- reason="Unsupported content type: {0}".format(content_type)
+ status=0, reason="Unsupported content type: {0}".format(content_type)
)
return self.__deserialize(data, response_type)
@@ -426,19 +422,17 @@ def __deserialize(self, data, klass):
return None
if isinstance(klass, str):
- if klass.startswith('List['):
- m = re.match(r'List\[(.*)]', klass)
+ if klass.startswith("List["):
+ m = re.match(r"List\[(.*)]", klass)
assert m is not None, "Malformed List type definition"
sub_kls = m.group(1)
- return [self.__deserialize(sub_data, sub_kls)
- for sub_data in data]
+ return [self.__deserialize(sub_data, sub_kls) for sub_data in data]
- if klass.startswith('Dict['):
- m = re.match(r'Dict\[([^,]*), (.*)]', klass)
+ if klass.startswith("Dict["):
+ m = re.match(r"Dict\[([^,]*), (.*)]", klass)
assert m is not None, "Malformed Dict type definition"
sub_kls = m.group(2)
- return {k: self.__deserialize(v, sub_kls)
- for k, v in data.items()}
+ return {k: self.__deserialize(v, sub_kls) for k, v in data.items()}
# convert str to class
if klass in self.NATIVE_TYPES_MAPPING:
@@ -448,16 +442,15 @@ def __deserialize(self, data, klass):
if klass in self.PRIMITIVE_TYPES:
return self.__deserialize_primitive(data, klass)
- elif klass == object:
+ if klass == object:
return self.__deserialize_object(data)
- elif klass == datetime.date:
+ if klass == datetime.date:
return self.__deserialize_date(data)
- elif klass == datetime.datetime:
+ if klass == datetime.datetime:
return self.__deserialize_datetime(data)
- elif issubclass(klass, Enum):
+ if issubclass(klass, Enum):
return self.__deserialize_enum(data, klass)
- else:
- return self.__deserialize_model(data, klass)
+ return self.__deserialize_model(data, klass)
def parameters_to_tuples(self, params, collection_formats):
"""Get parameters as list of tuples, formatting collections.
@@ -472,19 +465,18 @@ def parameters_to_tuples(self, params, collection_formats):
for k, v in params.items() if isinstance(params, dict) else params:
if k in collection_formats:
collection_format = collection_formats[k]
- if collection_format == 'multi':
+ if collection_format == "multi":
new_params.extend((k, value) for value in v)
else:
- if collection_format == 'ssv':
- delimiter = ' '
- elif collection_format == 'tsv':
- delimiter = '\t'
- elif collection_format == 'pipes':
- delimiter = '|'
+ if collection_format == "ssv":
+ delimiter = " "
+ elif collection_format == "tsv":
+ delimiter = "\t"
+ elif collection_format == "pipes":
+ delimiter = "|"
else: # csv is the default
- delimiter = ','
- new_params.append(
- (k, delimiter.join(str(value) for value in v)))
+ delimiter = ","
+ new_params.append((k, delimiter.join(str(value) for value in v)))
else:
new_params.append((k, v))
return new_params
@@ -509,17 +501,17 @@ def parameters_to_url_query(self, params, collection_formats):
if k in collection_formats:
collection_format = collection_formats[k]
- if collection_format == 'multi':
+ if collection_format == "multi":
new_params.extend((k, str(value)) for value in v)
else:
- if collection_format == 'ssv':
- delimiter = ' '
- elif collection_format == 'tsv':
- delimiter = '\t'
- elif collection_format == 'pipes':
- delimiter = '|'
+ if collection_format == "ssv":
+ delimiter = " "
+ elif collection_format == "tsv":
+ delimiter = "\t"
+ elif collection_format == "pipes":
+ delimiter = "|"
else: # csv is the default
- delimiter = ','
+ delimiter = ","
new_params.append(
(k, delimiter.join(quote(str(value)) for value in v))
)
@@ -537,7 +529,7 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]):
params = []
for k, v in files.items():
if isinstance(v, str):
- with open(v, 'rb') as f:
+ with open(v, "rb") as f:
filename = os.path.basename(f.name)
filedata = f.read()
elif isinstance(v, bytes):
@@ -545,13 +537,8 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]):
filedata = v
else:
raise ValueError("Unsupported file value")
- mimetype = (
- mimetypes.guess_type(filename)[0]
- or 'application/octet-stream'
- )
- params.append(
- tuple([k, tuple([filename, filedata, mimetype])])
- )
+ mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream"
+ params.append(tuple([k, tuple([filename, filedata, mimetype])]))
return params
def select_header_accept(self, accepts: List[str]) -> Optional[str]:
@@ -564,7 +551,7 @@ def select_header_accept(self, accepts: List[str]) -> Optional[str]:
return None
for accept in accepts:
- if re.search('json', accept, re.IGNORECASE):
+ if re.search("json", accept, re.IGNORECASE):
return accept
return accepts[0]
@@ -579,7 +566,7 @@ def select_header_content_type(self, content_types):
return None
for content_type in content_types:
- if re.search('json', content_type, re.IGNORECASE):
+ if re.search("json", content_type, re.IGNORECASE):
return content_type
return content_types[0]
@@ -592,7 +579,7 @@ def update_params_for_auth(
resource_path,
method,
body,
- request_auth=None
+ request_auth=None,
) -> None:
"""Updates header and query params based on authentication setting.
@@ -611,34 +598,18 @@ def update_params_for_auth(
if request_auth:
self._apply_auth_params(
- headers,
- queries,
- resource_path,
- method,
- body,
- request_auth
+ headers, queries, resource_path, method, body, request_auth
)
else:
for auth in auth_settings:
auth_setting = self.configuration.auth_settings().get(auth)
if auth_setting:
self._apply_auth_params(
- headers,
- queries,
- resource_path,
- method,
- body,
- auth_setting
+ headers, queries, resource_path, method, body, auth_setting
)
def _apply_auth_params(
- self,
- headers,
- queries,
- resource_path,
- method,
- body,
- auth_setting
+ self, headers, queries, resource_path, method, body, auth_setting
) -> None:
"""Updates the request parameters based on a single auth_setting
@@ -650,17 +621,15 @@ def _apply_auth_params(
The object type is the return value of sanitize_for_serialization().
:param auth_setting: auth settings for the endpoint
"""
- if auth_setting['in'] == 'cookie':
- headers['Cookie'] = auth_setting['value']
- elif auth_setting['in'] == 'header':
- if auth_setting['type'] != 'http-signature':
- headers[auth_setting['key']] = auth_setting['value']
- elif auth_setting['in'] == 'query':
- queries.append((auth_setting['key'], auth_setting['value']))
+ if auth_setting["in"] == "cookie":
+ headers["Cookie"] = auth_setting["value"]
+ elif auth_setting["in"] == "header":
+ if auth_setting["type"] != "http-signature":
+ headers[auth_setting["key"]] = auth_setting["value"]
+ elif auth_setting["in"] == "query":
+ queries.append((auth_setting["key"], auth_setting["value"]))
else:
- raise ApiValueError(
- 'Authentication token must be in `query` or `header`'
- )
+ raise ApiValueError("Authentication token must be in `query` or `header`")
def __deserialize_file(self, response):
"""Deserializes body to file
@@ -680,10 +649,7 @@ def __deserialize_file(self, response):
content_disposition = response.getheader("Content-Disposition")
if content_disposition:
- m = re.search(
- r'filename=[\'"]?([^\'"\s]+)[\'"]?',
- content_disposition
- )
+ m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition)
assert m is not None, "Unexpected 'content-disposition' header value"
filename = m.group(1)
path = os.path.join(os.path.dirname(path), filename)
@@ -727,8 +693,7 @@ def __deserialize_date(self, string):
return string
except ValueError:
raise rest.ApiException(
- status=0,
- reason="Failed to parse `{0}` as date object".format(string)
+ status=0, reason="Failed to parse `{0}` as date object".format(string)
)
def __deserialize_datetime(self, string):
@@ -746,10 +711,7 @@ def __deserialize_datetime(self, string):
except ValueError:
raise rest.ApiException(
status=0,
- reason=(
- "Failed to parse `{0}` as datetime object"
- .format(string)
- )
+ reason=("Failed to parse `{0}` as datetime object".format(string)),
)
def __deserialize_enum(self, data, klass):
@@ -763,11 +725,7 @@ def __deserialize_enum(self, data, klass):
return klass(data)
except ValueError:
raise rest.ApiException(
- status=0,
- reason=(
- "Failed to parse `{0}` as `{1}`"
- .format(data, klass)
- )
+ status=0, reason=("Failed to parse `{0}` as `{1}`".format(data, klass))
)
def __deserialize_model(self, data, klass):
diff --git a/src/askui/tools/askui/askui_workspaces/api_response.py b/src/askui/tools/askui/askui_workspaces/api_response.py
index 9bc7c11f..ca801da0 100644
--- a/src/askui/tools/askui/askui_workspaces/api_response.py
+++ b/src/askui/tools/askui/askui_workspaces/api_response.py
@@ -1,11 +1,14 @@
"""API response object."""
from __future__ import annotations
-from typing import Optional, Generic, Mapping, TypeVar
-from pydantic import Field, StrictInt, StrictBytes, BaseModel
+
+from typing import Generic, Mapping, Optional, TypeVar
+
+from pydantic import BaseModel, Field, StrictBytes, StrictInt
T = TypeVar("T")
+
class ApiResponse(BaseModel, Generic[T]):
"""
API response object
@@ -16,6 +19,4 @@ class ApiResponse(BaseModel, Generic[T]):
data: T = Field(description="Deserialized data given the data type")
raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
- model_config = {
- "arbitrary_types_allowed": True
- }
+ model_config = {"arbitrary_types_allowed": True}
diff --git a/src/askui/tools/askui/askui_workspaces/configuration.py b/src/askui/tools/askui/askui_workspaces/configuration.py
index 15585053..e652f23e 100644
--- a/src/askui/tools/askui/askui_workspaces/configuration.py
+++ b/src/askui/tools/askui/askui_workspaces/configuration.py
@@ -1,102 +1,114 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
import copy
+import http.client as httplib
import logging
-from logging import FileHandler
import multiprocessing
import sys
+from logging import FileHandler
from typing import Optional
-import urllib3
-import http.client as httplib
+import urllib3
JSON_SCHEMA_VALIDATION_KEYWORDS = {
- 'multipleOf', 'maximum', 'exclusiveMaximum',
- 'minimum', 'exclusiveMinimum', 'maxLength',
- 'minLength', 'pattern', 'maxItems', 'minItems'
+ "multipleOf",
+ "maximum",
+ "exclusiveMaximum",
+ "minimum",
+ "exclusiveMinimum",
+ "maxLength",
+ "minLength",
+ "pattern",
+ "maxItems",
+ "minItems",
}
+
class Configuration:
"""This class contains various settings of the API client.
- :param host: Base url.
- :param ignore_operation_servers
- Boolean to ignore operation servers for the API client.
- Config will use `host` as the base url regardless of the operation servers.
- :param api_key: Dict to store API key(s).
- Each entry in the dict specifies an API key.
- The dict key is the name of the security scheme in the OAS specification.
- The dict value is the API key secret.
- :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
- The dict key is the name of the security scheme in the OAS specification.
- The dict value is an API key prefix when generating the auth data.
- :param username: Username for HTTP basic authentication.
- :param password: Password for HTTP basic authentication.
- :param access_token: Access token.
- :param server_index: Index to servers configuration.
- :param server_variables: Mapping with string values to replace variables in
- templated server configuration. The validation of enums is performed for
- variables with defined enum values before.
- :param server_operation_index: Mapping from operation ID to an index to server
- configuration.
- :param server_operation_variables: Mapping from operation ID to a mapping with
- string values to replace variables in templated server configuration.
- The validation of enums is performed for variables with defined enum
- values before.
- :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
- in PEM format.
- :param retries: Number of retries for API requests.
-
- :Example:
-
- API Key Authentication Example.
- Given the following security scheme in the OpenAPI specification:
- components:
- securitySchemes:
- cookieAuth: # name for the security scheme
- type: apiKey
- in: cookie
- name: JSESSIONID # cookie name
-
- You can programmatically set the cookie:
-
-conf = askui.tools.askui.askui_workspaces.Configuration(
- api_key={'cookieAuth': 'abc123'}
- api_key_prefix={'cookieAuth': 'JSESSIONID'}
-)
-
- The following cookie will be added to the HTTP request:
- Cookie: JSESSIONID abc123
+ :param host: Base url.
+ :param ignore_operation_servers
+ Boolean to ignore operation servers for the API client.
+ Config will use `host` as the base url regardless of the operation servers.
+ :param api_key: Dict to store API key(s).
+ Each entry in the dict specifies an API key.
+ The dict key is the name of the security scheme in the OAS specification.
+ The dict value is the API key secret.
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
+ The dict key is the name of the security scheme in the OAS specification.
+ The dict value is an API key prefix when generating the auth data.
+ :param username: Username for HTTP basic authentication.
+ :param password: Password for HTTP basic authentication.
+ :param access_token: Access token.
+ :param server_index: Index to servers configuration.
+ :param server_variables: Mapping with string values to replace variables in
+ templated server configuration. The validation of enums is performed for
+ variables with defined enum values before.
+ :param server_operation_index: Mapping from operation ID to an index to server
+ configuration.
+ :param server_operation_variables: Mapping from operation ID to a mapping with
+ string values to replace variables in templated server configuration.
+ The validation of enums is performed for variables with defined enum
+ values before.
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
+ in PEM format.
+ :param retries: Number of retries for API requests.
+
+ :Example:
+
+ API Key Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ cookieAuth: # name for the security scheme
+ type: apiKey
+ in: cookie
+ name: JSESSIONID # cookie name
+
+ You can programmatically set the cookie:
+
+ conf = askui.tools.askui.askui_workspaces.Configuration(
+ api_key={'cookieAuth': 'abc123'}
+ api_key_prefix={'cookieAuth': 'JSESSIONID'}
+ )
+
+ The following cookie will be added to the HTTP request:
+ Cookie: JSESSIONID abc123
"""
_default = None
- def __init__(self, host=None,
- api_key=None, api_key_prefix=None,
- username=None, password=None,
- access_token=None,
- server_index=None, server_variables=None,
- server_operation_index=None, server_operation_variables=None,
- ignore_operation_servers=False,
- ssl_ca_cert=None,
- retries=None,
- *,
- debug: Optional[bool] = None
- ) -> None:
- """Constructor
- """
+ def __init__(
+ self,
+ host=None,
+ api_key=None,
+ api_key_prefix=None,
+ username=None,
+ password=None,
+ access_token=None,
+ server_index=None,
+ server_variables=None,
+ server_operation_index=None,
+ server_operation_variables=None,
+ ignore_operation_servers=False,
+ ssl_ca_cert=None,
+ retries=None,
+ *,
+ debug: Optional[bool] = None,
+ ) -> None:
+ """Constructor"""
self._base_path = "http://localhost" if host is None else host
"""Default Base url
"""
@@ -140,9 +152,11 @@ def __init__(self, host=None,
self.logger = {}
"""Logging Settings
"""
- self.logger["package_logger"] = logging.getLogger("askui.tools.askui.askui_workspaces")
+ self.logger["package_logger"] = logging.getLogger(
+ "askui.tools.askui.askui_workspaces"
+ )
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
- self.logger_format = '%(asctime)s %(levelname)s %(message)s'
+ self.logger_format = "%(asctime)s %(levelname)s %(message)s"
"""Log format
"""
self.logger_stream_handler = None
@@ -197,7 +211,7 @@ def __init__(self, host=None,
self.proxy_headers = None
"""Proxy headers
"""
- self.safe_chars_for_path_param = ''
+ self.safe_chars_for_path_param = ""
"""Safe chars for path_param
"""
self.retries = retries
@@ -223,7 +237,7 @@ def __deepcopy__(self, memo):
result = cls.__new__(cls)
memo[id(self)] = result
for k, v in self.__dict__.items():
- if k not in ('logger', 'logger_file_handler'):
+ if k not in ("logger", "logger_file_handler"):
setattr(result, k, copy.deepcopy(v, memo))
# shallow copy of loggers
result.logger = copy.copy(self.logger)
@@ -364,13 +378,14 @@ def get_api_key_with_prefix(self, identifier, alias=None):
"""
if self.refresh_api_key_hook is not None:
self.refresh_api_key_hook(self)
- key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
+ key = self.api_key.get(
+ identifier, self.api_key.get(alias) if alias is not None else None
+ )
if key:
prefix = self.api_key_prefix.get(identifier)
if prefix:
return "%s %s" % (prefix, key)
- else:
- return key
+ return key
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
@@ -383,9 +398,9 @@ def get_basic_auth_token(self):
password = ""
if self.password is not None:
password = self.password
- return urllib3.util.make_headers(
- basic_auth=username + ':' + password
- ).get('authorization')
+ return urllib3.util.make_headers(basic_auth=username + ":" + password).get(
+ "authorization"
+ )
def auth_settings(self):
"""Gets Auth Settings dict for api client.
@@ -394,19 +409,19 @@ def auth_settings(self):
"""
auth = {}
if self.access_token is not None:
- auth['Bearer'] = {
- 'type': 'bearer',
- 'in': 'header',
- 'key': 'Authorization',
- 'value': 'Bearer ' + self.access_token
+ auth["Bearer"] = {
+ "type": "bearer",
+ "in": "header",
+ "key": "Authorization",
+ "value": "Bearer " + self.access_token,
}
- if 'Basic' in self.api_key:
- auth['Basic'] = {
- 'type': 'api_key',
- 'in': 'header',
- 'key': 'Authorization',
- 'value': self.get_api_key_with_prefix(
- 'Basic',
+ if "Basic" in self.api_key:
+ auth["Basic"] = {
+ "type": "api_key",
+ "in": "header",
+ "key": "Authorization",
+ "value": self.get_api_key_with_prefix(
+ "Basic",
),
}
return auth
@@ -416,12 +431,13 @@ def to_debug_report(self):
:return: The report for debugging.
"""
- return "Python SDK Debug Report:\n"\
- "OS: {env}\n"\
- "Python Version: {pyversion}\n"\
- "Version of the API: 0.1.30\n"\
- "SDK Package Version: 0.1.2".\
- format(env=sys.platform, pyversion=sys.version)
+ return (
+ "Python SDK Debug Report:\n"
+ "OS: {env}\n"
+ "Python Version: {pyversion}\n"
+ "Version of the API: 0.1.30\n"
+ "SDK Package Version: 0.1.2".format(env=sys.platform, pyversion=sys.version)
+ )
def get_host_settings(self):
"""Gets an array of host settings
@@ -430,8 +446,8 @@ def get_host_settings(self):
"""
return [
{
- 'url': "",
- 'description': "No description provided",
+ "url": "",
+ "description": "No description provided",
}
]
@@ -453,22 +469,22 @@ def get_host_from_settings(self, index, variables=None, servers=None):
except IndexError:
raise ValueError(
"Invalid index {0} when selecting the host settings. "
- "Must be less than {1}".format(index, len(servers)))
+ "Must be less than {1}".format(index, len(servers))
+ )
- url = server['url']
+ url = server["url"]
# go through variables and replace placeholders
- for variable_name, variable in server.get('variables', {}).items():
- used_value = variables.get(
- variable_name, variable['default_value'])
+ for variable_name, variable in server.get("variables", {}).items():
+ used_value = variables.get(variable_name, variable["default_value"])
- if 'enum_values' in variable \
- and used_value not in variable['enum_values']:
+ if "enum_values" in variable and used_value not in variable["enum_values"]:
raise ValueError(
"The variable `{0}` in the host URL has invalid value "
"{1}. Must be {2}.".format(
- variable_name, variables[variable_name],
- variable['enum_values']))
+ variable_name, variables[variable_name], variable["enum_values"]
+ )
+ )
url = url.replace("{" + variable_name + "}", used_value)
@@ -477,7 +493,9 @@ def get_host_from_settings(self, index, variables=None, servers=None):
@property
def host(self):
"""Return generated host."""
- return self.get_host_from_settings(self.server_index, variables=self.server_variables)
+ return self.get_host_from_settings(
+ self.server_index, variables=self.server_variables
+ )
@host.setter
def host(self, value):
diff --git a/src/askui/tools/askui/askui_workspaces/exceptions.py b/src/askui/tools/askui/askui_workspaces/exceptions.py
index a3bf52fb..26599986 100644
--- a/src/askui/tools/askui/askui_workspaces/exceptions.py
+++ b/src/askui/tools/askui/askui_workspaces/exceptions.py
@@ -1,27 +1,30 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
from typing import Any, Optional
+
from typing_extensions import Self
+
class OpenApiException(Exception):
"""The base exception class for all OpenAPIExceptions"""
class ApiTypeError(OpenApiException, TypeError):
- def __init__(self, msg, path_to_item=None, valid_classes=None,
- key_type=None) -> None:
- """ Raises an exception for TypeErrors
+ def __init__(
+ self, msg, path_to_item=None, valid_classes=None, key_type=None
+ ) -> None:
+ """Raises an exception for TypeErrors
Args:
msg (str): the exception message
@@ -102,11 +105,10 @@ def __init__(self, msg, path_to_item=None) -> None:
class ApiException(OpenApiException):
-
def __init__(
- self,
- status=None,
- reason=None,
+ self,
+ status=None,
+ reason=None,
http_resp=None,
*,
body: Optional[str] = None,
@@ -125,17 +127,17 @@ def __init__(
self.reason = http_resp.reason
if self.body is None:
try:
- self.body = http_resp.data.decode('utf-8')
+ self.body = http_resp.data.decode("utf-8")
except Exception:
pass
self.headers = http_resp.getheaders()
@classmethod
def from_response(
- cls,
- *,
- http_resp,
- body: Optional[str],
+ cls,
+ *,
+ http_resp,
+ body: Optional[str],
data: Optional[Any],
) -> Self:
if http_resp.status == 400:
@@ -156,11 +158,9 @@ def from_response(
def __str__(self):
"""Custom error messages for exception"""
- error_message = "({0})\n"\
- "Reason: {1}\n".format(self.status, self.reason)
+ error_message = "({0})\nReason: {1}\n".format(self.status, self.reason)
if self.headers:
- error_message += "HTTP response headers: {0}\n".format(
- self.headers)
+ error_message += "HTTP response headers: {0}\n".format(self.headers)
if self.data or self.body:
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
diff --git a/src/askui/tools/askui/askui_workspaces/models/__init__.py b/src/askui/tools/askui/askui_workspaces/models/__init__.py
index 575b6882..9f46d386 100644
--- a/src/askui/tools/askui/askui_workspaces/models/__init__.py
+++ b/src/askui/tools/askui/askui_workspaces/models/__init__.py
@@ -2,111 +2,262 @@
# flake8: noqa
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
# import models into model package
-from askui.tools.askui.askui_workspaces.models.access_token_response_dto import AccessTokenResponseDto
+from askui.tools.askui.askui_workspaces.models.access_token_response_dto import (
+ AccessTokenResponseDto,
+)
from askui.tools.askui.askui_workspaces.models.agent import Agent
-from askui.tools.askui.askui_workspaces.models.agent_create_command import AgentCreateCommand
-from askui.tools.askui.askui_workspaces.models.agent_create_command_data_destinations_inner import AgentCreateCommandDataDestinationsInner
-from askui.tools.askui.askui_workspaces.models.agent_data_destinations_inner import AgentDataDestinationsInner
+from askui.tools.askui.askui_workspaces.models.agent_create_command import (
+ AgentCreateCommand,
+)
+from askui.tools.askui.askui_workspaces.models.agent_create_command_data_destinations_inner import (
+ AgentCreateCommandDataDestinationsInner,
+)
+from askui.tools.askui.askui_workspaces.models.agent_data_destinations_inner import (
+ AgentDataDestinationsInner,
+)
from askui.tools.askui.askui_workspaces.models.agent_execution import AgentExecution
-from askui.tools.askui.askui_workspaces.models.agent_execution_cancel import AgentExecutionCancel
-from askui.tools.askui.askui_workspaces.models.agent_execution_confirm import AgentExecutionConfirm
-from askui.tools.askui.askui_workspaces.models.agent_execution_pending_review import AgentExecutionPendingReview
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_canceled import AgentExecutionStateCanceled
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_confirmed import AgentExecutionStateConfirmed
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input import AgentExecutionStateDeliveredToDestinationInput
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input_deliveries_inner import AgentExecutionStateDeliveredToDestinationInputDeliveriesInner
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_output import AgentExecutionStateDeliveredToDestinationOutput
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_data_extraction import AgentExecutionStatePendingDataExtraction
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_inputs import AgentExecutionStatePendingInputs
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_review import AgentExecutionStatePendingReview
-from askui.tools.askui.askui_workspaces.models.agent_execution_update_command import AgentExecutionUpdateCommand
-from askui.tools.askui.askui_workspaces.models.agent_executions_list_response import AgentExecutionsListResponse
-from askui.tools.askui.askui_workspaces.models.agent_update_command import AgentUpdateCommand
-from askui.tools.askui.askui_workspaces.models.agents_list_response import AgentsListResponse
+from askui.tools.askui.askui_workspaces.models.agent_execution_cancel import (
+ AgentExecutionCancel,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_confirm import (
+ AgentExecutionConfirm,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_pending_review import (
+ AgentExecutionPendingReview,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_canceled import (
+ AgentExecutionStateCanceled,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_confirmed import (
+ AgentExecutionStateConfirmed,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input import (
+ AgentExecutionStateDeliveredToDestinationInput,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input_deliveries_inner import (
+ AgentExecutionStateDeliveredToDestinationInputDeliveriesInner,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_output import (
+ AgentExecutionStateDeliveredToDestinationOutput,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_data_extraction import (
+ AgentExecutionStatePendingDataExtraction,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_inputs import (
+ AgentExecutionStatePendingInputs,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_review import (
+ AgentExecutionStatePendingReview,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_update_command import (
+ AgentExecutionUpdateCommand,
+)
+from askui.tools.askui.askui_workspaces.models.agent_executions_list_response import (
+ AgentExecutionsListResponse,
+)
+from askui.tools.askui.askui_workspaces.models.agent_update_command import (
+ AgentUpdateCommand,
+)
+from askui.tools.askui.askui_workspaces.models.agents_list_response import (
+ AgentsListResponse,
+)
from askui.tools.askui.askui_workspaces.models.ask_ui_runner_host import AskUiRunnerHost
-from askui.tools.askui.askui_workspaces.models.complete_runner_job_request_dto import CompleteRunnerJobRequestDto
-from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_request_dto import CreateCustomerPortalSessionRequestDto
-from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_response_dto import CreateCustomerPortalSessionResponseDto
-from askui.tools.askui.askui_workspaces.models.create_schedule_request_dto import CreateScheduleRequestDto
-from askui.tools.askui.askui_workspaces.models.create_schedule_response_dto import CreateScheduleResponseDto
-from askui.tools.askui.askui_workspaces.models.create_subject_access_token_command import CreateSubjectAccessTokenCommand
-from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_input import CreateSubjectAccessTokenResponseDtoInput
-from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_output import CreateSubjectAccessTokenResponseDtoOutput
-from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_request_dto import CreateWorkspaceAccessTokenRequestDto
-from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_response_dto import CreateWorkspaceAccessTokenResponseDto
-from askui.tools.askui.askui_workspaces.models.create_workspace_membership_request_dto import CreateWorkspaceMembershipRequestDto
-from askui.tools.askui.askui_workspaces.models.create_workspace_membership_response_dto import CreateWorkspaceMembershipResponseDto
-from askui.tools.askui.askui_workspaces.models.create_workspace_request_dto import CreateWorkspaceRequestDto
-from askui.tools.askui.askui_workspaces.models.create_workspace_response_dto import CreateWorkspaceResponseDto
-from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow import DataDestinationAskUiWorkflow
-from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow_create import DataDestinationAskUiWorkflowCreate
-from askui.tools.askui.askui_workspaces.models.data_destination_delivery_ask_ui_workflow import DataDestinationDeliveryAskUiWorkflow
-from askui.tools.askui.askui_workspaces.models.data_destination_delivery_webhook import DataDestinationDeliveryWebhook
-from askui.tools.askui.askui_workspaces.models.data_destination_webhook import DataDestinationWebhook
-from askui.tools.askui.askui_workspaces.models.data_destination_webhook_create import DataDestinationWebhookCreate
-from askui.tools.askui.askui_workspaces.models.email_agent_trigger import EmailAgentTrigger
-from askui.tools.askui.askui_workspaces.models.email_agent_trigger_create import EmailAgentTriggerCreate
-from askui.tools.askui.askui_workspaces.models.email_agent_trigger_update import EmailAgentTriggerUpdate
-from askui.tools.askui.askui_workspaces.models.extract_data_command import ExtractDataCommand
-from askui.tools.askui.askui_workspaces.models.extract_data_response import ExtractDataResponse
+from askui.tools.askui.askui_workspaces.models.complete_runner_job_request_dto import (
+ CompleteRunnerJobRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_request_dto import (
+ CreateCustomerPortalSessionRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_response_dto import (
+ CreateCustomerPortalSessionResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_schedule_request_dto import (
+ CreateScheduleRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_schedule_response_dto import (
+ CreateScheduleResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_subject_access_token_command import (
+ CreateSubjectAccessTokenCommand,
+)
+from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_input import (
+ CreateSubjectAccessTokenResponseDtoInput,
+)
+from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_output import (
+ CreateSubjectAccessTokenResponseDtoOutput,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_request_dto import (
+ CreateWorkspaceAccessTokenRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_response_dto import (
+ CreateWorkspaceAccessTokenResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_membership_request_dto import (
+ CreateWorkspaceMembershipRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_membership_response_dto import (
+ CreateWorkspaceMembershipResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_request_dto import (
+ CreateWorkspaceRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.create_workspace_response_dto import (
+ CreateWorkspaceResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow import (
+ DataDestinationAskUiWorkflow,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow_create import (
+ DataDestinationAskUiWorkflowCreate,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_delivery_ask_ui_workflow import (
+ DataDestinationDeliveryAskUiWorkflow,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_delivery_webhook import (
+ DataDestinationDeliveryWebhook,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_webhook import (
+ DataDestinationWebhook,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_webhook_create import (
+ DataDestinationWebhookCreate,
+)
+from askui.tools.askui.askui_workspaces.models.email_agent_trigger import (
+ EmailAgentTrigger,
+)
+from askui.tools.askui.askui_workspaces.models.email_agent_trigger_create import (
+ EmailAgentTriggerCreate,
+)
+from askui.tools.askui.askui_workspaces.models.email_agent_trigger_update import (
+ EmailAgentTriggerUpdate,
+)
+from askui.tools.askui.askui_workspaces.models.extract_data_command import (
+ ExtractDataCommand,
+)
+from askui.tools.askui.askui_workspaces.models.extract_data_response import (
+ ExtractDataResponse,
+)
from askui.tools.askui.askui_workspaces.models.file_dto import FileDto
-from askui.tools.askui.askui_workspaces.models.files_list_response_dto import FilesListResponseDto
-from askui.tools.askui.askui_workspaces.models.files_list_response_dto_data_inner import FilesListResponseDtoDataInner
+from askui.tools.askui.askui_workspaces.models.files_list_response_dto import (
+ FilesListResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.files_list_response_dto_data_inner import (
+ FilesListResponseDtoDataInner,
+)
from askui.tools.askui.askui_workspaces.models.folder_dto import FolderDto
-from askui.tools.askui.askui_workspaces.models.generate_signed_cookies_command import GenerateSignedCookiesCommand
-from askui.tools.askui.askui_workspaces.models.get_subscription_response_dto import GetSubscriptionResponseDto
-from askui.tools.askui.askui_workspaces.models.http_validation_error import HTTPValidationError
+from askui.tools.askui.askui_workspaces.models.generate_signed_cookies_command import (
+ GenerateSignedCookiesCommand,
+)
+from askui.tools.askui.askui_workspaces.models.get_subscription_response_dto import (
+ GetSubscriptionResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.http_validation_error import (
+ HTTPValidationError,
+)
from askui.tools.askui.askui_workspaces.models.json_schema import JsonSchema
-from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto import LeaseRunnerJobResponseDto
-from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data import LeaseRunnerJobResponseDtoData
-from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data_credentials import LeaseRunnerJobResponseDtoDataCredentials
-from askui.tools.askui.askui_workspaces.models.list_access_token_response_dto import ListAccessTokenResponseDto
-from askui.tools.askui.askui_workspaces.models.list_runs_response_dto import ListRunsResponseDto
-from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_input import ListSubjectAccessTokensResponseDtoInput
-from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_output import ListSubjectAccessTokensResponseDtoOutput
-from askui.tools.askui.askui_workspaces.models.lookup_access_token_command import LookupAccessTokenCommand
-from askui.tools.askui.askui_workspaces.models.lookup_access_token_response_dto import LookupAccessTokenResponseDto
-from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_command import LookupWorkspaceAccessTokenCommand
-from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_response_dto import LookupWorkspaceAccessTokenResponseDto
-from askui.tools.askui.askui_workspaces.models.ping_runner_job_response_dto import PingRunnerJobResponseDto
+from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto import (
+ LeaseRunnerJobResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data import (
+ LeaseRunnerJobResponseDtoData,
+)
+from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data_credentials import (
+ LeaseRunnerJobResponseDtoDataCredentials,
+)
+from askui.tools.askui.askui_workspaces.models.list_access_token_response_dto import (
+ ListAccessTokenResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.list_runs_response_dto import (
+ ListRunsResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_input import (
+ ListSubjectAccessTokensResponseDtoInput,
+)
+from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_output import (
+ ListSubjectAccessTokensResponseDtoOutput,
+)
+from askui.tools.askui.askui_workspaces.models.lookup_access_token_command import (
+ LookupAccessTokenCommand,
+)
+from askui.tools.askui.askui_workspaces.models.lookup_access_token_response_dto import (
+ LookupAccessTokenResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_command import (
+ LookupWorkspaceAccessTokenCommand,
+)
+from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_response_dto import (
+ LookupWorkspaceAccessTokenResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.ping_runner_job_response_dto import (
+ PingRunnerJobResponseDto,
+)
from askui.tools.askui.askui_workspaces.models.run_response_dto import RunResponseDto
from askui.tools.askui.askui_workspaces.models.run_status import RunStatus
from askui.tools.askui.askui_workspaces.models.run_template import RunTemplate
from askui.tools.askui.askui_workspaces.models.runner_assignment import RunnerAssignment
from askui.tools.askui.askui_workspaces.models.runner_host import RunnerHost
from askui.tools.askui.askui_workspaces.models.runner_job_status import RunnerJobStatus
-from askui.tools.askui.askui_workspaces.models.schedule_reponse_dto import ScheduleReponseDto
+from askui.tools.askui.askui_workspaces.models.schedule_reponse_dto import (
+ ScheduleReponseDto,
+)
from askui.tools.askui.askui_workspaces.models.schedule_status import ScheduleStatus
from askui.tools.askui.askui_workspaces.models.state import State
from askui.tools.askui.askui_workspaces.models.state1 import State1
-from askui.tools.askui.askui_workspaces.models.string_error_response import StringErrorResponse
-from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_input import SubjectAccessTokenResponseDtoInput
-from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_output import SubjectAccessTokenResponseDtoOutput
-from askui.tools.askui.askui_workspaces.models.update_workspace_name_request_dto import UpdateWorkspaceNameRequestDto
-from askui.tools.askui.askui_workspaces.models.update_workspace_name_response_dto import UpdateWorkspaceNameResponseDto
-from askui.tools.askui.askui_workspaces.models.upload_file_response import UploadFileResponse
+from askui.tools.askui.askui_workspaces.models.string_error_response import (
+ StringErrorResponse,
+)
+from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_input import (
+ SubjectAccessTokenResponseDtoInput,
+)
+from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_output import (
+ SubjectAccessTokenResponseDtoOutput,
+)
+from askui.tools.askui.askui_workspaces.models.update_workspace_name_request_dto import (
+ UpdateWorkspaceNameRequestDto,
+)
+from askui.tools.askui.askui_workspaces.models.update_workspace_name_response_dto import (
+ UpdateWorkspaceNameResponseDto,
+)
+from askui.tools.askui.askui_workspaces.models.upload_file_response import (
+ UploadFileResponse,
+)
from askui.tools.askui.askui_workspaces.models.usage_event import UsageEvent
-from askui.tools.askui.askui_workspaces.models.usage_events_list_response import UsageEventsListResponse
+from askui.tools.askui.askui_workspaces.models.usage_events_list_response import (
+ UsageEventsListResponse,
+)
from askui.tools.askui.askui_workspaces.models.user_dto import UserDto
from askui.tools.askui.askui_workspaces.models.validation_error import ValidationError
-from askui.tools.askui.askui_workspaces.models.validation_error_loc_inner import ValidationErrorLocInner
+from askui.tools.askui.askui_workspaces.models.validation_error_loc_inner import (
+ ValidationErrorLocInner,
+)
from askui.tools.askui.askui_workspaces.models.webhook_response import WebhookResponse
-from askui.tools.askui.askui_workspaces.models.workspace_access_token import WorkspaceAccessToken
+from askui.tools.askui.askui_workspaces.models.workspace_access_token import (
+ WorkspaceAccessToken,
+)
from askui.tools.askui.askui_workspaces.models.workspace_dto import WorkspaceDto
-from askui.tools.askui.askui_workspaces.models.workspace_memberships_list_response import WorkspaceMembershipsListResponse
-from askui.tools.askui.askui_workspaces.models.workspace_privilege import WorkspacePrivilege
-from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto import WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto
-from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto import WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto
-from askui.tools.askui.askui_workspaces.models.workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto import WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto
+from askui.tools.askui.askui_workspaces.models.workspace_memberships_list_response import (
+ WorkspaceMembershipsListResponse,
+)
+from askui.tools.askui.askui_workspaces.models.workspace_privilege import (
+ WorkspacePrivilege,
+)
+from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto import (
+ WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto,
+)
+from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto import (
+ WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto,
+)
+from askui.tools.askui.askui_workspaces.models.workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto import (
+ WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto,
+)
diff --git a/src/askui/tools/askui/askui_workspaces/models/access_token_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/access_token_response_dto.py
index 97d927d7..88f7067d 100644
--- a/src/askui/tools/askui/askui_workspaces/models/access_token_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/access_token_response_dto.py
@@ -1,32 +1,33 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class AccessTokenResponseDto(BaseModel):
"""
AccessTokenResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
id: StrictStr
name: StrictStr
@@ -40,7 +41,6 @@ class AccessTokenResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -66,9 +66,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -83,7 +85,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if expires_at (nullable) is None
# and model_fields_set contains the field
if self.expires_at is None and "expires_at" in self.model_fields_set:
- _dict['expiresAt'] = None
+ _dict["expiresAt"] = None
return _dict
@@ -96,17 +98,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "createdAt": obj.get("createdAt"),
- "id": obj.get("id"),
- "name": obj.get("name"),
- "expiresAt": obj.get("expiresAt")
- })
+ _obj = cls.model_validate(
+ {
+ "createdAt": obj.get("createdAt"),
+ "id": obj.get("id"),
+ "name": obj.get("name"),
+ "expiresAt": obj.get("expiresAt"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent.py b/src/askui/tools/askui/askui_workspaces/models/agent.py
index dd1695ef..fafe6f55 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent.py
@@ -1,61 +1,97 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
-from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
-from askui.tools.askui.askui_workspaces.models.agent_data_destinations_inner import AgentDataDestinationsInner
-from askui.tools.askui.askui_workspaces.models.email_agent_trigger import EmailAgentTrigger
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
+from pydantic import (
+ BaseModel,
+ ConfigDict,
+ Field,
+ StrictBool,
+ StrictStr,
+ field_validator,
+)
+from typing_extensions import Annotated, Self
+
+from askui.tools.askui.askui_workspaces.models.agent_data_destinations_inner import (
+ AgentDataDestinationsInner,
+)
+from askui.tools.askui.askui_workspaces.models.email_agent_trigger import (
+ EmailAgentTrigger,
+)
from askui.tools.askui.askui_workspaces.models.json_schema import JsonSchema
-from typing import Optional, Set
-from typing_extensions import Self
+
class Agent(BaseModel):
"""
Agent
- """ # noqa: E501
+ """ # noqa: E501
+
id: Optional[StrictStr] = None
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
updated_at: Optional[datetime] = Field(default=None, alias="updatedAt")
- name: Annotated[str, Field(strict=True)] = Field(description="The name of the agent. The name must only contain the following characters: a-z, A-Z, 0-9, -, _, and space. The name must not be empty. The name must start and end with a letter or a number. The name must not be longer than 64 characters.")
+ name: Annotated[str, Field(strict=True)] = Field(
+ description="The name of the agent. The name must only contain the following characters: a-z, A-Z, 0-9, -, _, and space. The name must not be empty. The name must start and end with a letter or a number. The name must not be longer than 64 characters."
+ )
status: StrictStr
- auto_confirm: StrictBool = Field(description="If true, the agent will automatically confirm the data extracted, i.e., no review is necessary.", alias="autoConfirm")
- description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = ''
+ auto_confirm: StrictBool = Field(
+ description="If true, the agent will automatically confirm the data extracted, i.e., no review is necessary.",
+ alias="autoConfirm",
+ )
+ description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = ""
email_trigger: EmailAgentTrigger = Field(alias="emailTrigger")
- data_schema: JsonSchema = Field(description=" The data schema describes the data to extract in form of a [JSON schema draft 2020-12](https://json-schema.org/draft/2020-12/release-notes). Use the [\"description\" keyword](https://json-schema.org/understanding-json-schema/reference/annotations) of each property to provide additional information about the field, e.g., the prompt for extraction from sources. ", alias="dataSchema")
- data_destinations: List[AgentDataDestinationsInner] = Field(alias="dataDestinations")
+ data_schema: JsonSchema = Field(
+ description=' The data schema describes the data to extract in form of a [JSON schema draft 2020-12](https://json-schema.org/draft/2020-12/release-notes). Use the ["description" keyword](https://json-schema.org/understanding-json-schema/reference/annotations) of each property to provide additional information about the field, e.g., the prompt for extraction from sources. ',
+ alias="dataSchema",
+ )
+ data_destinations: List[AgentDataDestinationsInner] = Field(
+ alias="dataDestinations"
+ )
workspace_id: StrictStr = Field(alias="workspaceId")
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt", "name", "status", "autoConfirm", "description", "emailTrigger", "dataSchema", "dataDestinations", "workspaceId"]
-
- @field_validator('name')
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "createdAt",
+ "updatedAt",
+ "name",
+ "status",
+ "autoConfirm",
+ "description",
+ "emailTrigger",
+ "dataSchema",
+ "dataDestinations",
+ "workspaceId",
+ ]
+
+ @field_validator("name")
def name_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$", value):
- raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$/")
+ raise ValueError(
+ r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$/"
+ )
return value
- @field_validator('status')
+ @field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
- if value not in set(['ACTIVE', 'ARCHIVED']):
+ if value not in set(["ACTIVE", "ARCHIVED"]):
raise ValueError("must be one of enum values ('ACTIVE', 'ARCHIVED')")
return value
@@ -65,7 +101,6 @@ def status_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -91,9 +126,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -102,17 +139,17 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of email_trigger
if self.email_trigger:
- _dict['emailTrigger'] = self.email_trigger.to_dict()
+ _dict["emailTrigger"] = self.email_trigger.to_dict()
# override the default output from pydantic by calling `to_dict()` of data_schema
if self.data_schema:
- _dict['dataSchema'] = self.data_schema.to_dict()
+ _dict["dataSchema"] = self.data_schema.to_dict()
# override the default output from pydantic by calling `to_dict()` of each item in data_destinations (list)
_items = []
if self.data_destinations:
for _item in self.data_destinations:
if _item:
_items.append(_item.to_dict())
- _dict['dataDestinations'] = _items
+ _dict["dataDestinations"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -129,24 +166,35 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "createdAt": obj.get("createdAt"),
- "updatedAt": obj.get("updatedAt"),
- "name": obj.get("name"),
- "status": obj.get("status"),
- "autoConfirm": obj.get("autoConfirm"),
- "description": obj.get("description") if obj.get("description") is not None else '',
- "emailTrigger": EmailAgentTrigger.from_dict(obj["emailTrigger"]) if obj.get("emailTrigger") is not None else None,
- "dataSchema": JsonSchema.from_dict(obj["dataSchema"]) if obj.get("dataSchema") is not None else None,
- "dataDestinations": [AgentDataDestinationsInner.from_dict(_item) for _item in obj["dataDestinations"]] if obj.get("dataDestinations") is not None else None,
- "workspaceId": obj.get("workspaceId")
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "createdAt": obj.get("createdAt"),
+ "updatedAt": obj.get("updatedAt"),
+ "name": obj.get("name"),
+ "status": obj.get("status"),
+ "autoConfirm": obj.get("autoConfirm"),
+ "description": obj.get("description")
+ if obj.get("description") is not None
+ else "",
+ "emailTrigger": EmailAgentTrigger.from_dict(obj["emailTrigger"])
+ if obj.get("emailTrigger") is not None
+ else None,
+ "dataSchema": JsonSchema.from_dict(obj["dataSchema"])
+ if obj.get("dataSchema") is not None
+ else None,
+ "dataDestinations": [
+ AgentDataDestinationsInner.from_dict(_item)
+ for _item in obj["dataDestinations"]
+ ]
+ if obj.get("dataDestinations") is not None
+ else None,
+ "workspaceId": obj.get("workspaceId"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_create_command.py b/src/askui/tools/askui/askui_workspaces/models/agent_create_command.py
index 5f970348..24bf09c2 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_create_command.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_create_command.py
@@ -1,51 +1,87 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
-from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
-from askui.tools.askui.askui_workspaces.models.agent_create_command_data_destinations_inner import AgentCreateCommandDataDestinationsInner
-from askui.tools.askui.askui_workspaces.models.email_agent_trigger_create import EmailAgentTriggerCreate
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
+from pydantic import (
+ BaseModel,
+ ConfigDict,
+ Field,
+ StrictBool,
+ StrictStr,
+ field_validator,
+)
+from typing_extensions import Annotated, Self
+
+from askui.tools.askui.askui_workspaces.models.agent_create_command_data_destinations_inner import (
+ AgentCreateCommandDataDestinationsInner,
+)
+from askui.tools.askui.askui_workspaces.models.email_agent_trigger_create import (
+ EmailAgentTriggerCreate,
+)
from askui.tools.askui.askui_workspaces.models.json_schema import JsonSchema
-from typing import Optional, Set
-from typing_extensions import Self
+
class AgentCreateCommand(BaseModel):
"""
AgentCreateCommand
- """ # noqa: E501
- name: Annotated[str, Field(strict=True)] = Field(description="The name of the agent. The name must only contain the following characters: a-z, A-Z, 0-9, -, _, and space. The name must not be empty. The name must start and end with a letter or a number. The name must not be longer than 64 characters.")
- description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = ''
- data_schema: JsonSchema = Field(description="The JSON schema of the data that the agent is going to extract from documents uploaded. The schema must comply with Draft 2020-12. The schema (root) must be an object with at least one property. The size of the schema must not exceed 15 MB.", alias="dataSchema")
- auto_confirm: Optional[StrictBool] = Field(default=False, description="If true, the agent will automatically confirm the data extracted, i.e., no review is necessary.", alias="autoConfirm")
- data_destinations: Optional[List[AgentCreateCommandDataDestinationsInner]] = Field(default=None, alias="dataDestinations")
+ """ # noqa: E501
+
+ name: Annotated[str, Field(strict=True)] = Field(
+ description="The name of the agent. The name must only contain the following characters: a-z, A-Z, 0-9, -, _, and space. The name must not be empty. The name must start and end with a letter or a number. The name must not be longer than 64 characters."
+ )
+ description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = ""
+ data_schema: JsonSchema = Field(
+ description="The JSON schema of the data that the agent is going to extract from documents uploaded. The schema must comply with Draft 2020-12. The schema (root) must be an object with at least one property. The size of the schema must not exceed 15 MB.",
+ alias="dataSchema",
+ )
+ auto_confirm: Optional[StrictBool] = Field(
+ default=False,
+ description="If true, the agent will automatically confirm the data extracted, i.e., no review is necessary.",
+ alias="autoConfirm",
+ )
+ data_destinations: Optional[List[AgentCreateCommandDataDestinationsInner]] = Field(
+ default=None, alias="dataDestinations"
+ )
parent_id: Optional[StrictStr] = Field(default=None, alias="parentId")
- email_trigger: Optional[EmailAgentTriggerCreate] = Field(default=None, alias="emailTrigger")
+ email_trigger: Optional[EmailAgentTriggerCreate] = Field(
+ default=None, alias="emailTrigger"
+ )
workspace_id: StrictStr = Field(alias="workspaceId")
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["name", "description", "dataSchema", "autoConfirm", "dataDestinations", "parentId", "emailTrigger", "workspaceId"]
-
- @field_validator('name')
+ __properties: ClassVar[List[str]] = [
+ "name",
+ "description",
+ "dataSchema",
+ "autoConfirm",
+ "dataDestinations",
+ "parentId",
+ "emailTrigger",
+ "workspaceId",
+ ]
+
+ @field_validator("name")
def name_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$", value):
- raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$/")
+ raise ValueError(
+ r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$/"
+ )
return value
model_config = ConfigDict(
@@ -54,7 +90,6 @@ def name_validate_regular_expression(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -80,9 +115,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -91,17 +128,17 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of data_schema
if self.data_schema:
- _dict['dataSchema'] = self.data_schema.to_dict()
+ _dict["dataSchema"] = self.data_schema.to_dict()
# override the default output from pydantic by calling `to_dict()` of each item in data_destinations (list)
_items = []
if self.data_destinations:
for _item in self.data_destinations:
if _item:
_items.append(_item.to_dict())
- _dict['dataDestinations'] = _items
+ _dict["dataDestinations"] = _items
# override the default output from pydantic by calling `to_dict()` of email_trigger
if self.email_trigger:
- _dict['emailTrigger'] = self.email_trigger.to_dict()
+ _dict["emailTrigger"] = self.email_trigger.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -110,7 +147,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if parent_id (nullable) is None
# and model_fields_set contains the field
if self.parent_id is None and "parent_id" in self.model_fields_set:
- _dict['parentId'] = None
+ _dict["parentId"] = None
return _dict
@@ -123,21 +160,34 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "name": obj.get("name"),
- "description": obj.get("description") if obj.get("description") is not None else '',
- "dataSchema": JsonSchema.from_dict(obj["dataSchema"]) if obj.get("dataSchema") is not None else None,
- "autoConfirm": obj.get("autoConfirm") if obj.get("autoConfirm") is not None else False,
- "dataDestinations": [AgentCreateCommandDataDestinationsInner.from_dict(_item) for _item in obj["dataDestinations"]] if obj.get("dataDestinations") is not None else None,
- "parentId": obj.get("parentId"),
- "emailTrigger": EmailAgentTriggerCreate.from_dict(obj["emailTrigger"]) if obj.get("emailTrigger") is not None else None,
- "workspaceId": obj.get("workspaceId")
- })
+ _obj = cls.model_validate(
+ {
+ "name": obj.get("name"),
+ "description": obj.get("description")
+ if obj.get("description") is not None
+ else "",
+ "dataSchema": JsonSchema.from_dict(obj["dataSchema"])
+ if obj.get("dataSchema") is not None
+ else None,
+ "autoConfirm": obj.get("autoConfirm")
+ if obj.get("autoConfirm") is not None
+ else False,
+ "dataDestinations": [
+ AgentCreateCommandDataDestinationsInner.from_dict(_item)
+ for _item in obj["dataDestinations"]
+ ]
+ if obj.get("dataDestinations") is not None
+ else None,
+ "parentId": obj.get("parentId"),
+ "emailTrigger": EmailAgentTriggerCreate.from_dict(obj["emailTrigger"])
+ if obj.get("emailTrigger") is not None
+ else None,
+ "workspaceId": obj.get("workspaceId"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_create_command_data_destinations_inner.py b/src/askui/tools/askui/askui_workspaces/models/agent_create_command_data_destinations_inner.py
index 375d54fd..3bc1c884 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_create_command_data_destinations_inner.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_create_command_data_destinations_inner.py
@@ -1,83 +1,113 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
import json
import pprint
-from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
-from typing import Any, List, Optional
-from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow_create import DataDestinationAskUiWorkflowCreate
-from askui.tools.askui.askui_workspaces.models.data_destination_webhook_create import DataDestinationWebhookCreate
-from pydantic import StrictStr, Field
-from typing import Union, List, Set, Optional, Dict
-from typing_extensions import Literal, Self
+from typing import Any, Dict, Optional, Set, Union
+
+from pydantic import (
+ BaseModel,
+ ConfigDict,
+ ValidationError,
+ field_validator,
+)
+from typing_extensions import Self
+
+from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow_create import (
+ DataDestinationAskUiWorkflowCreate,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_webhook_create import (
+ DataDestinationWebhookCreate,
+)
+
+AGENTCREATECOMMANDDATADESTINATIONSINNER_ONE_OF_SCHEMAS = [
+ "DataDestinationAskUiWorkflowCreate",
+ "DataDestinationWebhookCreate",
+]
-AGENTCREATECOMMANDDATADESTINATIONSINNER_ONE_OF_SCHEMAS = ["DataDestinationAskUiWorkflowCreate", "DataDestinationWebhookCreate"]
class AgentCreateCommandDataDestinationsInner(BaseModel):
"""
AgentCreateCommandDataDestinationsInner
"""
+
# data type: DataDestinationAskUiWorkflowCreate
oneof_schema_1_validator: Optional[DataDestinationAskUiWorkflowCreate] = None
# data type: DataDestinationWebhookCreate
oneof_schema_2_validator: Optional[DataDestinationWebhookCreate] = None
- actual_instance: Optional[Union[DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate]] = None
- one_of_schemas: Set[str] = { "DataDestinationAskUiWorkflowCreate", "DataDestinationWebhookCreate" }
+ actual_instance: Optional[
+ Union[DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate]
+ ] = None
+ one_of_schemas: Set[str] = {
+ "DataDestinationAskUiWorkflowCreate",
+ "DataDestinationWebhookCreate",
+ }
model_config = ConfigDict(
validate_assignment=True,
protected_namespaces=(),
)
-
- discriminator_value_class_map: Dict[str, str] = {
- }
+ discriminator_value_class_map: Dict[str, str] = {}
def __init__(self, *args, **kwargs) -> None:
if args:
if len(args) > 1:
- raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ raise ValueError(
+ "If a position argument is used, only 1 is allowed to set `actual_instance`"
+ )
if kwargs:
- raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ raise ValueError(
+ "If a position argument is used, keyword arguments cannot be used."
+ )
super().__init__(actual_instance=args[0])
else:
super().__init__(**kwargs)
- @field_validator('actual_instance')
+ @field_validator("actual_instance")
def actual_instance_must_validate_oneof(cls, v):
instance = AgentCreateCommandDataDestinationsInner.model_construct()
error_messages = []
match = 0
# validate data type: DataDestinationAskUiWorkflowCreate
if not isinstance(v, DataDestinationAskUiWorkflowCreate):
- error_messages.append(f"Error! Input type `{type(v)}` is not `DataDestinationAskUiWorkflowCreate`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `DataDestinationAskUiWorkflowCreate`"
+ )
else:
match += 1
# validate data type: DataDestinationWebhookCreate
if not isinstance(v, DataDestinationWebhookCreate):
- error_messages.append(f"Error! Input type `{type(v)}` is not `DataDestinationWebhookCreate`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `DataDestinationWebhookCreate`"
+ )
else:
match += 1
if match > 1:
# more than 1 match
- raise ValueError("Multiple matches found when setting `actual_instance` in AgentCreateCommandDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate. Details: " + ", ".join(error_messages))
- elif match == 0:
+ raise ValueError(
+ "Multiple matches found when setting `actual_instance` in AgentCreateCommandDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate. Details: "
+ + ", ".join(error_messages)
+ )
+ if match == 0:
# no match
- raise ValueError("No match found when setting `actual_instance` in AgentCreateCommandDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate. Details: " + ", ".join(error_messages))
- else:
- return v
+ raise ValueError(
+ "No match found when setting `actual_instance` in AgentCreateCommandDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate. Details: "
+ + ", ".join(error_messages)
+ )
+ return v
@classmethod
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
@@ -93,11 +123,15 @@ def from_json(cls, json_str: str) -> Self:
# use oneOf discriminator to lookup the data type
_data_type = json.loads(json_str).get("type")
if not _data_type:
- raise ValueError("Failed to lookup data type from the field `type` in the input.")
+ raise ValueError(
+ "Failed to lookup data type from the field `type` in the input."
+ )
# check if data type is `DataDestinationAskUiWorkflowCreate`
if _data_type == "ASKUI_WORKFLOW":
- instance.actual_instance = DataDestinationAskUiWorkflowCreate.from_json(json_str)
+ instance.actual_instance = DataDestinationAskUiWorkflowCreate.from_json(
+ json_str
+ )
return instance
# check if data type is `DataDestinationWebhookCreate`
@@ -107,7 +141,9 @@ def from_json(cls, json_str: str) -> Self:
# check if data type is `DataDestinationAskUiWorkflowCreate`
if _data_type == "DataDestinationAskUiWorkflowCreate":
- instance.actual_instance = DataDestinationAskUiWorkflowCreate.from_json(json_str)
+ instance.actual_instance = DataDestinationAskUiWorkflowCreate.from_json(
+ json_str
+ )
return instance
# check if data type is `DataDestinationWebhookCreate`
@@ -117,7 +153,9 @@ def from_json(cls, json_str: str) -> Self:
# deserialize data into DataDestinationAskUiWorkflowCreate
try:
- instance.actual_instance = DataDestinationAskUiWorkflowCreate.from_json(json_str)
+ instance.actual_instance = DataDestinationAskUiWorkflowCreate.from_json(
+ json_str
+ )
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
@@ -130,36 +168,49 @@ def from_json(cls, json_str: str) -> Self:
if match > 1:
# more than 1 match
- raise ValueError("Multiple matches found when deserializing the JSON string into AgentCreateCommandDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate. Details: " + ", ".join(error_messages))
- elif match == 0:
+ raise ValueError(
+ "Multiple matches found when deserializing the JSON string into AgentCreateCommandDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate. Details: "
+ + ", ".join(error_messages)
+ )
+ if match == 0:
# no match
- raise ValueError("No match found when deserializing the JSON string into AgentCreateCommandDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate. Details: " + ", ".join(error_messages))
- else:
- return instance
+ raise ValueError(
+ "No match found when deserializing the JSON string into AgentCreateCommandDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate. Details: "
+ + ", ".join(error_messages)
+ )
+ return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
- if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ if hasattr(self.actual_instance, "to_json") and callable(
+ self.actual_instance.to_json
+ ):
return self.actual_instance.to_json()
- else:
- return json.dumps(self.actual_instance)
-
- def to_dict(self) -> Optional[Union[Dict[str, Any], DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate]]:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(
+ self,
+ ) -> Optional[
+ Union[
+ Dict[str, Any],
+ DataDestinationAskUiWorkflowCreate,
+ DataDestinationWebhookCreate,
+ ]
+ ]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
- if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ if hasattr(self.actual_instance, "to_dict") and callable(
+ self.actual_instance.to_dict
+ ):
return self.actual_instance.to_dict()
- else:
- # primitive type
- return self.actual_instance
+ # primitive type
+ return self.actual_instance
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_data_destinations_inner.py b/src/askui/tools/askui/askui_workspaces/models/agent_data_destinations_inner.py
index 418c0ed0..6fdfd525 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_data_destinations_inner.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_data_destinations_inner.py
@@ -1,83 +1,113 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
import json
import pprint
-from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
-from typing import Any, List, Optional
-from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow import DataDestinationAskUiWorkflow
-from askui.tools.askui.askui_workspaces.models.data_destination_webhook import DataDestinationWebhook
-from pydantic import StrictStr, Field
-from typing import Union, List, Set, Optional, Dict
-from typing_extensions import Literal, Self
+from typing import Any, Dict, Optional, Set, Union
+
+from pydantic import (
+ BaseModel,
+ ConfigDict,
+ ValidationError,
+ field_validator,
+)
+from typing_extensions import Self
+
+from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow import (
+ DataDestinationAskUiWorkflow,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_webhook import (
+ DataDestinationWebhook,
+)
+
+AGENTDATADESTINATIONSINNER_ONE_OF_SCHEMAS = [
+ "DataDestinationAskUiWorkflow",
+ "DataDestinationWebhook",
+]
-AGENTDATADESTINATIONSINNER_ONE_OF_SCHEMAS = ["DataDestinationAskUiWorkflow", "DataDestinationWebhook"]
class AgentDataDestinationsInner(BaseModel):
"""
AgentDataDestinationsInner
"""
+
# data type: DataDestinationAskUiWorkflow
oneof_schema_1_validator: Optional[DataDestinationAskUiWorkflow] = None
# data type: DataDestinationWebhook
oneof_schema_2_validator: Optional[DataDestinationWebhook] = None
- actual_instance: Optional[Union[DataDestinationAskUiWorkflow, DataDestinationWebhook]] = None
- one_of_schemas: Set[str] = { "DataDestinationAskUiWorkflow", "DataDestinationWebhook" }
+ actual_instance: Optional[
+ Union[DataDestinationAskUiWorkflow, DataDestinationWebhook]
+ ] = None
+ one_of_schemas: Set[str] = {
+ "DataDestinationAskUiWorkflow",
+ "DataDestinationWebhook",
+ }
model_config = ConfigDict(
validate_assignment=True,
protected_namespaces=(),
)
-
- discriminator_value_class_map: Dict[str, str] = {
- }
+ discriminator_value_class_map: Dict[str, str] = {}
def __init__(self, *args, **kwargs) -> None:
if args:
if len(args) > 1:
- raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ raise ValueError(
+ "If a position argument is used, only 1 is allowed to set `actual_instance`"
+ )
if kwargs:
- raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ raise ValueError(
+ "If a position argument is used, keyword arguments cannot be used."
+ )
super().__init__(actual_instance=args[0])
else:
super().__init__(**kwargs)
- @field_validator('actual_instance')
+ @field_validator("actual_instance")
def actual_instance_must_validate_oneof(cls, v):
instance = AgentDataDestinationsInner.model_construct()
error_messages = []
match = 0
# validate data type: DataDestinationAskUiWorkflow
if not isinstance(v, DataDestinationAskUiWorkflow):
- error_messages.append(f"Error! Input type `{type(v)}` is not `DataDestinationAskUiWorkflow`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `DataDestinationAskUiWorkflow`"
+ )
else:
match += 1
# validate data type: DataDestinationWebhook
if not isinstance(v, DataDestinationWebhook):
- error_messages.append(f"Error! Input type `{type(v)}` is not `DataDestinationWebhook`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `DataDestinationWebhook`"
+ )
else:
match += 1
if match > 1:
# more than 1 match
- raise ValueError("Multiple matches found when setting `actual_instance` in AgentDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflow, DataDestinationWebhook. Details: " + ", ".join(error_messages))
- elif match == 0:
+ raise ValueError(
+ "Multiple matches found when setting `actual_instance` in AgentDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflow, DataDestinationWebhook. Details: "
+ + ", ".join(error_messages)
+ )
+ if match == 0:
# no match
- raise ValueError("No match found when setting `actual_instance` in AgentDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflow, DataDestinationWebhook. Details: " + ", ".join(error_messages))
- else:
- return v
+ raise ValueError(
+ "No match found when setting `actual_instance` in AgentDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflow, DataDestinationWebhook. Details: "
+ + ", ".join(error_messages)
+ )
+ return v
@classmethod
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
@@ -93,7 +123,9 @@ def from_json(cls, json_str: str) -> Self:
# use oneOf discriminator to lookup the data type
_data_type = json.loads(json_str).get("type")
if not _data_type:
- raise ValueError("Failed to lookup data type from the field `type` in the input.")
+ raise ValueError(
+ "Failed to lookup data type from the field `type` in the input."
+ )
# check if data type is `DataDestinationAskUiWorkflow`
if _data_type == "ASKUI_WORKFLOW":
@@ -130,36 +162,45 @@ def from_json(cls, json_str: str) -> Self:
if match > 1:
# more than 1 match
- raise ValueError("Multiple matches found when deserializing the JSON string into AgentDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflow, DataDestinationWebhook. Details: " + ", ".join(error_messages))
- elif match == 0:
+ raise ValueError(
+ "Multiple matches found when deserializing the JSON string into AgentDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflow, DataDestinationWebhook. Details: "
+ + ", ".join(error_messages)
+ )
+ if match == 0:
# no match
- raise ValueError("No match found when deserializing the JSON string into AgentDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflow, DataDestinationWebhook. Details: " + ", ".join(error_messages))
- else:
- return instance
+ raise ValueError(
+ "No match found when deserializing the JSON string into AgentDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflow, DataDestinationWebhook. Details: "
+ + ", ".join(error_messages)
+ )
+ return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
- if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ if hasattr(self.actual_instance, "to_json") and callable(
+ self.actual_instance.to_json
+ ):
return self.actual_instance.to_json()
- else:
- return json.dumps(self.actual_instance)
+ return json.dumps(self.actual_instance)
- def to_dict(self) -> Optional[Union[Dict[str, Any], DataDestinationAskUiWorkflow, DataDestinationWebhook]]:
+ def to_dict(
+ self,
+ ) -> Optional[
+ Union[Dict[str, Any], DataDestinationAskUiWorkflow, DataDestinationWebhook]
+ ]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
- if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ if hasattr(self.actual_instance, "to_dict") and callable(
+ self.actual_instance.to_dict
+ ):
return self.actual_instance.to_dict()
- else:
- # primitive type
- return self.actual_instance
+ # primitive type
+ return self.actual_instance
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution.py
index c6630346..72328ada 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution.py
@@ -1,33 +1,35 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.state import State
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.state import State
+
+
class AgentExecution(BaseModel):
"""
AgentExecution
- """ # noqa: E501
+ """ # noqa: E501
+
id: Optional[StrictStr] = None
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
updated_at: Optional[datetime] = Field(default=None, alias="updatedAt")
@@ -35,7 +37,14 @@ class AgentExecution(BaseModel):
workspace_id: StrictStr = Field(alias="workspaceId")
state: State
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt", "agentId", "workspaceId", "state"]
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "createdAt",
+ "updatedAt",
+ "agentId",
+ "workspaceId",
+ "state",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -43,7 +52,6 @@ class AgentExecution(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -69,9 +77,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -80,7 +90,7 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of state
if self.state:
- _dict['state'] = self.state.to_dict()
+ _dict["state"] = self.state.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -97,19 +107,21 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "createdAt": obj.get("createdAt"),
- "updatedAt": obj.get("updatedAt"),
- "agentId": obj.get("agentId"),
- "workspaceId": obj.get("workspaceId"),
- "state": State.from_dict(obj["state"]) if obj.get("state") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "createdAt": obj.get("createdAt"),
+ "updatedAt": obj.get("updatedAt"),
+ "agentId": obj.get("agentId"),
+ "workspaceId": obj.get("workspaceId"),
+ "state": State.from_dict(obj["state"])
+ if obj.get("state") is not None
+ else None,
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_cancel.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_cancel.py
index 4143c41d..b12878f3 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_cancel.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution_cancel.py
@@ -1,42 +1,43 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class AgentExecutionCancel(BaseModel):
"""
AgentExecutionCancel
- """ # noqa: E501
- status: Optional[StrictStr] = 'CANCELED'
+ """ # noqa: E501
+
+ status: Optional[StrictStr] = "CANCELED"
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["status"]
- @field_validator('status')
+ @field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['CANCELED']):
+ if value not in set(["CANCELED"]):
raise ValueError("must be one of enum values ('CANCELED')")
return value
@@ -46,7 +47,6 @@ def status_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -72,9 +72,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -97,14 +99,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "status": obj.get("status") if obj.get("status") is not None else 'CANCELED'
- })
+ _obj = cls.model_validate(
+ {
+ "status": obj.get("status")
+ if obj.get("status") is not None
+ else "CANCELED"
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_confirm.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_confirm.py
index 8cf9de3a..fd42e1bb 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_confirm.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution_confirm.py
@@ -1,43 +1,44 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class AgentExecutionConfirm(BaseModel):
"""
AgentExecutionConfirm
- """ # noqa: E501
- status: Optional[StrictStr] = 'CONFIRMED'
+ """ # noqa: E501
+
+ status: Optional[StrictStr] = "CONFIRMED"
data_confirmed: Dict[str, Any] = Field(alias="dataConfirmed")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["status", "dataConfirmed"]
- @field_validator('status')
+ @field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['CONFIRMED']):
+ if value not in set(["CONFIRMED"]):
raise ValueError("must be one of enum values ('CONFIRMED')")
return value
@@ -47,7 +48,6 @@ def status_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -73,9 +73,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -98,15 +100,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "status": obj.get("status") if obj.get("status") is not None else 'CONFIRMED',
- "dataConfirmed": obj.get("dataConfirmed")
- })
+ _obj = cls.model_validate(
+ {
+ "status": obj.get("status")
+ if obj.get("status") is not None
+ else "CONFIRMED",
+ "dataConfirmed": obj.get("dataConfirmed"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_pending_review.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_pending_review.py
index fb99995e..ba123c7c 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_pending_review.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution_pending_review.py
@@ -1,43 +1,44 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class AgentExecutionPendingReview(BaseModel):
"""
AgentExecutionPendingReview
- """ # noqa: E501
- status: Optional[StrictStr] = 'PENDING_REVIEW'
+ """ # noqa: E501
+
+ status: Optional[StrictStr] = "PENDING_REVIEW"
data_extracted: Dict[str, Any] = Field(alias="dataExtracted")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["status", "dataExtracted"]
- @field_validator('status')
+ @field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['PENDING_REVIEW']):
+ if value not in set(["PENDING_REVIEW"]):
raise ValueError("must be one of enum values ('PENDING_REVIEW')")
return value
@@ -47,7 +48,6 @@ def status_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -73,9 +73,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -98,15 +100,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "status": obj.get("status") if obj.get("status") is not None else 'PENDING_REVIEW',
- "dataExtracted": obj.get("dataExtracted")
- })
+ _obj = cls.model_validate(
+ {
+ "status": obj.get("status")
+ if obj.get("status") is not None
+ else "PENDING_REVIEW",
+ "dataExtracted": obj.get("dataExtracted"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_canceled.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_canceled.py
index 741ffa36..3a220fd2 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_canceled.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_canceled.py
@@ -1,43 +1,48 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class AgentExecutionStateCanceled(BaseModel):
"""
AgentExecutionStateCanceled
- """ # noqa: E501
- status: Optional[StrictStr] = Field(default='CANCELED', description="The agent execution was canceled by the user.")
- data_extracted: Optional[Dict[str, Any]] = Field(default=None, alias="dataExtracted")
+ """ # noqa: E501
+
+ status: Optional[StrictStr] = Field(
+ default="CANCELED", description="The agent execution was canceled by the user."
+ )
+ data_extracted: Optional[Dict[str, Any]] = Field(
+ default=None, alias="dataExtracted"
+ )
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["status", "dataExtracted"]
- @field_validator('status')
+ @field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['CANCELED']):
+ if value not in set(["CANCELED"]):
raise ValueError("must be one of enum values ('CANCELED')")
return value
@@ -47,7 +52,6 @@ def status_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -73,9 +77,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -90,7 +96,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if data_extracted (nullable) is None
# and model_fields_set contains the field
if self.data_extracted is None and "data_extracted" in self.model_fields_set:
- _dict['dataExtracted'] = None
+ _dict["dataExtracted"] = None
return _dict
@@ -103,15 +109,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "status": obj.get("status") if obj.get("status") is not None else 'CANCELED',
- "dataExtracted": obj.get("dataExtracted")
- })
+ _obj = cls.model_validate(
+ {
+ "status": obj.get("status")
+ if obj.get("status") is not None
+ else "CANCELED",
+ "dataExtracted": obj.get("dataExtracted"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_confirmed.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_confirmed.py
index dfa37756..7f82c639 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_confirmed.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_confirmed.py
@@ -1,44 +1,47 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class AgentExecutionStateConfirmed(BaseModel):
"""
AgentExecutionStateConfirmed
- """ # noqa: E501
- status: Optional[StrictStr] = Field(default='CONFIRMED', description="The user confirmed the extracted data.")
+ """ # noqa: E501
+
+ status: Optional[StrictStr] = Field(
+ default="CONFIRMED", description="The user confirmed the extracted data."
+ )
data_extracted: Dict[str, Any] = Field(alias="dataExtracted")
data_confirmed: Dict[str, Any] = Field(alias="dataConfirmed")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["status", "dataExtracted", "dataConfirmed"]
- @field_validator('status')
+ @field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['CONFIRMED']):
+ if value not in set(["CONFIRMED"]):
raise ValueError("must be one of enum values ('CONFIRMED')")
return value
@@ -48,7 +51,6 @@ def status_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -74,9 +76,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -99,16 +103,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "status": obj.get("status") if obj.get("status") is not None else 'CONFIRMED',
- "dataExtracted": obj.get("dataExtracted"),
- "dataConfirmed": obj.get("dataConfirmed")
- })
+ _obj = cls.model_validate(
+ {
+ "status": obj.get("status")
+ if obj.get("status") is not None
+ else "CONFIRMED",
+ "dataExtracted": obj.get("dataExtracted"),
+ "dataConfirmed": obj.get("dataConfirmed"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination.py
index cd80b3a1..26b2194e 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination.py
@@ -1,46 +1,60 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.24
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.24
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_deliveries_inner import AgentExecutionStateDeliveredToDestinationDeliveriesInner
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_deliveries_inner import (
+ AgentExecutionStateDeliveredToDestinationDeliveriesInner,
+)
+
+
class AgentExecutionStateDeliveredToDestination(BaseModel):
"""
AgentExecutionStateDeliveredToDestination
- """ # noqa: E501
- status: Optional[StrictStr] = Field(default='DELIVERED_TO_DESTINATION', description="The extracted data was successfully delivered to the destination(s), e.g., an AskUI workflow invoked with the data.")
+ """ # noqa: E501
+
+ status: Optional[StrictStr] = Field(
+ default="DELIVERED_TO_DESTINATION",
+ description="The extracted data was successfully delivered to the destination(s), e.g., an AskUI workflow invoked with the data.",
+ )
data_extracted: Dict[str, Any] = Field(alias="dataExtracted")
data_confirmed: Dict[str, Any] = Field(alias="dataConfirmed")
- deliveries: Optional[List[AgentExecutionStateDeliveredToDestinationDeliveriesInner]] = None
+ deliveries: Optional[
+ List[AgentExecutionStateDeliveredToDestinationDeliveriesInner]
+ ] = None
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["status", "dataExtracted", "dataConfirmed", "deliveries"]
-
- @field_validator('status')
+ __properties: ClassVar[List[str]] = [
+ "status",
+ "dataExtracted",
+ "dataConfirmed",
+ "deliveries",
+ ]
+
+ @field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['DELIVERED_TO_DESTINATION']):
+ if value not in set(["DELIVERED_TO_DESTINATION"]):
raise ValueError("must be one of enum values ('DELIVERED_TO_DESTINATION')")
return value
@@ -50,7 +64,6 @@ def status_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -76,9 +89,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -91,7 +106,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.deliveries:
if _item:
_items.append(_item.to_dict())
- _dict['deliveries'] = _items
+ _dict["deliveries"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -108,17 +123,26 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "status": obj.get("status") if obj.get("status") is not None else 'DELIVERED_TO_DESTINATION',
- "dataExtracted": obj.get("dataExtracted"),
- "dataConfirmed": obj.get("dataConfirmed"),
- "deliveries": [AgentExecutionStateDeliveredToDestinationDeliveriesInner.from_dict(_item) for _item in obj["deliveries"]] if obj.get("deliveries") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "status": obj.get("status")
+ if obj.get("status") is not None
+ else "DELIVERED_TO_DESTINATION",
+ "dataExtracted": obj.get("dataExtracted"),
+ "dataConfirmed": obj.get("dataConfirmed"),
+ "deliveries": [
+ AgentExecutionStateDeliveredToDestinationDeliveriesInner.from_dict(
+ _item
+ )
+ for _item in obj["deliveries"]
+ ]
+ if obj.get("deliveries") is not None
+ else None,
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_deliveries_inner.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_deliveries_inner.py
index 65867d8f..3e8b1d1d 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_deliveries_inner.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_deliveries_inner.py
@@ -1,83 +1,115 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.24
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.24
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
import json
import pprint
-from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
-from typing import Any, List, Optional
-from askui.tools.askui.askui_workspaces.models.data_destination_delivery_ask_ui_workflow import DataDestinationDeliveryAskUiWorkflow
-from askui.tools.askui.askui_workspaces.models.data_destination_delivery_webhook import DataDestinationDeliveryWebhook
-from pydantic import StrictStr, Field
-from typing import Union, List, Set, Optional, Dict
-from typing_extensions import Literal, Self
+from typing import Any, Dict, Optional, Set, Union
+
+from pydantic import (
+ BaseModel,
+ ConfigDict,
+ ValidationError,
+ field_validator,
+)
+from typing_extensions import Self
+
+from askui.tools.askui.askui_workspaces.models.data_destination_delivery_ask_ui_workflow import (
+ DataDestinationDeliveryAskUiWorkflow,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_delivery_webhook import (
+ DataDestinationDeliveryWebhook,
+)
+
+AGENTEXECUTIONSTATEDELIVEREDTODESTINATIONDELIVERIESINNER_ONE_OF_SCHEMAS = [
+ "DataDestinationDeliveryAskUiWorkflow",
+ "DataDestinationDeliveryWebhook",
+]
-AGENTEXECUTIONSTATEDELIVEREDTODESTINATIONDELIVERIESINNER_ONE_OF_SCHEMAS = ["DataDestinationDeliveryAskUiWorkflow", "DataDestinationDeliveryWebhook"]
class AgentExecutionStateDeliveredToDestinationDeliveriesInner(BaseModel):
"""
AgentExecutionStateDeliveredToDestinationDeliveriesInner
"""
+
# data type: DataDestinationDeliveryAskUiWorkflow
oneof_schema_1_validator: Optional[DataDestinationDeliveryAskUiWorkflow] = None
# data type: DataDestinationDeliveryWebhook
oneof_schema_2_validator: Optional[DataDestinationDeliveryWebhook] = None
- actual_instance: Optional[Union[DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook]] = None
- one_of_schemas: Set[str] = { "DataDestinationDeliveryAskUiWorkflow", "DataDestinationDeliveryWebhook" }
+ actual_instance: Optional[
+ Union[DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook]
+ ] = None
+ one_of_schemas: Set[str] = {
+ "DataDestinationDeliveryAskUiWorkflow",
+ "DataDestinationDeliveryWebhook",
+ }
model_config = ConfigDict(
validate_assignment=True,
protected_namespaces=(),
)
-
- discriminator_value_class_map: Dict[str, str] = {
- }
+ discriminator_value_class_map: Dict[str, str] = {}
def __init__(self, *args, **kwargs) -> None:
if args:
if len(args) > 1:
- raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ raise ValueError(
+ "If a position argument is used, only 1 is allowed to set `actual_instance`"
+ )
if kwargs:
- raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ raise ValueError(
+ "If a position argument is used, keyword arguments cannot be used."
+ )
super().__init__(actual_instance=args[0])
else:
super().__init__(**kwargs)
- @field_validator('actual_instance')
+ @field_validator("actual_instance")
def actual_instance_must_validate_oneof(cls, v):
- instance = AgentExecutionStateDeliveredToDestinationDeliveriesInner.model_construct()
+ instance = (
+ AgentExecutionStateDeliveredToDestinationDeliveriesInner.model_construct()
+ )
error_messages = []
match = 0
# validate data type: DataDestinationDeliveryAskUiWorkflow
if not isinstance(v, DataDestinationDeliveryAskUiWorkflow):
- error_messages.append(f"Error! Input type `{type(v)}` is not `DataDestinationDeliveryAskUiWorkflow`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `DataDestinationDeliveryAskUiWorkflow`"
+ )
else:
match += 1
# validate data type: DataDestinationDeliveryWebhook
if not isinstance(v, DataDestinationDeliveryWebhook):
- error_messages.append(f"Error! Input type `{type(v)}` is not `DataDestinationDeliveryWebhook`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `DataDestinationDeliveryWebhook`"
+ )
else:
match += 1
if match > 1:
# more than 1 match
- raise ValueError("Multiple matches found when setting `actual_instance` in AgentExecutionStateDeliveredToDestinationDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " + ", ".join(error_messages))
- elif match == 0:
+ raise ValueError(
+ "Multiple matches found when setting `actual_instance` in AgentExecutionStateDeliveredToDestinationDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: "
+ + ", ".join(error_messages)
+ )
+ if match == 0:
# no match
- raise ValueError("No match found when setting `actual_instance` in AgentExecutionStateDeliveredToDestinationDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " + ", ".join(error_messages))
- else:
- return v
+ raise ValueError(
+ "No match found when setting `actual_instance` in AgentExecutionStateDeliveredToDestinationDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: "
+ + ", ".join(error_messages)
+ )
+ return v
@classmethod
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
@@ -93,73 +125,100 @@ def from_json(cls, json_str: str) -> Self:
# use oneOf discriminator to lookup the data type
_data_type = json.loads(json_str).get("type")
if not _data_type:
- raise ValueError("Failed to lookup data type from the field `type` in the input.")
+ raise ValueError(
+ "Failed to lookup data type from the field `type` in the input."
+ )
# check if data type is `DataDestinationDeliveryAskUiWorkflow`
if _data_type == "ASKUI_WORKFLOW":
- instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json(json_str)
+ instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json(
+ json_str
+ )
return instance
# check if data type is `DataDestinationDeliveryWebhook`
if _data_type == "WEBHOOK":
- instance.actual_instance = DataDestinationDeliveryWebhook.from_json(json_str)
+ instance.actual_instance = DataDestinationDeliveryWebhook.from_json(
+ json_str
+ )
return instance
# check if data type is `DataDestinationDeliveryAskUiWorkflow`
if _data_type == "DataDestinationDeliveryAskUiWorkflow":
- instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json(json_str)
+ instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json(
+ json_str
+ )
return instance
# check if data type is `DataDestinationDeliveryWebhook`
if _data_type == "DataDestinationDeliveryWebhook":
- instance.actual_instance = DataDestinationDeliveryWebhook.from_json(json_str)
+ instance.actual_instance = DataDestinationDeliveryWebhook.from_json(
+ json_str
+ )
return instance
# deserialize data into DataDestinationDeliveryAskUiWorkflow
try:
- instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json(json_str)
+ instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json(
+ json_str
+ )
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into DataDestinationDeliveryWebhook
try:
- instance.actual_instance = DataDestinationDeliveryWebhook.from_json(json_str)
+ instance.actual_instance = DataDestinationDeliveryWebhook.from_json(
+ json_str
+ )
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if match > 1:
# more than 1 match
- raise ValueError("Multiple matches found when deserializing the JSON string into AgentExecutionStateDeliveredToDestinationDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " + ", ".join(error_messages))
- elif match == 0:
+ raise ValueError(
+ "Multiple matches found when deserializing the JSON string into AgentExecutionStateDeliveredToDestinationDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: "
+ + ", ".join(error_messages)
+ )
+ if match == 0:
# no match
- raise ValueError("No match found when deserializing the JSON string into AgentExecutionStateDeliveredToDestinationDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " + ", ".join(error_messages))
- else:
- return instance
+ raise ValueError(
+ "No match found when deserializing the JSON string into AgentExecutionStateDeliveredToDestinationDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: "
+ + ", ".join(error_messages)
+ )
+ return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
- if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ if hasattr(self.actual_instance, "to_json") and callable(
+ self.actual_instance.to_json
+ ):
return self.actual_instance.to_json()
- else:
- return json.dumps(self.actual_instance)
-
- def to_dict(self) -> Optional[Union[Dict[str, Any], DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook]]:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(
+ self,
+ ) -> Optional[
+ Union[
+ Dict[str, Any],
+ DataDestinationDeliveryAskUiWorkflow,
+ DataDestinationDeliveryWebhook,
+ ]
+ ]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
- if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ if hasattr(self.actual_instance, "to_dict") and callable(
+ self.actual_instance.to_dict
+ ):
return self.actual_instance.to_dict()
- else:
- # primitive type
- return self.actual_instance
+ # primitive type
+ return self.actual_instance
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_input.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_input.py
index 11011138..ac9d7276 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_input.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_input.py
@@ -1,44 +1,50 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input_deliveries_inner import AgentExecutionStateDeliveredToDestinationInputDeliveriesInner
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input_deliveries_inner import (
+ AgentExecutionStateDeliveredToDestinationInputDeliveriesInner,
+)
+
+
class AgentExecutionStateDeliveredToDestinationInput(BaseModel):
"""
AgentExecutionStateDeliveredToDestinationInput
- """ # noqa: E501
- status: Optional[StrictStr] = 'DELIVERED_TO_DESTINATION'
- deliveries: Optional[List[AgentExecutionStateDeliveredToDestinationInputDeliveriesInner]] = None
+ """ # noqa: E501
+
+ status: Optional[StrictStr] = "DELIVERED_TO_DESTINATION"
+ deliveries: Optional[
+ List[AgentExecutionStateDeliveredToDestinationInputDeliveriesInner]
+ ] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["status", "deliveries"]
- @field_validator('status')
+ @field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['DELIVERED_TO_DESTINATION']):
+ if value not in set(["DELIVERED_TO_DESTINATION"]):
raise ValueError("must be one of enum values ('DELIVERED_TO_DESTINATION')")
return value
@@ -48,7 +54,6 @@ def status_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -74,9 +79,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -89,7 +96,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.deliveries:
if _item:
_items.append(_item.to_dict())
- _dict['deliveries'] = _items
+ _dict["deliveries"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -106,15 +113,24 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "status": obj.get("status") if obj.get("status") is not None else 'DELIVERED_TO_DESTINATION',
- "deliveries": [AgentExecutionStateDeliveredToDestinationInputDeliveriesInner.from_dict(_item) for _item in obj["deliveries"]] if obj.get("deliveries") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "status": obj.get("status")
+ if obj.get("status") is not None
+ else "DELIVERED_TO_DESTINATION",
+ "deliveries": [
+ AgentExecutionStateDeliveredToDestinationInputDeliveriesInner.from_dict(
+ _item
+ )
+ for _item in obj["deliveries"]
+ ]
+ if obj.get("deliveries") is not None
+ else None,
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_input_deliveries_inner.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_input_deliveries_inner.py
index e2edb468..e3c436a3 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_input_deliveries_inner.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_input_deliveries_inner.py
@@ -1,83 +1,113 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
import json
import pprint
-from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
-from typing import Any, List, Optional
-from askui.tools.askui.askui_workspaces.models.data_destination_delivery_ask_ui_workflow import DataDestinationDeliveryAskUiWorkflow
-from askui.tools.askui.askui_workspaces.models.data_destination_delivery_webhook import DataDestinationDeliveryWebhook
-from pydantic import StrictStr, Field
-from typing import Union, List, Set, Optional, Dict
-from typing_extensions import Literal, Self
+from typing import Any, Dict, Optional, Set, Union
+
+from pydantic import (
+ BaseModel,
+ ConfigDict,
+ ValidationError,
+ field_validator,
+)
+from typing_extensions import Self
+
+from askui.tools.askui.askui_workspaces.models.data_destination_delivery_ask_ui_workflow import (
+ DataDestinationDeliveryAskUiWorkflow,
+)
+from askui.tools.askui.askui_workspaces.models.data_destination_delivery_webhook import (
+ DataDestinationDeliveryWebhook,
+)
+
+AGENTEXECUTIONSTATEDELIVEREDTODESTINATIONINPUTDELIVERIESINNER_ONE_OF_SCHEMAS = [
+ "DataDestinationDeliveryAskUiWorkflow",
+ "DataDestinationDeliveryWebhook",
+]
-AGENTEXECUTIONSTATEDELIVEREDTODESTINATIONINPUTDELIVERIESINNER_ONE_OF_SCHEMAS = ["DataDestinationDeliveryAskUiWorkflow", "DataDestinationDeliveryWebhook"]
class AgentExecutionStateDeliveredToDestinationInputDeliveriesInner(BaseModel):
"""
AgentExecutionStateDeliveredToDestinationInputDeliveriesInner
"""
+
# data type: DataDestinationDeliveryAskUiWorkflow
oneof_schema_1_validator: Optional[DataDestinationDeliveryAskUiWorkflow] = None
# data type: DataDestinationDeliveryWebhook
oneof_schema_2_validator: Optional[DataDestinationDeliveryWebhook] = None
- actual_instance: Optional[Union[DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook]] = None
- one_of_schemas: Set[str] = { "DataDestinationDeliveryAskUiWorkflow", "DataDestinationDeliveryWebhook" }
+ actual_instance: Optional[
+ Union[DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook]
+ ] = None
+ one_of_schemas: Set[str] = {
+ "DataDestinationDeliveryAskUiWorkflow",
+ "DataDestinationDeliveryWebhook",
+ }
model_config = ConfigDict(
validate_assignment=True,
protected_namespaces=(),
)
-
- discriminator_value_class_map: Dict[str, str] = {
- }
+ discriminator_value_class_map: Dict[str, str] = {}
def __init__(self, *args, **kwargs) -> None:
if args:
if len(args) > 1:
- raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ raise ValueError(
+ "If a position argument is used, only 1 is allowed to set `actual_instance`"
+ )
if kwargs:
- raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ raise ValueError(
+ "If a position argument is used, keyword arguments cannot be used."
+ )
super().__init__(actual_instance=args[0])
else:
super().__init__(**kwargs)
- @field_validator('actual_instance')
+ @field_validator("actual_instance")
def actual_instance_must_validate_oneof(cls, v):
instance = AgentExecutionStateDeliveredToDestinationInputDeliveriesInner.model_construct()
error_messages = []
match = 0
# validate data type: DataDestinationDeliveryAskUiWorkflow
if not isinstance(v, DataDestinationDeliveryAskUiWorkflow):
- error_messages.append(f"Error! Input type `{type(v)}` is not `DataDestinationDeliveryAskUiWorkflow`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `DataDestinationDeliveryAskUiWorkflow`"
+ )
else:
match += 1
# validate data type: DataDestinationDeliveryWebhook
if not isinstance(v, DataDestinationDeliveryWebhook):
- error_messages.append(f"Error! Input type `{type(v)}` is not `DataDestinationDeliveryWebhook`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `DataDestinationDeliveryWebhook`"
+ )
else:
match += 1
if match > 1:
# more than 1 match
- raise ValueError("Multiple matches found when setting `actual_instance` in AgentExecutionStateDeliveredToDestinationInputDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " + ", ".join(error_messages))
- elif match == 0:
+ raise ValueError(
+ "Multiple matches found when setting `actual_instance` in AgentExecutionStateDeliveredToDestinationInputDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: "
+ + ", ".join(error_messages)
+ )
+ if match == 0:
# no match
- raise ValueError("No match found when setting `actual_instance` in AgentExecutionStateDeliveredToDestinationInputDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " + ", ".join(error_messages))
- else:
- return v
+ raise ValueError(
+ "No match found when setting `actual_instance` in AgentExecutionStateDeliveredToDestinationInputDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: "
+ + ", ".join(error_messages)
+ )
+ return v
@classmethod
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
@@ -93,73 +123,100 @@ def from_json(cls, json_str: str) -> Self:
# use oneOf discriminator to lookup the data type
_data_type = json.loads(json_str).get("type")
if not _data_type:
- raise ValueError("Failed to lookup data type from the field `type` in the input.")
+ raise ValueError(
+ "Failed to lookup data type from the field `type` in the input."
+ )
# check if data type is `DataDestinationDeliveryAskUiWorkflow`
if _data_type == "ASKUI_WORKFLOW":
- instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json(json_str)
+ instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json(
+ json_str
+ )
return instance
# check if data type is `DataDestinationDeliveryWebhook`
if _data_type == "WEBHOOK":
- instance.actual_instance = DataDestinationDeliveryWebhook.from_json(json_str)
+ instance.actual_instance = DataDestinationDeliveryWebhook.from_json(
+ json_str
+ )
return instance
# check if data type is `DataDestinationDeliveryAskUiWorkflow`
if _data_type == "DataDestinationDeliveryAskUiWorkflow":
- instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json(json_str)
+ instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json(
+ json_str
+ )
return instance
# check if data type is `DataDestinationDeliveryWebhook`
if _data_type == "DataDestinationDeliveryWebhook":
- instance.actual_instance = DataDestinationDeliveryWebhook.from_json(json_str)
+ instance.actual_instance = DataDestinationDeliveryWebhook.from_json(
+ json_str
+ )
return instance
# deserialize data into DataDestinationDeliveryAskUiWorkflow
try:
- instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json(json_str)
+ instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json(
+ json_str
+ )
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into DataDestinationDeliveryWebhook
try:
- instance.actual_instance = DataDestinationDeliveryWebhook.from_json(json_str)
+ instance.actual_instance = DataDestinationDeliveryWebhook.from_json(
+ json_str
+ )
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if match > 1:
# more than 1 match
- raise ValueError("Multiple matches found when deserializing the JSON string into AgentExecutionStateDeliveredToDestinationInputDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " + ", ".join(error_messages))
- elif match == 0:
+ raise ValueError(
+ "Multiple matches found when deserializing the JSON string into AgentExecutionStateDeliveredToDestinationInputDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: "
+ + ", ".join(error_messages)
+ )
+ if match == 0:
# no match
- raise ValueError("No match found when deserializing the JSON string into AgentExecutionStateDeliveredToDestinationInputDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " + ", ".join(error_messages))
- else:
- return instance
+ raise ValueError(
+ "No match found when deserializing the JSON string into AgentExecutionStateDeliveredToDestinationInputDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: "
+ + ", ".join(error_messages)
+ )
+ return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
- if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ if hasattr(self.actual_instance, "to_json") and callable(
+ self.actual_instance.to_json
+ ):
return self.actual_instance.to_json()
- else:
- return json.dumps(self.actual_instance)
-
- def to_dict(self) -> Optional[Union[Dict[str, Any], DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook]]:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(
+ self,
+ ) -> Optional[
+ Union[
+ Dict[str, Any],
+ DataDestinationDeliveryAskUiWorkflow,
+ DataDestinationDeliveryWebhook,
+ ]
+ ]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
- if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ if hasattr(self.actual_instance, "to_dict") and callable(
+ self.actual_instance.to_dict
+ ):
return self.actual_instance.to_dict()
- else:
- # primitive type
- return self.actual_instance
+ # primitive type
+ return self.actual_instance
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_output.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_output.py
index 5a77ad88..1f4d1be1 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_output.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_output.py
@@ -1,46 +1,60 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input_deliveries_inner import AgentExecutionStateDeliveredToDestinationInputDeliveriesInner
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input_deliveries_inner import (
+ AgentExecutionStateDeliveredToDestinationInputDeliveriesInner,
+)
+
+
class AgentExecutionStateDeliveredToDestinationOutput(BaseModel):
"""
AgentExecutionStateDeliveredToDestinationOutput
- """ # noqa: E501
- status: Optional[StrictStr] = Field(default='DELIVERED_TO_DESTINATION', description="The extracted data was successfully delivered to the destination(s), e.g., an AskUI workflow invoked with the data.")
+ """ # noqa: E501
+
+ status: Optional[StrictStr] = Field(
+ default="DELIVERED_TO_DESTINATION",
+ description="The extracted data was successfully delivered to the destination(s), e.g., an AskUI workflow invoked with the data.",
+ )
data_extracted: Dict[str, Any] = Field(alias="dataExtracted")
data_confirmed: Dict[str, Any] = Field(alias="dataConfirmed")
- deliveries: Optional[List[AgentExecutionStateDeliveredToDestinationInputDeliveriesInner]] = None
+ deliveries: Optional[
+ List[AgentExecutionStateDeliveredToDestinationInputDeliveriesInner]
+ ] = None
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["status", "dataExtracted", "dataConfirmed", "deliveries"]
-
- @field_validator('status')
+ __properties: ClassVar[List[str]] = [
+ "status",
+ "dataExtracted",
+ "dataConfirmed",
+ "deliveries",
+ ]
+
+ @field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['DELIVERED_TO_DESTINATION']):
+ if value not in set(["DELIVERED_TO_DESTINATION"]):
raise ValueError("must be one of enum values ('DELIVERED_TO_DESTINATION')")
return value
@@ -50,7 +64,6 @@ def status_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -76,9 +89,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -91,7 +106,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.deliveries:
if _item:
_items.append(_item.to_dict())
- _dict['deliveries'] = _items
+ _dict["deliveries"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -108,17 +123,26 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "status": obj.get("status") if obj.get("status") is not None else 'DELIVERED_TO_DESTINATION',
- "dataExtracted": obj.get("dataExtracted"),
- "dataConfirmed": obj.get("dataConfirmed"),
- "deliveries": [AgentExecutionStateDeliveredToDestinationInputDeliveriesInner.from_dict(_item) for _item in obj["deliveries"]] if obj.get("deliveries") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "status": obj.get("status")
+ if obj.get("status") is not None
+ else "DELIVERED_TO_DESTINATION",
+ "dataExtracted": obj.get("dataExtracted"),
+ "dataConfirmed": obj.get("dataConfirmed"),
+ "deliveries": [
+ AgentExecutionStateDeliveredToDestinationInputDeliveriesInner.from_dict(
+ _item
+ )
+ for _item in obj["deliveries"]
+ ]
+ if obj.get("deliveries") is not None
+ else None,
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_data_extraction.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_data_extraction.py
index f44233da..4a748c73 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_data_extraction.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_data_extraction.py
@@ -1,42 +1,46 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class AgentExecutionStatePendingDataExtraction(BaseModel):
"""
AgentExecutionStatePendingDataExtraction
- """ # noqa: E501
- status: Optional[StrictStr] = Field(default='PENDING_DATA_EXTRACTION', description="The agent has all inputs at hand and is about to or already extracting data from inputs. An agent may stay in this state in failure cases, e.g., if data extraction fails.")
+ """ # noqa: E501
+
+ status: Optional[StrictStr] = Field(
+ default="PENDING_DATA_EXTRACTION",
+ description="The agent has all inputs at hand and is about to or already extracting data from inputs. An agent may stay in this state in failure cases, e.g., if data extraction fails.",
+ )
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["status"]
- @field_validator('status')
+ @field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['PENDING_DATA_EXTRACTION']):
+ if value not in set(["PENDING_DATA_EXTRACTION"]):
raise ValueError("must be one of enum values ('PENDING_DATA_EXTRACTION')")
return value
@@ -46,7 +50,6 @@ def status_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -72,9 +75,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -97,14 +102,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "status": obj.get("status") if obj.get("status") is not None else 'PENDING_DATA_EXTRACTION'
- })
+ _obj = cls.model_validate(
+ {
+ "status": obj.get("status")
+ if obj.get("status") is not None
+ else "PENDING_DATA_EXTRACTION"
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_inputs.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_inputs.py
index a0f8617c..74e8c1f5 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_inputs.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_inputs.py
@@ -1,42 +1,46 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class AgentExecutionStatePendingInputs(BaseModel):
"""
AgentExecutionStatePendingInputs
- """ # noqa: E501
- status: Optional[StrictStr] = Field(default='PENDING_INPUTS', description="The agent is waiting for inputs, e.g., files to be uploaded. An agent may stay in this state in failure cases, e.g., if file upload fails.")
+ """ # noqa: E501
+
+ status: Optional[StrictStr] = Field(
+ default="PENDING_INPUTS",
+ description="The agent is waiting for inputs, e.g., files to be uploaded. An agent may stay in this state in failure cases, e.g., if file upload fails.",
+ )
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["status"]
- @field_validator('status')
+ @field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['PENDING_INPUTS']):
+ if value not in set(["PENDING_INPUTS"]):
raise ValueError("must be one of enum values ('PENDING_INPUTS')")
return value
@@ -46,7 +50,6 @@ def status_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -72,9 +75,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -97,14 +102,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "status": obj.get("status") if obj.get("status") is not None else 'PENDING_INPUTS'
- })
+ _obj = cls.model_validate(
+ {
+ "status": obj.get("status")
+ if obj.get("status") is not None
+ else "PENDING_INPUTS"
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_review.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_review.py
index 73a4ca50..043d4474 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_review.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_review.py
@@ -1,43 +1,47 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class AgentExecutionStatePendingReview(BaseModel):
"""
AgentExecutionStatePendingReview
- """ # noqa: E501
- status: Optional[StrictStr] = Field(default='PENDING_REVIEW', description="The agent is waiting for the user to review the extracted data. An agent may stay if the user never confirms the data or cancels the execution.")
+ """ # noqa: E501
+
+ status: Optional[StrictStr] = Field(
+ default="PENDING_REVIEW",
+ description="The agent is waiting for the user to review the extracted data. An agent may stay if the user never confirms the data or cancels the execution.",
+ )
data_extracted: Dict[str, Any] = Field(alias="dataExtracted")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["status", "dataExtracted"]
- @field_validator('status')
+ @field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['PENDING_REVIEW']):
+ if value not in set(["PENDING_REVIEW"]):
raise ValueError("must be one of enum values ('PENDING_REVIEW')")
return value
@@ -47,7 +51,6 @@ def status_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -73,9 +76,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -98,15 +103,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "status": obj.get("status") if obj.get("status") is not None else 'PENDING_REVIEW',
- "dataExtracted": obj.get("dataExtracted")
- })
+ _obj = cls.model_validate(
+ {
+ "status": obj.get("status")
+ if obj.get("status") is not None
+ else "PENDING_REVIEW",
+ "dataExtracted": obj.get("dataExtracted"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_update_command.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_update_command.py
index 084d2079..dc845579 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_update_command.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_execution_update_command.py
@@ -1,32 +1,34 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict
-from typing import Any, ClassVar, Dict, List
-from askui.tools.askui.askui_workspaces.models.state1 import State1
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.state1 import State1
+
+
class AgentExecutionUpdateCommand(BaseModel):
"""
AgentExecutionUpdateCommand
- """ # noqa: E501
+ """ # noqa: E501
+
state: State1
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["state"]
@@ -37,7 +39,6 @@ class AgentExecutionUpdateCommand(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -63,9 +64,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -74,7 +77,7 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of state
if self.state:
- _dict['state'] = self.state.to_dict()
+ _dict["state"] = self.state.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -91,14 +94,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "state": State1.from_dict(obj["state"]) if obj.get("state") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "state": State1.from_dict(obj["state"])
+ if obj.get("state") is not None
+ else None
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_executions_list_response.py b/src/askui/tools/askui/askui_workspaces/models/agent_executions_list_response.py
index 54589fce..bbab6fb2 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_executions_list_response.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_executions_list_response.py
@@ -1,34 +1,40 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.agent_execution import AgentExecution
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.agent_execution import AgentExecution
+
+
class AgentExecutionsListResponse(BaseModel):
"""
AgentExecutionsListResponse
- """ # noqa: E501
+ """ # noqa: E501
+
data: List[AgentExecution]
- has_more: Optional[StrictBool] = Field(default=False, description="Whether there are more agent executions that match the query that were not included in this response.", alias="hasMore")
+ has_more: Optional[StrictBool] = Field(
+ default=False,
+ description="Whether there are more agent executions that match the query that were not included in this response.",
+ alias="hasMore",
+ )
total_count: Optional[StrictInt] = Field(default=None, alias="totalCount")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["data", "hasMore", "totalCount"]
@@ -39,7 +45,6 @@ class AgentExecutionsListResponse(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -65,9 +70,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -80,7 +87,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.data:
if _item:
_items.append(_item.to_dict())
- _dict['data'] = _items
+ _dict["data"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -89,7 +96,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if total_count (nullable) is None
# and model_fields_set contains the field
if self.total_count is None and "total_count" in self.model_fields_set:
- _dict['totalCount'] = None
+ _dict["totalCount"] = None
return _dict
@@ -102,16 +109,20 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "data": [AgentExecution.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None,
- "hasMore": obj.get("hasMore") if obj.get("hasMore") is not None else False,
- "totalCount": obj.get("totalCount")
- })
+ _obj = cls.model_validate(
+ {
+ "data": [AgentExecution.from_dict(_item) for _item in obj["data"]]
+ if obj.get("data") is not None
+ else None,
+ "hasMore": obj.get("hasMore")
+ if obj.get("hasMore") is not None
+ else False,
+ "totalCount": obj.get("totalCount"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_update_command.py b/src/askui/tools/askui/askui_workspaces/models/agent_update_command.py
index 05d4a534..26ea8523 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agent_update_command.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agent_update_command.py
@@ -1,58 +1,81 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
+from pydantic import (
+ BaseModel,
+ ConfigDict,
+ Field,
+ StrictBool,
+ StrictStr,
+ field_validator,
+)
+from typing_extensions import Annotated, Self
+
+from askui.tools.askui.askui_workspaces.models.email_agent_trigger_update import (
+ EmailAgentTriggerUpdate,
+)
-from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
-from askui.tools.askui.askui_workspaces.models.email_agent_trigger_update import EmailAgentTriggerUpdate
-from typing import Optional, Set
-from typing_extensions import Self
class AgentUpdateCommand(BaseModel):
"""
AgentUpdateCommand
- """ # noqa: E501
- name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The name of the agent. The name must only contain the following characters: a-z, A-Z, 0-9, -, _, and space. The name must not be empty. The name must start and end with a letter or a number. The name must not be longer than 64 characters.")
- description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = ''
+ """ # noqa: E501
+
+ name: Optional[Annotated[str, Field(strict=True)]] = Field(
+ default=None,
+ description="The name of the agent. The name must only contain the following characters: a-z, A-Z, 0-9, -, _, and space. The name must not be empty. The name must start and end with a letter or a number. The name must not be longer than 64 characters.",
+ )
+ description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = ""
status: Optional[StrictStr] = None
- email_trigger: Optional[EmailAgentTriggerUpdate] = Field(default=None, alias="emailTrigger")
+ email_trigger: Optional[EmailAgentTriggerUpdate] = Field(
+ default=None, alias="emailTrigger"
+ )
auto_confirm: Optional[StrictBool] = Field(default=None, alias="autoConfirm")
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["name", "description", "status", "emailTrigger", "autoConfirm"]
-
- @field_validator('name')
+ __properties: ClassVar[List[str]] = [
+ "name",
+ "description",
+ "status",
+ "emailTrigger",
+ "autoConfirm",
+ ]
+
+ @field_validator("name")
def name_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$", value):
- raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$/")
+ raise ValueError(
+ r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$/"
+ )
return value
- @field_validator('status')
+ @field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['ACTIVE', 'ARCHIVED']):
+ if value not in set(["ACTIVE", "ARCHIVED"]):
raise ValueError("must be one of enum values ('ACTIVE', 'ARCHIVED')")
return value
@@ -62,7 +85,6 @@ def status_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -88,9 +110,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -99,7 +123,7 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of email_trigger
if self.email_trigger:
- _dict['emailTrigger'] = self.email_trigger.to_dict()
+ _dict["emailTrigger"] = self.email_trigger.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -108,27 +132,27 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if name (nullable) is None
# and model_fields_set contains the field
if self.name is None and "name" in self.model_fields_set:
- _dict['name'] = None
+ _dict["name"] = None
# set to None if description (nullable) is None
# and model_fields_set contains the field
if self.description is None and "description" in self.model_fields_set:
- _dict['description'] = None
+ _dict["description"] = None
# set to None if status (nullable) is None
# and model_fields_set contains the field
if self.status is None and "status" in self.model_fields_set:
- _dict['status'] = None
+ _dict["status"] = None
# set to None if email_trigger (nullable) is None
# and model_fields_set contains the field
if self.email_trigger is None and "email_trigger" in self.model_fields_set:
- _dict['emailTrigger'] = None
+ _dict["emailTrigger"] = None
# set to None if auto_confirm (nullable) is None
# and model_fields_set contains the field
if self.auto_confirm is None and "auto_confirm" in self.model_fields_set:
- _dict['autoConfirm'] = None
+ _dict["autoConfirm"] = None
return _dict
@@ -141,18 +165,22 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "name": obj.get("name"),
- "description": obj.get("description") if obj.get("description") is not None else '',
- "status": obj.get("status"),
- "emailTrigger": EmailAgentTriggerUpdate.from_dict(obj["emailTrigger"]) if obj.get("emailTrigger") is not None else None,
- "autoConfirm": obj.get("autoConfirm")
- })
+ _obj = cls.model_validate(
+ {
+ "name": obj.get("name"),
+ "description": obj.get("description")
+ if obj.get("description") is not None
+ else "",
+ "status": obj.get("status"),
+ "emailTrigger": EmailAgentTriggerUpdate.from_dict(obj["emailTrigger"])
+ if obj.get("emailTrigger") is not None
+ else None,
+ "autoConfirm": obj.get("autoConfirm"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/agents_list_response.py b/src/askui/tools/askui/askui_workspaces/models/agents_list_response.py
index 68b8bffd..d280022c 100644
--- a/src/askui/tools/askui/askui_workspaces/models/agents_list_response.py
+++ b/src/askui/tools/askui/askui_workspaces/models/agents_list_response.py
@@ -1,34 +1,40 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.agent import Agent
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.agent import Agent
+
+
class AgentsListResponse(BaseModel):
"""
AgentsListResponse
- """ # noqa: E501
+ """ # noqa: E501
+
data: List[Agent]
- has_more: Optional[StrictBool] = Field(default=False, description="Whether there are more agents that match the query that were not included in this response.", alias="hasMore")
+ has_more: Optional[StrictBool] = Field(
+ default=False,
+ description="Whether there are more agents that match the query that were not included in this response.",
+ alias="hasMore",
+ )
total_count: Optional[StrictInt] = Field(default=None, alias="totalCount")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["data", "hasMore", "totalCount"]
@@ -39,7 +45,6 @@ class AgentsListResponse(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -65,9 +70,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -80,7 +87,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.data:
if _item:
_items.append(_item.to_dict())
- _dict['data'] = _items
+ _dict["data"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -89,7 +96,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if total_count (nullable) is None
# and model_fields_set contains the field
if self.total_count is None and "total_count" in self.model_fields_set:
- _dict['totalCount'] = None
+ _dict["totalCount"] = None
return _dict
@@ -102,16 +109,20 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "data": [Agent.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None,
- "hasMore": obj.get("hasMore") if obj.get("hasMore") is not None else False,
- "totalCount": obj.get("totalCount")
- })
+ _obj = cls.model_validate(
+ {
+ "data": [Agent.from_dict(_item) for _item in obj["data"]]
+ if obj.get("data") is not None
+ else None,
+ "hasMore": obj.get("hasMore")
+ if obj.get("hasMore") is not None
+ else False,
+ "totalCount": obj.get("totalCount"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/ask_ui_runner_host.py b/src/askui/tools/askui/askui_workspaces/models/ask_ui_runner_host.py
index f267aea9..9ac36c0c 100644
--- a/src/askui/tools/askui/askui_workspaces/models/ask_ui_runner_host.py
+++ b/src/askui/tools/askui/askui_workspaces/models/ask_ui_runner_host.py
@@ -1,20 +1,21 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
import json
from enum import Enum
+
from typing_extensions import Self
@@ -26,12 +27,10 @@ class AskUiRunnerHost(str, Enum):
"""
allowed enum values
"""
- SELF = 'SELF'
- ASKUI = 'ASKUI'
+ SELF = "SELF"
+ ASKUI = "ASKUI"
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AskUiRunnerHost from a JSON string"""
return cls(json.loads(json_str))
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/complete_runner_job_request_dto.py b/src/askui/tools/askui/askui_workspaces/models/complete_runner_job_request_dto.py
index bef57396..58ff690b 100644
--- a/src/askui/tools/askui/askui_workspaces/models/complete_runner_job_request_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/complete_runner_job_request_dto.py
@@ -1,40 +1,43 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List
-from typing import Optional, Set
from typing_extensions import Self
+
class CompleteRunnerJobRequestDto(BaseModel):
"""
CompleteRunnerJobRequestDto
- """ # noqa: E501
+ """ # noqa: E501
+
status: StrictStr
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["status"]
- @field_validator('status')
+ @field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
- if value not in set(['CANCELED', 'FAILED', 'PASSED']):
- raise ValueError("must be one of enum values ('CANCELED', 'FAILED', 'PASSED')")
+ if value not in set(["CANCELED", "FAILED", "PASSED"]):
+ raise ValueError(
+ "must be one of enum values ('CANCELED', 'FAILED', 'PASSED')"
+ )
return value
model_config = ConfigDict(
@@ -43,7 +46,6 @@ def status_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -69,9 +71,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -94,14 +98,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "status": obj.get("status")
- })
+ _obj = cls.model_validate({"status": obj.get("status")})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/create_customer_portal_session_request_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_customer_portal_session_request_dto.py
index c245f900..a267ef0d 100644
--- a/src/askui/tools/askui/askui_workspaces/models/create_customer_portal_session_request_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/create_customer_portal_session_request_dto.py
@@ -1,33 +1,35 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field
-from typing import Any, ClassVar, Dict, List
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
+from typing_extensions import Annotated, Self
+
class CreateCustomerPortalSessionRequestDto(BaseModel):
"""
CreateCustomerPortalSessionRequestDto
- """ # noqa: E501
- return_url: Annotated[str, Field(min_length=1, strict=True, max_length=2083)] = Field(alias="returnUrl")
+ """ # noqa: E501
+
+ return_url: Annotated[str, Field(min_length=1, strict=True, max_length=2083)] = (
+ Field(alias="returnUrl")
+ )
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["returnUrl"]
@@ -37,7 +39,6 @@ class CreateCustomerPortalSessionRequestDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -63,9 +64,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -88,14 +91,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "returnUrl": obj.get("returnUrl")
- })
+ _obj = cls.model_validate({"returnUrl": obj.get("returnUrl")})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/create_customer_portal_session_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_customer_portal_session_response_dto.py
index 19d9f207..abbcaa87 100644
--- a/src/askui/tools/askui/askui_workspaces/models/create_customer_portal_session_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/create_customer_portal_session_response_dto.py
@@ -1,33 +1,35 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field
-from typing import Any, ClassVar, Dict, List
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
+from typing_extensions import Annotated, Self
+
class CreateCustomerPortalSessionResponseDto(BaseModel):
"""
CreateCustomerPortalSessionResponseDto
- """ # noqa: E501
- session_url: Annotated[str, Field(min_length=1, strict=True, max_length=2083)] = Field(alias="sessionUrl")
+ """ # noqa: E501
+
+ session_url: Annotated[str, Field(min_length=1, strict=True, max_length=2083)] = (
+ Field(alias="sessionUrl")
+ )
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["sessionUrl"]
@@ -37,7 +39,6 @@ class CreateCustomerPortalSessionResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -63,9 +64,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -88,14 +91,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "sessionUrl": obj.get("sessionUrl")
- })
+ _obj = cls.model_validate({"sessionUrl": obj.get("sessionUrl")})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/create_schedule_request_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_schedule_request_dto.py
index ee87f18e..df6f085c 100644
--- a/src/askui/tools/askui/askui_workspaces/models/create_schedule_request_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/create_schedule_request_dto.py
@@ -1,46 +1,66 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
+from typing_extensions import Annotated, Self
+
from askui.tools.askui.askui_workspaces.models.runner_host import RunnerHost
-from typing import Optional, Set
-from typing_extensions import Self
+
class CreateScheduleRequestDto(BaseModel):
"""
CreateScheduleRequestDto
- """ # noqa: E501
- name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=63)]] = 'Unnamed'
+ """ # noqa: E501
+
+ name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=63)]] = (
+ "Unnamed"
+ )
host: Optional[RunnerHost] = None
runner_ids: Optional[List[StrictStr]] = None
tags: Optional[List[StrictStr]] = None
- started_at: Optional[datetime] = Field(default=None, description="Timestamp after which the schedule starts. If not specified, the schedule starts immediately.")
+ started_at: Optional[datetime] = Field(
+ default=None,
+ description="Timestamp after which the schedule starts. If not specified, the schedule starts immediately.",
+ )
ended_at: Optional[datetime] = None
ended_after: Optional[StrictInt] = None
schedule: Optional[StrictStr] = None
workflows: Optional[List[StrictStr]] = None
- data: Optional[Dict[str, Any]] = Field(default=None, description="Arbitrary data to be stored with the schedule which is made available to the runner when executing AskUI workflows.")
+ data: Optional[Dict[str, Any]] = Field(
+ default=None,
+ description="Arbitrary data to be stored with the schedule which is made available to the runner when executing AskUI workflows.",
+ )
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["name", "host", "runner_ids", "tags", "started_at", "ended_at", "ended_after", "schedule", "workflows", "data"]
+ __properties: ClassVar[List[str]] = [
+ "name",
+ "host",
+ "runner_ids",
+ "tags",
+ "started_at",
+ "ended_at",
+ "ended_after",
+ "schedule",
+ "workflows",
+ "data",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -48,7 +68,6 @@ class CreateScheduleRequestDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -74,9 +93,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -91,22 +112,22 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if ended_at (nullable) is None
# and model_fields_set contains the field
if self.ended_at is None and "ended_at" in self.model_fields_set:
- _dict['ended_at'] = None
+ _dict["ended_at"] = None
# set to None if ended_after (nullable) is None
# and model_fields_set contains the field
if self.ended_after is None and "ended_after" in self.model_fields_set:
- _dict['ended_after'] = None
+ _dict["ended_after"] = None
# set to None if schedule (nullable) is None
# and model_fields_set contains the field
if self.schedule is None and "schedule" in self.model_fields_set:
- _dict['schedule'] = None
+ _dict["schedule"] = None
# set to None if workflows (nullable) is None
# and model_fields_set contains the field
if self.workflows is None and "workflows" in self.model_fields_set:
- _dict['workflows'] = None
+ _dict["workflows"] = None
return _dict
@@ -119,23 +140,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "name": obj.get("name") if obj.get("name") is not None else 'Unnamed',
- "host": obj.get("host"),
- "runner_ids": obj.get("runner_ids"),
- "tags": obj.get("tags"),
- "started_at": obj.get("started_at"),
- "ended_at": obj.get("ended_at"),
- "ended_after": obj.get("ended_after"),
- "schedule": obj.get("schedule"),
- "workflows": obj.get("workflows"),
- "data": obj.get("data")
- })
+ _obj = cls.model_validate(
+ {
+ "name": obj.get("name") if obj.get("name") is not None else "Unnamed",
+ "host": obj.get("host"),
+ "runner_ids": obj.get("runner_ids"),
+ "tags": obj.get("tags"),
+ "started_at": obj.get("started_at"),
+ "ended_at": obj.get("ended_at"),
+ "ended_after": obj.get("ended_after"),
+ "schedule": obj.get("schedule"),
+ "workflows": obj.get("workflows"),
+ "data": obj.get("data"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/create_schedule_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_schedule_response_dto.py
index 70df6150..5768ab01 100644
--- a/src/askui/tools/askui/askui_workspaces/models/create_schedule_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/create_schedule_response_dto.py
@@ -1,34 +1,36 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
+from typing_extensions import Self
+
from askui.tools.askui.askui_workspaces.models.run_template import RunTemplate
from askui.tools.askui.askui_workspaces.models.schedule_status import ScheduleStatus
-from typing import Optional, Set
-from typing_extensions import Self
+
class CreateScheduleResponseDto(BaseModel):
"""
CreateScheduleResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
id: Optional[StrictStr] = None
created_at: Optional[datetime] = None
name: StrictStr
@@ -40,7 +42,18 @@ class CreateScheduleResponseDto(BaseModel):
run_template: RunTemplate
runs_count: Optional[StrictInt] = 0
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "created_at", "name", "status", "started_at", "ended_at", "schedule", "ended_after", "run_template", "runs_count"]
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "created_at",
+ "name",
+ "status",
+ "started_at",
+ "ended_at",
+ "schedule",
+ "ended_after",
+ "run_template",
+ "runs_count",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -48,7 +61,6 @@ class CreateScheduleResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -74,9 +86,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -85,7 +99,7 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of run_template
if self.run_template:
- _dict['run_template'] = self.run_template.to_dict()
+ _dict["run_template"] = self.run_template.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -94,17 +108,17 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if ended_at (nullable) is None
# and model_fields_set contains the field
if self.ended_at is None and "ended_at" in self.model_fields_set:
- _dict['ended_at'] = None
+ _dict["ended_at"] = None
# set to None if schedule (nullable) is None
# and model_fields_set contains the field
if self.schedule is None and "schedule" in self.model_fields_set:
- _dict['schedule'] = None
+ _dict["schedule"] = None
# set to None if ended_after (nullable) is None
# and model_fields_set contains the field
if self.ended_after is None and "ended_after" in self.model_fields_set:
- _dict['ended_after'] = None
+ _dict["ended_after"] = None
return _dict
@@ -117,23 +131,27 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "created_at": obj.get("created_at"),
- "name": obj.get("name"),
- "status": obj.get("status"),
- "started_at": obj.get("started_at"),
- "ended_at": obj.get("ended_at"),
- "schedule": obj.get("schedule"),
- "ended_after": obj.get("ended_after"),
- "run_template": RunTemplate.from_dict(obj["run_template"]) if obj.get("run_template") is not None else None,
- "runs_count": obj.get("runs_count") if obj.get("runs_count") is not None else 0
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "created_at": obj.get("created_at"),
+ "name": obj.get("name"),
+ "status": obj.get("status"),
+ "started_at": obj.get("started_at"),
+ "ended_at": obj.get("ended_at"),
+ "schedule": obj.get("schedule"),
+ "ended_after": obj.get("ended_after"),
+ "run_template": RunTemplate.from_dict(obj["run_template"])
+ if obj.get("run_template") is not None
+ else None,
+ "runs_count": obj.get("runs_count")
+ if obj.get("runs_count") is not None
+ else 0,
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_command.py b/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_command.py
index 038536bf..77aa5c91 100644
--- a/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_command.py
+++ b/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_command.py
@@ -1,33 +1,33 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
+from typing_extensions import Annotated, Self
+
class CreateSubjectAccessTokenCommand(BaseModel):
"""
CreateSubjectAccessTokenCommand
- """ # noqa: E501
+ """ # noqa: E501
+
name: Annotated[str, Field(min_length=1, strict=True, max_length=128)]
expires_at: Optional[datetime] = Field(default=None, alias="expiresAt")
additional_properties: Dict[str, Any] = {}
@@ -39,7 +39,6 @@ class CreateSubjectAccessTokenCommand(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -65,9 +64,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -82,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if expires_at (nullable) is None
# and model_fields_set contains the field
if self.expires_at is None and "expires_at" in self.model_fields_set:
- _dict['expiresAt'] = None
+ _dict["expiresAt"] = None
return _dict
@@ -95,15 +96,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "name": obj.get("name"),
- "expiresAt": obj.get("expiresAt")
- })
+ _obj = cls.model_validate(
+ {"name": obj.get("name"), "expiresAt": obj.get("expiresAt")}
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_response_dto_input.py b/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_response_dto_input.py
index 7e2f7264..de0a68c3 100644
--- a/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_response_dto_input.py
+++ b/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_response_dto_input.py
@@ -1,32 +1,36 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List
-from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_input import SubjectAccessTokenResponseDtoInput
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_input import (
+ SubjectAccessTokenResponseDtoInput,
+)
+
+
class CreateSubjectAccessTokenResponseDtoInput(BaseModel):
"""
CreateSubjectAccessTokenResponseDtoInput
- """ # noqa: E501
+ """ # noqa: E501
+
token: SubjectAccessTokenResponseDtoInput
token_string: StrictStr = Field(alias="tokenString")
additional_properties: Dict[str, Any] = {}
@@ -38,7 +42,6 @@ class CreateSubjectAccessTokenResponseDtoInput(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -64,9 +67,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -75,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of token
if self.token:
- _dict['token'] = self.token.to_dict()
+ _dict["token"] = self.token.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -92,15 +97,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "token": SubjectAccessTokenResponseDtoInput.from_dict(obj["token"]) if obj.get("token") is not None else None,
- "tokenString": obj.get("tokenString")
- })
+ _obj = cls.model_validate(
+ {
+ "token": SubjectAccessTokenResponseDtoInput.from_dict(obj["token"])
+ if obj.get("token") is not None
+ else None,
+ "tokenString": obj.get("tokenString"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_response_dto_output.py b/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_response_dto_output.py
index 57f5e0e0..2189cb95 100644
--- a/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_response_dto_output.py
+++ b/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_response_dto_output.py
@@ -1,32 +1,36 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List
-from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_output import SubjectAccessTokenResponseDtoOutput
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_output import (
+ SubjectAccessTokenResponseDtoOutput,
+)
+
+
class CreateSubjectAccessTokenResponseDtoOutput(BaseModel):
"""
CreateSubjectAccessTokenResponseDtoOutput
- """ # noqa: E501
+ """ # noqa: E501
+
token: SubjectAccessTokenResponseDtoOutput
token_string: StrictStr = Field(alias="tokenString")
additional_properties: Dict[str, Any] = {}
@@ -38,7 +42,6 @@ class CreateSubjectAccessTokenResponseDtoOutput(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -64,9 +67,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -75,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of token
if self.token:
- _dict['token'] = self.token.to_dict()
+ _dict["token"] = self.token.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -92,15 +97,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "token": SubjectAccessTokenResponseDtoOutput.from_dict(obj["token"]) if obj.get("token") is not None else None,
- "tokenString": obj.get("tokenString")
- })
+ _obj = cls.model_validate(
+ {
+ "token": SubjectAccessTokenResponseDtoOutput.from_dict(obj["token"])
+ if obj.get("token") is not None
+ else None,
+ "tokenString": obj.get("tokenString"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/create_workspace_access_token_request_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_workspace_access_token_request_dto.py
index 788d079a..30b32d74 100644
--- a/src/askui/tools/askui/askui_workspaces/models/create_workspace_access_token_request_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/create_workspace_access_token_request_dto.py
@@ -1,33 +1,33 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
+from typing_extensions import Annotated, Self
+
class CreateWorkspaceAccessTokenRequestDto(BaseModel):
"""
CreateWorkspaceAccessTokenRequestDto
- """ # noqa: E501
+ """ # noqa: E501
+
name: Annotated[str, Field(min_length=1, strict=True, max_length=128)]
expires_at: Optional[datetime] = Field(default=None, alias="expiresAt")
additional_properties: Dict[str, Any] = {}
@@ -39,7 +39,6 @@ class CreateWorkspaceAccessTokenRequestDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -65,9 +64,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -82,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if expires_at (nullable) is None
# and model_fields_set contains the field
if self.expires_at is None and "expires_at" in self.model_fields_set:
- _dict['expiresAt'] = None
+ _dict["expiresAt"] = None
return _dict
@@ -95,15 +96,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "name": obj.get("name"),
- "expiresAt": obj.get("expiresAt")
- })
+ _obj = cls.model_validate(
+ {"name": obj.get("name"), "expiresAt": obj.get("expiresAt")}
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/create_workspace_access_token_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_workspace_access_token_response_dto.py
index 241b4fd1..691c185d 100644
--- a/src/askui/tools/askui/askui_workspaces/models/create_workspace_access_token_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/create_workspace_access_token_response_dto.py
@@ -1,32 +1,36 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List
-from askui.tools.askui.askui_workspaces.models.access_token_response_dto import AccessTokenResponseDto
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.access_token_response_dto import (
+ AccessTokenResponseDto,
+)
+
+
class CreateWorkspaceAccessTokenResponseDto(BaseModel):
"""
CreateWorkspaceAccessTokenResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
private_token: AccessTokenResponseDto = Field(alias="privateToken")
token_string: StrictStr = Field(alias="tokenString")
additional_properties: Dict[str, Any] = {}
@@ -38,7 +42,6 @@ class CreateWorkspaceAccessTokenResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -64,9 +67,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -75,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of private_token
if self.private_token:
- _dict['privateToken'] = self.private_token.to_dict()
+ _dict["privateToken"] = self.private_token.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -92,15 +97,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "privateToken": AccessTokenResponseDto.from_dict(obj["privateToken"]) if obj.get("privateToken") is not None else None,
- "tokenString": obj.get("tokenString")
- })
+ _obj = cls.model_validate(
+ {
+ "privateToken": AccessTokenResponseDto.from_dict(obj["privateToken"])
+ if obj.get("privateToken") is not None
+ else None,
+ "tokenString": obj.get("tokenString"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/create_workspace_membership_request_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_workspace_membership_request_dto.py
index 52037b21..5689a788 100644
--- a/src/askui/tools/askui/askui_workspaces/models/create_workspace_membership_request_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/create_workspace_membership_request_dto.py
@@ -1,36 +1,41 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
-from askui.tools.askui.askui_workspaces.models.workspace_privilege import WorkspacePrivilege
-from typing import Optional, Set
-from typing_extensions import Self
+from typing_extensions import Annotated, Self
+
+from askui.tools.askui.askui_workspaces.models.workspace_privilege import (
+ WorkspacePrivilege,
+)
+
class CreateWorkspaceMembershipRequestDto(BaseModel):
"""
CreateWorkspaceMembershipRequestDto
- """ # noqa: E501
+ """ # noqa: E501
+
user_id: StrictStr = Field(alias="userId")
workspace_id: StrictStr = Field(alias="workspaceId")
- privileges: Optional[Annotated[List[WorkspacePrivilege], Field(max_length=1)]] = None
+ privileges: Optional[Annotated[List[WorkspacePrivilege], Field(max_length=1)]] = (
+ None
+ )
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["userId", "workspaceId", "privileges"]
@@ -40,7 +45,6 @@ class CreateWorkspaceMembershipRequestDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -66,9 +70,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -91,16 +97,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "userId": obj.get("userId"),
- "workspaceId": obj.get("workspaceId"),
- "privileges": obj.get("privileges")
- })
+ _obj = cls.model_validate(
+ {
+ "userId": obj.get("userId"),
+ "workspaceId": obj.get("workspaceId"),
+ "privileges": obj.get("privileges"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/create_workspace_membership_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_workspace_membership_response_dto.py
index 1347d397..42ad2195 100644
--- a/src/askui/tools/askui/askui_workspaces/models/create_workspace_membership_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/create_workspace_membership_response_dto.py
@@ -1,43 +1,59 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.workspace_access_token import WorkspaceAccessToken
-from askui.tools.askui.askui_workspaces.models.workspace_privilege import WorkspacePrivilege
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.workspace_access_token import (
+ WorkspaceAccessToken,
+)
+from askui.tools.askui.askui_workspaces.models.workspace_privilege import (
+ WorkspacePrivilege,
+)
+
+
class CreateWorkspaceMembershipResponseDto(BaseModel):
"""
CreateWorkspaceMembershipResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
id: Optional[StrictStr] = None
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
updated_at: Optional[datetime] = Field(default=None, alias="updatedAt")
user_id: StrictStr = Field(alias="userId")
workspace_id: StrictStr = Field(alias="workspaceId")
privileges: List[WorkspacePrivilege]
- access_tokens: Optional[List[WorkspaceAccessToken]] = Field(default=None, alias="accessTokens")
+ access_tokens: Optional[List[WorkspaceAccessToken]] = Field(
+ default=None, alias="accessTokens"
+ )
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt", "userId", "workspaceId", "privileges", "accessTokens"]
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "createdAt",
+ "updatedAt",
+ "userId",
+ "workspaceId",
+ "privileges",
+ "accessTokens",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -45,7 +61,6 @@ class CreateWorkspaceMembershipResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -71,9 +86,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -86,7 +103,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.access_tokens:
if _item:
_items.append(_item.to_dict())
- _dict['accessTokens'] = _items
+ _dict["accessTokens"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -103,20 +120,25 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "createdAt": obj.get("createdAt"),
- "updatedAt": obj.get("updatedAt"),
- "userId": obj.get("userId"),
- "workspaceId": obj.get("workspaceId"),
- "privileges": obj.get("privileges"),
- "accessTokens": [WorkspaceAccessToken.from_dict(_item) for _item in obj["accessTokens"]] if obj.get("accessTokens") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "createdAt": obj.get("createdAt"),
+ "updatedAt": obj.get("updatedAt"),
+ "userId": obj.get("userId"),
+ "workspaceId": obj.get("workspaceId"),
+ "privileges": obj.get("privileges"),
+ "accessTokens": [
+ WorkspaceAccessToken.from_dict(_item)
+ for _item in obj["accessTokens"]
+ ]
+ if obj.get("accessTokens") is not None
+ else None,
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/create_workspace_request_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_workspace_request_dto.py
index 1c512d3a..dc9e1451 100644
--- a/src/askui/tools/askui/askui_workspaces/models/create_workspace_request_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/create_workspace_request_dto.py
@@ -1,32 +1,32 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
+from typing_extensions import Annotated, Self
+
class CreateWorkspaceRequestDto(BaseModel):
"""
CreateWorkspaceRequestDto
- """ # noqa: E501
+ """ # noqa: E501
+
name: Annotated[str, Field(min_length=1, strict=True, max_length=128)]
first_member_id: Optional[StrictStr] = Field(default=None, alias="firstMemberId")
billing_account_email: StrictStr = Field(alias="billingAccountEmail")
@@ -39,7 +39,6 @@ class CreateWorkspaceRequestDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -65,9 +64,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -82,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if first_member_id (nullable) is None
# and model_fields_set contains the field
if self.first_member_id is None and "first_member_id" in self.model_fields_set:
- _dict['firstMemberId'] = None
+ _dict["firstMemberId"] = None
return _dict
@@ -95,16 +96,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "name": obj.get("name"),
- "firstMemberId": obj.get("firstMemberId"),
- "billingAccountEmail": obj.get("billingAccountEmail")
- })
+ _obj = cls.model_validate(
+ {
+ "name": obj.get("name"),
+ "firstMemberId": obj.get("firstMemberId"),
+ "billingAccountEmail": obj.get("billingAccountEmail"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/create_workspace_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_workspace_response_dto.py
index 4dbf0582..ea1ff87e 100644
--- a/src/askui/tools/askui/askui_workspaces/models/create_workspace_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/create_workspace_response_dto.py
@@ -1,40 +1,52 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto import WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto import (
+ WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto,
+)
+
+
class CreateWorkspaceResponseDto(BaseModel):
"""
CreateWorkspaceResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
id: Optional[StrictStr] = None
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
updated_at: Optional[datetime] = Field(default=None, alias="updatedAt")
name: StrictStr
- memberships: List[WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto]
+ memberships: List[
+ WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto
+ ]
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt", "name", "memberships"]
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "createdAt",
+ "updatedAt",
+ "name",
+ "memberships",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -42,7 +54,6 @@ class CreateWorkspaceResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -68,9 +79,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -83,7 +96,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.memberships:
if _item:
_items.append(_item.to_dict())
- _dict['memberships'] = _items
+ _dict["memberships"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -100,18 +113,25 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "createdAt": obj.get("createdAt"),
- "updatedAt": obj.get("updatedAt"),
- "name": obj.get("name"),
- "memberships": [WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto.from_dict(_item) for _item in obj["memberships"]] if obj.get("memberships") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "createdAt": obj.get("createdAt"),
+ "updatedAt": obj.get("updatedAt"),
+ "name": obj.get("name"),
+ "memberships": [
+ WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto.from_dict(
+ _item
+ )
+ for _item in obj["memberships"]
+ ]
+ if obj.get("memberships") is not None
+ else None,
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/data_destination_ask_ui_workflow.py b/src/askui/tools/askui/askui_workspaces/models/data_destination_ask_ui_workflow.py
index cb157700..9a7c5962 100644
--- a/src/askui/tools/askui/askui_workspaces/models/data_destination_ask_ui_workflow.py
+++ b/src/askui/tools/askui/askui_workspaces/models/data_destination_ask_ui_workflow.py
@@ -1,47 +1,48 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
+from typing_extensions import Annotated, Self
+
from askui.tools.askui.askui_workspaces.models.ask_ui_runner_host import AskUiRunnerHost
-from typing import Optional, Set
-from typing_extensions import Self
+
class DataDestinationAskUiWorkflow(BaseModel):
"""
DataDestinationAskUiWorkflow
- """ # noqa: E501
- type: Optional[StrictStr] = 'ASKUI_WORKFLOW'
+ """ # noqa: E501
+
+ type: Optional[StrictStr] = "ASKUI_WORKFLOW"
host: AskUiRunnerHost
runner_tags: List[StrictStr] = Field(alias="runnerTags")
workflows: Annotated[List[StrictStr], Field(min_length=1)]
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["type", "host", "runnerTags", "workflows"]
- @field_validator('type')
+ @field_validator("type")
def type_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['ASKUI_WORKFLOW']):
+ if value not in set(["ASKUI_WORKFLOW"]):
raise ValueError("must be one of enum values ('ASKUI_WORKFLOW')")
return value
@@ -51,7 +52,6 @@ def type_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -77,9 +77,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -102,17 +104,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "type": obj.get("type") if obj.get("type") is not None else 'ASKUI_WORKFLOW',
- "host": obj.get("host"),
- "runnerTags": obj.get("runnerTags"),
- "workflows": obj.get("workflows")
- })
+ _obj = cls.model_validate(
+ {
+ "type": obj.get("type")
+ if obj.get("type") is not None
+ else "ASKUI_WORKFLOW",
+ "host": obj.get("host"),
+ "runnerTags": obj.get("runnerTags"),
+ "workflows": obj.get("workflows"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/data_destination_ask_ui_workflow_create.py b/src/askui/tools/askui/askui_workspaces/models/data_destination_ask_ui_workflow_create.py
index 19f912aa..ef594bbc 100644
--- a/src/askui/tools/askui/askui_workspaces/models/data_destination_ask_ui_workflow_create.py
+++ b/src/askui/tools/askui/askui_workspaces/models/data_destination_ask_ui_workflow_create.py
@@ -1,47 +1,48 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
+from typing_extensions import Annotated, Self
+
from askui.tools.askui.askui_workspaces.models.ask_ui_runner_host import AskUiRunnerHost
-from typing import Optional, Set
-from typing_extensions import Self
+
class DataDestinationAskUiWorkflowCreate(BaseModel):
"""
DataDestinationAskUiWorkflowCreate
- """ # noqa: E501
- type: Optional[StrictStr] = 'ASKUI_WORKFLOW'
+ """ # noqa: E501
+
+ type: Optional[StrictStr] = "ASKUI_WORKFLOW"
host: Optional[AskUiRunnerHost] = None
runner_tags: Optional[List[StrictStr]] = Field(default=None, alias="runnerTags")
workflows: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["type", "host", "runnerTags", "workflows"]
- @field_validator('type')
+ @field_validator("type")
def type_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['ASKUI_WORKFLOW']):
+ if value not in set(["ASKUI_WORKFLOW"]):
raise ValueError("must be one of enum values ('ASKUI_WORKFLOW')")
return value
@@ -51,7 +52,6 @@ def type_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -77,9 +77,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -102,17 +104,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "type": obj.get("type") if obj.get("type") is not None else 'ASKUI_WORKFLOW',
- "host": obj.get("host"),
- "runnerTags": obj.get("runnerTags"),
- "workflows": obj.get("workflows")
- })
+ _obj = cls.model_validate(
+ {
+ "type": obj.get("type")
+ if obj.get("type") is not None
+ else "ASKUI_WORKFLOW",
+ "host": obj.get("host"),
+ "runnerTags": obj.get("runnerTags"),
+ "workflows": obj.get("workflows"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/data_destination_delivery_ask_ui_workflow.py b/src/askui/tools/askui/askui_workspaces/models/data_destination_delivery_ask_ui_workflow.py
index 09324404..97559dc1 100644
--- a/src/askui/tools/askui/askui_workspaces/models/data_destination_delivery_ask_ui_workflow.py
+++ b/src/askui/tools/askui/askui_workspaces/models/data_destination_delivery_ask_ui_workflow.py
@@ -1,43 +1,44 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class DataDestinationDeliveryAskUiWorkflow(BaseModel):
"""
DataDestinationDeliveryAskUiWorkflow
- """ # noqa: E501
- type: Optional[StrictStr] = 'ASKUI_WORKFLOW'
+ """ # noqa: E501
+
+ type: Optional[StrictStr] = "ASKUI_WORKFLOW"
schedule_id: StrictStr = Field(alias="scheduleId")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["type", "scheduleId"]
- @field_validator('type')
+ @field_validator("type")
def type_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['ASKUI_WORKFLOW']):
+ if value not in set(["ASKUI_WORKFLOW"]):
raise ValueError("must be one of enum values ('ASKUI_WORKFLOW')")
return value
@@ -47,7 +48,6 @@ def type_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -73,9 +73,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -98,15 +100,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "type": obj.get("type") if obj.get("type") is not None else 'ASKUI_WORKFLOW',
- "scheduleId": obj.get("scheduleId")
- })
+ _obj = cls.model_validate(
+ {
+ "type": obj.get("type")
+ if obj.get("type") is not None
+ else "ASKUI_WORKFLOW",
+ "scheduleId": obj.get("scheduleId"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/data_destination_delivery_webhook.py b/src/askui/tools/askui/askui_workspaces/models/data_destination_delivery_webhook.py
index bc9b9d14..42777fb5 100644
--- a/src/askui/tools/askui/askui_workspaces/models/data_destination_delivery_webhook.py
+++ b/src/askui/tools/askui/askui_workspaces/models/data_destination_delivery_webhook.py
@@ -1,44 +1,46 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.webhook_response import WebhookResponse
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.webhook_response import WebhookResponse
+
+
class DataDestinationDeliveryWebhook(BaseModel):
"""
DataDestinationDeliveryWebhook
- """ # noqa: E501
- type: Optional[StrictStr] = 'WEBHOOK'
+ """ # noqa: E501
+
+ type: Optional[StrictStr] = "WEBHOOK"
response: WebhookResponse
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["type", "response"]
- @field_validator('type')
+ @field_validator("type")
def type_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['WEBHOOK']):
+ if value not in set(["WEBHOOK"]):
raise ValueError("must be one of enum values ('WEBHOOK')")
return value
@@ -48,7 +50,6 @@ def type_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -74,9 +75,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -85,7 +88,7 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of response
if self.response:
- _dict['response'] = self.response.to_dict()
+ _dict["response"] = self.response.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -102,15 +105,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "type": obj.get("type") if obj.get("type") is not None else 'WEBHOOK',
- "response": WebhookResponse.from_dict(obj["response"]) if obj.get("response") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "type": obj.get("type") if obj.get("type") is not None else "WEBHOOK",
+ "response": WebhookResponse.from_dict(obj["response"])
+ if obj.get("response") is not None
+ else None,
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/data_destination_webhook.py b/src/askui/tools/askui/askui_workspaces/models/data_destination_webhook.py
index e8ca84f6..ac36b2af 100644
--- a/src/askui/tools/askui/askui_workspaces/models/data_destination_webhook.py
+++ b/src/askui/tools/askui/askui_workspaces/models/data_destination_webhook.py
@@ -1,45 +1,45 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
+from typing_extensions import Annotated, Self
+
class DataDestinationWebhook(BaseModel):
"""
DataDestinationWebhook
- """ # noqa: E501
- type: Optional[StrictStr] = 'WEBHOOK'
+ """ # noqa: E501
+
+ type: Optional[StrictStr] = "WEBHOOK"
url: Annotated[str, Field(min_length=1, strict=True, max_length=2083)]
headers: Dict[str, StrictStr]
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["type", "url", "headers"]
- @field_validator('type')
+ @field_validator("type")
def type_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['WEBHOOK']):
+ if value not in set(["WEBHOOK"]):
raise ValueError("must be one of enum values ('WEBHOOK')")
return value
@@ -49,7 +49,6 @@ def type_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -75,9 +74,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -100,16 +101,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "type": obj.get("type") if obj.get("type") is not None else 'WEBHOOK',
- "url": obj.get("url"),
- "headers": obj.get("headers")
- })
+ _obj = cls.model_validate(
+ {
+ "type": obj.get("type") if obj.get("type") is not None else "WEBHOOK",
+ "url": obj.get("url"),
+ "headers": obj.get("headers"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/data_destination_webhook_create.py b/src/askui/tools/askui/askui_workspaces/models/data_destination_webhook_create.py
index e4e634c5..e8f7565b 100644
--- a/src/askui/tools/askui/askui_workspaces/models/data_destination_webhook_create.py
+++ b/src/askui/tools/askui/askui_workspaces/models/data_destination_webhook_create.py
@@ -1,45 +1,45 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
+from typing_extensions import Annotated, Self
+
class DataDestinationWebhookCreate(BaseModel):
"""
DataDestinationWebhookCreate
- """ # noqa: E501
- type: Optional[StrictStr] = 'WEBHOOK'
+ """ # noqa: E501
+
+ type: Optional[StrictStr] = "WEBHOOK"
url: Annotated[str, Field(min_length=1, strict=True, max_length=2083)]
headers: Optional[Dict[str, StrictStr]] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["type", "url", "headers"]
- @field_validator('type')
+ @field_validator("type")
def type_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['WEBHOOK']):
+ if value not in set(["WEBHOOK"]):
raise ValueError("must be one of enum values ('WEBHOOK')")
return value
@@ -49,7 +49,6 @@ def type_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -75,9 +74,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -100,16 +101,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "type": obj.get("type") if obj.get("type") is not None else 'WEBHOOK',
- "url": obj.get("url"),
- "headers": obj.get("headers")
- })
+ _obj = cls.model_validate(
+ {
+ "type": obj.get("type") if obj.get("type") is not None else "WEBHOOK",
+ "url": obj.get("url"),
+ "headers": obj.get("headers"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger.py b/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger.py
index a9a7b677..d9a4efdb 100644
--- a/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger.py
+++ b/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger.py
@@ -1,43 +1,60 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
+from pydantic import (
+ BaseModel,
+ ConfigDict,
+ Field,
+ StrictBool,
+ StrictStr,
+ field_validator,
+)
+from typing_extensions import Annotated, Self
-from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
class EmailAgentTrigger(BaseModel):
"""
EmailAgentTrigger
- """ # noqa: E501
- active: Optional[StrictBool] = Field(default=True, description="If false, no emails can be send to trigger agent.")
- allowed_senders: Optional[List[StrictStr]] = Field(default=None, description="The email addresses that are allowed to send emails to trigger the agent. If empty, no emails can be send to trigger agent.", alias="allowedSenders")
- email: Annotated[str, Field(strict=True)] = Field(description="The email address of the agent to send emails to to trigger the agent. The email address must be unique for each agent. The domain of the email address is fixed. The local part of the email address must be between 1 and 64 characters long and can only contain the following characters: a-z, A-Z, 0-9, -, _, . and +.")
+ """ # noqa: E501
+
+ active: Optional[StrictBool] = Field(
+ default=True, description="If false, no emails can be send to trigger agent."
+ )
+ allowed_senders: Optional[List[StrictStr]] = Field(
+ default=None,
+ description="The email addresses that are allowed to send emails to trigger the agent. If empty, no emails can be send to trigger agent.",
+ alias="allowedSenders",
+ )
+ email: Annotated[str, Field(strict=True)] = Field(
+ description="The email address of the agent to send emails to to trigger the agent. The email address must be unique for each agent. The domain of the email address is fixed. The local part of the email address must be between 1 and 64 characters long and can only contain the following characters: a-z, A-Z, 0-9, -, _, . and +."
+ )
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["active", "allowedSenders", "email"]
- @field_validator('email')
+ @field_validator("email")
def email_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-zA-Z0-9-_.+]+@.*$", value):
- raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-_.+]+@.*$/")
+ raise ValueError(
+ r"must validate the regular expression /^[a-zA-Z0-9-_.+]+@.*$/"
+ )
return value
model_config = ConfigDict(
@@ -46,7 +63,6 @@ def email_validate_regular_expression(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -72,9 +88,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -97,16 +115,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "active": obj.get("active") if obj.get("active") is not None else True,
- "allowedSenders": obj.get("allowedSenders"),
- "email": obj.get("email")
- })
+ _obj = cls.model_validate(
+ {
+ "active": obj.get("active") if obj.get("active") is not None else True,
+ "allowedSenders": obj.get("allowedSenders"),
+ "email": obj.get("email"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger_create.py b/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger_create.py
index c65c6fa6..2e71f031 100644
--- a/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger_create.py
+++ b/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger_create.py
@@ -1,46 +1,63 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
+from pydantic import (
+ BaseModel,
+ ConfigDict,
+ Field,
+ StrictBool,
+ StrictStr,
+ field_validator,
+)
+from typing_extensions import Annotated, Self
-from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
class EmailAgentTriggerCreate(BaseModel):
"""
EmailAgentTriggerCreate
- """ # noqa: E501
- active: Optional[StrictBool] = Field(default=True, description="If false, no emails can be send to trigger agent.")
- allowed_senders: Optional[List[StrictStr]] = Field(default=None, description="The email addresses that are allowed to send emails to trigger the agent. If empty, no emails can be send to trigger agent.", alias="allowedSenders")
- local_part: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, alias="localPart")
+ """ # noqa: E501
+
+ active: Optional[StrictBool] = Field(
+ default=True, description="If false, no emails can be send to trigger agent."
+ )
+ allowed_senders: Optional[List[StrictStr]] = Field(
+ default=None,
+ description="The email addresses that are allowed to send emails to trigger the agent. If empty, no emails can be send to trigger agent.",
+ alias="allowedSenders",
+ )
+ local_part: Optional[Annotated[str, Field(strict=True)]] = Field(
+ default=None, alias="localPart"
+ )
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["active", "allowedSenders", "localPart"]
- @field_validator('local_part')
+ @field_validator("local_part")
def local_part_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-zA-Z0-9-_.+]+$", value):
- raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-_.+]+$/")
+ raise ValueError(
+ r"must validate the regular expression /^[a-zA-Z0-9-_.+]+$/"
+ )
return value
model_config = ConfigDict(
@@ -49,7 +66,6 @@ def local_part_validate_regular_expression(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -75,9 +91,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -92,7 +110,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if local_part (nullable) is None
# and model_fields_set contains the field
if self.local_part is None and "local_part" in self.model_fields_set:
- _dict['localPart'] = None
+ _dict["localPart"] = None
return _dict
@@ -105,16 +123,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "active": obj.get("active") if obj.get("active") is not None else True,
- "allowedSenders": obj.get("allowedSenders"),
- "localPart": obj.get("localPart")
- })
+ _obj = cls.model_validate(
+ {
+ "active": obj.get("active") if obj.get("active") is not None else True,
+ "allowedSenders": obj.get("allowedSenders"),
+ "localPart": obj.get("localPart"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger_update.py b/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger_update.py
index 1d2202d4..2136aec9 100644
--- a/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger_update.py
+++ b/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger_update.py
@@ -1,46 +1,59 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
+from pydantic import (
+ BaseModel,
+ ConfigDict,
+ Field,
+ StrictBool,
+ StrictStr,
+ field_validator,
+)
+from typing_extensions import Annotated, Self
-from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
class EmailAgentTriggerUpdate(BaseModel):
"""
EmailAgentTriggerUpdate
- """ # noqa: E501
+ """ # noqa: E501
+
active: Optional[StrictBool] = None
- allowed_senders: Optional[List[StrictStr]] = Field(default=None, alias="allowedSenders")
- local_part: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, alias="localPart")
+ allowed_senders: Optional[List[StrictStr]] = Field(
+ default=None, alias="allowedSenders"
+ )
+ local_part: Optional[Annotated[str, Field(strict=True)]] = Field(
+ default=None, alias="localPart"
+ )
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["active", "allowedSenders", "localPart"]
- @field_validator('local_part')
+ @field_validator("local_part")
def local_part_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-zA-Z0-9-_.+]+$", value):
- raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-_.+]+$/")
+ raise ValueError(
+ r"must validate the regular expression /^[a-zA-Z0-9-_.+]+$/"
+ )
return value
model_config = ConfigDict(
@@ -49,7 +62,6 @@ def local_part_validate_regular_expression(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -75,9 +87,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -92,17 +106,17 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if active (nullable) is None
# and model_fields_set contains the field
if self.active is None and "active" in self.model_fields_set:
- _dict['active'] = None
+ _dict["active"] = None
# set to None if allowed_senders (nullable) is None
# and model_fields_set contains the field
if self.allowed_senders is None and "allowed_senders" in self.model_fields_set:
- _dict['allowedSenders'] = None
+ _dict["allowedSenders"] = None
# set to None if local_part (nullable) is None
# and model_fields_set contains the field
if self.local_part is None and "local_part" in self.model_fields_set:
- _dict['localPart'] = None
+ _dict["localPart"] = None
return _dict
@@ -115,16 +129,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "active": obj.get("active"),
- "allowedSenders": obj.get("allowedSenders"),
- "localPart": obj.get("localPart")
- })
+ _obj = cls.model_validate(
+ {
+ "active": obj.get("active"),
+ "allowedSenders": obj.get("allowedSenders"),
+ "localPart": obj.get("localPart"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/extract_data_command.py b/src/askui/tools/askui/askui_workspaces/models/extract_data_command.py
index cfb650f2..ad80c61f 100644
--- a/src/askui/tools/askui/askui_workspaces/models/extract_data_command.py
+++ b/src/askui/tools/askui/askui_workspaces/models/extract_data_command.py
@@ -1,32 +1,34 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List
-from askui.tools.askui.askui_workspaces.models.json_schema import JsonSchema
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.json_schema import JsonSchema
+
+
class ExtractDataCommand(BaseModel):
"""
ExtractDataCommand
- """ # noqa: E501
+ """ # noqa: E501
+
file_paths: List[StrictStr] = Field(alias="filePaths")
data_schema: JsonSchema = Field(alias="dataSchema")
additional_properties: Dict[str, Any] = {}
@@ -38,7 +40,6 @@ class ExtractDataCommand(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -64,9 +65,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -75,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of data_schema
if self.data_schema:
- _dict['dataSchema'] = self.data_schema.to_dict()
+ _dict["dataSchema"] = self.data_schema.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -92,15 +95,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "filePaths": obj.get("filePaths"),
- "dataSchema": JsonSchema.from_dict(obj["dataSchema"]) if obj.get("dataSchema") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "filePaths": obj.get("filePaths"),
+ "dataSchema": JsonSchema.from_dict(obj["dataSchema"])
+ if obj.get("dataSchema") is not None
+ else None,
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/extract_data_response.py b/src/askui/tools/askui/askui_workspaces/models/extract_data_response.py
index f52eff13..23a0df77 100644
--- a/src/askui/tools/askui/askui_workspaces/models/extract_data_response.py
+++ b/src/askui/tools/askui/askui_workspaces/models/extract_data_response.py
@@ -1,31 +1,32 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict
-from typing import Any, ClassVar, Dict, List
-from typing import Optional, Set
from typing_extensions import Self
+
class ExtractDataResponse(BaseModel):
"""
ExtractDataResponse
- """ # noqa: E501
+ """ # noqa: E501
+
data: Dict[str, Any]
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["data"]
@@ -36,7 +37,6 @@ class ExtractDataResponse(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -62,9 +62,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -87,14 +89,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "data": obj.get("data")
- })
+ _obj = cls.model_validate({"data": obj.get("data")})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/file_dto.py b/src/askui/tools/askui/askui_workspaces/models/file_dto.py
index 6680c1a7..79e9eb5b 100644
--- a/src/askui/tools/askui/askui_workspaces/models/file_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/file_dto.py
@@ -1,48 +1,56 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class FileDto(BaseModel):
"""
FileDto
- """ # noqa: E501
- type: Optional[StrictStr] = 'file'
+ """ # noqa: E501
+
+ type: Optional[StrictStr] = "file"
name: StrictStr
path: StrictStr = Field(description="Path to the file starting")
url: Optional[StrictStr] = None
size: StrictInt = Field(description="Size of the file in bytes")
last_modified: datetime = Field(alias="lastModified")
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["type", "name", "path", "url", "size", "lastModified"]
-
- @field_validator('type')
+ __properties: ClassVar[List[str]] = [
+ "type",
+ "name",
+ "path",
+ "url",
+ "size",
+ "lastModified",
+ ]
+
+ @field_validator("type")
def type_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['file']):
+ if value not in set(["file"]):
raise ValueError("must be one of enum values ('file')")
return value
@@ -52,7 +60,6 @@ def type_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -78,9 +85,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -95,7 +104,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if url (nullable) is None
# and model_fields_set contains the field
if self.url is None and "url" in self.model_fields_set:
- _dict['url'] = None
+ _dict["url"] = None
return _dict
@@ -108,19 +117,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "type": obj.get("type") if obj.get("type") is not None else 'file',
- "name": obj.get("name"),
- "path": obj.get("path"),
- "url": obj.get("url"),
- "size": obj.get("size"),
- "lastModified": obj.get("lastModified")
- })
+ _obj = cls.model_validate(
+ {
+ "type": obj.get("type") if obj.get("type") is not None else "file",
+ "name": obj.get("name"),
+ "path": obj.get("path"),
+ "url": obj.get("url"),
+ "size": obj.get("size"),
+ "lastModified": obj.get("lastModified"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/files_list_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/files_list_response_dto.py
index c598354e..1de92917 100644
--- a/src/askui/tools/askui/askui_workspaces/models/files_list_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/files_list_response_dto.py
@@ -1,34 +1,40 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.files_list_response_dto_data_inner import FilesListResponseDtoDataInner
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.files_list_response_dto_data_inner import (
+ FilesListResponseDtoDataInner,
+)
+
+
class FilesListResponseDto(BaseModel):
"""
FilesListResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
data: List[FilesListResponseDtoDataInner]
- next_continuation_token: Optional[StrictStr] = Field(default=None, alias="nextContinuationToken")
+ next_continuation_token: Optional[StrictStr] = Field(
+ default=None, alias="nextContinuationToken"
+ )
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["data", "nextContinuationToken"]
@@ -38,7 +44,6 @@ class FilesListResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -64,9 +69,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -79,7 +86,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.data:
if _item:
_items.append(_item.to_dict())
- _dict['data'] = _items
+ _dict["data"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -87,8 +94,11 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if next_continuation_token (nullable) is None
# and model_fields_set contains the field
- if self.next_continuation_token is None and "next_continuation_token" in self.model_fields_set:
- _dict['nextContinuationToken'] = None
+ if (
+ self.next_continuation_token is None
+ and "next_continuation_token" in self.model_fields_set
+ ):
+ _dict["nextContinuationToken"] = None
return _dict
@@ -101,15 +111,20 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "data": [FilesListResponseDtoDataInner.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None,
- "nextContinuationToken": obj.get("nextContinuationToken")
- })
+ _obj = cls.model_validate(
+ {
+ "data": [
+ FilesListResponseDtoDataInner.from_dict(_item)
+ for _item in obj["data"]
+ ]
+ if obj.get("data") is not None
+ else None,
+ "nextContinuationToken": obj.get("nextContinuationToken"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/files_list_response_dto_data_inner.py b/src/askui/tools/askui/askui_workspaces/models/files_list_response_dto_data_inner.py
index c37d09d6..8f56ef89 100644
--- a/src/askui/tools/askui/askui_workspaces/models/files_list_response_dto_data_inner.py
+++ b/src/askui/tools/askui/askui_workspaces/models/files_list_response_dto_data_inner.py
@@ -1,61 +1,70 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
import json
import pprint
-from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
-from typing import Any, List, Optional
+from typing import Any, Dict, Optional, Set, Union
+
+from pydantic import (
+ BaseModel,
+ ConfigDict,
+ ValidationError,
+ field_validator,
+)
+from typing_extensions import Self
+
from askui.tools.askui.askui_workspaces.models.file_dto import FileDto
from askui.tools.askui.askui_workspaces.models.folder_dto import FolderDto
-from pydantic import StrictStr, Field
-from typing import Union, List, Set, Optional, Dict
-from typing_extensions import Literal, Self
FILESLISTRESPONSEDTODATAINNER_ONE_OF_SCHEMAS = ["FileDto", "FolderDto"]
+
class FilesListResponseDtoDataInner(BaseModel):
"""
FilesListResponseDtoDataInner
"""
+
# data type: FileDto
oneof_schema_1_validator: Optional[FileDto] = None
# data type: FolderDto
oneof_schema_2_validator: Optional[FolderDto] = None
actual_instance: Optional[Union[FileDto, FolderDto]] = None
- one_of_schemas: Set[str] = { "FileDto", "FolderDto" }
+ one_of_schemas: Set[str] = {"FileDto", "FolderDto"}
model_config = ConfigDict(
validate_assignment=True,
protected_namespaces=(),
)
-
- discriminator_value_class_map: Dict[str, str] = {
- }
+ discriminator_value_class_map: Dict[str, str] = {}
def __init__(self, *args, **kwargs) -> None:
if args:
if len(args) > 1:
- raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ raise ValueError(
+ "If a position argument is used, only 1 is allowed to set `actual_instance`"
+ )
if kwargs:
- raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ raise ValueError(
+ "If a position argument is used, keyword arguments cannot be used."
+ )
super().__init__(actual_instance=args[0])
else:
super().__init__(**kwargs)
- @field_validator('actual_instance')
+ @field_validator("actual_instance")
def actual_instance_must_validate_oneof(cls, v):
instance = FilesListResponseDtoDataInner.model_construct()
error_messages = []
@@ -72,12 +81,17 @@ def actual_instance_must_validate_oneof(cls, v):
match += 1
if match > 1:
# more than 1 match
- raise ValueError("Multiple matches found when setting `actual_instance` in FilesListResponseDtoDataInner with oneOf schemas: FileDto, FolderDto. Details: " + ", ".join(error_messages))
- elif match == 0:
+ raise ValueError(
+ "Multiple matches found when setting `actual_instance` in FilesListResponseDtoDataInner with oneOf schemas: FileDto, FolderDto. Details: "
+ + ", ".join(error_messages)
+ )
+ if match == 0:
# no match
- raise ValueError("No match found when setting `actual_instance` in FilesListResponseDtoDataInner with oneOf schemas: FileDto, FolderDto. Details: " + ", ".join(error_messages))
- else:
- return v
+ raise ValueError(
+ "No match found when setting `actual_instance` in FilesListResponseDtoDataInner with oneOf schemas: FileDto, FolderDto. Details: "
+ + ", ".join(error_messages)
+ )
+ return v
@classmethod
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
@@ -93,7 +107,9 @@ def from_json(cls, json_str: str) -> Self:
# use oneOf discriminator to lookup the data type
_data_type = json.loads(json_str).get("type")
if not _data_type:
- raise ValueError("Failed to lookup data type from the field `type` in the input.")
+ raise ValueError(
+ "Failed to lookup data type from the field `type` in the input."
+ )
# check if data type is `FileDto`
if _data_type == "file":
@@ -130,36 +146,41 @@ def from_json(cls, json_str: str) -> Self:
if match > 1:
# more than 1 match
- raise ValueError("Multiple matches found when deserializing the JSON string into FilesListResponseDtoDataInner with oneOf schemas: FileDto, FolderDto. Details: " + ", ".join(error_messages))
- elif match == 0:
+ raise ValueError(
+ "Multiple matches found when deserializing the JSON string into FilesListResponseDtoDataInner with oneOf schemas: FileDto, FolderDto. Details: "
+ + ", ".join(error_messages)
+ )
+ if match == 0:
# no match
- raise ValueError("No match found when deserializing the JSON string into FilesListResponseDtoDataInner with oneOf schemas: FileDto, FolderDto. Details: " + ", ".join(error_messages))
- else:
- return instance
+ raise ValueError(
+ "No match found when deserializing the JSON string into FilesListResponseDtoDataInner with oneOf schemas: FileDto, FolderDto. Details: "
+ + ", ".join(error_messages)
+ )
+ return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
- if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ if hasattr(self.actual_instance, "to_json") and callable(
+ self.actual_instance.to_json
+ ):
return self.actual_instance.to_json()
- else:
- return json.dumps(self.actual_instance)
+ return json.dumps(self.actual_instance)
def to_dict(self) -> Optional[Union[Dict[str, Any], FileDto, FolderDto]]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
- if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ if hasattr(self.actual_instance, "to_dict") and callable(
+ self.actual_instance.to_dict
+ ):
return self.actual_instance.to_dict()
- else:
- # primitive type
- return self.actual_instance
+ # primitive type
+ return self.actual_instance
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/folder_dto.py b/src/askui/tools/askui/askui_workspaces/models/folder_dto.py
index 0305d18a..286b9938 100644
--- a/src/askui/tools/askui/askui_workspaces/models/folder_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/folder_dto.py
@@ -1,44 +1,45 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class FolderDto(BaseModel):
"""
FolderDto
- """ # noqa: E501
- type: Optional[StrictStr] = 'folder'
+ """ # noqa: E501
+
+ type: Optional[StrictStr] = "folder"
name: StrictStr
path: StrictStr
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["type", "name", "path"]
- @field_validator('type')
+ @field_validator("type")
def type_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['folder']):
+ if value not in set(["folder"]):
raise ValueError("must be one of enum values ('folder')")
return value
@@ -48,7 +49,6 @@ def type_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -74,9 +74,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -99,16 +101,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "type": obj.get("type") if obj.get("type") is not None else 'folder',
- "name": obj.get("name"),
- "path": obj.get("path")
- })
+ _obj = cls.model_validate(
+ {
+ "type": obj.get("type") if obj.get("type") is not None else "folder",
+ "name": obj.get("name"),
+ "path": obj.get("path"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/generate_signed_cookies_command.py b/src/askui/tools/askui/askui_workspaces/models/generate_signed_cookies_command.py
index 0a4302e5..cf5948f0 100644
--- a/src/askui/tools/askui/askui_workspaces/models/generate_signed_cookies_command.py
+++ b/src/askui/tools/askui/askui_workspaces/models/generate_signed_cookies_command.py
@@ -1,31 +1,32 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class GenerateSignedCookiesCommand(BaseModel):
"""
GenerateSignedCookiesCommand
- """ # noqa: E501
+ """ # noqa: E501
+
workspace_id: Optional[StrictStr] = Field(alias="workspaceId")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["workspaceId"]
@@ -36,7 +37,6 @@ class GenerateSignedCookiesCommand(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -62,9 +62,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -79,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if workspace_id (nullable) is None
# and model_fields_set contains the field
if self.workspace_id is None and "workspace_id" in self.model_fields_set:
- _dict['workspaceId'] = None
+ _dict["workspaceId"] = None
return _dict
@@ -92,14 +94,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "workspaceId": obj.get("workspaceId")
- })
+ _obj = cls.model_validate({"workspaceId": obj.get("workspaceId")})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/get_subscription_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/get_subscription_response_dto.py
index cc7a9370..f0961222 100644
--- a/src/askui/tools/askui/askui_workspaces/models/get_subscription_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/get_subscription_response_dto.py
@@ -1,37 +1,42 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
-from typing import Any, ClassVar, Dict, List
-from typing import Optional, Set
from typing_extensions import Self
+
class GetSubscriptionResponseDto(BaseModel):
"""
GetSubscriptionResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
id: StrictStr
max_usage_events_per_period: StrictInt = Field(alias="maxUsageEventsPerPeriod")
current_period_start: datetime = Field(alias="currentPeriodStart")
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "maxUsageEventsPerPeriod", "currentPeriodStart"]
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "maxUsageEventsPerPeriod",
+ "currentPeriodStart",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -39,7 +44,6 @@ class GetSubscriptionResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -65,9 +69,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -90,16 +96,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "maxUsageEventsPerPeriod": obj.get("maxUsageEventsPerPeriod"),
- "currentPeriodStart": obj.get("currentPeriodStart")
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "maxUsageEventsPerPeriod": obj.get("maxUsageEventsPerPeriod"),
+ "currentPeriodStart": obj.get("currentPeriodStart"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/http_validation_error.py b/src/askui/tools/askui/askui_workspaces/models/http_validation_error.py
index 9264ef6c..ec3f038f 100644
--- a/src/askui/tools/askui/askui_workspaces/models/http_validation_error.py
+++ b/src/askui/tools/askui/askui_workspaces/models/http_validation_error.py
@@ -1,32 +1,34 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.validation_error import ValidationError
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.validation_error import ValidationError
+
+
class HTTPValidationError(BaseModel):
"""
HTTPValidationError
- """ # noqa: E501
+ """ # noqa: E501
+
detail: Optional[List[ValidationError]] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["detail"]
@@ -37,7 +39,6 @@ class HTTPValidationError(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -63,9 +64,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -78,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.detail:
if _item:
_items.append(_item.to_dict())
- _dict['detail'] = _items
+ _dict["detail"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -95,14 +98,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "detail": [ValidationError.from_dict(_item) for _item in obj["detail"]] if obj.get("detail") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "detail": [ValidationError.from_dict(_item) for _item in obj["detail"]]
+ if obj.get("detail") is not None
+ else None
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/json_schema.py b/src/askui/tools/askui/askui_workspaces/models/json_schema.py
index 1c4d8c84..a6980763 100644
--- a/src/askui/tools/askui/askui_workspaces/models/json_schema.py
+++ b/src/askui/tools/askui/askui_workspaces/models/json_schema.py
@@ -1,41 +1,47 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
-from typing import Any, ClassVar, Dict, List, Optional
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
+from typing_extensions import Annotated, Self
+
class JsonSchema(BaseModel):
"""
JsonSchema
- """ # noqa: E501
- title: Optional[Annotated[str, Field(strict=True)]] = 'DataToExtract'
- description: Optional[StrictStr] = ''
- type: Optional[StrictStr] = 'object'
+ """ # noqa: E501
+
+ title: Optional[Annotated[str, Field(strict=True)]] = "DataToExtract"
+ description: Optional[StrictStr] = ""
+ type: Optional[StrictStr] = "object"
properties: Dict[str, Dict[str, Any]]
required: Optional[List[StrictStr]] = None
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["title", "description", "type", "properties", "required"]
-
- @field_validator('title')
+ __properties: ClassVar[List[str]] = [
+ "title",
+ "description",
+ "type",
+ "properties",
+ "required",
+ ]
+
+ @field_validator("title")
def title_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
@@ -45,13 +51,13 @@ def title_validate_regular_expression(cls, value):
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9_-]+$/")
return value
- @field_validator('type')
+ @field_validator("type")
def type_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
- if value not in set(['object']):
+ if value not in set(["object"]):
raise ValueError("must be one of enum values ('object')")
return value
@@ -61,7 +67,6 @@ def type_validate_enum(cls, value):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -87,9 +92,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -112,18 +119,22 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "title": obj.get("title") if obj.get("title") is not None else 'DataToExtract',
- "description": obj.get("description") if obj.get("description") is not None else '',
- "type": obj.get("type") if obj.get("type") is not None else 'object',
- "properties": obj.get("properties"),
- "required": obj.get("required")
- })
+ _obj = cls.model_validate(
+ {
+ "title": obj.get("title")
+ if obj.get("title") is not None
+ else "DataToExtract",
+ "description": obj.get("description")
+ if obj.get("description") is not None
+ else "",
+ "type": obj.get("type") if obj.get("type") is not None else "object",
+ "properties": obj.get("properties"),
+ "required": obj.get("required"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto.py
index 89e1e4f1..f08d1971 100644
--- a/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto.py
@@ -1,34 +1,38 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
-from typing import Any, ClassVar, Dict, List
-from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data import LeaseRunnerJobResponseDtoData
-from askui.tools.askui.askui_workspaces.models.runner_job_status import RunnerJobStatus
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data import (
+ LeaseRunnerJobResponseDtoData,
+)
+from askui.tools.askui.askui_workspaces.models.runner_job_status import RunnerJobStatus
+
+
class LeaseRunnerJobResponseDto(BaseModel):
"""
LeaseRunnerJobResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
id: StrictStr
ack: StrictStr
status: RunnerJobStatus
@@ -37,7 +41,15 @@ class LeaseRunnerJobResponseDto(BaseModel):
tries: StrictInt
data: LeaseRunnerJobResponseDtoData
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "ack", "status", "visible", "runner_id", "tries", "data"]
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "ack",
+ "status",
+ "visible",
+ "runner_id",
+ "tries",
+ "data",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -45,7 +57,6 @@ class LeaseRunnerJobResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -71,9 +82,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -82,7 +95,7 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of data
if self.data:
- _dict['data'] = self.data.to_dict()
+ _dict["data"] = self.data.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -99,20 +112,22 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "ack": obj.get("ack"),
- "status": obj.get("status"),
- "visible": obj.get("visible"),
- "runner_id": obj.get("runner_id"),
- "tries": obj.get("tries"),
- "data": LeaseRunnerJobResponseDtoData.from_dict(obj["data"]) if obj.get("data") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "ack": obj.get("ack"),
+ "status": obj.get("status"),
+ "visible": obj.get("visible"),
+ "runner_id": obj.get("runner_id"),
+ "tries": obj.get("tries"),
+ "data": LeaseRunnerJobResponseDtoData.from_dict(obj["data"])
+ if obj.get("data") is not None
+ else None,
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto_data.py b/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto_data.py
index 38ce26da..1f33d6cc 100644
--- a/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto_data.py
+++ b/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto_data.py
@@ -1,32 +1,36 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data_credentials import LeaseRunnerJobResponseDtoDataCredentials
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data_credentials import (
+ LeaseRunnerJobResponseDtoDataCredentials,
+)
+
+
class LeaseRunnerJobResponseDtoData(BaseModel):
"""
LeaseRunnerJobResponseDtoData
- """ # noqa: E501
+ """ # noqa: E501
+
credentials: LeaseRunnerJobResponseDtoDataCredentials
workflows: Optional[List[StrictStr]]
schedule_results_api_url: StrictStr
@@ -35,7 +39,15 @@ class LeaseRunnerJobResponseDtoData(BaseModel):
inference_api_url: StrictStr
data: Optional[Dict[str, Any]] = None
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["credentials", "workflows", "schedule_results_api_url", "results_api_url", "workflows_api_url", "inference_api_url", "data"]
+ __properties: ClassVar[List[str]] = [
+ "credentials",
+ "workflows",
+ "schedule_results_api_url",
+ "results_api_url",
+ "workflows_api_url",
+ "inference_api_url",
+ "data",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -43,7 +55,6 @@ class LeaseRunnerJobResponseDtoData(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -69,9 +80,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -80,7 +93,7 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of credentials
if self.credentials:
- _dict['credentials'] = self.credentials.to_dict()
+ _dict["credentials"] = self.credentials.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -89,7 +102,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if workflows (nullable) is None
# and model_fields_set contains the field
if self.workflows is None and "workflows" in self.model_fields_set:
- _dict['workflows'] = None
+ _dict["workflows"] = None
return _dict
@@ -102,20 +115,24 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "credentials": LeaseRunnerJobResponseDtoDataCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None,
- "workflows": obj.get("workflows"),
- "schedule_results_api_url": obj.get("schedule_results_api_url"),
- "results_api_url": obj.get("results_api_url"),
- "workflows_api_url": obj.get("workflows_api_url"),
- "inference_api_url": obj.get("inference_api_url"),
- "data": obj.get("data")
- })
+ _obj = cls.model_validate(
+ {
+ "credentials": LeaseRunnerJobResponseDtoDataCredentials.from_dict(
+ obj["credentials"]
+ )
+ if obj.get("credentials") is not None
+ else None,
+ "workflows": obj.get("workflows"),
+ "schedule_results_api_url": obj.get("schedule_results_api_url"),
+ "results_api_url": obj.get("results_api_url"),
+ "workflows_api_url": obj.get("workflows_api_url"),
+ "inference_api_url": obj.get("inference_api_url"),
+ "data": obj.get("data"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto_data_credentials.py b/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto_data_credentials.py
index bd380eb9..6639c8b7 100644
--- a/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto_data_credentials.py
+++ b/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto_data_credentials.py
@@ -1,31 +1,32 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, StrictStr
-from typing import Any, ClassVar, Dict, List
-from typing import Optional, Set
from typing_extensions import Self
+
class LeaseRunnerJobResponseDtoDataCredentials(BaseModel):
"""
LeaseRunnerJobResponseDtoDataCredentials
- """ # noqa: E501
+ """ # noqa: E501
+
workspace_id: StrictStr
access_token: StrictStr
additional_properties: Dict[str, Any] = {}
@@ -37,7 +38,6 @@ class LeaseRunnerJobResponseDtoDataCredentials(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -63,9 +63,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -88,15 +90,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "workspace_id": obj.get("workspace_id"),
- "access_token": obj.get("access_token")
- })
+ _obj = cls.model_validate(
+ {
+ "workspace_id": obj.get("workspace_id"),
+ "access_token": obj.get("access_token"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/list_access_token_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/list_access_token_response_dto.py
index 67cac6f0..6aa6a5a7 100644
--- a/src/askui/tools/askui/askui_workspaces/models/list_access_token_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/list_access_token_response_dto.py
@@ -1,32 +1,33 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class ListAccessTokenResponseDto(BaseModel):
"""
ListAccessTokenResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
id: StrictStr
name: StrictStr
created_at: datetime = Field(alias="createdAt")
@@ -40,7 +41,6 @@ class ListAccessTokenResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -66,9 +66,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -83,7 +85,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if expires_at (nullable) is None
# and model_fields_set contains the field
if self.expires_at is None and "expires_at" in self.model_fields_set:
- _dict['expiresAt'] = None
+ _dict["expiresAt"] = None
return _dict
@@ -96,17 +98,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "name": obj.get("name"),
- "createdAt": obj.get("createdAt"),
- "expiresAt": obj.get("expiresAt")
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "name": obj.get("name"),
+ "createdAt": obj.get("createdAt"),
+ "expiresAt": obj.get("expiresAt"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/list_runs_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/list_runs_response_dto.py
index 890a8714..d93f8746 100644
--- a/src/askui/tools/askui/askui_workspaces/models/list_runs_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/list_runs_response_dto.py
@@ -1,32 +1,34 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict
-from typing import Any, ClassVar, Dict, List
-from askui.tools.askui.askui_workspaces.models.run_response_dto import RunResponseDto
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.run_response_dto import RunResponseDto
+
+
class ListRunsResponseDto(BaseModel):
"""
ListRunsResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
data: List[RunResponseDto]
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["data"]
@@ -37,7 +39,6 @@ class ListRunsResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -63,9 +64,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -78,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.data:
if _item:
_items.append(_item.to_dict())
- _dict['data'] = _items
+ _dict["data"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -95,14 +98,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "data": [RunResponseDto.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "data": [RunResponseDto.from_dict(_item) for _item in obj["data"]]
+ if obj.get("data") is not None
+ else None
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/list_subject_access_tokens_response_dto_input.py b/src/askui/tools/askui/askui_workspaces/models/list_subject_access_tokens_response_dto_input.py
index 88e2518d..1f6f6cf9 100644
--- a/src/askui/tools/askui/askui_workspaces/models/list_subject_access_tokens_response_dto_input.py
+++ b/src/askui/tools/askui/askui_workspaces/models/list_subject_access_tokens_response_dto_input.py
@@ -1,32 +1,36 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict
-from typing import Any, ClassVar, Dict, List
-from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_input import SubjectAccessTokenResponseDtoInput
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_input import (
+ SubjectAccessTokenResponseDtoInput,
+)
+
+
class ListSubjectAccessTokensResponseDtoInput(BaseModel):
"""
ListSubjectAccessTokensResponseDtoInput
- """ # noqa: E501
+ """ # noqa: E501
+
data: List[SubjectAccessTokenResponseDtoInput]
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["data"]
@@ -37,7 +41,6 @@ class ListSubjectAccessTokensResponseDtoInput(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -63,9 +66,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -78,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.data:
if _item:
_items.append(_item.to_dict())
- _dict['data'] = _items
+ _dict["data"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -95,14 +100,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "data": [SubjectAccessTokenResponseDtoInput.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "data": [
+ SubjectAccessTokenResponseDtoInput.from_dict(_item)
+ for _item in obj["data"]
+ ]
+ if obj.get("data") is not None
+ else None
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/list_subject_access_tokens_response_dto_output.py b/src/askui/tools/askui/askui_workspaces/models/list_subject_access_tokens_response_dto_output.py
index 64bc0b8d..6b36098f 100644
--- a/src/askui/tools/askui/askui_workspaces/models/list_subject_access_tokens_response_dto_output.py
+++ b/src/askui/tools/askui/askui_workspaces/models/list_subject_access_tokens_response_dto_output.py
@@ -1,32 +1,36 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict
-from typing import Any, ClassVar, Dict, List
-from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_output import SubjectAccessTokenResponseDtoOutput
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_output import (
+ SubjectAccessTokenResponseDtoOutput,
+)
+
+
class ListSubjectAccessTokensResponseDtoOutput(BaseModel):
"""
ListSubjectAccessTokensResponseDtoOutput
- """ # noqa: E501
+ """ # noqa: E501
+
data: List[SubjectAccessTokenResponseDtoOutput]
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["data"]
@@ -37,7 +41,6 @@ class ListSubjectAccessTokensResponseDtoOutput(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -63,9 +66,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -78,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.data:
if _item:
_items.append(_item.to_dict())
- _dict['data'] = _items
+ _dict["data"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -95,14 +100,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "data": [SubjectAccessTokenResponseDtoOutput.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "data": [
+ SubjectAccessTokenResponseDtoOutput.from_dict(_item)
+ for _item in obj["data"]
+ ]
+ if obj.get("data") is not None
+ else None
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/lookup_access_token_command.py b/src/askui/tools/askui/askui_workspaces/models/lookup_access_token_command.py
index 44590bac..e4168c75 100644
--- a/src/askui/tools/askui/askui_workspaces/models/lookup_access_token_command.py
+++ b/src/askui/tools/askui/askui_workspaces/models/lookup_access_token_command.py
@@ -1,33 +1,35 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field
-from typing import Any, ClassVar, Dict, List
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
+from typing_extensions import Annotated, Self
+
class LookupAccessTokenCommand(BaseModel):
"""
LookupAccessTokenCommand
- """ # noqa: E501
- access_token: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="accessToken")
+ """ # noqa: E501
+
+ access_token: Annotated[str, Field(min_length=1, strict=True)] = Field(
+ alias="accessToken"
+ )
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["accessToken"]
@@ -37,7 +39,6 @@ class LookupAccessTokenCommand(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -63,9 +64,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -88,14 +91,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "accessToken": obj.get("accessToken")
- })
+ _obj = cls.model_validate({"accessToken": obj.get("accessToken")})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/lookup_access_token_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/lookup_access_token_response_dto.py
index 5b89476a..77f7d4c7 100644
--- a/src/askui/tools/askui/askui_workspaces/models/lookup_access_token_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/lookup_access_token_response_dto.py
@@ -1,31 +1,32 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List
-from typing import Optional, Set
from typing_extensions import Self
+
class LookupAccessTokenResponseDto(BaseModel):
"""
LookupAccessTokenResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
access_token_id: StrictStr = Field(alias="accessTokenId")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["accessTokenId"]
@@ -36,7 +37,6 @@ class LookupAccessTokenResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -62,9 +62,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -87,14 +89,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "accessTokenId": obj.get("accessTokenId")
- })
+ _obj = cls.model_validate({"accessTokenId": obj.get("accessTokenId")})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/lookup_workspace_access_token_command.py b/src/askui/tools/askui/askui_workspaces/models/lookup_workspace_access_token_command.py
index cd302326..745ac73c 100644
--- a/src/askui/tools/askui/askui_workspaces/models/lookup_workspace_access_token_command.py
+++ b/src/askui/tools/askui/askui_workspaces/models/lookup_workspace_access_token_command.py
@@ -1,33 +1,35 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field
-from typing import Any, ClassVar, Dict, List
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
+from typing_extensions import Annotated, Self
+
class LookupWorkspaceAccessTokenCommand(BaseModel):
"""
LookupWorkspaceAccessTokenCommand
- """ # noqa: E501
- access_token: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="accessToken")
+ """ # noqa: E501
+
+ access_token: Annotated[str, Field(min_length=1, strict=True)] = Field(
+ alias="accessToken"
+ )
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["accessToken"]
@@ -37,7 +39,6 @@ class LookupWorkspaceAccessTokenCommand(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -63,9 +64,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -88,14 +91,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "accessToken": obj.get("accessToken")
- })
+ _obj = cls.model_validate({"accessToken": obj.get("accessToken")})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/lookup_workspace_access_token_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/lookup_workspace_access_token_response_dto.py
index 5b6856bc..cb430407 100644
--- a/src/askui/tools/askui/askui_workspaces/models/lookup_workspace_access_token_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/lookup_workspace_access_token_response_dto.py
@@ -1,31 +1,32 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List
-from typing import Optional, Set
from typing_extensions import Self
+
class LookupWorkspaceAccessTokenResponseDto(BaseModel):
"""
LookupWorkspaceAccessTokenResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
access_token_id: StrictStr = Field(alias="accessTokenId")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["accessTokenId"]
@@ -36,7 +37,6 @@ class LookupWorkspaceAccessTokenResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -62,9 +62,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -87,14 +89,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "accessTokenId": obj.get("accessTokenId")
- })
+ _obj = cls.model_validate({"accessTokenId": obj.get("accessTokenId")})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/ping_runner_job_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/ping_runner_job_response_dto.py
index c490723a..96347627 100644
--- a/src/askui/tools/askui/askui_workspaces/models/ping_runner_job_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/ping_runner_job_response_dto.py
@@ -1,32 +1,33 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, StrictBool
-from typing import Any, ClassVar, Dict, List
-from typing import Optional, Set
from typing_extensions import Self
+
class PingRunnerJobResponseDto(BaseModel):
"""
PingRunnerJobResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
visible: datetime
cancel_job: StrictBool
additional_properties: Dict[str, Any] = {}
@@ -38,7 +39,6 @@ class PingRunnerJobResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -64,9 +64,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -89,15 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "visible": obj.get("visible"),
- "cancel_job": obj.get("cancel_job")
- })
+ _obj = cls.model_validate(
+ {"visible": obj.get("visible"), "cancel_job": obj.get("cancel_job")}
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/run_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/run_response_dto.py
index d0c47840..10862d49 100644
--- a/src/askui/tools/askui/askui_workspaces/models/run_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/run_response_dto.py
@@ -1,35 +1,39 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
+from typing_extensions import Self
+
from askui.tools.askui.askui_workspaces.models.run_status import RunStatus
from askui.tools.askui.askui_workspaces.models.run_template import RunTemplate
-from askui.tools.askui.askui_workspaces.models.schedule_reponse_dto import ScheduleReponseDto
-from typing import Optional, Set
-from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.schedule_reponse_dto import (
+ ScheduleReponseDto,
+)
+
class RunResponseDto(BaseModel):
"""
RunResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
version: Optional[StrictStr] = None
id: Optional[StrictStr] = None
created_at: Optional[datetime] = None
@@ -43,7 +47,20 @@ class RunResponseDto(BaseModel):
no: StrictInt
schedule: ScheduleReponseDto
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["version", "id", "created_at", "name", "status", "to_be_started_at", "started_at", "schedule_id", "template", "ended_at", "no", "schedule"]
+ __properties: ClassVar[List[str]] = [
+ "version",
+ "id",
+ "created_at",
+ "name",
+ "status",
+ "to_be_started_at",
+ "started_at",
+ "schedule_id",
+ "template",
+ "ended_at",
+ "no",
+ "schedule",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -51,7 +68,6 @@ class RunResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -77,9 +93,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -88,10 +106,10 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of template
if self.template:
- _dict['template'] = self.template.to_dict()
+ _dict["template"] = self.template.to_dict()
# override the default output from pydantic by calling `to_dict()` of schedule
if self.schedule:
- _dict['schedule'] = self.schedule.to_dict()
+ _dict["schedule"] = self.schedule.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -100,12 +118,12 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if started_at (nullable) is None
# and model_fields_set contains the field
if self.started_at is None and "started_at" in self.model_fields_set:
- _dict['started_at'] = None
+ _dict["started_at"] = None
# set to None if ended_at (nullable) is None
# and model_fields_set contains the field
if self.ended_at is None and "ended_at" in self.model_fields_set:
- _dict['ended_at'] = None
+ _dict["ended_at"] = None
return _dict
@@ -118,25 +136,29 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "version": obj.get("version"),
- "id": obj.get("id"),
- "created_at": obj.get("created_at"),
- "name": obj.get("name"),
- "status": obj.get("status"),
- "to_be_started_at": obj.get("to_be_started_at"),
- "started_at": obj.get("started_at"),
- "schedule_id": obj.get("schedule_id"),
- "template": RunTemplate.from_dict(obj["template"]) if obj.get("template") is not None else None,
- "ended_at": obj.get("ended_at"),
- "no": obj.get("no"),
- "schedule": ScheduleReponseDto.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "version": obj.get("version"),
+ "id": obj.get("id"),
+ "created_at": obj.get("created_at"),
+ "name": obj.get("name"),
+ "status": obj.get("status"),
+ "to_be_started_at": obj.get("to_be_started_at"),
+ "started_at": obj.get("started_at"),
+ "schedule_id": obj.get("schedule_id"),
+ "template": RunTemplate.from_dict(obj["template"])
+ if obj.get("template") is not None
+ else None,
+ "ended_at": obj.get("ended_at"),
+ "no": obj.get("no"),
+ "schedule": ScheduleReponseDto.from_dict(obj["schedule"])
+ if obj.get("schedule") is not None
+ else None,
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/run_status.py b/src/askui/tools/askui/askui_workspaces/models/run_status.py
index 027efe4b..25bca560 100644
--- a/src/askui/tools/askui/askui_workspaces/models/run_status.py
+++ b/src/askui/tools/askui/askui_workspaces/models/run_status.py
@@ -1,20 +1,21 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
import json
from enum import Enum
+
from typing_extensions import Self
@@ -26,21 +27,19 @@ class RunStatus(str, Enum):
"""
allowed enum values
"""
- UPCOMING = 'UPCOMING'
- PENDING = 'PENDING'
- RUNNING = 'RUNNING'
- SKIPPED = 'SKIPPED'
- SKIPPED_NOTHING_TO_RUN = 'SKIPPED_NOTHING_TO_RUN'
- PASSED_NOT_YET_REPORTED = 'PASSED_NOT_YET_REPORTED'
- FAILED_NOT_YET_REPORTED = 'FAILED_NOT_YET_REPORTED'
- PASSED = 'PASSED'
- FAILED = 'FAILED'
- CANCELED = 'CANCELED'
- SUSPENDED = 'SUSPENDED'
+ UPCOMING = "UPCOMING"
+ PENDING = "PENDING"
+ RUNNING = "RUNNING"
+ SKIPPED = "SKIPPED"
+ SKIPPED_NOTHING_TO_RUN = "SKIPPED_NOTHING_TO_RUN"
+ PASSED_NOT_YET_REPORTED = "PASSED_NOT_YET_REPORTED"
+ FAILED_NOT_YET_REPORTED = "FAILED_NOT_YET_REPORTED"
+ PASSED = "PASSED"
+ FAILED = "FAILED"
+ CANCELED = "CANCELED"
+ SUSPENDED = "SUSPENDED"
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of RunStatus from a JSON string"""
return cls(json.loads(json_str))
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/run_template.py b/src/askui/tools/askui/askui_workspaces/models/run_template.py
index 1a3e0ad3..312795a6 100644
--- a/src/askui/tools/askui/askui_workspaces/models/run_template.py
+++ b/src/askui/tools/askui/askui_workspaces/models/run_template.py
@@ -1,38 +1,45 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.runner_assignment import RunnerAssignment
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.runner_assignment import RunnerAssignment
+
+
class RunTemplate(BaseModel):
"""
RunTemplate
- """ # noqa: E501
+ """ # noqa: E501
+
workspace_id: StrictStr
workflows: Optional[List[StrictStr]] = None
runner_assignment: RunnerAssignment
data: Optional[Dict[str, Any]] = None
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["workspace_id", "workflows", "runner_assignment", "data"]
+ __properties: ClassVar[List[str]] = [
+ "workspace_id",
+ "workflows",
+ "runner_assignment",
+ "data",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -40,7 +47,6 @@ class RunTemplate(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -66,9 +72,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -77,7 +85,7 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of runner_assignment
if self.runner_assignment:
- _dict['runner_assignment'] = self.runner_assignment.to_dict()
+ _dict["runner_assignment"] = self.runner_assignment.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -86,7 +94,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if workflows (nullable) is None
# and model_fields_set contains the field
if self.workflows is None and "workflows" in self.model_fields_set:
- _dict['workflows'] = None
+ _dict["workflows"] = None
return _dict
@@ -99,17 +107,21 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "workspace_id": obj.get("workspace_id"),
- "workflows": obj.get("workflows"),
- "runner_assignment": RunnerAssignment.from_dict(obj["runner_assignment"]) if obj.get("runner_assignment") is not None else None,
- "data": obj.get("data")
- })
+ _obj = cls.model_validate(
+ {
+ "workspace_id": obj.get("workspace_id"),
+ "workflows": obj.get("workflows"),
+ "runner_assignment": RunnerAssignment.from_dict(
+ obj["runner_assignment"]
+ )
+ if obj.get("runner_assignment") is not None
+ else None,
+ "data": obj.get("data"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/run_template_base.py b/src/askui/tools/askui/askui_workspaces/models/run_template_base.py
index 49f5cbf2..f5feb273 100644
--- a/src/askui/tools/askui/askui_workspaces/models/run_template_base.py
+++ b/src/askui/tools/askui/askui_workspaces/models/run_template_base.py
@@ -1,38 +1,45 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.24
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.24
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.runner_assignment import RunnerAssignment
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.runner_assignment import RunnerAssignment
+
+
class RunTemplateBase(BaseModel):
"""
RunTemplateBase
- """ # noqa: E501
+ """ # noqa: E501
+
workspace_id: StrictStr
workflows: List[StrictStr]
runner_assignment: RunnerAssignment
data: Optional[Dict[str, Any]] = None
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["workspace_id", "workflows", "runner_assignment", "data"]
+ __properties: ClassVar[List[str]] = [
+ "workspace_id",
+ "workflows",
+ "runner_assignment",
+ "data",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -40,7 +47,6 @@ class RunTemplateBase(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -66,9 +72,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -77,7 +85,7 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of runner_assignment
if self.runner_assignment:
- _dict['runner_assignment'] = self.runner_assignment.to_dict()
+ _dict["runner_assignment"] = self.runner_assignment.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -94,17 +102,21 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "workspace_id": obj.get("workspace_id"),
- "workflows": obj.get("workflows"),
- "runner_assignment": RunnerAssignment.from_dict(obj["runner_assignment"]) if obj.get("runner_assignment") is not None else None,
- "data": obj.get("data")
- })
+ _obj = cls.model_validate(
+ {
+ "workspace_id": obj.get("workspace_id"),
+ "workflows": obj.get("workflows"),
+ "runner_assignment": RunnerAssignment.from_dict(
+ obj["runner_assignment"]
+ )
+ if obj.get("runner_assignment") is not None
+ else None,
+ "data": obj.get("data"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/runner_assignment.py b/src/askui/tools/askui/askui_workspaces/models/runner_assignment.py
index aef2a941..e55a7f78 100644
--- a/src/askui/tools/askui/askui_workspaces/models/runner_assignment.py
+++ b/src/askui/tools/askui/askui_workspaces/models/runner_assignment.py
@@ -1,32 +1,34 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.runner_host import RunnerHost
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.runner_host import RunnerHost
+
+
class RunnerAssignment(BaseModel):
"""
RunnerAssignment
- """ # noqa: E501
+ """ # noqa: E501
+
ids: Optional[List[StrictStr]] = None
host: RunnerHost
tags: Optional[List[StrictStr]] = None
@@ -39,7 +41,6 @@ class RunnerAssignment(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -65,9 +66,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -90,16 +93,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "ids": obj.get("ids"),
- "host": obj.get("host"),
- "tags": obj.get("tags")
- })
+ _obj = cls.model_validate(
+ {"ids": obj.get("ids"), "host": obj.get("host"), "tags": obj.get("tags")}
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/runner_host.py b/src/askui/tools/askui/askui_workspaces/models/runner_host.py
index 62bb4fcd..d44cc300 100644
--- a/src/askui/tools/askui/askui_workspaces/models/runner_host.py
+++ b/src/askui/tools/askui/askui_workspaces/models/runner_host.py
@@ -1,20 +1,21 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
import json
from enum import Enum
+
from typing_extensions import Self
@@ -26,12 +27,10 @@ class RunnerHost(str, Enum):
"""
allowed enum values
"""
- SELF = 'SELF'
- ASKUI = 'ASKUI'
+ SELF = "SELF"
+ ASKUI = "ASKUI"
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of RunnerHost from a JSON string"""
return cls(json.loads(json_str))
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/runner_job_status.py b/src/askui/tools/askui/askui_workspaces/models/runner_job_status.py
index 5f9930ec..43190552 100644
--- a/src/askui/tools/askui/askui_workspaces/models/runner_job_status.py
+++ b/src/askui/tools/askui/askui_workspaces/models/runner_job_status.py
@@ -1,20 +1,21 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
import json
from enum import Enum
+
from typing_extensions import Self
@@ -26,16 +27,14 @@ class RunnerJobStatus(str, Enum):
"""
allowed enum values
"""
- PENDING = 'PENDING'
- RUNNING = 'RUNNING'
- PASSED = 'PASSED'
- FAILED = 'FAILED'
- CANCELED = 'CANCELED'
- MAX_RETRIES_EXCEEDED = 'MAX_RETRIES_EXCEEDED'
+ PENDING = "PENDING"
+ RUNNING = "RUNNING"
+ PASSED = "PASSED"
+ FAILED = "FAILED"
+ CANCELED = "CANCELED"
+ MAX_RETRIES_EXCEEDED = "MAX_RETRIES_EXCEEDED"
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of RunnerJobStatus from a JSON string"""
return cls(json.loads(json_str))
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/schedule_reponse_dto.py b/src/askui/tools/askui/askui_workspaces/models/schedule_reponse_dto.py
index fcb7c16e..1c898787 100644
--- a/src/askui/tools/askui/askui_workspaces/models/schedule_reponse_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/schedule_reponse_dto.py
@@ -1,34 +1,36 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
+from typing_extensions import Self
+
from askui.tools.askui.askui_workspaces.models.run_template import RunTemplate
from askui.tools.askui.askui_workspaces.models.schedule_status import ScheduleStatus
-from typing import Optional, Set
-from typing_extensions import Self
+
class ScheduleReponseDto(BaseModel):
"""
ScheduleReponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
version: Optional[StrictStr] = None
id: Optional[StrictStr] = None
created_at: Optional[datetime] = None
@@ -42,7 +44,20 @@ class ScheduleReponseDto(BaseModel):
runs_count: Optional[StrictInt] = 0
next_run_to_be_started_at: Optional[datetime] = None
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["version", "id", "created_at", "name", "status", "started_at", "ended_at", "schedule", "ended_after", "run_template", "runs_count", "next_run_to_be_started_at"]
+ __properties: ClassVar[List[str]] = [
+ "version",
+ "id",
+ "created_at",
+ "name",
+ "status",
+ "started_at",
+ "ended_at",
+ "schedule",
+ "ended_after",
+ "run_template",
+ "runs_count",
+ "next_run_to_be_started_at",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -50,7 +65,6 @@ class ScheduleReponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -76,9 +90,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -87,7 +103,7 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of run_template
if self.run_template:
- _dict['run_template'] = self.run_template.to_dict()
+ _dict["run_template"] = self.run_template.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -96,22 +112,25 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if ended_at (nullable) is None
# and model_fields_set contains the field
if self.ended_at is None and "ended_at" in self.model_fields_set:
- _dict['ended_at'] = None
+ _dict["ended_at"] = None
# set to None if schedule (nullable) is None
# and model_fields_set contains the field
if self.schedule is None and "schedule" in self.model_fields_set:
- _dict['schedule'] = None
+ _dict["schedule"] = None
# set to None if ended_after (nullable) is None
# and model_fields_set contains the field
if self.ended_after is None and "ended_after" in self.model_fields_set:
- _dict['ended_after'] = None
+ _dict["ended_after"] = None
# set to None if next_run_to_be_started_at (nullable) is None
# and model_fields_set contains the field
- if self.next_run_to_be_started_at is None and "next_run_to_be_started_at" in self.model_fields_set:
- _dict['next_run_to_be_started_at'] = None
+ if (
+ self.next_run_to_be_started_at is None
+ and "next_run_to_be_started_at" in self.model_fields_set
+ ):
+ _dict["next_run_to_be_started_at"] = None
return _dict
@@ -124,25 +143,29 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "version": obj.get("version"),
- "id": obj.get("id"),
- "created_at": obj.get("created_at"),
- "name": obj.get("name"),
- "status": obj.get("status"),
- "started_at": obj.get("started_at"),
- "ended_at": obj.get("ended_at"),
- "schedule": obj.get("schedule"),
- "ended_after": obj.get("ended_after"),
- "run_template": RunTemplate.from_dict(obj["run_template"]) if obj.get("run_template") is not None else None,
- "runs_count": obj.get("runs_count") if obj.get("runs_count") is not None else 0,
- "next_run_to_be_started_at": obj.get("next_run_to_be_started_at")
- })
+ _obj = cls.model_validate(
+ {
+ "version": obj.get("version"),
+ "id": obj.get("id"),
+ "created_at": obj.get("created_at"),
+ "name": obj.get("name"),
+ "status": obj.get("status"),
+ "started_at": obj.get("started_at"),
+ "ended_at": obj.get("ended_at"),
+ "schedule": obj.get("schedule"),
+ "ended_after": obj.get("ended_after"),
+ "run_template": RunTemplate.from_dict(obj["run_template"])
+ if obj.get("run_template") is not None
+ else None,
+ "runs_count": obj.get("runs_count")
+ if obj.get("runs_count") is not None
+ else 0,
+ "next_run_to_be_started_at": obj.get("next_run_to_be_started_at"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/schedule_status.py b/src/askui/tools/askui/askui_workspaces/models/schedule_status.py
index 5ecede96..65d6cd5f 100644
--- a/src/askui/tools/askui/askui_workspaces/models/schedule_status.py
+++ b/src/askui/tools/askui/askui_workspaces/models/schedule_status.py
@@ -1,20 +1,21 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
import json
from enum import Enum
+
from typing_extensions import Self
@@ -26,13 +27,11 @@ class ScheduleStatus(str, Enum):
"""
allowed enum values
"""
- ACTIVE = 'ACTIVE'
- SUSPENDED = 'SUSPENDED'
- ENDED = 'ENDED'
+ ACTIVE = "ACTIVE"
+ SUSPENDED = "SUSPENDED"
+ ENDED = "ENDED"
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of ScheduleStatus from a JSON string"""
return cls(json.loads(json_str))
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/state.py b/src/askui/tools/askui/askui_workspaces/models/state.py
index c3ed7445..c80054f0 100644
--- a/src/askui/tools/askui/askui_workspaces/models/state.py
+++ b/src/askui/tools/askui/askui_workspaces/models/state.py
@@ -1,38 +1,64 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
import json
import pprint
-from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
-from typing import Any, List, Optional
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_canceled import AgentExecutionStateCanceled
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_confirmed import AgentExecutionStateConfirmed
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_output import AgentExecutionStateDeliveredToDestinationOutput
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_data_extraction import AgentExecutionStatePendingDataExtraction
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_inputs import AgentExecutionStatePendingInputs
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_review import AgentExecutionStatePendingReview
-from pydantic import StrictStr, Field
-from typing import Union, List, Set, Optional, Dict
-from typing_extensions import Literal, Self
-
-STATE_ONE_OF_SCHEMAS = ["AgentExecutionStateCanceled", "AgentExecutionStateConfirmed", "AgentExecutionStateDeliveredToDestinationOutput", "AgentExecutionStatePendingDataExtraction", "AgentExecutionStatePendingInputs", "AgentExecutionStatePendingReview"]
+from typing import Any, Dict, Optional, Set, Union
+
+from pydantic import (
+ BaseModel,
+ ConfigDict,
+ ValidationError,
+ field_validator,
+)
+from typing_extensions import Self
+
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_canceled import (
+ AgentExecutionStateCanceled,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_confirmed import (
+ AgentExecutionStateConfirmed,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_output import (
+ AgentExecutionStateDeliveredToDestinationOutput,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_data_extraction import (
+ AgentExecutionStatePendingDataExtraction,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_inputs import (
+ AgentExecutionStatePendingInputs,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_review import (
+ AgentExecutionStatePendingReview,
+)
+
+STATE_ONE_OF_SCHEMAS = [
+ "AgentExecutionStateCanceled",
+ "AgentExecutionStateConfirmed",
+ "AgentExecutionStateDeliveredToDestinationOutput",
+ "AgentExecutionStatePendingDataExtraction",
+ "AgentExecutionStatePendingInputs",
+ "AgentExecutionStatePendingReview",
+]
+
class State(BaseModel):
"""
State
"""
+
# data type: AgentExecutionStatePendingInputs
oneof_schema_1_validator: Optional[AgentExecutionStatePendingInputs] = None
# data type: AgentExecutionStatePendingDataExtraction
@@ -44,72 +70,109 @@ class State(BaseModel):
# data type: AgentExecutionStateConfirmed
oneof_schema_5_validator: Optional[AgentExecutionStateConfirmed] = None
# data type: AgentExecutionStateDeliveredToDestinationOutput
- oneof_schema_6_validator: Optional[AgentExecutionStateDeliveredToDestinationOutput] = None
- actual_instance: Optional[Union[AgentExecutionStateCanceled, AgentExecutionStateConfirmed, AgentExecutionStateDeliveredToDestinationOutput, AgentExecutionStatePendingDataExtraction, AgentExecutionStatePendingInputs, AgentExecutionStatePendingReview]] = None
- one_of_schemas: Set[str] = { "AgentExecutionStateCanceled", "AgentExecutionStateConfirmed", "AgentExecutionStateDeliveredToDestinationOutput", "AgentExecutionStatePendingDataExtraction", "AgentExecutionStatePendingInputs", "AgentExecutionStatePendingReview" }
+ oneof_schema_6_validator: Optional[
+ AgentExecutionStateDeliveredToDestinationOutput
+ ] = None
+ actual_instance: Optional[
+ Union[
+ AgentExecutionStateCanceled,
+ AgentExecutionStateConfirmed,
+ AgentExecutionStateDeliveredToDestinationOutput,
+ AgentExecutionStatePendingDataExtraction,
+ AgentExecutionStatePendingInputs,
+ AgentExecutionStatePendingReview,
+ ]
+ ] = None
+ one_of_schemas: Set[str] = {
+ "AgentExecutionStateCanceled",
+ "AgentExecutionStateConfirmed",
+ "AgentExecutionStateDeliveredToDestinationOutput",
+ "AgentExecutionStatePendingDataExtraction",
+ "AgentExecutionStatePendingInputs",
+ "AgentExecutionStatePendingReview",
+ }
model_config = ConfigDict(
validate_assignment=True,
protected_namespaces=(),
)
-
- discriminator_value_class_map: Dict[str, str] = {
- }
+ discriminator_value_class_map: Dict[str, str] = {}
def __init__(self, *args, **kwargs) -> None:
if args:
if len(args) > 1:
- raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ raise ValueError(
+ "If a position argument is used, only 1 is allowed to set `actual_instance`"
+ )
if kwargs:
- raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ raise ValueError(
+ "If a position argument is used, keyword arguments cannot be used."
+ )
super().__init__(actual_instance=args[0])
else:
super().__init__(**kwargs)
- @field_validator('actual_instance')
+ @field_validator("actual_instance")
def actual_instance_must_validate_oneof(cls, v):
instance = State.model_construct()
error_messages = []
match = 0
# validate data type: AgentExecutionStatePendingInputs
if not isinstance(v, AgentExecutionStatePendingInputs):
- error_messages.append(f"Error! Input type `{type(v)}` is not `AgentExecutionStatePendingInputs`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `AgentExecutionStatePendingInputs`"
+ )
else:
match += 1
# validate data type: AgentExecutionStatePendingDataExtraction
if not isinstance(v, AgentExecutionStatePendingDataExtraction):
- error_messages.append(f"Error! Input type `{type(v)}` is not `AgentExecutionStatePendingDataExtraction`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `AgentExecutionStatePendingDataExtraction`"
+ )
else:
match += 1
# validate data type: AgentExecutionStatePendingReview
if not isinstance(v, AgentExecutionStatePendingReview):
- error_messages.append(f"Error! Input type `{type(v)}` is not `AgentExecutionStatePendingReview`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `AgentExecutionStatePendingReview`"
+ )
else:
match += 1
# validate data type: AgentExecutionStateCanceled
if not isinstance(v, AgentExecutionStateCanceled):
- error_messages.append(f"Error! Input type `{type(v)}` is not `AgentExecutionStateCanceled`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `AgentExecutionStateCanceled`"
+ )
else:
match += 1
# validate data type: AgentExecutionStateConfirmed
if not isinstance(v, AgentExecutionStateConfirmed):
- error_messages.append(f"Error! Input type `{type(v)}` is not `AgentExecutionStateConfirmed`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `AgentExecutionStateConfirmed`"
+ )
else:
match += 1
# validate data type: AgentExecutionStateDeliveredToDestinationOutput
if not isinstance(v, AgentExecutionStateDeliveredToDestinationOutput):
- error_messages.append(f"Error! Input type `{type(v)}` is not `AgentExecutionStateDeliveredToDestinationOutput`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `AgentExecutionStateDeliveredToDestinationOutput`"
+ )
else:
match += 1
if match > 1:
# more than 1 match
- raise ValueError("Multiple matches found when setting `actual_instance` in State with oneOf schemas: AgentExecutionStateCanceled, AgentExecutionStateConfirmed, AgentExecutionStateDeliveredToDestinationOutput, AgentExecutionStatePendingDataExtraction, AgentExecutionStatePendingInputs, AgentExecutionStatePendingReview. Details: " + ", ".join(error_messages))
- elif match == 0:
+ raise ValueError(
+ "Multiple matches found when setting `actual_instance` in State with oneOf schemas: AgentExecutionStateCanceled, AgentExecutionStateConfirmed, AgentExecutionStateDeliveredToDestinationOutput, AgentExecutionStatePendingDataExtraction, AgentExecutionStatePendingInputs, AgentExecutionStatePendingReview. Details: "
+ + ", ".join(error_messages)
+ )
+ if match == 0:
# no match
- raise ValueError("No match found when setting `actual_instance` in State with oneOf schemas: AgentExecutionStateCanceled, AgentExecutionStateConfirmed, AgentExecutionStateDeliveredToDestinationOutput, AgentExecutionStatePendingDataExtraction, AgentExecutionStatePendingInputs, AgentExecutionStatePendingReview. Details: " + ", ".join(error_messages))
- else:
- return v
+ raise ValueError(
+ "No match found when setting `actual_instance` in State with oneOf schemas: AgentExecutionStateCanceled, AgentExecutionStateConfirmed, AgentExecutionStateDeliveredToDestinationOutput, AgentExecutionStatePendingDataExtraction, AgentExecutionStatePendingInputs, AgentExecutionStatePendingReview. Details: "
+ + ", ".join(error_messages)
+ )
+ return v
@classmethod
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
@@ -125,7 +188,9 @@ def from_json(cls, json_str: str) -> Self:
# use oneOf discriminator to lookup the data type
_data_type = json.loads(json_str).get("status")
if not _data_type:
- raise ValueError("Failed to lookup data type from the field `status` in the input.")
+ raise ValueError(
+ "Failed to lookup data type from the field `status` in the input."
+ )
# check if data type is `AgentExecutionStateCanceled`
if _data_type == "CANCELED":
@@ -139,22 +204,30 @@ def from_json(cls, json_str: str) -> Self:
# check if data type is `AgentExecutionStateDeliveredToDestinationOutput`
if _data_type == "DELIVERED_TO_DESTINATION":
- instance.actual_instance = AgentExecutionStateDeliveredToDestinationOutput.from_json(json_str)
+ instance.actual_instance = (
+ AgentExecutionStateDeliveredToDestinationOutput.from_json(json_str)
+ )
return instance
# check if data type is `AgentExecutionStatePendingDataExtraction`
if _data_type == "PENDING_DATA_EXTRACTION":
- instance.actual_instance = AgentExecutionStatePendingDataExtraction.from_json(json_str)
+ instance.actual_instance = (
+ AgentExecutionStatePendingDataExtraction.from_json(json_str)
+ )
return instance
# check if data type is `AgentExecutionStatePendingInputs`
if _data_type == "PENDING_INPUTS":
- instance.actual_instance = AgentExecutionStatePendingInputs.from_json(json_str)
+ instance.actual_instance = AgentExecutionStatePendingInputs.from_json(
+ json_str
+ )
return instance
# check if data type is `AgentExecutionStatePendingReview`
if _data_type == "PENDING_REVIEW":
- instance.actual_instance = AgentExecutionStatePendingReview.from_json(json_str)
+ instance.actual_instance = AgentExecutionStatePendingReview.from_json(
+ json_str
+ )
return instance
# check if data type is `AgentExecutionStateCanceled`
@@ -169,39 +242,53 @@ def from_json(cls, json_str: str) -> Self:
# check if data type is `AgentExecutionStateDeliveredToDestinationOutput`
if _data_type == "AgentExecutionStateDeliveredToDestination-Output":
- instance.actual_instance = AgentExecutionStateDeliveredToDestinationOutput.from_json(json_str)
+ instance.actual_instance = (
+ AgentExecutionStateDeliveredToDestinationOutput.from_json(json_str)
+ )
return instance
# check if data type is `AgentExecutionStatePendingDataExtraction`
if _data_type == "AgentExecutionStatePendingDataExtraction":
- instance.actual_instance = AgentExecutionStatePendingDataExtraction.from_json(json_str)
+ instance.actual_instance = (
+ AgentExecutionStatePendingDataExtraction.from_json(json_str)
+ )
return instance
# check if data type is `AgentExecutionStatePendingInputs`
if _data_type == "AgentExecutionStatePendingInputs":
- instance.actual_instance = AgentExecutionStatePendingInputs.from_json(json_str)
+ instance.actual_instance = AgentExecutionStatePendingInputs.from_json(
+ json_str
+ )
return instance
# check if data type is `AgentExecutionStatePendingReview`
if _data_type == "AgentExecutionStatePendingReview":
- instance.actual_instance = AgentExecutionStatePendingReview.from_json(json_str)
+ instance.actual_instance = AgentExecutionStatePendingReview.from_json(
+ json_str
+ )
return instance
# deserialize data into AgentExecutionStatePendingInputs
try:
- instance.actual_instance = AgentExecutionStatePendingInputs.from_json(json_str)
+ instance.actual_instance = AgentExecutionStatePendingInputs.from_json(
+ json_str
+ )
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into AgentExecutionStatePendingDataExtraction
try:
- instance.actual_instance = AgentExecutionStatePendingDataExtraction.from_json(json_str)
+ instance.actual_instance = (
+ AgentExecutionStatePendingDataExtraction.from_json(json_str)
+ )
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into AgentExecutionStatePendingReview
try:
- instance.actual_instance = AgentExecutionStatePendingReview.from_json(json_str)
+ instance.actual_instance = AgentExecutionStatePendingReview.from_json(
+ json_str
+ )
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
@@ -219,43 +306,62 @@ def from_json(cls, json_str: str) -> Self:
error_messages.append(str(e))
# deserialize data into AgentExecutionStateDeliveredToDestinationOutput
try:
- instance.actual_instance = AgentExecutionStateDeliveredToDestinationOutput.from_json(json_str)
+ instance.actual_instance = (
+ AgentExecutionStateDeliveredToDestinationOutput.from_json(json_str)
+ )
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if match > 1:
# more than 1 match
- raise ValueError("Multiple matches found when deserializing the JSON string into State with oneOf schemas: AgentExecutionStateCanceled, AgentExecutionStateConfirmed, AgentExecutionStateDeliveredToDestinationOutput, AgentExecutionStatePendingDataExtraction, AgentExecutionStatePendingInputs, AgentExecutionStatePendingReview. Details: " + ", ".join(error_messages))
- elif match == 0:
+ raise ValueError(
+ "Multiple matches found when deserializing the JSON string into State with oneOf schemas: AgentExecutionStateCanceled, AgentExecutionStateConfirmed, AgentExecutionStateDeliveredToDestinationOutput, AgentExecutionStatePendingDataExtraction, AgentExecutionStatePendingInputs, AgentExecutionStatePendingReview. Details: "
+ + ", ".join(error_messages)
+ )
+ if match == 0:
# no match
- raise ValueError("No match found when deserializing the JSON string into State with oneOf schemas: AgentExecutionStateCanceled, AgentExecutionStateConfirmed, AgentExecutionStateDeliveredToDestinationOutput, AgentExecutionStatePendingDataExtraction, AgentExecutionStatePendingInputs, AgentExecutionStatePendingReview. Details: " + ", ".join(error_messages))
- else:
- return instance
+ raise ValueError(
+ "No match found when deserializing the JSON string into State with oneOf schemas: AgentExecutionStateCanceled, AgentExecutionStateConfirmed, AgentExecutionStateDeliveredToDestinationOutput, AgentExecutionStatePendingDataExtraction, AgentExecutionStatePendingInputs, AgentExecutionStatePendingReview. Details: "
+ + ", ".join(error_messages)
+ )
+ return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
- if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ if hasattr(self.actual_instance, "to_json") and callable(
+ self.actual_instance.to_json
+ ):
return self.actual_instance.to_json()
- else:
- return json.dumps(self.actual_instance)
-
- def to_dict(self) -> Optional[Union[Dict[str, Any], AgentExecutionStateCanceled, AgentExecutionStateConfirmed, AgentExecutionStateDeliveredToDestinationOutput, AgentExecutionStatePendingDataExtraction, AgentExecutionStatePendingInputs, AgentExecutionStatePendingReview]]:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(
+ self,
+ ) -> Optional[
+ Union[
+ Dict[str, Any],
+ AgentExecutionStateCanceled,
+ AgentExecutionStateConfirmed,
+ AgentExecutionStateDeliveredToDestinationOutput,
+ AgentExecutionStatePendingDataExtraction,
+ AgentExecutionStatePendingInputs,
+ AgentExecutionStatePendingReview,
+ ]
+ ]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
- if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ if hasattr(self.actual_instance, "to_dict") and callable(
+ self.actual_instance.to_dict
+ ):
return self.actual_instance.to_dict()
- else:
- # primitive type
- return self.actual_instance
+ # primitive type
+ return self.actual_instance
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/state1.py b/src/askui/tools/askui/askui_workspaces/models/state1.py
index d3dfeba4..a9cc60af 100644
--- a/src/askui/tools/askui/askui_workspaces/models/state1.py
+++ b/src/askui/tools/askui/askui_workspaces/models/state1.py
@@ -1,36 +1,56 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
import json
import pprint
-from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
-from typing import Any, List, Optional
-from askui.tools.askui.askui_workspaces.models.agent_execution_cancel import AgentExecutionCancel
-from askui.tools.askui.askui_workspaces.models.agent_execution_confirm import AgentExecutionConfirm
-from askui.tools.askui.askui_workspaces.models.agent_execution_pending_review import AgentExecutionPendingReview
-from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input import AgentExecutionStateDeliveredToDestinationInput
-from pydantic import StrictStr, Field
-from typing import Union, List, Set, Optional, Dict
-from typing_extensions import Literal, Self
-
-STATE1_ONE_OF_SCHEMAS = ["AgentExecutionCancel", "AgentExecutionConfirm", "AgentExecutionPendingReview", "AgentExecutionStateDeliveredToDestinationInput"]
+from typing import Any, Dict, Optional, Set, Union
+
+from pydantic import (
+ BaseModel,
+ ConfigDict,
+ ValidationError,
+ field_validator,
+)
+from typing_extensions import Self
+
+from askui.tools.askui.askui_workspaces.models.agent_execution_cancel import (
+ AgentExecutionCancel,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_confirm import (
+ AgentExecutionConfirm,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_pending_review import (
+ AgentExecutionPendingReview,
+)
+from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input import (
+ AgentExecutionStateDeliveredToDestinationInput,
+)
+
+STATE1_ONE_OF_SCHEMAS = [
+ "AgentExecutionCancel",
+ "AgentExecutionConfirm",
+ "AgentExecutionPendingReview",
+ "AgentExecutionStateDeliveredToDestinationInput",
+]
+
class State1(BaseModel):
"""
State1
"""
+
# data type: AgentExecutionPendingReview
oneof_schema_1_validator: Optional[AgentExecutionPendingReview] = None
# data type: AgentExecutionCancel
@@ -38,62 +58,91 @@ class State1(BaseModel):
# data type: AgentExecutionConfirm
oneof_schema_3_validator: Optional[AgentExecutionConfirm] = None
# data type: AgentExecutionStateDeliveredToDestinationInput
- oneof_schema_4_validator: Optional[AgentExecutionStateDeliveredToDestinationInput] = None
- actual_instance: Optional[Union[AgentExecutionCancel, AgentExecutionConfirm, AgentExecutionPendingReview, AgentExecutionStateDeliveredToDestinationInput]] = None
- one_of_schemas: Set[str] = { "AgentExecutionCancel", "AgentExecutionConfirm", "AgentExecutionPendingReview", "AgentExecutionStateDeliveredToDestinationInput" }
+ oneof_schema_4_validator: Optional[
+ AgentExecutionStateDeliveredToDestinationInput
+ ] = None
+ actual_instance: Optional[
+ Union[
+ AgentExecutionCancel,
+ AgentExecutionConfirm,
+ AgentExecutionPendingReview,
+ AgentExecutionStateDeliveredToDestinationInput,
+ ]
+ ] = None
+ one_of_schemas: Set[str] = {
+ "AgentExecutionCancel",
+ "AgentExecutionConfirm",
+ "AgentExecutionPendingReview",
+ "AgentExecutionStateDeliveredToDestinationInput",
+ }
model_config = ConfigDict(
validate_assignment=True,
protected_namespaces=(),
)
-
- discriminator_value_class_map: Dict[str, str] = {
- }
+ discriminator_value_class_map: Dict[str, str] = {}
def __init__(self, *args, **kwargs) -> None:
if args:
if len(args) > 1:
- raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ raise ValueError(
+ "If a position argument is used, only 1 is allowed to set `actual_instance`"
+ )
if kwargs:
- raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ raise ValueError(
+ "If a position argument is used, keyword arguments cannot be used."
+ )
super().__init__(actual_instance=args[0])
else:
super().__init__(**kwargs)
- @field_validator('actual_instance')
+ @field_validator("actual_instance")
def actual_instance_must_validate_oneof(cls, v):
instance = State1.model_construct()
error_messages = []
match = 0
# validate data type: AgentExecutionPendingReview
if not isinstance(v, AgentExecutionPendingReview):
- error_messages.append(f"Error! Input type `{type(v)}` is not `AgentExecutionPendingReview`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `AgentExecutionPendingReview`"
+ )
else:
match += 1
# validate data type: AgentExecutionCancel
if not isinstance(v, AgentExecutionCancel):
- error_messages.append(f"Error! Input type `{type(v)}` is not `AgentExecutionCancel`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `AgentExecutionCancel`"
+ )
else:
match += 1
# validate data type: AgentExecutionConfirm
if not isinstance(v, AgentExecutionConfirm):
- error_messages.append(f"Error! Input type `{type(v)}` is not `AgentExecutionConfirm`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `AgentExecutionConfirm`"
+ )
else:
match += 1
# validate data type: AgentExecutionStateDeliveredToDestinationInput
if not isinstance(v, AgentExecutionStateDeliveredToDestinationInput):
- error_messages.append(f"Error! Input type `{type(v)}` is not `AgentExecutionStateDeliveredToDestinationInput`")
+ error_messages.append(
+ f"Error! Input type `{type(v)}` is not `AgentExecutionStateDeliveredToDestinationInput`"
+ )
else:
match += 1
if match > 1:
# more than 1 match
- raise ValueError("Multiple matches found when setting `actual_instance` in State1 with oneOf schemas: AgentExecutionCancel, AgentExecutionConfirm, AgentExecutionPendingReview, AgentExecutionStateDeliveredToDestinationInput. Details: " + ", ".join(error_messages))
- elif match == 0:
+ raise ValueError(
+ "Multiple matches found when setting `actual_instance` in State1 with oneOf schemas: AgentExecutionCancel, AgentExecutionConfirm, AgentExecutionPendingReview, AgentExecutionStateDeliveredToDestinationInput. Details: "
+ + ", ".join(error_messages)
+ )
+ if match == 0:
# no match
- raise ValueError("No match found when setting `actual_instance` in State1 with oneOf schemas: AgentExecutionCancel, AgentExecutionConfirm, AgentExecutionPendingReview, AgentExecutionStateDeliveredToDestinationInput. Details: " + ", ".join(error_messages))
- else:
- return v
+ raise ValueError(
+ "No match found when setting `actual_instance` in State1 with oneOf schemas: AgentExecutionCancel, AgentExecutionConfirm, AgentExecutionPendingReview, AgentExecutionStateDeliveredToDestinationInput. Details: "
+ + ", ".join(error_messages)
+ )
+ return v
@classmethod
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
@@ -109,7 +158,9 @@ def from_json(cls, json_str: str) -> Self:
# use oneOf discriminator to lookup the data type
_data_type = json.loads(json_str).get("status")
if not _data_type:
- raise ValueError("Failed to lookup data type from the field `status` in the input.")
+ raise ValueError(
+ "Failed to lookup data type from the field `status` in the input."
+ )
# check if data type is `AgentExecutionCancel`
if _data_type == "CANCELED":
@@ -123,7 +174,9 @@ def from_json(cls, json_str: str) -> Self:
# check if data type is `AgentExecutionStateDeliveredToDestinationInput`
if _data_type == "DELIVERED_TO_DESTINATION":
- instance.actual_instance = AgentExecutionStateDeliveredToDestinationInput.from_json(json_str)
+ instance.actual_instance = (
+ AgentExecutionStateDeliveredToDestinationInput.from_json(json_str)
+ )
return instance
# check if data type is `AgentExecutionPendingReview`
@@ -148,7 +201,9 @@ def from_json(cls, json_str: str) -> Self:
# check if data type is `AgentExecutionStateDeliveredToDestinationInput`
if _data_type == "AgentExecutionStateDeliveredToDestination-Input":
- instance.actual_instance = AgentExecutionStateDeliveredToDestinationInput.from_json(json_str)
+ instance.actual_instance = (
+ AgentExecutionStateDeliveredToDestinationInput.from_json(json_str)
+ )
return instance
# deserialize data into AgentExecutionPendingReview
@@ -171,43 +226,60 @@ def from_json(cls, json_str: str) -> Self:
error_messages.append(str(e))
# deserialize data into AgentExecutionStateDeliveredToDestinationInput
try:
- instance.actual_instance = AgentExecutionStateDeliveredToDestinationInput.from_json(json_str)
+ instance.actual_instance = (
+ AgentExecutionStateDeliveredToDestinationInput.from_json(json_str)
+ )
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if match > 1:
# more than 1 match
- raise ValueError("Multiple matches found when deserializing the JSON string into State1 with oneOf schemas: AgentExecutionCancel, AgentExecutionConfirm, AgentExecutionPendingReview, AgentExecutionStateDeliveredToDestinationInput. Details: " + ", ".join(error_messages))
- elif match == 0:
+ raise ValueError(
+ "Multiple matches found when deserializing the JSON string into State1 with oneOf schemas: AgentExecutionCancel, AgentExecutionConfirm, AgentExecutionPendingReview, AgentExecutionStateDeliveredToDestinationInput. Details: "
+ + ", ".join(error_messages)
+ )
+ if match == 0:
# no match
- raise ValueError("No match found when deserializing the JSON string into State1 with oneOf schemas: AgentExecutionCancel, AgentExecutionConfirm, AgentExecutionPendingReview, AgentExecutionStateDeliveredToDestinationInput. Details: " + ", ".join(error_messages))
- else:
- return instance
+ raise ValueError(
+ "No match found when deserializing the JSON string into State1 with oneOf schemas: AgentExecutionCancel, AgentExecutionConfirm, AgentExecutionPendingReview, AgentExecutionStateDeliveredToDestinationInput. Details: "
+ + ", ".join(error_messages)
+ )
+ return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
- if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ if hasattr(self.actual_instance, "to_json") and callable(
+ self.actual_instance.to_json
+ ):
return self.actual_instance.to_json()
- else:
- return json.dumps(self.actual_instance)
-
- def to_dict(self) -> Optional[Union[Dict[str, Any], AgentExecutionCancel, AgentExecutionConfirm, AgentExecutionPendingReview, AgentExecutionStateDeliveredToDestinationInput]]:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(
+ self,
+ ) -> Optional[
+ Union[
+ Dict[str, Any],
+ AgentExecutionCancel,
+ AgentExecutionConfirm,
+ AgentExecutionPendingReview,
+ AgentExecutionStateDeliveredToDestinationInput,
+ ]
+ ]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
- if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ if hasattr(self.actual_instance, "to_dict") and callable(
+ self.actual_instance.to_dict
+ ):
return self.actual_instance.to_dict()
- else:
- # primitive type
- return self.actual_instance
+ # primitive type
+ return self.actual_instance
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/string_error_response.py b/src/askui/tools/askui/askui_workspaces/models/string_error_response.py
index 55912560..a8a7c9f5 100644
--- a/src/askui/tools/askui/askui_workspaces/models/string_error_response.py
+++ b/src/askui/tools/askui/askui_workspaces/models/string_error_response.py
@@ -1,31 +1,32 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, StrictStr
-from typing import Any, ClassVar, Dict, List
-from typing import Optional, Set
from typing_extensions import Self
+
class StringErrorResponse(BaseModel):
"""
StringErrorResponse
- """ # noqa: E501
+ """ # noqa: E501
+
detail: StrictStr
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["detail"]
@@ -36,7 +37,6 @@ class StringErrorResponse(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -62,9 +62,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -87,14 +89,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "detail": obj.get("detail")
- })
+ _obj = cls.model_validate({"detail": obj.get("detail")})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/subject_access_token_response_dto_input.py b/src/askui/tools/askui/askui_workspaces/models/subject_access_token_response_dto_input.py
index 033ece4a..249a7164 100644
--- a/src/askui/tools/askui/askui_workspaces/models/subject_access_token_response_dto_input.py
+++ b/src/askui/tools/askui/askui_workspaces/models/subject_access_token_response_dto_input.py
@@ -1,39 +1,46 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class SubjectAccessTokenResponseDtoInput(BaseModel):
"""
SubjectAccessTokenResponseDtoInput
- """ # noqa: E501
+ """ # noqa: E501
+
id: Optional[StrictStr] = Field(default=None, alias="_id")
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
name: StrictStr
expires_at: Optional[datetime] = Field(alias="expiresAt")
creator_id: StrictStr = Field(alias="creatorId")
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["_id", "createdAt", "name", "expiresAt", "creatorId"]
+ __properties: ClassVar[List[str]] = [
+ "_id",
+ "createdAt",
+ "name",
+ "expiresAt",
+ "creatorId",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -41,7 +48,6 @@ class SubjectAccessTokenResponseDtoInput(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -67,9 +73,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -84,7 +92,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if expires_at (nullable) is None
# and model_fields_set contains the field
if self.expires_at is None and "expires_at" in self.model_fields_set:
- _dict['expiresAt'] = None
+ _dict["expiresAt"] = None
return _dict
@@ -97,18 +105,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "_id": obj.get("_id"),
- "createdAt": obj.get("createdAt"),
- "name": obj.get("name"),
- "expiresAt": obj.get("expiresAt"),
- "creatorId": obj.get("creatorId")
- })
+ _obj = cls.model_validate(
+ {
+ "_id": obj.get("_id"),
+ "createdAt": obj.get("createdAt"),
+ "name": obj.get("name"),
+ "expiresAt": obj.get("expiresAt"),
+ "creatorId": obj.get("creatorId"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/subject_access_token_response_dto_output.py b/src/askui/tools/askui/askui_workspaces/models/subject_access_token_response_dto_output.py
index 0e0e91cd..b59714fb 100644
--- a/src/askui/tools/askui/askui_workspaces/models/subject_access_token_response_dto_output.py
+++ b/src/askui/tools/askui/askui_workspaces/models/subject_access_token_response_dto_output.py
@@ -1,39 +1,46 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class SubjectAccessTokenResponseDtoOutput(BaseModel):
"""
SubjectAccessTokenResponseDtoOutput
- """ # noqa: E501
+ """ # noqa: E501
+
id: Optional[StrictStr] = None
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
name: StrictStr
expires_at: Optional[datetime] = Field(alias="expiresAt")
creator_id: StrictStr = Field(alias="creatorId")
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "createdAt", "name", "expiresAt", "creatorId"]
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "createdAt",
+ "name",
+ "expiresAt",
+ "creatorId",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -41,7 +48,6 @@ class SubjectAccessTokenResponseDtoOutput(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -67,9 +73,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -84,7 +92,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if expires_at (nullable) is None
# and model_fields_set contains the field
if self.expires_at is None and "expires_at" in self.model_fields_set:
- _dict['expiresAt'] = None
+ _dict["expiresAt"] = None
return _dict
@@ -97,18 +105,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "createdAt": obj.get("createdAt"),
- "name": obj.get("name"),
- "expiresAt": obj.get("expiresAt"),
- "creatorId": obj.get("creatorId")
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "createdAt": obj.get("createdAt"),
+ "name": obj.get("name"),
+ "expiresAt": obj.get("expiresAt"),
+ "creatorId": obj.get("creatorId"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/update_workspace_name_request_dto.py b/src/askui/tools/askui/askui_workspaces/models/update_workspace_name_request_dto.py
index 6f320565..5359d6d7 100644
--- a/src/askui/tools/askui/askui_workspaces/models/update_workspace_name_request_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/update_workspace_name_request_dto.py
@@ -1,32 +1,32 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field
-from typing import Any, ClassVar, Dict, List
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
+from typing_extensions import Annotated, Self
+
class UpdateWorkspaceNameRequestDto(BaseModel):
"""
UpdateWorkspaceNameRequestDto
- """ # noqa: E501
+ """ # noqa: E501
+
name: Annotated[str, Field(min_length=1, strict=True, max_length=128)]
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["name"]
@@ -37,7 +37,6 @@ class UpdateWorkspaceNameRequestDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -63,9 +62,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -88,14 +89,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "name": obj.get("name")
- })
+ _obj = cls.model_validate({"name": obj.get("name")})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/update_workspace_name_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/update_workspace_name_response_dto.py
index 92bc1d5a..dd8d4049 100644
--- a/src/askui/tools/askui/askui_workspaces/models/update_workspace_name_response_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/update_workspace_name_response_dto.py
@@ -1,40 +1,54 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto import WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto import (
+ WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto,
+)
+
+
class UpdateWorkspaceNameResponseDto(BaseModel):
"""
UpdateWorkspaceNameResponseDto
- """ # noqa: E501
+ """ # noqa: E501
+
id: Optional[StrictStr] = None
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
updated_at: Optional[datetime] = Field(default=None, alias="updatedAt")
name: StrictStr
- memberships: Optional[List[WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto]]
+ memberships: Optional[
+ List[
+ WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto
+ ]
+ ]
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt", "name", "memberships"]
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "createdAt",
+ "updatedAt",
+ "name",
+ "memberships",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -42,7 +56,6 @@ class UpdateWorkspaceNameResponseDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -68,9 +81,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -83,7 +98,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.memberships:
if _item:
_items.append(_item.to_dict())
- _dict['memberships'] = _items
+ _dict["memberships"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -92,7 +107,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if memberships (nullable) is None
# and model_fields_set contains the field
if self.memberships is None and "memberships" in self.model_fields_set:
- _dict['memberships'] = None
+ _dict["memberships"] = None
return _dict
@@ -105,18 +120,25 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "createdAt": obj.get("createdAt"),
- "updatedAt": obj.get("updatedAt"),
- "name": obj.get("name"),
- "memberships": [WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto.from_dict(_item) for _item in obj["memberships"]] if obj.get("memberships") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "createdAt": obj.get("createdAt"),
+ "updatedAt": obj.get("updatedAt"),
+ "name": obj.get("name"),
+ "memberships": [
+ WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto.from_dict(
+ _item
+ )
+ for _item in obj["memberships"]
+ ]
+ if obj.get("memberships") is not None
+ else None,
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/upload_file_response.py b/src/askui/tools/askui/askui_workspaces/models/upload_file_response.py
index 79085e2a..5a1f5abd 100644
--- a/src/askui/tools/askui/askui_workspaces/models/upload_file_response.py
+++ b/src/askui/tools/askui/askui_workspaces/models/upload_file_response.py
@@ -1,31 +1,32 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List
-from typing import Optional, Set
from typing_extensions import Self
+
class UploadFileResponse(BaseModel):
"""
UploadFileResponse
- """ # noqa: E501
+ """ # noqa: E501
+
file_path: StrictStr = Field(alias="filePath")
content_type: StrictStr = Field(alias="contentType")
additional_properties: Dict[str, Any] = {}
@@ -37,7 +38,6 @@ class UploadFileResponse(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -63,9 +63,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -88,15 +90,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "filePath": obj.get("filePath"),
- "contentType": obj.get("contentType")
- })
+ _obj = cls.model_validate(
+ {"filePath": obj.get("filePath"), "contentType": obj.get("contentType")}
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/usage_event.py b/src/askui/tools/askui/askui_workspaces/models/usage_event.py
index 48d55247..ffa977b4 100644
--- a/src/askui/tools/askui/askui_workspaces/models/usage_event.py
+++ b/src/askui/tools/askui/askui_workspaces/models/usage_event.py
@@ -1,39 +1,46 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class UsageEvent(BaseModel):
"""
UsageEvent
- """ # noqa: E501
+ """ # noqa: E501
+
id: StrictStr
access_token_id: Optional[StrictStr] = Field(default=None, alias="accessTokenId")
user_id: StrictStr = Field(alias="userId")
workspace_id: StrictStr = Field(alias="workspaceId")
timestamp: datetime
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "accessTokenId", "userId", "workspaceId", "timestamp"]
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "accessTokenId",
+ "userId",
+ "workspaceId",
+ "timestamp",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -41,7 +48,6 @@ class UsageEvent(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -67,9 +73,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -84,7 +92,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if access_token_id (nullable) is None
# and model_fields_set contains the field
if self.access_token_id is None and "access_token_id" in self.model_fields_set:
- _dict['accessTokenId'] = None
+ _dict["accessTokenId"] = None
return _dict
@@ -97,18 +105,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "accessTokenId": obj.get("accessTokenId"),
- "userId": obj.get("userId"),
- "workspaceId": obj.get("workspaceId"),
- "timestamp": obj.get("timestamp")
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "accessTokenId": obj.get("accessTokenId"),
+ "userId": obj.get("userId"),
+ "workspaceId": obj.get("workspaceId"),
+ "timestamp": obj.get("timestamp"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/usage_events_list_response.py b/src/askui/tools/askui/askui_workspaces/models/usage_events_list_response.py
index 5aaa3fcc..60a15f1e 100644
--- a/src/askui/tools/askui/askui_workspaces/models/usage_events_list_response.py
+++ b/src/askui/tools/askui/askui_workspaces/models/usage_events_list_response.py
@@ -1,34 +1,42 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.usage_event import UsageEvent
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.usage_event import UsageEvent
+
+
class UsageEventsListResponse(BaseModel):
"""
UsageEventsListResponse
- """ # noqa: E501
- data: List[UsageEvent] = Field(description="List of usage events matching the query")
- has_more: Optional[StrictBool] = Field(default=False, description="Whether more events exist beyond the `limit`", alias="hasMore")
+ """ # noqa: E501
+
+ data: List[UsageEvent] = Field(
+ description="List of usage events matching the query"
+ )
+ has_more: Optional[StrictBool] = Field(
+ default=False,
+ description="Whether more events exist beyond the `limit`",
+ alias="hasMore",
+ )
total_count: Optional[StrictInt] = Field(default=None, alias="totalCount")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["data", "hasMore", "totalCount"]
@@ -39,7 +47,6 @@ class UsageEventsListResponse(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -65,9 +72,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -80,7 +89,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.data:
if _item:
_items.append(_item.to_dict())
- _dict['data'] = _items
+ _dict["data"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -89,7 +98,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if total_count (nullable) is None
# and model_fields_set contains the field
if self.total_count is None and "total_count" in self.model_fields_set:
- _dict['totalCount'] = None
+ _dict["totalCount"] = None
return _dict
@@ -102,16 +111,20 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "data": [UsageEvent.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None,
- "hasMore": obj.get("hasMore") if obj.get("hasMore") is not None else False,
- "totalCount": obj.get("totalCount")
- })
+ _obj = cls.model_validate(
+ {
+ "data": [UsageEvent.from_dict(_item) for _item in obj["data"]]
+ if obj.get("data") is not None
+ else None,
+ "hasMore": obj.get("hasMore")
+ if obj.get("hasMore") is not None
+ else False,
+ "totalCount": obj.get("totalCount"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/user_dto.py b/src/askui/tools/askui/askui_workspaces/models/user_dto.py
index 3d38c566..de2ed919 100644
--- a/src/askui/tools/askui/askui_workspaces/models/user_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/user_dto.py
@@ -1,33 +1,33 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List
-from typing_extensions import Annotated
-from typing import Optional, Set
-from typing_extensions import Self
+from typing_extensions import Annotated, Self
+
class UserDto(BaseModel):
"""
UserDto
- """ # noqa: E501
+ """ # noqa: E501
+
id: StrictStr
email: StrictStr
name: StrictStr
@@ -35,7 +35,14 @@ class UserDto(BaseModel):
updated_at: datetime = Field(alias="updatedAt")
created_at: datetime = Field(alias="createdAt")
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "email", "name", "picture", "updatedAt", "createdAt"]
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "email",
+ "name",
+ "picture",
+ "updatedAt",
+ "createdAt",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -43,7 +50,6 @@ class UserDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -69,9 +75,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -94,19 +102,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "email": obj.get("email"),
- "name": obj.get("name"),
- "picture": obj.get("picture"),
- "updatedAt": obj.get("updatedAt"),
- "createdAt": obj.get("createdAt")
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "email": obj.get("email"),
+ "name": obj.get("name"),
+ "picture": obj.get("picture"),
+ "updatedAt": obj.get("updatedAt"),
+ "createdAt": obj.get("createdAt"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/validation_error.py b/src/askui/tools/askui/askui_workspaces/models/validation_error.py
index 2d7d75d6..2882e67a 100644
--- a/src/askui/tools/askui/askui_workspaces/models/validation_error.py
+++ b/src/askui/tools/askui/askui_workspaces/models/validation_error.py
@@ -1,32 +1,36 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, StrictStr
-from typing import Any, ClassVar, Dict, List
-from askui.tools.askui.askui_workspaces.models.validation_error_loc_inner import ValidationErrorLocInner
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.validation_error_loc_inner import (
+ ValidationErrorLocInner,
+)
+
+
class ValidationError(BaseModel):
"""
ValidationError
- """ # noqa: E501
+ """ # noqa: E501
+
loc: List[ValidationErrorLocInner]
msg: StrictStr
type: StrictStr
@@ -39,7 +43,6 @@ class ValidationError(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -65,9 +68,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -80,7 +85,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.loc:
if _item:
_items.append(_item.to_dict())
- _dict['loc'] = _items
+ _dict["loc"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -97,16 +102,20 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "loc": [ValidationErrorLocInner.from_dict(_item) for _item in obj["loc"]] if obj.get("loc") is not None else None,
- "msg": obj.get("msg"),
- "type": obj.get("type")
- })
+ _obj = cls.model_validate(
+ {
+ "loc": [
+ ValidationErrorLocInner.from_dict(_item) for _item in obj["loc"]
+ ]
+ if obj.get("loc") is not None
+ else None,
+ "msg": obj.get("msg"),
+ "type": obj.get("type"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/validation_error_loc_inner.py b/src/askui/tools/askui/askui_workspaces/models/validation_error_loc_inner.py
index b4e93a1a..7bcfe0cf 100644
--- a/src/askui/tools/askui/askui_workspaces/models/validation_error_loc_inner.py
+++ b/src/askui/tools/askui/askui_workspaces/models/validation_error_loc_inner.py
@@ -1,30 +1,35 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
-from inspect import getfullargspec
+
import json
import pprint
import re # noqa: F401
-from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, ValidationError, field_validator
-from typing import Optional
-from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
-from typing_extensions import Literal, Self
-from pydantic import Field
+from typing import TYPE_CHECKING, Any, Dict, Optional, Set, Union
+
+from pydantic import (
+ BaseModel,
+ StrictInt,
+ StrictStr,
+ ValidationError,
+ field_validator,
+)
+from typing_extensions import Self
VALIDATIONERRORLOCINNER_ANY_OF_SCHEMAS = ["int", "str"]
+
class ValidationErrorLocInner(BaseModel):
"""
ValidationErrorLocInner
@@ -38,7 +43,7 @@ class ValidationErrorLocInner(BaseModel):
actual_instance: Optional[Union[int, str]] = None
else:
actual_instance: Any = None
- any_of_schemas: Set[str] = { "int", "str" }
+ any_of_schemas: Set[str] = {"int", "str"}
model_config = {
"validate_assignment": True,
@@ -48,14 +53,18 @@ class ValidationErrorLocInner(BaseModel):
def __init__(self, *args, **kwargs) -> None:
if args:
if len(args) > 1:
- raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ raise ValueError(
+ "If a position argument is used, only 1 is allowed to set `actual_instance`"
+ )
if kwargs:
- raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ raise ValueError(
+ "If a position argument is used, keyword arguments cannot be used."
+ )
super().__init__(actual_instance=args[0])
else:
super().__init__(**kwargs)
- @field_validator('actual_instance')
+ @field_validator("actual_instance")
def actual_instance_must_validate_anyof(cls, v):
instance = ValidationErrorLocInner.model_construct()
error_messages = []
@@ -73,9 +82,11 @@ def actual_instance_must_validate_anyof(cls, v):
error_messages.append(str(e))
if error_messages:
# no match
- raise ValueError("No match found when setting the actual_instance in ValidationErrorLocInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages))
- else:
- return v
+ raise ValueError(
+ "No match found when setting the actual_instance in ValidationErrorLocInner with anyOf schemas: int, str. Details: "
+ + ", ".join(error_messages)
+ )
+ return v
@classmethod
def from_dict(cls, obj: Dict[str, Any]) -> Self:
@@ -107,32 +118,34 @@ def from_json(cls, json_str: str) -> Self:
if error_messages:
# no match
- raise ValueError("No match found when deserializing the JSON string into ValidationErrorLocInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages))
- else:
- return instance
+ raise ValueError(
+ "No match found when deserializing the JSON string into ValidationErrorLocInner with anyOf schemas: int, str. Details: "
+ + ", ".join(error_messages)
+ )
+ return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
- if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ if hasattr(self.actual_instance, "to_json") and callable(
+ self.actual_instance.to_json
+ ):
return self.actual_instance.to_json()
- else:
- return json.dumps(self.actual_instance)
+ return json.dumps(self.actual_instance)
def to_dict(self) -> Optional[Union[Dict[str, Any], int, str]]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
- if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ if hasattr(self.actual_instance, "to_dict") and callable(
+ self.actual_instance.to_dict
+ ):
return self.actual_instance.to_dict()
- else:
- return self.actual_instance
+ return self.actual_instance
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/webhook_response.py b/src/askui/tools/askui/askui_workspaces/models/webhook_response.py
index 180b1e40..d857f9c5 100644
--- a/src/askui/tools/askui/askui_workspaces/models/webhook_response.py
+++ b/src/askui/tools/askui/askui_workspaces/models/webhook_response.py
@@ -1,31 +1,32 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
-from typing import Any, ClassVar, Dict, List
-from typing import Optional, Set
from typing_extensions import Self
+
class WebhookResponse(BaseModel):
"""
WebhookResponse
- """ # noqa: E501
+ """ # noqa: E501
+
status_code: StrictInt = Field(alias="statusCode")
headers: Dict[str, StrictStr]
body: StrictStr
@@ -38,7 +39,6 @@ class WebhookResponse(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -64,9 +64,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -89,16 +91,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "statusCode": obj.get("statusCode"),
- "headers": obj.get("headers"),
- "body": obj.get("body")
- })
+ _obj = cls.model_validate(
+ {
+ "statusCode": obj.get("statusCode"),
+ "headers": obj.get("headers"),
+ "body": obj.get("body"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/workspace_access_token.py b/src/askui/tools/askui/askui_workspaces/models/workspace_access_token.py
index 57933536..cfcd9cd4 100644
--- a/src/askui/tools/askui/askui_workspaces/models/workspace_access_token.py
+++ b/src/askui/tools/askui/askui_workspaces/models/workspace_access_token.py
@@ -1,39 +1,46 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class WorkspaceAccessToken(BaseModel):
"""
WorkspaceAccessToken
- """ # noqa: E501
+ """ # noqa: E501
+
id: Optional[StrictStr] = None
created_at: Optional[datetime] = None
name: StrictStr
hash: StrictStr
expires_at: Optional[datetime]
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "created_at", "name", "hash", "expires_at"]
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "created_at",
+ "name",
+ "hash",
+ "expires_at",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -41,7 +48,6 @@ class WorkspaceAccessToken(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -67,9 +73,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -84,7 +92,7 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if expires_at (nullable) is None
# and model_fields_set contains the field
if self.expires_at is None and "expires_at" in self.model_fields_set:
- _dict['expires_at'] = None
+ _dict["expires_at"] = None
return _dict
@@ -97,18 +105,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "created_at": obj.get("created_at"),
- "name": obj.get("name"),
- "hash": obj.get("hash"),
- "expires_at": obj.get("expires_at")
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "created_at": obj.get("created_at"),
+ "name": obj.get("name"),
+ "hash": obj.get("hash"),
+ "expires_at": obj.get("expires_at"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/workspace_dto.py b/src/askui/tools/askui/askui_workspaces/models/workspace_dto.py
index 55355ab0..0adb529a 100644
--- a/src/askui/tools/askui/askui_workspaces/models/workspace_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/workspace_dto.py
@@ -1,32 +1,33 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from typing import Optional, Set
from typing_extensions import Self
+
class WorkspaceDto(BaseModel):
"""
WorkspaceDto
- """ # noqa: E501
+ """ # noqa: E501
+
id: Optional[StrictStr] = None
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
updated_at: Optional[datetime] = Field(default=None, alias="updatedAt")
@@ -40,7 +41,6 @@ class WorkspaceDto(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -66,9 +66,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -91,17 +93,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "createdAt": obj.get("createdAt"),
- "updatedAt": obj.get("updatedAt"),
- "name": obj.get("name")
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "createdAt": obj.get("createdAt"),
+ "updatedAt": obj.get("updatedAt"),
+ "name": obj.get("name"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/workspace_memberships_list_response.py b/src/askui/tools/askui/askui_workspaces/models/workspace_memberships_list_response.py
index 1e871c25..b0e143d5 100644
--- a/src/askui/tools/askui/askui_workspaces/models/workspace_memberships_list_response.py
+++ b/src/askui/tools/askui/askui_workspaces/models/workspace_memberships_list_response.py
@@ -1,33 +1,39 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
+from typing import Any, ClassVar, Dict, List, Optional, Set
from pydantic import BaseModel, ConfigDict
-from typing import Any, ClassVar, Dict, List
-from askui.tools.askui.askui_workspaces.models.workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto import WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto
-from typing import Optional, Set
from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto import (
+ WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto,
+)
+
+
class WorkspaceMembershipsListResponse(BaseModel):
"""
WorkspaceMembershipsListResponse
- """ # noqa: E501
- data: List[WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto]
+ """ # noqa: E501
+
+ data: List[
+ WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto
+ ]
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["data"]
@@ -37,7 +43,6 @@ class WorkspaceMembershipsListResponse(BaseModel):
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -63,9 +68,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -78,7 +85,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.data:
if _item:
_items.append(_item.to_dict())
- _dict['data'] = _items
+ _dict["data"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -95,14 +102,21 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "data": [WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "data": [
+ WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto.from_dict(
+ _item
+ )
+ for _item in obj["data"]
+ ]
+ if obj.get("data") is not None
+ else None
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/workspace_privilege.py b/src/askui/tools/askui/askui_workspaces/models/workspace_privilege.py
index f4e2e0d0..dcf1d197 100644
--- a/src/askui/tools/askui/askui_workspaces/models/workspace_privilege.py
+++ b/src/askui/tools/askui/askui_workspaces/models/workspace_privilege.py
@@ -1,20 +1,21 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
import json
from enum import Enum
+
from typing_extensions import Self
@@ -26,13 +27,11 @@ class WorkspacePrivilege(str, Enum):
"""
allowed enum values
"""
- ROLE_WORKSPACE_OWNER = 'ROLE_WORKSPACE_OWNER'
- ROLE_WORKSPACE_ADMIN = 'ROLE_WORKSPACE_ADMIN'
- ROLE_WORKSPACE_MEMBER = 'ROLE_WORKSPACE_MEMBER'
+ ROLE_WORKSPACE_OWNER = "ROLE_WORKSPACE_OWNER"
+ ROLE_WORKSPACE_ADMIN = "ROLE_WORKSPACE_ADMIN"
+ ROLE_WORKSPACE_MEMBER = "ROLE_WORKSPACE_MEMBER"
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of WorkspacePrivilege from a JSON string"""
return cls(json.loads(json_str))
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto.py b/src/askui/tools/askui/askui_workspaces/models/workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto.py
index a6e2fce7..59a530c4 100644
--- a/src/askui/tools/askui/askui_workspaces/models/workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto.py
@@ -1,43 +1,61 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.workspace_access_token import WorkspaceAccessToken
-from askui.tools.askui.askui_workspaces.models.workspace_privilege import WorkspacePrivilege
-from typing import Optional, Set
from typing_extensions import Self
-class WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto(BaseModel):
+from askui.tools.askui.askui_workspaces.models.workspace_access_token import (
+ WorkspaceAccessToken,
+)
+from askui.tools.askui.askui_workspaces.models.workspace_privilege import (
+ WorkspacePrivilege,
+)
+
+
+class WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto(
+ BaseModel
+):
"""
WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto
- """ # noqa: E501
+ """ # noqa: E501
+
id: Optional[StrictStr] = None
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
updated_at: Optional[datetime] = Field(default=None, alias="updatedAt")
user_id: StrictStr = Field(alias="userId")
workspace_id: StrictStr = Field(alias="workspaceId")
privileges: List[WorkspacePrivilege]
- access_tokens: Optional[List[WorkspaceAccessToken]] = Field(default=None, alias="accessTokens")
+ access_tokens: Optional[List[WorkspaceAccessToken]] = Field(
+ default=None, alias="accessTokens"
+ )
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt", "userId", "workspaceId", "privileges", "accessTokens"]
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "createdAt",
+ "updatedAt",
+ "userId",
+ "workspaceId",
+ "privileges",
+ "accessTokens",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -45,7 +63,6 @@ class WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWo
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -71,9 +88,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -86,7 +105,7 @@ def to_dict(self) -> Dict[str, Any]:
for _item in self.access_tokens:
if _item:
_items.append(_item.to_dict())
- _dict['accessTokens'] = _items
+ _dict["accessTokens"] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -103,20 +122,25 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "createdAt": obj.get("createdAt"),
- "updatedAt": obj.get("updatedAt"),
- "userId": obj.get("userId"),
- "workspaceId": obj.get("workspaceId"),
- "privileges": obj.get("privileges"),
- "accessTokens": [WorkspaceAccessToken.from_dict(_item) for _item in obj["accessTokens"]] if obj.get("accessTokens") is not None else None
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "createdAt": obj.get("createdAt"),
+ "updatedAt": obj.get("updatedAt"),
+ "userId": obj.get("userId"),
+ "workspaceId": obj.get("workspaceId"),
+ "privileges": obj.get("privileges"),
+ "accessTokens": [
+ WorkspaceAccessToken.from_dict(_item)
+ for _item in obj["accessTokens"]
+ ]
+ if obj.get("accessTokens") is not None
+ else None,
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto.py b/src/askui/tools/askui/askui_workspaces/models/workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto.py
index da518e56..3cefc8f2 100644
--- a/src/askui/tools/askui/askui_workspaces/models/workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto.py
@@ -1,33 +1,39 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
-from askui.tools.askui.askui_workspaces.models.workspace_privilege import WorkspacePrivilege
-from typing import Optional, Set
from typing_extensions import Self
-class WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto(BaseModel):
+from askui.tools.askui.askui_workspaces.models.workspace_privilege import (
+ WorkspacePrivilege,
+)
+
+
+class WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto(
+ BaseModel
+):
"""
WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto
- """ # noqa: E501
+ """ # noqa: E501
+
id: Optional[StrictStr] = None
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
updated_at: Optional[datetime] = Field(default=None, alias="updatedAt")
@@ -35,7 +41,14 @@ class WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseD
workspace_id: StrictStr = Field(alias="workspaceId")
privileges: List[WorkspacePrivilege]
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt", "userId", "workspaceId", "privileges"]
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "createdAt",
+ "updatedAt",
+ "userId",
+ "workspaceId",
+ "privileges",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -43,7 +56,6 @@ class WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseD
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -69,9 +81,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -94,19 +108,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "createdAt": obj.get("createdAt"),
- "updatedAt": obj.get("updatedAt"),
- "userId": obj.get("userId"),
- "workspaceId": obj.get("workspaceId"),
- "privileges": obj.get("privileges")
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "createdAt": obj.get("createdAt"),
+ "updatedAt": obj.get("updatedAt"),
+ "userId": obj.get("userId"),
+ "workspaceId": obj.get("workspaceId"),
+ "privileges": obj.get("privileges"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/models/workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto.py b/src/askui/tools/askui/askui_workspaces/models/workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto.py
index 2abe9cfb..2d9af5f6 100644
--- a/src/askui/tools/askui/askui_workspaces/models/workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto.py
+++ b/src/askui/tools/askui/askui_workspaces/models/workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto.py
@@ -1,35 +1,41 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
from __future__ import annotations
+
+import json
import pprint
import re # noqa: F401
-import json
-
from datetime import datetime
+from typing import Any, ClassVar, Dict, List, Optional, Set
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
-from typing import Any, ClassVar, Dict, List, Optional
+from typing_extensions import Self
+
from askui.tools.askui.askui_workspaces.models.user_dto import UserDto
from askui.tools.askui.askui_workspaces.models.workspace_dto import WorkspaceDto
-from askui.tools.askui.askui_workspaces.models.workspace_privilege import WorkspacePrivilege
-from typing import Optional, Set
-from typing_extensions import Self
+from askui.tools.askui.askui_workspaces.models.workspace_privilege import (
+ WorkspacePrivilege,
+)
+
-class WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto(BaseModel):
+class WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto(
+ BaseModel
+):
"""
WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto
- """ # noqa: E501
+ """ # noqa: E501
+
id: Optional[StrictStr] = None
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
updated_at: Optional[datetime] = Field(default=None, alias="updatedAt")
@@ -39,7 +45,16 @@ class WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMem
workspace: Optional[WorkspaceDto] = None
workspace_id: StrictStr = Field(alias="workspaceId")
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt", "privileges", "user", "userId", "workspace", "workspaceId"]
+ __properties: ClassVar[List[str]] = [
+ "id",
+ "createdAt",
+ "updatedAt",
+ "privileges",
+ "user",
+ "userId",
+ "workspace",
+ "workspaceId",
+ ]
model_config = ConfigDict(
populate_by_name=True,
@@ -47,7 +62,6 @@ class WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMem
protected_namespaces=(),
)
-
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
@@ -73,9 +87,11 @@ def to_dict(self) -> Dict[str, Any]:
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
- excluded_fields: Set[str] = set([
- "additional_properties",
- ])
+ excluded_fields: Set[str] = set(
+ [
+ "additional_properties",
+ ]
+ )
_dict = self.model_dump(
by_alias=True,
@@ -84,10 +100,10 @@ def to_dict(self) -> Dict[str, Any]:
)
# override the default output from pydantic by calling `to_dict()` of user
if self.user:
- _dict['user'] = self.user.to_dict()
+ _dict["user"] = self.user.to_dict()
# override the default output from pydantic by calling `to_dict()` of workspace
if self.workspace:
- _dict['workspace'] = self.workspace.to_dict()
+ _dict["workspace"] = self.workspace.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
@@ -96,12 +112,12 @@ def to_dict(self) -> Dict[str, Any]:
# set to None if user (nullable) is None
# and model_fields_set contains the field
if self.user is None and "user" in self.model_fields_set:
- _dict['user'] = None
+ _dict["user"] = None
# set to None if workspace (nullable) is None
# and model_fields_set contains the field
if self.workspace is None and "workspace" in self.model_fields_set:
- _dict['workspace'] = None
+ _dict["workspace"] = None
return _dict
@@ -114,21 +130,25 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate({
- "id": obj.get("id"),
- "createdAt": obj.get("createdAt"),
- "updatedAt": obj.get("updatedAt"),
- "privileges": obj.get("privileges"),
- "user": UserDto.from_dict(obj["user"]) if obj.get("user") is not None else None,
- "userId": obj.get("userId"),
- "workspace": WorkspaceDto.from_dict(obj["workspace"]) if obj.get("workspace") is not None else None,
- "workspaceId": obj.get("workspaceId")
- })
+ _obj = cls.model_validate(
+ {
+ "id": obj.get("id"),
+ "createdAt": obj.get("createdAt"),
+ "updatedAt": obj.get("updatedAt"),
+ "privileges": obj.get("privileges"),
+ "user": UserDto.from_dict(obj["user"])
+ if obj.get("user") is not None
+ else None,
+ "userId": obj.get("userId"),
+ "workspace": WorkspaceDto.from_dict(obj["workspace"])
+ if obj.get("workspace") is not None
+ else None,
+ "workspaceId": obj.get("workspaceId"),
+ }
+ )
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj
-
-
diff --git a/src/askui/tools/askui/askui_workspaces/rest.py b/src/askui/tools/askui/askui_workspaces/rest.py
index f2d7425c..2eac7417 100644
--- a/src/askui/tools/askui/askui_workspaces/rest.py
+++ b/src/askui/tools/askui/askui_workspaces/rest.py
@@ -1,17 +1,16 @@
# coding: utf-8
"""
- AskUI Workspaces API
+AskUI Workspaces API
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- The version of the OpenAPI document: 0.1.30
- Generated by OpenAPI Generator (https://openapi-generator.tech)
+The version of the OpenAPI document: 0.1.30
+Generated by OpenAPI Generator (https://openapi-generator.tech)
- Do not edit the class manually.
+Do not edit the class manually.
""" # noqa: E501
-
import io
import json
import re
@@ -31,12 +30,10 @@ def is_socks_proxy_url(url):
split_section = url.split("://")
if len(split_section) < 2:
return False
- else:
- return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES
+ return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES
class RESTResponse(io.IOBase):
-
def __init__(self, resp) -> None:
self.response = resp
self.status = resp.status
@@ -58,7 +55,6 @@ def getheader(self, name, default=None):
class RESTClientObject:
-
def __init__(self, configuration) -> None:
# urllib3.PoolManager will pass all kw parameters to connectionpool
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
@@ -78,22 +74,19 @@ def __init__(self, configuration) -> None:
"key_file": configuration.key_file,
}
if configuration.assert_hostname is not None:
- pool_args['assert_hostname'] = (
- configuration.assert_hostname
- )
+ pool_args["assert_hostname"] = configuration.assert_hostname
if configuration.retries is not None:
- pool_args['retries'] = configuration.retries
+ pool_args["retries"] = configuration.retries
if configuration.tls_server_name:
- pool_args['server_hostname'] = configuration.tls_server_name
-
+ pool_args["server_hostname"] = configuration.tls_server_name
if configuration.socket_options is not None:
- pool_args['socket_options'] = configuration.socket_options
+ pool_args["socket_options"] = configuration.socket_options
if configuration.connection_pool_maxsize is not None:
- pool_args['maxsize'] = configuration.connection_pool_maxsize
+ pool_args["maxsize"] = configuration.connection_pool_maxsize
# https pool manager
self.pool_manager: urllib3.PoolManager
@@ -101,6 +94,7 @@ def __init__(self, configuration) -> None:
if configuration.proxy:
if is_socks_proxy_url(configuration.proxy):
from urllib3.contrib.socks import SOCKSProxyManager
+
pool_args["proxy_url"] = configuration.proxy
pool_args["headers"] = configuration.proxy_headers
self.pool_manager = SOCKSProxyManager(**pool_args)
@@ -118,7 +112,7 @@ def request(
headers=None,
body=None,
post_params=None,
- _request_timeout=None
+ _request_timeout=None,
):
"""Perform requests.
@@ -135,15 +129,7 @@ def request(
(connection, read) timeouts.
"""
method = method.upper()
- assert method in [
- 'GET',
- 'HEAD',
- 'DELETE',
- 'POST',
- 'PUT',
- 'PATCH',
- 'OPTIONS'
- ]
+ assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"]
if post_params and body:
raise ApiValueError(
@@ -157,25 +143,17 @@ def request(
if _request_timeout:
if isinstance(_request_timeout, (int, float)):
timeout = urllib3.Timeout(total=_request_timeout)
- elif (
- isinstance(_request_timeout, tuple)
- and len(_request_timeout) == 2
- ):
+ elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2:
timeout = urllib3.Timeout(
- connect=_request_timeout[0],
- read=_request_timeout[1]
+ connect=_request_timeout[0], read=_request_timeout[1]
)
try:
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
- if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
-
+ if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]:
# no content type provided or payload is json
- content_type = headers.get('Content-Type')
- if (
- not content_type
- or re.search('json', content_type, re.IGNORECASE)
- ):
+ content_type = headers.get("Content-Type")
+ if not content_type or re.search("json", content_type, re.IGNORECASE):
request_body = None
if body is not None:
request_body = json.dumps(body)
@@ -185,9 +163,9 @@ def request(
body=request_body,
timeout=timeout,
headers=headers,
- preload_content=False
+ preload_content=False,
)
- elif content_type == 'application/x-www-form-urlencoded':
+ elif content_type == "application/x-www-form-urlencoded":
r = self.pool_manager.request(
method,
url,
@@ -195,15 +173,18 @@ def request(
encode_multipart=False,
timeout=timeout,
headers=headers,
- preload_content=False
+ preload_content=False,
)
- elif content_type == 'multipart/form-data':
+ elif content_type == "multipart/form-data":
# must del headers['Content-Type'], or the correct
# Content-Type which generated by urllib3 will be
# overwritten.
- del headers['Content-Type']
+ del headers["Content-Type"]
# Ensures that dict objects are serialized
- post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params]
+ post_params = [
+ (a, json.dumps(b)) if isinstance(b, dict) else (a, b)
+ for a, b in post_params
+ ]
r = self.pool_manager.request(
method,
url,
@@ -211,7 +192,7 @@ def request(
encode_multipart=True,
timeout=timeout,
headers=headers,
- preload_content=False
+ preload_content=False,
)
# Pass a `string` parameter directly in the body to support
# other content types than JSON when `body` argument is
@@ -223,9 +204,9 @@ def request(
body=body,
timeout=timeout,
headers=headers,
- preload_content=False
+ preload_content=False,
)
- elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool):
+ elif headers["Content-Type"] == "text/plain" and isinstance(body, bool):
request_body = "true" if body else "false"
r = self.pool_manager.request(
method,
@@ -233,7 +214,8 @@ def request(
body=request_body,
preload_content=False,
timeout=timeout,
- headers=headers)
+ headers=headers,
+ )
else:
# Cannot generate the request from given parameters
msg = """Cannot prepare a request message for provided
@@ -248,7 +230,7 @@ def request(
fields={},
timeout=timeout,
headers=headers,
- preload_content=False
+ preload_content=False,
)
except urllib3.exceptions.SSLError as e:
msg = "\n".join([type(e).__name__, str(e)])
diff --git a/src/askui/tools/toolbox.py b/src/askui/tools/toolbox.py
index 137a8843..718134f3 100644
--- a/src/askui/tools/toolbox.py
+++ b/src/askui/tools/toolbox.py
@@ -1,6 +1,8 @@
+import webbrowser
+
import httpx
import pyperclip
-import webbrowser
+
from askui.tools.agent_os import AgentOs
from askui.tools.askui.askui_hub import AskUIHub
@@ -21,15 +23,18 @@ class AgentToolbox:
httpx: HTTPX client for HTTP requests.
hub (AskUIHub): Internal AskUI Hub instance.
"""
+
def __init__(self, agent_os: AgentOs):
self.webbrowser = webbrowser
- self.clipboard: pyperclip = pyperclip
+ self.clipboard = pyperclip
self.agent_os = agent_os
self._hub = AskUIHub()
self.httpx = httpx
-
+
@property
def hub(self) -> AskUIHub:
if self._hub.disabled:
- raise ValueError("AskUI Hub is disabled. Please, set ASKUI_WORKSPACE_ID and ASKUI_TOKEN environment variables to enable it.")
+ raise ValueError(
+ "AskUI Hub is disabled. Please, set ASKUI_WORKSPACE_ID and ASKUI_TOKEN environment variables to enable it."
+ )
return self._hub
diff --git a/src/askui/tools/utils.py b/src/askui/tools/utils.py
index 22fbe4b9..5ee14480 100644
--- a/src/askui/tools/utils.py
+++ b/src/askui/tools/utils.py
@@ -3,7 +3,7 @@
import time
-def wait_for_port(port: int, host: str = 'localhost', timeout: float = 5.0):
+def wait_for_port(port: int, host: str = "localhost", timeout: float = 5.0) -> None:
"""Wait until a port starts accepting TCP connections.
Args:
port: Port number.
@@ -20,15 +20,17 @@ def wait_for_port(port: int, host: str = 'localhost', timeout: float = 5.0):
except OSError as ex:
time.sleep(0.01)
if time.perf_counter() - start_time >= timeout:
- raise TimeoutError('Waited too long for the port {} on host {} to start accepting '
- 'connections.'.format(port, host)) from ex
+ raise TimeoutError(
+ "Waited too long for the port {} on host {} to start accepting "
+ "connections.".format(port, host)
+ ) from ex
-def process_exists(process_name):
- call = 'TASKLIST', '/FI', 'imagename eq %s' % process_name
+def process_exists(process_name: str) -> bool:
+ call = "TASKLIST", "/FI", "imagename eq %s" % process_name
# use buildin check_output right away
- output = subprocess.check_output(call).decode("utf-16-le", errors='ignore')
+ output = subprocess.check_output(call).decode("utf-16-le", errors="ignore")
# check in last line for process name
- last_line = output.strip().split('\r\n')[-1]
+ last_line = output.strip().split("\r\n")[-1]
# because Fail message could be translated
return last_line.lower().startswith(process_name.lower())
diff --git a/src/askui/utils/image_utils.py b/src/askui/utils/image_utils.py
index 8de5b7db..dd447576 100644
--- a/src/askui/utils/image_utils.py
+++ b/src/askui/utils/image_utils.py
@@ -1,15 +1,15 @@
-from io import BytesIO
-import pathlib
-from typing import Any, Literal, Union, Tuple
-from pathlib import Path
-from PIL import Image, Image as PILImage, ImageDraw, ImageOps, UnidentifiedImageError
import base64
+import binascii
import io
+import pathlib
import re
-import binascii
-
-from pydantic import RootModel, field_validator, ConfigDict
+from io import BytesIO
+from pathlib import Path
+from typing import Any, Literal, Tuple, Union
+from PIL import Image, ImageDraw, ImageOps, UnidentifiedImageError
+from PIL import Image as PILImage
+from pydantic import ConfigDict, RootModel, field_validator
# Regex to capture any kind of valid base64 data url (with optional media type and ;base64)
# e.g., data:image/png;base64,... or data:;base64,... or data:,... or just ,...
@@ -270,7 +270,7 @@ class ImageSource(RootModel):
model_config = ConfigDict(arbitrary_types_allowed=True)
root: PILImage.Image
- def __init__(self, root: Img, **kwargs) -> None:
+ def __init__(self, root: Img, **kwargs: dict[str, Any]) -> None:
super().__init__(root=root, **kwargs)
@field_validator("root", mode="before")
diff --git a/src/askui/utils/str_utils.py b/src/askui/utils/str_utils.py
index 1a5491d4..12d8c84f 100644
--- a/src/askui/utils/str_utils.py
+++ b/src/askui/utils/str_utils.py
@@ -1,36 +1,40 @@
from typing import Any, TypeVar, overload
-T = TypeVar('T', dict[str, Any], list[Any], str)
+T = TypeVar("T", dict[str, Any], list[Any], str)
+
@overload
def truncate_long_strings(
json_data: dict[str, Any],
max_length: int = 100,
truncate_length: int = 20,
- tag: str = "[shortened]"
+ tag: str = "[shortened]",
) -> dict[str, Any]: ...
+
@overload
def truncate_long_strings(
json_data: list[Any],
max_length: int = 100,
truncate_length: int = 20,
- tag: str = "[shortened]"
+ tag: str = "[shortened]",
) -> list[Any]: ...
+
@overload
def truncate_long_strings(
json_data: str,
max_length: int = 100,
truncate_length: int = 20,
- tag: str = "[shortened]"
+ tag: str = "[shortened]",
) -> str: ...
+
def truncate_long_strings(
json_data: T,
max_length: int = 100,
truncate_length: int = 20,
- tag: str = "[shortened]"
+ tag: str = "[shortened]",
) -> T:
"""
Traverse and truncate long strings in JSON data.
@@ -47,17 +51,23 @@ def truncate_long_strings(
Examples:
>>> truncate_long_strings({"key": "a" * 101})
{'key': 'aaaaaaaaaaaaaaaaaaaa... [shortened]'}
-
+
>>> truncate_long_strings(["short", "a" * 101])
['short', 'aaaaaaaaaaaaaaaaaaaa... [shortened]']
-
+
>>> truncate_long_strings("a" * 101)
'aaaaaaaaaaaaaaaaaaaa... [shortened]'
"""
if isinstance(json_data, dict):
- return {k: truncate_long_strings(v, max_length, truncate_length, tag) for k, v in json_data.items()}
- elif isinstance(json_data, list):
- return [truncate_long_strings(item, max_length, truncate_length, tag) for item in json_data]
- elif isinstance(json_data, str) and len(json_data) > max_length:
+ return {
+ k: truncate_long_strings(v, max_length, truncate_length, tag)
+ for k, v in json_data.items()
+ }
+ if isinstance(json_data, list):
+ return [
+ truncate_long_strings(item, max_length, truncate_length, tag)
+ for item in json_data
+ ]
+ if isinstance(json_data, str) and len(json_data) > max_length:
return f"{json_data[:truncate_length]}... {tag}"
return json_data
diff --git a/tests/conftest.py b/tests/conftest.py
index ce33ac4d..d61c0e4e 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,4 +1,5 @@
import pathlib
+from typing import cast
import pytest
from PIL import Image
@@ -14,32 +15,39 @@ def path_fixtures() -> pathlib.Path:
"""Fixture providing the path to the fixtures directory."""
return pathlib.Path().absolute() / "tests" / "fixtures"
+
@pytest.fixture
def path_fixtures_images(path_fixtures: pathlib.Path) -> pathlib.Path:
"""Fixture providing the path to the images directory."""
return path_fixtures / "images"
+
@pytest.fixture
def path_fixtures_github_com__icon(path_fixtures_images: pathlib.Path) -> pathlib.Path:
"""Fixture providing the path to the github com icon image."""
return path_fixtures_images / "github_com__icon.png"
+
@pytest.fixture
def agent_os_mock(mocker: MockerFixture) -> AgentOs:
"""Fixture providing a mock agent os."""
mock = mocker.MagicMock(spec=AgentOs)
- mock.screenshot.return_value = Image.new('RGB', (100, 100), color='white')
- return mock
+ mock.screenshot.return_value = Image.new("RGB", (100, 100), color="white")
+ return cast("AgentOs", mock)
+
@pytest.fixture
def agent_toolbox_mock(agent_os_mock: AgentOs) -> AgentToolbox:
"""Fixture providing a mock agent toolbox."""
return AgentToolbox(agent_os=agent_os_mock)
+
@pytest.fixture
def model_router_mock(mocker: MockerFixture) -> ModelRouter:
"""Fixture providing a mock model router."""
mock = mocker.MagicMock(spec=ModelRouter)
mock.locate.return_value = (100, 100) # Return fixed point for all locate calls
- mock.get_inference.return_value = "Mock response" # Return fixed response for all get_inference calls
- return mock
+ mock.get_inference.return_value = (
+ "Mock response" # Return fixed response for all get_inference calls
+ )
+ return cast("ModelRouter", mock)
diff --git a/tests/e2e/agent/conftest.py b/tests/e2e/agent/conftest.py
index 6b7151e1..784fb9df 100644
--- a/tests/e2e/agent/conftest.py
+++ b/tests/e2e/agent/conftest.py
@@ -2,24 +2,30 @@
import pathlib
from typing import Generator, Optional, Union
-from typing_extensions import override
+
import pytest
from PIL import Image as PILImage
+from typing_extensions import override
from askui.agent import VisionAgent
+from askui.locators.serializers import AskUiLocatorSerializer
from askui.models.askui.ai_element_utils import AiElementCollection
from askui.models.askui.api import AskUiInferenceApi
-from askui.locators.serializers import AskUiLocatorSerializer
-from askui.models.router import ModelRouter, AskUiModelRouter
+from askui.models.router import AskUiModelRouter, ModelRouter
from askui.reporting import Reporter, SimpleHtmlReporter
from askui.tools.toolbox import AgentToolbox
class ReporterMock(Reporter):
@override
- def add_message(self, role: str, content: Union[str, dict, list], image: Optional[PILImage.Image | list[PILImage.Image]] = None) -> None:
+ def add_message(
+ self,
+ role: str,
+ content: Union[str, dict, list],
+ image: Optional[PILImage.Image | list[PILImage.Image]] = None,
+ ) -> None:
pass
-
+
@override
def generate(self) -> None:
pass
@@ -34,12 +40,14 @@ def vision_agent(
additional_ai_element_locations=[path_fixtures / "images"]
)
reporter = SimpleHtmlReporter()
- serializer = AskUiLocatorSerializer(ai_element_collection=ai_element_collection, reporter=reporter)
+ serializer = AskUiLocatorSerializer(
+ ai_element_collection=ai_element_collection, reporter=reporter
+ )
inference_api = AskUiInferenceApi(locator_serializer=serializer)
model_router = ModelRouter(
tools=agent_toolbox_mock,
reporter=reporter,
- grounding_model_routers=[AskUiModelRouter(inference_api=inference_api)]
+ grounding_model_routers=[AskUiModelRouter(inference_api=inference_api)],
)
with VisionAgent(
reporters=[reporter], model_router=model_router, tools=agent_toolbox_mock
diff --git a/tests/e2e/agent/test_get.py b/tests/e2e/agent/test_get.py
index 73ae576f..7d35005c 100644
--- a/tests/e2e/agent/test_get.py
+++ b/tests/e2e/agent/test_get.py
@@ -1,9 +1,10 @@
from typing import Literal
+
import pytest
from PIL import Image as PILImage
+
+from askui import ResponseSchemaBase, VisionAgent
from askui.models import ModelName
-from askui import VisionAgent
-from askui import ResponseSchemaBase
class UrlResponse(ResponseSchemaBase):
@@ -33,7 +34,9 @@ def test_get(
assert url in ["github.com/login", "https://github.com/login"]
-@pytest.mark.skip("Skip for now as this pops up in our observability systems as a false positive")
+@pytest.mark.skip(
+ "Skip for now as this pops up in our observability systems as a false positive"
+)
def test_get_with_response_schema_without_additional_properties_with_askui_model_raises(
vision_agent: VisionAgent,
github_login_screenshot: PILImage.Image,
@@ -47,7 +50,9 @@ def test_get_with_response_schema_without_additional_properties_with_askui_model
)
-@pytest.mark.skip("Skip for now as this pops up in our observability systems as a false positive")
+@pytest.mark.skip(
+ "Skip for now as this pops up in our observability systems as a false positive"
+)
def test_get_with_response_schema_without_required_with_askui_model_raises(
vision_agent: VisionAgent,
github_login_screenshot: PILImage.Image,
@@ -91,7 +96,9 @@ def test_get_with_response_schema_with_anthropic_model_raises_not_implemented(
@pytest.mark.parametrize("model", [ModelName.ASKUI])
-@pytest.mark.skip("Skip as there is currently a bug on the api side not supporting definitions used for nested schemas")
+@pytest.mark.skip(
+ "Skip as there is currently a bug on the api side not supporting definitions used for nested schemas"
+)
def test_get_with_nested_and_inherited_response_schema(
vision_agent: VisionAgent,
github_login_screenshot: PILImage.Image,
@@ -188,7 +195,7 @@ def test_get_returns_str_when_no_schema_specified(
class Basis(ResponseSchemaBase):
answer: str
-
+
@pytest.mark.parametrize("model", [ModelName.ASKUI])
def test_get_with_basis_schema(
@@ -203,4 +210,4 @@ def test_get_with_basis_schema(
model=model,
)
assert isinstance(response, Basis)
- assert response.answer != "\"What is the display showing?\""
+ assert response.answer != '"What is the display showing?"'
diff --git a/tests/e2e/agent/test_locate.py b/tests/e2e/agent/test_locate.py
index 0cf0d524..317451f4 100644
--- a/tests/e2e/agent/test_locate.py
+++ b/tests/e2e/agent/test_locate.py
@@ -1,18 +1,19 @@
"""Tests for VisionAgent.locate() with different locator types and models"""
import pathlib
+
import pytest
from PIL import Image as PILImage
from askui.agent import VisionAgent
+from askui.exceptions import ElementNotFoundError
from askui.locators import (
- Prompt,
+ AiElement,
Element,
+ Prompt,
Text,
- AiElement,
)
from askui.locators.locators import Image
-from askui.exceptions import ElementNotFoundError
from askui.models import ModelName
@@ -34,9 +35,7 @@ def test_locate_with_string_locator(
) -> None:
"""Test locating elements using a simple string locator."""
locator = "Forgot password?"
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 450 <= x <= 570
assert 190 <= y <= 260
@@ -48,9 +47,7 @@ def test_locate_with_textfield_class_locator(
) -> None:
"""Test locating elements using a class locator."""
locator = Element("textfield")
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 50 <= x <= 860 or 350 <= x <= 570
assert 0 <= y <= 80 or 160 <= y <= 280
@@ -62,9 +59,7 @@ def test_locate_with_unspecified_class_locator(
) -> None:
"""Test locating elements using a class locator."""
locator = Element()
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 0 <= x <= github_login_screenshot.width
assert 0 <= y <= github_login_screenshot.height
@@ -76,9 +71,7 @@ def test_locate_with_description_locator(
) -> None:
"""Test locating elements using a description locator."""
locator = Prompt("Username textfield")
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 160 <= y <= 230
@@ -90,9 +83,7 @@ def test_locate_with_similar_text_locator(
) -> None:
"""Test locating elements using a text locator."""
locator = Text("Forgot password?")
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 450 <= x <= 570
assert 190 <= y <= 260
@@ -104,9 +95,7 @@ def test_locate_with_typo_text_locator(
) -> None:
"""Test locating elements using a text locator with a typo."""
locator = Text("Forgot pasword", similarity_threshold=90)
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 450 <= x <= 570
assert 190 <= y <= 260
@@ -118,9 +107,7 @@ def test_locate_with_exact_text_locator(
) -> None:
"""Test locating elements using a text locator."""
locator = Text("Forgot password?", match_type="exact")
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 450 <= x <= 570
assert 190 <= y <= 260
@@ -132,9 +119,7 @@ def test_locate_with_regex_text_locator(
) -> None:
"""Test locating elements using a text locator."""
locator = Text(r"F.*?", match_type="regex")
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 450 <= x <= 570
assert 190 <= y <= 260
@@ -146,12 +131,10 @@ def test_locate_with_contains_text_locator(
) -> None:
"""Test locating elements using a text locator."""
locator = Text("Forgot", match_type="contains")
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 450 <= x <= 570
assert 190 <= y <= 260
-
+
def test_locate_with_image(
self,
vision_agent: VisionAgent,
@@ -165,9 +148,7 @@ def test_locate_with_image(
image_path = path_fixtures / "images" / "github_com__signin__button.png"
image = PILImage.open(image_path)
locator = Image(image=image)
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 240 <= y <= 320
@@ -189,11 +170,9 @@ def test_locate_with_image_and_custom_params(
stop_threshold=0.95,
rotation_degree_per_step=45,
image_compare_format="RGB",
- name="Sign in button"
- )
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
+ name="Sign in button",
)
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 240 <= y <= 320
@@ -209,11 +188,7 @@ def test_locate_with_image_should_fail_when_threshold_is_too_high(
pytest.skip("Skipping test for Anthropic model because not supported yet")
image_path = path_fixtures / "images" / "github_com__icon.png"
image = PILImage.open(image_path)
- locator = Image(
- image=image,
- threshold=1.0,
- stop_threshold=1.0
- )
+ locator = Image(image=image, threshold=1.0, stop_threshold=1.0)
with pytest.raises(ElementNotFoundError):
vision_agent.locate(locator, github_login_screenshot, model=model)
@@ -227,12 +202,10 @@ def test_locate_with_ai_element_locator(
if model in [ModelName.ANTHROPIC__CLAUDE__3_5__SONNET__20241022]:
pytest.skip("Skipping test for Anthropic model because not supported yet")
locator = AiElement("github_com__icon")
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 50 <= y <= 130
-
+
def test_locate_with_ai_element_locator_should_fail_when_threshold_is_too_high(
self,
vision_agent: VisionAgent,
diff --git a/tests/e2e/agent/test_locate_with_different_models.py b/tests/e2e/agent/test_locate_with_different_models.py
index 2a3b887e..7d0f1dee 100644
--- a/tests/e2e/agent/test_locate_with_different_models.py
+++ b/tests/e2e/agent/test_locate_with_different_models.py
@@ -4,12 +4,12 @@
from PIL import Image as PILImage
from askui.agent import VisionAgent
+from askui.exceptions import AutomationError
from askui.locators import (
+ AiElement,
Prompt,
Text,
- AiElement,
)
-from askui.exceptions import AutomationError
from askui.models.models import ModelName
@@ -25,9 +25,7 @@ def test_locate_with_pta_model(
) -> None:
"""Test locating elements using PTA model with description locator."""
locator = "Username textfield"
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 160 <= y <= 230
@@ -52,9 +50,7 @@ def test_locate_with_ocr_model(
) -> None:
"""Test locating elements using OCR model with text locator."""
locator = "Forgot password?"
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 450 <= x <= 570
assert 190 <= y <= 260
@@ -79,9 +75,7 @@ def test_locate_with_ai_element_model(
) -> None:
"""Test locating elements using AI element model."""
locator = "github_com__signin__button"
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 240 <= y <= 320
@@ -106,9 +100,7 @@ def test_locate_with_combo_model_description_first(
) -> None:
"""Test locating elements using combo model with description locator."""
locator = "Username textfield"
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 160 <= y <= 230
@@ -121,9 +113,7 @@ def test_locate_with_combo_model_text_fallback(
) -> None:
"""Test locating elements using combo model with text locator as fallback."""
locator = "Forgot password?"
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 450 <= x <= 570
assert 190 <= y <= 260
diff --git a/tests/e2e/agent/test_locate_with_relations.py b/tests/e2e/agent/test_locate_with_relations.py
index 21a5425e..8d70d4f2 100644
--- a/tests/e2e/agent/test_locate_with_relations.py
+++ b/tests/e2e/agent/test_locate_with_relations.py
@@ -1,17 +1,19 @@
"""Tests for VisionAgent.locate() with different locator types and models"""
import pathlib
+
import pytest
from PIL import Image as PILImage
-from askui.locators.locators import AiElement
-from askui.exceptions import ElementNotFoundError
+
from askui.agent import VisionAgent
+from askui.exceptions import ElementNotFoundError
from askui.locators import (
- Prompt,
Element,
- Text,
Image,
+ Prompt,
+ Text,
)
+from askui.locators.locators import AiElement
@pytest.mark.parametrize(
@@ -31,9 +33,7 @@ def test_locate_with_above_relation(
) -> None:
"""Test locating elements using above_of relation."""
locator = Text("Forgot password?").above_of(Element("textfield"))
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 450 <= x <= 570
assert 190 <= y <= 260
@@ -45,9 +45,7 @@ def test_locate_with_below_relation(
) -> None:
"""Test locating elements using below_of relation."""
locator = Text("Forgot password?").below_of(Element("textfield"))
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 450 <= x <= 570
assert 190 <= y <= 260
@@ -59,9 +57,7 @@ def test_locate_with_right_relation(
) -> None:
"""Test locating elements using right_of relation."""
locator = Text("Forgot password?").right_of(Text("Password"))
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 450 <= x <= 570
assert 190 <= y <= 260
@@ -73,9 +69,7 @@ def test_locate_with_left_relation(
) -> None:
"""Test locating elements using left_of relation."""
locator = Text("Password").left_of(Text("Forgot password?"))
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 450
assert 190 <= y <= 260
@@ -87,9 +81,7 @@ def test_locate_with_containing_relation(
) -> None:
"""Test locating elements using containing relation."""
locator = Element("textfield").containing(Text("github.com/login"))
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 50 <= x <= 860
assert 0 <= y <= 80
@@ -101,9 +93,7 @@ def test_locate_with_inside_relation(
) -> None:
"""Test locating elements using inside_of relation."""
locator = Text("github.com/login").inside_of(Element("textfield"))
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 70 <= x <= 200
assert 10 <= y <= 75
@@ -115,9 +105,7 @@ def test_locate_with_nearest_to_relation(
) -> None:
"""Test locating elements using nearest_to relation."""
locator = Element("textfield").nearest_to(Text("Password"))
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 210 <= y <= 280
@@ -130,9 +118,7 @@ def test_locate_with_and_relation(
) -> None:
"""Test locating elements using and_ relation."""
locator = Text("Forgot password?").and_(Element("text"))
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 450 <= x <= 570
assert 190 <= y <= 260
@@ -146,9 +132,7 @@ def test_locate_with_or_relation(
locator = Element("textfield").nearest_to(
Text("Password").or_(Text("Username or email address"))
)
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 160 <= y <= 280
@@ -162,9 +146,7 @@ def test_locate_with_relation_index(
locator = Element("textfield").below_of(
Text("Username or email address"), index=0
)
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 160 <= y <= 230
@@ -176,9 +158,7 @@ def test_locate_with_relation_index_greater_0(
) -> None:
"""Test locating elements using relation with index."""
locator = Element("textfield").below_of(Element("textfield"), index=1)
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 210 <= y <= 280
@@ -191,9 +171,7 @@ def test_locate_with_relation_index_greater_1(
) -> None:
"""Test locating elements using relation with index."""
locator = Text("Sign in").below_of(Text(), index=4, reference_point="any")
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 420 <= x <= 500
assert 250 <= y <= 310
@@ -207,9 +185,7 @@ def test_locate_with_relation_reference_point_center(
locator = Text("Forgot password?").right_of(
Text("Password"), reference_point="center"
)
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 450 <= x <= 570
assert 190 <= y <= 260
@@ -234,9 +210,7 @@ def test_locate_with_relation_reference_point_boundary(
locator = Text("Forgot password?").right_of(
Text("Password"), reference_point="boundary"
)
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 450 <= x <= 570
assert 190 <= y <= 260
@@ -259,9 +233,7 @@ def test_locate_with_relation_reference_point_any(
) -> None:
"""Test locating elements using relation with any reference point."""
locator = Text("Sign in").below_of(Text("Password"), reference_point="any")
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 420 <= x <= 500
assert 250 <= y <= 310
@@ -291,9 +263,7 @@ def test_locate_with_chained_relations(
Text("Password").below_of(Text("Username or email address")),
reference_point="any",
)
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 420 <= x <= 500
assert 250 <= y <= 310
@@ -308,9 +278,7 @@ def test_locate_with_relation_different_locator_types(
Element("textfield").below_of(Text("Username or email address")),
reference_point="center",
)
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 420 <= x <= 500
assert 250 <= y <= 310
@@ -322,9 +290,7 @@ def test_locate_with_description_and_relation(
) -> None:
"""Test locating elements using description with relation."""
locator = Prompt("Sign in button").below_of(Prompt("Password field"))
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 240 <= y <= 320
@@ -339,9 +305,7 @@ def test_locate_with_description_and_complex_relation(
locator = Prompt("Sign in button").below_of(
Element("textfield").below_of(Text("Password"))
)
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 240 <= y <= 320
@@ -356,9 +320,7 @@ def test_locate_with_image_and_relation(
image_path = path_fixtures / "images" / "github_com__signin__button.png"
image = PILImage.open(image_path)
locator = Image(image=image).containing(Text("Sign in"))
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 240 <= y <= 320
@@ -371,14 +333,14 @@ def test_locate_with_image_in_relation_to_other_image(
) -> None:
"""Test locating elements using image locator with relation."""
github_icon_image_path = path_fixtures / "images" / "github_com__icon.png"
- signin_button_image_path = path_fixtures / "images" / "github_com__signin__button.png"
+ signin_button_image_path = (
+ path_fixtures / "images" / "github_com__signin__button.png"
+ )
github_icon_image = PILImage.open(github_icon_image_path)
signin_button_image = PILImage.open(signin_button_image_path)
github_icon = Image(image=github_icon_image)
signin_button = Image(image=signin_button_image).below_of(github_icon)
- x, y = vision_agent.locate(
- signin_button, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(signin_button, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 240 <= y <= 320
@@ -395,9 +357,7 @@ def test_locate_with_image_and_complex_relation(
locator = Image(image=image).below_of(
Element("textfield").below_of(Text("Password"))
)
- x, y = vision_agent.locate(
- locator, github_login_screenshot, model=model
- )
+ x, y = vision_agent.locate(locator, github_login_screenshot, model=model)
assert 350 <= x <= 570
assert 240 <= y <= 320
diff --git a/tests/e2e/agent/test_model_composition.py b/tests/e2e/agent/test_model_composition.py
index 8ae8b165..0bab9ac1 100644
--- a/tests/e2e/agent/test_model_composition.py
+++ b/tests/e2e/agent/test_model_composition.py
@@ -2,8 +2,10 @@
import pytest
from PIL import Image as PILImage
+
from askui.agent import VisionAgent
-from askui.locators.locators import DEFAULT_SIMILARITY_THRESHOLD, Text
+from askui.locators import Text
+from askui.locators.locators import DEFAULT_SIMILARITY_THRESHOLD
from askui.models import ModelComposition, ModelDefinition
@@ -104,8 +106,24 @@ def test_locate_with_trained_word_level_ocr_with_non_default_text_raises(
if any("trained" not in m.tags for m in model):
pytest.skip("Skipping test for non-trained model")
with pytest.raises(Exception):
- vision_agent.locate(Text("Sign in", text_type="exact"), github_login_screenshot, model=model)
- vision_agent.locate(Text("Sign in", text_type="regex"), github_login_screenshot, model=model)
- vision_agent.locate(Text("Sign in", text_type="contains"), github_login_screenshot, model=model)
+ vision_agent.locate(
+ Text("Sign in", match_type="exact"),
+ github_login_screenshot,
+ model=model,
+ )
+ vision_agent.locate(
+ Text("Sign in", match_type="regex"),
+ github_login_screenshot,
+ model=model,
+ )
+ vision_agent.locate(
+ Text("Sign in", match_type="contains"),
+ github_login_screenshot,
+ model=model,
+ )
assert DEFAULT_SIMILARITY_THRESHOLD != 80
- vision_agent.locate(Text("Sign in", similarity_threshold=80), github_login_screenshot, model=model)
+ vision_agent.locate(
+ Text("Sign in", similarity_threshold=80),
+ github_login_screenshot,
+ model=model,
+ )
diff --git a/tests/integration/tools/askui/test_askui_controller.py b/tests/integration/tools/askui/test_askui_controller.py
index 41cd1fd2..52bc178b 100644
--- a/tests/integration/tools/askui/test_askui_controller.py
+++ b/tests/integration/tools/askui/test_askui_controller.py
@@ -1,19 +1,23 @@
+from pathlib import Path
+
import pytest
+
from askui.reporting import CompositeReporter
from askui.tools.askui.askui_controller import (
AskUiControllerClient,
AskUiControllerServer,
)
-from pathlib import Path
@pytest.fixture
-def controller_server():
+def controller_server() -> AskUiControllerServer:
return AskUiControllerServer()
@pytest.fixture
-def controller_client(controller_server: AskUiControllerServer):
+def controller_client(
+ controller_server: AskUiControllerServer,
+) -> AskUiControllerClient:
return AskUiControllerClient(
reporter=CompositeReporter(),
display=1,
@@ -23,14 +27,14 @@ def controller_client(controller_server: AskUiControllerServer):
def test_find_remote_device_controller_by_component_registry(
controller_server: AskUiControllerServer,
-):
+) -> None:
remote_device_controller_path = Path(
controller_server._find_remote_device_controller_by_component_registry()
)
assert "AskuiRemoteDeviceController" == remote_device_controller_path.stem
-def test_actions(controller_client: AskUiControllerClient):
+def test_actions(controller_client: AskUiControllerClient) -> None:
with controller_client:
controller_client.screenshot()
controller_client.mouse(0, 0)
diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py
index d7f6efef..a4699d3a 100644
--- a/tests/unit/conftest.py
+++ b/tests/unit/conftest.py
@@ -1,6 +1,7 @@
import pytest
+
@pytest.fixture(autouse=True)
def set_env_variable(monkeypatch: pytest.MonkeyPatch) -> None:
- monkeypatch.setenv('ASKUI__VA__TELEMETRY__ENABLED', 'False')
- monkeypatch.setenv('ASKUI_WORKSPACE_ID', 'test_workspace_id')
+ monkeypatch.setenv("ASKUI__VA__TELEMETRY__ENABLED", "False")
+ monkeypatch.setenv("ASKUI_WORKSPACE_ID", "test_workspace_id")
diff --git a/tests/unit/locators/serializers/test_askui_locator_serializer.py b/tests/unit/locators/serializers/test_askui_locator_serializer.py
index 2d59bc03..e10412f3 100644
--- a/tests/unit/locators/serializers/test_askui_locator_serializer.py
+++ b/tests/unit/locators/serializers/test_askui_locator_serializer.py
@@ -1,17 +1,17 @@
import pathlib
import re
+
import pytest
from PIL import Image as PILImage
from pytest_mock import MockerFixture
+from askui.locators import Element, Image, Prompt, Text
from askui.locators.locators import Locator
-from askui.locators import Element, Prompt, Text, Image
+from askui.locators.relatable import CircularDependencyError
from askui.locators.serializers import AskUiLocatorSerializer
from askui.models.askui.ai_element_utils import AiElementCollection
-from askui.utils.image_utils import image_to_base64
from askui.reporting import CompositeReporter
-from askui.locators.relatable import CircularDependencyError
-
+from askui.utils.image_utils import image_to_base64
TEST_IMAGE = PILImage.new("RGB", (100, 100), color="red")
TEST_IMAGE_BASE64 = image_to_base64(TEST_IMAGE)
@@ -21,25 +21,30 @@
def askui_serializer(path_fixtures: pathlib.Path) -> AskUiLocatorSerializer:
return AskUiLocatorSerializer(
ai_element_collection=AiElementCollection(
- additional_ai_element_locations=[
- path_fixtures / "images"
- ]
+ additional_ai_element_locations=[path_fixtures / "images"]
),
- reporter=CompositeReporter()
+ reporter=CompositeReporter(),
)
-
-def test_serialize_text_without_content(askui_serializer: AskUiLocatorSerializer) -> None:
+
+def test_serialize_text_without_content(
+ askui_serializer: AskUiLocatorSerializer,
+) -> None:
text = Text()
result = askui_serializer.serialize(text)
assert result["instruction"] == "text"
assert result["customElements"] == []
-
-def test_serialize_text_without_content_in_relation(askui_serializer: AskUiLocatorSerializer) -> None:
+
+def test_serialize_text_without_content_in_relation(
+ askui_serializer: AskUiLocatorSerializer,
+) -> None:
locator = Text().right_of(Text("Name"))
result = askui_serializer.serialize(locator)
- assert result["instruction"] == "text index 0 right of intersection_area element_center_line text <|string|>Name<|string|>"
+ assert (
+ result["instruction"]
+ == "text index 0 right of intersection_area element_center_line text <|string|>Name<|string|>"
+ )
assert result["customElements"] == []
@@ -88,7 +93,9 @@ def test_serialize_description(askui_serializer: AskUiLocatorSerializer) -> None
assert result["customElements"] == []
-CUSTOM_ELEMENT_STR_PATTERN = re.compile(r'^custom element with text <|string|>.*<|string|>$')
+CUSTOM_ELEMENT_STR_PATTERN = re.compile(
+ r"^custom element with text <|string|>.*<|string|>$"
+)
def test_serialize_image(askui_serializer: AskUiLocatorSerializer) -> None:
@@ -119,7 +126,10 @@ def test_serialize_image_with_all_options(
name="test_image",
)
result = askui_serializer.serialize(image)
- assert result["instruction"] == "custom element with text <|string|>test_image<|string|>"
+ assert (
+ result["instruction"]
+ == "custom element with text <|string|>test_image<|string|>"
+ )
assert len(result["customElements"]) == 1
custom_element = result["customElements"][0]
assert custom_element["customImage"] == f"data:image/png;base64,{TEST_IMAGE_BASE64}"
@@ -268,7 +278,9 @@ class UnsupportedLocator(Locator):
askui_serializer.serialize(UnsupportedLocator())
-def test_serialize_simple_cycle_raises(askui_serializer: AskUiLocatorSerializer) -> None:
+def test_serialize_simple_cycle_raises(
+ askui_serializer: AskUiLocatorSerializer,
+) -> None:
text1 = Text("hello")
text2 = Text("world")
text1.above_of(text2)
@@ -277,7 +289,9 @@ def test_serialize_simple_cycle_raises(askui_serializer: AskUiLocatorSerializer)
askui_serializer.serialize(text1)
-def test_serialize_self_reference_cycle_raises(askui_serializer: AskUiLocatorSerializer) -> None:
+def test_serialize_self_reference_cycle_raises(
+ askui_serializer: AskUiLocatorSerializer,
+) -> None:
text = Text("hello")
text.above_of(text)
with pytest.raises(CircularDependencyError):
@@ -295,11 +309,13 @@ def test_serialize_deep_cycle_raises(askui_serializer: AskUiLocatorSerializer) -
askui_serializer.serialize(text1)
-def test_serialize_cycle_detection_called_once(askui_serializer: AskUiLocatorSerializer, mocker: MockerFixture) -> None:
+def test_serialize_cycle_detection_called_once(
+ askui_serializer: AskUiLocatorSerializer, mocker: MockerFixture
+) -> None:
text1 = Text("hello")
- mocked_text1 = mocker.patch.object(text1, '_has_cycle')
+ mocked_text1 = mocker.patch.object(text1, "_has_cycle")
text2 = Text("world")
- mocked_text2 = mocker.patch.object(text2, '_has_cycle')
+ mocked_text2 = mocker.patch.object(text2, "_has_cycle")
text1.above_of(text2)
text2.above_of(text1)
with pytest.raises(CircularDependencyError):
@@ -308,7 +324,9 @@ def test_serialize_cycle_detection_called_once(askui_serializer: AskUiLocatorSer
mocked_text2.assert_not_called()
-def test_serialize_image_with_cycle_raises(askui_serializer: AskUiLocatorSerializer) -> None:
+def test_serialize_image_with_cycle_raises(
+ askui_serializer: AskUiLocatorSerializer,
+) -> None:
image1 = Image(TEST_IMAGE, name="image1")
image2 = Image(TEST_IMAGE, name="image2")
image1.above_of(image2)
@@ -317,7 +335,9 @@ def test_serialize_image_with_cycle_raises(askui_serializer: AskUiLocatorSeriali
askui_serializer.serialize(image1)
-def test_serialize_mixed_locator_types_cycle_raises(askui_serializer: AskUiLocatorSerializer) -> None:
+def test_serialize_mixed_locator_types_cycle_raises(
+ askui_serializer: AskUiLocatorSerializer,
+) -> None:
text = Text("hello")
image = Image(TEST_IMAGE, name="image")
text.above_of(image)
@@ -370,8 +390,14 @@ def test_serialize_multiple_images_with_relation(
assert len(result["customElements"]) == 2
assert result["customElements"][0]["name"] == "image1"
assert result["customElements"][1]["name"] == "image2"
- assert result["customElements"][0]["customImage"] == f"data:image/png;base64,{TEST_IMAGE_BASE64}"
- assert result["customElements"][1]["customImage"] == f"data:image/png;base64,{TEST_IMAGE_BASE64}"
+ assert (
+ result["customElements"][0]["customImage"]
+ == f"data:image/png;base64,{TEST_IMAGE_BASE64}"
+ )
+ assert (
+ result["customElements"][1]["customImage"]
+ == f"data:image/png;base64,{TEST_IMAGE_BASE64}"
+ )
def test_serialize_images_with_non_neighbor_relation(
@@ -388,5 +414,11 @@ def test_serialize_images_with_non_neighbor_relation(
assert len(result["customElements"]) == 2
assert result["customElements"][0]["name"] == "image1"
assert result["customElements"][1]["name"] == "image2"
- assert result["customElements"][0]["customImage"] == f"data:image/png;base64,{TEST_IMAGE_BASE64}"
- assert result["customElements"][1]["customImage"] == f"data:image/png;base64,{TEST_IMAGE_BASE64}"
+ assert (
+ result["customElements"][0]["customImage"]
+ == f"data:image/png;base64,{TEST_IMAGE_BASE64}"
+ )
+ assert (
+ result["customElements"][1]["customImage"]
+ == f"data:image/png;base64,{TEST_IMAGE_BASE64}"
+ )
diff --git a/tests/unit/locators/serializers/test_locator_string_representation.py b/tests/unit/locators/serializers/test_locator_string_representation.py
index 6529714f..123f9a01 100644
--- a/tests/unit/locators/serializers/test_locator_string_representation.py
+++ b/tests/unit/locators/serializers/test_locator_string_representation.py
@@ -1,9 +1,10 @@
import re
+
import pytest
-from askui.locators import Element, Prompt, Text, Image
-from askui.locators.relatable import CircularDependencyError
from PIL import Image as PILImage
+from askui.locators import Element, Image, Prompt, Text
+from askui.locators.relatable import CircularDependencyError
TEST_IMAGE = PILImage.new("RGB", (100, 100), color="red")
@@ -178,7 +179,9 @@ def test_complex_relation_chain_str() -> None:
)
-IMAGE_STR_PATTERN = re.compile(r'^element ".*" located by image \(threshold: \d+\.\d+, stop_threshold: \d+\.\d+, rotation_degree_per_step: \d+, image_compare_format: \w+, mask: None\)$')
+IMAGE_STR_PATTERN = re.compile(
+ r'^element ".*" located by image \(threshold: \d+\.\d+, stop_threshold: \d+\.\d+, rotation_degree_per_step: \d+, image_compare_format: \w+, mask: None\)$'
+)
def test_image_str() -> None:
@@ -188,15 +191,24 @@ def test_image_str() -> None:
def test_image_with_name_str() -> None:
image = Image(TEST_IMAGE, name="test_image")
- assert str(image) == 'element "test_image" located by image (threshold: 0.5, stop_threshold: 0.5, rotation_degree_per_step: 0, image_compare_format: grayscale, mask: None)'
+ assert (
+ str(image)
+ == 'element "test_image" located by image (threshold: 0.5, stop_threshold: 0.5, rotation_degree_per_step: 0, image_compare_format: grayscale, mask: None)'
+ )
def test_image_with_relation_str() -> None:
image = Image(TEST_IMAGE, name="image")
image.above_of(Text("hello"))
lines = str(image).split("\n")
- assert lines[0] == 'element "image" located by image (threshold: 0.5, stop_threshold: 0.5, rotation_degree_per_step: 0, image_compare_format: grayscale, mask: None)'
- assert lines[1] == ' 1. above of boundary of the 1st text similar to "hello" (similarity >= 70%)'
+ assert (
+ lines[0]
+ == 'element "image" located by image (threshold: 0.5, stop_threshold: 0.5, rotation_degree_per_step: 0, image_compare_format: grayscale, mask: None)'
+ )
+ assert (
+ lines[1]
+ == ' 1. above of boundary of the 1st text similar to "hello" (similarity >= 70%)'
+ )
def test_simple_cycle_str() -> None:
@@ -231,7 +243,10 @@ def test_multiple_references_no_cycle_str() -> None:
textfield = Element("textfield")
textfield.right_of(heading)
textfield.below_of(heading)
- assert str(textfield) == 'element with class "textfield"\n 1. right of center of the 1st text similar to "heading" (similarity >= 70%)\n 2. below of boundary of the 1st text similar to "heading" (similarity >= 70%)'
+ assert (
+ str(textfield)
+ == 'element with class "textfield"\n 1. right of center of the 1st text similar to "heading" (similarity >= 70%)\n 2. below of boundary of the 1st text similar to "heading" (similarity >= 70%)'
+ )
def test_image_cycle_str() -> None:
diff --git a/tests/unit/locators/serializers/test_vlm_locator_serializer.py b/tests/unit/locators/serializers/test_vlm_locator_serializer.py
index 86e70c1d..e62462fc 100644
--- a/tests/unit/locators/serializers/test_vlm_locator_serializer.py
+++ b/tests/unit/locators/serializers/test_vlm_locator_serializer.py
@@ -1,14 +1,12 @@
import pytest
-from askui.locators.locators import Locator
+from PIL import Image as PILImage
+
from askui.locators import Element, Prompt, Text
-from askui.locators.locators import Image
+from askui.locators.locators import Image, Locator
from askui.locators.relatable import CircularDependencyError
from askui.locators.serializers import VlmLocatorSerializer
-from PIL import Image as PILImage
-
-
-TEST_IMAGE = PILImage.new('RGB', (100, 100), color='red')
+TEST_IMAGE = PILImage.new("RGB", (100, 100), color="red")
@pytest.fixture
@@ -90,7 +88,9 @@ def test_serialize_simple_cycle_raises(vlm_serializer: VlmLocatorSerializer) ->
vlm_serializer.serialize(text1)
-def test_serialize_self_reference_cycle_raises(vlm_serializer: VlmLocatorSerializer) -> None:
+def test_serialize_self_reference_cycle_raises(
+ vlm_serializer: VlmLocatorSerializer,
+) -> None:
text = Text("hello")
text.above_of(text)
with pytest.raises(CircularDependencyError):
diff --git a/tests/unit/locators/test_locators.py b/tests/unit/locators/test_locators.py
index 14eeffff..7aee9024 100644
--- a/tests/unit/locators/test_locators.py
+++ b/tests/unit/locators/test_locators.py
@@ -1,10 +1,10 @@
-from pathlib import Path
import re
+from pathlib import Path
+
import pytest
from PIL import Image as PILImage
-from askui.locators import Prompt, Element, Text, Image, AiElement
-
+from askui.locators import AiElement, Element, Image, Prompt, Text
TEST_IMAGE_PATH = Path("tests/fixtures/images/github_com__icon.png")
@@ -19,6 +19,10 @@ def test_initialization_without_description_raises(self) -> None:
with pytest.raises(ValueError):
Prompt() # type: ignore
+ def test_initialization_with_empty_description_raises(self) -> None:
+ with pytest.raises(ValueError):
+ Prompt("")
+
def test_initialization_with_positional_arg(self) -> None:
desc = Prompt("test")
assert desc._prompt == "test"
@@ -110,8 +114,10 @@ class TestImageLocator:
@pytest.fixture
def test_image(self) -> PILImage.Image:
return PILImage.open(TEST_IMAGE_PATH)
-
- _STR_PATTERN = re.compile(r'^element ".*" located by image \(threshold: \d+\.\d+, stop_threshold: \d+\.\d+, rotation_degree_per_step: \d+, image_compare_format: \w+, mask: None\)$')
+
+ _STR_PATTERN = re.compile(
+ r'^element ".*" located by image \(threshold: \d+\.\d+, stop_threshold: \d+\.\d+, rotation_degree_per_step: \d+, image_compare_format: \w+, mask: None\)$'
+ )
def test_initialization_with_basic_params(self, test_image: PILImage.Image) -> None:
locator = Image(image=test_image)
@@ -125,27 +131,35 @@ def test_initialization_with_basic_params(self, test_image: PILImage.Image) -> N
def test_initialization_with_name(self, test_image: PILImage.Image) -> None:
locator = Image(image=test_image, name="test")
- assert str(locator) == 'element "test" located by image (threshold: 0.5, stop_threshold: 0.5, rotation_degree_per_step: 0, image_compare_format: grayscale, mask: None)'
+ assert (
+ str(locator)
+ == 'element "test" located by image (threshold: 0.5, stop_threshold: 0.5, rotation_degree_per_step: 0, image_compare_format: grayscale, mask: None)'
+ )
- def test_initialization_with_custom_params(self, test_image: PILImage.Image) -> None:
+ def test_initialization_with_custom_params(
+ self, test_image: PILImage.Image
+ ) -> None:
locator = Image(
image=test_image,
threshold=0.7,
stop_threshold=0.95,
mask=[(0, 0), (1, 0), (1, 1)],
rotation_degree_per_step=45,
- image_compare_format="RGB"
+ image_compare_format="RGB",
)
assert locator._threshold == 0.7
assert locator._stop_threshold == 0.95
assert locator._mask == [(0, 0), (1, 0), (1, 1)]
assert locator._rotation_degree_per_step == 45
assert locator._image_compare_format == "RGB"
- assert re.match(r'^element "anonymous image [a-f0-9-]+" located by image \(threshold: 0.7, stop_threshold: 0.95, rotation_degree_per_step: 45, image_compare_format: RGB, mask: \[\(0.0, 0.0\), \(1.0, 0.0\), \(1.0, 1.0\)\]\)$', str(locator))
+ assert re.match(
+ r'^element "anonymous image [a-f0-9-]+" located by image \(threshold: 0.7, stop_threshold: 0.95, rotation_degree_per_step: 45, image_compare_format: RGB, mask: \[\(0.0, 0.0\), \(1.0, 0.0\), \(1.0, 1.0\)\]\)$',
+ str(locator),
+ )
def test_initialization_with_invalid_args(self, test_image: PILImage.Image) -> None:
with pytest.raises(ValueError):
- Image(image="not_an_image") # type: ignore
+ Image(image="not_an_image")
with pytest.raises(ValueError):
Image(image=test_image, threshold=-0.1)
@@ -176,7 +190,10 @@ class TestAiElementLocator:
def test_initialization_with_name(self) -> None:
locator = AiElement("github_com__icon")
assert locator._name == "github_com__icon"
- assert str(locator) == 'ai element named "github_com__icon" (threshold: 0.5, stop_threshold: 0.5, rotation_degree_per_step: 0, image_compare_format: grayscale, mask: None)'
+ assert (
+ str(locator)
+ == 'ai element named "github_com__icon" (threshold: 0.5, stop_threshold: 0.5, rotation_degree_per_step: 0, image_compare_format: grayscale, mask: None)'
+ )
def test_initialization_without_name_raises(self) -> None:
with pytest.raises(ValueError):
@@ -193,7 +210,7 @@ def test_initialization_with_custom_params(self) -> None:
stop_threshold=0.95,
mask=[(0, 0), (1, 0), (1, 1)],
rotation_degree_per_step=45,
- image_compare_format="RGB"
+ image_compare_format="RGB",
)
assert locator._name == "test_element"
assert locator._threshold == 0.7
@@ -201,7 +218,10 @@ def test_initialization_with_custom_params(self) -> None:
assert locator._mask == [(0, 0), (1, 0), (1, 1)]
assert locator._rotation_degree_per_step == 45
assert locator._image_compare_format == "RGB"
- assert str(locator) == 'ai element named "test_element" (threshold: 0.7, stop_threshold: 0.95, rotation_degree_per_step: 45, image_compare_format: RGB, mask: [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0)])'
+ assert (
+ str(locator)
+ == 'ai element named "test_element" (threshold: 0.7, stop_threshold: 0.95, rotation_degree_per_step: 45, image_compare_format: RGB, mask: [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0)])'
+ )
def test_initialization_with_invalid_threshold(self) -> None:
with pytest.raises(ValueError):
@@ -233,4 +253,4 @@ def test_initialization_with_invalid_mask(self) -> None:
AiElement(name="test", mask=[(0, 0), (1)]) # type: ignore
with pytest.raises(ValueError):
- AiElement(name="test", mask=[(0, 0)]) # type: ignore
+ AiElement(name="test", mask=[(0, 0)])
diff --git a/tests/unit/models/test_models.py b/tests/unit/models/test_models.py
index c28402f9..5af26b79 100644
--- a/tests/unit/models/test_models.py
+++ b/tests/unit/models/test_models.py
@@ -1,6 +1,6 @@
import pytest
-from src.askui.models.models import ModelComposition, ModelDefinition
+from askui.models.models import ModelComposition, ModelDefinition
MODEL_DEFINITIONS = {
"e2e_ocr": ModelDefinition(
@@ -9,32 +9,43 @@
version="1",
interface="online_learning",
use_case="test_workspace",
- tags=["trained"]
+ tags=["trained"],
),
"od": ModelDefinition(
task="od",
architecture="yolo",
version="789012",
interface="offline_learning",
- use_case="test_workspace2"
- )
+ use_case="test_workspace2",
+ ),
}
-def test_model_composition_initialization():
+def test_model_composition_initialization() -> None:
composition = ModelComposition([MODEL_DEFINITIONS["e2e_ocr"]])
assert len(composition.root) == 1
- assert composition.root[0].model_name == "e2e_ocr-easy_ocr-online_learning-test_workspace-1-trained"
+ assert (
+ composition.root[0].model_name
+ == "e2e_ocr-easy_ocr-online_learning-test_workspace-1-trained"
+ )
-def test_model_composition_initialization_with_multiple_models():
- composition = ModelComposition([MODEL_DEFINITIONS["e2e_ocr"], MODEL_DEFINITIONS["od"]])
+def test_model_composition_initialization_with_multiple_models() -> None:
+ composition = ModelComposition(
+ [MODEL_DEFINITIONS["e2e_ocr"], MODEL_DEFINITIONS["od"]]
+ )
assert len(composition.root) == 2
- assert composition.root[0].model_name == "e2e_ocr-easy_ocr-online_learning-test_workspace-1-trained"
- assert composition.root[1].model_name == "od-yolo-offline_learning-test_workspace2-789012"
+ assert (
+ composition.root[0].model_name
+ == "e2e_ocr-easy_ocr-online_learning-test_workspace-1-trained"
+ )
+ assert (
+ composition.root[1].model_name
+ == "od-yolo-offline_learning-test_workspace2-789012"
+ )
-def test_model_composition_serialization():
+def test_model_composition_serialization() -> None:
model_def = MODEL_DEFINITIONS["e2e_ocr"]
composition = ModelComposition([model_def])
serialized = composition.model_dump(by_alias=True)
@@ -48,8 +59,10 @@ def test_model_composition_serialization():
assert serialized[0]["tags"] == ["trained"]
-def test_model_composition_serialization_with_multiple_models():
- composition = ModelComposition([MODEL_DEFINITIONS["e2e_ocr"], MODEL_DEFINITIONS["od"]])
+def test_model_composition_serialization_with_multiple_models() -> None:
+ composition = ModelComposition(
+ [MODEL_DEFINITIONS["e2e_ocr"], MODEL_DEFINITIONS["od"]]
+ )
serialized = composition.model_dump(by_alias=True)
assert isinstance(serialized, list)
assert len(serialized) == 2
@@ -57,29 +70,45 @@ def test_model_composition_serialization_with_multiple_models():
assert serialized[1]["task"] == "od"
-def test_model_composition_validation_with_invalid_task():
+def test_model_composition_validation_with_invalid_task() -> None:
with pytest.raises(ValueError):
- ModelComposition([{
- "task": "invalid task!",
- "architecture": "easy_ocr",
- "version": "123456",
- "interface": "online_learning",
- "useCase": "test_workspace"
- }])
-
-
-def test_model_composition_validation_with_invalid_version():
+ ModelComposition(
+ [
+ { # type: ignore
+ "task": "invalid task!",
+ "architecture": "easy_ocr",
+ "version": "123456",
+ "interface": "online_learning",
+ "useCase": "test_workspace",
+ }
+ ]
+ )
+
+
+def test_model_composition_validation_with_invalid_version() -> None:
with pytest.raises(ValueError):
- ModelComposition([{
- "task": "e2e_ocr",
- "architecture": "easy_ocr",
- "version": "invalid",
- "interface": "online_learning",
- "useCase": "test_workspace"
- }])
-
-
-def test_model_composition_with_empty_tags_and_use_case():
- model_def = ModelDefinition(**{**MODEL_DEFINITIONS["e2e_ocr"].model_dump(exclude={"tags", "use_case"}), "tags": []})
+ ModelComposition(
+ [
+ { # type: ignore
+ "task": "e2e_ocr",
+ "architecture": "easy_ocr",
+ "version": "invalid",
+ "interface": "online_learning",
+ "useCase": "test_workspace",
+ }
+ ]
+ )
+
+
+def test_model_composition_with_empty_tags_and_use_case() -> None:
+ model_def = ModelDefinition(
+ **{
+ **MODEL_DEFINITIONS["e2e_ocr"].model_dump(exclude={"tags", "use_case"}),
+ "tags": [],
+ }
+ )
composition = ModelComposition([model_def])
- assert composition.root[0].model_name == "e2e_ocr-easy_ocr-online_learning-00000000_0000_0000_0000_000000000000-1"
+ assert (
+ composition.root[0].model_name
+ == "e2e_ocr-easy_ocr-online_learning-00000000_0000_0000_0000_000000000000-1"
+ )
diff --git a/tests/unit/telemetry/test_anonymous_id.py b/tests/unit/telemetry/test_anonymous_id.py
index fe9438de..2580b2a1 100644
--- a/tests/unit/telemetry/test_anonymous_id.py
+++ b/tests/unit/telemetry/test_anonymous_id.py
@@ -1,17 +1,19 @@
import uuid
+from collections.abc import Generator
+import machineid
import pytest
from pytest_mock import MockerFixture
from askui.telemetry.anonymous_id import get_anonymous_id
-import machineid
@pytest.fixture(autouse=True)
-def reset_caches():
+def reset_caches() -> Generator[None, None, None]:
"""Reset the module-level caches before each test."""
import askui.telemetry.anonymous_id
import askui.telemetry.device_id
+
askui.telemetry.anonymous_id._anonymous_id = None
askui.telemetry.device_id._device_id = None
yield
@@ -19,64 +21,85 @@ def reset_caches():
askui.telemetry.device_id._device_id = None
-def test_get_anonymous_id_returns_cached_id():
+def test_get_anonymous_id_returns_cached_id() -> None:
# First call to get_anonymous_id will set the cache
first_id = get_anonymous_id()
-
+
# Second call should return the same ID
second_id = get_anonymous_id()
assert first_id == second_id
-def test_get_anonymous_id_uses_device_id_when_available(mocker: MockerFixture):
+def test_get_anonymous_id_uses_device_id_when_available(mocker: MockerFixture) -> None:
test_device_id = "test-device-id"
expected_anonymous_id = "7c810ac9-d1be-4620-a665-95f9554920ec"
-
- mocker.patch("askui.telemetry.anonymous_id._read_anonymous_id_from_file", return_value=None)
+
+ mocker.patch(
+ "askui.telemetry.anonymous_id._read_anonymous_id_from_file", return_value=None
+ )
mocker.patch("askui.telemetry.device_id.get_device_id", return_value=test_device_id)
mocker.patch("askui.telemetry.utils.is_valid_uuid4", return_value=False)
- mocker.patch("askui.telemetry.utils.hash_to_uuid4", return_value=expected_anonymous_id)
- mocker.patch("askui.telemetry.anonymous_id.hash_to_uuid4", return_value=expected_anonymous_id)
- mock_write = mocker.patch("askui.telemetry.anonymous_id._write_anonymous_id_to_file")
-
+ mocker.patch(
+ "askui.telemetry.utils.hash_to_uuid4", return_value=expected_anonymous_id
+ )
+ mocker.patch(
+ "askui.telemetry.anonymous_id.hash_to_uuid4", return_value=expected_anonymous_id
+ )
+ mock_write = mocker.patch(
+ "askui.telemetry.anonymous_id._write_anonymous_id_to_file"
+ )
+
anonymous_id = get_anonymous_id()
assert anonymous_id == expected_anonymous_id
mock_write.assert_called_once_with(expected_anonymous_id)
-def test_get_anonymous_id_uses_random_uuid_when_device_id_unavailable(mocker: MockerFixture):
+def test_get_anonymous_id_uses_random_uuid_when_device_id_unavailable(
+ mocker: MockerFixture,
+) -> None:
test_id = "1c9cb557-1c83-45b0-8aa8-6938c84d5893"
-
- mocker.patch("askui.telemetry.anonymous_id._read_anonymous_id_from_file", return_value=None)
+
+ mocker.patch(
+ "askui.telemetry.anonymous_id._read_anonymous_id_from_file", return_value=None
+ )
mocker.patch("machineid.hashed_id", side_effect=machineid.MachineIdNotFound())
mocker.patch("askui.telemetry.device_id.get_device_id", return_value=None)
mocker.patch("askui.telemetry.utils.is_valid_uuid4", return_value=False)
mocker.patch("uuid.uuid4", return_value=uuid.UUID(test_id.upper()))
- mock_write = mocker.patch("askui.telemetry.anonymous_id._write_anonymous_id_to_file")
-
+ mock_write = mocker.patch(
+ "askui.telemetry.anonymous_id._write_anonymous_id_to_file"
+ )
+
anonymous_id = get_anonymous_id()
assert anonymous_id == test_id
mock_write.assert_called_once_with(test_id)
-def test_get_anonymous_id_reads_from_file(mocker: MockerFixture):
+def test_get_anonymous_id_reads_from_file(mocker: MockerFixture) -> None:
test_id = "1c9cb557-1c83-45b0-8aa8-6938c84d5893"
- mocker.patch("askui.telemetry.anonymous_id._read_anonymous_id_from_file", return_value=test_id)
+ mocker.patch(
+ "askui.telemetry.anonymous_id._read_anonymous_id_from_file",
+ return_value=test_id,
+ )
mocker.patch("askui.telemetry.utils.is_valid_uuid4", return_value=True)
-
+
anonymous_id = get_anonymous_id()
assert anonymous_id == test_id
-def test_get_anonymous_id_writes_to_file(mocker: MockerFixture):
+def test_get_anonymous_id_writes_to_file(mocker: MockerFixture) -> None:
test_id = "1c9cb557-1c83-45b0-8aa8-6938c84d5893"
-
- mocker.patch("askui.telemetry.anonymous_id._read_anonymous_id_from_file", return_value=None)
+
+ mocker.patch(
+ "askui.telemetry.anonymous_id._read_anonymous_id_from_file", return_value=None
+ )
mocker.patch("machineid.hashed_id", side_effect=machineid.MachineIdNotFound())
mocker.patch("askui.telemetry.device_id.get_device_id", return_value=None)
mocker.patch("askui.telemetry.utils.is_valid_uuid4", return_value=False)
mocker.patch("uuid.uuid4", return_value=uuid.UUID(test_id.upper()))
- mock_write = mocker.patch("askui.telemetry.anonymous_id._write_anonymous_id_to_file")
-
+ mock_write = mocker.patch(
+ "askui.telemetry.anonymous_id._write_anonymous_id_to_file"
+ )
+
get_anonymous_id()
mock_write.assert_called_once_with(test_id)
diff --git a/tests/unit/telemetry/test_device_id.py b/tests/unit/telemetry/test_device_id.py
index 49b8959e..620a575c 100644
--- a/tests/unit/telemetry/test_device_id.py
+++ b/tests/unit/telemetry/test_device_id.py
@@ -4,21 +4,21 @@
from askui.telemetry.device_id import get_device_id
-
-
-
-def test_get_device_id_returns_cached_id(mocker: MockerFixture):
+def test_get_device_id_returns_cached_id(mocker: MockerFixture) -> None:
# First call to get_device_id will set the cache
mocker.patch("askui.telemetry.device_id._device_id", None)
- mocker.patch("machineid.hashed_id", return_value="02c2431a4608f230d2d759ac888d773d274229ebd9c9093249752dd839ee3ea3")
+ mocker.patch(
+ "machineid.hashed_id",
+ return_value="02c2431a4608f230d2d759ac888d773d274229ebd9c9093249752dd839ee3ea3",
+ )
first_id = get_device_id()
-
+
# Second call should return the same ID
second_id = get_device_id()
assert first_id == second_id
-def test_get_device_id_returns_hashed_id(mocker: MockerFixture):
+def test_get_device_id_returns_hashed_id(mocker: MockerFixture) -> None:
test_id = "02c2431a4608f230d2d759ac888d773d274229ebd9c9093249752dd839ee3ea3"
mocker.patch("askui.telemetry.device_id._device_id", None)
mocker.patch("machineid.hashed_id", return_value=test_id)
@@ -26,8 +26,8 @@ def test_get_device_id_returns_hashed_id(mocker: MockerFixture):
assert device_id == test_id
-def test_get_device_id_returns_none_on_error(mocker: MockerFixture):
+def test_get_device_id_returns_none_on_error(mocker: MockerFixture) -> None:
mocker.patch("askui.telemetry.device_id._device_id", None)
mocker.patch("machineid.hashed_id", side_effect=machineid.MachineIdNotFound)
device_id = get_device_id()
- assert device_id is None
\ No newline at end of file
+ assert device_id is None
diff --git a/tests/unit/telemetry/test_telemetry.py b/tests/unit/telemetry/test_telemetry.py
index 2cb440a2..89574d7b 100644
--- a/tests/unit/telemetry/test_telemetry.py
+++ b/tests/unit/telemetry/test_telemetry.py
@@ -1,9 +1,11 @@
+from typing import Any
+
import pytest
from askui.telemetry import InMemoryProcessor, Telemetry, TelemetrySettings
-def test_telemetry_disabled():
+def test_telemetry_disabled() -> None:
settings = TelemetrySettings(enabled=False)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -18,13 +20,15 @@ def test_func(x: int) -> int:
assert len(processor.get_events()) == 0
-def test_telemetry_enabled():
+def test_telemetry_enabled() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
telemetry.add_processor(processor)
- @telemetry.record_call(exclude_first_arg=False, exclude_response=False, exclude_start=False)
+ @telemetry.record_call(
+ exclude_first_arg=False, exclude_response=False, exclude_start=False
+ )
def test_func(x: int) -> int:
return x * 2
@@ -50,13 +54,15 @@ def test_func(x: int) -> int:
assert end_event["attributes"]["duration_ms"] >= 0
-def test_telemetry_error():
+def test_telemetry_error() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
telemetry.add_processor(processor)
- @telemetry.record_call(exclude_first_arg=False, exclude_start=False, exclude_exception=False)
+ @telemetry.record_call(
+ exclude_first_arg=False, exclude_start=False, exclude_exception=False
+ )
def test_func(x: int) -> int:
raise ValueError("Test error")
@@ -83,7 +89,7 @@ def test_func(x: int) -> int:
assert error_event["attributes"]["duration_ms"] >= 0
-def test_multiple_processors():
+def test_multiple_processors() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor1 = InMemoryProcessor()
@@ -102,7 +108,7 @@ def test_func(x: int) -> int:
events2 = processor2.get_events()
assert len(events1) == 2
assert len(events2) == 2
- for e1, e2 in zip(events1, events2):
+ for e1, e2 in zip(events1, events2, strict=False):
assert e1["name"] == e2["name"]
assert e1["attributes"]["fn_name"] == e2["attributes"]["fn_name"]
assert e1["attributes"]["args"] == e2["attributes"]["args"]
@@ -115,7 +121,7 @@ def test_func(x: int) -> int:
assert e1["timestamp"] <= e2["timestamp"]
-def test_function_tracking():
+def test_function_tracking() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -134,7 +140,7 @@ def standalone_function(x: int) -> int:
assert events[1]["attributes"]["fn_name"].endswith("standalone_function")
-def test_instance_method_tracking():
+def test_instance_method_tracking() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -155,7 +161,7 @@ def instance_method(self, x: int) -> int:
assert events[1]["attributes"]["fn_name"].endswith("TestClass.instance_method")
-def test_class_method_tracking():
+def test_class_method_tracking() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -176,7 +182,7 @@ def class_method(cls, x: int) -> int:
assert events[1]["attributes"]["fn_name"].endswith("TestClass.class_method")
-def test_static_method_tracking():
+def test_static_method_tracking() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -197,7 +203,7 @@ def static_method(x: int) -> int:
assert events[1]["attributes"]["fn_name"].endswith("TestClass.static_method")
-def test_nested_class_tracking():
+def test_nested_class_tracking() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -218,13 +224,15 @@ def nested_method(self, x: int) -> int:
assert events[1]["attributes"]["fn_name"].endswith("Outer.Inner.nested_method")
-def test_exclude_parameter():
+def test_exclude_parameter() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
telemetry.add_processor(processor)
- @telemetry.record_call(exclude={"password", "token"}, exclude_first_arg=False, exclude_start=False)
+ @telemetry.record_call(
+ exclude={"password", "token"}, exclude_first_arg=False, exclude_start=False
+ )
def sensitive_function(username: str, password: str, token: str) -> str:
return f"User: {username}"
@@ -233,12 +241,12 @@ def sensitive_function(username: str, password: str, token: str) -> str:
events = processor.get_events()
assert len(events) == 2
-
+
# Check that excluded parameters are masked
start_event = events[0]
assert start_event["attributes"]["args"][0] == "test_user" # username is included
- assert start_event["attributes"]["args"][1] == "masked" # password is masked
- assert start_event["attributes"]["args"][2] == "masked" # token is masked
+ assert start_event["attributes"]["args"][1] == "masked" # password is masked
+ assert start_event["attributes"]["args"][2] == "masked" # token is masked
end_event = events[1]
assert end_event["attributes"]["args"][0] == "test_user"
@@ -246,22 +254,26 @@ def sensitive_function(username: str, password: str, token: str) -> str:
assert end_event["attributes"]["args"][2] == "masked"
-def test_exclude_kwargs():
+def test_exclude_kwargs() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
telemetry.add_processor(processor)
- @telemetry.record_call(exclude={"password", "token"}, exclude_first_arg=False, exclude_start=False)
- def sensitive_function(username: str, **kwargs) -> str:
+ @telemetry.record_call(
+ exclude={"password", "token"}, exclude_first_arg=False, exclude_start=False
+ )
+ def sensitive_function(username: str, **kwargs: Any) -> str:
return f"User: {username}"
- result = sensitive_function("test_user", password="secret_password", token="private_token", visible="ok")
+ result = sensitive_function(
+ "test_user", password="secret_password", token="private_token", visible="ok"
+ )
assert result == "User: test_user"
events = processor.get_events()
assert len(events) == 2
-
+
# Check that excluded kwargs are masked but others aren't
start_event = events[0]
assert start_event["attributes"]["args"][0] == "test_user"
@@ -270,7 +282,7 @@ def sensitive_function(username: str, **kwargs) -> str:
assert start_event["attributes"]["kwargs"]["visible"] == "ok"
-def test_include_first_arg_function():
+def test_include_first_arg_function() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -285,13 +297,13 @@ def test_func(first: str, second: str) -> str:
events = processor.get_events()
assert len(events) == 2
-
+
# Check that first argument is included
assert events[0]["attributes"]["args"] == ("one", "two")
assert events[1]["attributes"]["args"] == ("one", "two")
-def test_include_first_arg_method():
+def test_include_first_arg_method() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -300,7 +312,7 @@ def test_include_first_arg_method():
class TestClass:
def __init__(self, name: str):
self.name = name
-
+
@telemetry.record_call(exclude_first_arg=False, exclude_start=False)
def method_with_self(self, param: str) -> str:
return f"{self.name}-{param}"
@@ -311,14 +323,14 @@ def method_with_self(self, param: str) -> str:
events = processor.get_events()
assert len(events) == 2
-
+
# Check that self is included as first argument
assert len(events[0]["attributes"]["args"]) == 2
assert events[0]["attributes"]["args"][1] == "param" # Second arg should be param
# Can't directly check self, but we can check it's not removed
-def test_default_exclude_self_method():
+def test_default_exclude_self_method() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -327,7 +339,7 @@ def test_default_exclude_self_method():
class TestClass:
def __init__(self, name: str):
self.name = name
-
+
@telemetry.record_call(exclude_start=False) # Default exclude_first_arg=True
def method_with_self(self, param: str) -> str:
return f"{self.name}-{param}"
@@ -338,20 +350,22 @@ def method_with_self(self, param: str) -> str:
events = processor.get_events()
assert len(events) == 2
-
+
# Check that self is excluded
assert events[0]["attributes"]["args"] == ("param",)
assert events[1]["attributes"]["args"] == ("param",)
-def test_combined_exclude_and_include_first_arg():
+def test_combined_exclude_and_include_first_arg() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
telemetry.add_processor(processor)
class User:
- @telemetry.record_call(exclude={"password"}, exclude_first_arg=False, exclude_start=False)
+ @telemetry.record_call(
+ exclude={"password"}, exclude_first_arg=False, exclude_start=False
+ )
def authenticate(self, username: str, password: str) -> bool:
return username == "valid" and password == "correct"
@@ -361,18 +375,18 @@ def authenticate(self, username: str, password: str) -> bool:
events = processor.get_events()
assert len(events) == 2
-
+
# First arg (self) should be included, password should be masked
assert len(events[0]["attributes"]["args"]) == 3
- assert events[0]["attributes"]["args"][1] == "valid" # username is included
- assert events[0]["attributes"]["args"][2] == "masked" # password is masked
-
+ assert events[0]["attributes"]["args"][1] == "valid" # username is included
+ assert events[0]["attributes"]["args"][2] == "masked" # password is masked
+
assert len(events[1]["attributes"]["args"]) == 3
assert events[1]["attributes"]["args"][1] == "valid"
assert events[1]["attributes"]["args"][2] == "masked"
-def test_static_method_with_include_first_arg():
+def test_static_method_with_include_first_arg() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -389,14 +403,14 @@ def static_method(first: str, second: str) -> str:
events = processor.get_events()
assert len(events) == 2
-
+
# Check that all arguments are included
assert events[0]["attributes"]["args"] == ("one", "two")
assert events[1]["attributes"]["args"] == ("one", "two")
# Tests for new parameters
-def test_exclude_response():
+def test_exclude_response() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -411,13 +425,13 @@ def test_func(x: int) -> int:
events = processor.get_events()
assert len(events) == 2
-
+
# Check that response is excluded
end_event = events[1]
assert "response" not in end_event["attributes"]
-def test_include_response():
+def test_include_response() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -432,14 +446,14 @@ def test_func(x: int) -> int:
events = processor.get_events()
assert len(events) == 2
-
+
# Check that response is included
end_event = events[1]
assert "response" in end_event["attributes"]
assert end_event["attributes"]["response"] == 10
-def test_exclude_exception():
+def test_exclude_exception() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -454,13 +468,13 @@ def test_func(x: int) -> int:
events = processor.get_events()
assert len(events) == 2
-
+
# Check that exception is excluded
end_event = events[1]
assert "exception" not in end_event["attributes"]
-def test_include_exception():
+def test_include_exception() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -475,7 +489,7 @@ def test_func(x: int) -> int:
events = processor.get_events()
assert len(events) == 2
-
+
# Check that exception is included
end_event = events[1]
assert "exception" in end_event["attributes"]
@@ -483,7 +497,7 @@ def test_func(x: int) -> int:
assert end_event["attributes"]["exception"]["message"] == "Test error"
-def test_exclude_start():
+def test_exclude_start() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -498,13 +512,13 @@ def test_func(x: int) -> int:
events = processor.get_events()
assert len(events) == 1
-
+
# Check that only the end event is recorded
end_event = events[0]
assert end_event["name"] == "Function called"
-def test_include_start():
+def test_include_start() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
@@ -519,7 +533,7 @@ def test_func(x: int) -> int:
events = processor.get_events()
assert len(events) == 2
-
+
# Check that both start and end events are recorded
start_event = events[0]
end_event = events[1]
@@ -527,16 +541,14 @@ def test_func(x: int) -> int:
assert end_event["name"] == "Function called"
-def test_all_new_parameters_together():
+def test_all_new_parameters_together() -> None:
settings = TelemetrySettings(enabled=True)
telemetry = Telemetry(settings)
processor = InMemoryProcessor()
telemetry.add_processor(processor)
@telemetry.record_call(
- exclude_response=False,
- exclude_exception=False,
- exclude_start=False
+ exclude_response=False, exclude_exception=False, exclude_start=False
)
def test_func(x: int) -> int:
if x < 0:
@@ -546,20 +558,20 @@ def test_func(x: int) -> int:
# Successful case
result = test_func(5)
assert result == 10
-
+
# Error case
with pytest.raises(ValueError):
test_func(-5)
events = processor.get_events()
assert len(events) == 4
-
+
# First pair of events (successful call)
assert events[0]["name"] == "Function call started"
assert events[1]["name"] == "Function called"
assert "response" in events[1]["attributes"]
assert events[1]["attributes"]["response"] == 10
-
+
# Second pair of events (error call)
assert events[2]["name"] == "Function call started"
assert events[3]["name"] == "Function called"
diff --git a/tests/unit/telemetry/test_utils.py b/tests/unit/telemetry/test_utils.py
index b821fecc..23b6ba0c 100644
--- a/tests/unit/telemetry/test_utils.py
+++ b/tests/unit/telemetry/test_utils.py
@@ -1,13 +1,14 @@
import uuid
+
from askui.telemetry.utils import hash_to_uuid4, is_valid_uuid4
-def test_is_valid_uuid4():
+def test_is_valid_uuid4() -> None:
# Valid UUID4
assert is_valid_uuid4(str(uuid.uuid4()))
assert is_valid_uuid4("123e4567-e89b-4456-a456-426614174000") # Version 4 UUID
assert is_valid_uuid4("123E4567-E89B-4456-A456-426614174000") # Case doesn't matter
-
+
# Invalid UUID4
assert not is_valid_uuid4("not-a-uuid")
assert not is_valid_uuid4("12345678-1234-5678-1234-56781234567") # Too short
@@ -15,7 +16,7 @@ def test_is_valid_uuid4():
assert not is_valid_uuid4("123e4567-e89b-1234-a456-426614174000") # Wrong version
-def test_hash_to_uuid4_string_input():
+def test_hash_to_uuid4_string_input() -> None:
guid = "12345678901234567890123456789012"
result = hash_to_uuid4(guid)
@@ -25,7 +26,7 @@ def test_hash_to_uuid4_string_input():
assert uuid_obj.variant == uuid.RFC_4122
-def test_hash_to_uuid4_bytes_input():
+def test_hash_to_uuid4_bytes_input() -> None:
guid = b"12345678901234567890123456789012"
result = hash_to_uuid4(guid.decode()) # Convert bytes to str
@@ -35,7 +36,7 @@ def test_hash_to_uuid4_bytes_input():
assert uuid_obj.variant == uuid.RFC_4122
-def test_hash_to_uuid4_short_input():
+def test_hash_to_uuid4_short_input() -> None:
guid = "1234567890"
result = hash_to_uuid4(guid)
@@ -45,7 +46,7 @@ def test_hash_to_uuid4_short_input():
assert uuid_obj.variant == uuid.RFC_4122
-def test_hash_to_uuid4_deterministic():
+def test_hash_to_uuid4_deterministic() -> None:
guid = "12345678901234567890123456789012"
result1 = hash_to_uuid4(guid)
result2 = hash_to_uuid4(guid)
@@ -54,7 +55,7 @@ def test_hash_to_uuid4_deterministic():
assert result1 == result2
-def test_hash_to_uuid4_different_inputs():
+def test_hash_to_uuid4_different_inputs() -> None:
guid1 = "12345678901234567890123456789012"
guid2 = "98765432109876543210987654321098"
result1 = hash_to_uuid4(guid1)
diff --git a/tests/unit/test_validate_call.py b/tests/unit/test_validate_call.py
index c8b11b29..0533fafa 100644
--- a/tests/unit/test_validate_call.py
+++ b/tests/unit/test_validate_call.py
@@ -1,9 +1,11 @@
import pytest
+
from askui import VisionAgent
-def test_validate_call_with_non_pydantic_invalid_types_raises_value_error():
+def test_validate_call_with_non_pydantic_invalid_types_raises_value_error() -> None:
class InvalidModelRouter:
pass
+
with pytest.raises(ValueError):
- VisionAgent(model_router=InvalidModelRouter())
+ VisionAgent(model_router=InvalidModelRouter()) # type: ignore
diff --git a/tests/unit/test_version.py b/tests/unit/test_version.py
index fa22dd83..565caf64 100644
--- a/tests/unit/test_version.py
+++ b/tests/unit/test_version.py
@@ -1,9 +1,10 @@
import askui
-
from askui.telemetry.pkg_version import get_pkg_version
-def test_version_consistency():
+
+def test_version_consistency() -> None:
package_version = get_pkg_version()
module_version = askui.__version__
- assert package_version == module_version, \
+ assert package_version == module_version, (
f"Version mismatch: package={package_version}, module={module_version}"
+ )
diff --git a/tests/unit/utils/test_image_utils.py b/tests/unit/utils/test_image_utils.py
index 72f39a97..1b25dc6a 100644
--- a/tests/unit/utils/test_image_utils.py
+++ b/tests/unit/utils/test_image_utils.py
@@ -1,27 +1,33 @@
+import base64
import pathlib
+
import pytest
-import base64
from PIL import Image
from askui.utils.image_utils import (
- load_image,
- ImageSource,
- image_to_data_url,
+ ImageSource,
+ base64_to_image,
data_url_to_image,
draw_point_on_image,
- base64_to_image,
image_to_base64,
+ image_to_data_url,
+ load_image,
+ scale_coordinates_back,
scale_image_with_padding,
- scale_coordinates_back
)
+
class TestLoadImage:
- def test_load_image_from_pil(self, path_fixtures_github_com__icon: pathlib.Path) -> None:
+ def test_load_image_from_pil(
+ self, path_fixtures_github_com__icon: pathlib.Path
+ ) -> None:
img = Image.open(path_fixtures_github_com__icon)
loaded = load_image(img)
assert loaded == img
- def test_load_image_from_path(self, path_fixtures_github_com__icon: pathlib.Path) -> None:
+ def test_load_image_from_path(
+ self, path_fixtures_github_com__icon: pathlib.Path
+ ) -> None:
# Test loading from Path
loaded = load_image(path_fixtures_github_com__icon)
assert isinstance(loaded, Image.Image)
@@ -32,7 +38,9 @@ def test_load_image_from_path(self, path_fixtures_github_com__icon: pathlib.Path
assert isinstance(loaded, Image.Image)
assert loaded.size == (128, 125)
- def test_load_image_from_base64(self, path_fixtures_github_com__icon: pathlib.Path) -> None:
+ def test_load_image_from_base64(
+ self, path_fixtures_github_com__icon: pathlib.Path
+ ) -> None:
# Load test image and convert to base64
with open(path_fixtures_github_com__icon, "rb") as f:
img_bytes = f.read()
@@ -51,13 +59,15 @@ def test_load_image_from_base64(self, path_fixtures_github_com__icon: pathlib.Pa
assert isinstance(loaded, Image.Image)
assert loaded.size == (128, 125)
- def test_load_image_invalid(self, path_fixtures_github_com__icon: pathlib.Path) -> None:
+ def test_load_image_invalid(
+ self, path_fixtures_github_com__icon: pathlib.Path
+ ) -> None:
with pytest.raises(ValueError):
load_image("invalid_path.png")
with pytest.raises(ValueError):
load_image("invalid_base64")
-
+
with pytest.raises(ValueError):
with open(path_fixtures_github_com__icon, "rb") as f:
img_bytes = f.read()
@@ -105,29 +115,35 @@ def test_to_base64(self, path_fixtures_github_com__icon: pathlib.Path) -> None:
class TestDataUrlConversion:
- def test_image_to_data_url(self, path_fixtures_github_com__icon: pathlib.Path) -> None:
+ def test_image_to_data_url(
+ self, path_fixtures_github_com__icon: pathlib.Path
+ ) -> None:
img = Image.open(path_fixtures_github_com__icon)
data_url = image_to_data_url(img)
assert data_url.startswith("data:image/png;base64,")
assert len(data_url) > 100
- def test_data_url_to_image(self, path_fixtures_github_com__icon: pathlib.Path) -> None:
+ def test_data_url_to_image(
+ self, path_fixtures_github_com__icon: pathlib.Path
+ ) -> None:
with open(path_fixtures_github_com__icon, "rb") as f:
img_bytes = f.read()
img_str = base64.b64encode(img_bytes).decode()
data_url = f"data:image/png;base64,{img_str}"
-
+
img = data_url_to_image(data_url)
assert isinstance(img, Image.Image)
assert img.size == (128, 125)
class TestPointDrawing:
- def test_draw_point_on_image(self, path_fixtures_github_com__icon: pathlib.Path) -> None:
+ def test_draw_point_on_image(
+ self, path_fixtures_github_com__icon: pathlib.Path
+ ) -> None:
img = Image.open(path_fixtures_github_com__icon)
x, y = 64, 62 # Center of the image
new_img = draw_point_on_image(img, x, y)
-
+
assert new_img != img # Should be a new image
assert isinstance(new_img, Image.Image)
# Check that the point was drawn by looking at the pixel color
@@ -135,60 +151,67 @@ def test_draw_point_on_image(self, path_fixtures_github_com__icon: pathlib.Path)
class TestBase64Conversion:
- def test_base64_to_image(self, path_fixtures_github_com__icon: pathlib.Path) -> None:
+ def test_base64_to_image(
+ self, path_fixtures_github_com__icon: pathlib.Path
+ ) -> None:
with open(path_fixtures_github_com__icon, "rb") as f:
img_bytes = f.read()
img_str = base64.b64encode(img_bytes).decode()
-
+
img = base64_to_image(img_str)
assert isinstance(img, Image.Image)
assert img.size == (128, 125)
- def test_image_to_base64(self, path_fixtures_github_com__icon: pathlib.Path) -> None:
+ def test_image_to_base64(
+ self, path_fixtures_github_com__icon: pathlib.Path
+ ) -> None:
# Test with PIL Image
img = Image.open(path_fixtures_github_com__icon)
base64_str = image_to_base64(img)
assert len(base64_str) > 100
-
+
# Test with Path
base64_str = image_to_base64(path_fixtures_github_com__icon)
assert len(base64_str) > 100
class TestImageScaling:
- def test_scale_image_with_padding(self, path_fixtures_github_com__icon: pathlib.Path) -> None:
+ def test_scale_image_with_padding(
+ self, path_fixtures_github_com__icon: pathlib.Path
+ ) -> None:
img = Image.open(path_fixtures_github_com__icon)
max_width, max_height = 200, 200
-
+
scaled = scale_image_with_padding(img, max_width, max_height)
assert isinstance(scaled, Image.Image)
assert scaled.size == (max_width, max_height)
-
+
# Check that the image was scaled proportionally
original_ratio = img.size[0] / img.size[1]
- scaled_ratio = (scaled.size[0] - 2 * (max_width - int(img.size[0] * (max_height / img.size[1]))) // 2) / max_height
+ scaled_ratio = (
+ scaled.size[0]
+ - 2 * (max_width - int(img.size[0] * (max_height / img.size[1]))) // 2
+ ) / max_height
assert abs(original_ratio - scaled_ratio) < 0.01
- def test_scale_coordinates_back(self, path_fixtures_github_com__icon: pathlib.Path) -> None:
+ def test_scale_coordinates_back(
+ self, path_fixtures_github_com__icon: pathlib.Path
+ ) -> None:
img = Image.open(path_fixtures_github_com__icon)
max_width, max_height = 200, 200
-
+
# Test coordinates in the center of the scaled image
x, y = 100, 100
original_x, original_y = scale_coordinates_back(
- x, y,
- img.size[0], img.size[1],
- max_width, max_height
+ x, y, img.size[0], img.size[1], max_width, max_height
)
-
+
# Coordinates should be within the original image bounds
assert 0 <= original_x <= img.size[0]
assert 0 <= original_y <= img.size[1]
-
+
# Test coordinates outside the padded area
with pytest.raises(ValueError):
scale_coordinates_back(
- -10, -10,
- img.size[0], img.size[1],
- max_width, max_height
+ -10, -10, img.size[0], img.size[1], max_width, max_height
)
diff --git a/tests/unit/utils/test_str_utils.py b/tests/unit/utils/test_str_utils.py
index 21e3061c..a32887a8 100644
--- a/tests/unit/utils/test_str_utils.py
+++ b/tests/unit/utils/test_str_utils.py
@@ -1,50 +1,53 @@
from askui.utils.str_utils import truncate_long_strings
-def test_truncate_long_strings_with_dict():
- input_data = {
- "short": "short",
- "long": "a" * 101,
- "nested": {
- "long": "b" * 101
- }
- }
+
+def test_truncate_long_strings_with_dict() -> None:
+ input_data = {"short": "short", "long": "a" * 101, "nested": {"long": "b" * 101}}
expected = {
"short": "short",
"long": "a" * 20 + "... [shortened]",
- "nested": {
- "long": "b" * 20 + "... [shortened]"
- }
+ "nested": {"long": "b" * 20 + "... [shortened]"},
}
assert truncate_long_strings(input_data) == expected
-def test_truncate_long_strings_with_list():
+
+def test_truncate_long_strings_with_list() -> None:
input_data = ["short", "a" * 101, ["b" * 101]]
expected = ["short", "a" * 20 + "... [shortened]", ["b" * 20 + "... [shortened]"]]
assert truncate_long_strings(input_data) == expected
-def test_truncate_long_strings_with_string():
+
+def test_truncate_long_strings_with_string() -> None:
assert truncate_long_strings("short") == "short"
assert truncate_long_strings("a" * 101) == "a" * 20 + "... [shortened]"
-def test_truncate_long_strings_with_custom_params():
+
+def test_truncate_long_strings_with_custom_params() -> None:
input_data = "a" * 101
expected = "a" * 10 + "... [custom]"
- assert truncate_long_strings(input_data, max_length=50, truncate_length=10, tag="[custom]") == expected
+ assert (
+ truncate_long_strings(
+ input_data, max_length=50, truncate_length=10, tag="[custom]"
+ )
+ == expected
+ )
-def test_truncate_long_strings_with_mixed_data():
+
+def test_truncate_long_strings_with_mixed_data() -> None:
input_data = {
"list": ["short", "a" * 101],
"dict": {"long": "b" * 101},
- "str": "c" * 101
+ "str": "c" * 101,
}
expected = {
"list": ["short", "a" * 20 + "... [shortened]"],
"dict": {"long": "b" * 20 + "... [shortened]"},
- "str": "c" * 20 + "... [shortened]"
+ "str": "c" * 20 + "... [shortened]",
}
assert truncate_long_strings(input_data) == expected
-def test_truncate_long_strings_with_empty_data():
+
+def test_truncate_long_strings_with_empty_data() -> None:
assert truncate_long_strings({}) == {}
assert truncate_long_strings([]) == []
- assert truncate_long_strings("") == ""
+ assert truncate_long_strings("") == ""
diff --git a/tests/utils/generate_ai_elements.py b/tests/utils/generate_ai_elements.py
index 8864816f..21206fab 100644
--- a/tests/utils/generate_ai_elements.py
+++ b/tests/utils/generate_ai_elements.py
@@ -2,8 +2,10 @@
import pathlib
import uuid
from datetime import datetime
+
from PIL import Image
+
def generate_ai_element_json(image_path: pathlib.Path) -> None:
# Open image to get dimensions
with Image.open(image_path) as img:
@@ -15,23 +17,20 @@ def generate_ai_element_json(image_path: pathlib.Path) -> None:
"id": str(uuid.uuid4()),
"name": image_path.stem,
"creationDateTime": datetime.now().isoformat(),
- "image": {
- "size": {
- "width": width,
- "height": height
- }
- }
+ "image": {"size": {"width": width, "height": height}},
}
# Write JSON file
- json_path = image_path.with_suffix('.json')
- with open(json_path, 'w') as f:
+ json_path = image_path.with_suffix(".json")
+ with open(json_path, "w") as f:
json.dump(metadata, f, indent=2)
-def main():
- fixtures_dir = pathlib.Path('tests/fixtures/images')
- for image_path in fixtures_dir.glob('*.png'):
+
+def main() -> None:
+ fixtures_dir = pathlib.Path("tests/fixtures/images")
+ for image_path in fixtures_dir.glob("*.png"):
generate_ai_element_json(image_path)
-if __name__ == '__main__':
+
+if __name__ == "__main__":
main()