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
@@ -0,0 +1,152 @@
1
+ # Auto-generated by RestClientGenerator. DO NOT EDIT.
2
+
3
+ from typing import Any, Dict, List, Optional
4
+
5
+ from ccai.pychestrate.rest.client.models.runs import Run
6
+ from ccai.pychestrate.rest.client.models.runs import Runpage
7
+ from ccai.restclient.base.aspectsrest import AspectsRest
8
+ from ccai.restclient.base.restapigroup import RestApiGroup
9
+
10
+
11
+ class RunsApiGroup(RestApiGroup):
12
+ """
13
+ Run-state reads (`GET /runs/...`).
14
+ """
15
+
16
+ def runs_get_by_id(self, run_id: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Run:
17
+ """
18
+ Read a run.
19
+ """
20
+ client = self.client
21
+ if aspects is None:
22
+ aspects = client.aspects
23
+
24
+ header_params = client.headers
25
+ if headers is not None:
26
+ header_params = headers
27
+
28
+ leaf_template = "/runs/{run_id}"
29
+ path_params = {
30
+ 'run_id': run_id,
31
+ }
32
+ call_leaf = leaf_template.format(**path_params)
33
+
34
+ query_params = None
35
+
36
+
37
+ if exp_status is None:
38
+ exp_status = [200]
39
+
40
+ resp = client.perform_call(
41
+ leaf=call_leaf,
42
+ method="GET",
43
+ params=query_params if query_params else None,
44
+ body=None,
45
+ exp_status=exp_status,
46
+ headers=header_params if header_params else None,
47
+ context_msg=None,
48
+ aspects=aspects,
49
+ )
50
+ if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
51
+ rtnobj = None
52
+ else:
53
+ raw_data = resp.json()
54
+ rtnobj = Run.from_dict(raw_data)
55
+ return rtnobj
56
+
57
+ def runs_list(self, *, project_id: Optional[str] = None, pod_id: Optional[str] = None, state: Optional[str] = None, page: Optional[int] = 1, per_page: Optional[int] = 50, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Runpage:
58
+ """
59
+ List runs (with filters).
60
+ """
61
+ client = self.client
62
+ if aspects is None:
63
+ aspects = client.aspects
64
+
65
+ header_params = client.headers
66
+ if headers is not None:
67
+ header_params = headers
68
+
69
+ call_leaf = "/runs"
70
+
71
+ query_params = {}
72
+ if project_id is not None:
73
+ query_params['project_id'] = project_id
74
+ if pod_id is not None:
75
+ query_params['pod_id'] = pod_id
76
+ if state is not None:
77
+ query_params['state'] = state
78
+ if page is not None:
79
+ query_params['page'] = page
80
+ if per_page is not None:
81
+ query_params['per_page'] = per_page
82
+
83
+
84
+ if exp_status is None:
85
+ exp_status = [200]
86
+
87
+ resp = client.perform_call(
88
+ leaf=call_leaf,
89
+ method="GET",
90
+ params=query_params if query_params else None,
91
+ body=None,
92
+ exp_status=exp_status,
93
+ headers=header_params if header_params else None,
94
+ context_msg=None,
95
+ aspects=aspects,
96
+ )
97
+ if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
98
+ rtnobj = None
99
+ else:
100
+ raw_data = resp.json()
101
+ rtnobj = Runpage.from_dict(raw_data)
102
+ return rtnobj
103
+
104
+ def runs_subscribe_events(self, run_id: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
105
+ """
106
+ Subscribe to run events via Server-Sent Events.
107
+
108
+ Long-lived response stream encoded as `text/event-stream`
109
+ (Server-Sent Events). Each SSE frame's `data:` payload is a
110
+ JSON document conforming to the `RunEvent` schema; the SSE
111
+ `event:` line carries the event type
112
+ (`state_changed` | `progress` | `result_manifest` | `heartbeat`).
113
+
114
+ Clients should send `Accept: text/event-stream` and reconnect
115
+ with `Last-Event-ID` to resume from a known sequence number.
116
+
117
+ """
118
+ client = self.client
119
+ if aspects is None:
120
+ aspects = client.aspects
121
+
122
+ header_params = client.headers
123
+ if headers is not None:
124
+ header_params = headers
125
+
126
+ leaf_template = "/runs/{run_id}/events"
127
+ path_params = {
128
+ 'run_id': run_id,
129
+ }
130
+ call_leaf = leaf_template.format(**path_params)
131
+
132
+ query_params = None
133
+
134
+
135
+ if exp_status is None:
136
+ exp_status = [200]
137
+
138
+ resp = client.perform_call(
139
+ leaf=call_leaf,
140
+ method="GET",
141
+ params=query_params if query_params else None,
142
+ body=None,
143
+ exp_status=exp_status,
144
+ headers=header_params if header_params else None,
145
+ context_msg=None,
146
+ aspects=aspects,
147
+ )
148
+ if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
149
+ rtnval = None
150
+ else:
151
+ rtnval = resp.json()
152
+ return rtnval
@@ -0,0 +1,91 @@
1
+ # Auto-generated by RestClientGenerator. DO NOT EDIT.
2
+
3
+ from typing import Any, Dict, List, Optional
4
+
5
+ from ccai.pychestrate.rest.client.models.secrets import Secretref
6
+ from ccai.restclient.base.aspectsrest import AspectsRest
7
+ from ccai.restclient.base.restapigroup import RestApiGroup
8
+
9
+
10
+ class SecretsApiGroup(RestApiGroup):
11
+ """
12
+ Encrypted-secrets read API (writes are out-of-band today).
13
+ """
14
+
15
+ def secrets_get_by_ref(self, secret_ref: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Secretref:
16
+ """
17
+ Read a single secret reference (metadata only).
18
+ """
19
+ client = self.client
20
+ if aspects is None:
21
+ aspects = client.aspects
22
+
23
+ header_params = client.headers
24
+ if headers is not None:
25
+ header_params = headers
26
+
27
+ leaf_template = "/secrets/{secret_ref}"
28
+ path_params = {
29
+ 'secret_ref': secret_ref,
30
+ }
31
+ call_leaf = leaf_template.format(**path_params)
32
+
33
+ query_params = None
34
+
35
+
36
+ if exp_status is None:
37
+ exp_status = [200]
38
+
39
+ resp = client.perform_call(
40
+ leaf=call_leaf,
41
+ method="GET",
42
+ params=query_params if query_params else None,
43
+ body=None,
44
+ exp_status=exp_status,
45
+ headers=header_params if header_params else None,
46
+ context_msg=None,
47
+ aspects=aspects,
48
+ )
49
+ if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
50
+ rtnobj = None
51
+ else:
52
+ raw_data = resp.json()
53
+ rtnobj = Secretref.from_dict(raw_data)
54
+ return rtnobj
55
+
56
+ def secrets_list(self, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Dict[str, Any]:
57
+ """
58
+ List secret references (metadata only — no plaintext).
59
+ """
60
+ client = self.client
61
+ if aspects is None:
62
+ aspects = client.aspects
63
+
64
+ header_params = client.headers
65
+ if headers is not None:
66
+ header_params = headers
67
+
68
+ call_leaf = "/secrets"
69
+
70
+ query_params = None
71
+
72
+
73
+ if exp_status is None:
74
+ exp_status = [200]
75
+
76
+ resp = client.perform_call(
77
+ leaf=call_leaf,
78
+ method="GET",
79
+ params=query_params if query_params else None,
80
+ body=None,
81
+ exp_status=exp_status,
82
+ headers=header_params if header_params else None,
83
+ context_msg=None,
84
+ aspects=aspects,
85
+ )
86
+ if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
87
+ rtnval = None
88
+ else:
89
+ raw_data = resp.json()
90
+ rtnval = self._parse_item(raw_data, Dict[str, Any])
91
+ return rtnval
@@ -0,0 +1,216 @@
1
+ # Auto-generated by RestClientGenerator. DO NOT EDIT.
2
+
3
+ from typing import Any, Dict, List, Optional
4
+
5
+ from ccai.pychestrate.rest.client.models.tagging import Tagattachrequest
6
+ from ccai.restclient.base.aspectsrest import AspectsRest
7
+ from ccai.restclient.base.restapigroup import RestApiGroup
8
+
9
+
10
+ class TaggingApiGroup(RestApiGroup):
11
+ """
12
+ Shared tag model across entities.
13
+ """
14
+
15
+ def tagging_attach(self, entity_kind: str, entity_id: str, body: Tagattachrequest, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
16
+ """
17
+ Attach a tag to an entity.
18
+ """
19
+ client = self.client
20
+ if aspects is None:
21
+ aspects = client.aspects
22
+
23
+ header_params = client.headers
24
+ if headers is not None:
25
+ header_params = headers
26
+
27
+ leaf_template = "/tags/{entity_kind}/{entity_id}"
28
+ path_params = {
29
+ 'entity_kind': entity_kind,
30
+ 'entity_id': entity_id,
31
+ }
32
+ call_leaf = leaf_template.format(**path_params)
33
+
34
+ query_params = None
35
+
36
+
37
+ if exp_status is None:
38
+ exp_status = [201]
39
+
40
+ resp = client.perform_call(
41
+ leaf=call_leaf,
42
+ method="POST",
43
+ params=query_params if query_params else None,
44
+ body=body,
45
+ exp_status=exp_status,
46
+ headers=header_params if header_params else None,
47
+ context_msg=None,
48
+ aspects=aspects,
49
+ )
50
+ if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
51
+ rtnval = None
52
+ else:
53
+ rtnval = resp.json()
54
+ return rtnval
55
+
56
+ def tagging_detach(self, entity_kind: str, entity_id: str, tag: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
57
+ """
58
+ Detach a tag from an entity.
59
+ """
60
+ client = self.client
61
+ if aspects is None:
62
+ aspects = client.aspects
63
+
64
+ header_params = client.headers
65
+ if headers is not None:
66
+ header_params = headers
67
+
68
+ leaf_template = "/tags/{entity_kind}/{entity_id}/{tag}"
69
+ path_params = {
70
+ 'entity_kind': entity_kind,
71
+ 'entity_id': entity_id,
72
+ 'tag': tag,
73
+ }
74
+ call_leaf = leaf_template.format(**path_params)
75
+
76
+ query_params = None
77
+
78
+
79
+ if exp_status is None:
80
+ exp_status = [204]
81
+
82
+ resp = client.perform_call(
83
+ leaf=call_leaf,
84
+ method="DELETE",
85
+ params=query_params if query_params else None,
86
+ body=None,
87
+ exp_status=exp_status,
88
+ headers=header_params if header_params else None,
89
+ context_msg=None,
90
+ aspects=aspects,
91
+ )
92
+ if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
93
+ rtnval = None
94
+ else:
95
+ rtnval = resp.json()
96
+ return rtnval
97
+
98
+ def tagging_list_for_entity(self, entity_kind: str, entity_id: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Dict[str, Any]:
99
+ """
100
+ List tags attached to an entity.
101
+ """
102
+ client = self.client
103
+ if aspects is None:
104
+ aspects = client.aspects
105
+
106
+ header_params = client.headers
107
+ if headers is not None:
108
+ header_params = headers
109
+
110
+ leaf_template = "/tags/{entity_kind}/{entity_id}"
111
+ path_params = {
112
+ 'entity_kind': entity_kind,
113
+ 'entity_id': entity_id,
114
+ }
115
+ call_leaf = leaf_template.format(**path_params)
116
+
117
+ query_params = None
118
+
119
+
120
+ if exp_status is None:
121
+ exp_status = [200]
122
+
123
+ resp = client.perform_call(
124
+ leaf=call_leaf,
125
+ method="GET",
126
+ params=query_params if query_params else None,
127
+ body=None,
128
+ exp_status=exp_status,
129
+ headers=header_params if header_params else None,
130
+ context_msg=None,
131
+ aspects=aspects,
132
+ )
133
+ if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
134
+ rtnval = None
135
+ else:
136
+ raw_data = resp.json()
137
+ rtnval = self._parse_item(raw_data, Dict[str, Any])
138
+ return rtnval
139
+
140
+ def tagging_list_taxonomies(self, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Dict[str, Any]:
141
+ """
142
+ List declared tag taxonomies.
143
+ """
144
+ client = self.client
145
+ if aspects is None:
146
+ aspects = client.aspects
147
+
148
+ header_params = client.headers
149
+ if headers is not None:
150
+ header_params = headers
151
+
152
+ call_leaf = "/tags/taxonomies"
153
+
154
+ query_params = None
155
+
156
+
157
+ if exp_status is None:
158
+ exp_status = [200]
159
+
160
+ resp = client.perform_call(
161
+ leaf=call_leaf,
162
+ method="GET",
163
+ params=query_params if query_params else None,
164
+ body=None,
165
+ exp_status=exp_status,
166
+ headers=header_params if header_params else None,
167
+ context_msg=None,
168
+ aspects=aspects,
169
+ )
170
+ if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
171
+ rtnval = None
172
+ else:
173
+ raw_data = resp.json()
174
+ rtnval = self._parse_item(raw_data, Dict[str, Any])
175
+ return rtnval
176
+
177
+ def tagging_search(self, *, q: Optional[str] = None, taxonomy: Optional[str] = None, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Dict[str, Any]:
178
+ """
179
+ Search tag definitions.
180
+ """
181
+ client = self.client
182
+ if aspects is None:
183
+ aspects = client.aspects
184
+
185
+ header_params = client.headers
186
+ if headers is not None:
187
+ header_params = headers
188
+
189
+ call_leaf = "/tags/search"
190
+
191
+ query_params = {}
192
+ if q is not None:
193
+ query_params['q'] = q
194
+ if taxonomy is not None:
195
+ query_params['taxonomy'] = taxonomy
196
+
197
+
198
+ if exp_status is None:
199
+ exp_status = [200]
200
+
201
+ resp = client.perform_call(
202
+ leaf=call_leaf,
203
+ method="GET",
204
+ params=query_params if query_params else None,
205
+ body=None,
206
+ exp_status=exp_status,
207
+ headers=header_params if header_params else None,
208
+ context_msg=None,
209
+ aspects=aspects,
210
+ )
211
+ if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
212
+ rtnval = None
213
+ else:
214
+ raw_data = resp.json()
215
+ rtnval = self._parse_item(raw_data, Dict[str, Any])
216
+ return rtnval
@@ -0,0 +1,152 @@
1
+ # Auto-generated by RestClientGenerator. DO NOT EDIT.
2
+
3
+ from typing import Any, Dict, List, Optional
4
+
5
+ from ccai.pychestrate.rest.client.models.testcatalog import Testcatalogentry
6
+ from ccai.pychestrate.rest.client.models.testcatalog import Testcatalogentrypage
7
+ from ccai.pychestrate.rest.client.models.testcatalog import Testcatalogentryupsertrequest
8
+ from ccai.pychestrate.rest.client.models.testcatalog import Testcatalogimportrequest
9
+ from ccai.restclient.base.aspectsrest import AspectsRest
10
+ from ccai.restclient.base.restapigroup import RestApiGroup
11
+
12
+
13
+ class TestCatalogApiGroup(RestApiGroup):
14
+ """
15
+ Per-project test-catalog entries.
16
+ """
17
+
18
+ def test_catalog_import(self, project_id: str, body: Testcatalogimportrequest, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
19
+ """
20
+ Run a test-catalog importer (e.g., testbase project discovery).
21
+
22
+ Invokes the named importer (resolved via the
23
+ `test_catalog_importer` factory protocol) against the project.
24
+ Each import overwrites entries with the same
25
+ `(project_id, importer_tag, entry_key)` key in place.
26
+
27
+ """
28
+ client = self.client
29
+ if aspects is None:
30
+ aspects = client.aspects
31
+
32
+ header_params = client.headers
33
+ if headers is not None:
34
+ header_params = headers
35
+
36
+ leaf_template = "/projects/{project_id}/test-catalog:import"
37
+ path_params = {
38
+ 'project_id': project_id,
39
+ }
40
+ call_leaf = leaf_template.format(**path_params)
41
+
42
+ query_params = None
43
+
44
+
45
+ if exp_status is None:
46
+ exp_status = [202]
47
+
48
+ resp = client.perform_call(
49
+ leaf=call_leaf,
50
+ method="POST",
51
+ params=query_params if query_params else None,
52
+ body=body,
53
+ exp_status=exp_status,
54
+ headers=header_params if header_params else None,
55
+ context_msg=None,
56
+ aspects=aspects,
57
+ )
58
+ if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
59
+ rtnval = None
60
+ else:
61
+ rtnval = resp.json()
62
+ return rtnval
63
+
64
+ def test_catalog_list(self, project_id: str, *, importer_tag: Optional[str] = None, include_retired: Optional[bool] = False, page: Optional[int] = 1, per_page: Optional[int] = 50, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Testcatalogentrypage:
65
+ """
66
+ List test-catalog entries for a project.
67
+ """
68
+ client = self.client
69
+ if aspects is None:
70
+ aspects = client.aspects
71
+
72
+ header_params = client.headers
73
+ if headers is not None:
74
+ header_params = headers
75
+
76
+ leaf_template = "/projects/{project_id}/test-catalog"
77
+ path_params = {
78
+ 'project_id': project_id,
79
+ }
80
+ call_leaf = leaf_template.format(**path_params)
81
+
82
+ query_params = {}
83
+ if importer_tag is not None:
84
+ query_params['importer_tag'] = importer_tag
85
+ if include_retired is not None:
86
+ query_params['include_retired'] = include_retired
87
+ if page is not None:
88
+ query_params['page'] = page
89
+ if per_page is not None:
90
+ query_params['per_page'] = per_page
91
+
92
+
93
+ if exp_status is None:
94
+ exp_status = [200]
95
+
96
+ resp = client.perform_call(
97
+ leaf=call_leaf,
98
+ method="GET",
99
+ params=query_params if query_params else None,
100
+ body=None,
101
+ exp_status=exp_status,
102
+ headers=header_params if header_params else None,
103
+ context_msg=None,
104
+ aspects=aspects,
105
+ )
106
+ if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
107
+ rtnobj = None
108
+ else:
109
+ raw_data = resp.json()
110
+ rtnobj = Testcatalogentrypage.from_dict(raw_data)
111
+ return rtnobj
112
+
113
+ def test_catalog_upsert(self, project_id: str, body: Testcatalogentryupsertrequest, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Testcatalogentry:
114
+ """
115
+ Upsert a test-catalog entry.
116
+ """
117
+ client = self.client
118
+ if aspects is None:
119
+ aspects = client.aspects
120
+
121
+ header_params = client.headers
122
+ if headers is not None:
123
+ header_params = headers
124
+
125
+ leaf_template = "/projects/{project_id}/test-catalog"
126
+ path_params = {
127
+ 'project_id': project_id,
128
+ }
129
+ call_leaf = leaf_template.format(**path_params)
130
+
131
+ query_params = None
132
+
133
+
134
+ if exp_status is None:
135
+ exp_status = [200]
136
+
137
+ resp = client.perform_call(
138
+ leaf=call_leaf,
139
+ method="POST",
140
+ params=query_params if query_params else None,
141
+ body=body,
142
+ exp_status=exp_status,
143
+ headers=header_params if header_params else None,
144
+ context_msg=None,
145
+ aspects=aspects,
146
+ )
147
+ if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
148
+ rtnobj = None
149
+ else:
150
+ raw_data = resp.json()
151
+ rtnobj = Testcatalogentry.from_dict(raw_data)
152
+ return rtnobj
@@ -0,0 +1,58 @@
1
+ # Auto-generated by RestClientGenerator. DO NOT EDIT.
2
+
3
+ from typing import Any, Dict, List, Optional
4
+
5
+ from ccai.pychestrate.rest.client.models.testruns import Testruncreaterequest
6
+ from ccai.restclient.base.aspectsrest import AspectsRest
7
+ from ccai.restclient.base.restapigroup import RestApiGroup
8
+
9
+
10
+ class TestRunsApiGroup(RestApiGroup):
11
+ """
12
+ Trigger a new test run on a project + pod.
13
+ """
14
+
15
+ def test_runs_trigger(self, project_id: str, body: Testruncreaterequest, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
16
+ """
17
+ Trigger a new test run on a project.
18
+
19
+ Creates a new run from a catalog entry and a pod selector.
20
+ Returns the freshly-created run in `PENDING` state; the
21
+ dispatcher transitions it to `DISPATCHING` asynchronously.
22
+
23
+ """
24
+ client = self.client
25
+ if aspects is None:
26
+ aspects = client.aspects
27
+
28
+ header_params = client.headers
29
+ if headers is not None:
30
+ header_params = headers
31
+
32
+ leaf_template = "/projects/{project_id}/test-runs"
33
+ path_params = {
34
+ 'project_id': project_id,
35
+ }
36
+ call_leaf = leaf_template.format(**path_params)
37
+
38
+ query_params = None
39
+
40
+
41
+ if exp_status is None:
42
+ exp_status = [202]
43
+
44
+ resp = client.perform_call(
45
+ leaf=call_leaf,
46
+ method="POST",
47
+ params=query_params if query_params else None,
48
+ body=body,
49
+ exp_status=exp_status,
50
+ headers=header_params if header_params else None,
51
+ context_msg=None,
52
+ aspects=aspects,
53
+ )
54
+ if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
55
+ rtnval = None
56
+ else:
57
+ rtnval = resp.json()
58
+ return rtnval