codecraftai-restclient-pychestrate 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccai/pychestrate/py.typed +0 -0
- ccai/pychestrate/rest/client/__init__.py +0 -0
- ccai/pychestrate/rest/client/generation/__init__.py +0 -0
- ccai/pychestrate/rest/client/generation/pychestraterestclientgenerator.py +98 -0
- ccai/pychestrate/rest/client/generation/specs/pychestrate.yaml +3757 -0
- ccai/pychestrate/rest/client/groups/__init__.py +0 -0
- ccai/pychestrate/rest/client/groups/agents.py +171 -0
- ccai/pychestrate/rest/client/groups/artifacts.py +103 -0
- ccai/pychestrate/rest/client/groups/audit.py +99 -0
- ccai/pychestrate/rest/client/groups/auth.py +55 -0
- ccai/pychestrate/rest/client/groups/clients.py +287 -0
- ccai/pychestrate/rest/client/groups/dispatch.py +118 -0
- ccai/pychestrate/rest/client/groups/enrollment.py +212 -0
- ccai/pychestrate/rest/client/groups/flags.py +332 -0
- ccai/pychestrate/rest/client/groups/me.py +55 -0
- ccai/pychestrate/rest/client/groups/notifications.py +128 -0
- ccai/pychestrate/rest/client/groups/pluginapi.py +128 -0
- ccai/pychestrate/rest/client/groups/pods.py +558 -0
- ccai/pychestrate/rest/client/groups/progress.py +64 -0
- ccai/pychestrate/rest/client/groups/projects.py +420 -0
- ccai/pychestrate/rest/client/groups/projecttemplates.py +91 -0
- ccai/pychestrate/rest/client/groups/rbac.py +243 -0
- ccai/pychestrate/rest/client/groups/results.py +193 -0
- ccai/pychestrate/rest/client/groups/retention.py +169 -0
- ccai/pychestrate/rest/client/groups/runs.py +152 -0
- ccai/pychestrate/rest/client/groups/secrets.py +91 -0
- ccai/pychestrate/rest/client/groups/tagging.py +216 -0
- ccai/pychestrate/rest/client/groups/testcatalog.py +152 -0
- ccai/pychestrate/rest/client/groups/testruns.py +58 -0
- ccai/pychestrate/rest/client/groups/users.py +91 -0
- ccai/pychestrate/rest/client/groups/variables.py +228 -0
- ccai/pychestrate/rest/client/models/__init__.py +0 -0
- ccai/pychestrate/rest/client/models/agents.py +34 -0
- ccai/pychestrate/rest/client/models/artifactlocaluploadresult.py +18 -0
- ccai/pychestrate/rest/client/models/artifacts.py +24 -0
- ccai/pychestrate/rest/client/models/artifactuploadtarget.py +20 -0
- ccai/pychestrate/rest/client/models/audit.py +18 -0
- ccai/pychestrate/rest/client/models/auth.py +15 -0
- ccai/pychestrate/rest/client/models/capabilityentry.py +15 -0
- ccai/pychestrate/rest/client/models/client.py +19 -0
- ccai/pychestrate/rest/client/models/clients.py +40 -0
- ccai/pychestrate/rest/client/models/dispatch.py +26 -0
- ccai/pychestrate/rest/client/models/enrollment.py +39 -0
- ccai/pychestrate/rest/client/models/flags.py +55 -0
- ccai/pychestrate/rest/client/models/jobdeadline.py +11 -0
- ccai/pychestrate/rest/client/models/jobenvelope.py +38 -0
- ccai/pychestrate/rest/client/models/jobforwardinginfo.py +12 -0
- ccai/pychestrate/rest/client/models/jobpipelineref.py +11 -0
- ccai/pychestrate/rest/client/models/jobrefs.py +14 -0
- ccai/pychestrate/rest/client/models/jobresultslocator.py +11 -0
- ccai/pychestrate/rest/client/models/me.py +14 -0
- ccai/pychestrate/rest/client/models/notifications.py +24 -0
- ccai/pychestrate/rest/client/models/pagemeta.py +18 -0
- ccai/pychestrate/rest/client/models/pluginapi.py +21 -0
- ccai/pychestrate/rest/client/models/podmember.py +14 -0
- ccai/pychestrate/rest/client/models/pods.py +75 -0
- ccai/pychestrate/rest/client/models/podtopologylink.py +15 -0
- ccai/pychestrate/rest/client/models/problem.py +19 -0
- ccai/pychestrate/rest/client/models/progress.py +18 -0
- ccai/pychestrate/rest/client/models/progressrecord.py +26 -0
- ccai/pychestrate/rest/client/models/progresssummary.py +29 -0
- ccai/pychestrate/rest/client/models/projects.py +49 -0
- ccai/pychestrate/rest/client/models/projecttemplates.py +14 -0
- ccai/pychestrate/rest/client/models/rbac.py +46 -0
- ccai/pychestrate/rest/client/models/results.py +56 -0
- ccai/pychestrate/rest/client/models/retention.py +26 -0
- ccai/pychestrate/rest/client/models/runevent.py +25 -0
- ccai/pychestrate/rest/client/models/runs.py +32 -0
- ccai/pychestrate/rest/client/models/scopedsecret.py +13 -0
- ccai/pychestrate/rest/client/models/secrets.py +16 -0
- ccai/pychestrate/rest/client/models/signingkey.py +19 -0
- ccai/pychestrate/rest/client/models/tagging.py +24 -0
- ccai/pychestrate/rest/client/models/testcatalog.py +50 -0
- ccai/pychestrate/rest/client/models/testcatalogimportsummary.py +16 -0
- ccai/pychestrate/rest/client/models/testruns.py +25 -0
- ccai/pychestrate/rest/client/models/users.py +23 -0
- ccai/pychestrate/rest/client/models/variableeffectiveentry.py +13 -0
- ccai/pychestrate/rest/client/models/variables.py +30 -0
- ccai/pychestrate/rest/client/pychestraterestclient.py +166 -0
- ccai/pychestrate/rest/client/pychestraterestclientbase.py +147 -0
- codecraftai_restclient_pychestrate-1.2.0.dist-info/METADATA +96 -0
- codecraftai_restclient_pychestrate-1.2.0.dist-info/RECORD +84 -0
- codecraftai_restclient_pychestrate-1.2.0.dist-info/WHEEL +4 -0
- codecraftai_restclient_pychestrate-1.2.0.dist-info/licenses/LICENSE.md +204 -0
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"""
|
|
2
|
+
.. module:: pychestraterestclientgenerator
|
|
3
|
+
:platform: Darwin, Linux, Unix, Windows
|
|
4
|
+
:synopsis: Pychestrate REST client generator with project-specific configuration.
|
|
5
|
+
|
|
6
|
+
.. moduleauthor:: Myron Walker <myron.walker@gmail.com>
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import os
|
|
12
|
+
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
from ccai.restclient.base.restclientgenerator import RestClientGenerator
|
|
16
|
+
|
|
17
|
+
from ccai.pychestrate.rest.client.pychestraterestclientbase import PychestrateRestClientBase
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class PychestrateRestClientGenerator(RestClientGenerator):
|
|
21
|
+
"""
|
|
22
|
+
Pychestrate REST client generator.
|
|
23
|
+
|
|
24
|
+
The base ``RestClientGenerator`` emits schema modules into a sibling
|
|
25
|
+
directory named ``schemas/`` next to the generated ``groups/`` directory.
|
|
26
|
+
This subclass renames that directory to ``models/`` to match the
|
|
27
|
+
convention preferred by the Pychestrate consumer, while leaving the
|
|
28
|
+
rest of the generator behaviour identical.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
REST_CLIENT_BASE_CLASS = PychestrateRestClientBase
|
|
32
|
+
|
|
33
|
+
CLIENT_MODULE_ROOT = "ccai.pychestrate.rest.client"
|
|
34
|
+
SCHEMA_MODULE_ROOT = "ccai.pychestrate.rest.client.models"
|
|
35
|
+
GROUP_MODULE_ROOT = "ccai.pychestrate.rest.client.groups"
|
|
36
|
+
|
|
37
|
+
def generate(self):
|
|
38
|
+
"""
|
|
39
|
+
Generate all client, group, and schema modules.
|
|
40
|
+
|
|
41
|
+
Mirrors the parent generator but writes schemas into a
|
|
42
|
+
``models/`` directory instead of ``schemas/``.
|
|
43
|
+
"""
|
|
44
|
+
clients_root = self._clients_root
|
|
45
|
+
groups_dir = clients_root / "groups"
|
|
46
|
+
schemas_dir = clients_root / "models"
|
|
47
|
+
|
|
48
|
+
for directory in (groups_dir, schemas_dir):
|
|
49
|
+
directory.mkdir(parents=True, exist_ok=True)
|
|
50
|
+
|
|
51
|
+
self._generate_schema_modules(schemas_dir)
|
|
52
|
+
|
|
53
|
+
sorted_groups = sorted(self._groups.keys())
|
|
54
|
+
|
|
55
|
+
for group in sorted_groups:
|
|
56
|
+
ops = sorted(self._groups[group], key=lambda o: self._safe_snake(o.method_name))
|
|
57
|
+
self._generate_group_module(group, ops, groups_dir)
|
|
58
|
+
|
|
59
|
+
self._generate_client_module(sorted_groups, clients_root)
|
|
60
|
+
self._write_simple_init(groups_dir)
|
|
61
|
+
self._write_schemas_init(schemas_dir)
|
|
62
|
+
self._write_simple_init(clients_root)
|
|
63
|
+
return
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def pychestrate_rest_client_generator_main():
|
|
67
|
+
"""
|
|
68
|
+
Entry point used to generate the Pychestrate REST client code from the
|
|
69
|
+
OpenAPI specification embedded in this package.
|
|
70
|
+
"""
|
|
71
|
+
this_file = __file__
|
|
72
|
+
this_dir = os.path.dirname(this_file)
|
|
73
|
+
client_root = os.path.dirname(this_dir)
|
|
74
|
+
|
|
75
|
+
specs_dir = os.path.join(this_dir, "specs")
|
|
76
|
+
openapi_specfile = os.path.join(specs_dir, "pychestrate.yaml")
|
|
77
|
+
|
|
78
|
+
if not os.path.exists(openapi_specfile):
|
|
79
|
+
errmsg_lines = [
|
|
80
|
+
"Pychestrate OpenAPI spec file not found.",
|
|
81
|
+
f" EXPECTED: {openapi_specfile}",
|
|
82
|
+
" Refresh the spec by copying it from pychestrate-service:",
|
|
83
|
+
" pychestrate-service/specs/openapi/pychestrate.yaml",
|
|
84
|
+
]
|
|
85
|
+
errmsg = os.linesep.join(errmsg_lines)
|
|
86
|
+
raise FileNotFoundError(errmsg)
|
|
87
|
+
|
|
88
|
+
generator = PychestrateRestClientGenerator(
|
|
89
|
+
openapi_spec_file=openapi_specfile,
|
|
90
|
+
clients_root=client_root,
|
|
91
|
+
client_class_name="PychestrateRestClient",
|
|
92
|
+
)
|
|
93
|
+
generator.generate()
|
|
94
|
+
return
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
if __name__ == "__main__":
|
|
98
|
+
pychestrate_rest_client_generator_main()
|