From b74580268d5eb254bd6dbd49cf80d517816ec0dd Mon Sep 17 00:00:00 2001 From: Vivek Nair Date: Tue, 18 Jul 2023 10:49:12 -0400 Subject: [PATCH 1/3] fix: wip --- .../examples/evaluation/test-sets/list.py | 18 + examples/poetry.lock | 76 +- package/conftest.py | 1 + package/fixtures/__init__.py | 1 + package/fixtures/test_sets.py | 67 + package/gentrace/__init__.py | 2 +- package/gentrace/api_client.py | 593 +++----- package/gentrace/apis/__init__.py | 2 +- package/gentrace/apis/tag_to_api.py | 4 +- package/gentrace/apis/tags/core_api.py | 1 - package/gentrace/exceptions.py | 11 +- package/gentrace/model/feedback_request.py | 150 +- package/gentrace/model/feedback_request.pyi | 126 +- package/gentrace/model/feedback_response.py | 44 +- package/gentrace/model/feedback_response.pyi | 38 +- .../gentrace/model/pipeline_run_request.py | 716 +++------ .../gentrace/model/pipeline_run_request.pyi | 643 +++----- .../gentrace/model/pipeline_run_response.py | 74 +- .../gentrace/model/pipeline_run_response.pyi | 63 +- package/gentrace/model/test_case.py | 510 ++----- package/gentrace/model/test_case.pyi | 443 ++---- package/gentrace/model/test_run.py | 206 +-- package/gentrace/model/test_run.pyi | 185 +-- .../gentrace/paths/pipeline_run/__init__.py | 2 +- package/gentrace/paths/pipeline_run/post.py | 134 +- package/gentrace/paths/pipeline_run/post.pyi | 115 +- package/gentrace/paths/test_case/__init__.py | 2 +- package/gentrace/paths/test_case/get.py | 309 ++-- package/gentrace/paths/test_case/get.pyi | 265 ++-- package/gentrace/paths/test_run/__init__.py | 2 +- package/gentrace/paths/test_run/get.py | 655 +++----- package/gentrace/paths/test_run/get.pyi | 557 +++---- package/gentrace/paths/test_run/post.py | 1146 +++++--------- package/gentrace/paths/test_run/post.pyi | 1020 +++++-------- package/gentrace/providers/evaluation.py | 29 + package/gentrace/rest.py | 199 +-- package/gentrace/schemas.py | 1350 +++++------------ package/pyproject.toml | 1 + package/tests/test_evaluation.py | 25 + 39 files changed, 3412 insertions(+), 6373 deletions(-) create mode 100644 examples/examples/evaluation/test-sets/list.py create mode 100644 package/fixtures/test_sets.py diff --git a/examples/examples/evaluation/test-sets/list.py b/examples/examples/evaluation/test-sets/list.py new file mode 100644 index 00000000..3b1695e9 --- /dev/null +++ b/examples/examples/evaluation/test-sets/list.py @@ -0,0 +1,18 @@ +import os + +import gentrace +from dotenv import load_dotenv + +load_dotenv() + +gentrace.init( + api_key=os.getenv("GENTRACE_API_KEY"), + host="http://localhost:3000/api/v1", +) + +LABEL_NAME = "Monkies" + +test_sets = gentrace.get_test_sets(LABEL_NAME) + +for test_set in test_sets: + print(test_set["id"]) diff --git a/examples/poetry.lock b/examples/poetry.lock index 9dc61a77..1c27705b 100644 --- a/examples/poetry.lock +++ b/examples/poetry.lock @@ -500,7 +500,7 @@ category = "main" optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "gentrace_py-0.12.1.tar.gz", hash = "sha256:05c580b6fe0fcf537767eec410801b9ea5fc94f1def9235ffb5656c160baaf97"}, + {file = "gentrace_py-0.12.1.tar.gz", hash = "sha256:e93a9b1a7992a55d9f8e4d2abe45b226b01ed9c883b9c90e4e866c86ba925b48"}, ] [package.dependencies] @@ -777,48 +777,48 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.2.2)", "pytest- [[package]] name = "pydantic" -version = "1.10.9" +version = "1.10.11" description = "Data validation and settings management using python type hints" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "pydantic-1.10.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e692dec4a40bfb40ca530e07805b1208c1de071a18d26af4a2a0d79015b352ca"}, - {file = "pydantic-1.10.9-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3c52eb595db83e189419bf337b59154bdcca642ee4b2a09e5d7797e41ace783f"}, - {file = "pydantic-1.10.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:939328fd539b8d0edf244327398a667b6b140afd3bf7e347cf9813c736211896"}, - {file = "pydantic-1.10.9-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b48d3d634bca23b172f47f2335c617d3fcb4b3ba18481c96b7943a4c634f5c8d"}, - {file = "pydantic-1.10.9-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:f0b7628fb8efe60fe66fd4adadd7ad2304014770cdc1f4934db41fe46cc8825f"}, - {file = "pydantic-1.10.9-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e1aa5c2410769ca28aa9a7841b80d9d9a1c5f223928ca8bec7e7c9a34d26b1d4"}, - {file = "pydantic-1.10.9-cp310-cp310-win_amd64.whl", hash = "sha256:eec39224b2b2e861259d6f3c8b6290d4e0fbdce147adb797484a42278a1a486f"}, - {file = "pydantic-1.10.9-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d111a21bbbfd85c17248130deac02bbd9b5e20b303338e0dbe0faa78330e37e0"}, - {file = "pydantic-1.10.9-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2e9aec8627a1a6823fc62fb96480abe3eb10168fd0d859ee3d3b395105ae19a7"}, - {file = "pydantic-1.10.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:07293ab08e7b4d3c9d7de4949a0ea571f11e4557d19ea24dd3ae0c524c0c334d"}, - {file = "pydantic-1.10.9-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ee829b86ce984261d99ff2fd6e88f2230068d96c2a582f29583ed602ef3fc2c"}, - {file = "pydantic-1.10.9-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:4b466a23009ff5cdd7076eb56aca537c745ca491293cc38e72bf1e0e00de5b91"}, - {file = "pydantic-1.10.9-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:7847ca62e581e6088d9000f3c497267868ca2fa89432714e21a4fb33a04d52e8"}, - {file = "pydantic-1.10.9-cp311-cp311-win_amd64.whl", hash = "sha256:7845b31959468bc5b78d7b95ec52fe5be32b55d0d09983a877cca6aedc51068f"}, - {file = "pydantic-1.10.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:517a681919bf880ce1dac7e5bc0c3af1e58ba118fd774da2ffcd93c5f96eaece"}, - {file = "pydantic-1.10.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67195274fd27780f15c4c372f4ba9a5c02dad6d50647b917b6a92bf00b3d301a"}, - {file = "pydantic-1.10.9-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2196c06484da2b3fded1ab6dbe182bdabeb09f6318b7fdc412609ee2b564c49a"}, - {file = "pydantic-1.10.9-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:6257bb45ad78abacda13f15bde5886efd6bf549dd71085e64b8dcf9919c38b60"}, - {file = "pydantic-1.10.9-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:3283b574b01e8dbc982080d8287c968489d25329a463b29a90d4157de4f2baaf"}, - {file = "pydantic-1.10.9-cp37-cp37m-win_amd64.whl", hash = "sha256:5f8bbaf4013b9a50e8100333cc4e3fa2f81214033e05ac5aa44fa24a98670a29"}, - {file = "pydantic-1.10.9-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b9cd67fb763248cbe38f0593cd8611bfe4b8ad82acb3bdf2b0898c23415a1f82"}, - {file = "pydantic-1.10.9-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f50e1764ce9353be67267e7fd0da08349397c7db17a562ad036aa7c8f4adfdb6"}, - {file = "pydantic-1.10.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:73ef93e5e1d3c8e83f1ff2e7fdd026d9e063c7e089394869a6e2985696693766"}, - {file = "pydantic-1.10.9-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:128d9453d92e6e81e881dd7e2484e08d8b164da5507f62d06ceecf84bf2e21d3"}, - {file = "pydantic-1.10.9-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ad428e92ab68798d9326bb3e5515bc927444a3d71a93b4a2ca02a8a5d795c572"}, - {file = "pydantic-1.10.9-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fab81a92f42d6d525dd47ced310b0c3e10c416bbfae5d59523e63ea22f82b31e"}, - {file = "pydantic-1.10.9-cp38-cp38-win_amd64.whl", hash = "sha256:963671eda0b6ba6926d8fc759e3e10335e1dc1b71ff2a43ed2efd6996634dafb"}, - {file = "pydantic-1.10.9-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:970b1bdc6243ef663ba5c7e36ac9ab1f2bfecb8ad297c9824b542d41a750b298"}, - {file = "pydantic-1.10.9-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7e1d5290044f620f80cf1c969c542a5468f3656de47b41aa78100c5baa2b8276"}, - {file = "pydantic-1.10.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:83fcff3c7df7adff880622a98022626f4f6dbce6639a88a15a3ce0f96466cb60"}, - {file = "pydantic-1.10.9-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0da48717dc9495d3a8f215e0d012599db6b8092db02acac5e0d58a65248ec5bc"}, - {file = "pydantic-1.10.9-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:0a2aabdc73c2a5960e87c3ffebca6ccde88665616d1fd6d3db3178ef427b267a"}, - {file = "pydantic-1.10.9-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9863b9420d99dfa9c064042304868e8ba08e89081428a1c471858aa2af6f57c4"}, - {file = "pydantic-1.10.9-cp39-cp39-win_amd64.whl", hash = "sha256:e7c9900b43ac14110efa977be3da28931ffc74c27e96ee89fbcaaf0b0fe338e1"}, - {file = "pydantic-1.10.9-py3-none-any.whl", hash = "sha256:6cafde02f6699ce4ff643417d1a9223716ec25e228ddc3b436fe7e2d25a1f305"}, - {file = "pydantic-1.10.9.tar.gz", hash = "sha256:95c70da2cd3b6ddf3b9645ecaa8d98f3d80c606624b6d245558d202cd23ea3be"}, + {file = "pydantic-1.10.11-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ff44c5e89315b15ff1f7fdaf9853770b810936d6b01a7bcecaa227d2f8fe444f"}, + {file = "pydantic-1.10.11-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a6c098d4ab5e2d5b3984d3cb2527e2d6099d3de85630c8934efcfdc348a9760e"}, + {file = "pydantic-1.10.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:16928fdc9cb273c6af00d9d5045434c39afba5f42325fb990add2c241402d151"}, + {file = "pydantic-1.10.11-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0588788a9a85f3e5e9ebca14211a496409cb3deca5b6971ff37c556d581854e7"}, + {file = "pydantic-1.10.11-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e9baf78b31da2dc3d3f346ef18e58ec5f12f5aaa17ac517e2ffd026a92a87588"}, + {file = "pydantic-1.10.11-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:373c0840f5c2b5b1ccadd9286782852b901055998136287828731868027a724f"}, + {file = "pydantic-1.10.11-cp310-cp310-win_amd64.whl", hash = "sha256:c3339a46bbe6013ef7bdd2844679bfe500347ac5742cd4019a88312aa58a9847"}, + {file = "pydantic-1.10.11-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:08a6c32e1c3809fbc49debb96bf833164f3438b3696abf0fbeceb417d123e6eb"}, + {file = "pydantic-1.10.11-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a451ccab49971af043ec4e0d207cbc8cbe53dbf148ef9f19599024076fe9c25b"}, + {file = "pydantic-1.10.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5b02d24f7b2b365fed586ed73582c20f353a4c50e4be9ba2c57ab96f8091ddae"}, + {file = "pydantic-1.10.11-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3f34739a89260dfa420aa3cbd069fbcc794b25bbe5c0a214f8fb29e363484b66"}, + {file = "pydantic-1.10.11-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:e297897eb4bebde985f72a46a7552a7556a3dd11e7f76acda0c1093e3dbcf216"}, + {file = "pydantic-1.10.11-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d185819a7a059550ecb85d5134e7d40f2565f3dd94cfd870132c5f91a89cf58c"}, + {file = "pydantic-1.10.11-cp311-cp311-win_amd64.whl", hash = "sha256:4400015f15c9b464c9db2d5d951b6a780102cfa5870f2c036d37c23b56f7fc1b"}, + {file = "pydantic-1.10.11-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2417de68290434461a266271fc57274a138510dca19982336639484c73a07af6"}, + {file = "pydantic-1.10.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:331c031ba1554b974c98679bd0780d89670d6fd6f53f5d70b10bdc9addee1713"}, + {file = "pydantic-1.10.11-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8268a735a14c308923e8958363e3a3404f6834bb98c11f5ab43251a4e410170c"}, + {file = "pydantic-1.10.11-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:44e51ba599c3ef227e168424e220cd3e544288c57829520dc90ea9cb190c3248"}, + {file = "pydantic-1.10.11-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d7781f1d13b19700b7949c5a639c764a077cbbdd4322ed505b449d3ca8edcb36"}, + {file = "pydantic-1.10.11-cp37-cp37m-win_amd64.whl", hash = "sha256:7522a7666157aa22b812ce14c827574ddccc94f361237ca6ea8bb0d5c38f1629"}, + {file = "pydantic-1.10.11-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:bc64eab9b19cd794a380179ac0e6752335e9555d214cfcb755820333c0784cb3"}, + {file = "pydantic-1.10.11-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:8dc77064471780262b6a68fe67e013298d130414d5aaf9b562c33987dbd2cf4f"}, + {file = "pydantic-1.10.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fe429898f2c9dd209bd0632a606bddc06f8bce081bbd03d1c775a45886e2c1cb"}, + {file = "pydantic-1.10.11-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:192c608ad002a748e4a0bed2ddbcd98f9b56df50a7c24d9a931a8c5dd053bd3d"}, + {file = "pydantic-1.10.11-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ef55392ec4bb5721f4ded1096241e4b7151ba6d50a50a80a2526c854f42e6a2f"}, + {file = "pydantic-1.10.11-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:41e0bb6efe86281623abbeeb0be64eab740c865388ee934cd3e6a358784aca6e"}, + {file = "pydantic-1.10.11-cp38-cp38-win_amd64.whl", hash = "sha256:265a60da42f9f27e0b1014eab8acd3e53bd0bad5c5b4884e98a55f8f596b2c19"}, + {file = "pydantic-1.10.11-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:469adf96c8e2c2bbfa655fc7735a2a82f4c543d9fee97bd113a7fb509bf5e622"}, + {file = "pydantic-1.10.11-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e6cbfbd010b14c8a905a7b10f9fe090068d1744d46f9e0c021db28daeb8b6de1"}, + {file = "pydantic-1.10.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:abade85268cc92dff86d6effcd917893130f0ff516f3d637f50dadc22ae93999"}, + {file = "pydantic-1.10.11-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e9738b0f2e6c70f44ee0de53f2089d6002b10c33264abee07bdb5c7f03038303"}, + {file = "pydantic-1.10.11-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:787cf23e5a0cde753f2eabac1b2e73ae3844eb873fd1f5bdbff3048d8dbb7604"}, + {file = "pydantic-1.10.11-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:174899023337b9fc685ac8adaa7b047050616136ccd30e9070627c1aaab53a13"}, + {file = "pydantic-1.10.11-cp39-cp39-win_amd64.whl", hash = "sha256:1954f8778489a04b245a1e7b8b22a9d3ea8ef49337285693cf6959e4b757535e"}, + {file = "pydantic-1.10.11-py3-none-any.whl", hash = "sha256:008c5e266c8aada206d0627a011504e14268a62091450210eda7c07fabe6963e"}, + {file = "pydantic-1.10.11.tar.gz", hash = "sha256:f66d479cf7eb331372c470614be6511eae96f1f120344c25f3f9bb59fb1b5528"}, ] [package.dependencies] diff --git a/package/conftest.py b/package/conftest.py index 8db6ce79..5b191d53 100644 --- a/package/conftest.py +++ b/package/conftest.py @@ -11,6 +11,7 @@ from fixtures.gentrace import gentrace_pipeline_run_response from fixtures.submit_test_run import test_run_response from fixtures.test_cases import test_cases +from fixtures.test_sets import test_sets from fixtures.vector import vector diff --git a/package/fixtures/__init__.py b/package/fixtures/__init__.py index 721eef66..6cce5fa9 100644 --- a/package/fixtures/__init__.py +++ b/package/fixtures/__init__.py @@ -5,4 +5,5 @@ from fixtures.gentrace import gentrace_pipeline_run_response from fixtures.submit_test_run import test_run_response from fixtures.test_cases import test_cases +from fixtures.test_sets import test_sets from fixtures.vector import vector diff --git a/package/fixtures/test_sets.py b/package/fixtures/test_sets.py new file mode 100644 index 00000000..651b14db --- /dev/null +++ b/package/fixtures/test_sets.py @@ -0,0 +1,67 @@ +import pytest + + +@pytest.fixture +def test_sets(): + return { + "testSets": [ + { + "id": "9685b34e-2cac-5bd2-8751-c9e34ff9fd98", + "createdAt": "2023-07-18T11:08:09.842Z", + "updatedAt": "2023-07-18T11:08:09.842Z", + "archivedAt": None, + "labels": ["guessing"], + "name": "Guess the Year", + "organizationId": "fe05eab7-4f07-530d-8ed9-15aeae86e0db", + "branch": "main", + "cases": [ + { + "id": "316c3797-7d04-54f9-91f0-8af87e1c8413", + "createdAt": "2023-07-18T11:08:09.863Z", + "updatedAt": "2023-07-18T11:08:09.863Z", + "archivedAt": None, + "expected": "2023", + "expectedSteps": None, + "inputs": { + "query": "In what year was the Apple Vision Pro released?" + }, + "name": "Apple Vision Pro released", + "setId": "9685b34e-2cac-5bd2-8751-c9e34ff9fd98", + }, + { + "id": "a2bddcbc-51ac-5831-be0d-5868a7ffa1db", + "createdAt": "2023-07-18T11:08:09.861Z", + "updatedAt": "2023-07-18T11:08:09.861Z", + "archivedAt": None, + "expected": "2022", + "expectedSteps": None, + "inputs": {"query": "In what year was ChatGPT released?"}, + "name": "ChatGPT released", + "setId": "9685b34e-2cac-5bd2-8751-c9e34ff9fd98", + }, + { + "id": "275d92ac-db8a-5964-846d-c8a7bc3caf4d", + "createdAt": "2023-07-18T11:08:09.858Z", + "updatedAt": "2023-07-18T11:08:09.858Z", + "archivedAt": None, + "expected": "2023", + "expectedSteps": None, + "inputs": {"query": "In what year was Gentrace founded?"}, + "name": "Gentrace founded", + "setId": "9685b34e-2cac-5bd2-8751-c9e34ff9fd98", + }, + ], + }, + { + "id": "393e926e-ba1b-486f-8cbe-db7d9471fe56", + "createdAt": "2023-07-18T12:47:58.618Z", + "updatedAt": "2023-07-18T12:47:58.618Z", + "archivedAt": None, + "labels": [], + "name": "Testign", + "organizationId": "fe05eab7-4f07-530d-8ed9-15aeae86e0db", + "branch": "main", + "cases": [], + }, + ] + } diff --git a/package/gentrace/__init__.py b/package/gentrace/__init__.py index 8c01a580..235cea37 100644 --- a/package/gentrace/__init__.py +++ b/package/gentrace/__init__.py @@ -46,4 +46,4 @@ # @deprecated: use gentrace.providers.init.init() instead to set the Gentrace # log level -log_level = "warn" +log_level = "warn" \ No newline at end of file diff --git a/package/gentrace/api_client.py b/package/gentrace/api_client.py index 79162546..5e6959ac 100644 --- a/package/gentrace/api_client.py +++ b/package/gentrace/api_client.py @@ -53,7 +53,7 @@ def __eq__(self, other): class JSONEncoder(json.JSONEncoder): - compact_separators = (",", ":") + compact_separators = (',', ':') def default(self, obj): if isinstance(obj, str): @@ -74,26 +74,24 @@ def default(self, obj): return {key: self.default(val) for key, val in obj.items()} elif isinstance(obj, (list, tuple)): return [self.default(item) for item in obj] - raise ApiValueError( - "Unable to prepare type {} for serialization".format(obj.__class__.__name__) - ) + raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) class ParameterInType(enum.Enum): - QUERY = "query" - HEADER = "header" - PATH = "path" - COOKIE = "cookie" + QUERY = 'query' + HEADER = 'header' + PATH = 'path' + COOKIE = 'cookie' class ParameterStyle(enum.Enum): - MATRIX = "matrix" - LABEL = "label" - FORM = "form" - SIMPLE = "simple" - SPACE_DELIMITED = "spaceDelimited" - PIPE_DELIMITED = "pipeDelimited" - DEEP_OBJECT = "deepObject" + MATRIX = 'matrix' + LABEL = 'label' + FORM = 'form' + SIMPLE = 'simple' + SPACE_DELIMITED = 'spaceDelimited' + PIPE_DELIMITED = 'pipeDelimited' + DEEP_OBJECT = 'deepObject' class PrefixSeparatorIterator: @@ -103,10 +101,10 @@ def __init__(self, prefix: str, separator: str): self.prefix = prefix self.separator = separator self.first = True - if separator in {".", "|", "%20"}: + if separator in {'.', '|', '%20'}: item_separator = separator else: - item_separator = "," + item_separator = ',' self.item_separator = item_separator def __iter__(self): @@ -148,9 +146,7 @@ def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): elif isinstance(in_data, dict) and not in_data: # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 return None - raise ApiValueError( - "Unable to generate a ref6570 item representation of {}".format(in_data) - ) + raise ApiValueError('Unable to generate a ref6570 item representation of {}'.format(in_data)) @staticmethod def _to_dict(name: str, value: str): @@ -165,20 +161,13 @@ def __ref6570_str_float_int_expansion( percent_encode: bool, prefix_separator_iterator: PrefixSeparatorIterator, var_name_piece: str, - named_parameter_expansion: bool, + named_parameter_expansion: bool ) -> str: item_value = cls.__ref6570_item_value(in_data, percent_encode) - if item_value is None or ( - item_value == "" and prefix_separator_iterator.separator == ";" - ): + if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): return next(prefix_separator_iterator) + var_name_piece - value_pair_equals = "=" if named_parameter_expansion else "" - return ( - next(prefix_separator_iterator) - + var_name_piece - + value_pair_equals - + item_value - ) + value_pair_equals = '=' if named_parameter_expansion else '' + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value @classmethod def __ref6570_list_expansion( @@ -189,20 +178,20 @@ def __ref6570_list_expansion( percent_encode: bool, prefix_separator_iterator: PrefixSeparatorIterator, var_name_piece: str, - named_parameter_expansion: bool, + named_parameter_expansion: bool ) -> str: item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] item_values = [v for v in item_values if v is not None] if not item_values: # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 return "" - value_pair_equals = "=" if named_parameter_expansion else "" + value_pair_equals = '=' if named_parameter_expansion else '' if not explode: return ( - next(prefix_separator_iterator) - + var_name_piece - + value_pair_equals - + prefix_separator_iterator.item_separator.join(item_values) + next(prefix_separator_iterator) + + var_name_piece + + value_pair_equals + + prefix_separator_iterator.item_separator.join(item_values) ) # exploded return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( @@ -218,32 +207,27 @@ def __ref6570_dict_expansion( percent_encode: bool, prefix_separator_iterator: PrefixSeparatorIterator, var_name_piece: str, - named_parameter_expansion: bool, + named_parameter_expansion: bool ) -> str: - in_data_transformed = { - key: cls.__ref6570_item_value(val, percent_encode) - for key, val in in_data.items() - } - in_data_transformed = { - key: val for key, val in in_data_transformed.items() if val is not None - } + in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} + in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} if not in_data_transformed: # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 return "" - value_pair_equals = "=" if named_parameter_expansion else "" + value_pair_equals = '=' if named_parameter_expansion else '' if not explode: return ( - next(prefix_separator_iterator) - + var_name_piece - + value_pair_equals - + prefix_separator_iterator.item_separator.join( - prefix_separator_iterator.item_separator.join(item_pair) - for item_pair in in_data_transformed.items() + next(prefix_separator_iterator) + + var_name_piece + value_pair_equals + + prefix_separator_iterator.item_separator.join( + prefix_separator_iterator.item_separator.join( + item_pair + ) for item_pair in in_data_transformed.items() ) ) # exploded return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [key + "=" + val for key, val in in_data_transformed.items()] + [key + '=' + val for key, val in in_data_transformed.items()] ) @classmethod @@ -253,13 +237,13 @@ def _ref6570_expansion( in_data: typing.Any, explode: bool, percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, + prefix_separator_iterator: PrefixSeparatorIterator ) -> str: """ Separator is for separate variables like dict with explode true, not for array item separation """ - named_parameter_expansion = prefix_separator_iterator.separator in {"&", ";"} - var_name_piece = variable_name if named_parameter_expansion else "" + named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} + var_name_piece = variable_name if named_parameter_expansion else '' if type(in_data) in {str, float, int}: return cls.__ref6570_str_float_int_expansion( variable_name, @@ -268,7 +252,7 @@ def _ref6570_expansion( percent_encode, prefix_separator_iterator, var_name_piece, - named_parameter_expansion, + named_parameter_expansion ) elif isinstance(in_data, none_type): # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 @@ -281,7 +265,7 @@ def _ref6570_expansion( percent_encode, prefix_separator_iterator, var_name_piece, - named_parameter_expansion, + named_parameter_expansion ) elif isinstance(in_data, dict): return cls.__ref6570_dict_expansion( @@ -291,12 +275,10 @@ def _ref6570_expansion( percent_encode, prefix_separator_iterator, var_name_piece, - named_parameter_expansion, + named_parameter_expansion ) # bool, bytes, etc - raise ApiValueError( - "Unable to generate a ref6570 representation of {}".format(in_data) - ) + raise ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) class StyleFormSerializer(ParameterSerializerBase): @@ -312,34 +294,35 @@ def _serialize_form( name: str, explode: bool, percent_encode: bool, - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None, + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None ) -> str: if prefix_separator_iterator is None: - prefix_separator_iterator = PrefixSeparatorIterator("", "&") + prefix_separator_iterator = PrefixSeparatorIterator('', '&') return self._ref6570_expansion( variable_name=name, in_data=in_data, explode=explode, percent_encode=percent_encode, - prefix_separator_iterator=prefix_separator_iterator, + prefix_separator_iterator=prefix_separator_iterator ) class StyleSimpleSerializer(ParameterSerializerBase): + def _serialize_simple( self, in_data: typing.Union[None, int, float, str, bool, dict, list], name: str, explode: bool, - percent_encode: bool, + percent_encode: bool ) -> str: - prefix_separator_iterator = PrefixSeparatorIterator("", ",") + prefix_separator_iterator = PrefixSeparatorIterator('', ',') return self._ref6570_expansion( variable_name=name, in_data=in_data, explode=explode, percent_encode=percent_encode, - prefix_separator_iterator=prefix_separator_iterator, + prefix_separator_iterator=prefix_separator_iterator ) @@ -351,7 +334,6 @@ class JSONDetector: application/json-patch+json application/geo+json """ - __json_content_type_pattern = re.compile("application/[^+]*[+]?(json);?.*") @classmethod @@ -387,19 +369,17 @@ class ParameterBase(JSONDetector): ParameterInType.HEADER: ParameterStyle.SIMPLE, ParameterInType.COOKIE: ParameterStyle.FORM, } - __disallowed_header_names = {"Accept", "Content-Type", "Authorization"} + __disallowed_header_names = {'Accept', 'Content-Type', 'Authorization'} _json_encoder = JSONEncoder() @classmethod - def __verify_style_to_in_type( - cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType - ): + def __verify_style_to_in_type(cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType): if style is None: return in_type_set = cls.__style_to_in_type[style] if in_type not in in_type_set: raise ValueError( - "Invalid style and in_type combination. For style={} only in_type={} are allowed".format( + 'Invalid style and in_type combination. For style={} only in_type={} are allowed'.format( style, in_type_set ) ) @@ -413,29 +393,19 @@ def __init__( explode: bool = False, allow_reserved: typing.Optional[bool] = None, schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None ): if schema is None and content is None: - raise ValueError("Value missing; Pass in either schema or content") + raise ValueError('Value missing; Pass in either schema or content') if schema and content: - raise ValueError( - "Too many values provided. Both schema and content were provided. Only one may be input" - ) + raise ValueError('Too many values provided. Both schema and content were provided. Only one may be input') if name in self.__disallowed_header_names and in_type is ParameterInType.HEADER: - raise ValueError( - "Invalid name, name may not be one of {}".format( - self.__disallowed_header_names - ) - ) + raise ValueError('Invalid name, name may not be one of {}'.format(self.__disallowed_header_names)) self.__verify_style_to_in_type(style, in_type) if content is None and style is None: style = self.__in_type_to_default_style[in_type] - if ( - content is not None - and in_type in self.__in_type_to_default_style - and len(content) != 1 - ): - raise ValueError("Invalid content length, content length must equal 1") + if content is not None and in_type in self.__in_type_to_default_style and len(content) != 1: + raise ValueError('Invalid content length, content length must equal 1') self.in_type = in_type self.name = name self.required = required @@ -448,7 +418,7 @@ def __init__( def _serialize_json( self, in_data: typing.Union[None, int, float, str, bool, dict, list], - eliminate_whitespace: bool = False, + eliminate_whitespace: bool = False ) -> str: if eliminate_whitespace: return json.dumps(in_data, separators=self._json_encoder.compact_separators) @@ -456,6 +426,7 @@ def _serialize_json( class PathParameter(ParameterBase, StyleSimpleSerializer): + def __init__( self, name: str, @@ -464,7 +435,7 @@ def __init__( explode: bool = False, allow_reserved: typing.Optional[bool] = None, schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None ): super().__init__( name, @@ -474,32 +445,34 @@ def __init__( explode=explode, allow_reserved=allow_reserved, schema=schema, - content=content, + content=content ) def __serialize_label( - self, in_data: typing.Union[None, int, float, str, bool, dict, list] + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] ) -> typing.Dict[str, str]: - prefix_separator_iterator = PrefixSeparatorIterator(".", ".") + prefix_separator_iterator = PrefixSeparatorIterator('.', '.') value = self._ref6570_expansion( variable_name=self.name, in_data=in_data, explode=self.explode, percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator, + prefix_separator_iterator=prefix_separator_iterator ) return self._to_dict(self.name, value) def __serialize_matrix( - self, in_data: typing.Union[None, int, float, str, bool, dict, list] + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] ) -> typing.Dict[str, str]: - prefix_separator_iterator = PrefixSeparatorIterator(";", ";") + prefix_separator_iterator = PrefixSeparatorIterator(';', ';') value = self._ref6570_expansion( variable_name=self.name, in_data=in_data, explode=self.explode, percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator, + prefix_separator_iterator=prefix_separator_iterator ) return self._to_dict(self.name, value) @@ -508,27 +481,17 @@ def __serialize_simple( in_data: typing.Union[None, int, float, str, bool, dict, list], ) -> typing.Dict[str, str]: value = self._serialize_simple( - in_data=in_data, name=self.name, explode=self.explode, percent_encode=True + in_data=in_data, + name=self.name, + explode=self.explode, + percent_encode=True ) return self._to_dict(self.name, value) def serialize( self, in_data: typing.Union[ - Schema, - Decimal, - int, - float, - str, - date, - datetime, - None, - bool, - list, - tuple, - dict, - frozendict.frozendict, - ], + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: if self.schema: cast_in_data = self.schema(in_data) @@ -556,12 +519,11 @@ def serialize( if self._content_type_is_json(content_type): value = self._serialize_json(cast_in_data) return self._to_dict(self.name, value) - raise NotImplementedError( - "Serialization of {} has not yet been implemented".format(content_type) - ) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class QueryParameter(ParameterBase, StyleFormSerializer): + def __init__( self, name: str, @@ -570,12 +532,10 @@ def __init__( explode: typing.Optional[bool] = None, allow_reserved: typing.Optional[bool] = None, schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None ): used_style = ParameterStyle.FORM if style is None else style - used_explode = ( - self._get_default_explode(used_style) if explode is None else explode - ) + used_explode = self._get_default_explode(used_style) if explode is None else explode super().__init__( name, @@ -585,13 +545,13 @@ def __init__( explode=used_explode, allow_reserved=allow_reserved, schema=schema, - content=content, + content=content ) def __serialize_space_delimited( self, in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: prefix_separator_iterator = self.get_prefix_separator_iterator() @@ -600,14 +560,14 @@ def __serialize_space_delimited( in_data=in_data, explode=self.explode, percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator, + prefix_separator_iterator=prefix_separator_iterator ) return self._to_dict(self.name, value) def __serialize_pipe_delimited( self, in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: prefix_separator_iterator = self.get_prefix_separator_iterator() @@ -616,14 +576,14 @@ def __serialize_pipe_delimited( in_data=in_data, explode=self.explode, percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator, + prefix_separator_iterator=prefix_separator_iterator ) return self._to_dict(self.name, value) def __serialize_form( self, in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: prefix_separator_iterator = self.get_prefix_separator_iterator() @@ -632,36 +592,23 @@ def __serialize_form( name=self.name, explode=self.explode, percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator, + prefix_separator_iterator=prefix_separator_iterator ) return self._to_dict(self.name, value) def get_prefix_separator_iterator(self) -> typing.Optional[PrefixSeparatorIterator]: if self.style is ParameterStyle.FORM: - return PrefixSeparatorIterator("?", "&") + return PrefixSeparatorIterator('?', '&') elif self.style is ParameterStyle.SPACE_DELIMITED: - return PrefixSeparatorIterator("", "%20") + return PrefixSeparatorIterator('', '%20') elif self.style is ParameterStyle.PIPE_DELIMITED: - return PrefixSeparatorIterator("", "|") + return PrefixSeparatorIterator('', '|') def serialize( self, in_data: typing.Union[ - Schema, - Decimal, - int, - float, - str, - date, - datetime, - None, - bool, - list, - tuple, - dict, - frozendict.frozendict, - ], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None, + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None ) -> typing.Dict[str, str]: if self.schema: cast_in_data = self.schema(in_data) @@ -682,17 +629,11 @@ def serialize( if self.style: # TODO update query ones to omit setting values when [] {} or None is input if self.style is ParameterStyle.FORM: - return self.__serialize_form( - cast_in_data, prefix_separator_iterator - ) + return self.__serialize_form(cast_in_data, prefix_separator_iterator) elif self.style is ParameterStyle.SPACE_DELIMITED: - return self.__serialize_space_delimited( - cast_in_data, prefix_separator_iterator - ) + return self.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) elif self.style is ParameterStyle.PIPE_DELIMITED: - return self.__serialize_pipe_delimited( - cast_in_data, prefix_separator_iterator - ) + return self.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) # self.content will be length one if prefix_separator_iterator is None: prefix_separator_iterator = self.get_prefix_separator_iterator() @@ -703,14 +644,13 @@ def serialize( value = self._serialize_json(cast_in_data, eliminate_whitespace=True) return self._to_dict( self.name, - next(prefix_separator_iterator) + self.name + "=" + quote(value), + next(prefix_separator_iterator) + self.name + '=' + quote(value) ) - raise NotImplementedError( - "Serialization of {} has not yet been implemented".format(content_type) - ) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class CookieParameter(ParameterBase, StyleFormSerializer): + def __init__( self, name: str, @@ -719,16 +659,10 @@ def __init__( explode: typing.Optional[bool] = None, allow_reserved: typing.Optional[bool] = None, schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None ): - used_style = ( - ParameterStyle.FORM - if style is None and content is None and schema - else style - ) - used_explode = ( - self._get_default_explode(used_style) if explode is None else explode - ) + used_style = ParameterStyle.FORM if style is None and content is None and schema else style + used_explode = self._get_default_explode(used_style) if explode is None else explode super().__init__( name, @@ -738,26 +672,13 @@ def __init__( explode=used_explode, allow_reserved=allow_reserved, schema=schema, - content=content, + content=content ) def serialize( self, in_data: typing.Union[ - Schema, - Decimal, - int, - float, - str, - date, - datetime, - None, - bool, - list, - tuple, - dict, - frozendict.frozendict, - ], + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: if self.schema: cast_in_data = self.schema(in_data) @@ -776,7 +697,7 @@ def serialize( explode=self.explode, name=self.name, percent_encode=False, - prefix_separator_iterator=PrefixSeparatorIterator("", "&"), + prefix_separator_iterator=PrefixSeparatorIterator('', '&') ) return self._to_dict(self.name, value) # self.content will be length one @@ -786,9 +707,7 @@ def serialize( if self._content_type_is_json(content_type): value = self._serialize_json(cast_in_data) return self._to_dict(self.name, value) - raise NotImplementedError( - "Serialization of {} has not yet been implemented".format(content_type) - ) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class HeaderParameter(ParameterBase, StyleSimpleSerializer): @@ -800,7 +719,7 @@ def __init__( explode: bool = False, allow_reserved: typing.Optional[bool] = None, schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None ): super().__init__( name, @@ -810,13 +729,11 @@ def __init__( explode=explode, allow_reserved=allow_reserved, schema=schema, - content=content, + content=content ) @staticmethod - def __to_headers( - in_data: typing.Tuple[typing.Tuple[str, str], ...] - ) -> HTTPHeaderDict: + def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict: data = tuple(t for t in in_data if t) headers = HTTPHeaderDict() if not data: @@ -827,20 +744,7 @@ def __to_headers( def serialize( self, in_data: typing.Union[ - Schema, - Decimal, - int, - float, - str, - date, - datetime, - None, - bool, - list, - tuple, - dict, - frozendict.frozendict, - ], + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> HTTPHeaderDict: if self.schema: cast_in_data = self.schema(in_data) @@ -851,9 +755,7 @@ def serialize( returns headers: dict """ if self.style: - value = self._serialize_simple( - cast_in_data, self.name, self.explode, False - ) + value = self._serialize_simple(cast_in_data, self.name, self.explode, False) return self.__to_headers(((self.name, value),)) # self.content will be length one for content_type, schema in self.content.items(): @@ -862,9 +764,7 @@ def serialize( if self._content_type_is_json(content_type): value = self._serialize_json(cast_in_data) return self.__to_headers(((self.name, value),)) - raise NotImplementedError( - "Serialization of {} has not yet been implemented".format(content_type) - ) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class Encoding: @@ -893,7 +793,6 @@ class MediaType: The encoding object SHALL only apply to requestBody objects when the media type is multipart or application/x-www-form-urlencoded. """ - schema: typing.Optional[typing.Type[Schema]] = None encoding: typing.Optional[typing.Dict[str, Encoding]] = None @@ -908,7 +807,7 @@ def __init__( self, response: urllib3.HTTPResponse, body: typing.Union[Unset, Schema] = unset, - headers: typing.Union[Unset, typing.Dict[str, Schema]] = unset, + headers: typing.Union[Unset, typing.Dict[str, Schema]] = unset ): """ pycharm needs this to prevent 'Unexpected argument' warnings @@ -936,9 +835,7 @@ def __init__( ): self.headers = headers if content is not None and len(content) == 0: - raise ValueError( - "Invalid value for content, the content dict must have >= 1 entry" - ) + raise ValueError('Invalid value for content, the content dict must have >= 1 entry') self.content = content self.response_cls = response_cls @@ -948,9 +845,7 @@ def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: return json.loads(response.data) @staticmethod - def __file_name_from_response_url( - response_url: typing.Optional[str], - ) -> typing.Optional[str]: + def __file_name_from_response_url(response_url: typing.Optional[str]) -> typing.Optional[str]: if response_url is None: return None url_path = urlparse(response_url).path @@ -963,9 +858,7 @@ def __file_name_from_response_url( return None @classmethod - def __file_name_from_content_disposition( - cls, content_disposition: typing.Optional[str] - ) -> typing.Optional[str]: + def __file_name_from_content_disposition(cls, content_disposition: typing.Optional[str]) -> typing.Optional[str]: if content_disposition is None: return None match = cls.__filename_content_disposition_pattern.search(content_disposition) @@ -983,16 +876,17 @@ def __deserialize_application_octet_stream( a file will be written and returned """ if response.supports_chunked_reads(): - file_name = self.__file_name_from_content_disposition( - response.headers.get("content-disposition") - ) or self.__file_name_from_response_url(response.geturl()) + file_name = ( + self.__file_name_from_content_disposition(response.headers.get('content-disposition')) + or self.__file_name_from_response_url(response.geturl()) + ) if file_name is None: _fd, path = tempfile.mkstemp() else: path = os.path.join(tempfile.gettempdir(), file_name) - with open(path, "wb") as new_file: + with open(path, 'wb') as new_file: chunk_size = 1024 while True: data = response.read(chunk_size) @@ -1001,14 +895,14 @@ def __deserialize_application_octet_stream( new_file.write(data) # release_conn is needed for streaming connections only response.release_conn() - new_file = open(path, "rb") + new_file = open(path, 'rb') return new_file else: return response.data @staticmethod def __deserialize_multipart_form_data( - response: urllib3.HTTPResponse, + response: urllib3.HTTPResponse ) -> typing.Dict[str, typing.Any]: msg = email.message_from_bytes(response.data) return { @@ -1020,10 +914,8 @@ def __deserialize_multipart_form_data( for part in msg.get_payload() } - def deserialize( - self, response: urllib3.HTTPResponse, configuration: Configuration - ) -> ApiResponse: - content_type = response.getheader("content-type") + def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: + content_type = response.getheader('content-type') deserialized_body = unset streamed = response.supports_chunked_reads() @@ -1042,30 +934,29 @@ def deserialize( if body_schema is None: # some specs do not define response content media type schemas return self.response_cls( - response=response, headers=deserialized_headers, body=unset + response=response, + headers=deserialized_headers, + body=unset ) if self._content_type_is_json(content_type): body_data = self.__deserialize_json(response) - elif content_type == "application/octet-stream": + elif content_type == 'application/octet-stream': body_data = self.__deserialize_application_octet_stream(response) - elif content_type.startswith("multipart/form-data"): + elif content_type.startswith('multipart/form-data'): body_data = self.__deserialize_multipart_form_data(response) - content_type = "multipart/form-data" + content_type = 'multipart/form-data' else: - raise NotImplementedError( - "Deserialization of {} has not yet been implemented".format( - content_type - ) - ) + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) deserialized_body = body_schema.from_openapi_data_oapg( - body_data, _configuration=configuration - ) + body_data, _configuration=configuration) elif streamed: response.release_conn() return self.response_cls( - response=response, headers=deserialized_headers, body=deserialized_body + response=response, + headers=deserialized_headers, + body=deserialized_body ) @@ -1099,7 +990,7 @@ def __init__( header_name: typing.Optional[str] = None, header_value: typing.Optional[str] = None, cookie: typing.Optional[str] = None, - pool_threads: int = 1, + pool_threads: int = 1 ): if configuration is None: configuration = Configuration() @@ -1112,7 +1003,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = "OpenAPI-Generator/1.0.0/python" + self.user_agent = 'OpenAPI-Generator/1.0.0/python' def __enter__(self): return self @@ -1125,13 +1016,13 @@ def close(self): self._pool.close() self._pool.join() self._pool = None - if hasattr(atexit, "unregister"): + if hasattr(atexit, 'unregister'): atexit.unregister(self.close) @property def pool(self): """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. + avoids instantiating unused threadpool for blocking clients. """ if self._pool is None: atexit.register(self.close) @@ -1141,11 +1032,11 @@ def pool(self): @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 @@ -1162,15 +1053,15 @@ def __call_api( timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, host: typing.Optional[str] = None, ) -> urllib3.HTTPResponse: + # header parameters used_headers = HTTPHeaderDict(self.default_headers) if self.cookie: - headers["Cookie"] = self.cookie + headers['Cookie'] = self.cookie # auth setting - self.update_params_for_auth( - used_headers, auth_settings, resource_path, method, body - ) + self.update_params_for_auth(used_headers, + auth_settings, resource_path, method, body) # must happen after cookie setting and auth setting in case user is overriding those if headers: @@ -1268,7 +1159,7 @@ def call_api( stream, timeout, host, - ), + ) ) def request( @@ -1283,62 +1174,57 @@ def request( ) -> urllib3.HTTPResponse: """Makes the HTTP request using RESTClient.""" if method == "GET": - return self.rest_client.GET( - url, stream=stream, timeout=timeout, headers=headers - ) + return self.rest_client.GET(url, + stream=stream, + timeout=timeout, + headers=headers) elif method == "HEAD": - return self.rest_client.HEAD( - url, stream=stream, timeout=timeout, headers=headers - ) + return self.rest_client.HEAD(url, + stream=stream, + timeout=timeout, + headers=headers) elif method == "OPTIONS": - return self.rest_client.OPTIONS( - url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body, - ) + return self.rest_client.OPTIONS(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) elif method == "POST": - return self.rest_client.POST( - url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body, - ) + return self.rest_client.POST(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) elif method == "PUT": - return self.rest_client.PUT( - url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body, - ) + return self.rest_client.PUT(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) elif method == "PATCH": - return self.rest_client.PATCH( - url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body, - ) + return self.rest_client.PATCH(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) elif method == "DELETE": - return self.rest_client.DELETE( - url, headers=headers, stream=stream, timeout=timeout, body=body - ) + return self.rest_client.DELETE(url, + headers=headers, + stream=stream, + timeout=timeout, + body=body) else: raise ApiValueError( "http method must be `GET`, `HEAD`, `OPTIONS`," " `POST`, `PATCH`, `PUT` or `DELETE`." ) - def update_params_for_auth( - self, headers, auth_settings, resource_path, method, body - ): + def update_params_for_auth(self, headers, auth_settings, + resource_path, method, body): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -1355,20 +1241,20 @@ def update_params_for_auth( auth_setting = self.configuration.auth_settings().get(auth) if not auth_setting: continue - if auth_setting["in"] == "cookie": - headers.add("Cookie", auth_setting["value"]) - elif auth_setting["in"] == "header": - if auth_setting["type"] != "http-signature": - headers.add(auth_setting["key"], auth_setting["value"]) - elif auth_setting["in"] == "query": - """TODO implement auth in query + if auth_setting['in'] == 'cookie': + headers.add('Cookie', auth_setting['value']) + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers.add(auth_setting['key'], auth_setting['value']) + elif auth_setting['in'] == 'query': + """ TODO implement auth in query need to pass in prefix_separator_iterator and need to output resource_path with query params added """ raise ApiValueError("Auth in query not yet implemented") else: raise ApiValueError( - "Authentication token must be in `query` or `header`" + 'Authentication token must be in `query` or `header`' ) @@ -1385,10 +1271,7 @@ def __init__(self, api_client: typing.Optional[ApiClient] = None): self.api_client = api_client @staticmethod - def _verify_typed_dict_inputs_oapg( - cls: typing.Type[typing_extensions.TypedDict], - data: typing.Dict[str, typing.Any], - ): + def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]): """ Ensures that: - required keys are present @@ -1407,16 +1290,14 @@ def _verify_typed_dict_inputs_oapg( required_keys_with_unset_values.append(required_key) if missing_required_keys: raise ApiTypeError( - "{} missing {} required arguments: {}".format( + '{} missing {} required arguments: {}'.format( cls.__name__, len(missing_required_keys), missing_required_keys - ) - ) + ) + ) if required_keys_with_unset_values: raise ApiValueError( - "{} contains invalid unset values for {} required keys: {}".format( - cls.__name__, - len(required_keys_with_unset_values), - required_keys_with_unset_values, + '{} contains invalid unset values for {} required keys: {}'.format( + cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values ) ) @@ -1427,10 +1308,8 @@ def _verify_typed_dict_inputs_oapg( disallowed_additional_keys.append(key) if disallowed_additional_keys: raise ApiTypeError( - "{} got {} unexpected keyword arguments: {}".format( - cls.__name__, - len(disallowed_additional_keys), - disallowed_additional_keys, + '{} got {} unexpected keyword arguments: {}'.format( + cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys ) ) @@ -1438,7 +1317,7 @@ def _get_host_oapg( self, operation_id: str, servers: typing.Tuple[typing.Dict[str, str], ...] = tuple(), - host_index: typing.Optional[int] = None, + host_index: typing.Optional[int] = None ) -> typing.Optional[str]: configuration = self.api_client.configuration try: @@ -1457,7 +1336,8 @@ def _get_host_oapg( except IndexError: if servers: raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % len(servers) + "Invalid host index. Must be 0 <= index < %s" % + len(servers) ) host = None return host @@ -1473,7 +1353,6 @@ class RequestBody(StyleFormSerializer, JSONDetector): A request body parameter content: content_type to MediaType Schema info """ - __json_encoder = JSONEncoder() def __init__( @@ -1483,50 +1362,47 @@ def __init__( ): self.required = required if len(content) == 0: - raise ValueError( - "Invalid value for content, the content dict must have >= 1 entry" - ) + raise ValueError('Invalid value for content, the content dict must have >= 1 entry') self.content = content - def __serialize_json(self, in_data: typing.Any) -> typing.Dict[str, bytes]: + def __serialize_json( + self, + in_data: typing.Any + ) -> typing.Dict[str, bytes]: in_data = self.__json_encoder.default(in_data) - json_str = json.dumps( - in_data, separators=(",", ":"), ensure_ascii=False - ).encode("utf-8") + json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( + "utf-8" + ) return dict(body=json_str) @staticmethod def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: if isinstance(in_data, frozendict.frozendict): - raise ValueError( - "Unable to serialize type frozendict.frozendict to text/plain" - ) + raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') elif isinstance(in_data, tuple): - raise ValueError("Unable to serialize type tuple to text/plain") + raise ValueError('Unable to serialize type tuple to text/plain') elif isinstance(in_data, NoneClass): - raise ValueError("Unable to serialize type NoneClass to text/plain") + raise ValueError('Unable to serialize type NoneClass to text/plain') elif isinstance(in_data, BoolClass): - raise ValueError("Unable to serialize type BoolClass to text/plain") + raise ValueError('Unable to serialize type BoolClass to text/plain') return dict(body=str(in_data)) def __multipart_json_item(self, key: str, value: Schema) -> RequestField: json_value = self.__json_encoder.default(value) request_field = RequestField(name=key, data=json.dumps(json_value)) - request_field.make_multipart(content_type="application/json") + request_field.make_multipart(content_type='application/json') return request_field def __multipart_form_item(self, key: str, value: Schema) -> RequestField: if isinstance(value, str): request_field = RequestField(name=key, data=str(value)) - request_field.make_multipart(content_type="text/plain") + request_field.make_multipart(content_type='text/plain') elif isinstance(value, bytes): request_field = RequestField(name=key, data=value) - request_field.make_multipart(content_type="application/octet-stream") + request_field.make_multipart(content_type='application/octet-stream') elif isinstance(value, FileIO): # TODO use content.encoding to limit allowed content types if they are present - request_field = RequestField.from_tuples( - key, (os.path.basename(value.name), value.read()) - ) + request_field = RequestField.from_tuples(key, (os.path.basename(value.name), value.read())) value.close() else: request_field = self.__multipart_json_item(key=key, value=value) @@ -1536,9 +1412,7 @@ def __serialize_multipart_form_data( self, in_data: Schema ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: if not isinstance(in_data, frozendict.frozendict): - raise ValueError( - f"Unable to serialize {in_data} to multipart/form-data because it is not a dict of data" - ) + raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') """ In a multipart/form-data request body, each schema property, or each element of a schema array property, takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy @@ -1570,9 +1444,7 @@ def __serialize_multipart_form_data( return dict(fields=tuple(fields)) - def __serialize_application_octet_stream( - self, in_data: BinarySchema - ) -> typing.Dict[str, bytes]: + def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing.Dict[str, bytes]: if isinstance(in_data, bytes): return dict(body=in_data) # FileIO type @@ -1588,12 +1460,9 @@ def __serialize_application_x_www_form_data( """ if not isinstance(in_data, frozendict.frozendict): raise ValueError( - f"Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data" - ) + f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') cast_in_data = self.__json_encoder.default(in_data) - value = self._serialize_form( - cast_in_data, name="", explode=True, percent_encode=True - ) + value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) return dict(body=value) def serialize( @@ -1619,14 +1488,12 @@ def serialize( # and content_type is multipart or application/x-www-form-urlencoded if self._content_type_is_json(content_type): return self.__serialize_json(cast_in_data) - elif content_type == "text/plain": + elif content_type == 'text/plain': return self.__serialize_text_plain(cast_in_data) - elif content_type == "multipart/form-data": + elif content_type == 'multipart/form-data': return self.__serialize_multipart_form_data(cast_in_data) - elif content_type == "application/x-www-form-urlencoded": + elif content_type == 'application/x-www-form-urlencoded': return self.__serialize_application_x_www_form_data(cast_in_data) - elif content_type == "application/octet-stream": + elif content_type == 'application/octet-stream': return self.__serialize_application_octet_stream(cast_in_data) - raise NotImplementedError( - "Serialization has not yet been implemented for {}".format(content_type) - ) + raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) \ No newline at end of file diff --git a/package/gentrace/apis/__init__.py b/package/gentrace/apis/__init__.py index 5ca66b80..7840f772 100644 --- a/package/gentrace/apis/__init__.py +++ b/package/gentrace/apis/__init__.py @@ -1,3 +1,3 @@ # do not import all endpoints into this module because that uses a lot of memory and stack frames # if you need the ability to import all endpoints then import them from -# tags, paths, or path_to_api, or tag_to_api +# tags, paths, or path_to_api, or tag_to_api \ No newline at end of file diff --git a/package/gentrace/apis/tag_to_api.py b/package/gentrace/apis/tag_to_api.py index 609cb586..fafe1eee 100644 --- a/package/gentrace/apis/tag_to_api.py +++ b/package/gentrace/apis/tag_to_api.py @@ -5,11 +5,11 @@ from gentrace.apis.tags.feedback_api import FeedbackApi TagToApi = typing_extensions.TypedDict( - "TagToApi", + 'TagToApi', { TagValues.CORE: CoreApi, TagValues.FEEDBACK: FeedbackApi, - }, + } ) tag_to_api = TagToApi( diff --git a/package/gentrace/apis/tags/core_api.py b/package/gentrace/apis/tags/core_api.py index 8a08a6c1..01628d67 100644 --- a/package/gentrace/apis/tags/core_api.py +++ b/package/gentrace/apis/tags/core_api.py @@ -28,5 +28,4 @@ class CoreApi( Do not edit the class manually. """ - pass diff --git a/package/gentrace/exceptions.py b/package/gentrace/exceptions.py index 9d118458..0540adb1 100644 --- a/package/gentrace/exceptions.py +++ b/package/gentrace/exceptions.py @@ -19,8 +19,9 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None): - """Raises an exception for TypeErrors + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors Args: msg (str): the exception message @@ -123,9 +124,11 @@ def headers(self) -> typing.Optional[HTTPHeaderDict]: def __str__(self): """Custom error messages for exception""" - error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) + error_message = "({0})\n"\ + "Reason: {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.body: error_message += "HTTP response body: {0}\n".format(self.body) diff --git a/package/gentrace/model/feedback_request.py b/package/gentrace/model/feedback_request.py index e34909cc..1e81444d 100644 --- a/package/gentrace/model/feedback_request.py +++ b/package/gentrace/model/feedback_request.py @@ -23,159 +23,109 @@ from gentrace import schemas # noqa: F401 -class FeedbackRequest(schemas.DictSchema): +class FeedbackRequest( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ + class MetaOapg: required = { "score", "pipelineRunId", "recordedTime", } - + class properties: pipelineRunId = schemas.UUIDSchema - - class score(schemas.Float32Schema): + + + class score( + schemas.Float32Schema + ): + + class MetaOapg: - format = "float" + format = 'float' inclusive_maximum = 1 inclusive_minimum = 0 - recordedTime = schemas.DateTimeSchema - + + class details( - schemas.StrBase, schemas.NoneBase, schemas.Schema, schemas.NoneStrMixin + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin ): + + def __new__( cls, - *_args: typing.Union[ - None, - str, - ], + *_args: typing.Union[None, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "details": + ) -> 'details': return super().__new__( cls, *_args, _configuration=_configuration, ) - __annotations__ = { "pipelineRunId": pipelineRunId, "score": score, "recordedTime": recordedTime, "details": details, } - additional_properties = schemas.NotAnyTypeSchema - + score: MetaOapg.properties.score pipelineRunId: MetaOapg.properties.pipelineRunId recordedTime: MetaOapg.properties.recordedTime - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["score"] - ) -> MetaOapg.properties.score: - ... - + def __getitem__(self, name: typing_extensions.Literal["score"]) -> MetaOapg.properties.score: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["pipelineRunId"] - ) -> MetaOapg.properties.pipelineRunId: - ... - + def __getitem__(self, name: typing_extensions.Literal["pipelineRunId"]) -> MetaOapg.properties.pipelineRunId: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["recordedTime"] - ) -> MetaOapg.properties.recordedTime: - ... - + def __getitem__(self, name: typing_extensions.Literal["recordedTime"]) -> MetaOapg.properties.recordedTime: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["details"] - ) -> MetaOapg.properties.details: - ... - - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal["score"], - typing_extensions.Literal["pipelineRunId"], - typing_extensions.Literal["recordedTime"], - typing_extensions.Literal["details"], - ], - ): + def __getitem__(self, name: typing_extensions.Literal["details"]) -> MetaOapg.properties.details: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["score"], typing_extensions.Literal["pipelineRunId"], typing_extensions.Literal["recordedTime"], typing_extensions.Literal["details"], ]): # dict_instance[name] accessor return super().__getitem__(name) - + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["score"] - ) -> MetaOapg.properties.score: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["score"]) -> MetaOapg.properties.score: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["pipelineRunId"] - ) -> MetaOapg.properties.pipelineRunId: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["pipelineRunId"]) -> MetaOapg.properties.pipelineRunId: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["recordedTime"] - ) -> MetaOapg.properties.recordedTime: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["recordedTime"]) -> MetaOapg.properties.recordedTime: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["details"] - ) -> typing.Union[MetaOapg.properties.details, schemas.Unset]: - ... - - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal["score"], - typing_extensions.Literal["pipelineRunId"], - typing_extensions.Literal["recordedTime"], - typing_extensions.Literal["details"], - ], - ): + def get_item_oapg(self, name: typing_extensions.Literal["details"]) -> typing.Union[MetaOapg.properties.details, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["score"], typing_extensions.Literal["pipelineRunId"], typing_extensions.Literal["recordedTime"], typing_extensions.Literal["details"], ]): return super().get_item_oapg(name) def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - score: typing.Union[ - MetaOapg.properties.score, - decimal.Decimal, - int, - float, - ], - pipelineRunId: typing.Union[ - MetaOapg.properties.pipelineRunId, - str, - uuid.UUID, - ], - recordedTime: typing.Union[ - MetaOapg.properties.recordedTime, - str, - datetime, - ], - details: typing.Union[ - MetaOapg.properties.details, None, str, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + score: typing.Union[MetaOapg.properties.score, decimal.Decimal, int, float, ], + pipelineRunId: typing.Union[MetaOapg.properties.pipelineRunId, str, uuid.UUID, ], + recordedTime: typing.Union[MetaOapg.properties.recordedTime, str, datetime, ], + details: typing.Union[MetaOapg.properties.details, None, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "FeedbackRequest": + ) -> 'FeedbackRequest': return super().__new__( cls, *_args, diff --git a/package/gentrace/model/feedback_request.pyi b/package/gentrace/model/feedback_request.pyi index f3e37786..acfdbfd0 100644 --- a/package/gentrace/model/feedback_request.pyi +++ b/package/gentrace/model/feedback_request.pyi @@ -22,38 +22,47 @@ import typing_extensions # noqa: F401 from gentrace import schemas # noqa: F401 -class FeedbackRequest(schemas.DictSchema): +class FeedbackRequest( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ + class MetaOapg: required = { "score", "pipelineRunId", "recordedTime", } - + class properties: pipelineRunId = schemas.UUIDSchema - - class score(schemas.Float32Schema): + + + class score( + schemas.Float32Schema + ): pass recordedTime = schemas.DateTimeSchema - + + class details( - schemas.StrBase, schemas.NoneBase, schemas.Schema, schemas.NoneStrMixin + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin ): + + def __new__( cls, - *_args: typing.Union[ - None, - str, - ], + *_args: typing.Union[None, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "details": + ) -> 'details': return super().__new__( cls, *_args, @@ -66,90 +75,51 @@ class FeedbackRequest(schemas.DictSchema): "details": details, } additional_properties = schemas.NotAnyTypeSchema + score: MetaOapg.properties.score pipelineRunId: MetaOapg.properties.pipelineRunId recordedTime: MetaOapg.properties.recordedTime - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["score"] - ) -> MetaOapg.properties.score: ... + def __getitem__(self, name: typing_extensions.Literal["score"]) -> MetaOapg.properties.score: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["pipelineRunId"] - ) -> MetaOapg.properties.pipelineRunId: ... + def __getitem__(self, name: typing_extensions.Literal["pipelineRunId"]) -> MetaOapg.properties.pipelineRunId: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["recordedTime"] - ) -> MetaOapg.properties.recordedTime: ... + def __getitem__(self, name: typing_extensions.Literal["recordedTime"]) -> MetaOapg.properties.recordedTime: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["details"] - ) -> MetaOapg.properties.details: ... - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal["score"], - typing_extensions.Literal["pipelineRunId"], - typing_extensions.Literal["recordedTime"], - typing_extensions.Literal["details"], - ], - ): + def __getitem__(self, name: typing_extensions.Literal["details"]) -> MetaOapg.properties.details: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["score"], typing_extensions.Literal["pipelineRunId"], typing_extensions.Literal["recordedTime"], typing_extensions.Literal["details"], ]): # dict_instance[name] accessor return super().__getitem__(name) + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["score"] - ) -> MetaOapg.properties.score: ... + def get_item_oapg(self, name: typing_extensions.Literal["score"]) -> MetaOapg.properties.score: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["pipelineRunId"] - ) -> MetaOapg.properties.pipelineRunId: ... + def get_item_oapg(self, name: typing_extensions.Literal["pipelineRunId"]) -> MetaOapg.properties.pipelineRunId: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["recordedTime"] - ) -> MetaOapg.properties.recordedTime: ... + def get_item_oapg(self, name: typing_extensions.Literal["recordedTime"]) -> MetaOapg.properties.recordedTime: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["details"] - ) -> typing.Union[MetaOapg.properties.details, schemas.Unset]: ... - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal["score"], - typing_extensions.Literal["pipelineRunId"], - typing_extensions.Literal["recordedTime"], - typing_extensions.Literal["details"], - ], - ): + def get_item_oapg(self, name: typing_extensions.Literal["details"]) -> typing.Union[MetaOapg.properties.details, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["score"], typing_extensions.Literal["pipelineRunId"], typing_extensions.Literal["recordedTime"], typing_extensions.Literal["details"], ]): return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - score: typing.Union[ - MetaOapg.properties.score, - decimal.Decimal, - int, - float, - ], - pipelineRunId: typing.Union[ - MetaOapg.properties.pipelineRunId, - str, - uuid.UUID, - ], - recordedTime: typing.Union[ - MetaOapg.properties.recordedTime, - str, - datetime, - ], - details: typing.Union[ - MetaOapg.properties.details, None, str, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + score: typing.Union[MetaOapg.properties.score, decimal.Decimal, int, float, ], + pipelineRunId: typing.Union[MetaOapg.properties.pipelineRunId, str, uuid.UUID, ], + recordedTime: typing.Union[MetaOapg.properties.recordedTime, str, datetime, ], + details: typing.Union[MetaOapg.properties.details, None, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "FeedbackRequest": + ) -> 'FeedbackRequest': return super().__new__( cls, *_args, diff --git a/package/gentrace/model/feedback_response.py b/package/gentrace/model/feedback_response.py index 34da3350..52bafd7f 100644 --- a/package/gentrace/model/feedback_response.py +++ b/package/gentrace/model/feedback_response.py @@ -23,59 +23,49 @@ from gentrace import schemas # noqa: F401 -class FeedbackResponse(schemas.DictSchema): +class FeedbackResponse( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ + class MetaOapg: required = { "message", } - + class properties: message = schemas.StrSchema __annotations__ = { "message": message, } - additional_properties = schemas.NotAnyTypeSchema - + message: MetaOapg.properties.message - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["message"] - ) -> MetaOapg.properties.message: - ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["message"],]): + def __getitem__(self, name: typing_extensions.Literal["message"]) -> MetaOapg.properties.message: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["message"], ]): # dict_instance[name] accessor return super().__getitem__(name) - + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["message"] - ) -> MetaOapg.properties.message: - ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["message"],]): + def get_item_oapg(self, name: typing_extensions.Literal["message"]) -> MetaOapg.properties.message: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["message"], ]): return super().get_item_oapg(name) def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - message: typing.Union[ - MetaOapg.properties.message, - str, - ], + *_args: typing.Union[dict, frozendict.frozendict, ], + message: typing.Union[MetaOapg.properties.message, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "FeedbackResponse": + ) -> 'FeedbackResponse': return super().__new__( cls, *_args, diff --git a/package/gentrace/model/feedback_response.pyi b/package/gentrace/model/feedback_response.pyi index dc08f79b..9bdcf528 100644 --- a/package/gentrace/model/feedback_response.pyi +++ b/package/gentrace/model/feedback_response.pyi @@ -22,51 +22,49 @@ import typing_extensions # noqa: F401 from gentrace import schemas # noqa: F401 -class FeedbackResponse(schemas.DictSchema): +class FeedbackResponse( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ + class MetaOapg: required = { "message", } - + class properties: message = schemas.StrSchema __annotations__ = { "message": message, } additional_properties = schemas.NotAnyTypeSchema + message: MetaOapg.properties.message - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["message"] - ) -> MetaOapg.properties.message: ... - def __getitem__(self, name: typing.Union[typing_extensions.Literal["message"],]): + def __getitem__(self, name: typing_extensions.Literal["message"]) -> MetaOapg.properties.message: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["message"], ]): # dict_instance[name] accessor return super().__getitem__(name) + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["message"] - ) -> MetaOapg.properties.message: ... - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["message"],]): + def get_item_oapg(self, name: typing_extensions.Literal["message"]) -> MetaOapg.properties.message: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["message"], ]): return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - message: typing.Union[ - MetaOapg.properties.message, - str, - ], + *_args: typing.Union[dict, frozendict.frozendict, ], + message: typing.Union[MetaOapg.properties.message, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "FeedbackResponse": + ) -> 'FeedbackResponse': return super().__new__( cls, *_args, diff --git a/package/gentrace/model/pipeline_run_request.py b/package/gentrace/model/pipeline_run_request.py index bf09bf3e..d8c9e553 100644 --- a/package/gentrace/model/pipeline_run_request.py +++ b/package/gentrace/model/pipeline_run_request.py @@ -23,194 +23,143 @@ from gentrace import schemas # noqa: F401 -class PipelineRunRequest(schemas.DictSchema): +class PipelineRunRequest( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ + class MetaOapg: required = { "stepRuns", "name", "id", } - + class properties: id = schemas.UUIDSchema name = schemas.StrSchema - - class stepRuns(schemas.ListSchema): + + + class stepRuns( + schemas.ListSchema + ): + + class MetaOapg: - class items(schemas.DictSchema): + + + class items( + schemas.DictSchema + ): + + class MetaOapg: + class properties: - class provider(schemas.DictSchema): + + + class provider( + schemas.DictSchema + ): + + class MetaOapg: + class properties: name = schemas.StrSchema invocation = schemas.StrSchema - - class modelParams(schemas.DictSchema): + + + class modelParams( + schemas.DictSchema + ): + + class MetaOapg: - additional_properties = ( - schemas.AnyTypeSchema - ) - - def __getitem__( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: # dict_instance[name] accessor return super().__getitem__(name) - - def get_item_oapg( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: return super().get_item_oapg(name) - + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - MetaOapg.additional_properties, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader, - ], - ) -> "modelParams": + *_args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + ) -> 'modelParams': return super().__new__( cls, *_args, _configuration=_configuration, **kwargs, ) - - class inputs(schemas.DictSchema): + + + class inputs( + schemas.DictSchema + ): + + class MetaOapg: - additional_properties = ( - schemas.AnyTypeSchema - ) - - def __getitem__( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: # dict_instance[name] accessor return super().__getitem__(name) - - def get_item_oapg( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: return super().get_item_oapg(name) - + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - MetaOapg.additional_properties, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader, - ], - ) -> "inputs": + *_args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + ) -> 'inputs': return super().__new__( cls, *_args, _configuration=_configuration, **kwargs, ) - - class outputs(schemas.DictSchema): + + + class outputs( + schemas.DictSchema + ): + + class MetaOapg: - additional_properties = ( - schemas.AnyTypeSchema - ) - - def __getitem__( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: # dict_instance[name] accessor return super().__getitem__(name) - - def get_item_oapg( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: return super().get_item_oapg(name) - + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - MetaOapg.additional_properties, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader, - ], - ) -> "outputs": + *_args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + ) -> 'outputs': return super().__new__( cls, *_args, _configuration=_configuration, **kwargs, ) - __annotations__ = { "name": name, "invocation": invocation, @@ -218,178 +167,63 @@ def __new__( "inputs": inputs, "outputs": outputs, } - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["name"] - ) -> MetaOapg.properties.name: - ... - + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + @typing.overload - def __getitem__( - self, - name: typing_extensions.Literal["invocation"], - ) -> MetaOapg.properties.invocation: - ... - + def __getitem__(self, name: typing_extensions.Literal["invocation"]) -> MetaOapg.properties.invocation: ... + @typing.overload - def __getitem__( - self, - name: typing_extensions.Literal["modelParams"], - ) -> MetaOapg.properties.modelParams: - ... - + def __getitem__(self, name: typing_extensions.Literal["modelParams"]) -> MetaOapg.properties.modelParams: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["inputs"] - ) -> MetaOapg.properties.inputs: - ... - + def __getitem__(self, name: typing_extensions.Literal["inputs"]) -> MetaOapg.properties.inputs: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["outputs"] - ) -> MetaOapg.properties.outputs: - ... - + def __getitem__(self, name: typing_extensions.Literal["outputs"]) -> MetaOapg.properties.outputs: ... + @typing.overload - def __getitem__( - self, name: str - ) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "name", - "invocation", - "modelParams", - "inputs", - "outputs", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "invocation", "modelParams", "inputs", "outputs", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["name"] - ) -> typing.Union[ - MetaOapg.properties.name, schemas.Unset - ]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, - name: typing_extensions.Literal["invocation"], - ) -> typing.Union[ - MetaOapg.properties.invocation, schemas.Unset - ]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["invocation"]) -> typing.Union[MetaOapg.properties.invocation, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, - name: typing_extensions.Literal["modelParams"], - ) -> typing.Union[ - MetaOapg.properties.modelParams, schemas.Unset - ]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["modelParams"]) -> typing.Union[MetaOapg.properties.modelParams, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["inputs"] - ) -> typing.Union[ - MetaOapg.properties.inputs, schemas.Unset - ]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["inputs"]) -> typing.Union[MetaOapg.properties.inputs, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["outputs"] - ) -> typing.Union[ - MetaOapg.properties.outputs, schemas.Unset - ]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["outputs"]) -> typing.Union[MetaOapg.properties.outputs, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[ - schemas.UnsetAnyTypeSchema, schemas.Unset - ]: - ... - - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "name", - "invocation", - "modelParams", - "inputs", - "outputs", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "invocation", "modelParams", "inputs", "outputs", ], str]): return super().get_item_oapg(name) - + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - name: typing.Union[ - MetaOapg.properties.name, str, schemas.Unset - ] = schemas.unset, - invocation: typing.Union[ - MetaOapg.properties.invocation, - str, - schemas.Unset, - ] = schemas.unset, - modelParams: typing.Union[ - MetaOapg.properties.modelParams, - dict, - frozendict.frozendict, - schemas.Unset, - ] = schemas.unset, - inputs: typing.Union[ - MetaOapg.properties.inputs, - dict, - frozendict.frozendict, - schemas.Unset, - ] = schemas.unset, - outputs: typing.Union[ - MetaOapg.properties.outputs, - dict, - frozendict.frozendict, - schemas.Unset, - ] = schemas.unset, - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "provider": + *_args: typing.Union[dict, frozendict.frozendict, ], + name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, + invocation: typing.Union[MetaOapg.properties.invocation, str, schemas.Unset] = schemas.unset, + modelParams: typing.Union[MetaOapg.properties.modelParams, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + inputs: typing.Union[MetaOapg.properties.inputs, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + outputs: typing.Union[MetaOapg.properties.outputs, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'provider': return super().__new__( cls, *_args, @@ -401,7 +235,6 @@ def __new__( _configuration=_configuration, **kwargs, ) - elapsedTime = schemas.IntSchema startTime = schemas.DateTimeSchema endTime = schemas.DateTimeSchema @@ -411,146 +244,56 @@ def __new__( "startTime": startTime, "endTime": endTime, } - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["provider"] - ) -> MetaOapg.properties.provider: - ... - + def __getitem__(self, name: typing_extensions.Literal["provider"]) -> MetaOapg.properties.provider: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["elapsedTime"] - ) -> MetaOapg.properties.elapsedTime: - ... - + def __getitem__(self, name: typing_extensions.Literal["elapsedTime"]) -> MetaOapg.properties.elapsedTime: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["startTime"] - ) -> MetaOapg.properties.startTime: - ... - + def __getitem__(self, name: typing_extensions.Literal["startTime"]) -> MetaOapg.properties.startTime: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["endTime"] - ) -> MetaOapg.properties.endTime: - ... - + def __getitem__(self, name: typing_extensions.Literal["endTime"]) -> MetaOapg.properties.endTime: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "provider", - "elapsedTime", - "startTime", - "endTime", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["provider", "elapsedTime", "startTime", "endTime", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["provider"] - ) -> typing.Union[MetaOapg.properties.provider, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["provider"]) -> typing.Union[MetaOapg.properties.provider, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["elapsedTime"] - ) -> typing.Union[ - MetaOapg.properties.elapsedTime, schemas.Unset - ]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["elapsedTime"]) -> typing.Union[MetaOapg.properties.elapsedTime, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["startTime"] - ) -> typing.Union[MetaOapg.properties.startTime, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["startTime"]) -> typing.Union[MetaOapg.properties.startTime, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["endTime"] - ) -> typing.Union[MetaOapg.properties.endTime, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["endTime"]) -> typing.Union[MetaOapg.properties.endTime, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "provider", - "elapsedTime", - "startTime", - "endTime", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["provider", "elapsedTime", "startTime", "endTime", ], str]): return super().get_item_oapg(name) - + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - provider: typing.Union[ - MetaOapg.properties.provider, - dict, - frozendict.frozendict, - schemas.Unset, - ] = schemas.unset, - elapsedTime: typing.Union[ - MetaOapg.properties.elapsedTime, - decimal.Decimal, - int, - schemas.Unset, - ] = schemas.unset, - startTime: typing.Union[ - MetaOapg.properties.startTime, - str, - datetime, - schemas.Unset, - ] = schemas.unset, - endTime: typing.Union[ - MetaOapg.properties.endTime, - str, - datetime, - schemas.Unset, - ] = schemas.unset, - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "items": + *_args: typing.Union[dict, frozendict.frozendict, ], + provider: typing.Union[MetaOapg.properties.provider, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + elapsedTime: typing.Union[MetaOapg.properties.elapsedTime, decimal.Decimal, int, schemas.Unset] = schemas.unset, + startTime: typing.Union[MetaOapg.properties.startTime, str, datetime, schemas.Unset] = schemas.unset, + endTime: typing.Union[MetaOapg.properties.endTime, str, datetime, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'items': return super().__new__( cls, *_args, @@ -561,157 +304,72 @@ def __new__( _configuration=_configuration, **kwargs, ) - + def __new__( cls, - _arg: typing.Union[ - typing.Tuple[ - typing.Union[ - MetaOapg.items, - dict, - frozendict.frozendict, - ] - ], - typing.List[ - typing.Union[ - MetaOapg.items, - dict, - frozendict.frozendict, - ] - ], - ], + _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, ]]], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "stepRuns": + ) -> 'stepRuns': return super().__new__( cls, _arg, _configuration=_configuration, ) - + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) - __annotations__ = { "id": id, "name": name, "stepRuns": stepRuns, } - + stepRuns: MetaOapg.properties.stepRuns name: MetaOapg.properties.name id: MetaOapg.properties.id - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["id"] - ) -> MetaOapg.properties.id: - ... - + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["name"] - ) -> MetaOapg.properties.name: - ... - + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["stepRuns"] - ) -> MetaOapg.properties.stepRuns: - ... - + def __getitem__(self, name: typing_extensions.Literal["stepRuns"]) -> MetaOapg.properties.stepRuns: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "name", - "stepRuns", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "name", "stepRuns", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["id"] - ) -> MetaOapg.properties.id: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["name"] - ) -> MetaOapg.properties.name: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["stepRuns"] - ) -> MetaOapg.properties.stepRuns: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["stepRuns"]) -> MetaOapg.properties.stepRuns: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "name", - "stepRuns", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "name", "stepRuns", ], str]): return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - stepRuns: typing.Union[ - MetaOapg.properties.stepRuns, - list, - tuple, - ], - name: typing.Union[ - MetaOapg.properties.name, - str, - ], - id: typing.Union[ - MetaOapg.properties.id, - str, - uuid.UUID, - ], + *_args: typing.Union[dict, frozendict.frozendict, ], + stepRuns: typing.Union[MetaOapg.properties.stepRuns, list, tuple, ], + name: typing.Union[MetaOapg.properties.name, str, ], + id: typing.Union[MetaOapg.properties.id, str, uuid.UUID, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "PipelineRunRequest": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'PipelineRunRequest': return super().__new__( cls, *_args, diff --git a/package/gentrace/model/pipeline_run_request.pyi b/package/gentrace/model/pipeline_run_request.pyi index e4458ca4..f1362cbc 100644 --- a/package/gentrace/model/pipeline_run_request.pyi +++ b/package/gentrace/model/pipeline_run_request.pyi @@ -22,178 +22,137 @@ import typing_extensions # noqa: F401 from gentrace import schemas # noqa: F401 -class PipelineRunRequest(schemas.DictSchema): +class PipelineRunRequest( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ + class MetaOapg: required = { "stepRuns", "name", "id", } - + class properties: id = schemas.UUIDSchema name = schemas.StrSchema - - class stepRuns(schemas.ListSchema): + + + class stepRuns( + schemas.ListSchema + ): + + class MetaOapg: - class items(schemas.DictSchema): + + + class items( + schemas.DictSchema + ): + + class MetaOapg: + class properties: - class provider(schemas.DictSchema): + + + class provider( + schemas.DictSchema + ): + + class MetaOapg: + class properties: name = schemas.StrSchema invocation = schemas.StrSchema - - class modelParams(schemas.DictSchema): + + + class modelParams( + schemas.DictSchema + ): + + class MetaOapg: - additional_properties = ( - schemas.AnyTypeSchema - ) - def __getitem__( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: # dict_instance[name] accessor return super().__getitem__(name) - def get_item_oapg( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - MetaOapg.additional_properties, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader, - ], - ) -> "modelParams": + *_args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + ) -> 'modelParams': return super().__new__( cls, *_args, _configuration=_configuration, **kwargs, ) - - class inputs(schemas.DictSchema): + + + class inputs( + schemas.DictSchema + ): + + class MetaOapg: - additional_properties = ( - schemas.AnyTypeSchema - ) - def __getitem__( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: # dict_instance[name] accessor return super().__getitem__(name) - def get_item_oapg( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - MetaOapg.additional_properties, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader, - ], - ) -> "inputs": + *_args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + ) -> 'inputs': return super().__new__( cls, *_args, _configuration=_configuration, **kwargs, ) - - class outputs(schemas.DictSchema): + + + class outputs( + schemas.DictSchema + ): + + class MetaOapg: - additional_properties = ( - schemas.AnyTypeSchema - ) - def __getitem__( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: # dict_instance[name] accessor return super().__getitem__(name) - def get_item_oapg( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - MetaOapg.additional_properties, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader, - ], - ) -> "outputs": + *_args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + ) -> 'outputs': return super().__new__( cls, *_args, @@ -207,151 +166,63 @@ class PipelineRunRequest(schemas.DictSchema): "inputs": inputs, "outputs": outputs, } + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["name"] - ) -> MetaOapg.properties.name: ... + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + @typing.overload - def __getitem__( - self, - name: typing_extensions.Literal["invocation"], - ) -> MetaOapg.properties.invocation: ... + def __getitem__(self, name: typing_extensions.Literal["invocation"]) -> MetaOapg.properties.invocation: ... + @typing.overload - def __getitem__( - self, - name: typing_extensions.Literal["modelParams"], - ) -> MetaOapg.properties.modelParams: ... + def __getitem__(self, name: typing_extensions.Literal["modelParams"]) -> MetaOapg.properties.modelParams: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["inputs"] - ) -> MetaOapg.properties.inputs: ... + def __getitem__(self, name: typing_extensions.Literal["inputs"]) -> MetaOapg.properties.inputs: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["outputs"] - ) -> MetaOapg.properties.outputs: ... + def __getitem__(self, name: typing_extensions.Literal["outputs"]) -> MetaOapg.properties.outputs: ... + @typing.overload - def __getitem__( - self, name: str - ) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "name", - "invocation", - "modelParams", - "inputs", - "outputs", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "invocation", "modelParams", "inputs", "outputs", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["name"] - ) -> typing.Union[ - MetaOapg.properties.name, schemas.Unset - ]: ... + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, - name: typing_extensions.Literal["invocation"], - ) -> typing.Union[ - MetaOapg.properties.invocation, schemas.Unset - ]: ... + def get_item_oapg(self, name: typing_extensions.Literal["invocation"]) -> typing.Union[MetaOapg.properties.invocation, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, - name: typing_extensions.Literal["modelParams"], - ) -> typing.Union[ - MetaOapg.properties.modelParams, schemas.Unset - ]: ... + def get_item_oapg(self, name: typing_extensions.Literal["modelParams"]) -> typing.Union[MetaOapg.properties.modelParams, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["inputs"] - ) -> typing.Union[ - MetaOapg.properties.inputs, schemas.Unset - ]: ... + def get_item_oapg(self, name: typing_extensions.Literal["inputs"]) -> typing.Union[MetaOapg.properties.inputs, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["outputs"] - ) -> typing.Union[ - MetaOapg.properties.outputs, schemas.Unset - ]: ... + def get_item_oapg(self, name: typing_extensions.Literal["outputs"]) -> typing.Union[MetaOapg.properties.outputs, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[ - schemas.UnsetAnyTypeSchema, schemas.Unset - ]: ... - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "name", - "invocation", - "modelParams", - "inputs", - "outputs", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "invocation", "modelParams", "inputs", "outputs", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - name: typing.Union[ - MetaOapg.properties.name, str, schemas.Unset - ] = schemas.unset, - invocation: typing.Union[ - MetaOapg.properties.invocation, - str, - schemas.Unset, - ] = schemas.unset, - modelParams: typing.Union[ - MetaOapg.properties.modelParams, - dict, - frozendict.frozendict, - schemas.Unset, - ] = schemas.unset, - inputs: typing.Union[ - MetaOapg.properties.inputs, - dict, - frozendict.frozendict, - schemas.Unset, - ] = schemas.unset, - outputs: typing.Union[ - MetaOapg.properties.outputs, - dict, - frozendict.frozendict, - schemas.Unset, - ] = schemas.unset, - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "provider": + *_args: typing.Union[dict, frozendict.frozendict, ], + name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, + invocation: typing.Union[MetaOapg.properties.invocation, str, schemas.Unset] = schemas.unset, + modelParams: typing.Union[MetaOapg.properties.modelParams, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + inputs: typing.Union[MetaOapg.properties.inputs, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + outputs: typing.Union[MetaOapg.properties.outputs, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'provider': return super().__new__( cls, *_args, @@ -372,133 +243,56 @@ class PipelineRunRequest(schemas.DictSchema): "startTime": startTime, "endTime": endTime, } + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["provider"] - ) -> MetaOapg.properties.provider: ... + def __getitem__(self, name: typing_extensions.Literal["provider"]) -> MetaOapg.properties.provider: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["elapsedTime"] - ) -> MetaOapg.properties.elapsedTime: ... + def __getitem__(self, name: typing_extensions.Literal["elapsedTime"]) -> MetaOapg.properties.elapsedTime: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["startTime"] - ) -> MetaOapg.properties.startTime: ... + def __getitem__(self, name: typing_extensions.Literal["startTime"]) -> MetaOapg.properties.startTime: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["endTime"] - ) -> MetaOapg.properties.endTime: ... + def __getitem__(self, name: typing_extensions.Literal["endTime"]) -> MetaOapg.properties.endTime: ... + @typing.overload - def __getitem__( - self, name: str - ) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "provider", - "elapsedTime", - "startTime", - "endTime", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["provider", "elapsedTime", "startTime", "endTime", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["provider"] - ) -> typing.Union[ - MetaOapg.properties.provider, schemas.Unset - ]: ... + def get_item_oapg(self, name: typing_extensions.Literal["provider"]) -> typing.Union[MetaOapg.properties.provider, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["elapsedTime"] - ) -> typing.Union[ - MetaOapg.properties.elapsedTime, schemas.Unset - ]: ... + def get_item_oapg(self, name: typing_extensions.Literal["elapsedTime"]) -> typing.Union[MetaOapg.properties.elapsedTime, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["startTime"] - ) -> typing.Union[ - MetaOapg.properties.startTime, schemas.Unset - ]: ... + def get_item_oapg(self, name: typing_extensions.Literal["startTime"]) -> typing.Union[MetaOapg.properties.startTime, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["endTime"] - ) -> typing.Union[ - MetaOapg.properties.endTime, schemas.Unset - ]: ... + def get_item_oapg(self, name: typing_extensions.Literal["endTime"]) -> typing.Union[MetaOapg.properties.endTime, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[ - schemas.UnsetAnyTypeSchema, schemas.Unset - ]: ... - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "provider", - "elapsedTime", - "startTime", - "endTime", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["provider", "elapsedTime", "startTime", "endTime", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - provider: typing.Union[ - MetaOapg.properties.provider, - dict, - frozendict.frozendict, - schemas.Unset, - ] = schemas.unset, - elapsedTime: typing.Union[ - MetaOapg.properties.elapsedTime, - decimal.Decimal, - int, - schemas.Unset, - ] = schemas.unset, - startTime: typing.Union[ - MetaOapg.properties.startTime, - str, - datetime, - schemas.Unset, - ] = schemas.unset, - endTime: typing.Union[ - MetaOapg.properties.endTime, - str, - datetime, - schemas.Unset, - ] = schemas.unset, - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "items": + *_args: typing.Union[dict, frozendict.frozendict, ], + provider: typing.Union[MetaOapg.properties.provider, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + elapsedTime: typing.Union[MetaOapg.properties.elapsedTime, decimal.Decimal, int, schemas.Unset] = schemas.unset, + startTime: typing.Union[MetaOapg.properties.startTime, str, datetime, schemas.Unset] = schemas.unset, + endTime: typing.Union[MetaOapg.properties.endTime, str, datetime, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'items': return super().__new__( cls, *_args, @@ -509,31 +303,18 @@ class PipelineRunRequest(schemas.DictSchema): _configuration=_configuration, **kwargs, ) + def __new__( cls, - _arg: typing.Union[ - typing.Tuple[ - typing.Union[ - MetaOapg.items, - dict, - frozendict.frozendict, - ] - ], - typing.List[ - typing.Union[ - MetaOapg.items, - dict, - frozendict.frozendict, - ] - ], - ], + _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, ]]], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "stepRuns": + ) -> 'stepRuns': return super().__new__( cls, _arg, _configuration=_configuration, ) + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) __annotations__ = { @@ -541,103 +322,53 @@ class PipelineRunRequest(schemas.DictSchema): "name": name, "stepRuns": stepRuns, } + stepRuns: MetaOapg.properties.stepRuns name: MetaOapg.properties.name id: MetaOapg.properties.id - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["id"] - ) -> MetaOapg.properties.id: ... + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["name"] - ) -> MetaOapg.properties.name: ... + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["stepRuns"] - ) -> MetaOapg.properties.stepRuns: ... + def __getitem__(self, name: typing_extensions.Literal["stepRuns"]) -> MetaOapg.properties.stepRuns: ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "name", - "stepRuns", - ], - str, - ], - ): + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "name", "stepRuns", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["id"] - ) -> MetaOapg.properties.id: ... + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["name"] - ) -> MetaOapg.properties.name: ... + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["stepRuns"] - ) -> MetaOapg.properties.stepRuns: ... + def get_item_oapg(self, name: typing_extensions.Literal["stepRuns"]) -> MetaOapg.properties.stepRuns: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "name", - "stepRuns", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "name", "stepRuns", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - stepRuns: typing.Union[ - MetaOapg.properties.stepRuns, - list, - tuple, - ], - name: typing.Union[ - MetaOapg.properties.name, - str, - ], - id: typing.Union[ - MetaOapg.properties.id, - str, - uuid.UUID, - ], + *_args: typing.Union[dict, frozendict.frozendict, ], + stepRuns: typing.Union[MetaOapg.properties.stepRuns, list, tuple, ], + name: typing.Union[MetaOapg.properties.name, str, ], + id: typing.Union[MetaOapg.properties.id, str, uuid.UUID, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "PipelineRunRequest": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'PipelineRunRequest': return super().__new__( cls, *_args, diff --git a/package/gentrace/model/pipeline_run_response.py b/package/gentrace/model/pipeline_run_response.py index 29823905..c6e44e0f 100644 --- a/package/gentrace/model/pipeline_run_response.py +++ b/package/gentrace/model/pipeline_run_response.py @@ -23,80 +23,52 @@ from gentrace import schemas # noqa: F401 -class PipelineRunResponse(schemas.DictSchema): +class PipelineRunResponse( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ + class MetaOapg: + class properties: pipelineRunId = schemas.UUIDSchema __annotations__ = { "pipelineRunId": pipelineRunId, } - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["pipelineRunId"] - ) -> MetaOapg.properties.pipelineRunId: - ... - + def __getitem__(self, name: typing_extensions.Literal["pipelineRunId"]) -> MetaOapg.properties.pipelineRunId: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, name: typing.Union[typing_extensions.Literal["pipelineRunId",], str] - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["pipelineRunId", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["pipelineRunId"] - ) -> typing.Union[MetaOapg.properties.pipelineRunId, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["pipelineRunId"]) -> typing.Union[MetaOapg.properties.pipelineRunId, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, name: typing.Union[typing_extensions.Literal["pipelineRunId",], str] - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["pipelineRunId", ], str]): return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - pipelineRunId: typing.Union[ - MetaOapg.properties.pipelineRunId, str, uuid.UUID, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + pipelineRunId: typing.Union[MetaOapg.properties.pipelineRunId, str, uuid.UUID, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "PipelineRunResponse": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'PipelineRunResponse': return super().__new__( cls, *_args, diff --git a/package/gentrace/model/pipeline_run_response.pyi b/package/gentrace/model/pipeline_run_response.pyi index 0fdce2fc..18ed787d 100644 --- a/package/gentrace/model/pipeline_run_response.pyi +++ b/package/gentrace/model/pipeline_run_response.pyi @@ -22,69 +22,52 @@ import typing_extensions # noqa: F401 from gentrace import schemas # noqa: F401 -class PipelineRunResponse(schemas.DictSchema): +class PipelineRunResponse( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ + class MetaOapg: + class properties: pipelineRunId = schemas.UUIDSchema __annotations__ = { "pipelineRunId": pipelineRunId, } + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["pipelineRunId"] - ) -> MetaOapg.properties.pipelineRunId: ... + def __getitem__(self, name: typing_extensions.Literal["pipelineRunId"]) -> MetaOapg.properties.pipelineRunId: ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, name: typing.Union[typing_extensions.Literal["pipelineRunId",], str] - ): + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["pipelineRunId", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["pipelineRunId"] - ) -> typing.Union[MetaOapg.properties.pipelineRunId, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["pipelineRunId"]) -> typing.Union[MetaOapg.properties.pipelineRunId, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg( - self, name: typing.Union[typing_extensions.Literal["pipelineRunId",], str] - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["pipelineRunId", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - pipelineRunId: typing.Union[ - MetaOapg.properties.pipelineRunId, str, uuid.UUID, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + pipelineRunId: typing.Union[MetaOapg.properties.pipelineRunId, str, uuid.UUID, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "PipelineRunResponse": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'PipelineRunResponse': return super().__new__( cls, *_args, diff --git a/package/gentrace/model/test_case.py b/package/gentrace/model/test_case.py index 9addb213..69768b5c 100644 --- a/package/gentrace/model/test_case.py +++ b/package/gentrace/model/test_case.py @@ -23,13 +23,16 @@ from gentrace import schemas # noqa: F401 -class TestCase(schemas.DictSchema): +class TestCase( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ + class MetaOapg: required = { "createdAt", @@ -39,7 +42,7 @@ class MetaOapg: "id", "updatedAt", } - + class properties: id = schemas.UUIDSchema createdAt = schemas.DateTimeSchema @@ -47,236 +50,171 @@ class properties: inputs = schemas.DictSchema name = schemas.StrSchema setId = schemas.UUIDSchema - + + class archivedAt( schemas.DateTimeBase, schemas.StrBase, schemas.NoneBase, schemas.Schema, - schemas.NoneStrMixin, + schemas.NoneStrMixin ): + + class MetaOapg: - format = "date-time" - + format = 'date-time' + + def __new__( cls, - *_args: typing.Union[ - None, - str, - datetime, - ], + *_args: typing.Union[None, str, datetime, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "archivedAt": + ) -> 'archivedAt': return super().__new__( cls, *_args, _configuration=_configuration, ) - + + class expected( - schemas.StrBase, schemas.NoneBase, schemas.Schema, schemas.NoneStrMixin + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin ): + + def __new__( cls, - *_args: typing.Union[ - None, - str, - ], + *_args: typing.Union[None, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "expected": + ) -> 'expected': return super().__new__( cls, *_args, _configuration=_configuration, ) - + + class expectedSteps( schemas.ListBase, schemas.NoneBase, schemas.Schema, - schemas.NoneTupleMixin, + schemas.NoneTupleMixin ): + + class MetaOapg: - class items(schemas.DictSchema): + + + class items( + schemas.DictSchema + ): + + class MetaOapg: required = { "output", "key", } - + class properties: - class key(schemas.StrSchema): + + + class key( + schemas.StrSchema + ): + + class MetaOapg: max_length = 100 min_length = 1 - output = schemas.StrSchema - + + class inputs( schemas.DictBase, schemas.NoneBase, schemas.Schema, - schemas.NoneFrozenDictMixin, + schemas.NoneFrozenDictMixin ): + + class MetaOapg: additional_properties = schemas.StrSchema - - def __getitem__( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: # dict_instance[name] accessor return super().__getitem__(name) - - def get_item_oapg( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: return super().get_item_oapg(name) - + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - None, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - MetaOapg.additional_properties, - str, - ], - ) -> "inputs": + *_args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'inputs': return super().__new__( cls, *_args, _configuration=_configuration, **kwargs, ) - __annotations__ = { "key": key, "output": output, "inputs": inputs, } - + output: MetaOapg.properties.output key: MetaOapg.properties.key - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["key"] - ) -> MetaOapg.properties.key: - ... - + def __getitem__(self, name: typing_extensions.Literal["key"]) -> MetaOapg.properties.key: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["output"] - ) -> MetaOapg.properties.output: - ... - + def __getitem__(self, name: typing_extensions.Literal["output"]) -> MetaOapg.properties.output: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["inputs"] - ) -> MetaOapg.properties.inputs: - ... - + def __getitem__(self, name: typing_extensions.Literal["inputs"]) -> MetaOapg.properties.inputs: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "key", - "output", - "inputs", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["key", "output", "inputs", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["key"] - ) -> MetaOapg.properties.key: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["key"]) -> MetaOapg.properties.key: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["output"] - ) -> MetaOapg.properties.output: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["output"]) -> MetaOapg.properties.output: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["inputs"] - ) -> typing.Union[MetaOapg.properties.inputs, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["inputs"]) -> typing.Union[MetaOapg.properties.inputs, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "key", - "output", - "inputs", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["key", "output", "inputs", ], str]): return super().get_item_oapg(name) - + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - output: typing.Union[ - MetaOapg.properties.output, - str, - ], - key: typing.Union[ - MetaOapg.properties.key, - str, - ], - inputs: typing.Union[ - MetaOapg.properties.inputs, - dict, - frozendict.frozendict, - None, - schemas.Unset, - ] = schemas.unset, - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "items": + *_args: typing.Union[dict, frozendict.frozendict, ], + output: typing.Union[MetaOapg.properties.output, str, ], + key: typing.Union[MetaOapg.properties.key, str, ], + inputs: typing.Union[MetaOapg.properties.inputs, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'items': return super().__new__( cls, *_args, @@ -286,24 +224,19 @@ def __new__( _configuration=_configuration, **kwargs, ) - min_items = 1 - + + def __new__( cls, - *_args: typing.Union[ - list, - tuple, - None, - ], + *_args: typing.Union[list, tuple, None, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "expectedSteps": + ) -> 'expectedSteps': return super().__new__( cls, *_args, _configuration=_configuration, ) - __annotations__ = { "id": id, "createdAt": createdAt, @@ -315,233 +248,98 @@ def __new__( "expected": expected, "expectedSteps": expectedSteps, } - + createdAt: MetaOapg.properties.createdAt inputs: MetaOapg.properties.inputs name: MetaOapg.properties.name setId: MetaOapg.properties.setId id: MetaOapg.properties.id updatedAt: MetaOapg.properties.updatedAt - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["id"] - ) -> MetaOapg.properties.id: - ... - + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["createdAt"] - ) -> MetaOapg.properties.createdAt: - ... - + def __getitem__(self, name: typing_extensions.Literal["createdAt"]) -> MetaOapg.properties.createdAt: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["updatedAt"] - ) -> MetaOapg.properties.updatedAt: - ... - + def __getitem__(self, name: typing_extensions.Literal["updatedAt"]) -> MetaOapg.properties.updatedAt: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["inputs"] - ) -> MetaOapg.properties.inputs: - ... - + def __getitem__(self, name: typing_extensions.Literal["inputs"]) -> MetaOapg.properties.inputs: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["name"] - ) -> MetaOapg.properties.name: - ... - + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["setId"] - ) -> MetaOapg.properties.setId: - ... - + def __getitem__(self, name: typing_extensions.Literal["setId"]) -> MetaOapg.properties.setId: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["archivedAt"] - ) -> MetaOapg.properties.archivedAt: - ... - + def __getitem__(self, name: typing_extensions.Literal["archivedAt"]) -> MetaOapg.properties.archivedAt: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["expected"] - ) -> MetaOapg.properties.expected: - ... - + def __getitem__(self, name: typing_extensions.Literal["expected"]) -> MetaOapg.properties.expected: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["expectedSteps"] - ) -> MetaOapg.properties.expectedSteps: - ... - + def __getitem__(self, name: typing_extensions.Literal["expectedSteps"]) -> MetaOapg.properties.expectedSteps: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "createdAt", - "updatedAt", - "inputs", - "name", - "setId", - "archivedAt", - "expected", - "expectedSteps", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "createdAt", "updatedAt", "inputs", "name", "setId", "archivedAt", "expected", "expectedSteps", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["id"] - ) -> MetaOapg.properties.id: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["createdAt"] - ) -> MetaOapg.properties.createdAt: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["createdAt"]) -> MetaOapg.properties.createdAt: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["updatedAt"] - ) -> MetaOapg.properties.updatedAt: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["updatedAt"]) -> MetaOapg.properties.updatedAt: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["inputs"] - ) -> MetaOapg.properties.inputs: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["inputs"]) -> MetaOapg.properties.inputs: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["name"] - ) -> MetaOapg.properties.name: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["setId"] - ) -> MetaOapg.properties.setId: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["setId"]) -> MetaOapg.properties.setId: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["archivedAt"] - ) -> typing.Union[MetaOapg.properties.archivedAt, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["archivedAt"]) -> typing.Union[MetaOapg.properties.archivedAt, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["expected"] - ) -> typing.Union[MetaOapg.properties.expected, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["expected"]) -> typing.Union[MetaOapg.properties.expected, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["expectedSteps"] - ) -> typing.Union[MetaOapg.properties.expectedSteps, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["expectedSteps"]) -> typing.Union[MetaOapg.properties.expectedSteps, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "createdAt", - "updatedAt", - "inputs", - "name", - "setId", - "archivedAt", - "expected", - "expectedSteps", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "createdAt", "updatedAt", "inputs", "name", "setId", "archivedAt", "expected", "expectedSteps", ], str]): return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - createdAt: typing.Union[ - MetaOapg.properties.createdAt, - str, - datetime, - ], - inputs: typing.Union[ - MetaOapg.properties.inputs, - dict, - frozendict.frozendict, - ], - name: typing.Union[ - MetaOapg.properties.name, - str, - ], - setId: typing.Union[ - MetaOapg.properties.setId, - str, - uuid.UUID, - ], - id: typing.Union[ - MetaOapg.properties.id, - str, - uuid.UUID, - ], - updatedAt: typing.Union[ - MetaOapg.properties.updatedAt, - str, - datetime, - ], - archivedAt: typing.Union[ - MetaOapg.properties.archivedAt, None, str, datetime, schemas.Unset - ] = schemas.unset, - expected: typing.Union[ - MetaOapg.properties.expected, None, str, schemas.Unset - ] = schemas.unset, - expectedSteps: typing.Union[ - MetaOapg.properties.expectedSteps, list, tuple, None, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + createdAt: typing.Union[MetaOapg.properties.createdAt, str, datetime, ], + inputs: typing.Union[MetaOapg.properties.inputs, dict, frozendict.frozendict, ], + name: typing.Union[MetaOapg.properties.name, str, ], + setId: typing.Union[MetaOapg.properties.setId, str, uuid.UUID, ], + id: typing.Union[MetaOapg.properties.id, str, uuid.UUID, ], + updatedAt: typing.Union[MetaOapg.properties.updatedAt, str, datetime, ], + archivedAt: typing.Union[MetaOapg.properties.archivedAt, None, str, datetime, schemas.Unset] = schemas.unset, + expected: typing.Union[MetaOapg.properties.expected, None, str, schemas.Unset] = schemas.unset, + expectedSteps: typing.Union[MetaOapg.properties.expectedSteps, list, tuple, None, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "TestCase": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'TestCase': return super().__new__( cls, *_args, diff --git a/package/gentrace/model/test_case.pyi b/package/gentrace/model/test_case.pyi index ff9f9b96..ba649187 100644 --- a/package/gentrace/model/test_case.pyi +++ b/package/gentrace/model/test_case.pyi @@ -22,13 +22,16 @@ import typing_extensions # noqa: F401 from gentrace import schemas # noqa: F401 -class TestCase(schemas.DictSchema): +class TestCase( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ + class MetaOapg: required = { "createdAt", @@ -38,7 +41,7 @@ class TestCase(schemas.DictSchema): "id", "updatedAt", } - + class properties: id = schemas.UUIDSchema createdAt = schemas.DateTimeSchema @@ -46,99 +49,110 @@ class TestCase(schemas.DictSchema): inputs = schemas.DictSchema name = schemas.StrSchema setId = schemas.UUIDSchema - + + class archivedAt( schemas.DateTimeBase, schemas.StrBase, schemas.NoneBase, schemas.Schema, - schemas.NoneStrMixin, + schemas.NoneStrMixin ): + + class MetaOapg: - format = "date-time" + format = 'date-time' + + def __new__( cls, - *_args: typing.Union[ - None, - str, - datetime, - ], + *_args: typing.Union[None, str, datetime, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "archivedAt": + ) -> 'archivedAt': return super().__new__( cls, *_args, _configuration=_configuration, ) - + + class expected( - schemas.StrBase, schemas.NoneBase, schemas.Schema, schemas.NoneStrMixin + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin ): + + def __new__( cls, - *_args: typing.Union[ - None, - str, - ], + *_args: typing.Union[None, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "expected": + ) -> 'expected': return super().__new__( cls, *_args, _configuration=_configuration, ) - + + class expectedSteps( schemas.ListBase, schemas.NoneBase, schemas.Schema, - schemas.NoneTupleMixin, + schemas.NoneTupleMixin ): + + class MetaOapg: - class items(schemas.DictSchema): + + + class items( + schemas.DictSchema + ): + + class MetaOapg: required = { "output", "key", } - + class properties: - class key(schemas.StrSchema): + + + class key( + schemas.StrSchema + ): pass output = schemas.StrSchema - + + class inputs( schemas.DictBase, schemas.NoneBase, schemas.Schema, - schemas.NoneFrozenDictMixin, + schemas.NoneFrozenDictMixin ): + + class MetaOapg: additional_properties = schemas.StrSchema - def __getitem__( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: # dict_instance[name] accessor return super().__getitem__(name) - def get_item_oapg( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - None, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - MetaOapg.additional_properties, - str, - ], - ) -> "inputs": + *_args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'inputs': return super().__new__( cls, *_args, @@ -150,111 +164,52 @@ class TestCase(schemas.DictSchema): "output": output, "inputs": inputs, } + output: MetaOapg.properties.output key: MetaOapg.properties.key - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["key"] - ) -> MetaOapg.properties.key: ... + def __getitem__(self, name: typing_extensions.Literal["key"]) -> MetaOapg.properties.key: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["output"] - ) -> MetaOapg.properties.output: ... + def __getitem__(self, name: typing_extensions.Literal["output"]) -> MetaOapg.properties.output: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["inputs"] - ) -> MetaOapg.properties.inputs: ... + def __getitem__(self, name: typing_extensions.Literal["inputs"]) -> MetaOapg.properties.inputs: ... + @typing.overload - def __getitem__( - self, name: str - ) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "key", - "output", - "inputs", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["key", "output", "inputs", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["key"] - ) -> MetaOapg.properties.key: ... + def get_item_oapg(self, name: typing_extensions.Literal["key"]) -> MetaOapg.properties.key: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["output"] - ) -> MetaOapg.properties.output: ... + def get_item_oapg(self, name: typing_extensions.Literal["output"]) -> MetaOapg.properties.output: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["inputs"] - ) -> typing.Union[ - MetaOapg.properties.inputs, schemas.Unset - ]: ... + def get_item_oapg(self, name: typing_extensions.Literal["inputs"]) -> typing.Union[MetaOapg.properties.inputs, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[ - schemas.UnsetAnyTypeSchema, schemas.Unset - ]: ... - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "key", - "output", - "inputs", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["key", "output", "inputs", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - output: typing.Union[ - MetaOapg.properties.output, - str, - ], - key: typing.Union[ - MetaOapg.properties.key, - str, - ], - inputs: typing.Union[ - MetaOapg.properties.inputs, - dict, - frozendict.frozendict, - None, - schemas.Unset, - ] = schemas.unset, - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "items": + *_args: typing.Union[dict, frozendict.frozendict, ], + output: typing.Union[MetaOapg.properties.output, str, ], + key: typing.Union[MetaOapg.properties.key, str, ], + inputs: typing.Union[MetaOapg.properties.inputs, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'items': return super().__new__( cls, *_args, @@ -264,15 +219,13 @@ class TestCase(schemas.DictSchema): _configuration=_configuration, **kwargs, ) + + def __new__( cls, - *_args: typing.Union[ - list, - tuple, - None, - ], + *_args: typing.Union[list, tuple, None, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "expectedSteps": + ) -> 'expectedSteps': return super().__new__( cls, *_args, @@ -289,190 +242,98 @@ class TestCase(schemas.DictSchema): "expected": expected, "expectedSteps": expectedSteps, } + createdAt: MetaOapg.properties.createdAt inputs: MetaOapg.properties.inputs name: MetaOapg.properties.name setId: MetaOapg.properties.setId id: MetaOapg.properties.id updatedAt: MetaOapg.properties.updatedAt - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["id"] - ) -> MetaOapg.properties.id: ... + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["createdAt"] - ) -> MetaOapg.properties.createdAt: ... + def __getitem__(self, name: typing_extensions.Literal["createdAt"]) -> MetaOapg.properties.createdAt: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["updatedAt"] - ) -> MetaOapg.properties.updatedAt: ... + def __getitem__(self, name: typing_extensions.Literal["updatedAt"]) -> MetaOapg.properties.updatedAt: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["inputs"] - ) -> MetaOapg.properties.inputs: ... + def __getitem__(self, name: typing_extensions.Literal["inputs"]) -> MetaOapg.properties.inputs: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["name"] - ) -> MetaOapg.properties.name: ... + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["setId"] - ) -> MetaOapg.properties.setId: ... + def __getitem__(self, name: typing_extensions.Literal["setId"]) -> MetaOapg.properties.setId: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["archivedAt"] - ) -> MetaOapg.properties.archivedAt: ... + def __getitem__(self, name: typing_extensions.Literal["archivedAt"]) -> MetaOapg.properties.archivedAt: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["expected"] - ) -> MetaOapg.properties.expected: ... + def __getitem__(self, name: typing_extensions.Literal["expected"]) -> MetaOapg.properties.expected: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["expectedSteps"] - ) -> MetaOapg.properties.expectedSteps: ... + def __getitem__(self, name: typing_extensions.Literal["expectedSteps"]) -> MetaOapg.properties.expectedSteps: ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "createdAt", - "updatedAt", - "inputs", - "name", - "setId", - "archivedAt", - "expected", - "expectedSteps", - ], - str, - ], - ): + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "createdAt", "updatedAt", "inputs", "name", "setId", "archivedAt", "expected", "expectedSteps", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["id"] - ) -> MetaOapg.properties.id: ... + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["createdAt"] - ) -> MetaOapg.properties.createdAt: ... + def get_item_oapg(self, name: typing_extensions.Literal["createdAt"]) -> MetaOapg.properties.createdAt: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["updatedAt"] - ) -> MetaOapg.properties.updatedAt: ... + def get_item_oapg(self, name: typing_extensions.Literal["updatedAt"]) -> MetaOapg.properties.updatedAt: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["inputs"] - ) -> MetaOapg.properties.inputs: ... + def get_item_oapg(self, name: typing_extensions.Literal["inputs"]) -> MetaOapg.properties.inputs: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["name"] - ) -> MetaOapg.properties.name: ... + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["setId"] - ) -> MetaOapg.properties.setId: ... + def get_item_oapg(self, name: typing_extensions.Literal["setId"]) -> MetaOapg.properties.setId: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["archivedAt"] - ) -> typing.Union[MetaOapg.properties.archivedAt, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["archivedAt"]) -> typing.Union[MetaOapg.properties.archivedAt, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["expected"] - ) -> typing.Union[MetaOapg.properties.expected, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["expected"]) -> typing.Union[MetaOapg.properties.expected, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["expectedSteps"] - ) -> typing.Union[MetaOapg.properties.expectedSteps, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["expectedSteps"]) -> typing.Union[MetaOapg.properties.expectedSteps, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "createdAt", - "updatedAt", - "inputs", - "name", - "setId", - "archivedAt", - "expected", - "expectedSteps", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "createdAt", "updatedAt", "inputs", "name", "setId", "archivedAt", "expected", "expectedSteps", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - createdAt: typing.Union[ - MetaOapg.properties.createdAt, - str, - datetime, - ], - inputs: typing.Union[ - MetaOapg.properties.inputs, - dict, - frozendict.frozendict, - ], - name: typing.Union[ - MetaOapg.properties.name, - str, - ], - setId: typing.Union[ - MetaOapg.properties.setId, - str, - uuid.UUID, - ], - id: typing.Union[ - MetaOapg.properties.id, - str, - uuid.UUID, - ], - updatedAt: typing.Union[ - MetaOapg.properties.updatedAt, - str, - datetime, - ], - archivedAt: typing.Union[ - MetaOapg.properties.archivedAt, None, str, datetime, schemas.Unset - ] = schemas.unset, - expected: typing.Union[ - MetaOapg.properties.expected, None, str, schemas.Unset - ] = schemas.unset, - expectedSteps: typing.Union[ - MetaOapg.properties.expectedSteps, list, tuple, None, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + createdAt: typing.Union[MetaOapg.properties.createdAt, str, datetime, ], + inputs: typing.Union[MetaOapg.properties.inputs, dict, frozendict.frozendict, ], + name: typing.Union[MetaOapg.properties.name, str, ], + setId: typing.Union[MetaOapg.properties.setId, str, uuid.UUID, ], + id: typing.Union[MetaOapg.properties.id, str, uuid.UUID, ], + updatedAt: typing.Union[MetaOapg.properties.updatedAt, str, datetime, ], + archivedAt: typing.Union[MetaOapg.properties.archivedAt, None, str, datetime, schemas.Unset] = schemas.unset, + expected: typing.Union[MetaOapg.properties.expected, None, str, schemas.Unset] = schemas.unset, + expectedSteps: typing.Union[MetaOapg.properties.expectedSteps, list, tuple, None, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "TestCase": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'TestCase': return super().__new__( cls, *_args, diff --git a/package/gentrace/model/test_run.py b/package/gentrace/model/test_run.py index e91ca3aa..37b2d8ae 100644 --- a/package/gentrace/model/test_run.py +++ b/package/gentrace/model/test_run.py @@ -23,14 +23,18 @@ from gentrace import schemas # noqa: F401 -class TestRun(schemas.DictSchema): +class TestRun( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ + class MetaOapg: + class properties: id = schemas.UUIDSchema createdAt = schemas.DateTimeSchema @@ -48,181 +52,77 @@ class properties: "commit": commit, "name": name, } - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["id"] - ) -> MetaOapg.properties.id: - ... - + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["createdAt"] - ) -> MetaOapg.properties.createdAt: - ... - + def __getitem__(self, name: typing_extensions.Literal["createdAt"]) -> MetaOapg.properties.createdAt: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["updatedAt"] - ) -> MetaOapg.properties.updatedAt: - ... - + def __getitem__(self, name: typing_extensions.Literal["updatedAt"]) -> MetaOapg.properties.updatedAt: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["setId"] - ) -> MetaOapg.properties.setId: - ... - + def __getitem__(self, name: typing_extensions.Literal["setId"]) -> MetaOapg.properties.setId: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["branch"] - ) -> MetaOapg.properties.branch: - ... - + def __getitem__(self, name: typing_extensions.Literal["branch"]) -> MetaOapg.properties.branch: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["commit"] - ) -> MetaOapg.properties.commit: - ... - + def __getitem__(self, name: typing_extensions.Literal["commit"]) -> MetaOapg.properties.commit: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["name"] - ) -> MetaOapg.properties.name: - ... - + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "createdAt", - "updatedAt", - "setId", - "branch", - "commit", - "name", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "createdAt", "updatedAt", "setId", "branch", "commit", "name", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["id"] - ) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["createdAt"] - ) -> typing.Union[MetaOapg.properties.createdAt, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["createdAt"]) -> typing.Union[MetaOapg.properties.createdAt, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["updatedAt"] - ) -> typing.Union[MetaOapg.properties.updatedAt, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["updatedAt"]) -> typing.Union[MetaOapg.properties.updatedAt, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["setId"] - ) -> typing.Union[MetaOapg.properties.setId, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["setId"]) -> typing.Union[MetaOapg.properties.setId, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["branch"] - ) -> typing.Union[MetaOapg.properties.branch, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["branch"]) -> typing.Union[MetaOapg.properties.branch, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["commit"] - ) -> typing.Union[MetaOapg.properties.commit, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["commit"]) -> typing.Union[MetaOapg.properties.commit, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["name"] - ) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "createdAt", - "updatedAt", - "setId", - "branch", - "commit", - "name", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "createdAt", "updatedAt", "setId", "branch", "commit", "name", ], str]): return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - id: typing.Union[ - MetaOapg.properties.id, str, uuid.UUID, schemas.Unset - ] = schemas.unset, - createdAt: typing.Union[ - MetaOapg.properties.createdAt, str, datetime, schemas.Unset - ] = schemas.unset, - updatedAt: typing.Union[ - MetaOapg.properties.updatedAt, str, datetime, schemas.Unset - ] = schemas.unset, - setId: typing.Union[ - MetaOapg.properties.setId, str, uuid.UUID, schemas.Unset - ] = schemas.unset, - branch: typing.Union[ - MetaOapg.properties.branch, str, schemas.Unset - ] = schemas.unset, - commit: typing.Union[ - MetaOapg.properties.commit, str, schemas.Unset - ] = schemas.unset, - name: typing.Union[ - MetaOapg.properties.name, str, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + id: typing.Union[MetaOapg.properties.id, str, uuid.UUID, schemas.Unset] = schemas.unset, + createdAt: typing.Union[MetaOapg.properties.createdAt, str, datetime, schemas.Unset] = schemas.unset, + updatedAt: typing.Union[MetaOapg.properties.updatedAt, str, datetime, schemas.Unset] = schemas.unset, + setId: typing.Union[MetaOapg.properties.setId, str, uuid.UUID, schemas.Unset] = schemas.unset, + branch: typing.Union[MetaOapg.properties.branch, str, schemas.Unset] = schemas.unset, + commit: typing.Union[MetaOapg.properties.commit, str, schemas.Unset] = schemas.unset, + name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "TestRun": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'TestRun': return super().__new__( cls, *_args, diff --git a/package/gentrace/model/test_run.pyi b/package/gentrace/model/test_run.pyi index d0192c28..70e30da3 100644 --- a/package/gentrace/model/test_run.pyi +++ b/package/gentrace/model/test_run.pyi @@ -22,14 +22,18 @@ import typing_extensions # noqa: F401 from gentrace import schemas # noqa: F401 -class TestRun(schemas.DictSchema): +class TestRun( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ + class MetaOapg: + class properties: id = schemas.UUIDSchema createdAt = schemas.DateTimeSchema @@ -47,146 +51,77 @@ class TestRun(schemas.DictSchema): "commit": commit, "name": name, } + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["id"] - ) -> MetaOapg.properties.id: ... + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["createdAt"] - ) -> MetaOapg.properties.createdAt: ... + def __getitem__(self, name: typing_extensions.Literal["createdAt"]) -> MetaOapg.properties.createdAt: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["updatedAt"] - ) -> MetaOapg.properties.updatedAt: ... + def __getitem__(self, name: typing_extensions.Literal["updatedAt"]) -> MetaOapg.properties.updatedAt: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["setId"] - ) -> MetaOapg.properties.setId: ... + def __getitem__(self, name: typing_extensions.Literal["setId"]) -> MetaOapg.properties.setId: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["branch"] - ) -> MetaOapg.properties.branch: ... + def __getitem__(self, name: typing_extensions.Literal["branch"]) -> MetaOapg.properties.branch: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["commit"] - ) -> MetaOapg.properties.commit: ... + def __getitem__(self, name: typing_extensions.Literal["commit"]) -> MetaOapg.properties.commit: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["name"] - ) -> MetaOapg.properties.name: ... + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "createdAt", - "updatedAt", - "setId", - "branch", - "commit", - "name", - ], - str, - ], - ): + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "createdAt", "updatedAt", "setId", "branch", "commit", "name", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["createdAt"]) -> typing.Union[MetaOapg.properties.createdAt, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["updatedAt"]) -> typing.Union[MetaOapg.properties.updatedAt, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["setId"]) -> typing.Union[MetaOapg.properties.setId, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["id"] - ) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["createdAt"] - ) -> typing.Union[MetaOapg.properties.createdAt, schemas.Unset]: ... - @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["updatedAt"] - ) -> typing.Union[MetaOapg.properties.updatedAt, schemas.Unset]: ... - @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["setId"] - ) -> typing.Union[MetaOapg.properties.setId, schemas.Unset]: ... - @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["branch"] - ) -> typing.Union[MetaOapg.properties.branch, schemas.Unset]: ... - @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["commit"] - ) -> typing.Union[MetaOapg.properties.commit, schemas.Unset]: ... - @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["name"] - ) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "createdAt", - "updatedAt", - "setId", - "branch", - "commit", - "name", - ], - str, - ], - ): + def get_item_oapg(self, name: typing_extensions.Literal["branch"]) -> typing.Union[MetaOapg.properties.branch, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["commit"]) -> typing.Union[MetaOapg.properties.commit, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "createdAt", "updatedAt", "setId", "branch", "commit", "name", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - id: typing.Union[ - MetaOapg.properties.id, str, uuid.UUID, schemas.Unset - ] = schemas.unset, - createdAt: typing.Union[ - MetaOapg.properties.createdAt, str, datetime, schemas.Unset - ] = schemas.unset, - updatedAt: typing.Union[ - MetaOapg.properties.updatedAt, str, datetime, schemas.Unset - ] = schemas.unset, - setId: typing.Union[ - MetaOapg.properties.setId, str, uuid.UUID, schemas.Unset - ] = schemas.unset, - branch: typing.Union[ - MetaOapg.properties.branch, str, schemas.Unset - ] = schemas.unset, - commit: typing.Union[ - MetaOapg.properties.commit, str, schemas.Unset - ] = schemas.unset, - name: typing.Union[ - MetaOapg.properties.name, str, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + id: typing.Union[MetaOapg.properties.id, str, uuid.UUID, schemas.Unset] = schemas.unset, + createdAt: typing.Union[MetaOapg.properties.createdAt, str, datetime, schemas.Unset] = schemas.unset, + updatedAt: typing.Union[MetaOapg.properties.updatedAt, str, datetime, schemas.Unset] = schemas.unset, + setId: typing.Union[MetaOapg.properties.setId, str, uuid.UUID, schemas.Unset] = schemas.unset, + branch: typing.Union[MetaOapg.properties.branch, str, schemas.Unset] = schemas.unset, + commit: typing.Union[MetaOapg.properties.commit, str, schemas.Unset] = schemas.unset, + name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "TestRun": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'TestRun': return super().__new__( cls, *_args, diff --git a/package/gentrace/paths/pipeline_run/__init__.py b/package/gentrace/paths/pipeline_run/__init__.py index 9aeef870..12714336 100644 --- a/package/gentrace/paths/pipeline_run/__init__.py +++ b/package/gentrace/paths/pipeline_run/__init__.py @@ -4,4 +4,4 @@ from gentrace.paths import PathValues -path = PathValues.PIPELINERUN +path = PathValues.PIPELINERUN \ No newline at end of file diff --git a/package/gentrace/paths/pipeline_run/post.py b/package/gentrace/paths/pipeline_run/post.py index daa85a68..b48357a3 100644 --- a/package/gentrace/paths/pipeline_run/post.py +++ b/package/gentrace/paths/pipeline_run/post.py @@ -36,14 +36,13 @@ request_body_pipeline_run_request = api_client.RequestBody( content={ - "application/json": api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson - ), + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), }, required=True, ) _auth = [ - "bearerAuth", + 'bearerAuth', ] SchemaFor200ResponseBodyApplicationJsonCharsetutf8 = PipelineRunResponse SchemaFor200ResponseBodyApplicationJson = PipelineRunResponse @@ -62,12 +61,10 @@ class ApiResponseFor200(api_client.ApiResponse): _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, content={ - "application/json; charset=utf-8": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8 - ), - "application/json": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson - ), + 'application/json; charset=utf-8': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), }, ) @@ -95,13 +92,13 @@ class ApiResponseFor500(api_client.ApiResponse): response_cls=ApiResponseFor500, ) _status_code_to_response = { - "200": _response_for_200, - "400": _response_for_400, - "500": _response_for_500, + '200': _response_for_200, + '400': _response_for_400, + '500': _response_for_500, } _all_accept_content_types = ( - "application/json; charset=utf-8", - "application/json", + 'application/json; charset=utf-8', + 'application/json', ) @@ -115,8 +112,9 @@ def _pipeline_run_post_oapg( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... @typing.overload def _pipeline_run_post_oapg( @@ -127,8 +125,10 @@ def _pipeline_run_post_oapg( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def _pipeline_run_post_oapg( @@ -139,8 +139,7 @@ def _pipeline_run_post_oapg( accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: - ... + ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload def _pipeline_run_post_oapg( @@ -151,13 +150,15 @@ def _pipeline_run_post_oapg( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., - ) -> typing.Union[ApiResponseFor200, api_client.ApiResponseWithoutDeserialization,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... def _pipeline_run_post_oapg( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = "application/json", + content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -175,25 +176,22 @@ class instances # TODO add cookie handling if accept_content_types: for accept_content_type in accept_content_types: - _headers.add("Accept", accept_content_type) + _headers.add('Accept', accept_content_type) if body is schemas.unset: raise exceptions.ApiValueError( - "The required body parameter has an invalid value of: unset. Set a valid value instead" - ) + 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body_pipeline_run_request.serialize( - body, content_type - ) - _headers.add("Content-Type", content_type) - if "fields" in serialized_data: - _fields = serialized_data["fields"] - elif "body" in serialized_data: - _body = serialized_data["body"] + serialized_data = request_body_pipeline_run_request.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] response = self.api_client.call_api( resource_path=used_path, - method="post".upper(), + method='post'.upper(), headers=_headers, fields=_fields, body=_body, @@ -203,25 +201,19 @@ class instances ) if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: response_for_status = _status_code_to_response.get(str(response.status)) if response_for_status: - api_response = response_for_status.deserialize( - response, self.api_client.configuration - ) + api_response = response_for_status.deserialize(response, self.api_client.configuration) else: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: raise exceptions.ApiException( status=response.status, reason=response.reason, - api_response=api_response, + api_response=api_response ) return api_response @@ -239,8 +231,9 @@ def pipeline_run_post( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... @typing.overload def pipeline_run_post( @@ -251,8 +244,10 @@ def pipeline_run_post( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def pipeline_run_post( @@ -263,8 +258,7 @@ def pipeline_run_post( accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: - ... + ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload def pipeline_run_post( @@ -275,13 +269,15 @@ def pipeline_run_post( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., - ) -> typing.Union[ApiResponseFor200, api_client.ApiResponseWithoutDeserialization,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... def pipeline_run_post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = "application/json", + content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -293,7 +289,7 @@ def pipeline_run_post( accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) @@ -309,8 +305,9 @@ def post( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... @typing.overload def post( @@ -321,8 +318,10 @@ def post( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def post( @@ -333,8 +332,7 @@ def post( accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: - ... + ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload def post( @@ -345,13 +343,15 @@ def post( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., - ) -> typing.Union[ApiResponseFor200, api_client.ApiResponseWithoutDeserialization,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... def post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = "application/json", + content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -363,5 +363,7 @@ def post( accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) + + diff --git a/package/gentrace/paths/pipeline_run/post.pyi b/package/gentrace/paths/pipeline_run/post.pyi index 37fea801..aa930170 100644 --- a/package/gentrace/paths/pipeline_run/post.pyi +++ b/package/gentrace/paths/pipeline_run/post.pyi @@ -31,17 +31,18 @@ from gentrace.model.pipeline_run_response import PipelineRunResponse # body param SchemaForRequestBodyApplicationJson = PipelineRunRequest + request_body_pipeline_run_request = api_client.RequestBody( content={ - "application/json": api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson - ), + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), }, required=True, ) SchemaFor200ResponseBodyApplicationJsonCharsetutf8 = PipelineRunResponse SchemaFor200ResponseBodyApplicationJson = PipelineRunResponse + @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse @@ -51,42 +52,46 @@ class ApiResponseFor200(api_client.ApiResponse): ] headers: schemas.Unset = schemas.unset + _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, content={ - "application/json; charset=utf-8": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8 - ), - "application/json": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson - ), + 'application/json; charset=utf-8': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), }, ) + @dataclass class ApiResponseFor400(api_client.ApiResponse): response: urllib3.HTTPResponse body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset + _response_for_400 = api_client.OpenApiResponse( response_cls=ApiResponseFor400, ) + @dataclass class ApiResponseFor500(api_client.ApiResponse): response: urllib3.HTTPResponse body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset + _response_for_500 = api_client.OpenApiResponse( response_cls=ApiResponseFor500, ) _all_accept_content_types = ( - "application/json; charset=utf-8", - "application/json", + 'application/json; charset=utf-8', + 'application/json', ) + class BaseApi(api_client.Api): @typing.overload def _pipeline_run_post_oapg( @@ -97,7 +102,10 @@ class BaseApi(api_client.Api): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def _pipeline_run_post_oapg( self, @@ -107,7 +115,11 @@ class BaseApi(api_client.Api): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload def _pipeline_run_post_oapg( self, @@ -118,6 +130,7 @@ class BaseApi(api_client.Api): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload def _pipeline_run_post_oapg( self, @@ -131,10 +144,11 @@ class BaseApi(api_client.Api): ApiResponseFor200, api_client.ApiResponseWithoutDeserialization, ]: ... + def _pipeline_run_post_oapg( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = "application/json", + content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -152,25 +166,22 @@ class BaseApi(api_client.Api): # TODO add cookie handling if accept_content_types: for accept_content_type in accept_content_types: - _headers.add("Accept", accept_content_type) + _headers.add('Accept', accept_content_type) if body is schemas.unset: raise exceptions.ApiValueError( - "The required body parameter has an invalid value of: unset. Set a valid value instead" - ) + 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body_pipeline_run_request.serialize( - body, content_type - ) - _headers.add("Content-Type", content_type) - if "fields" in serialized_data: - _fields = serialized_data["fields"] - elif "body" in serialized_data: - _body = serialized_data["body"] + serialized_data = request_body_pipeline_run_request.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] response = self.api_client.call_api( resource_path=used_path, - method="post".upper(), + method='post'.upper(), headers=_headers, fields=_fields, body=_body, @@ -180,29 +191,24 @@ class BaseApi(api_client.Api): ) if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: response_for_status = _status_code_to_response.get(str(response.status)) if response_for_status: - api_response = response_for_status.deserialize( - response, self.api_client.configuration - ) + api_response = response_for_status.deserialize(response, self.api_client.configuration) else: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: raise exceptions.ApiException( status=response.status, reason=response.reason, - api_response=api_response, + api_response=api_response ) return api_response + class PipelineRunPost(BaseApi): # this class is used by api classes that refer to endpoints with operationId fn names @@ -215,7 +221,10 @@ class PipelineRunPost(BaseApi): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def pipeline_run_post( self, @@ -225,7 +234,11 @@ class PipelineRunPost(BaseApi): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload def pipeline_run_post( self, @@ -236,6 +249,7 @@ class PipelineRunPost(BaseApi): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload def pipeline_run_post( self, @@ -249,10 +263,11 @@ class PipelineRunPost(BaseApi): ApiResponseFor200, api_client.ApiResponseWithoutDeserialization, ]: ... + def pipeline_run_post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = "application/json", + content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -264,9 +279,10 @@ class PipelineRunPost(BaseApi): accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) + class ApiForpost(BaseApi): # this class is used by api classes that refer to endpoints by path and http method names @@ -279,7 +295,10 @@ class ApiForpost(BaseApi): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def post( self, @@ -289,7 +308,11 @@ class ApiForpost(BaseApi): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload def post( self, @@ -300,6 +323,7 @@ class ApiForpost(BaseApi): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload def post( self, @@ -313,10 +337,11 @@ class ApiForpost(BaseApi): ApiResponseFor200, api_client.ApiResponseWithoutDeserialization, ]: ... + def post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = "application/json", + content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -328,5 +353,7 @@ class ApiForpost(BaseApi): accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) + + diff --git a/package/gentrace/paths/test_case/__init__.py b/package/gentrace/paths/test_case/__init__.py index cc7cade4..9a921a8f 100644 --- a/package/gentrace/paths/test_case/__init__.py +++ b/package/gentrace/paths/test_case/__init__.py @@ -4,4 +4,4 @@ from gentrace.paths import PathValues -path = PathValues.TESTCASE +path = PathValues.TESTCASE \ No newline at end of file diff --git a/package/gentrace/paths/test_case/get.py b/package/gentrace/paths/test_case/get.py index f73072d3..1e363c8d 100644 --- a/package/gentrace/paths/test_case/get.py +++ b/package/gentrace/paths/test_case/get.py @@ -32,17 +32,16 @@ # Query params SetIdSchema = schemas.UUIDSchema RequestRequiredQueryParams = typing_extensions.TypedDict( - "RequestRequiredQueryParams", + 'RequestRequiredQueryParams', { - "setId": typing.Union[ - SetIdSchema, - str, - uuid.UUID, - ], - }, + 'setId': typing.Union[SetIdSchema, str, uuid.UUID, ], + } ) RequestOptionalQueryParams = typing_extensions.TypedDict( - "RequestOptionalQueryParams", {}, total=False + 'RequestOptionalQueryParams', + { + }, + total=False ) @@ -58,99 +57,76 @@ class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams) explode=True, ) _auth = [ - "bearerAuth", + 'bearerAuth', ] -class SchemaFor200ResponseBodyApplicationJson(schemas.DictSchema): +class SchemaFor200ResponseBodyApplicationJson( + schemas.DictSchema +): + + class MetaOapg: + class properties: - class testCases(schemas.ListSchema): + + + class testCases( + schemas.ListSchema + ): + + class MetaOapg: + @staticmethod - def items() -> typing.Type["TestCase"]: + def items() -> typing.Type['TestCase']: return TestCase - + def __new__( cls, - _arg: typing.Union[ - typing.Tuple["TestCase"], typing.List["TestCase"] - ], + _arg: typing.Union[typing.Tuple['TestCase'], typing.List['TestCase']], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "testCases": + ) -> 'testCases': return super().__new__( cls, _arg, _configuration=_configuration, ) - - def __getitem__(self, i: int) -> "TestCase": + + def __getitem__(self, i: int) -> 'TestCase': return super().__getitem__(i) - __annotations__ = { "testCases": testCases, } - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["testCases"] - ) -> MetaOapg.properties.testCases: - ... - + def __getitem__(self, name: typing_extensions.Literal["testCases"]) -> MetaOapg.properties.testCases: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, name: typing.Union[typing_extensions.Literal["testCases",], str] - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["testCases", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["testCases"] - ) -> typing.Union[MetaOapg.properties.testCases, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["testCases"]) -> typing.Union[MetaOapg.properties.testCases, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, name: typing.Union[typing_extensions.Literal["testCases",], str] - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["testCases", ], str]): return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - testCases: typing.Union[ - MetaOapg.properties.testCases, list, tuple, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + testCases: typing.Union[MetaOapg.properties.testCases, list, tuple, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "SchemaFor200ResponseBodyApplicationJson": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( cls, *_args, @@ -160,95 +136,72 @@ def __new__( ) -class SchemaFor200ResponseBodyApplicationJsonCharsetutf8(schemas.DictSchema): +class SchemaFor200ResponseBodyApplicationJsonCharsetutf8( + schemas.DictSchema +): + + class MetaOapg: + class properties: - class testCases(schemas.ListSchema): + + + class testCases( + schemas.ListSchema + ): + + class MetaOapg: + @staticmethod - def items() -> typing.Type["TestCase"]: + def items() -> typing.Type['TestCase']: return TestCase - + def __new__( cls, - _arg: typing.Union[ - typing.Tuple["TestCase"], typing.List["TestCase"] - ], + _arg: typing.Union[typing.Tuple['TestCase'], typing.List['TestCase']], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "testCases": + ) -> 'testCases': return super().__new__( cls, _arg, _configuration=_configuration, ) - - def __getitem__(self, i: int) -> "TestCase": + + def __getitem__(self, i: int) -> 'TestCase': return super().__getitem__(i) - __annotations__ = { "testCases": testCases, } - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["testCases"] - ) -> MetaOapg.properties.testCases: - ... - + def __getitem__(self, name: typing_extensions.Literal["testCases"]) -> MetaOapg.properties.testCases: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, name: typing.Union[typing_extensions.Literal["testCases",], str] - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["testCases", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["testCases"] - ) -> typing.Union[MetaOapg.properties.testCases, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["testCases"]) -> typing.Union[MetaOapg.properties.testCases, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, name: typing.Union[typing_extensions.Literal["testCases",], str] - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["testCases", ], str]): return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - testCases: typing.Union[ - MetaOapg.properties.testCases, list, tuple, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + testCases: typing.Union[MetaOapg.properties.testCases, list, tuple, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "SchemaFor200ResponseBodyApplicationJsonCharsetutf8": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SchemaFor200ResponseBodyApplicationJsonCharsetutf8': return super().__new__( cls, *_args, @@ -271,12 +224,10 @@ class ApiResponseFor200(api_client.ApiResponse): _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, content={ - "application/json": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson - ), - "application/json; charset=utf-8": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8 - ), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + 'application/json; charset=utf-8': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8), }, ) @@ -304,13 +255,13 @@ class ApiResponseFor500(api_client.ApiResponse): response_cls=ApiResponseFor500, ) _status_code_to_response = { - "200": _response_for_200, - "400": _response_for_400, - "500": _response_for_500, + '200': _response_for_200, + '400': _response_for_400, + '500': _response_for_500, } _all_accept_content_types = ( - "application/json", - "application/json; charset=utf-8", + 'application/json', + 'application/json; charset=utf-8', ) @@ -323,8 +274,9 @@ def _test_case_get_oapg( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... @typing.overload def _test_case_get_oapg( @@ -334,8 +286,7 @@ def _test_case_get_oapg( accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: - ... + ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload def _test_case_get_oapg( @@ -345,8 +296,10 @@ def _test_case_get_oapg( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., - ) -> typing.Union[ApiResponseFor200, api_client.ApiResponseWithoutDeserialization,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... def _test_case_get_oapg( self, @@ -366,15 +319,15 @@ class instances used_path = path.value prefix_separator_iterator = None - for parameter in (request_query_set_id,): + for parameter in ( + request_query_set_id, + ): parameter_data = query_params.get(parameter.name, schemas.unset) if parameter_data is schemas.unset: continue if prefix_separator_iterator is None: prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize( - parameter_data, prefix_separator_iterator - ) + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) for serialized_value in serialized_data.values(): used_path += serialized_value @@ -382,11 +335,11 @@ class instances # TODO add cookie handling if accept_content_types: for accept_content_type in accept_content_types: - _headers.add("Accept", accept_content_type) + _headers.add('Accept', accept_content_type) response = self.api_client.call_api( resource_path=used_path, - method="get".upper(), + method='get'.upper(), headers=_headers, auth_settings=_auth, stream=stream, @@ -394,25 +347,19 @@ class instances ) if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: response_for_status = _status_code_to_response.get(str(response.status)) if response_for_status: - api_response = response_for_status.deserialize( - response, self.api_client.configuration - ) + api_response = response_for_status.deserialize(response, self.api_client.configuration) else: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: raise exceptions.ApiException( status=response.status, reason=response.reason, - api_response=api_response, + api_response=api_response ) return api_response @@ -429,8 +376,9 @@ def test_case_get( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... @typing.overload def test_case_get( @@ -440,8 +388,7 @@ def test_case_get( accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: - ... + ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload def test_case_get( @@ -451,8 +398,10 @@ def test_case_get( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., - ) -> typing.Union[ApiResponseFor200, api_client.ApiResponseWithoutDeserialization,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... def test_case_get( self, @@ -467,7 +416,7 @@ def test_case_get( accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) @@ -482,8 +431,9 @@ def get( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... @typing.overload def get( @@ -493,8 +443,7 @@ def get( accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: - ... + ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload def get( @@ -504,8 +453,10 @@ def get( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., - ) -> typing.Union[ApiResponseFor200, api_client.ApiResponseWithoutDeserialization,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... def get( self, @@ -520,5 +471,7 @@ def get( accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) + + diff --git a/package/gentrace/paths/test_case/get.pyi b/package/gentrace/paths/test_case/get.pyi index 210af5cc..0624de7e 100644 --- a/package/gentrace/paths/test_case/get.pyi +++ b/package/gentrace/paths/test_case/get.pyi @@ -30,22 +30,23 @@ from gentrace.model.test_case import TestCase # Query params SetIdSchema = schemas.UUIDSchema RequestRequiredQueryParams = typing_extensions.TypedDict( - "RequestRequiredQueryParams", + 'RequestRequiredQueryParams', { - "setId": typing.Union[ - SetIdSchema, - str, - uuid.UUID, - ], - }, + 'setId': typing.Union[SetIdSchema, str, uuid.UUID, ], + } ) RequestOptionalQueryParams = typing_extensions.TypedDict( - "RequestOptionalQueryParams", {}, total=False + 'RequestOptionalQueryParams', + { + }, + total=False ) + class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): pass + request_query_set_id = api_client.QueryParameter( name="setId", style=api_client.ParameterStyle.FORM, @@ -54,81 +55,73 @@ request_query_set_id = api_client.QueryParameter( explode=True, ) -class SchemaFor200ResponseBodyApplicationJson(schemas.DictSchema): + +class SchemaFor200ResponseBodyApplicationJson( + schemas.DictSchema +): + + class MetaOapg: + class properties: - class testCases(schemas.ListSchema): + + + class testCases( + schemas.ListSchema + ): + + class MetaOapg: + @staticmethod - def items() -> typing.Type["TestCase"]: + def items() -> typing.Type['TestCase']: return TestCase + def __new__( cls, - _arg: typing.Union[ - typing.Tuple["TestCase"], typing.List["TestCase"] - ], + _arg: typing.Union[typing.Tuple['TestCase'], typing.List['TestCase']], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "testCases": + ) -> 'testCases': return super().__new__( cls, _arg, _configuration=_configuration, ) - def __getitem__(self, i: int) -> "TestCase": + + def __getitem__(self, i: int) -> 'TestCase': return super().__getitem__(i) __annotations__ = { "testCases": testCases, } + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["testCases"] - ) -> MetaOapg.properties.testCases: ... + def __getitem__(self, name: typing_extensions.Literal["testCases"]) -> MetaOapg.properties.testCases: ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, name: typing.Union[typing_extensions.Literal["testCases",], str] - ): + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["testCases", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["testCases"] - ) -> typing.Union[MetaOapg.properties.testCases, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["testCases"]) -> typing.Union[MetaOapg.properties.testCases, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg( - self, name: typing.Union[typing_extensions.Literal["testCases",], str] - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["testCases", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - testCases: typing.Union[ - MetaOapg.properties.testCases, list, tuple, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + testCases: typing.Union[MetaOapg.properties.testCases, list, tuple, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "SchemaFor200ResponseBodyApplicationJson": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( cls, *_args, @@ -137,81 +130,73 @@ class SchemaFor200ResponseBodyApplicationJson(schemas.DictSchema): **kwargs, ) -class SchemaFor200ResponseBodyApplicationJsonCharsetutf8(schemas.DictSchema): + +class SchemaFor200ResponseBodyApplicationJsonCharsetutf8( + schemas.DictSchema +): + + class MetaOapg: + class properties: - class testCases(schemas.ListSchema): + + + class testCases( + schemas.ListSchema + ): + + class MetaOapg: + @staticmethod - def items() -> typing.Type["TestCase"]: + def items() -> typing.Type['TestCase']: return TestCase + def __new__( cls, - _arg: typing.Union[ - typing.Tuple["TestCase"], typing.List["TestCase"] - ], + _arg: typing.Union[typing.Tuple['TestCase'], typing.List['TestCase']], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "testCases": + ) -> 'testCases': return super().__new__( cls, _arg, _configuration=_configuration, ) - def __getitem__(self, i: int) -> "TestCase": + + def __getitem__(self, i: int) -> 'TestCase': return super().__getitem__(i) __annotations__ = { "testCases": testCases, } + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["testCases"] - ) -> MetaOapg.properties.testCases: ... + def __getitem__(self, name: typing_extensions.Literal["testCases"]) -> MetaOapg.properties.testCases: ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, name: typing.Union[typing_extensions.Literal["testCases",], str] - ): + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["testCases", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["testCases"] - ) -> typing.Union[MetaOapg.properties.testCases, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["testCases"]) -> typing.Union[MetaOapg.properties.testCases, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg( - self, name: typing.Union[typing_extensions.Literal["testCases",], str] - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["testCases", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - testCases: typing.Union[ - MetaOapg.properties.testCases, list, tuple, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + testCases: typing.Union[MetaOapg.properties.testCases, list, tuple, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "SchemaFor200ResponseBodyApplicationJsonCharsetutf8": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SchemaFor200ResponseBodyApplicationJsonCharsetutf8': return super().__new__( cls, *_args, @@ -220,6 +205,7 @@ class SchemaFor200ResponseBodyApplicationJsonCharsetutf8(schemas.DictSchema): **kwargs, ) + @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse @@ -229,42 +215,46 @@ class ApiResponseFor200(api_client.ApiResponse): ] headers: schemas.Unset = schemas.unset + _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, content={ - "application/json": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson - ), - "application/json; charset=utf-8": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8 - ), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + 'application/json; charset=utf-8': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8), }, ) + @dataclass class ApiResponseFor400(api_client.ApiResponse): response: urllib3.HTTPResponse body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset + _response_for_400 = api_client.OpenApiResponse( response_cls=ApiResponseFor400, ) + @dataclass class ApiResponseFor500(api_client.ApiResponse): response: urllib3.HTTPResponse body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset + _response_for_500 = api_client.OpenApiResponse( response_cls=ApiResponseFor500, ) _all_accept_content_types = ( - "application/json", - "application/json; charset=utf-8", + 'application/json', + 'application/json; charset=utf-8', ) + class BaseApi(api_client.Api): @typing.overload def _test_case_get_oapg( @@ -274,7 +264,10 @@ class BaseApi(api_client.Api): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def _test_case_get_oapg( self, @@ -284,6 +277,7 @@ class BaseApi(api_client.Api): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload def _test_case_get_oapg( self, @@ -296,6 +290,7 @@ class BaseApi(api_client.Api): ApiResponseFor200, api_client.ApiResponseWithoutDeserialization, ]: ... + def _test_case_get_oapg( self, query_params: RequestQueryParams = frozendict.frozendict(), @@ -314,15 +309,15 @@ class BaseApi(api_client.Api): used_path = path.value prefix_separator_iterator = None - for parameter in (request_query_set_id,): + for parameter in ( + request_query_set_id, + ): parameter_data = query_params.get(parameter.name, schemas.unset) if parameter_data is schemas.unset: continue if prefix_separator_iterator is None: prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize( - parameter_data, prefix_separator_iterator - ) + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) for serialized_value in serialized_data.values(): used_path += serialized_value @@ -330,11 +325,11 @@ class BaseApi(api_client.Api): # TODO add cookie handling if accept_content_types: for accept_content_type in accept_content_types: - _headers.add("Accept", accept_content_type) + _headers.add('Accept', accept_content_type) response = self.api_client.call_api( resource_path=used_path, - method="get".upper(), + method='get'.upper(), headers=_headers, auth_settings=_auth, stream=stream, @@ -342,29 +337,24 @@ class BaseApi(api_client.Api): ) if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: response_for_status = _status_code_to_response.get(str(response.status)) if response_for_status: - api_response = response_for_status.deserialize( - response, self.api_client.configuration - ) + api_response = response_for_status.deserialize(response, self.api_client.configuration) else: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: raise exceptions.ApiException( status=response.status, reason=response.reason, - api_response=api_response, + api_response=api_response ) return api_response + class TestCaseGet(BaseApi): # this class is used by api classes that refer to endpoints with operationId fn names @@ -376,7 +366,10 @@ class TestCaseGet(BaseApi): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def test_case_get( self, @@ -386,6 +379,7 @@ class TestCaseGet(BaseApi): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload def test_case_get( self, @@ -398,6 +392,7 @@ class TestCaseGet(BaseApi): ApiResponseFor200, api_client.ApiResponseWithoutDeserialization, ]: ... + def test_case_get( self, query_params: RequestQueryParams = frozendict.frozendict(), @@ -411,9 +406,10 @@ class TestCaseGet(BaseApi): accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) + class ApiForget(BaseApi): # this class is used by api classes that refer to endpoints by path and http method names @@ -425,7 +421,10 @@ class ApiForget(BaseApi): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def get( self, @@ -435,6 +434,7 @@ class ApiForget(BaseApi): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload def get( self, @@ -447,6 +447,7 @@ class ApiForget(BaseApi): ApiResponseFor200, api_client.ApiResponseWithoutDeserialization, ]: ... + def get( self, query_params: RequestQueryParams = frozendict.frozendict(), @@ -460,5 +461,7 @@ class ApiForget(BaseApi): accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) + + diff --git a/package/gentrace/paths/test_run/__init__.py b/package/gentrace/paths/test_run/__init__.py index 19c01a74..a11603a2 100644 --- a/package/gentrace/paths/test_run/__init__.py +++ b/package/gentrace/paths/test_run/__init__.py @@ -4,4 +4,4 @@ from gentrace.paths import PathValues -path = PathValues.TESTRUN +path = PathValues.TESTRUN \ No newline at end of file diff --git a/package/gentrace/paths/test_run/get.py b/package/gentrace/paths/test_run/get.py index 10de6a40..9ad8b03e 100644 --- a/package/gentrace/paths/test_run/get.py +++ b/package/gentrace/paths/test_run/get.py @@ -32,17 +32,16 @@ # Query params RunIdSchema = schemas.UUIDSchema RequestRequiredQueryParams = typing_extensions.TypedDict( - "RequestRequiredQueryParams", + 'RequestRequiredQueryParams', { - "runId": typing.Union[ - RunIdSchema, - str, - uuid.UUID, - ], - }, + 'runId': typing.Union[RunIdSchema, str, uuid.UUID, ], + } ) RequestOptionalQueryParams = typing_extensions.TypedDict( - "RequestOptionalQueryParams", {}, total=False + 'RequestOptionalQueryParams', + { + }, + total=False ) @@ -58,18 +57,29 @@ class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams) explode=True, ) _auth = [ - "bearerAuth", + 'bearerAuth', ] -class SchemaFor200ResponseBodyApplicationJson(schemas.DictSchema): +class SchemaFor200ResponseBodyApplicationJson( + schemas.DictSchema +): + + class MetaOapg: + class properties: + @staticmethod - def testRun() -> typing.Type["TestRun"]: + def testRun() -> typing.Type['TestRun']: return TestRun - - class stats(schemas.DictSchema): + + + class stats( + schemas.DictSchema + ): + + class MetaOapg: required = { "total", @@ -77,7 +87,7 @@ class MetaOapg: "pending", "done", } - + class properties: total = schemas.NumberSchema pending = schemas.NumberSchema @@ -89,147 +99,61 @@ class properties: "failure": failure, "done": done, } - + total: MetaOapg.properties.total failure: MetaOapg.properties.failure pending: MetaOapg.properties.pending done: MetaOapg.properties.done - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["total"] - ) -> MetaOapg.properties.total: - ... - + def __getitem__(self, name: typing_extensions.Literal["total"]) -> MetaOapg.properties.total: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["pending"] - ) -> MetaOapg.properties.pending: - ... - + def __getitem__(self, name: typing_extensions.Literal["pending"]) -> MetaOapg.properties.pending: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["failure"] - ) -> MetaOapg.properties.failure: - ... - + def __getitem__(self, name: typing_extensions.Literal["failure"]) -> MetaOapg.properties.failure: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["done"] - ) -> MetaOapg.properties.done: - ... - + def __getitem__(self, name: typing_extensions.Literal["done"]) -> MetaOapg.properties.done: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "total", - "pending", - "failure", - "done", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["total", "pending", "failure", "done", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["total"] - ) -> MetaOapg.properties.total: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["total"]) -> MetaOapg.properties.total: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["pending"] - ) -> MetaOapg.properties.pending: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["pending"]) -> MetaOapg.properties.pending: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["failure"] - ) -> MetaOapg.properties.failure: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["failure"]) -> MetaOapg.properties.failure: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["done"] - ) -> MetaOapg.properties.done: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["done"]) -> MetaOapg.properties.done: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "total", - "pending", - "failure", - "done", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["total", "pending", "failure", "done", ], str]): return super().get_item_oapg(name) - + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - total: typing.Union[ - MetaOapg.properties.total, - decimal.Decimal, - int, - float, - ], - failure: typing.Union[ - MetaOapg.properties.failure, - decimal.Decimal, - int, - float, - ], - pending: typing.Union[ - MetaOapg.properties.pending, - decimal.Decimal, - int, - float, - ], - done: typing.Union[ - MetaOapg.properties.done, - decimal.Decimal, - int, - float, - ], + *_args: typing.Union[dict, frozendict.frozendict, ], + total: typing.Union[MetaOapg.properties.total, decimal.Decimal, int, float, ], + failure: typing.Union[MetaOapg.properties.failure, decimal.Decimal, int, float, ], + pending: typing.Union[MetaOapg.properties.pending, decimal.Decimal, int, float, ], + done: typing.Union[MetaOapg.properties.done, decimal.Decimal, int, float, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "stats": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'stats': return super().__new__( cls, *_args, @@ -240,97 +164,46 @@ def __new__( _configuration=_configuration, **kwargs, ) - __annotations__ = { "testRun": testRun, "stats": stats, } - + @typing.overload - def __getitem__(self, name: typing_extensions.Literal["testRun"]) -> "TestRun": - ... - + def __getitem__(self, name: typing_extensions.Literal["testRun"]) -> 'TestRun': ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["stats"] - ) -> MetaOapg.properties.stats: - ... - + def __getitem__(self, name: typing_extensions.Literal["stats"]) -> MetaOapg.properties.stats: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "testRun", - "stats", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["testRun", "stats", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["testRun"] - ) -> typing.Union["TestRun", schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["testRun"]) -> typing.Union['TestRun', schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["stats"] - ) -> typing.Union[MetaOapg.properties.stats, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["stats"]) -> typing.Union[MetaOapg.properties.stats, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "testRun", - "stats", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["testRun", "stats", ], str]): return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - testRun: typing.Union["TestRun", schemas.Unset] = schemas.unset, - stats: typing.Union[ - MetaOapg.properties.stats, dict, frozendict.frozendict, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + testRun: typing.Union['TestRun', schemas.Unset] = schemas.unset, + stats: typing.Union[MetaOapg.properties.stats, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "SchemaFor200ResponseBodyApplicationJson": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( cls, *_args, @@ -341,14 +214,25 @@ def __new__( ) -class SchemaFor200ResponseBodyApplicationJsonCharsetutf8(schemas.DictSchema): +class SchemaFor200ResponseBodyApplicationJsonCharsetutf8( + schemas.DictSchema +): + + class MetaOapg: + class properties: + @staticmethod - def testRun() -> typing.Type["TestRun"]: + def testRun() -> typing.Type['TestRun']: return TestRun - - class stats(schemas.DictSchema): + + + class stats( + schemas.DictSchema + ): + + class MetaOapg: required = { "total", @@ -356,7 +240,7 @@ class MetaOapg: "pending", "done", } - + class properties: total = schemas.NumberSchema pending = schemas.NumberSchema @@ -368,147 +252,61 @@ class properties: "failure": failure, "done": done, } - + total: MetaOapg.properties.total failure: MetaOapg.properties.failure pending: MetaOapg.properties.pending done: MetaOapg.properties.done - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["total"] - ) -> MetaOapg.properties.total: - ... - + def __getitem__(self, name: typing_extensions.Literal["total"]) -> MetaOapg.properties.total: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["pending"] - ) -> MetaOapg.properties.pending: - ... - + def __getitem__(self, name: typing_extensions.Literal["pending"]) -> MetaOapg.properties.pending: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["failure"] - ) -> MetaOapg.properties.failure: - ... - + def __getitem__(self, name: typing_extensions.Literal["failure"]) -> MetaOapg.properties.failure: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["done"] - ) -> MetaOapg.properties.done: - ... - + def __getitem__(self, name: typing_extensions.Literal["done"]) -> MetaOapg.properties.done: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "total", - "pending", - "failure", - "done", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["total", "pending", "failure", "done", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["total"] - ) -> MetaOapg.properties.total: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["total"]) -> MetaOapg.properties.total: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["pending"] - ) -> MetaOapg.properties.pending: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["pending"]) -> MetaOapg.properties.pending: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["failure"] - ) -> MetaOapg.properties.failure: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["failure"]) -> MetaOapg.properties.failure: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["done"] - ) -> MetaOapg.properties.done: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["done"]) -> MetaOapg.properties.done: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "total", - "pending", - "failure", - "done", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["total", "pending", "failure", "done", ], str]): return super().get_item_oapg(name) - + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - total: typing.Union[ - MetaOapg.properties.total, - decimal.Decimal, - int, - float, - ], - failure: typing.Union[ - MetaOapg.properties.failure, - decimal.Decimal, - int, - float, - ], - pending: typing.Union[ - MetaOapg.properties.pending, - decimal.Decimal, - int, - float, - ], - done: typing.Union[ - MetaOapg.properties.done, - decimal.Decimal, - int, - float, - ], + *_args: typing.Union[dict, frozendict.frozendict, ], + total: typing.Union[MetaOapg.properties.total, decimal.Decimal, int, float, ], + failure: typing.Union[MetaOapg.properties.failure, decimal.Decimal, int, float, ], + pending: typing.Union[MetaOapg.properties.pending, decimal.Decimal, int, float, ], + done: typing.Union[MetaOapg.properties.done, decimal.Decimal, int, float, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "stats": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'stats': return super().__new__( cls, *_args, @@ -519,97 +317,46 @@ def __new__( _configuration=_configuration, **kwargs, ) - __annotations__ = { "testRun": testRun, "stats": stats, } - + @typing.overload - def __getitem__(self, name: typing_extensions.Literal["testRun"]) -> "TestRun": - ... - + def __getitem__(self, name: typing_extensions.Literal["testRun"]) -> 'TestRun': ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["stats"] - ) -> MetaOapg.properties.stats: - ... - + def __getitem__(self, name: typing_extensions.Literal["stats"]) -> MetaOapg.properties.stats: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "testRun", - "stats", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["testRun", "stats", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["testRun"] - ) -> typing.Union["TestRun", schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["testRun"]) -> typing.Union['TestRun', schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["stats"] - ) -> typing.Union[MetaOapg.properties.stats, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["stats"]) -> typing.Union[MetaOapg.properties.stats, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "testRun", - "stats", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["testRun", "stats", ], str]): return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - testRun: typing.Union["TestRun", schemas.Unset] = schemas.unset, - stats: typing.Union[ - MetaOapg.properties.stats, dict, frozendict.frozendict, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + testRun: typing.Union['TestRun', schemas.Unset] = schemas.unset, + stats: typing.Union[MetaOapg.properties.stats, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "SchemaFor200ResponseBodyApplicationJsonCharsetutf8": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SchemaFor200ResponseBodyApplicationJsonCharsetutf8': return super().__new__( cls, *_args, @@ -633,20 +380,18 @@ class ApiResponseFor200(api_client.ApiResponse): _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, content={ - "application/json": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson - ), - "application/json; charset=utf-8": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8 - ), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + 'application/json; charset=utf-8': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8), }, ) _status_code_to_response = { - "200": _response_for_200, + '200': _response_for_200, } _all_accept_content_types = ( - "application/json", - "application/json; charset=utf-8", + 'application/json', + 'application/json; charset=utf-8', ) @@ -659,8 +404,9 @@ def _test_run_get_oapg( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... @typing.overload def _test_run_get_oapg( @@ -670,8 +416,7 @@ def _test_run_get_oapg( accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: - ... + ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload def _test_run_get_oapg( @@ -681,8 +426,10 @@ def _test_run_get_oapg( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., - ) -> typing.Union[ApiResponseFor200, api_client.ApiResponseWithoutDeserialization,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... def _test_run_get_oapg( self, @@ -702,15 +449,15 @@ class instances used_path = path.value prefix_separator_iterator = None - for parameter in (request_query_run_id,): + for parameter in ( + request_query_run_id, + ): parameter_data = query_params.get(parameter.name, schemas.unset) if parameter_data is schemas.unset: continue if prefix_separator_iterator is None: prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize( - parameter_data, prefix_separator_iterator - ) + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) for serialized_value in serialized_data.values(): used_path += serialized_value @@ -718,11 +465,11 @@ class instances # TODO add cookie handling if accept_content_types: for accept_content_type in accept_content_types: - _headers.add("Accept", accept_content_type) + _headers.add('Accept', accept_content_type) response = self.api_client.call_api( resource_path=used_path, - method="get".upper(), + method='get'.upper(), headers=_headers, auth_settings=_auth, stream=stream, @@ -730,25 +477,19 @@ class instances ) if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: response_for_status = _status_code_to_response.get(str(response.status)) if response_for_status: - api_response = response_for_status.deserialize( - response, self.api_client.configuration - ) + api_response = response_for_status.deserialize(response, self.api_client.configuration) else: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: raise exceptions.ApiException( status=response.status, reason=response.reason, - api_response=api_response, + api_response=api_response ) return api_response @@ -765,8 +506,9 @@ def test_run_get( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... @typing.overload def test_run_get( @@ -776,8 +518,7 @@ def test_run_get( accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: - ... + ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload def test_run_get( @@ -787,8 +528,10 @@ def test_run_get( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., - ) -> typing.Union[ApiResponseFor200, api_client.ApiResponseWithoutDeserialization,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... def test_run_get( self, @@ -803,7 +546,7 @@ def test_run_get( accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) @@ -818,8 +561,9 @@ def get( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... @typing.overload def get( @@ -829,8 +573,7 @@ def get( accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: - ... + ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload def get( @@ -840,8 +583,10 @@ def get( stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., - ) -> typing.Union[ApiResponseFor200, api_client.ApiResponseWithoutDeserialization,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... def get( self, @@ -856,5 +601,7 @@ def get( accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) + + diff --git a/package/gentrace/paths/test_run/get.pyi b/package/gentrace/paths/test_run/get.pyi index 9bb25141..767599f3 100644 --- a/package/gentrace/paths/test_run/get.pyi +++ b/package/gentrace/paths/test_run/get.pyi @@ -30,22 +30,23 @@ from gentrace.model.test_run import TestRun # Query params RunIdSchema = schemas.UUIDSchema RequestRequiredQueryParams = typing_extensions.TypedDict( - "RequestRequiredQueryParams", + 'RequestRequiredQueryParams', { - "runId": typing.Union[ - RunIdSchema, - str, - uuid.UUID, - ], - }, + 'runId': typing.Union[RunIdSchema, str, uuid.UUID, ], + } ) RequestOptionalQueryParams = typing_extensions.TypedDict( - "RequestOptionalQueryParams", {}, total=False + 'RequestOptionalQueryParams', + { + }, + total=False ) + class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): pass + request_query_run_id = api_client.QueryParameter( name="runId", style=api_client.ParameterStyle.FORM, @@ -54,14 +55,26 @@ request_query_run_id = api_client.QueryParameter( explode=True, ) -class SchemaFor200ResponseBodyApplicationJson(schemas.DictSchema): + +class SchemaFor200ResponseBodyApplicationJson( + schemas.DictSchema +): + + class MetaOapg: + class properties: + @staticmethod - def testRun() -> typing.Type["TestRun"]: + def testRun() -> typing.Type['TestRun']: return TestRun - - class stats(schemas.DictSchema): + + + class stats( + schemas.DictSchema + ): + + class MetaOapg: required = { "total", @@ -69,7 +82,7 @@ class SchemaFor200ResponseBodyApplicationJson(schemas.DictSchema): "pending", "done", } - + class properties: total = schemas.NumberSchema pending = schemas.NumberSchema @@ -81,124 +94,61 @@ class SchemaFor200ResponseBodyApplicationJson(schemas.DictSchema): "failure": failure, "done": done, } + total: MetaOapg.properties.total failure: MetaOapg.properties.failure pending: MetaOapg.properties.pending done: MetaOapg.properties.done - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["total"] - ) -> MetaOapg.properties.total: ... + def __getitem__(self, name: typing_extensions.Literal["total"]) -> MetaOapg.properties.total: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["pending"] - ) -> MetaOapg.properties.pending: ... + def __getitem__(self, name: typing_extensions.Literal["pending"]) -> MetaOapg.properties.pending: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["failure"] - ) -> MetaOapg.properties.failure: ... + def __getitem__(self, name: typing_extensions.Literal["failure"]) -> MetaOapg.properties.failure: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["done"] - ) -> MetaOapg.properties.done: ... + def __getitem__(self, name: typing_extensions.Literal["done"]) -> MetaOapg.properties.done: ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "total", - "pending", - "failure", - "done", - ], - str, - ], - ): + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["total", "pending", "failure", "done", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["total"] - ) -> MetaOapg.properties.total: ... + def get_item_oapg(self, name: typing_extensions.Literal["total"]) -> MetaOapg.properties.total: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["pending"] - ) -> MetaOapg.properties.pending: ... + def get_item_oapg(self, name: typing_extensions.Literal["pending"]) -> MetaOapg.properties.pending: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["failure"] - ) -> MetaOapg.properties.failure: ... + def get_item_oapg(self, name: typing_extensions.Literal["failure"]) -> MetaOapg.properties.failure: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["done"] - ) -> MetaOapg.properties.done: ... + def get_item_oapg(self, name: typing_extensions.Literal["done"]) -> MetaOapg.properties.done: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "total", - "pending", - "failure", - "done", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["total", "pending", "failure", "done", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - total: typing.Union[ - MetaOapg.properties.total, - decimal.Decimal, - int, - float, - ], - failure: typing.Union[ - MetaOapg.properties.failure, - decimal.Decimal, - int, - float, - ], - pending: typing.Union[ - MetaOapg.properties.pending, - decimal.Decimal, - int, - float, - ], - done: typing.Union[ - MetaOapg.properties.done, - decimal.Decimal, - int, - float, - ], + *_args: typing.Union[dict, frozendict.frozendict, ], + total: typing.Union[MetaOapg.properties.total, decimal.Decimal, int, float, ], + failure: typing.Union[MetaOapg.properties.failure, decimal.Decimal, int, float, ], + pending: typing.Union[MetaOapg.properties.pending, decimal.Decimal, int, float, ], + done: typing.Union[MetaOapg.properties.done, decimal.Decimal, int, float, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "stats": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'stats': return super().__new__( cls, *_args, @@ -213,77 +163,42 @@ class SchemaFor200ResponseBodyApplicationJson(schemas.DictSchema): "testRun": testRun, "stats": stats, } + @typing.overload - def __getitem__(self, name: typing_extensions.Literal["testRun"]) -> "TestRun": ... + def __getitem__(self, name: typing_extensions.Literal["testRun"]) -> 'TestRun': ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["stats"] - ) -> MetaOapg.properties.stats: ... + def __getitem__(self, name: typing_extensions.Literal["stats"]) -> MetaOapg.properties.stats: ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "testRun", - "stats", - ], - str, - ], - ): + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["testRun", "stats", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["testRun"] - ) -> typing.Union["TestRun", schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["testRun"]) -> typing.Union['TestRun', schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["stats"] - ) -> typing.Union[MetaOapg.properties.stats, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["stats"]) -> typing.Union[MetaOapg.properties.stats, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "testRun", - "stats", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["testRun", "stats", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - testRun: typing.Union["TestRun", schemas.Unset] = schemas.unset, - stats: typing.Union[ - MetaOapg.properties.stats, dict, frozendict.frozendict, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + testRun: typing.Union['TestRun', schemas.Unset] = schemas.unset, + stats: typing.Union[MetaOapg.properties.stats, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "SchemaFor200ResponseBodyApplicationJson": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( cls, *_args, @@ -293,14 +208,26 @@ class SchemaFor200ResponseBodyApplicationJson(schemas.DictSchema): **kwargs, ) -class SchemaFor200ResponseBodyApplicationJsonCharsetutf8(schemas.DictSchema): + +class SchemaFor200ResponseBodyApplicationJsonCharsetutf8( + schemas.DictSchema +): + + class MetaOapg: + class properties: + @staticmethod - def testRun() -> typing.Type["TestRun"]: + def testRun() -> typing.Type['TestRun']: return TestRun - - class stats(schemas.DictSchema): + + + class stats( + schemas.DictSchema + ): + + class MetaOapg: required = { "total", @@ -308,7 +235,7 @@ class SchemaFor200ResponseBodyApplicationJsonCharsetutf8(schemas.DictSchema): "pending", "done", } - + class properties: total = schemas.NumberSchema pending = schemas.NumberSchema @@ -320,124 +247,61 @@ class SchemaFor200ResponseBodyApplicationJsonCharsetutf8(schemas.DictSchema): "failure": failure, "done": done, } + total: MetaOapg.properties.total failure: MetaOapg.properties.failure pending: MetaOapg.properties.pending done: MetaOapg.properties.done - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["total"] - ) -> MetaOapg.properties.total: ... + def __getitem__(self, name: typing_extensions.Literal["total"]) -> MetaOapg.properties.total: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["pending"] - ) -> MetaOapg.properties.pending: ... + def __getitem__(self, name: typing_extensions.Literal["pending"]) -> MetaOapg.properties.pending: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["failure"] - ) -> MetaOapg.properties.failure: ... + def __getitem__(self, name: typing_extensions.Literal["failure"]) -> MetaOapg.properties.failure: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["done"] - ) -> MetaOapg.properties.done: ... + def __getitem__(self, name: typing_extensions.Literal["done"]) -> MetaOapg.properties.done: ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "total", - "pending", - "failure", - "done", - ], - str, - ], - ): + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["total", "pending", "failure", "done", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["total"] - ) -> MetaOapg.properties.total: ... + def get_item_oapg(self, name: typing_extensions.Literal["total"]) -> MetaOapg.properties.total: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["pending"] - ) -> MetaOapg.properties.pending: ... + def get_item_oapg(self, name: typing_extensions.Literal["pending"]) -> MetaOapg.properties.pending: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["failure"] - ) -> MetaOapg.properties.failure: ... + def get_item_oapg(self, name: typing_extensions.Literal["failure"]) -> MetaOapg.properties.failure: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["done"] - ) -> MetaOapg.properties.done: ... + def get_item_oapg(self, name: typing_extensions.Literal["done"]) -> MetaOapg.properties.done: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "total", - "pending", - "failure", - "done", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["total", "pending", "failure", "done", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - total: typing.Union[ - MetaOapg.properties.total, - decimal.Decimal, - int, - float, - ], - failure: typing.Union[ - MetaOapg.properties.failure, - decimal.Decimal, - int, - float, - ], - pending: typing.Union[ - MetaOapg.properties.pending, - decimal.Decimal, - int, - float, - ], - done: typing.Union[ - MetaOapg.properties.done, - decimal.Decimal, - int, - float, - ], + *_args: typing.Union[dict, frozendict.frozendict, ], + total: typing.Union[MetaOapg.properties.total, decimal.Decimal, int, float, ], + failure: typing.Union[MetaOapg.properties.failure, decimal.Decimal, int, float, ], + pending: typing.Union[MetaOapg.properties.pending, decimal.Decimal, int, float, ], + done: typing.Union[MetaOapg.properties.done, decimal.Decimal, int, float, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "stats": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'stats': return super().__new__( cls, *_args, @@ -452,77 +316,42 @@ class SchemaFor200ResponseBodyApplicationJsonCharsetutf8(schemas.DictSchema): "testRun": testRun, "stats": stats, } + @typing.overload - def __getitem__(self, name: typing_extensions.Literal["testRun"]) -> "TestRun": ... + def __getitem__(self, name: typing_extensions.Literal["testRun"]) -> 'TestRun': ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["stats"] - ) -> MetaOapg.properties.stats: ... + def __getitem__(self, name: typing_extensions.Literal["stats"]) -> MetaOapg.properties.stats: ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "testRun", - "stats", - ], - str, - ], - ): + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["testRun", "stats", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["testRun"] - ) -> typing.Union["TestRun", schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["testRun"]) -> typing.Union['TestRun', schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["stats"] - ) -> typing.Union[MetaOapg.properties.stats, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["stats"]) -> typing.Union[MetaOapg.properties.stats, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "testRun", - "stats", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["testRun", "stats", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - testRun: typing.Union["TestRun", schemas.Unset] = schemas.unset, - stats: typing.Union[ - MetaOapg.properties.stats, dict, frozendict.frozendict, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + testRun: typing.Union['TestRun', schemas.Unset] = schemas.unset, + stats: typing.Union[MetaOapg.properties.stats, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "SchemaFor200ResponseBodyApplicationJsonCharsetutf8": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SchemaFor200ResponseBodyApplicationJsonCharsetutf8': return super().__new__( cls, *_args, @@ -532,6 +361,7 @@ class SchemaFor200ResponseBodyApplicationJsonCharsetutf8(schemas.DictSchema): **kwargs, ) + @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse @@ -541,22 +371,22 @@ class ApiResponseFor200(api_client.ApiResponse): ] headers: schemas.Unset = schemas.unset + _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, content={ - "application/json": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson - ), - "application/json; charset=utf-8": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8 - ), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + 'application/json; charset=utf-8': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8), }, ) _all_accept_content_types = ( - "application/json", - "application/json; charset=utf-8", + 'application/json', + 'application/json; charset=utf-8', ) + class BaseApi(api_client.Api): @typing.overload def _test_run_get_oapg( @@ -566,7 +396,10 @@ class BaseApi(api_client.Api): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def _test_run_get_oapg( self, @@ -576,6 +409,7 @@ class BaseApi(api_client.Api): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload def _test_run_get_oapg( self, @@ -588,6 +422,7 @@ class BaseApi(api_client.Api): ApiResponseFor200, api_client.ApiResponseWithoutDeserialization, ]: ... + def _test_run_get_oapg( self, query_params: RequestQueryParams = frozendict.frozendict(), @@ -606,15 +441,15 @@ class BaseApi(api_client.Api): used_path = path.value prefix_separator_iterator = None - for parameter in (request_query_run_id,): + for parameter in ( + request_query_run_id, + ): parameter_data = query_params.get(parameter.name, schemas.unset) if parameter_data is schemas.unset: continue if prefix_separator_iterator is None: prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize( - parameter_data, prefix_separator_iterator - ) + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) for serialized_value in serialized_data.values(): used_path += serialized_value @@ -622,11 +457,11 @@ class BaseApi(api_client.Api): # TODO add cookie handling if accept_content_types: for accept_content_type in accept_content_types: - _headers.add("Accept", accept_content_type) + _headers.add('Accept', accept_content_type) response = self.api_client.call_api( resource_path=used_path, - method="get".upper(), + method='get'.upper(), headers=_headers, auth_settings=_auth, stream=stream, @@ -634,29 +469,24 @@ class BaseApi(api_client.Api): ) if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: response_for_status = _status_code_to_response.get(str(response.status)) if response_for_status: - api_response = response_for_status.deserialize( - response, self.api_client.configuration - ) + api_response = response_for_status.deserialize(response, self.api_client.configuration) else: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: raise exceptions.ApiException( status=response.status, reason=response.reason, - api_response=api_response, + api_response=api_response ) return api_response + class TestRunGet(BaseApi): # this class is used by api classes that refer to endpoints with operationId fn names @@ -668,7 +498,10 @@ class TestRunGet(BaseApi): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def test_run_get( self, @@ -678,6 +511,7 @@ class TestRunGet(BaseApi): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload def test_run_get( self, @@ -690,6 +524,7 @@ class TestRunGet(BaseApi): ApiResponseFor200, api_client.ApiResponseWithoutDeserialization, ]: ... + def test_run_get( self, query_params: RequestQueryParams = frozendict.frozendict(), @@ -703,9 +538,10 @@ class TestRunGet(BaseApi): accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) + class ApiForget(BaseApi): # this class is used by api classes that refer to endpoints by path and http method names @@ -717,7 +553,10 @@ class ApiForget(BaseApi): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def get( self, @@ -727,6 +566,7 @@ class ApiForget(BaseApi): stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload def get( self, @@ -739,6 +579,7 @@ class ApiForget(BaseApi): ApiResponseFor200, api_client.ApiResponseWithoutDeserialization, ]: ... + def get( self, query_params: RequestQueryParams = frozendict.frozendict(), @@ -752,5 +593,7 @@ class ApiForget(BaseApi): accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) + + diff --git a/package/gentrace/paths/test_run/post.py b/package/gentrace/paths/test_run/post.py index 24946530..558b8e49 100644 --- a/package/gentrace/paths/test_run/post.py +++ b/package/gentrace/paths/test_run/post.py @@ -31,368 +31,278 @@ # body param -class SchemaForRequestBodyApplicationJson(schemas.DictSchema): +class SchemaForRequestBodyApplicationJson( + schemas.DictSchema +): + + class MetaOapg: required = { "testResults", "setId", } - + class properties: setId = schemas.UUIDSchema - + + class branch( - schemas.StrBase, schemas.NoneBase, schemas.Schema, schemas.NoneStrMixin + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin ): + + def __new__( cls, - *_args: typing.Union[ - None, - str, - ], + *_args: typing.Union[None, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "branch": + ) -> 'branch': return super().__new__( cls, *_args, _configuration=_configuration, ) - + + class commit( - schemas.StrBase, schemas.NoneBase, schemas.Schema, schemas.NoneStrMixin + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin ): + + def __new__( cls, - *_args: typing.Union[ - None, - str, - ], + *_args: typing.Union[None, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "commit": + ) -> 'commit': return super().__new__( cls, *_args, _configuration=_configuration, ) - + + class name( - schemas.StrBase, schemas.NoneBase, schemas.Schema, schemas.NoneStrMixin + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin ): + + def __new__( cls, - *_args: typing.Union[ - None, - str, - ], + *_args: typing.Union[None, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "name": + ) -> 'name': return super().__new__( cls, *_args, _configuration=_configuration, ) - - class testResults(schemas.ListSchema): + + + class testResults( + schemas.ListSchema + ): + + class MetaOapg: - class items(schemas.DictSchema): + + + class items( + schemas.DictSchema + ): + + class MetaOapg: required = { "output", "inputs", "caseId", } - + class properties: + + class id( schemas.UUIDBase, schemas.StrBase, schemas.NoneBase, schemas.Schema, - schemas.NoneStrMixin, + schemas.NoneStrMixin ): + + class MetaOapg: - format = "uuid" - + format = 'uuid' + + def __new__( cls, - *_args: typing.Union[ - None, - str, - uuid.UUID, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - ) -> "id": + *_args: typing.Union[None, str, uuid.UUID, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'id': return super().__new__( cls, *_args, _configuration=_configuration, ) - caseId = schemas.UUIDSchema - - class inputs(schemas.DictSchema): + + + class inputs( + schemas.DictSchema + ): + + class MetaOapg: additional_properties = schemas.StrSchema - - def __getitem__( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: # dict_instance[name] accessor return super().__getitem__(name) - - def get_item_oapg( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: return super().get_item_oapg(name) - + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - MetaOapg.additional_properties, - str, - ], - ) -> "inputs": + *_args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'inputs': return super().__new__( cls, *_args, _configuration=_configuration, **kwargs, ) - output = schemas.StrSchema - + + class outputSteps( schemas.ListBase, schemas.NoneBase, schemas.Schema, - schemas.NoneTupleMixin, + schemas.NoneTupleMixin ): + + class MetaOapg: - class items(schemas.DictSchema): + + + class items( + schemas.DictSchema + ): + + class MetaOapg: required = { "output", "key", } - + class properties: - class key(schemas.StrSchema): + + + class key( + schemas.StrSchema + ): + + class MetaOapg: max_length = 100 min_length = 1 - output = schemas.StrSchema - + + class inputs( schemas.DictBase, schemas.NoneBase, schemas.Schema, - schemas.NoneFrozenDictMixin, + schemas.NoneFrozenDictMixin ): + + class MetaOapg: - additional_properties = ( - schemas.StrSchema - ) - - def __getitem__( - self, - name: typing.Union[str,], - ) -> ( - MetaOapg.additional_properties - ): + additional_properties = schemas.StrSchema + + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: # dict_instance[name] accessor - return super().__getitem__( - name - ) - - def get_item_oapg( - self, - name: typing.Union[str,], - ) -> ( - MetaOapg.additional_properties - ): - return ( - super().get_item_oapg( - name - ) - ) - + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - None, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - MetaOapg.additional_properties, - str, - ], - ) -> "inputs": + *_args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'inputs': return super().__new__( cls, *_args, _configuration=_configuration, **kwargs, ) - __annotations__ = { "key": key, "output": output, "inputs": inputs, } - + output: MetaOapg.properties.output key: MetaOapg.properties.key - + @typing.overload - def __getitem__( - self, - name: typing_extensions.Literal["key"], - ) -> MetaOapg.properties.key: - ... - + def __getitem__(self, name: typing_extensions.Literal["key"]) -> MetaOapg.properties.key: ... + @typing.overload - def __getitem__( - self, - name: typing_extensions.Literal[ - "output" - ], - ) -> MetaOapg.properties.output: - ... - + def __getitem__(self, name: typing_extensions.Literal["output"]) -> MetaOapg.properties.output: ... + @typing.overload - def __getitem__( - self, - name: typing_extensions.Literal[ - "inputs" - ], - ) -> MetaOapg.properties.inputs: - ... - + def __getitem__(self, name: typing_extensions.Literal["inputs"]) -> MetaOapg.properties.inputs: ... + @typing.overload - def __getitem__( - self, name: str - ) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "key", - "output", - "inputs", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["key", "output", "inputs", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, - name: typing_extensions.Literal["key"], - ) -> MetaOapg.properties.key: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["key"]) -> MetaOapg.properties.key: ... + @typing.overload - def get_item_oapg( - self, - name: typing_extensions.Literal[ - "output" - ], - ) -> MetaOapg.properties.output: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["output"]) -> MetaOapg.properties.output: ... + @typing.overload - def get_item_oapg( - self, - name: typing_extensions.Literal[ - "inputs" - ], - ) -> typing.Union[ - MetaOapg.properties.inputs, - schemas.Unset, - ]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["inputs"]) -> typing.Union[MetaOapg.properties.inputs, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[ - schemas.UnsetAnyTypeSchema, - schemas.Unset, - ]: - ... - - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "key", - "output", - "inputs", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["key", "output", "inputs", ], str]): return super().get_item_oapg(name) - + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - output: typing.Union[ - MetaOapg.properties.output, - str, - ], - key: typing.Union[ - MetaOapg.properties.key, - str, - ], - inputs: typing.Union[ - MetaOapg.properties.inputs, - dict, - frozendict.frozendict, - None, - schemas.Unset, - ] = schemas.unset, - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "items": + *_args: typing.Union[dict, frozendict.frozendict, ], + output: typing.Union[MetaOapg.properties.output, str, ], + key: typing.Union[MetaOapg.properties.key, str, ], + inputs: typing.Union[MetaOapg.properties.inputs, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'items': return super().__new__( cls, *_args, @@ -402,26 +312,19 @@ def __new__( _configuration=_configuration, **kwargs, ) - min_items = 1 - + + def __new__( cls, - *_args: typing.Union[ - list, - tuple, - None, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - ) -> "outputSteps": + *_args: typing.Union[list, tuple, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'outputSteps': return super().__new__( cls, *_args, _configuration=_configuration, ) - __annotations__ = { "id": id, "caseId": caseId, @@ -429,168 +332,67 @@ def __new__( "output": output, "outputSteps": outputSteps, } - + output: MetaOapg.properties.output inputs: MetaOapg.properties.inputs caseId: MetaOapg.properties.caseId - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["id"] - ) -> MetaOapg.properties.id: - ... - + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["caseId"] - ) -> MetaOapg.properties.caseId: - ... - + def __getitem__(self, name: typing_extensions.Literal["caseId"]) -> MetaOapg.properties.caseId: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["inputs"] - ) -> MetaOapg.properties.inputs: - ... - + def __getitem__(self, name: typing_extensions.Literal["inputs"]) -> MetaOapg.properties.inputs: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["output"] - ) -> MetaOapg.properties.output: - ... - + def __getitem__(self, name: typing_extensions.Literal["output"]) -> MetaOapg.properties.output: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["outputSteps"] - ) -> MetaOapg.properties.outputSteps: - ... - + def __getitem__(self, name: typing_extensions.Literal["outputSteps"]) -> MetaOapg.properties.outputSteps: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "caseId", - "inputs", - "output", - "outputSteps", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "caseId", "inputs", "output", "outputSteps", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["id"] - ) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["caseId"] - ) -> MetaOapg.properties.caseId: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["caseId"]) -> MetaOapg.properties.caseId: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["inputs"] - ) -> MetaOapg.properties.inputs: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["inputs"]) -> MetaOapg.properties.inputs: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["output"] - ) -> MetaOapg.properties.output: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["output"]) -> MetaOapg.properties.output: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["outputSteps"] - ) -> typing.Union[ - MetaOapg.properties.outputSteps, schemas.Unset - ]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["outputSteps"]) -> typing.Union[MetaOapg.properties.outputSteps, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "caseId", - "inputs", - "output", - "outputSteps", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "caseId", "inputs", "output", "outputSteps", ], str]): return super().get_item_oapg(name) - + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - output: typing.Union[ - MetaOapg.properties.output, - str, - ], - inputs: typing.Union[ - MetaOapg.properties.inputs, - dict, - frozendict.frozendict, - ], - caseId: typing.Union[ - MetaOapg.properties.caseId, - str, - uuid.UUID, - ], - id: typing.Union[ - MetaOapg.properties.id, - None, - str, - uuid.UUID, - schemas.Unset, - ] = schemas.unset, - outputSteps: typing.Union[ - MetaOapg.properties.outputSteps, - list, - tuple, - None, - schemas.Unset, - ] = schemas.unset, - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "items": + *_args: typing.Union[dict, frozendict.frozendict, ], + output: typing.Union[MetaOapg.properties.output, str, ], + inputs: typing.Union[MetaOapg.properties.inputs, dict, frozendict.frozendict, ], + caseId: typing.Union[MetaOapg.properties.caseId, str, uuid.UUID, ], + id: typing.Union[MetaOapg.properties.id, None, str, uuid.UUID, schemas.Unset] = schemas.unset, + outputSteps: typing.Union[MetaOapg.properties.outputSteps, list, tuple, None, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'items': return super().__new__( cls, *_args, @@ -602,36 +404,20 @@ def __new__( _configuration=_configuration, **kwargs, ) - + def __new__( cls, - _arg: typing.Union[ - typing.Tuple[ - typing.Union[ - MetaOapg.items, - dict, - frozendict.frozendict, - ] - ], - typing.List[ - typing.Union[ - MetaOapg.items, - dict, - frozendict.frozendict, - ] - ], - ], + _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, ]]], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "testResults": + ) -> 'testResults': return super().__new__( cls, _arg, _configuration=_configuration, ) - + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) - __annotations__ = { "setId": setId, "branch": branch, @@ -639,154 +425,66 @@ def __getitem__(self, i: int) -> MetaOapg.items: "name": name, "testResults": testResults, } - + testResults: MetaOapg.properties.testResults setId: MetaOapg.properties.setId - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["setId"] - ) -> MetaOapg.properties.setId: - ... - + def __getitem__(self, name: typing_extensions.Literal["setId"]) -> MetaOapg.properties.setId: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["branch"] - ) -> MetaOapg.properties.branch: - ... - + def __getitem__(self, name: typing_extensions.Literal["branch"]) -> MetaOapg.properties.branch: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["commit"] - ) -> MetaOapg.properties.commit: - ... - + def __getitem__(self, name: typing_extensions.Literal["commit"]) -> MetaOapg.properties.commit: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["name"] - ) -> MetaOapg.properties.name: - ... - + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["testResults"] - ) -> MetaOapg.properties.testResults: - ... - + def __getitem__(self, name: typing_extensions.Literal["testResults"]) -> MetaOapg.properties.testResults: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "setId", - "branch", - "commit", - "name", - "testResults", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["setId", "branch", "commit", "name", "testResults", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["setId"] - ) -> MetaOapg.properties.setId: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["setId"]) -> MetaOapg.properties.setId: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["branch"] - ) -> typing.Union[MetaOapg.properties.branch, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["branch"]) -> typing.Union[MetaOapg.properties.branch, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["commit"] - ) -> typing.Union[MetaOapg.properties.commit, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["commit"]) -> typing.Union[MetaOapg.properties.commit, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["name"] - ) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["testResults"] - ) -> MetaOapg.properties.testResults: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["testResults"]) -> MetaOapg.properties.testResults: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "setId", - "branch", - "commit", - "name", - "testResults", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["setId", "branch", "commit", "name", "testResults", ], str]): return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - testResults: typing.Union[ - MetaOapg.properties.testResults, - list, - tuple, - ], - setId: typing.Union[ - MetaOapg.properties.setId, - str, - uuid.UUID, - ], - branch: typing.Union[ - MetaOapg.properties.branch, None, str, schemas.Unset - ] = schemas.unset, - commit: typing.Union[ - MetaOapg.properties.commit, None, str, schemas.Unset - ] = schemas.unset, - name: typing.Union[ - MetaOapg.properties.name, None, str, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + testResults: typing.Union[MetaOapg.properties.testResults, list, tuple, ], + setId: typing.Union[MetaOapg.properties.setId, str, uuid.UUID, ], + branch: typing.Union[MetaOapg.properties.branch, None, str, schemas.Unset] = schemas.unset, + commit: typing.Union[MetaOapg.properties.commit, None, str, schemas.Unset] = schemas.unset, + name: typing.Union[MetaOapg.properties.name, None, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "SchemaForRequestBodyApplicationJson": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SchemaForRequestBodyApplicationJson': return super().__new__( cls, *_args, @@ -802,91 +500,62 @@ def __new__( request_body_any_type = api_client.RequestBody( content={ - "application/json": api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson - ), + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), }, required=True, ) _auth = [ - "bearerAuth", + 'bearerAuth', ] -class SchemaFor200ResponseBodyApplicationJson(schemas.DictSchema): +class SchemaFor200ResponseBodyApplicationJson( + schemas.DictSchema +): + + class MetaOapg: required = { "runId", } - + class properties: runId = schemas.UUIDSchema __annotations__ = { "runId": runId, } - + runId: MetaOapg.properties.runId - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["runId"] - ) -> MetaOapg.properties.runId: - ... - + def __getitem__(self, name: typing_extensions.Literal["runId"]) -> MetaOapg.properties.runId: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["runId",], str]): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["runId", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["runId"] - ) -> MetaOapg.properties.runId: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["runId"]) -> MetaOapg.properties.runId: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, name: typing.Union[typing_extensions.Literal["runId",], str] - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["runId", ], str]): return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - runId: typing.Union[ - MetaOapg.properties.runId, - str, - uuid.UUID, - ], + *_args: typing.Union[dict, frozendict.frozendict, ], + runId: typing.Union[MetaOapg.properties.runId, str, uuid.UUID, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "SchemaFor200ResponseBodyApplicationJson": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( cls, *_args, @@ -896,80 +565,52 @@ def __new__( ) -class SchemaFor200ResponseBodyApplicationJsonCharsetutf8(schemas.DictSchema): +class SchemaFor200ResponseBodyApplicationJsonCharsetutf8( + schemas.DictSchema +): + + class MetaOapg: required = { "runId", } - + class properties: runId = schemas.UUIDSchema __annotations__ = { "runId": runId, } - + runId: MetaOapg.properties.runId - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["runId"] - ) -> MetaOapg.properties.runId: - ... - + def __getitem__(self, name: typing_extensions.Literal["runId"]) -> MetaOapg.properties.runId: ... + @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: - ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["runId",], str]): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["runId", ], str]): # dict_instance[name] accessor return super().__getitem__(name) - + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["runId"] - ) -> MetaOapg.properties.runId: - ... - + def get_item_oapg(self, name: typing_extensions.Literal["runId"]) -> MetaOapg.properties.runId: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: - ... - - def get_item_oapg( - self, name: typing.Union[typing_extensions.Literal["runId",], str] - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["runId", ], str]): return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - runId: typing.Union[ - MetaOapg.properties.runId, - str, - uuid.UUID, - ], + *_args: typing.Union[dict, frozendict.frozendict, ], + runId: typing.Union[MetaOapg.properties.runId, str, uuid.UUID, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "SchemaFor200ResponseBodyApplicationJsonCharsetutf8": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SchemaFor200ResponseBodyApplicationJsonCharsetutf8': return super().__new__( cls, *_args, @@ -992,20 +633,18 @@ class ApiResponseFor200(api_client.ApiResponse): _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, content={ - "application/json": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson - ), - "application/json; charset=utf-8": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8 - ), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + 'application/json; charset=utf-8': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8), }, ) _status_code_to_response = { - "200": _response_for_200, + '200': _response_for_200, } _all_accept_content_types = ( - "application/json", - "application/json; charset=utf-8", + 'application/json', + 'application/json; charset=utf-8', ) @@ -1013,75 +652,59 @@ class BaseApi(api_client.Api): @typing.overload def _test_run_post_oapg( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... @typing.overload def _test_run_post_oapg( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def _test_run_post_oapg( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: - ... + ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload def _test_run_post_oapg( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., - ) -> typing.Union[ApiResponseFor200, api_client.ApiResponseWithoutDeserialization,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... def _test_run_post_oapg( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], - content_type: str = "application/json", + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], + content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -1099,23 +722,22 @@ class instances # TODO add cookie handling if accept_content_types: for accept_content_type in accept_content_types: - _headers.add("Accept", accept_content_type) + _headers.add('Accept', accept_content_type) if body is schemas.unset: raise exceptions.ApiValueError( - "The required body parameter has an invalid value of: unset. Set a valid value instead" - ) + 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None serialized_data = request_body_any_type.serialize(body, content_type) - _headers.add("Content-Type", content_type) - if "fields" in serialized_data: - _fields = serialized_data["fields"] - elif "body" in serialized_data: - _body = serialized_data["body"] + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] response = self.api_client.call_api( resource_path=used_path, - method="post".upper(), + method='post'.upper(), headers=_headers, fields=_fields, body=_body, @@ -1125,25 +747,19 @@ class instances ) if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: response_for_status = _status_code_to_response.get(str(response.status)) if response_for_status: - api_response = response_for_status.deserialize( - response, self.api_client.configuration - ) + api_response = response_for_status.deserialize(response, self.api_client.configuration) else: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: raise exceptions.ApiException( status=response.status, reason=response.reason, - api_response=api_response, + api_response=api_response ) return api_response @@ -1155,75 +771,59 @@ class TestRunPost(BaseApi): @typing.overload def test_run_post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... @typing.overload def test_run_post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def test_run_post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: - ... + ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload def test_run_post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., - ) -> typing.Union[ApiResponseFor200, api_client.ApiResponseWithoutDeserialization,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... def test_run_post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], - content_type: str = "application/json", + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], + content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -1235,7 +835,7 @@ def test_run_post( accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) @@ -1245,75 +845,59 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... @typing.overload def post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: - ... + ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload def post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., - ) -> typing.Union[ApiResponseFor200, api_client.ApiResponseWithoutDeserialization,]: - ... + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... def post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], - content_type: str = "application/json", + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], + content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -1325,5 +909,7 @@ def post( accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) + + diff --git a/package/gentrace/paths/test_run/post.pyi b/package/gentrace/paths/test_run/post.pyi index 3d8dc268..6c5b94e3 100644 --- a/package/gentrace/paths/test_run/post.pyi +++ b/package/gentrace/paths/test_run/post.pyi @@ -28,131 +28,152 @@ from gentrace import ( # body param -class SchemaForRequestBodyApplicationJson(schemas.DictSchema): + +class SchemaForRequestBodyApplicationJson( + schemas.DictSchema +): + + class MetaOapg: required = { "testResults", "setId", } - + class properties: setId = schemas.UUIDSchema - + + class branch( - schemas.StrBase, schemas.NoneBase, schemas.Schema, schemas.NoneStrMixin + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin ): + + def __new__( cls, - *_args: typing.Union[ - None, - str, - ], + *_args: typing.Union[None, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "branch": + ) -> 'branch': return super().__new__( cls, *_args, _configuration=_configuration, ) - + + class commit( - schemas.StrBase, schemas.NoneBase, schemas.Schema, schemas.NoneStrMixin + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin ): + + def __new__( cls, - *_args: typing.Union[ - None, - str, - ], + *_args: typing.Union[None, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "commit": + ) -> 'commit': return super().__new__( cls, *_args, _configuration=_configuration, ) - + + class name( - schemas.StrBase, schemas.NoneBase, schemas.Schema, schemas.NoneStrMixin + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin ): + + def __new__( cls, - *_args: typing.Union[ - None, - str, - ], + *_args: typing.Union[None, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "name": + ) -> 'name': return super().__new__( cls, *_args, _configuration=_configuration, ) - - class testResults(schemas.ListSchema): + + + class testResults( + schemas.ListSchema + ): + + class MetaOapg: - class items(schemas.DictSchema): + + + class items( + schemas.DictSchema + ): + + class MetaOapg: required = { "output", "inputs", "caseId", } - + class properties: + + class id( schemas.UUIDBase, schemas.StrBase, schemas.NoneBase, schemas.Schema, - schemas.NoneStrMixin, + schemas.NoneStrMixin ): + + class MetaOapg: - format = "uuid" + format = 'uuid' + + def __new__( cls, - *_args: typing.Union[ - None, - str, - uuid.UUID, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - ) -> "id": + *_args: typing.Union[None, str, uuid.UUID, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'id': return super().__new__( cls, *_args, _configuration=_configuration, ) caseId = schemas.UUIDSchema - - class inputs(schemas.DictSchema): + + + class inputs( + schemas.DictSchema + ): + + class MetaOapg: additional_properties = schemas.StrSchema - def __getitem__( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: # dict_instance[name] accessor return super().__getitem__(name) - def get_item_oapg( - self, name: typing.Union[str,] - ) -> MetaOapg.additional_properties: + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - MetaOapg.additional_properties, - str, - ], - ) -> "inputs": + *_args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'inputs': return super().__new__( cls, *_args, @@ -160,72 +181,65 @@ class SchemaForRequestBodyApplicationJson(schemas.DictSchema): **kwargs, ) output = schemas.StrSchema - + + class outputSteps( schemas.ListBase, schemas.NoneBase, schemas.Schema, - schemas.NoneTupleMixin, + schemas.NoneTupleMixin ): + + class MetaOapg: - class items(schemas.DictSchema): + + + class items( + schemas.DictSchema + ): + + class MetaOapg: required = { "output", "key", } - + class properties: - class key(schemas.StrSchema): + + + class key( + schemas.StrSchema + ): pass output = schemas.StrSchema - + + class inputs( schemas.DictBase, schemas.NoneBase, schemas.Schema, - schemas.NoneFrozenDictMixin, + schemas.NoneFrozenDictMixin ): + + class MetaOapg: - additional_properties = ( - schemas.StrSchema - ) - def __getitem__( - self, - name: typing.Union[str,], - ) -> ( - MetaOapg.additional_properties - ): + additional_properties = schemas.StrSchema + + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: # dict_instance[name] accessor - return super().__getitem__( - name - ) - def get_item_oapg( - self, - name: typing.Union[str,], - ) -> ( - MetaOapg.additional_properties - ): - return ( - super().get_item_oapg( - name - ) - ) + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - None, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - MetaOapg.additional_properties, - str, - ], - ) -> "inputs": + *_args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'inputs': return super().__new__( cls, *_args, @@ -237,127 +251,52 @@ class SchemaForRequestBodyApplicationJson(schemas.DictSchema): "output": output, "inputs": inputs, } + output: MetaOapg.properties.output key: MetaOapg.properties.key - + @typing.overload - def __getitem__( - self, - name: typing_extensions.Literal["key"], - ) -> MetaOapg.properties.key: ... + def __getitem__(self, name: typing_extensions.Literal["key"]) -> MetaOapg.properties.key: ... + @typing.overload - def __getitem__( - self, - name: typing_extensions.Literal[ - "output" - ], - ) -> MetaOapg.properties.output: ... + def __getitem__(self, name: typing_extensions.Literal["output"]) -> MetaOapg.properties.output: ... + @typing.overload - def __getitem__( - self, - name: typing_extensions.Literal[ - "inputs" - ], - ) -> MetaOapg.properties.inputs: ... + def __getitem__(self, name: typing_extensions.Literal["inputs"]) -> MetaOapg.properties.inputs: ... + @typing.overload - def __getitem__( - self, name: str - ) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "key", - "output", - "inputs", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["key", "output", "inputs", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, - name: typing_extensions.Literal["key"], - ) -> MetaOapg.properties.key: ... + def get_item_oapg(self, name: typing_extensions.Literal["key"]) -> MetaOapg.properties.key: ... + @typing.overload - def get_item_oapg( - self, - name: typing_extensions.Literal[ - "output" - ], - ) -> MetaOapg.properties.output: ... + def get_item_oapg(self, name: typing_extensions.Literal["output"]) -> MetaOapg.properties.output: ... + @typing.overload - def get_item_oapg( - self, - name: typing_extensions.Literal[ - "inputs" - ], - ) -> typing.Union[ - MetaOapg.properties.inputs, - schemas.Unset, - ]: ... + def get_item_oapg(self, name: typing_extensions.Literal["inputs"]) -> typing.Union[MetaOapg.properties.inputs, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[ - schemas.UnsetAnyTypeSchema, - schemas.Unset, - ]: ... - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "key", - "output", - "inputs", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["key", "output", "inputs", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - output: typing.Union[ - MetaOapg.properties.output, - str, - ], - key: typing.Union[ - MetaOapg.properties.key, - str, - ], - inputs: typing.Union[ - MetaOapg.properties.inputs, - dict, - frozendict.frozendict, - None, - schemas.Unset, - ] = schemas.unset, - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "items": + *_args: typing.Union[dict, frozendict.frozendict, ], + output: typing.Union[MetaOapg.properties.output, str, ], + key: typing.Union[MetaOapg.properties.key, str, ], + inputs: typing.Union[MetaOapg.properties.inputs, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'items': return super().__new__( cls, *_args, @@ -367,17 +306,13 @@ class SchemaForRequestBodyApplicationJson(schemas.DictSchema): _configuration=_configuration, **kwargs, ) + + def __new__( cls, - *_args: typing.Union[ - list, - tuple, - None, - ], - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - ) -> "outputSteps": + *_args: typing.Union[list, tuple, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'outputSteps': return super().__new__( cls, *_args, @@ -390,145 +325,67 @@ class SchemaForRequestBodyApplicationJson(schemas.DictSchema): "output": output, "outputSteps": outputSteps, } + output: MetaOapg.properties.output inputs: MetaOapg.properties.inputs caseId: MetaOapg.properties.caseId - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["id"] - ) -> MetaOapg.properties.id: ... + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["caseId"] - ) -> MetaOapg.properties.caseId: ... + def __getitem__(self, name: typing_extensions.Literal["caseId"]) -> MetaOapg.properties.caseId: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["inputs"] - ) -> MetaOapg.properties.inputs: ... + def __getitem__(self, name: typing_extensions.Literal["inputs"]) -> MetaOapg.properties.inputs: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["output"] - ) -> MetaOapg.properties.output: ... + def __getitem__(self, name: typing_extensions.Literal["output"]) -> MetaOapg.properties.output: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["outputSteps"] - ) -> MetaOapg.properties.outputSteps: ... + def __getitem__(self, name: typing_extensions.Literal["outputSteps"]) -> MetaOapg.properties.outputSteps: ... + @typing.overload - def __getitem__( - self, name: str - ) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "caseId", - "inputs", - "output", - "outputSteps", - ], - str, - ], - ): + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "caseId", "inputs", "output", "outputSteps", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["id"] - ) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["caseId"] - ) -> MetaOapg.properties.caseId: ... + def get_item_oapg(self, name: typing_extensions.Literal["caseId"]) -> MetaOapg.properties.caseId: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["inputs"] - ) -> MetaOapg.properties.inputs: ... + def get_item_oapg(self, name: typing_extensions.Literal["inputs"]) -> MetaOapg.properties.inputs: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["output"] - ) -> MetaOapg.properties.output: ... + def get_item_oapg(self, name: typing_extensions.Literal["output"]) -> MetaOapg.properties.output: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["outputSteps"] - ) -> typing.Union[ - MetaOapg.properties.outputSteps, schemas.Unset - ]: ... + def get_item_oapg(self, name: typing_extensions.Literal["outputSteps"]) -> typing.Union[MetaOapg.properties.outputSteps, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[ - schemas.UnsetAnyTypeSchema, schemas.Unset - ]: ... - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "id", - "caseId", - "inputs", - "output", - "outputSteps", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "caseId", "inputs", "output", "outputSteps", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - output: typing.Union[ - MetaOapg.properties.output, - str, - ], - inputs: typing.Union[ - MetaOapg.properties.inputs, - dict, - frozendict.frozendict, - ], - caseId: typing.Union[ - MetaOapg.properties.caseId, - str, - uuid.UUID, - ], - id: typing.Union[ - MetaOapg.properties.id, - None, - str, - uuid.UUID, - schemas.Unset, - ] = schemas.unset, - outputSteps: typing.Union[ - MetaOapg.properties.outputSteps, - list, - tuple, - None, - schemas.Unset, - ] = schemas.unset, - _configuration: typing.Optional[ - schemas.Configuration - ] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "items": + *_args: typing.Union[dict, frozendict.frozendict, ], + output: typing.Union[MetaOapg.properties.output, str, ], + inputs: typing.Union[MetaOapg.properties.inputs, dict, frozendict.frozendict, ], + caseId: typing.Union[MetaOapg.properties.caseId, str, uuid.UUID, ], + id: typing.Union[MetaOapg.properties.id, None, str, uuid.UUID, schemas.Unset] = schemas.unset, + outputSteps: typing.Union[MetaOapg.properties.outputSteps, list, tuple, None, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'items': return super().__new__( cls, *_args, @@ -540,31 +397,18 @@ class SchemaForRequestBodyApplicationJson(schemas.DictSchema): _configuration=_configuration, **kwargs, ) + def __new__( cls, - _arg: typing.Union[ - typing.Tuple[ - typing.Union[ - MetaOapg.items, - dict, - frozendict.frozendict, - ] - ], - typing.List[ - typing.Union[ - MetaOapg.items, - dict, - frozendict.frozendict, - ] - ], - ], + _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, ]]], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> "testResults": + ) -> 'testResults': return super().__new__( cls, _arg, _configuration=_configuration, ) + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) __annotations__ = { @@ -574,127 +418,66 @@ class SchemaForRequestBodyApplicationJson(schemas.DictSchema): "name": name, "testResults": testResults, } + testResults: MetaOapg.properties.testResults setId: MetaOapg.properties.setId - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["setId"] - ) -> MetaOapg.properties.setId: ... + def __getitem__(self, name: typing_extensions.Literal["setId"]) -> MetaOapg.properties.setId: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["branch"] - ) -> MetaOapg.properties.branch: ... + def __getitem__(self, name: typing_extensions.Literal["branch"]) -> MetaOapg.properties.branch: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["commit"] - ) -> MetaOapg.properties.commit: ... + def __getitem__(self, name: typing_extensions.Literal["commit"]) -> MetaOapg.properties.commit: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["name"] - ) -> MetaOapg.properties.name: ... + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["testResults"] - ) -> MetaOapg.properties.testResults: ... + def __getitem__(self, name: typing_extensions.Literal["testResults"]) -> MetaOapg.properties.testResults: ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__( - self, - name: typing.Union[ - typing_extensions.Literal[ - "setId", - "branch", - "commit", - "name", - "testResults", - ], - str, - ], - ): + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["setId", "branch", "commit", "name", "testResults", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["setId"] - ) -> MetaOapg.properties.setId: ... + def get_item_oapg(self, name: typing_extensions.Literal["setId"]) -> MetaOapg.properties.setId: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["branch"] - ) -> typing.Union[MetaOapg.properties.branch, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["branch"]) -> typing.Union[MetaOapg.properties.branch, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["commit"] - ) -> typing.Union[MetaOapg.properties.commit, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["commit"]) -> typing.Union[MetaOapg.properties.commit, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["name"] - ) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["testResults"] - ) -> MetaOapg.properties.testResults: ... + def get_item_oapg(self, name: typing_extensions.Literal["testResults"]) -> MetaOapg.properties.testResults: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg( - self, - name: typing.Union[ - typing_extensions.Literal[ - "setId", - "branch", - "commit", - "name", - "testResults", - ], - str, - ], - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["setId", "branch", "commit", "name", "testResults", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - testResults: typing.Union[ - MetaOapg.properties.testResults, - list, - tuple, - ], - setId: typing.Union[ - MetaOapg.properties.setId, - str, - uuid.UUID, - ], - branch: typing.Union[ - MetaOapg.properties.branch, None, str, schemas.Unset - ] = schemas.unset, - commit: typing.Union[ - MetaOapg.properties.commit, None, str, schemas.Unset - ] = schemas.unset, - name: typing.Union[ - MetaOapg.properties.name, None, str, schemas.Unset - ] = schemas.unset, + *_args: typing.Union[dict, frozendict.frozendict, ], + testResults: typing.Union[MetaOapg.properties.testResults, list, tuple, ], + setId: typing.Union[MetaOapg.properties.setId, str, uuid.UUID, ], + branch: typing.Union[MetaOapg.properties.branch, None, str, schemas.Unset] = schemas.unset, + commit: typing.Union[MetaOapg.properties.commit, None, str, schemas.Unset] = schemas.unset, + name: typing.Union[MetaOapg.properties.name, None, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "SchemaForRequestBodyApplicationJson": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SchemaForRequestBodyApplicationJson': return super().__new__( cls, *_args, @@ -707,78 +490,62 @@ class SchemaForRequestBodyApplicationJson(schemas.DictSchema): **kwargs, ) + request_body_any_type = api_client.RequestBody( content={ - "application/json": api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson - ), + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), }, required=True, ) -class SchemaFor200ResponseBodyApplicationJson(schemas.DictSchema): + +class SchemaFor200ResponseBodyApplicationJson( + schemas.DictSchema +): + + class MetaOapg: required = { "runId", } - + class properties: runId = schemas.UUIDSchema __annotations__ = { "runId": runId, } + runId: MetaOapg.properties.runId - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["runId"] - ) -> MetaOapg.properties.runId: ... + def __getitem__(self, name: typing_extensions.Literal["runId"]) -> MetaOapg.properties.runId: ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__(self, name: typing.Union[typing_extensions.Literal["runId",], str]): + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["runId", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["runId"] - ) -> MetaOapg.properties.runId: ... + def get_item_oapg(self, name: typing_extensions.Literal["runId"]) -> MetaOapg.properties.runId: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg( - self, name: typing.Union[typing_extensions.Literal["runId",], str] - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["runId", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - runId: typing.Union[ - MetaOapg.properties.runId, - str, - uuid.UUID, - ], + *_args: typing.Union[dict, frozendict.frozendict, ], + runId: typing.Union[MetaOapg.properties.runId, str, uuid.UUID, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "SchemaFor200ResponseBodyApplicationJson": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( cls, *_args, @@ -787,69 +554,53 @@ class SchemaFor200ResponseBodyApplicationJson(schemas.DictSchema): **kwargs, ) -class SchemaFor200ResponseBodyApplicationJsonCharsetutf8(schemas.DictSchema): + +class SchemaFor200ResponseBodyApplicationJsonCharsetutf8( + schemas.DictSchema +): + + class MetaOapg: required = { "runId", } - + class properties: runId = schemas.UUIDSchema __annotations__ = { "runId": runId, } + runId: MetaOapg.properties.runId - + @typing.overload - def __getitem__( - self, name: typing_extensions.Literal["runId"] - ) -> MetaOapg.properties.runId: ... + def __getitem__(self, name: typing_extensions.Literal["runId"]) -> MetaOapg.properties.runId: ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__(self, name: typing.Union[typing_extensions.Literal["runId",], str]): + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["runId", ], str]): # dict_instance[name] accessor return super().__getitem__(name) + + @typing.overload - def get_item_oapg( - self, name: typing_extensions.Literal["runId"] - ) -> MetaOapg.properties.runId: ... + def get_item_oapg(self, name: typing_extensions.Literal["runId"]) -> MetaOapg.properties.runId: ... + @typing.overload - def get_item_oapg( - self, name: str - ) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg( - self, name: typing.Union[typing_extensions.Literal["runId",], str] - ): + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["runId", ], str]): return super().get_item_oapg(name) + + def __new__( cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - ], - runId: typing.Union[ - MetaOapg.properties.runId, - str, - uuid.UUID, - ], + *_args: typing.Union[dict, frozendict.frozendict, ], + runId: typing.Union[MetaOapg.properties.runId, str, uuid.UUID, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[ - schemas.AnyTypeSchema, - dict, - frozendict.frozendict, - str, - date, - datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - None, - list, - tuple, - bytes, - ], - ) -> "SchemaFor200ResponseBodyApplicationJsonCharsetutf8": + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SchemaFor200ResponseBodyApplicationJsonCharsetutf8': return super().__new__( cls, *_args, @@ -858,6 +609,7 @@ class SchemaFor200ResponseBodyApplicationJsonCharsetutf8(schemas.DictSchema): **kwargs, ) + @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse @@ -867,73 +619,65 @@ class ApiResponseFor200(api_client.ApiResponse): ] headers: schemas.Unset = schemas.unset + _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, content={ - "application/json": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson - ), - "application/json; charset=utf-8": api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8 - ), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + 'application/json; charset=utf-8': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8), }, ) _all_accept_content_types = ( - "application/json", - "application/json; charset=utf-8", + 'application/json', + 'application/json; charset=utf-8', ) + class BaseApi(api_client.Api): @typing.overload def _test_run_post_oapg( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def _test_run_post_oapg( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload def _test_run_post_oapg( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload def _test_run_post_oapg( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -943,14 +687,11 @@ class BaseApi(api_client.Api): ApiResponseFor200, api_client.ApiResponseWithoutDeserialization, ]: ... + def _test_run_post_oapg( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], - content_type: str = "application/json", + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], + content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -968,23 +709,22 @@ class BaseApi(api_client.Api): # TODO add cookie handling if accept_content_types: for accept_content_type in accept_content_types: - _headers.add("Accept", accept_content_type) + _headers.add('Accept', accept_content_type) if body is schemas.unset: raise exceptions.ApiValueError( - "The required body parameter has an invalid value of: unset. Set a valid value instead" - ) + 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None serialized_data = request_body_any_type.serialize(body, content_type) - _headers.add("Content-Type", content_type) - if "fields" in serialized_data: - _fields = serialized_data["fields"] - elif "body" in serialized_data: - _body = serialized_data["body"] + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] response = self.api_client.call_api( resource_path=used_path, - method="post".upper(), + method='post'.upper(), headers=_headers, fields=_fields, body=_body, @@ -994,82 +734,69 @@ class BaseApi(api_client.Api): ) if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: response_for_status = _status_code_to_response.get(str(response.status)) if response_for_status: - api_response = response_for_status.deserialize( - response, self.api_client.configuration - ) + api_response = response_for_status.deserialize(response, self.api_client.configuration) else: - api_response = api_client.ApiResponseWithoutDeserialization( - response=response - ) + api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: raise exceptions.ApiException( status=response.status, reason=response.reason, - api_response=api_response, + api_response=api_response ) return api_response + class TestRunPost(BaseApi): # this class is used by api classes that refer to endpoints with operationId fn names @typing.overload def test_run_post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def test_run_post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload def test_run_post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload def test_run_post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -1079,14 +806,11 @@ class TestRunPost(BaseApi): ApiResponseFor200, api_client.ApiResponseWithoutDeserialization, ]: ... + def test_run_post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], - content_type: str = "application/json", + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], + content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -1098,62 +822,55 @@ class TestRunPost(BaseApi): accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) + class ApiForpost(BaseApi): # this class is used by api classes that refer to endpoints by path and http method names @typing.overload def post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + @typing.overload def post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ApiResponseFor200,]: ... + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload def post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload def post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -1163,14 +880,11 @@ class ApiForpost(BaseApi): ApiResponseFor200, api_client.ApiResponseWithoutDeserialization, ]: ... + def post( self, - body: typing.Union[ - SchemaForRequestBodyApplicationJson, - dict, - frozendict.frozendict, - ], - content_type: str = "application/json", + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], + content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -1182,5 +896,7 @@ class ApiForpost(BaseApi): accept_content_types=accept_content_types, stream=stream, timeout=timeout, - skip_deserialization=skip_deserialization, + skip_deserialization=skip_deserialization ) + + diff --git a/package/gentrace/providers/evaluation.py b/package/gentrace/providers/evaluation.py index d07cd0b4..1c0c2b04 100644 --- a/package/gentrace/providers/evaluation.py +++ b/package/gentrace/providers/evaluation.py @@ -166,9 +166,38 @@ def submit_test_results( return submit_prepared_test_results(set_id, test_results) +def get_test_sets( + label: Optional[str] = None, +) -> Run: + """ + Get test sets from the Gentrace API, optionally filtered by label. + + Args: + label (str, optional): The identifier of the test set. Defaults to None. + + Raises: + ValueError: If the Gentrace API key is not initialized. + + Returns: + Run: The array of test sets returned by the Gentrace API. + """ + api = GENTRACE_CONFIG_STATE["global_gentrace_api"] + if not api: + raise ValueError("Gentrace API key not initialized. Call init() first.") + + params = {"label": label} if label else {} + + response = api.test_sets_get(params) + + test_sets = response.body["testSets"] + + return test_sets + + __all__ = [ "get_test_cases", "submit_test_results", + "get_test_sets", "submit_prepared_test_results", "construct_submission_payload", "OutputStep", diff --git a/package/gentrace/rest.py b/package/gentrace/rest.py index 985ddf67..682ea177 100644 --- a/package/gentrace/rest.py +++ b/package/gentrace/rest.py @@ -24,6 +24,7 @@ class RESTClientObject(object): + def __init__(self, configuration, pools_size=4, maxsize=None): # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 @@ -46,15 +47,13 @@ def __init__(self, configuration, pools_size=4, maxsize=None): addition_pool_args = {} if configuration.assert_hostname is not None: - addition_pool_args[ - "assert_hostname" - ] = configuration.assert_hostname # noqa: E501 + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 if configuration.retries is not None: - addition_pool_args["retries"] = configuration.retries + addition_pool_args['retries'] = configuration.retries if configuration.socket_options is not None: - addition_pool_args["socket_options"] = configuration.socket_options + addition_pool_args['socket_options'] = configuration.socket_options if maxsize is None: if configuration.connection_pool_maxsize is not None: @@ -91,9 +90,7 @@ def request( method: str, url: str, headers: typing.Optional[HTTPHeaderDict] = None, - fields: typing.Optional[ - typing.Tuple[typing.Tuple[str, typing.Any], ...] - ] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, body: typing.Optional[typing.Union[str, bytes]] = None, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -116,10 +113,13 @@ 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 fields and body: - raise ApiValueError("body parameter cannot be used with fields parameter.") + raise ApiValueError( + "body parameter cannot be used with fields parameter." + ) fields = fields or {} headers = headers or {} @@ -127,60 +127,53 @@ def request( if timeout: if isinstance(timeout, (int, float)): # noqa: E501,F821 timeout = urllib3.Timeout(total=timeout) - elif isinstance(timeout, tuple) and len(timeout) == 2: + elif (isinstance(timeout, tuple) and + len(timeout) == 2): timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: - if "Content-Type" not in headers and body is None: + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if 'Content-Type' not in headers and body is None: r = self.pool_manager.request( method, url, preload_content=not stream, timeout=timeout, - headers=headers, + headers=headers ) - elif ( - headers["Content-Type"] == "application/x-www-form-urlencoded" - ): # noqa: E501 + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 r = self.pool_manager.request( - method, - url, + method, url, body=body, fields=fields, encode_multipart=False, preload_content=not stream, timeout=timeout, - headers=headers, - ) - elif headers["Content-Type"] == "multipart/form-data": + headers=headers) + elif headers['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'] r = self.pool_manager.request( - method, - url, + method, url, fields=fields, encode_multipart=True, preload_content=not stream, timeout=timeout, - headers=headers, - ) + headers=headers) # Pass a `string` parameter directly in the body to support # other content types than Json when `body` argument is # provided in serialized form elif isinstance(body, str) or isinstance(body, bytes): request_body = body r = self.pool_manager.request( - method, - url, + method, url, body=request_body, preload_content=not stream, timeout=timeout, - headers=headers, - ) + headers=headers) else: # Cannot generate the request from given parameters msg = """Cannot prepare a request message for provided @@ -189,13 +182,10 @@ def request( raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request( - method, - url, - preload_content=not stream, - timeout=timeout, - headers=headers, - ) + r = self.pool_manager.request(method, url, + preload_content=not stream, + timeout=timeout, + headers=headers) except urllib3.exceptions.SSLError as e: msg = "{0}\n{1}".format(type(e).__name__, str(e)) raise ApiException(status=0, reason=msg) @@ -206,81 +196,58 @@ def request( return r - def GET( - self, url, headers=None, stream=False, timeout=None, fields=None - ) -> urllib3.HTTPResponse: - return self.request( - "GET", url, headers=headers, stream=stream, timeout=timeout, fields=fields - ) - - def HEAD( - self, url, headers=None, stream=False, timeout=None, fields=None - ) -> urllib3.HTTPResponse: - return self.request( - "HEAD", url, headers=headers, stream=stream, timeout=timeout, fields=fields - ) - - def OPTIONS( - self, url, headers=None, body=None, stream=False, timeout=None, fields=None - ) -> urllib3.HTTPResponse: - return self.request( - "OPTIONS", - url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, - fields=fields, - ) - - def DELETE( - self, url, headers=None, body=None, stream=False, timeout=None, fields=None - ) -> urllib3.HTTPResponse: - return self.request( - "DELETE", - url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, - fields=fields, - ) - - def POST( - self, url, headers=None, body=None, stream=False, timeout=None, fields=None - ) -> urllib3.HTTPResponse: - return self.request( - "POST", - url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, - fields=fields, - ) - - def PUT( - self, url, headers=None, body=None, stream=False, timeout=None, fields=None - ) -> urllib3.HTTPResponse: - return self.request( - "PUT", - url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, - fields=fields, - ) - - def PATCH( - self, url, headers=None, body=None, stream=False, timeout=None, fields=None - ) -> urllib3.HTTPResponse: - return self.request( - "PATCH", - url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, - fields=fields, - ) + def GET(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("GET", url, + headers=headers, + stream=stream, + timeout=timeout, + fields=fields) + + def HEAD(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("HEAD", url, + headers=headers, + stream=stream, + timeout=timeout, + fields=fields) + + def OPTIONS(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("OPTIONS", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def DELETE(self, url, headers=None, body=None, + stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("DELETE", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def POST(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("POST", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def PUT(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PUT", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def PATCH(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PATCH", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) diff --git a/package/gentrace/schemas.py b/package/gentrace/schemas.py index 6acacb55..147a02e7 100644 --- a/package/gentrace/schemas.py +++ b/package/gentrace/schemas.py @@ -36,10 +36,8 @@ class Unset(object): An instance of this class is set as the default value for object type(dict) properties that are optional When a property has an unset value, that property will not be assigned in the dict """ - pass - unset = Unset() none_type = type(None) @@ -55,14 +53,12 @@ class FileIO(io.FileIO): def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader]): if isinstance(_arg, (io.FileIO, io.BufferedReader)): if _arg.closed: - raise ApiValueError( - "Invalid file state; file is closed and must be open" - ) + raise ApiValueError('Invalid file state; file is closed and must be open') _arg.close() inst = super(FileIO, cls).__new__(cls, _arg.name) super(FileIO, inst).__init__(_arg.name) return inst - raise ApiValueError("FileIO must be passed _arg which contains the open file") + raise ApiValueError('FileIO must be passed _arg which contains the open file') def __init__(self, _arg: typing.Union[io.FileIO, io.BufferedReader]): pass @@ -86,16 +82,13 @@ class ValidationMetadata(frozendict.frozendict): """ A class storing metadata that is needed to validate OpenApi Schema payloads """ - def __new__( cls, - path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(["args[0]"]), + path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), from_server: bool = False, configuration: typing.Optional[Configuration] = None, seen_classes: typing.FrozenSet[typing.Type] = frozenset(), - validated_path_to_schemas: typing.Dict[ - typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type] - ] = frozendict.frozendict(), + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict.frozendict() ): """ Args: @@ -122,7 +115,7 @@ def __new__( from_server=from_server, configuration=configuration, seen_classes=seen_classes, - validated_path_to_schemas=validated_path_to_schemas, + validated_path_to_schemas=validated_path_to_schemas ) def validation_ran_earlier(self, cls: type) -> bool: @@ -136,41 +129,33 @@ def validation_ran_earlier(self, cls: type) -> bool: @property def path_to_item(self) -> typing.Tuple[typing.Union[str, int], ...]: - return self.get("path_to_item") + return self.get('path_to_item') @property def from_server(self) -> bool: - return self.get("from_server") + return self.get('from_server') @property def configuration(self) -> typing.Optional[Configuration]: - return self.get("configuration") + return self.get('configuration') @property def seen_classes(self) -> typing.FrozenSet[typing.Type]: - return self.get("seen_classes") + return self.get('seen_classes') @property - def validated_path_to_schemas( - self, - ) -> typing.Dict[ - typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type] - ]: - return self.get("validated_path_to_schemas") + def validated_path_to_schemas(self) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]]: + return self.get('validated_path_to_schemas') -def add_deeper_validated_schemas( - validation_metadata: ValidationMetadata, path_to_schemas: dict -): +def add_deeper_validated_schemas(validation_metadata: ValidationMetadata, path_to_schemas: dict): # this is called if validation_ran_earlier and current and deeper locations need to be added current_path_to_item = validation_metadata.path_to_item other_path_to_schemas = {} for path_to_item, schemas in validation_metadata.validated_path_to_schemas.items(): if len(path_to_item) < len(current_path_to_item): continue - path_begins_with_current_path = ( - path_to_item[: len(current_path_to_item)] == current_path_to_item - ) + path_begins_with_current_path = path_to_item[:len(current_path_to_item)] == current_path_to_item if path_begins_with_current_path: other_path_to_schemas[path_to_item] = schemas update(path_to_schemas, other_path_to_schemas) @@ -181,7 +166,6 @@ class Singleton: Enums and singletons are the same The same instance is returned for a given key of (cls, _arg) """ - _instances = {} def __new__(cls, _arg: typing.Any, **kwargs): @@ -205,15 +189,16 @@ def __new__(cls, _arg: typing.Any, **kwargs): def __repr__(self): if isinstance(self, NoneClass): - return f"<{self.__class__.__name__}: None>" + return f'<{self.__class__.__name__}: None>' elif isinstance(self, BoolClass): if bool(self): - return f"<{self.__class__.__name__}: True>" - return f"<{self.__class__.__name__}: False>" - return f"<{self.__class__.__name__}: {super().__repr__()}>" + return f'<{self.__class__.__name__}: True>' + return f'<{self.__class__.__name__}: False>' + return f'<{self.__class__.__name__}: {super().__repr__()}>' class classproperty: + def __init__(self, fget): self.fget = fget @@ -244,7 +229,7 @@ def __bool__(self) -> bool: for key, instance in self._instances.items(): if self is instance: return bool(key[1]) - raise ValueError("Unable to find the boolean value of this instance") + raise ValueError('Unable to find the boolean value of this instance') class MetaOapgTyped: @@ -254,39 +239,30 @@ class MetaOapgTyped: inclusive_minimum: typing.Union[int, float] max_items: int min_items: int - discriminator: typing.Dict[str, typing.Dict[str, typing.Type["Schema"]]] + discriminator: typing.Dict[str, typing.Dict[str, typing.Type['Schema']]] + class properties: # to hold object properties pass - additional_properties: typing.Optional[typing.Type["Schema"]] + additional_properties: typing.Optional[typing.Type['Schema']] max_properties: int min_properties: int - all_of: typing.List[typing.Type["Schema"]] - one_of: typing.List[typing.Type["Schema"]] - any_of: typing.List[typing.Type["Schema"]] - not_schema: typing.Type["Schema"] + all_of: typing.List[typing.Type['Schema']] + one_of: typing.List[typing.Type['Schema']] + any_of: typing.List[typing.Type['Schema']] + not_schema: typing.Type['Schema'] max_length: int min_length: int - items: typing.Type["Schema"] + items: typing.Type['Schema'] class Schema: """ the base class of all swagger/openapi schemas/models """ - - __inheritable_primitive_types_set = { - decimal.Decimal, - str, - tuple, - frozendict.frozendict, - FileIO, - bytes, - BoolClass, - NoneClass, - } + __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict.frozendict, FileIO, bytes, BoolClass, NoneClass} _types: typing.Set[typing.Type] MetaOapg = MetaOapgTyped @@ -301,9 +277,7 @@ def __get_valid_classes_phrase(input_classes): return "is one of [{0}]".format(", ".join(all_class_names)) @staticmethod - def _get_class_oapg( - item_cls: typing.Union[types.FunctionType, staticmethod, typing.Type["Schema"]] - ) -> typing.Type["Schema"]: + def _get_class_oapg(item_cls: typing.Union[types.FunctionType, staticmethod, typing.Type['Schema']]) -> typing.Type['Schema']: if isinstance(item_cls, types.FunctionType): # referenced schema return item_cls() @@ -358,20 +332,7 @@ def _validate_oapg( cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[ - typing.Tuple[typing.Union[str, int], ...], - typing.Set[ - typing.Union[ - "Schema", - str, - decimal.Decimal, - BoolClass, - NoneClass, - frozendict.frozendict, - tuple, - ] - ], - ]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ Schema _validate_oapg All keyword validation except for type checking was done in calling stack frames @@ -400,17 +361,7 @@ def _validate_oapg( @staticmethod def _process_schema_classes_oapg( - schema_classes: typing.Set[ - typing.Union[ - "Schema", - str, - decimal.Decimal, - BoolClass, - NoneClass, - frozendict.frozendict, - tuple, - ] - ] + schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]] ): """ Processes and mutates schema_classes @@ -430,8 +381,10 @@ def _process_schema_classes_oapg( @classmethod def __get_new_cls( - cls, arg, validation_metadata: ValidationMetadata - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type["Schema"]]: + cls, + arg, + validation_metadata: ValidationMetadata + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']]: """ Make a new dynamic class and return an instance of that class We are making an instance of cls, but instead of making cls @@ -455,9 +408,7 @@ def __get_new_cls( if validation_metadata.validation_ran_earlier(cls): add_deeper_validated_schemas(validation_metadata, _path_to_schemas) else: - other_path_to_schemas = cls._validate_oapg( - arg, validation_metadata=validation_metadata - ) + other_path_to_schemas = cls._validate_oapg(arg, validation_metadata=validation_metadata) update(_path_to_schemas, other_path_to_schemas) # loop through it make a new class for each entry # do not modify the returned result because it is cached and we would be modifying the cached value @@ -473,21 +424,15 @@ def __get_new_cls( """ cls._process_schema_classes_oapg(schema_classes) enum_schema = any( - issubclass(this_cls, EnumBase) for this_cls in schema_classes - ) - inheritable_primitive_type = schema_classes.intersection( - cls.__inheritable_primitive_types_set - ) + issubclass(this_cls, EnumBase) for this_cls in schema_classes) + inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set) chosen_schema_classes = schema_classes - inheritable_primitive_type suffix = tuple(inheritable_primitive_type) if enum_schema and suffix[0] not in {NoneClass, BoolClass}: suffix = (Singleton,) + suffix - used_classes = ( - tuple(sorted(chosen_schema_classes, key=lambda a_cls: a_cls.__name__)) - + suffix - ) - mfg_cls = get_new_class(class_name="DynamicSchema", bases=used_classes) + used_classes = tuple(sorted(chosen_schema_classes, key=lambda a_cls: a_cls.__name__)) + suffix + mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) path_to_schemas[path] = mfg_cls return path_to_schemas @@ -497,9 +442,7 @@ def _get_new_instance_without_conversion_oapg( cls, arg: typing.Any, path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[ - typing.Tuple[typing.Union[str, int], ...], typing.Type["Schema"] - ], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] ): # We have a Dynamic class and we are making an instance of it if issubclass(cls, frozendict.frozendict) and issubclass(cls, DictBase): @@ -528,16 +471,16 @@ def from_openapi_data_oapg( decimal.Decimal, bool, None, - "Schema", + 'Schema', dict, frozendict.frozendict, tuple, list, io.FileIO, io.BufferedReader, - bytes, + bytes ], - _configuration: typing.Optional[Configuration], + _configuration: typing.Optional[Configuration] ): """ Schema from_openapi_data_oapg @@ -546,14 +489,13 @@ def from_openapi_data_oapg( validated_path_to_schemas = {} arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas) validation_metadata = ValidationMetadata( - from_server=from_server, - configuration=_configuration, - validated_path_to_schemas=validated_path_to_schemas, - ) + from_server=from_server, configuration=_configuration, validated_path_to_schemas=validated_path_to_schemas) path_to_schemas = cls.__get_new_cls(arg, validation_metadata) new_cls = path_to_schemas[validation_metadata.path_to_item] new_inst = new_cls._get_new_instance_without_conversion_oapg( - arg, validation_metadata.path_to_item, path_to_schemas + arg, + validation_metadata.path_to_item, + path_to_schemas ) return new_inst @@ -570,41 +512,7 @@ def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: def __remove_unsets(kwargs): return {key: val for key, val in kwargs.items() if val is not unset} - def __new__( - cls, - *_args: typing.Union[ - dict, - frozendict.frozendict, - list, - tuple, - decimal.Decimal, - float, - int, - str, - date, - datetime, - bool, - None, - "Schema", - ], - _configuration: typing.Optional[Configuration] = None, - **kwargs: typing.Union[ - dict, - frozendict.frozendict, - list, - tuple, - decimal.Decimal, - float, - int, - str, - date, - datetime, - bool, - None, - "Schema", - Unset, - ], - ): + def __new__(cls, *_args: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): """ Schema __new__ @@ -619,59 +527,35 @@ def __new__( """ __kwargs = cls.__remove_unsets(kwargs) if not _args and not __kwargs: - raise TypeError("No input given. args or kwargs must be given.") + raise TypeError( + 'No input given. args or kwargs must be given.' + ) if not __kwargs and _args and not isinstance(_args[0], dict): __arg = _args[0] else: __arg = cls.__get_input_dict(*_args, **__kwargs) __from_server = False __validated_path_to_schemas = {} - __arg = cast_to_allowed_types(__arg, __from_server, __validated_path_to_schemas) + __arg = cast_to_allowed_types( + __arg, __from_server, __validated_path_to_schemas) __validation_metadata = ValidationMetadata( - configuration=_configuration, - from_server=__from_server, - validated_path_to_schemas=__validated_path_to_schemas, - ) + configuration=_configuration, from_server=__from_server, validated_path_to_schemas=__validated_path_to_schemas) __path_to_schemas = cls.__get_new_cls(__arg, __validation_metadata) __new_cls = __path_to_schemas[__validation_metadata.path_to_item] return __new_cls._get_new_instance_without_conversion_oapg( - __arg, __validation_metadata.path_to_item, __path_to_schemas + __arg, + __validation_metadata.path_to_item, + __path_to_schemas ) def __init__( self, *_args: typing.Union[ - dict, - frozendict.frozendict, - list, - tuple, - decimal.Decimal, - float, - int, - str, - date, - datetime, - bool, - None, - "Schema", - ], + dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[ - dict, - frozendict.frozendict, - list, - tuple, - decimal.Decimal, - float, - int, - str, - date, - datetime, - bool, - None, - "Schema", - Unset, - ], + dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset + ] ): """ this is needed to fix 'Unexpected argument' warning in pycharm @@ -681,7 +565,6 @@ def __init__( """ pass - """ import itertools data_types = ('None', 'FrozenDict', 'Tuple', 'Str', 'Decimal', 'Bool') @@ -711,451 +594,272 @@ def __init__( BoolMixin = BoolClass BytesMixin = bytes FileMixin = FileIO - # qty 2 class BinaryMixin(bytes, FileIO): pass - class NoneFrozenDictMixin(NoneClass, frozendict.frozendict): pass - class NoneTupleMixin(NoneClass, tuple): pass - class NoneStrMixin(NoneClass, str): pass - class NoneDecimalMixin(NoneClass, decimal.Decimal): pass - class NoneBoolMixin(NoneClass, BoolClass): pass - class FrozenDictTupleMixin(frozendict.frozendict, tuple): pass - class FrozenDictStrMixin(frozendict.frozendict, str): pass - class FrozenDictDecimalMixin(frozendict.frozendict, decimal.Decimal): pass - class FrozenDictBoolMixin(frozendict.frozendict, BoolClass): pass - class TupleStrMixin(tuple, str): pass - class TupleDecimalMixin(tuple, decimal.Decimal): pass - class TupleBoolMixin(tuple, BoolClass): pass - class StrDecimalMixin(str, decimal.Decimal): pass - class StrBoolMixin(str, BoolClass): pass - class DecimalBoolMixin(decimal.Decimal, BoolClass): pass - # qty 3 class NoneFrozenDictTupleMixin(NoneClass, frozendict.frozendict, tuple): pass - class NoneFrozenDictStrMixin(NoneClass, frozendict.frozendict, str): pass - class NoneFrozenDictDecimalMixin(NoneClass, frozendict.frozendict, decimal.Decimal): pass - class NoneFrozenDictBoolMixin(NoneClass, frozendict.frozendict, BoolClass): pass - class NoneTupleStrMixin(NoneClass, tuple, str): pass - class NoneTupleDecimalMixin(NoneClass, tuple, decimal.Decimal): pass - class NoneTupleBoolMixin(NoneClass, tuple, BoolClass): pass - class NoneStrDecimalMixin(NoneClass, str, decimal.Decimal): pass - class NoneStrBoolMixin(NoneClass, str, BoolClass): pass - class NoneDecimalBoolMixin(NoneClass, decimal.Decimal, BoolClass): pass - class FrozenDictTupleStrMixin(frozendict.frozendict, tuple, str): pass - class FrozenDictTupleDecimalMixin(frozendict.frozendict, tuple, decimal.Decimal): pass - class FrozenDictTupleBoolMixin(frozendict.frozendict, tuple, BoolClass): pass - class FrozenDictStrDecimalMixin(frozendict.frozendict, str, decimal.Decimal): pass - class FrozenDictStrBoolMixin(frozendict.frozendict, str, BoolClass): pass - class FrozenDictDecimalBoolMixin(frozendict.frozendict, decimal.Decimal, BoolClass): pass - class TupleStrDecimalMixin(tuple, str, decimal.Decimal): pass - class TupleStrBoolMixin(tuple, str, BoolClass): pass - class TupleDecimalBoolMixin(tuple, decimal.Decimal, BoolClass): pass - class StrDecimalBoolMixin(str, decimal.Decimal, BoolClass): pass - # qty 4 class NoneFrozenDictTupleStrMixin(NoneClass, frozendict.frozendict, tuple, str): pass - - class NoneFrozenDictTupleDecimalMixin( - NoneClass, frozendict.frozendict, tuple, decimal.Decimal - ): + class NoneFrozenDictTupleDecimalMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal): pass - - class NoneFrozenDictTupleBoolMixin( - NoneClass, frozendict.frozendict, tuple, BoolClass - ): + class NoneFrozenDictTupleBoolMixin(NoneClass, frozendict.frozendict, tuple, BoolClass): pass - - class NoneFrozenDictStrDecimalMixin( - NoneClass, frozendict.frozendict, str, decimal.Decimal - ): + class NoneFrozenDictStrDecimalMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal): pass - class NoneFrozenDictStrBoolMixin(NoneClass, frozendict.frozendict, str, BoolClass): pass - - class NoneFrozenDictDecimalBoolMixin( - NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass - ): + class NoneFrozenDictDecimalBoolMixin(NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass): pass - class NoneTupleStrDecimalMixin(NoneClass, tuple, str, decimal.Decimal): pass - class NoneTupleStrBoolMixin(NoneClass, tuple, str, BoolClass): pass - class NoneTupleDecimalBoolMixin(NoneClass, tuple, decimal.Decimal, BoolClass): pass - class NoneStrDecimalBoolMixin(NoneClass, str, decimal.Decimal, BoolClass): pass - - class FrozenDictTupleStrDecimalMixin( - frozendict.frozendict, tuple, str, decimal.Decimal - ): + class FrozenDictTupleStrDecimalMixin(frozendict.frozendict, tuple, str, decimal.Decimal): pass - class FrozenDictTupleStrBoolMixin(frozendict.frozendict, tuple, str, BoolClass): pass - - class FrozenDictTupleDecimalBoolMixin( - frozendict.frozendict, tuple, decimal.Decimal, BoolClass - ): + class FrozenDictTupleDecimalBoolMixin(frozendict.frozendict, tuple, decimal.Decimal, BoolClass): pass - - class FrozenDictStrDecimalBoolMixin( - frozendict.frozendict, str, decimal.Decimal, BoolClass - ): + class FrozenDictStrDecimalBoolMixin(frozendict.frozendict, str, decimal.Decimal, BoolClass): pass - class TupleStrDecimalBoolMixin(tuple, str, decimal.Decimal, BoolClass): pass - # qty 5 - class NoneFrozenDictTupleStrDecimalMixin( - NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal - ): + class NoneFrozenDictTupleStrDecimalMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal): pass - - class NoneFrozenDictTupleStrBoolMixin( - NoneClass, frozendict.frozendict, tuple, str, BoolClass - ): + class NoneFrozenDictTupleStrBoolMixin(NoneClass, frozendict.frozendict, tuple, str, BoolClass): pass - - class NoneFrozenDictTupleDecimalBoolMixin( - NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass - ): + class NoneFrozenDictTupleDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass): pass - - class NoneFrozenDictStrDecimalBoolMixin( - NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass - ): + class NoneFrozenDictStrDecimalBoolMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass): pass - - class NoneTupleStrDecimalBoolMixin( - NoneClass, tuple, str, decimal.Decimal, BoolClass - ): + class NoneTupleStrDecimalBoolMixin(NoneClass, tuple, str, decimal.Decimal, BoolClass): pass - - class FrozenDictTupleStrDecimalBoolMixin( - frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass - ): + class FrozenDictTupleStrDecimalBoolMixin(frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): pass - # qty 6 - class NoneFrozenDictTupleStrDecimalBoolMixin( - NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass - ): + class NoneFrozenDictTupleStrDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): pass - # qty 8 - class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin( - NoneClass, - frozendict.frozendict, - tuple, - str, - decimal.Decimal, - BoolClass, - FileIO, - bytes, - ): + class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes): pass - else: # qty 1 class NoneMixin: _types = {NoneClass} - class FrozenDictMixin: _types = {frozendict.frozendict} - class TupleMixin: _types = {tuple} - class StrMixin: _types = {str} - class DecimalMixin: _types = {decimal.Decimal} - class BoolMixin: _types = {BoolClass} - class BytesMixin: _types = {bytes} - class FileMixin: _types = {FileIO} - # qty 2 class BinaryMixin: _types = {bytes, FileIO} - class NoneFrozenDictMixin: _types = {NoneClass, frozendict.frozendict} - class NoneTupleMixin: _types = {NoneClass, tuple} - class NoneStrMixin: _types = {NoneClass, str} - class NoneDecimalMixin: _types = {NoneClass, decimal.Decimal} - class NoneBoolMixin: _types = {NoneClass, BoolClass} - class FrozenDictTupleMixin: _types = {frozendict.frozendict, tuple} - class FrozenDictStrMixin: _types = {frozendict.frozendict, str} - class FrozenDictDecimalMixin: _types = {frozendict.frozendict, decimal.Decimal} - class FrozenDictBoolMixin: _types = {frozendict.frozendict, BoolClass} - class TupleStrMixin: _types = {tuple, str} - class TupleDecimalMixin: _types = {tuple, decimal.Decimal} - class TupleBoolMixin: _types = {tuple, BoolClass} - class StrDecimalMixin: _types = {str, decimal.Decimal} - class StrBoolMixin: _types = {str, BoolClass} - class DecimalBoolMixin: _types = {decimal.Decimal, BoolClass} - # qty 3 class NoneFrozenDictTupleMixin: _types = {NoneClass, frozendict.frozendict, tuple} - class NoneFrozenDictStrMixin: _types = {NoneClass, frozendict.frozendict, str} - class NoneFrozenDictDecimalMixin: _types = {NoneClass, frozendict.frozendict, decimal.Decimal} - class NoneFrozenDictBoolMixin: _types = {NoneClass, frozendict.frozendict, BoolClass} - class NoneTupleStrMixin: _types = {NoneClass, tuple, str} - class NoneTupleDecimalMixin: _types = {NoneClass, tuple, decimal.Decimal} - class NoneTupleBoolMixin: _types = {NoneClass, tuple, BoolClass} - class NoneStrDecimalMixin: _types = {NoneClass, str, decimal.Decimal} - class NoneStrBoolMixin: _types = {NoneClass, str, BoolClass} - class NoneDecimalBoolMixin: _types = {NoneClass, decimal.Decimal, BoolClass} - class FrozenDictTupleStrMixin: _types = {frozendict.frozendict, tuple, str} - class FrozenDictTupleDecimalMixin: _types = {frozendict.frozendict, tuple, decimal.Decimal} - class FrozenDictTupleBoolMixin: _types = {frozendict.frozendict, tuple, BoolClass} - class FrozenDictStrDecimalMixin: _types = {frozendict.frozendict, str, decimal.Decimal} - class FrozenDictStrBoolMixin: _types = {frozendict.frozendict, str, BoolClass} - class FrozenDictDecimalBoolMixin: _types = {frozendict.frozendict, decimal.Decimal, BoolClass} - class TupleStrDecimalMixin: _types = {tuple, str, decimal.Decimal} - class TupleStrBoolMixin: _types = {tuple, str, BoolClass} - class TupleDecimalBoolMixin: _types = {tuple, decimal.Decimal, BoolClass} - class StrDecimalBoolMixin: _types = {str, decimal.Decimal, BoolClass} - # qty 4 class NoneFrozenDictTupleStrMixin: _types = {NoneClass, frozendict.frozendict, tuple, str} - class NoneFrozenDictTupleDecimalMixin: _types = {NoneClass, frozendict.frozendict, tuple, decimal.Decimal} - class NoneFrozenDictTupleBoolMixin: _types = {NoneClass, frozendict.frozendict, tuple, BoolClass} - class NoneFrozenDictStrDecimalMixin: _types = {NoneClass, frozendict.frozendict, str, decimal.Decimal} - class NoneFrozenDictStrBoolMixin: _types = {NoneClass, frozendict.frozendict, str, BoolClass} - class NoneFrozenDictDecimalBoolMixin: _types = {NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass} - class NoneTupleStrDecimalMixin: _types = {NoneClass, tuple, str, decimal.Decimal} - class NoneTupleStrBoolMixin: _types = {NoneClass, tuple, str, BoolClass} - class NoneTupleDecimalBoolMixin: _types = {NoneClass, tuple, decimal.Decimal, BoolClass} - class NoneStrDecimalBoolMixin: _types = {NoneClass, str, decimal.Decimal, BoolClass} - class FrozenDictTupleStrDecimalMixin: _types = {frozendict.frozendict, tuple, str, decimal.Decimal} - class FrozenDictTupleStrBoolMixin: _types = {frozendict.frozendict, tuple, str, BoolClass} - class FrozenDictTupleDecimalBoolMixin: _types = {frozendict.frozendict, tuple, decimal.Decimal, BoolClass} - class FrozenDictStrDecimalBoolMixin: _types = {frozendict.frozendict, str, decimal.Decimal, BoolClass} - class TupleStrDecimalBoolMixin: _types = {tuple, str, decimal.Decimal, BoolClass} - # qty 5 class NoneFrozenDictTupleStrDecimalMixin: _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal} - class NoneFrozenDictTupleStrBoolMixin: _types = {NoneClass, frozendict.frozendict, tuple, str, BoolClass} - class NoneFrozenDictTupleDecimalBoolMixin: _types = {NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass} - class NoneFrozenDictStrDecimalBoolMixin: _types = {NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass} - class NoneTupleStrDecimalBoolMixin: _types = {NoneClass, tuple, str, decimal.Decimal, BoolClass} - class FrozenDictTupleStrDecimalBoolMixin: _types = {frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass} - # qty 6 class NoneFrozenDictTupleStrDecimalBoolMixin: - _types = { - NoneClass, - frozendict.frozendict, - tuple, - str, - decimal.Decimal, - BoolClass, - } - + _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass} # qty 8 class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin: - _types = { - NoneClass, - frozendict.frozendict, - tuple, - str, - decimal.Decimal, - BoolClass, - FileIO, - bytes, - } + _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes} class ValidatorBase: @@ -1172,16 +876,12 @@ def _is_json_validation_enabled_oapg(schema_keyword, configuration=None): configuration (Configuration): the configuration class. """ - return ( - configuration is None - or not hasattr(configuration, "_disabled_client_side_validations") - or schema_keyword not in configuration._disabled_client_side_validations - ) + return (configuration is None or + not hasattr(configuration, '_disabled_client_side_validations') or + schema_keyword not in configuration._disabled_client_side_validations) @staticmethod - def _raise_validation_error_message_oapg( - value, constraint_msg, constraint_value, path_to_item, additional_txt="" - ): + def _raise_validation_error_message_oapg(value, constraint_msg, constraint_value, path_to_item, additional_txt=""): raise ApiValueError( "Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format( value=value, @@ -1199,20 +899,7 @@ def _validate_oapg( cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[ - typing.Tuple[typing.Union[str, int], ...], - typing.Set[ - typing.Union[ - "Schema", - str, - decimal.Decimal, - BoolClass, - NoneClass, - frozendict.frozendict, - tuple, - ] - ], - ]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ EnumBase _validate_oapg Validates that arg is in the enum's allowed values @@ -1220,11 +907,7 @@ def _validate_oapg( try: cls.MetaOapg.enum_value_to_name[arg] except KeyError: - raise ApiValueError( - "Invalid value {} passed in to {}, allowed_values={}".format( - arg, cls, cls.MetaOapg.enum_value_to_name.keys() - ) - ) + raise ApiValueError("Invalid value {} passed in to {}, allowed_values={}".format(arg, cls, cls.MetaOapg.enum_value_to_name.keys())) return super()._validate_oapg(arg, validation_metadata=validation_metadata) @@ -1268,73 +951,68 @@ def as_str_oapg(self) -> str: @property def as_date_oapg(self) -> date: - raise Exception("not implemented") + raise Exception('not implemented') @property def as_datetime_oapg(self) -> datetime: - raise Exception("not implemented") + raise Exception('not implemented') @property def as_decimal_oapg(self) -> decimal.Decimal: - raise Exception("not implemented") + raise Exception('not implemented') @property def as_uuid_oapg(self) -> uuid.UUID: - raise Exception("not implemented") + raise Exception('not implemented') @classmethod - def __check_str_validations(cls, arg: str, validation_metadata: ValidationMetadata): - if not hasattr(cls, "MetaOapg"): + def __check_str_validations( + cls, + arg: str, + validation_metadata: ValidationMetadata + ): + if not hasattr(cls, 'MetaOapg'): return - if ( - cls._is_json_validation_enabled_oapg( - "maxLength", validation_metadata.configuration - ) - and hasattr(cls.MetaOapg, "max_length") - and len(arg) > cls.MetaOapg.max_length - ): + if (cls._is_json_validation_enabled_oapg('maxLength', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'max_length') and + len(arg) > cls.MetaOapg.max_length): cls._raise_validation_error_message_oapg( value=arg, constraint_msg="length must be less than or equal to", constraint_value=cls.MetaOapg.max_length, - path_to_item=validation_metadata.path_to_item, + path_to_item=validation_metadata.path_to_item ) - if ( - cls._is_json_validation_enabled_oapg( - "minLength", validation_metadata.configuration - ) - and hasattr(cls.MetaOapg, "min_length") - and len(arg) < cls.MetaOapg.min_length - ): + if (cls._is_json_validation_enabled_oapg('minLength', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'min_length') and + len(arg) < cls.MetaOapg.min_length): cls._raise_validation_error_message_oapg( value=arg, constraint_msg="length must be greater than or equal to", constraint_value=cls.MetaOapg.min_length, - path_to_item=validation_metadata.path_to_item, + path_to_item=validation_metadata.path_to_item ) - if cls._is_json_validation_enabled_oapg( - "pattern", validation_metadata.configuration - ) and hasattr(cls.MetaOapg, "regex"): + if (cls._is_json_validation_enabled_oapg('pattern', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'regex')): for regex_dict in cls.MetaOapg.regex: - flags = regex_dict.get("flags", 0) - if not re.search(regex_dict["pattern"], arg, flags=flags): + flags = regex_dict.get('flags', 0) + if not re.search(regex_dict['pattern'], arg, flags=flags): if flags != 0: # Don't print the regex flags if the flags are not # specified in the OAS document. cls._raise_validation_error_message_oapg( value=arg, constraint_msg="must match regular expression", - constraint_value=regex_dict["pattern"], + constraint_value=regex_dict['pattern'], path_to_item=validation_metadata.path_to_item, - additional_txt=" with flags=`{}`".format(flags), + additional_txt=" with flags=`{}`".format(flags) ) cls._raise_validation_error_message_oapg( value=arg, constraint_msg="must match regular expression", - constraint_value=regex_dict["pattern"], - path_to_item=validation_metadata.path_to_item, + constraint_value=regex_dict['pattern'], + path_to_item=validation_metadata.path_to_item ) @classmethod @@ -1342,20 +1020,7 @@ def _validate_oapg( cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[ - typing.Tuple[typing.Union[str, int], ...], - typing.Set[ - typing.Union[ - "Schema", - str, - decimal.Decimal, - BoolClass, - NoneClass, - frozendict.frozendict, - tuple, - ] - ], - ]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ StrBase _validate_oapg Validates that validations pass @@ -1372,18 +1037,14 @@ def as_uuid_oapg(self) -> uuid.UUID: return uuid.UUID(self) @classmethod - def __validate_format( - cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata - ): + def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): if isinstance(arg, str): try: uuid.UUID(arg) return True except ValueError: raise ApiValueError( - "Invalid value '{}' for type UUID at {}".format( - arg, validation_metadata.path_to_item - ) + "Invalid value '{}' for type UUID at {}".format(arg, validation_metadata.path_to_item) ) @classmethod @@ -1400,21 +1061,22 @@ def _validate_oapg( class CustomIsoparser(isoparser): + @_takes_ascii def parse_isodatetime(self, dt_str): components, pos = self._parse_isodate(dt_str) if len(dt_str) > pos: - if self._sep is None or dt_str[pos : pos + 1] == self._sep: - components += self._parse_isotime(dt_str[pos + 1 :]) + if self._sep is None or dt_str[pos:pos + 1] == self._sep: + components += self._parse_isotime(dt_str[pos + 1:]) else: - raise ValueError("String contains unknown ISO components") + raise ValueError('String contains unknown ISO components') if len(components) > 3 and components[3] == 24: components[3] = 0 return datetime(*components) + timedelta(days=1) if len(components) <= 3: - raise ValueError("Value is not a datetime") + raise ValueError('Value is not a datetime') return datetime(*components) @@ -1423,10 +1085,10 @@ def parse_isodate(self, datestr): components, pos = self._parse_isodate(datestr) if len(datestr) > pos: - raise ValueError("String contains invalid time components") + raise ValueError('String contains invalid time components') if len(components) > 3: - raise ValueError("String contains invalid time components") + raise ValueError('String contains invalid time components') return date(*components) @@ -1441,9 +1103,7 @@ def as_date_oapg(self) -> date: return DEFAULT_ISOPARSER.parse_isodate(self) @classmethod - def __validate_format( - cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata - ): + def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): if isinstance(arg, str): try: DEFAULT_ISOPARSER.parse_isodate(arg) @@ -1451,9 +1111,7 @@ def __validate_format( except ValueError: raise ApiValueError( "Value does not conform to the required ISO-8601 date format. " - "Invalid value '{}' for type date at {}".format( - arg, validation_metadata.path_to_item - ) + "Invalid value '{}' for type date at {}".format(arg, validation_metadata.path_to_item) ) @classmethod @@ -1476,9 +1134,7 @@ def as_datetime_oapg(self) -> datetime: return DEFAULT_ISOPARSER.parse_isodatetime(self) @classmethod - def __validate_format( - cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata - ): + def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): if isinstance(arg, str): try: DEFAULT_ISOPARSER.parse_isodatetime(arg) @@ -1486,9 +1142,7 @@ def __validate_format( except ValueError: raise ApiValueError( "Value does not conform to the required ISO-8601 datetime format. " - "Invalid value '{}' for type datetime at {}".format( - arg, validation_metadata.path_to_item - ) + "Invalid value '{}' for type datetime at {}".format(arg, validation_metadata.path_to_item) ) @classmethod @@ -1517,9 +1171,7 @@ def as_decimal_oapg(self) -> decimal.Decimal: return decimal.Decimal(self) @classmethod - def __validate_format( - cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata - ): + def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): if isinstance(arg, str): try: decimal.Decimal(arg) @@ -1527,9 +1179,7 @@ def __validate_format( except decimal.InvalidOperation: raise ApiValueError( "Value cannot be converted to a decimal. " - "Invalid value '{}' for type decimal at {}".format( - arg, validation_metadata.path_to_item - ) + "Invalid value '{}' for type decimal at {}".format(arg, validation_metadata.path_to_item) ) @classmethod @@ -1564,7 +1214,7 @@ def as_int_oapg(self) -> int: if self.as_tuple().exponent < 0: # this could be represented as an integer but should be represented as a float # because that's what it was serialized from - raise ApiValueError(f"{self} is not an integer") + raise ApiValueError(f'{self} is not an integer') self._as_int = int(self) return self._as_int @@ -1574,93 +1224,79 @@ def as_float_oapg(self) -> float: return self._as_float except AttributeError: if self.as_tuple().exponent >= 0: - raise ApiValueError(f"{self} is not a float") + raise ApiValueError(f'{self} is not a float') self._as_float = float(self) return self._as_float @classmethod - def __check_numeric_validations(cls, arg, validation_metadata: ValidationMetadata): - if not hasattr(cls, "MetaOapg"): + def __check_numeric_validations( + cls, + arg, + validation_metadata: ValidationMetadata + ): + if not hasattr(cls, 'MetaOapg'): return - if cls._is_json_validation_enabled_oapg( - "multipleOf", validation_metadata.configuration - ) and hasattr(cls.MetaOapg, "multiple_of"): + if cls._is_json_validation_enabled_oapg('multipleOf', + validation_metadata.configuration) and hasattr(cls.MetaOapg, 'multiple_of'): multiple_of_value = cls.MetaOapg.multiple_of - if not (float(arg) / multiple_of_value).is_integer(): + if (not (float(arg) / multiple_of_value).is_integer()): # Note 'multipleOf' will be as good as the floating point arithmetic. cls._raise_validation_error_message_oapg( value=arg, constraint_msg="value must be a multiple of", constraint_value=multiple_of_value, - path_to_item=validation_metadata.path_to_item, + path_to_item=validation_metadata.path_to_item ) checking_max_or_min_values = any( - hasattr(cls.MetaOapg, validation_key) - for validation_key in { - "exclusive_maximum", - "inclusive_maximum", - "exclusive_minimum", - "inclusive_minimum", + hasattr(cls.MetaOapg, validation_key) for validation_key in { + 'exclusive_maximum', + 'inclusive_maximum', + 'exclusive_minimum', + 'inclusive_minimum', } ) if not checking_max_or_min_values: return - if ( - cls._is_json_validation_enabled_oapg( - "exclusiveMaximum", validation_metadata.configuration - ) - and hasattr(cls.MetaOapg, "exclusive_maximum") - and arg >= cls.MetaOapg.exclusive_maximum - ): + if (cls._is_json_validation_enabled_oapg('exclusiveMaximum', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'exclusive_maximum') and + arg >= cls.MetaOapg.exclusive_maximum): cls._raise_validation_error_message_oapg( value=arg, constraint_msg="must be a value less than", constraint_value=cls.MetaOapg.exclusive_maximum, - path_to_item=validation_metadata.path_to_item, + path_to_item=validation_metadata.path_to_item ) - if ( - cls._is_json_validation_enabled_oapg( - "maximum", validation_metadata.configuration - ) - and hasattr(cls.MetaOapg, "inclusive_maximum") - and arg > cls.MetaOapg.inclusive_maximum - ): + if (cls._is_json_validation_enabled_oapg('maximum', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'inclusive_maximum') and + arg > cls.MetaOapg.inclusive_maximum): cls._raise_validation_error_message_oapg( value=arg, constraint_msg="must be a value less than or equal to", constraint_value=cls.MetaOapg.inclusive_maximum, - path_to_item=validation_metadata.path_to_item, + path_to_item=validation_metadata.path_to_item ) - if ( - cls._is_json_validation_enabled_oapg( - "exclusiveMinimum", validation_metadata.configuration - ) - and hasattr(cls.MetaOapg, "exclusive_minimum") - and arg <= cls.MetaOapg.exclusive_minimum - ): + if (cls._is_json_validation_enabled_oapg('exclusiveMinimum', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'exclusive_minimum') and + arg <= cls.MetaOapg.exclusive_minimum): cls._raise_validation_error_message_oapg( value=arg, constraint_msg="must be a value greater than", constraint_value=cls.MetaOapg.exclusive_maximum, - path_to_item=validation_metadata.path_to_item, + path_to_item=validation_metadata.path_to_item ) - if ( - cls._is_json_validation_enabled_oapg( - "minimum", validation_metadata.configuration - ) - and hasattr(cls.MetaOapg, "inclusive_minimum") - and arg < cls.MetaOapg.inclusive_minimum - ): + if (cls._is_json_validation_enabled_oapg('minimum', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'inclusive_minimum') and + arg < cls.MetaOapg.inclusive_minimum): cls._raise_validation_error_message_oapg( value=arg, constraint_msg="must be a value greater than or equal to", constraint_value=cls.MetaOapg.inclusive_minimum, - path_to_item=validation_metadata.path_to_item, + path_to_item=validation_metadata.path_to_item ) @classmethod @@ -1668,20 +1304,7 @@ def _validate_oapg( cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[ - typing.Tuple[typing.Union[str, int], ...], - typing.Set[ - typing.Union[ - "Schema", - str, - decimal.Decimal, - BoolClass, - NoneClass, - frozendict.frozendict, - tuple, - ] - ], - ]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ NumberBase _validate_oapg Validates that validations pass @@ -1711,72 +1334,59 @@ def __validate_items(cls, list_items, validation_metadata: ValidationMetadata): # if we have definitions for an items schema, use it # otherwise accept anything - item_cls = getattr(cls.MetaOapg, "items", UnsetAnyTypeSchema) + item_cls = getattr(cls.MetaOapg, 'items', UnsetAnyTypeSchema) item_cls = cls._get_class_oapg(item_cls) path_to_schemas = {} for i, value in enumerate(list_items): item_validation_metadata = ValidationMetadata( from_server=validation_metadata.from_server, configuration=validation_metadata.configuration, - path_to_item=validation_metadata.path_to_item + (i,), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas, + path_to_item=validation_metadata.path_to_item+(i,), + validated_path_to_schemas=validation_metadata.validated_path_to_schemas ) if item_validation_metadata.validation_ran_earlier(item_cls): add_deeper_validated_schemas(item_validation_metadata, path_to_schemas) continue other_path_to_schemas = item_cls._validate_oapg( - value, validation_metadata=item_validation_metadata - ) + value, validation_metadata=item_validation_metadata) update(path_to_schemas, other_path_to_schemas) return path_to_schemas @classmethod - def __check_tuple_validations(cls, arg, validation_metadata: ValidationMetadata): - if not hasattr(cls, "MetaOapg"): + def __check_tuple_validations( + cls, arg, + validation_metadata: ValidationMetadata): + if not hasattr(cls, 'MetaOapg'): return - if ( - cls._is_json_validation_enabled_oapg( - "maxItems", validation_metadata.configuration - ) - and hasattr(cls.MetaOapg, "max_items") - and len(arg) > cls.MetaOapg.max_items - ): + if (cls._is_json_validation_enabled_oapg('maxItems', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'max_items') and + len(arg) > cls.MetaOapg.max_items): cls._raise_validation_error_message_oapg( value=arg, constraint_msg="number of items must be less than or equal to", constraint_value=cls.MetaOapg.max_items, - path_to_item=validation_metadata.path_to_item, + path_to_item=validation_metadata.path_to_item ) - if ( - cls._is_json_validation_enabled_oapg( - "minItems", validation_metadata.configuration - ) - and hasattr(cls.MetaOapg, "min_items") - and len(arg) < cls.MetaOapg.min_items - ): + if (cls._is_json_validation_enabled_oapg('minItems', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'min_items') and + len(arg) < cls.MetaOapg.min_items): cls._raise_validation_error_message_oapg( value=arg, constraint_msg="number of items must be greater than or equal to", constraint_value=cls.MetaOapg.min_items, - path_to_item=validation_metadata.path_to_item, + path_to_item=validation_metadata.path_to_item ) - if ( - cls._is_json_validation_enabled_oapg( - "uniqueItems", validation_metadata.configuration - ) - and hasattr(cls.MetaOapg, "unique_items") - and cls.MetaOapg.unique_items - and arg - ): + if (cls._is_json_validation_enabled_oapg('uniqueItems', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'unique_items') and cls.MetaOapg.unique_items and arg): unique_items = set(arg) if len(arg) > len(unique_items): cls._raise_validation_error_message_oapg( value=arg, constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", - constraint_value="unique_items==True", - path_to_item=validation_metadata.path_to_item, + constraint_value='unique_items==True', + path_to_item=validation_metadata.path_to_item ) @classmethod @@ -1802,9 +1412,7 @@ def _validate_oapg( """ if isinstance(arg, tuple): cls.__check_tuple_validations(arg, validation_metadata) - _path_to_schemas = super()._validate_oapg( - arg, validation_metadata=validation_metadata - ) + _path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) if not isinstance(arg, tuple): return _path_to_schemas updated_vm = ValidationMetadata( @@ -1812,33 +1420,31 @@ def _validate_oapg( from_server=validation_metadata.from_server, path_to_item=validation_metadata.path_to_item, seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas, - ) - other_path_to_schemas = cls.__validate_items( - arg, validation_metadata=updated_vm + validated_path_to_schemas=validation_metadata.validated_path_to_schemas ) + other_path_to_schemas = cls.__validate_items(arg, validation_metadata=updated_vm) update(_path_to_schemas, other_path_to_schemas) return _path_to_schemas @classmethod def _get_items_oapg( - cls: "Schema", + cls: 'Schema', arg: typing.List[typing.Any], path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[ - typing.Tuple[typing.Union[str, int], ...], typing.Type["Schema"] - ], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] ): - """ + ''' ListBase _get_items_oapg - """ + ''' cast_items = [] for i, value in enumerate(arg): item_path_to_item = path_to_item + (i,) item_cls = path_to_schemas[item_path_to_item] new_value = item_cls._get_new_instance_without_conversion_oapg( - value, item_path_to_item, path_to_schemas + value, + item_path_to_item, + path_to_schemas ) cast_items.append(new_value) @@ -1849,26 +1455,20 @@ class Discriminable: MetaOapg: MetaOapgTyped @classmethod - def _ensure_discriminator_value_present_oapg( - cls, disc_property_name: str, validation_metadata: ValidationMetadata, *args - ): + def _ensure_discriminator_value_present_oapg(cls, disc_property_name: str, validation_metadata: ValidationMetadata, *args): if not args or args and disc_property_name not in args[0]: # The input data does not contain the discriminator property raise ApiValueError( "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '{}' is missing at path: {}".format( - disc_property_name, validation_metadata.path_to_item - ) + "The discriminator property '{}' is missing at path: {}".format(disc_property_name, validation_metadata.path_to_item) ) @classmethod - def get_discriminated_class_oapg( - cls, disc_property_name: str, disc_payload_value: str - ): + def get_discriminated_class_oapg(cls, disc_property_name: str, disc_payload_value: str): """ Used in schemas with discriminators """ - if not hasattr(cls.MetaOapg, "discriminator"): + if not hasattr(cls.MetaOapg, 'discriminator'): return None disc = cls.MetaOapg.discriminator() if disc_property_name not in disc: @@ -1876,43 +1476,38 @@ def get_discriminated_class_oapg( discriminated_cls = disc[disc_property_name].get(disc_payload_value) if discriminated_cls is not None: return discriminated_cls - if not hasattr(cls, "MetaOapg"): + if not hasattr(cls, 'MetaOapg'): return None elif not ( - hasattr(cls.MetaOapg, "all_of") - or hasattr(cls.MetaOapg, "one_of") - or hasattr(cls.MetaOapg, "any_of") + hasattr(cls.MetaOapg, 'all_of') or + hasattr(cls.MetaOapg, 'one_of') or + hasattr(cls.MetaOapg, 'any_of') ): return None # TODO stop traveling if a cycle is hit - if hasattr(cls.MetaOapg, "all_of"): + if hasattr(cls.MetaOapg, 'all_of'): for allof_cls in cls.MetaOapg.all_of(): discriminated_cls = allof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, - disc_payload_value=disc_payload_value, - ) + disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) if discriminated_cls is not None: return discriminated_cls - if hasattr(cls.MetaOapg, "one_of"): + if hasattr(cls.MetaOapg, 'one_of'): for oneof_cls in cls.MetaOapg.one_of(): discriminated_cls = oneof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, - disc_payload_value=disc_payload_value, - ) + disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) if discriminated_cls is not None: return discriminated_cls - if hasattr(cls.MetaOapg, "any_of"): + if hasattr(cls.MetaOapg, 'any_of'): for anyof_cls in cls.MetaOapg.any_of(): discriminated_cls = anyof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, - disc_payload_value=disc_payload_value, - ) + disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) if discriminated_cls is not None: return discriminated_cls return None class DictBase(Discriminable, ValidatorBase): + @classmethod def __validate_arg_presence(cls, arg): """ @@ -1935,12 +1530,10 @@ def __validate_arg_presence(cls, arg): """ seen_required_properties = set() invalid_arguments = [] - required_property_names = getattr(cls.MetaOapg, "required", set()) - additional_properties = getattr( - cls.MetaOapg, "additional_properties", UnsetAnyTypeSchema - ) - properties = getattr(cls.MetaOapg, "properties", {}) - property_annotations = getattr(properties, "__annotations__", {}) + required_property_names = getattr(cls.MetaOapg, 'required', set()) + additional_properties = getattr(cls.MetaOapg, 'additional_properties', UnsetAnyTypeSchema) + properties = getattr(cls.MetaOapg, 'properties', {}) + property_annotations = getattr(properties, '__annotations__', {}) for property_name in arg: if property_name in required_property_names: seen_required_properties.add(property_name) @@ -1950,9 +1543,7 @@ def __validate_arg_presence(cls, arg): continue else: invalid_arguments.append(property_name) - missing_required_arguments = list( - required_property_names - seen_required_properties - ) + missing_required_arguments = list(required_property_names - seen_required_properties) if missing_required_arguments: missing_required_arguments.sort() raise ApiTypeError( @@ -1960,7 +1551,7 @@ def __validate_arg_presence(cls, arg): cls.__name__, len(missing_required_arguments), "s" if len(missing_required_arguments) > 1 else "", - missing_required_arguments, + missing_required_arguments ) ) if invalid_arguments: @@ -1970,7 +1561,7 @@ def __validate_arg_presence(cls, arg): cls.__name__, len(invalid_arguments), "s" if len(invalid_arguments) > 1 else "", - invalid_arguments, + invalid_arguments ) ) @@ -1989,13 +1580,11 @@ def __validate_args(cls, arg, validation_metadata: ValidationMetadata): ApiTypeError - for missing required arguments, or for invalid properties """ path_to_schemas = {} - additional_properties = getattr( - cls.MetaOapg, "additional_properties", UnsetAnyTypeSchema - ) - properties = getattr(cls.MetaOapg, "properties", {}) - property_annotations = getattr(properties, "__annotations__", {}) + additional_properties = getattr(cls.MetaOapg, 'additional_properties', UnsetAnyTypeSchema) + properties = getattr(cls.MetaOapg, 'properties', {}) + property_annotations = getattr(properties, '__annotations__', {}) for property_name, value in arg.items(): - path_to_item = validation_metadata.path_to_item + (property_name,) + path_to_item = validation_metadata.path_to_item+(property_name,) if property_name in property_annotations: schema = property_annotations[property_name] elif additional_properties is not NotAnyTypeSchema: @@ -2009,57 +1598,49 @@ def __validate_args(cls, arg, validation_metadata: ValidationMetadata): continue schema = additional_properties else: - raise ApiTypeError( - "Unable to find schema for value={} in class={} at path_to_item={}".format( - value, cls, validation_metadata.path_to_item + (property_name,) - ) - ) + raise ApiTypeError('Unable to find schema for value={} in class={} at path_to_item={}'.format( + value, cls, validation_metadata.path_to_item+(property_name,) + )) schema = cls._get_class_oapg(schema) arg_validation_metadata = ValidationMetadata( from_server=validation_metadata.from_server, configuration=validation_metadata.configuration, path_to_item=path_to_item, - validated_path_to_schemas=validation_metadata.validated_path_to_schemas, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas ) if arg_validation_metadata.validation_ran_earlier(schema): add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) continue - other_path_to_schemas = schema._validate_oapg( - value, validation_metadata=arg_validation_metadata - ) + other_path_to_schemas = schema._validate_oapg(value, validation_metadata=arg_validation_metadata) update(path_to_schemas, other_path_to_schemas) return path_to_schemas @classmethod - def __check_dict_validations(cls, arg, validation_metadata: ValidationMetadata): - if not hasattr(cls, "MetaOapg"): + def __check_dict_validations( + cls, + arg, + validation_metadata: ValidationMetadata + ): + if not hasattr(cls, 'MetaOapg'): return - if ( - cls._is_json_validation_enabled_oapg( - "maxProperties", validation_metadata.configuration - ) - and hasattr(cls.MetaOapg, "max_properties") - and len(arg) > cls.MetaOapg.max_properties - ): + if (cls._is_json_validation_enabled_oapg('maxProperties', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'max_properties') and + len(arg) > cls.MetaOapg.max_properties): cls._raise_validation_error_message_oapg( value=arg, constraint_msg="number of properties must be less than or equal to", constraint_value=cls.MetaOapg.max_properties, - path_to_item=validation_metadata.path_to_item, + path_to_item=validation_metadata.path_to_item ) - if ( - cls._is_json_validation_enabled_oapg( - "minProperties", validation_metadata.configuration - ) - and hasattr(cls.MetaOapg, "min_properties") - and len(arg) < cls.MetaOapg.min_properties - ): + if (cls._is_json_validation_enabled_oapg('minProperties', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'min_properties') and + len(arg) < cls.MetaOapg.min_properties): cls._raise_validation_error_message_oapg( value=arg, constraint_msg="number of properties must be greater than or equal to", constraint_value=cls.MetaOapg.min_properties, - path_to_item=validation_metadata.path_to_item, + path_to_item=validation_metadata.path_to_item ) @classmethod @@ -2085,15 +1666,11 @@ def _validate_oapg( """ if isinstance(arg, frozendict.frozendict): cls.__check_dict_validations(arg, validation_metadata) - _path_to_schemas = super()._validate_oapg( - arg, validation_metadata=validation_metadata - ) + _path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) if not isinstance(arg, frozendict.frozendict): return _path_to_schemas cls.__validate_arg_presence(arg) - other_path_to_schemas = cls.__validate_args( - arg, validation_metadata=validation_metadata - ) + other_path_to_schemas = cls.__validate_args(arg, validation_metadata=validation_metadata) update(_path_to_schemas, other_path_to_schemas) try: discriminator = cls.MetaOapg.discriminator() @@ -2101,19 +1678,16 @@ def _validate_oapg( return _path_to_schemas # discriminator exists disc_prop_name = list(discriminator.keys())[0] - cls._ensure_discriminator_value_present_oapg( - disc_prop_name, validation_metadata, arg - ) + cls._ensure_discriminator_value_present_oapg(disc_prop_name, validation_metadata, arg) discriminated_cls = cls.get_discriminated_class_oapg( - disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name] - ) + disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name]) if discriminated_cls is None: raise ApiValueError( "Invalid discriminator value was passed in to {}.{} Only the values {} are allowed at {}".format( cls.__name__, disc_prop_name, list(discriminator[disc_prop_name].keys()), - validation_metadata.path_to_item + (disc_prop_name,), + validation_metadata.path_to_item + (disc_prop_name,) ) ) updated_vm = ValidationMetadata( @@ -2121,14 +1695,12 @@ def _validate_oapg( from_server=validation_metadata.from_server, path_to_item=validation_metadata.path_to_item, seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas ) if updated_vm.validation_ran_earlier(discriminated_cls): add_deeper_validated_schemas(updated_vm, _path_to_schemas) return _path_to_schemas - other_path_to_schemas = discriminated_cls._validate_oapg( - arg, validation_metadata=updated_vm - ) + other_path_to_schemas = discriminated_cls._validate_oapg(arg, validation_metadata=updated_vm) update(_path_to_schemas, other_path_to_schemas) return _path_to_schemas @@ -2137,9 +1709,7 @@ def _get_properties_oapg( cls, arg: typing.Dict[str, typing.Any], path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[ - typing.Tuple[typing.Union[str, int], ...], typing.Type["Schema"] - ], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] ): """ DictBase _get_properties_oapg, this is how properties are set @@ -2151,7 +1721,9 @@ def _get_properties_oapg( property_path_to_item = path_to_item + (property_name_js,) property_cls = path_to_schemas[property_path_to_item] new_value = property_cls._get_new_instance_without_conversion_oapg( - value, property_path_to_item, path_to_schemas + value, + property_path_to_item, + path_to_schemas ) dict_items[property_name_js] = new_value @@ -2159,9 +1731,7 @@ def _get_properties_oapg( def __setattr__(self, name: str, value: typing.Any): if not isinstance(self, FileIO): - raise AttributeError( - "property setting not supported on immutable instances" - ) + raise AttributeError('property setting not supported on immutable instances') def __getattr__(self, name: str): """ @@ -2188,7 +1758,7 @@ def __getitem__(self, name: str): return super().__getattr__(name) return super().__getitem__(name) - def get_item_oapg(self, name: str) -> typing.Union["AnyTypeSchema", Unset]: + def get_item_oapg(self, name: str) -> typing.Union['AnyTypeSchema', Unset]: # dict_instance[name] accessor if not isinstance(self, frozendict.frozendict): raise NotImplementedError() @@ -2199,50 +1769,11 @@ def get_item_oapg(self, name: str) -> typing.Union["AnyTypeSchema", Unset]: def cast_to_allowed_types( - arg: typing.Union[ - str, - date, - datetime, - uuid.UUID, - decimal.Decimal, - int, - float, - None, - dict, - frozendict.frozendict, - list, - tuple, - bytes, - Schema, - io.FileIO, - io.BufferedReader, - ], + arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict.frozendict, list, tuple, bytes, Schema, io.FileIO, io.BufferedReader], from_server: bool, - validated_path_to_schemas: typing.Dict[ - typing.Tuple[typing.Union[str, int], ...], - typing.Set[ - typing.Union[ - "Schema", - str, - decimal.Decimal, - BoolClass, - NoneClass, - frozendict.frozendict, - tuple, - ] - ], - ], - path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(["args[0]"]), -) -> typing.Union[ - frozendict.frozendict, - tuple, - decimal.Decimal, - str, - bytes, - BoolClass, - NoneClass, - FileIO, -]: + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]], + path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), +) -> typing.Union[frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO]: """ Casts the input payload arg into the allowed types The input validated_path_to_schemas is mutated by running this function @@ -2273,20 +1804,11 @@ def cast_to_allowed_types( schema_classes.add(cls) validated_path_to_schemas[path_to_item] = schema_classes - type_error = ApiTypeError( - f"Invalid type. Required value type is str and passed type was {type(arg)} at {path_to_item}" - ) + type_error = ApiTypeError(f"Invalid type. Required value type is str and passed type was {type(arg)} at {path_to_item}") if isinstance(arg, str): return str(arg) elif isinstance(arg, (dict, frozendict.frozendict)): - return frozendict.frozendict( - { - key: cast_to_allowed_types( - val, from_server, validated_path_to_schemas, path_to_item + (key,) - ) - for key, val in arg.items() - } - ) + return frozendict.frozendict({key: cast_to_allowed_types(val, from_server, validated_path_to_schemas, path_to_item + (key,)) for key, val in arg.items()}) elif isinstance(arg, (bool, BoolClass)): """ this check must come before isinstance(arg, (int, float)) @@ -2302,17 +1824,10 @@ def cast_to_allowed_types( if decimal_from_float.as_integer_ratio()[1] == 1: # 9.0 -> Decimal('9.0') # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') - return decimal.Decimal(str(decimal_from_float) + ".0") + return decimal.Decimal(str(decimal_from_float)+'.0') return decimal_from_float elif isinstance(arg, (tuple, list)): - return tuple( - [ - cast_to_allowed_types( - item, from_server, validated_path_to_schemas, path_to_item + (i,) - ) - for i, item in enumerate(arg) - ] - ) + return tuple([cast_to_allowed_types(item, from_server, validated_path_to_schemas, path_to_item + (i,)) for i, item in enumerate(arg)]) elif isinstance(arg, (none_type, NoneClass)): return NoneClass.NONE elif isinstance(arg, (date, datetime)): @@ -2329,12 +1844,11 @@ def cast_to_allowed_types( return bytes(arg) elif isinstance(arg, (io.FileIO, io.BufferedReader)): return FileIO(arg) - raise ValueError( - "Invalid type passed in got input={} type={}".format(arg, type(arg)) - ) + raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) class ComposedBase(Discriminable): + @classmethod def __get_allof_classes(cls, arg, validation_metadata: ValidationMetadata): path_to_schemas = defaultdict(set) @@ -2342,9 +1856,7 @@ def __get_allof_classes(cls, arg, validation_metadata: ValidationMetadata): if validation_metadata.validation_ran_earlier(allof_cls): add_deeper_validated_schemas(validation_metadata, path_to_schemas) continue - other_path_to_schemas = allof_cls._validate_oapg( - arg, validation_metadata=validation_metadata - ) + other_path_to_schemas = allof_cls._validate_oapg(arg, validation_metadata=validation_metadata) update(path_to_schemas, other_path_to_schemas) return path_to_schemas @@ -2366,9 +1878,7 @@ def __get_oneof_class( add_deeper_validated_schemas(validation_metadata, path_to_schemas) continue try: - path_to_schemas = oneof_cls._validate_oapg( - arg, validation_metadata=validation_metadata - ) + path_to_schemas = oneof_cls._validate_oapg(arg, validation_metadata=validation_metadata) except (ApiValueError, ApiTypeError) as ex: if discriminated_cls is not None and oneof_cls is discriminated_cls: raise ex @@ -2382,16 +1892,17 @@ def __get_oneof_class( elif len(oneof_classes) > 1: raise ApiValueError( "Invalid inputs given to generate an instance of {}. Multiple " - "oneOf schemas {} matched the inputs, but a max of one is allowed.".format( - cls, oneof_classes - ) + "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) ) # exactly one class matches return path_to_schemas @classmethod def __get_anyof_classes( - cls, arg, discriminated_cls, validation_metadata: ValidationMetadata + cls, + arg, + discriminated_cls, + validation_metadata: ValidationMetadata ): anyof_classes = [] path_to_schemas = defaultdict(set) @@ -2402,9 +1913,7 @@ def __get_anyof_classes( continue try: - other_path_to_schemas = anyof_cls._validate_oapg( - arg, validation_metadata=validation_metadata - ) + other_path_to_schemas = anyof_cls._validate_oapg(arg, validation_metadata=validation_metadata) except (ApiValueError, ApiTypeError) as ex: if discriminated_cls is not None and anyof_cls is discriminated_cls: raise ex @@ -2423,20 +1932,7 @@ def _validate_oapg( cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[ - typing.Tuple[typing.Union[str, int], ...], - typing.Set[ - typing.Union[ - "Schema", - str, - decimal.Decimal, - BoolClass, - NoneClass, - frozendict.frozendict, - tuple, - ] - ], - ]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ ComposedBase _validate_oapg We return dynamic classes of different bases depending upon the inputs @@ -2453,33 +1949,27 @@ def _validate_oapg( ApiTypeError: when the input type is not in the list of allowed spec types """ # validation checking on types, validations, and enums - path_to_schemas = super()._validate_oapg( - arg, validation_metadata=validation_metadata - ) + path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) updated_vm = ValidationMetadata( configuration=validation_metadata.configuration, from_server=validation_metadata.from_server, path_to_item=validation_metadata.path_to_item, seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas ) # process composed schema discriminator = None - if hasattr(cls, "MetaOapg") and hasattr(cls.MetaOapg, "discriminator"): + if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'discriminator'): discriminator = cls.MetaOapg.discriminator() discriminated_cls = None if discriminator and arg and isinstance(arg, frozendict.frozendict): disc_property_name = list(discriminator.keys())[0] - cls._ensure_discriminator_value_present_oapg( - disc_property_name, updated_vm, arg - ) + cls._ensure_discriminator_value_present_oapg(disc_property_name, updated_vm, arg) # get discriminated_cls by looking at the dict in the current class discriminated_cls = cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, - disc_payload_value=arg[disc_property_name], - ) + disc_property_name=disc_property_name, disc_payload_value=arg[disc_property_name]) if discriminated_cls is None: raise ApiValueError( "Invalid discriminator value '{}' was passed in to {}.{} Only the values {} are allowed at {}".format( @@ -2487,27 +1977,29 @@ def _validate_oapg( cls.__name__, disc_property_name, list(discriminator[disc_property_name].keys()), - updated_vm.path_to_item + (disc_property_name,), + updated_vm.path_to_item + (disc_property_name,) ) ) - if hasattr(cls, "MetaOapg") and hasattr(cls.MetaOapg, "all_of"): - other_path_to_schemas = cls.__get_allof_classes( - arg, validation_metadata=updated_vm - ) + if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'all_of'): + other_path_to_schemas = cls.__get_allof_classes(arg, validation_metadata=updated_vm) update(path_to_schemas, other_path_to_schemas) - if hasattr(cls, "MetaOapg") and hasattr(cls.MetaOapg, "one_of"): + if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'one_of'): other_path_to_schemas = cls.__get_oneof_class( - arg, discriminated_cls=discriminated_cls, validation_metadata=updated_vm + arg, + discriminated_cls=discriminated_cls, + validation_metadata=updated_vm ) update(path_to_schemas, other_path_to_schemas) - if hasattr(cls, "MetaOapg") and hasattr(cls.MetaOapg, "any_of"): + if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'any_of'): other_path_to_schemas = cls.__get_anyof_classes( - arg, discriminated_cls=discriminated_cls, validation_metadata=updated_vm + arg, + discriminated_cls=discriminated_cls, + validation_metadata=updated_vm ) update(path_to_schemas, other_path_to_schemas) not_cls = None - if hasattr(cls, "MetaOapg") and hasattr(cls.MetaOapg, "not_schema"): + if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'not_schema'): not_cls = cls.MetaOapg.not_schema not_cls = cls._get_class_oapg(not_cls) if not_cls: @@ -2523,17 +2015,13 @@ def _validate_oapg( raise not_exception try: - other_path_to_schemas = not_cls._validate_oapg( - arg, validation_metadata=updated_vm - ) + other_path_to_schemas = not_cls._validate_oapg(arg, validation_metadata=updated_vm) except (ApiValueError, ApiTypeError): pass if other_path_to_schemas: raise not_exception - if discriminated_cls is not None and not updated_vm.validation_ran_earlier( - discriminated_cls - ): + if discriminated_cls is not None and not updated_vm.validation_ran_earlier(discriminated_cls): # TODO use an exception from this package here add_deeper_validated_schemas(updated_vm, path_to_schemas) assert discriminated_cls in path_to_schemas[updated_vm.path_to_item] @@ -2550,71 +2038,60 @@ class ComposedSchema( BoolBase, NoneBase, Schema, - NoneFrozenDictTupleStrDecimalBoolMixin, + NoneFrozenDictTupleStrDecimalBoolMixin ): @classmethod - def from_openapi_data_oapg( - cls, - *args: typing.Any, - _configuration: typing.Optional[Configuration] = None, - **kwargs, - ): + def from_openapi_data_oapg(cls, *args: typing.Any, _configuration: typing.Optional[Configuration] = None, **kwargs): if not args: if not kwargs: - raise ApiTypeError( - "{} is missing required input data in args or kwargs".format( - cls.__name__ - ) - ) - args = (kwargs,) + raise ApiTypeError('{} is missing required input data in args or kwargs'.format(cls.__name__)) + args = (kwargs, ) return super().from_openapi_data_oapg(args[0], _configuration=_configuration) -class ListSchema(ListBase, Schema, TupleMixin): +class ListSchema( + ListBase, + Schema, + TupleMixin +): + @classmethod - def from_openapi_data_oapg( - cls, - arg: typing.List[typing.Any], - _configuration: typing.Optional[Configuration] = None, - ): + def from_openapi_data_oapg(cls, arg: typing.List[typing.Any], _configuration: typing.Optional[Configuration] = None): return super().from_openapi_data_oapg(arg, _configuration=_configuration) - def __new__( - cls, - _arg: typing.Union[typing.List[typing.Any], typing.Tuple[typing.Any]], - **kwargs: Configuration, - ): + def __new__(cls, _arg: typing.Union[typing.List[typing.Any], typing.Tuple[typing.Any]], **kwargs: Configuration): return super().__new__(cls, _arg, **kwargs) -class NoneSchema(NoneBase, Schema, NoneMixin): +class NoneSchema( + NoneBase, + Schema, + NoneMixin +): + @classmethod - def from_openapi_data_oapg( - cls, arg: None, _configuration: typing.Optional[Configuration] = None - ): + def from_openapi_data_oapg(cls, arg: None, _configuration: typing.Optional[Configuration] = None): return super().from_openapi_data_oapg(arg, _configuration=_configuration) def __new__(cls, _arg: None, **kwargs: Configuration): return super().__new__(cls, _arg, **kwargs) -class NumberSchema(NumberBase, Schema, DecimalMixin): +class NumberSchema( + NumberBase, + Schema, + DecimalMixin +): """ This is used for type: number with no format Both integers AND floats are accepted """ @classmethod - def from_openapi_data_oapg( - cls, - arg: typing.Union[int, float], - _configuration: typing.Optional[Configuration] = None, - ): + def from_openapi_data_oapg(cls, arg: typing.Union[int, float], _configuration: typing.Optional[Configuration] = None): return super().from_openapi_data_oapg(arg, _configuration=_configuration) - def __new__( - cls, _arg: typing.Union[decimal.Decimal, int, float], **kwargs: Configuration - ): + def __new__(cls, _arg: typing.Union[decimal.Decimal, int, float], **kwargs: Configuration): return super().__new__(cls, _arg, **kwargs) @@ -2628,18 +2105,13 @@ def as_int_oapg(self) -> int: return self._as_int @classmethod - def __validate_format( - cls, - arg: typing.Optional[decimal.Decimal], - validation_metadata: ValidationMetadata, - ): + def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): if isinstance(arg, decimal.Decimal): + denominator = arg.as_integer_ratio()[-1] if denominator != 1: raise ApiValueError( - "Invalid value '{}' for type integer at {}".format( - arg, validation_metadata.path_to_item - ) + "Invalid value '{}' for type integer at {}".format(arg, validation_metadata.path_to_item) ) @classmethod @@ -2657,10 +2129,9 @@ def _validate_oapg( class IntSchema(IntBase, NumberSchema): + @classmethod - def from_openapi_data_oapg( - cls, arg: int, _configuration: typing.Optional[Configuration] = None - ): + def from_openapi_data_oapg(cls, arg: int, _configuration: typing.Optional[Configuration] = None): return super().from_openapi_data_oapg(arg, _configuration=_configuration) def __new__(cls, _arg: typing.Union[decimal.Decimal, int], **kwargs: Configuration): @@ -2672,17 +2143,11 @@ class Int32Base: __inclusive_maximum = decimal.Decimal(2147483647) @classmethod - def __validate_format( - cls, - arg: typing.Optional[decimal.Decimal], - validation_metadata: ValidationMetadata, - ): + def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): if isinstance(arg, decimal.Decimal) and arg.as_tuple().exponent == 0: if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: raise ApiValueError( - "Invalid value '{}' for type int32 at {}".format( - arg, validation_metadata.path_to_item - ) + "Invalid value '{}' for type int32 at {}".format(arg, validation_metadata.path_to_item) ) @classmethod @@ -2698,7 +2163,10 @@ def _validate_oapg( return super()._validate_oapg(arg, validation_metadata=validation_metadata) -class Int32Schema(Int32Base, IntSchema): +class Int32Schema( + Int32Base, + IntSchema +): pass @@ -2707,17 +2175,11 @@ class Int64Base: __inclusive_maximum = decimal.Decimal(9223372036854775807) @classmethod - def __validate_format( - cls, - arg: typing.Optional[decimal.Decimal], - validation_metadata: ValidationMetadata, - ): + def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): if isinstance(arg, decimal.Decimal) and arg.as_tuple().exponent == 0: if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: raise ApiValueError( - "Invalid value '{}' for type int64 at {}".format( - arg, validation_metadata.path_to_item - ) + "Invalid value '{}' for type int64 at {}".format(arg, validation_metadata.path_to_item) ) @classmethod @@ -2733,26 +2195,23 @@ def _validate_oapg( return super()._validate_oapg(arg, validation_metadata=validation_metadata) -class Int64Schema(Int64Base, IntSchema): +class Int64Schema( + Int64Base, + IntSchema +): pass class Float32Base: - __inclusive_minimum = decimal.Decimal(-3.4028234663852886e38) - __inclusive_maximum = decimal.Decimal(3.4028234663852886e38) + __inclusive_minimum = decimal.Decimal(-3.4028234663852886e+38) + __inclusive_maximum = decimal.Decimal(3.4028234663852886e+38) @classmethod - def __validate_format( - cls, - arg: typing.Optional[decimal.Decimal], - validation_metadata: ValidationMetadata, - ): + def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): if isinstance(arg, decimal.Decimal): if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: raise ApiValueError( - "Invalid value '{}' for type float at {}".format( - arg, validation_metadata.path_to_item - ) + "Invalid value '{}' for type float at {}".format(arg, validation_metadata.path_to_item) ) @classmethod @@ -2768,30 +2227,26 @@ def _validate_oapg( return super()._validate_oapg(arg, validation_metadata=validation_metadata) -class Float32Schema(Float32Base, NumberSchema): +class Float32Schema( + Float32Base, + NumberSchema +): + @classmethod - def from_openapi_data_oapg( - cls, arg: float, _configuration: typing.Optional[Configuration] = None - ): + def from_openapi_data_oapg(cls, arg: float, _configuration: typing.Optional[Configuration] = None): return super().from_openapi_data_oapg(arg, _configuration=_configuration) class Float64Base: - __inclusive_minimum = decimal.Decimal(-1.7976931348623157e308) - __inclusive_maximum = decimal.Decimal(1.7976931348623157e308) + __inclusive_minimum = decimal.Decimal(-1.7976931348623157E+308) + __inclusive_maximum = decimal.Decimal(1.7976931348623157E+308) @classmethod - def __validate_format( - cls, - arg: typing.Optional[decimal.Decimal], - validation_metadata: ValidationMetadata, - ): + def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): if isinstance(arg, decimal.Decimal): if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: raise ApiValueError( - "Invalid value '{}' for type double at {}".format( - arg, validation_metadata.path_to_item - ) + "Invalid value '{}' for type double at {}".format(arg, validation_metadata.path_to_item) ) @classmethod @@ -2806,17 +2261,22 @@ def _validate_oapg( cls.__validate_format(arg, validation_metadata=validation_metadata) return super()._validate_oapg(arg, validation_metadata=validation_metadata) +class Float64Schema( + Float64Base, + NumberSchema +): -class Float64Schema(Float64Base, NumberSchema): @classmethod - def from_openapi_data_oapg( - cls, arg: float, _configuration: typing.Optional[Configuration] = None - ): + def from_openapi_data_oapg(cls, arg: float, _configuration: typing.Optional[Configuration] = None): # todo check format return super().from_openapi_data_oapg(arg, _configuration=_configuration) -class StrSchema(StrBase, Schema, StrMixin): +class StrSchema( + StrBase, + Schema, + StrMixin +): """ date + datetime string types must inherit from this class That is because one can validate a str payload as both: @@ -2825,33 +2285,33 @@ class StrSchema(StrBase, Schema, StrMixin): """ @classmethod - def from_openapi_data_oapg( - cls, arg: str, _configuration: typing.Optional[Configuration] = None - ) -> "StrSchema": + def from_openapi_data_oapg(cls, arg: str, _configuration: typing.Optional[Configuration] = None) -> 'StrSchema': return super().from_openapi_data_oapg(arg, _configuration=_configuration) - def __new__( - cls, _arg: typing.Union[str, date, datetime, uuid.UUID], **kwargs: Configuration - ): + def __new__(cls, _arg: typing.Union[str, date, datetime, uuid.UUID], **kwargs: Configuration): return super().__new__(cls, _arg, **kwargs) class UUIDSchema(UUIDBase, StrSchema): + def __new__(cls, _arg: typing.Union[str, uuid.UUID], **kwargs: Configuration): return super().__new__(cls, _arg, **kwargs) class DateSchema(DateBase, StrSchema): + def __new__(cls, _arg: typing.Union[str, date], **kwargs: Configuration): return super().__new__(cls, _arg, **kwargs) class DateTimeSchema(DateTimeBase, StrSchema): + def __new__(cls, _arg: typing.Union[str, datetime], **kwargs: Configuration): return super().__new__(cls, _arg, **kwargs) class DecimalSchema(DecimalBase, StrSchema): + def __new__(cls, _arg: str, **kwargs: Configuration): """ Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads @@ -2864,16 +2324,21 @@ def __new__(cls, _arg: str, **kwargs: Configuration): return super().__new__(cls, _arg, **kwargs) -class BytesSchema(Schema, BytesMixin): +class BytesSchema( + Schema, + BytesMixin +): """ this class will subclass bytes and is immutable """ - def __new__(cls, _arg: bytes, **kwargs: Configuration): return super(Schema, cls).__new__(cls, _arg) -class FileSchema(Schema, FileMixin): +class FileSchema( + Schema, + FileMixin +): """ This class is NOT immutable Dynamic classes are built using it for example when AnyType allows in binary data @@ -2891,9 +2356,7 @@ class FileSchema(Schema, FileMixin): - to be able to preserve file name info """ - def __new__( - cls, _arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: Configuration - ): + def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: Configuration): return super(Schema, cls).__new__(cls, _arg) @@ -2901,7 +2364,12 @@ class BinaryBase: pass -class BinarySchema(ComposedBase, BinaryBase, Schema, BinaryMixin): +class BinarySchema( + ComposedBase, + BinaryBase, + Schema, + BinaryMixin +): class MetaOapg: @staticmethod def one_of(): @@ -2910,19 +2378,18 @@ def one_of(): FileSchema, ] - def __new__( - cls, - _arg: typing.Union[io.FileIO, io.BufferedReader, bytes], - **kwargs: Configuration, - ): + def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: Configuration): return super().__new__(cls, _arg) -class BoolSchema(BoolBase, Schema, BoolMixin): +class BoolSchema( + BoolBase, + Schema, + BoolMixin +): + @classmethod - def from_openapi_data_oapg( - cls, arg: bool, _configuration: typing.Optional[Configuration] = None - ): + def from_openapi_data_oapg(cls, arg: bool, _configuration: typing.Optional[Configuration] = None): return super().from_openapi_data_oapg(arg, _configuration=_configuration) def __new__(cls, _arg: bool, **kwargs: ValidationMetadata): @@ -2937,7 +2404,7 @@ class AnyTypeSchema( BoolBase, NoneBase, Schema, - NoneFrozenDictTupleStrDecimalBoolFileBytesMixin, + NoneFrozenDictTupleStrDecimalBoolFileBytesMixin ): # Python representation of a schema defined as true or {} pass @@ -2964,7 +2431,7 @@ def __new__( cls, *_args, _configuration: typing.Optional[Configuration] = None, - ) -> "NotAnyTypeSchema": + ) -> 'NotAnyTypeSchema': return super().__new__( cls, *_args, @@ -2972,55 +2439,26 @@ def __new__( ) -class DictSchema(DictBase, Schema, FrozenDictMixin): +class DictSchema( + DictBase, + Schema, + FrozenDictMixin +): @classmethod - def from_openapi_data_oapg( - cls, - arg: typing.Dict[str, typing.Any], - _configuration: typing.Optional[Configuration] = None, - ): + def from_openapi_data_oapg(cls, arg: typing.Dict[str, typing.Any], _configuration: typing.Optional[Configuration] = None): return super().from_openapi_data_oapg(arg, _configuration=_configuration) - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict], - **kwargs: typing.Union[ - dict, - frozendict.frozendict, - list, - tuple, - decimal.Decimal, - float, - int, - str, - date, - datetime, - bool, - None, - bytes, - Schema, - Unset, - ValidationMetadata, - ], - ): + def __new__(cls, *_args: typing.Union[dict, frozendict.frozendict], **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): return super().__new__(cls, *_args, **kwargs) -schema_type_classes = { - NoneSchema, - DictSchema, - ListSchema, - NumberSchema, - StrSchema, - BoolSchema, - AnyTypeSchema, -} +schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema} @functools.lru_cache() def get_new_class( class_name: str, - bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...], + bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...] ) -> typing.Type[Schema]: """ Returns a new class that is made with the subclass bases @@ -3034,4 +2472,4 @@ def get_new_class( def log_cache_usage(cache_fn): if LOG_CACHE_USAGE: - print(cache_fn.__name__, cache_fn.cache_info()) + print(cache_fn.__name__, cache_fn.cache_info()) \ No newline at end of file diff --git a/package/pyproject.toml b/package/pyproject.toml index 4f5bebd2..74636dad 100644 --- a/package/pyproject.toml +++ b/package/pyproject.toml @@ -61,6 +61,7 @@ url = "https://test.pypi.org/legacy/" exclude = [".venv"] # TODO: Figure out how to solve these by changing Mustache templates. ignore = [ + "E402", "F401", "E501", "F841", diff --git a/package/tests/test_evaluation.py b/package/tests/test_evaluation.py index 2f63e4f7..1321b8ed 100644 --- a/package/tests/test_evaluation.py +++ b/package/tests/test_evaluation.py @@ -273,3 +273,28 @@ def test_validate_construct_submission_prioritizes_override(): assert payload["branch"] == "test-branch-init" assert payload["commit"] == "test-commit-init" + + +def test_evaluation_get_test_sets(mocker, test_sets, setup_teardown_openai): + # Setup Gentrace mocked response for get_test_cases + headers = http.client.HTTPMessage() + headers.add_header("Content-Type", "application/json") + + body = json.dumps(test_sets, ensure_ascii=False).encode("utf-8") + + gentrace_response = HTTPResponse( + body=body, + headers=headers, + status=200, + reason="OK", + preload_content=False, + decode_content=True, + enforce_content_length=True, + ) + + gentrace_request = mocker.patch.object(gentrace.api_client.ApiClient, "request") + gentrace_request.return_value = gentrace_response + + test_sets = gentrace.get_test_sets() + + assert len(test_sets) == 3 From ce23627a3f2c51a9f1c3fe3952af85f77ab56722 Mon Sep 17 00:00:00 2001 From: Vivek Nair Date: Tue, 18 Jul 2023 11:05:02 -0400 Subject: [PATCH 2/3] fix: wip --- package/tests/test_evaluation.py | 2 +- package/tests/test_pinecone.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package/tests/test_evaluation.py b/package/tests/test_evaluation.py index 1321b8ed..fd6a93bc 100644 --- a/package/tests/test_evaluation.py +++ b/package/tests/test_evaluation.py @@ -297,4 +297,4 @@ def test_evaluation_get_test_sets(mocker, test_sets, setup_teardown_openai): test_sets = gentrace.get_test_sets() - assert len(test_sets) == 3 + assert len(test_sets) == 2 diff --git a/package/tests/test_pinecone.py b/package/tests/test_pinecone.py index 2b815495..cbe684f9 100644 --- a/package/tests/test_pinecone.py +++ b/package/tests/test_pinecone.py @@ -47,6 +47,8 @@ def test_pinecone_pipeline_fetch_server(setup_teardown_pinecone): def test_pinecone_pipeline_query_server(vector, setup_teardown_pinecone): responses.add_passthru(PINECONE_API_PATTERN) + print("api key", os.getenv("PINECONE_API_KEY")) + pipeline = gentrace.Pipeline( "test-gentrace-python-pipeline", host="http://localhost:3000/api/v1", From b571fc21333470c40e6b11b5a16a3e1bb252098a Mon Sep 17 00:00:00 2001 From: Vivek Nair Date: Tue, 18 Jul 2023 11:07:47 -0400 Subject: [PATCH 3/3] fix: wip --- package/tests/test_pinecone.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/package/tests/test_pinecone.py b/package/tests/test_pinecone.py index cbe684f9..2b815495 100644 --- a/package/tests/test_pinecone.py +++ b/package/tests/test_pinecone.py @@ -47,8 +47,6 @@ def test_pinecone_pipeline_fetch_server(setup_teardown_pinecone): def test_pinecone_pipeline_query_server(vector, setup_teardown_pinecone): responses.add_passthru(PINECONE_API_PATTERN) - print("api key", os.getenv("PINECONE_API_KEY")) - pipeline = gentrace.Pipeline( "test-gentrace-python-pipeline", host="http://localhost:3000/api/v1",