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.
Files changed (84) hide show
  1. ccai/pychestrate/py.typed +0 -0
  2. ccai/pychestrate/rest/client/__init__.py +0 -0
  3. ccai/pychestrate/rest/client/generation/__init__.py +0 -0
  4. ccai/pychestrate/rest/client/generation/pychestraterestclientgenerator.py +98 -0
  5. ccai/pychestrate/rest/client/generation/specs/pychestrate.yaml +3757 -0
  6. ccai/pychestrate/rest/client/groups/__init__.py +0 -0
  7. ccai/pychestrate/rest/client/groups/agents.py +171 -0
  8. ccai/pychestrate/rest/client/groups/artifacts.py +103 -0
  9. ccai/pychestrate/rest/client/groups/audit.py +99 -0
  10. ccai/pychestrate/rest/client/groups/auth.py +55 -0
  11. ccai/pychestrate/rest/client/groups/clients.py +287 -0
  12. ccai/pychestrate/rest/client/groups/dispatch.py +118 -0
  13. ccai/pychestrate/rest/client/groups/enrollment.py +212 -0
  14. ccai/pychestrate/rest/client/groups/flags.py +332 -0
  15. ccai/pychestrate/rest/client/groups/me.py +55 -0
  16. ccai/pychestrate/rest/client/groups/notifications.py +128 -0
  17. ccai/pychestrate/rest/client/groups/pluginapi.py +128 -0
  18. ccai/pychestrate/rest/client/groups/pods.py +558 -0
  19. ccai/pychestrate/rest/client/groups/progress.py +64 -0
  20. ccai/pychestrate/rest/client/groups/projects.py +420 -0
  21. ccai/pychestrate/rest/client/groups/projecttemplates.py +91 -0
  22. ccai/pychestrate/rest/client/groups/rbac.py +243 -0
  23. ccai/pychestrate/rest/client/groups/results.py +193 -0
  24. ccai/pychestrate/rest/client/groups/retention.py +169 -0
  25. ccai/pychestrate/rest/client/groups/runs.py +152 -0
  26. ccai/pychestrate/rest/client/groups/secrets.py +91 -0
  27. ccai/pychestrate/rest/client/groups/tagging.py +216 -0
  28. ccai/pychestrate/rest/client/groups/testcatalog.py +152 -0
  29. ccai/pychestrate/rest/client/groups/testruns.py +58 -0
  30. ccai/pychestrate/rest/client/groups/users.py +91 -0
  31. ccai/pychestrate/rest/client/groups/variables.py +228 -0
  32. ccai/pychestrate/rest/client/models/__init__.py +0 -0
  33. ccai/pychestrate/rest/client/models/agents.py +34 -0
  34. ccai/pychestrate/rest/client/models/artifactlocaluploadresult.py +18 -0
  35. ccai/pychestrate/rest/client/models/artifacts.py +24 -0
  36. ccai/pychestrate/rest/client/models/artifactuploadtarget.py +20 -0
  37. ccai/pychestrate/rest/client/models/audit.py +18 -0
  38. ccai/pychestrate/rest/client/models/auth.py +15 -0
  39. ccai/pychestrate/rest/client/models/capabilityentry.py +15 -0
  40. ccai/pychestrate/rest/client/models/client.py +19 -0
  41. ccai/pychestrate/rest/client/models/clients.py +40 -0
  42. ccai/pychestrate/rest/client/models/dispatch.py +26 -0
  43. ccai/pychestrate/rest/client/models/enrollment.py +39 -0
  44. ccai/pychestrate/rest/client/models/flags.py +55 -0
  45. ccai/pychestrate/rest/client/models/jobdeadline.py +11 -0
  46. ccai/pychestrate/rest/client/models/jobenvelope.py +38 -0
  47. ccai/pychestrate/rest/client/models/jobforwardinginfo.py +12 -0
  48. ccai/pychestrate/rest/client/models/jobpipelineref.py +11 -0
  49. ccai/pychestrate/rest/client/models/jobrefs.py +14 -0
  50. ccai/pychestrate/rest/client/models/jobresultslocator.py +11 -0
  51. ccai/pychestrate/rest/client/models/me.py +14 -0
  52. ccai/pychestrate/rest/client/models/notifications.py +24 -0
  53. ccai/pychestrate/rest/client/models/pagemeta.py +18 -0
  54. ccai/pychestrate/rest/client/models/pluginapi.py +21 -0
  55. ccai/pychestrate/rest/client/models/podmember.py +14 -0
  56. ccai/pychestrate/rest/client/models/pods.py +75 -0
  57. ccai/pychestrate/rest/client/models/podtopologylink.py +15 -0
  58. ccai/pychestrate/rest/client/models/problem.py +19 -0
  59. ccai/pychestrate/rest/client/models/progress.py +18 -0
  60. ccai/pychestrate/rest/client/models/progressrecord.py +26 -0
  61. ccai/pychestrate/rest/client/models/progresssummary.py +29 -0
  62. ccai/pychestrate/rest/client/models/projects.py +49 -0
  63. ccai/pychestrate/rest/client/models/projecttemplates.py +14 -0
  64. ccai/pychestrate/rest/client/models/rbac.py +46 -0
  65. ccai/pychestrate/rest/client/models/results.py +56 -0
  66. ccai/pychestrate/rest/client/models/retention.py +26 -0
  67. ccai/pychestrate/rest/client/models/runevent.py +25 -0
  68. ccai/pychestrate/rest/client/models/runs.py +32 -0
  69. ccai/pychestrate/rest/client/models/scopedsecret.py +13 -0
  70. ccai/pychestrate/rest/client/models/secrets.py +16 -0
  71. ccai/pychestrate/rest/client/models/signingkey.py +19 -0
  72. ccai/pychestrate/rest/client/models/tagging.py +24 -0
  73. ccai/pychestrate/rest/client/models/testcatalog.py +50 -0
  74. ccai/pychestrate/rest/client/models/testcatalogimportsummary.py +16 -0
  75. ccai/pychestrate/rest/client/models/testruns.py +25 -0
  76. ccai/pychestrate/rest/client/models/users.py +23 -0
  77. ccai/pychestrate/rest/client/models/variableeffectiveentry.py +13 -0
  78. ccai/pychestrate/rest/client/models/variables.py +30 -0
  79. ccai/pychestrate/rest/client/pychestraterestclient.py +166 -0
  80. ccai/pychestrate/rest/client/pychestraterestclientbase.py +147 -0
  81. codecraftai_restclient_pychestrate-1.2.0.dist-info/METADATA +96 -0
  82. codecraftai_restclient_pychestrate-1.2.0.dist-info/RECORD +84 -0
  83. codecraftai_restclient_pychestrate-1.2.0.dist-info/WHEEL +4 -0
  84. 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()