alita-sdk 0.3.215__py3-none-any.whl → 0.3.216__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.
@@ -0,0 +1,904 @@
1
+ import json
2
+ from typing import Optional, Generator
3
+ from pydantic import model_validator, create_model, Field, SecretStr, PrivateAttr
4
+
5
+ from .client import ZephyrEssentialAPI
6
+ from ..elitea_base import extend_with_vector_tools, BaseVectorStoreToolApiWrapper
7
+ from langchain_core.documents import Document
8
+ from langchain_core.tools import ToolException
9
+
10
+ class ZephyrEssentialApiWrapper(BaseVectorStoreToolApiWrapper):
11
+ token: SecretStr
12
+ _client: ZephyrEssentialAPI = PrivateAttr()
13
+
14
+ @model_validator(mode='before')
15
+ @classmethod
16
+ def validate_toolkit(cls, values):
17
+ base_url = values.get("base_url", "https://prod-api.zephyr4jiracloud.com/v2")
18
+ token = values.get("token", None)
19
+ if not token:
20
+ raise ValueError("token is required.")
21
+ cls._client = ZephyrEssentialAPI(
22
+ base_url=base_url,
23
+ token=token
24
+ )
25
+ return values
26
+
27
+ def list_test_cases(self, project_key: Optional[str] = None, folder_id: Optional[str] = None, max_results: int = None, start_at: int = None):
28
+ """List test cases with optional filters."""
29
+ return self._client.list_test_cases(project_key=project_key, folder_id=folder_id, max_results=max_results, start_at=start_at)['values']
30
+
31
+ def create_test_case(self, json: str):
32
+ """Create a new test case."""
33
+ test_case_data = self._parse_json(json)
34
+ return self._client.create_test_case(test_case_data)
35
+
36
+ def get_test_case(self, test_case_key: str):
37
+ """Retrieve details of a specific test case."""
38
+ return self._client.get_test_case(test_case_key)
39
+
40
+ def update_test_case(self, test_case_key: str, json: str):
41
+ """Update an existing test case."""
42
+ test_case_data = self._parse_json(json)
43
+ return self._client.update_test_case(test_case_key, test_case_data)
44
+
45
+ def get_test_case_links(self, test_case_key: str):
46
+ """Retrieve links associated with a test case."""
47
+ return self._client.get_test_case_links(test_case_key)
48
+
49
+ def create_test_case_issue_link(self, test_case_key: str, json: str):
50
+ """Create an issue link for a test case."""
51
+ issue_link_data = self._parse_json(json)
52
+ return self._client.create_test_case_issue_link(test_case_key, issue_link_data)
53
+
54
+ def create_test_case_web_link(self, test_case_key: str, json: str):
55
+ """Create a web link for a test case."""
56
+ web_link_data = self._parse_json(json)
57
+ return self._client.create_test_case_web_link(test_case_key, web_link_data)
58
+
59
+ def list_test_case_versions(self, test_case_key: str, max_results: int = None, start_at: int = None):
60
+ """List versions of a test case."""
61
+ return self._client.list_test_case_versions(test_case_key, max_results=max_results, start_at=start_at)
62
+
63
+ def get_test_case_version(self, test_case_key: str, version: int):
64
+ """Retrieve a specific version of a test case."""
65
+ return self._client.get_test_case_version(test_case_key, version)
66
+
67
+ def get_test_case_test_script(self, test_case_key: str):
68
+ """Retrieve the test script of a test case."""
69
+ try:
70
+ return self._client.get_test_case_test_script(test_case_key)
71
+ except Exception as e:
72
+ return ToolException(f"Failed while receiving test steps: {e}")
73
+
74
+ def create_test_case_test_script(self, test_case_key: str, json: str):
75
+ """Create a test script for a test case."""
76
+ test_script_data = self._parse_json(json)
77
+ return self._client.create_test_case_test_script(test_case_key, test_script_data)
78
+
79
+ def get_test_case_test_steps(self, test_case_key: str, max_results: int = None, start_at: int = None):
80
+ """List test steps of a test case."""
81
+ try:
82
+ return self._client.get_test_case_test_steps(test_case_key, max_results=max_results, start_at=start_at)["values"]
83
+ except Exception as e:
84
+ return ToolException(f"Failed while receiving test steps: {e}")
85
+
86
+ def create_test_case_test_steps(self, test_case_key: str, json: str):
87
+ """Create test steps for a test case."""
88
+ test_steps_data = self._parse_json(json)
89
+ return self._client.create_test_case_test_steps(test_case_key, test_steps_data)
90
+
91
+ def list_test_cycles(self, project_key: Optional[str] = None, folder_id: Optional[str] = None, jira_project_version_id: Optional[str] = None, max_results: int = None, start_at: int = None):
92
+ """List test cycles with optional filters."""
93
+ return self._client.list_test_cycles(project_key=project_key, folder_id=folder_id, jira_project_version_id=jira_project_version_id, max_results=max_results, start_at=start_at)
94
+
95
+ def create_test_cycle(self, json: str):
96
+ """Create a new test cycle."""
97
+ test_cycle_data = self._parse_json(json)
98
+ return self._client.create_test_cycle(test_cycle_data)
99
+
100
+ def get_test_cycle(self, test_cycle_id_or_key: str):
101
+ """Retrieve details of a specific test cycle."""
102
+ return self._client.get_test_cycle(test_cycle_id_or_key)
103
+
104
+ def update_test_cycle(self, test_cycle_id_or_key: str, json: str):
105
+ """Update an existing test cycle."""
106
+ test_cycle_data = self._parse_json(json)
107
+ return self._client.update_test_cycle(test_cycle_id_or_key, test_cycle_data)
108
+
109
+ def get_test_cycle_links(self, test_cycle_id_or_key: str):
110
+ """Retrieve links associated with a test cycle."""
111
+ return self._client.get_test_cycle_links(test_cycle_id_or_key)
112
+
113
+ def create_test_cycle_issue_link(self, test_cycle_id_or_key: str, json: str):
114
+ """Create an issue link for a test cycle."""
115
+ issue_link_data = self._parse_json(json)
116
+ return self._client.create_test_cycle_issue_link(test_cycle_id_or_key, issue_link_data)
117
+
118
+ def create_test_cycle_web_link(self, test_cycle_id_or_key: str, json: str):
119
+ """Create a web link for a test cycle."""
120
+ web_link_data = self._parse_json(json)
121
+ return self._client.create_test_cycle_web_link(test_cycle_id_or_key, web_link_data)
122
+
123
+ def list_test_executions(self, project_key: Optional[str] = None, test_cycle: Optional[str] = None, test_case: Optional[str] = None, max_results: int = None, start_at: int = None):
124
+ """List test executions with optional filters."""
125
+ return self._client.list_test_executions(project_key=project_key, test_cycle=test_cycle, test_case=test_case, max_results=max_results, start_at=start_at)
126
+
127
+ def create_test_execution(self, json: str):
128
+ """Create a new test execution."""
129
+ test_execution_data = self._parse_json(json)
130
+ return self._client.create_test_execution(test_execution_data)
131
+
132
+ def get_test_execution(self, test_execution_id_or_key: str):
133
+ """Retrieve details of a specific test execution."""
134
+ return self._client.get_test_execution(test_execution_id_or_key)
135
+
136
+ def update_test_execution(self, test_execution_id_or_key: str, json: str):
137
+ """Update an existing test execution."""
138
+ test_execution_data = self._parse_json(json)
139
+ return self._client.update_test_execution(test_execution_id_or_key, test_execution_data)
140
+
141
+ def get_test_execution_test_steps(self, test_execution_id_or_key: str, max_results: int = None, start_at: int = None):
142
+ """List test steps of a test execution."""
143
+ return self._client.get_test_execution_test_steps(test_execution_id_or_key, max_results=max_results, start_at=start_at)
144
+
145
+ def update_test_execution_test_steps(self, test_execution_id_or_key: str, json: str):
146
+ """Update test steps of a test execution."""
147
+ test_steps_data = self._parse_json(json)
148
+ return self._client.update_test_execution_test_steps(test_execution_id_or_key, test_steps_data)
149
+
150
+ def sync_test_execution_script(self, test_execution_id_or_key: str):
151
+ """Sync the test execution script."""
152
+ return self._client.sync_test_execution_script(test_execution_id_or_key)
153
+
154
+ def list_test_execution_links(self, test_execution_id_or_key: str):
155
+ """List links associated with a test execution."""
156
+ return self._client.list_test_execution_links(test_execution_id_or_key)
157
+
158
+ def create_test_execution_issue_link(self, test_execution_id_or_key: str, json: str):
159
+ """Create an issue link for a test execution."""
160
+ issue_link_data = self._parse_json(json)
161
+ return self._client.create_test_execution_issue_link(test_execution_id_or_key, issue_link_data)
162
+
163
+ def list_projects(self, max_results: int = None, start_at: int = None):
164
+ """List all projects."""
165
+ return self._client.list_projects(max_results=max_results, start_at=start_at)
166
+
167
+ def get_project(self, project_id_or_key: str):
168
+ """Retrieve details of a specific project."""
169
+ return self._client.get_project(project_id_or_key)
170
+
171
+ def list_folders(self, project_key: Optional[str] = None, folder_type: Optional[str] = None, max_results: int = None, start_at: int = None):
172
+ """List folders with optional filters."""
173
+ return self._client.list_folders(project_key=project_key, folder_type=folder_type, max_results=max_results, start_at=start_at)
174
+
175
+ def create_folder(self, json: str):
176
+ """Create a new folder."""
177
+ folder_data = self._parse_json(json)
178
+ return self._client.create_folder(folder_data)
179
+
180
+ def get_folder(self, folder_id: str):
181
+ """Retrieve details of a specific folder."""
182
+ return self._client.get_folder(folder_id)
183
+
184
+ def delete_link(self, link_id: str):
185
+ """Delete a specific link."""
186
+ return self._client.delete_link(link_id)
187
+
188
+ def get_issue_link_test_cases(self, issue_key: str):
189
+ """Retrieve test cases linked to an issue."""
190
+ return self._client.get_issue_link_test_cases(issue_key)
191
+
192
+ def get_issue_link_test_cycles(self, issue_key: str):
193
+ """Retrieve test cycles linked to an issue."""
194
+ return self._client.get_issue_link_test_cycles(issue_key)
195
+
196
+ def get_issue_link_test_plans(self, issue_key: str):
197
+ """Retrieve test plans linked to an issue."""
198
+ return self._client.get_issue_link_test_plans(issue_key)
199
+
200
+ def get_issue_link_test_executions(self, issue_key: str):
201
+ """Retrieve test executions linked to an issue."""
202
+ return self._client.get_issue_link_test_executions(issue_key)
203
+
204
+ def create_custom_executions(self, project_key: str, files: str, auto_create_test_cases: bool = False):
205
+ """Create custom executions."""
206
+ return self._client.create_custom_executions(project_key, files, auto_create_test_cases)
207
+
208
+ def create_cucumber_executions(self, project_key: str, files: str, auto_create_test_cases: bool = False):
209
+ """Create cucumber executions."""
210
+ return self._client.create_cucumber_executions(project_key, files, auto_create_test_cases)
211
+
212
+ def create_junit_executions(self, project_key: str, files: str, auto_create_test_cases: bool = False):
213
+ """Create JUnit executions."""
214
+ return self._client.create_junit_executions(project_key, files, auto_create_test_cases)
215
+
216
+ def retrieve_bdd_test_cases(self, project_key: str):
217
+ """Retrieve BDD test cases."""
218
+ return self._client.retrieve_bdd_test_cases(project_key)
219
+
220
+ def healthcheck(self):
221
+ """Perform a health check on the API."""
222
+ return self._client.healthcheck()
223
+
224
+ def _parse_json(self, json_str: str):
225
+ """Helper method to parse JSON strings."""
226
+ import json
227
+ try:
228
+ return json.loads(json_str)
229
+ except json.JSONDecodeError as e:
230
+ raise ValueError(f"Invalid JSON string: {str(e)}")
231
+
232
+ def _base_loader(self) -> Generator[Document, None, None]:
233
+ try:
234
+ test_cases = self.list_test_cases()
235
+ except Exception as e:
236
+ raise ToolException(f"Unable to extract test cases: {e}")
237
+
238
+ for case in test_cases:
239
+ case['type'] = "TEST_CASE"
240
+ metadata = {
241
+ k: v for k, v in case.items()
242
+ if isinstance(v, (str, int, float, bool, list, dict))
243
+ }
244
+
245
+ yield Document(page_content=json.dumps(case), metadata=metadata)
246
+
247
+ def _process_document(self, document: Document) -> Generator[Document, None, None]:
248
+ try:
249
+ base_data = json.loads(document.page_content)
250
+
251
+ if base_data['type'] and base_data['type'] == "TEST_CASE":
252
+ additional_content = self._process_test_case(base_data)
253
+ base_data['test_case_content'] = additional_content
254
+
255
+ document.page_content = json.dumps(base_data)
256
+ yield document
257
+ except json.JSONDecodeError as e:
258
+ raise ToolException(f"Failed to decode JSON from document: {e}")
259
+
260
+ def _process_test_case(self, case):
261
+ steps = self.get_test_case_test_steps(case['key'])
262
+ script = self.get_test_case_test_script(case['key'])
263
+ additional_content = {
264
+ "steps": "" if isinstance(steps, ToolException) else steps,
265
+ "script": "" if isinstance(script, ToolException) else script,
266
+ }
267
+ return additional_content
268
+
269
+ @extend_with_vector_tools
270
+ def get_available_tools(self):
271
+ return [
272
+ {
273
+ "name": "list_test_cases",
274
+ "description": self.list_test_cases.__doc__,
275
+ "args_schema": ListTestCases,
276
+ "ref": self.list_test_cases,
277
+ },
278
+ {
279
+ "name": "create_test_case",
280
+ "description": self.create_test_case.__doc__,
281
+ "args_schema": CreateTestCase,
282
+ "ref": self.create_test_case,
283
+ },
284
+ {
285
+ "name": "get_test_case",
286
+ "description": self.get_test_case.__doc__,
287
+ "args_schema": GetTestCase,
288
+ "ref": self.get_test_case,
289
+ },
290
+ {
291
+ "name": "update_test_case",
292
+ "description": self.update_test_case.__doc__,
293
+ "args_schema": UpdateTestCase,
294
+ "ref": self.update_test_case,
295
+ },
296
+ {
297
+ "name": "get_test_case_links",
298
+ "description": self.get_test_case_links.__doc__,
299
+ "args_schema": GetTestCaseLinks,
300
+ "ref": self.get_test_case_links,
301
+ },
302
+ {
303
+ "name": "create_test_case_issue_link",
304
+ "description": self.create_test_case_issue_link.__doc__,
305
+ "args_schema": CreateTestCaseIssueLink,
306
+ "ref": self.create_test_case_issue_link,
307
+ },
308
+ {
309
+ "name": "create_test_case_web_link",
310
+ "description": self.create_test_case_web_link.__doc__,
311
+ "args_schema": CreateTestCaseWebLink,
312
+ "ref": self.create_test_case_web_link,
313
+ },
314
+ {
315
+ "name": "list_test_case_versions",
316
+ "description": self.list_test_case_versions.__doc__,
317
+ "args_schema": ListTestCaseVersions,
318
+ "ref": self.list_test_case_versions,
319
+ },
320
+ {
321
+ "name": "get_test_case_version",
322
+ "description": self.get_test_case_version.__doc__,
323
+ "args_schema": GetTestCaseVersion,
324
+ "ref": self.get_test_case_version,
325
+ },
326
+ {
327
+ "name": "get_test_case_test_script",
328
+ "description": self.get_test_case_test_script.__doc__,
329
+ "args_schema": GetTestCaseTestScript,
330
+ "ref": self.get_test_case_test_script,
331
+ },
332
+ {
333
+ "name": "create_test_case_test_script",
334
+ "description": self.create_test_case_test_script.__doc__,
335
+ "args_schema": CreateTestCaseTestScript,
336
+ "ref": self.create_test_case_test_script,
337
+ },
338
+ {
339
+ "name": "get_test_case_test_steps",
340
+ "description": self.get_test_case_test_steps.__doc__,
341
+ "args_schema": GetTestCaseTestSteps,
342
+ "ref": self.get_test_case_test_steps,
343
+ },
344
+ {
345
+ "name": "create_test_case_test_steps",
346
+ "description": self.create_test_case_test_steps.__doc__,
347
+ "args_schema": CreateTestCaseTestSteps,
348
+ "ref": self.create_test_case_test_steps,
349
+ },
350
+ {
351
+ "name": "list_test_cycles",
352
+ "description": self.list_test_cycles.__doc__,
353
+ "args_schema": ListTestCycles,
354
+ "ref": self.list_test_cycles,
355
+ },
356
+ {
357
+ "name": "create_test_cycle",
358
+ "description": self.create_test_cycle.__doc__,
359
+ "args_schema": CreateTestCycle,
360
+ "ref": self.create_test_cycle,
361
+ },
362
+ {
363
+ "name": "get_test_cycle",
364
+ "description": self.get_test_cycle.__doc__,
365
+ "args_schema": GetTestCycle,
366
+ "ref": self.get_test_cycle,
367
+ },
368
+ {
369
+ "name": "update_test_cycle",
370
+ "description": self.update_test_cycle.__doc__,
371
+ "args_schema": UpdateTestCycle,
372
+ "ref": self.update_test_cycle,
373
+ },
374
+ {
375
+ "name": "get_test_cycle_links",
376
+ "description": self.get_test_cycle_links.__doc__,
377
+ "args_schema": GetTestCycleLinks,
378
+ "ref": self.get_test_cycle_links,
379
+ },
380
+ {
381
+ "name": "create_test_cycle_issue_link",
382
+ "description": self.create_test_cycle_issue_link.__doc__,
383
+ "args_schema": CreateTestCycleIssueLink,
384
+ "ref": self.create_test_cycle_issue_link,
385
+ },
386
+ {
387
+ "name": "create_test_cycle_web_link",
388
+ "description": self.create_test_cycle_web_link.__doc__,
389
+ "args_schema": CreateTestCycleWebLink,
390
+ "ref": self.create_test_cycle_web_link,
391
+ },
392
+ {
393
+ "name": "list_test_executions",
394
+ "description": self.list_test_executions.__doc__,
395
+ "args_schema": ListTestExecutions,
396
+ "ref": self.list_test_executions,
397
+ },
398
+ {
399
+ "name": "create_test_execution",
400
+ "description": self.create_test_execution.__doc__,
401
+ "args_schema": CreateTestExecution,
402
+ "ref": self.create_test_execution,
403
+ },
404
+ {
405
+ "name": "get_test_execution",
406
+ "description": self.get_test_execution.__doc__,
407
+ "args_schema": GetTestExecution,
408
+ "ref": self.get_test_execution,
409
+ },
410
+ {
411
+ "name": "update_test_execution",
412
+ "description": self.update_test_execution.__doc__,
413
+ "args_schema": UpdateTestExecution,
414
+ "ref": self.update_test_execution,
415
+ },
416
+ {
417
+ "name": "get_test_execution_test_steps",
418
+ "description": self.get_test_execution_test_steps.__doc__,
419
+ "args_schema": GetTestExecutionTestSteps,
420
+ "ref": self.get_test_execution_test_steps,
421
+ },
422
+ {
423
+ "name": "update_test_execution_test_steps",
424
+ "description": self.update_test_execution_test_steps.__doc__,
425
+ "args_schema": UpdateTestExecutionTestSteps,
426
+ "ref": self.update_test_execution_test_steps,
427
+ },
428
+ {
429
+ "name": "sync_test_execution_script",
430
+ "description": self.sync_test_execution_script.__doc__,
431
+ "args_schema": SyncTestExecutionScript,
432
+ "ref": self.sync_test_execution_script,
433
+ },
434
+ {
435
+ "name": "list_test_execution_links",
436
+ "description": self.list_test_execution_links.__doc__,
437
+ "args_schema": ListTestExecutionLinks,
438
+ "ref": self.list_test_execution_links,
439
+ },
440
+ {
441
+ "name": "create_test_execution_issue_link",
442
+ "description": self.create_test_execution_issue_link.__doc__,
443
+ "args_schema": CreateTestExecutionIssueLink,
444
+ "ref": self.create_test_execution_issue_link,
445
+ },
446
+ {
447
+ "name": "list_projects",
448
+ "description": self.list_projects.__doc__,
449
+ "args_schema": ListProjects,
450
+ "ref": self.list_projects,
451
+ },
452
+ {
453
+ "name": "get_project",
454
+ "description": self.get_project.__doc__,
455
+ "args_schema": GetProject,
456
+ "ref": self.get_project,
457
+ },
458
+ {
459
+ "name": "list_folders",
460
+ "description": self.list_folders.__doc__,
461
+ "args_schema": ListFolders,
462
+ "ref": self.list_folders,
463
+ },
464
+ {
465
+ "name": "create_folder",
466
+ "description": self.create_folder.__doc__,
467
+ "args_schema": CreateFolder,
468
+ "ref": self.create_folder,
469
+ },
470
+ {
471
+ "name": "get_folder",
472
+ "description": self.get_folder.__doc__,
473
+ "args_schema": GetFolder,
474
+ "ref": self.get_folder,
475
+ },
476
+ {
477
+ "name": "delete_link",
478
+ "description": self.delete_link.__doc__,
479
+ "args_schema": DeleteLink,
480
+ "ref": self.delete_link,
481
+ },
482
+ {
483
+ "name": "get_issue_link_test_cases",
484
+ "description": self.get_issue_link_test_cases.__doc__,
485
+ "args_schema": GetIssueLinkTestCases,
486
+ "ref": self.get_issue_link_test_cases,
487
+ },
488
+ {
489
+ "name": "get_issue_link_test_cycles",
490
+ "description": self.get_issue_link_test_cycles.__doc__,
491
+ "args_schema": GetIssueLinkTestCycles,
492
+ "ref": self.get_issue_link_test_cycles,
493
+ },
494
+ {
495
+ "name": "get_issue_link_test_plans",
496
+ "description": self.get_issue_link_test_plans.__doc__,
497
+ "args_schema": GetIssueLinkTestPlans,
498
+ "ref": self.get_issue_link_test_plans,
499
+ },
500
+ {
501
+ "name": "get_issue_link_test_executions",
502
+ "description": self.get_issue_link_test_executions.__doc__,
503
+ "args_schema": GetIssueLinkTestExecutions,
504
+ "ref": self.get_issue_link_test_executions,
505
+ },
506
+ {
507
+ "name": "create_custom_executions",
508
+ "description": self.create_custom_executions.__doc__,
509
+ "args_schema": CreateCustomExecutions,
510
+ "ref": self.create_custom_executions,
511
+ },
512
+ {
513
+ "name": "create_cucumber_executions",
514
+ "description": self.create_cucumber_executions.__doc__,
515
+ "args_schema": CreateCucumberExecutions,
516
+ "ref": self.create_cucumber_executions,
517
+ },
518
+ {
519
+ "name": "create_junit_executions",
520
+ "description": self.create_junit_executions.__doc__,
521
+ "args_schema": CreateJUnitExecutions,
522
+ "ref": self.create_junit_executions,
523
+ },
524
+ {
525
+ "name": "retrieve_bdd_test_cases",
526
+ "description": self.retrieve_bdd_test_cases.__doc__,
527
+ "args_schema": RetrieveBDDTestCases,
528
+ "ref": self.retrieve_bdd_test_cases,
529
+ },
530
+ {
531
+ "name": "healthcheck",
532
+ "description": self.healthcheck.__doc__,
533
+ "args_schema": create_model("NoInput"),
534
+ "ref": self.healthcheck,
535
+ }
536
+ ]
537
+
538
+ ListTestCases = create_model(
539
+ "ListTestCases",
540
+ project_key=(Optional[str], Field(default=None, description="Project key to filter test cases.")),
541
+ folder_id=(Optional[str], Field(default=None, description="Folder ID to filter test cases.")),
542
+ max_results=(Optional[int], Field(default=None, description="Maximum number of results to return.")),
543
+ start_at=(Optional[int], Field(default=None, description="Starting index of the results."))
544
+ )
545
+
546
+ CreateTestCase = create_model(
547
+ "CreateTestCase",
548
+ json=(str, Field(description=("""
549
+ JSON body to create a test case. Example:
550
+ {
551
+ "name": "Test Case Name",
552
+ "description": "Test Case Description",
553
+ "projectKey": "PROJECT_KEY",
554
+ "folderId": "FOLDER_ID"
555
+ }
556
+ """
557
+ )))
558
+ )
559
+
560
+ GetTestCase = create_model(
561
+ "GetTestCase",
562
+ test_case_key=(str, Field(description="Key of the test case to retrieve."))
563
+ )
564
+
565
+ UpdateTestCase = create_model(
566
+ "UpdateTestCase",
567
+ test_case_key=(str, Field(description="Key of the test case to update.")),
568
+ json=(str, Field(description=("""
569
+ JSON body to update a test case. Example:
570
+ {
571
+ "name": "Updated Test Case Name",
572
+ "description": "Updated Test Case Description"
573
+ }
574
+ """
575
+ )))
576
+ )
577
+
578
+ GetTestCaseLinks = create_model(
579
+ "GetTestCaseLinks",
580
+ test_case_key=(str, Field(description="Key of the test case to retrieve links for."))
581
+ )
582
+
583
+ CreateTestCaseIssueLink = create_model(
584
+ "CreateTestCaseIssueLink",
585
+ test_case_key=(str, Field(description="Key of the test case to link an issue to.")),
586
+ json=(str, Field(description=("""
587
+ JSON body to create an issue link. Example:
588
+ {
589
+ "issueKey": "ISSUE_KEY",
590
+ "description": "Link Description"
591
+ }
592
+ """
593
+ )))
594
+ )
595
+
596
+ CreateTestCaseWebLink = create_model(
597
+ "CreateTestCaseWebLink",
598
+ test_case_key=(str, Field(description="Key of the test case to link a web link to.")),
599
+ json=(str, Field(description=("""
600
+ JSON body to create a web link. Example:
601
+ {
602
+ "url": "https://example.com",
603
+ "description": "Web Link Description"
604
+ }"
605
+ """
606
+ )))
607
+ )
608
+
609
+ ListTestCaseVersions = create_model(
610
+ "ListTestCaseVersions",
611
+ test_case_key=(str, Field(description="Key of the test case to list versions for.")),
612
+ max_results=(Optional[int], Field(default=None, description="Maximum number of results to return.")),
613
+ start_at=(Optional[int], Field(default=None, description="Starting index of the results."))
614
+ )
615
+
616
+ GetTestCaseVersion = create_model(
617
+ "GetTestCaseVersion",
618
+ test_case_key=(str, Field(description="Key of the test case to retrieve a specific version for.")),
619
+ version=(int, Field(description="Version number to retrieve."))
620
+ )
621
+
622
+ GetTestCaseTestScript = create_model(
623
+ "GetTestCaseTestScript",
624
+ test_case_key=(str, Field(description="Key of the test case to retrieve the test script for."))
625
+ )
626
+
627
+ CreateTestCaseTestScript = create_model(
628
+ "CreateTestCaseTestScript",
629
+ test_case_key=(str, Field(description="Key of the test case to create a test script for.")),
630
+ json=(str, Field(description=("""
631
+ JSON body to create a test script. Example:
632
+ {
633
+ "script": "Test Script Content"
634
+ }
635
+ """
636
+ )))
637
+ )
638
+
639
+ GetTestCaseTestSteps = create_model(
640
+ "GetTestCaseTestSteps",
641
+ test_case_key=(str, Field(description="Key of the test case to retrieve test steps for.")),
642
+ max_results=(Optional[int], Field(default=None, description="Maximum number of results to return.")),
643
+ start_at=(Optional[int], Field(default=None, description="Starting index of the results."))
644
+ )
645
+
646
+ CreateTestCaseTestSteps = create_model(
647
+ "CreateTestCaseTestSteps",
648
+ test_case_key=(str, Field(description="Key of the test case to create test steps for.")),
649
+ json=(str, Field(description=("""
650
+ JSON body to create test steps. Example:
651
+ [
652
+ {
653
+ "step": "Step 1",
654
+ "data": "Test Data",
655
+ "result": "Expected Result"
656
+ }
657
+ ]
658
+ """
659
+ )))
660
+ )
661
+
662
+ ListTestCycles = create_model(
663
+ "ListTestCycles",
664
+ project_key=(Optional[str], Field(default=None, description="Project key to filter test cycles.")),
665
+ folder_id=(Optional[str], Field(default=None, description="Folder ID to filter test cycles.")),
666
+ jira_project_version_id=(Optional[str], Field(default=None, description="JIRA project version ID to filter test cycles.")),
667
+ max_results=(Optional[int], Field(default=None, description="Maximum number of results to return.")),
668
+ start_at=(Optional[int], Field(default=None, description="Starting index of the results."))
669
+ )
670
+
671
+ CreateTestCycle = create_model(
672
+ "CreateTestCycle",
673
+ json=(str, Field(description=("""
674
+ JSON body to create a test cycle. Example:
675
+ {
676
+ "name": "Test Cycle Name",
677
+ "description": "Test Cycle Description",
678
+ "projectKey": "PROJECT_KEY"
679
+ }
680
+ """
681
+ )))
682
+ )
683
+
684
+ GetTestCycle = create_model(
685
+ "GetTestCycle",
686
+ test_cycle_id_or_key=(str, Field(description="ID or key of the test cycle to retrieve."))
687
+ )
688
+
689
+ UpdateTestCycle = create_model(
690
+ "UpdateTestCycle",
691
+ test_cycle_id_or_key=(str, Field(description="ID or key of the test cycle to update.")),
692
+ json=(str, Field(description=("""
693
+ JSON body to update a test cycle. Example:
694
+ {
695
+ "name": "Updated Test Cycle Name",
696
+ "description": "Updated Test Cycle Description"
697
+ }
698
+ """
699
+ )))
700
+ )
701
+
702
+ GetTestCycleLinks = create_model(
703
+ "GetTestCycleLinks",
704
+ test_cycle_id_or_key=(str, Field(description="ID or key of the test cycle to retrieve links for."))
705
+ )
706
+
707
+ CreateTestCycleIssueLink = create_model(
708
+ "CreateTestCycleIssueLink",
709
+ test_cycle_id_or_key=(str, Field(description="ID or key of the test cycle to link an issue to.")),
710
+ json=(str, Field(description=("""
711
+ JSON body to create an issue link. Example:
712
+ {
713
+ "issueKey": "ISSUE_KEY",
714
+ "description": "Link Description"
715
+ }
716
+ """
717
+ )))
718
+ )
719
+
720
+ CreateTestCycleWebLink = create_model(
721
+ "CreateTestCycleWebLink",
722
+ test_cycle_id_or_key=(str, Field(description="ID or key of the test cycle to link a web link to.")),
723
+ json=(str, Field(description=("""
724
+ JSON body to create a web link. Example:
725
+ {
726
+ "url": "https://example.com",
727
+ "description": "Web Link Description"
728
+ }
729
+ """
730
+ )))
731
+ )
732
+
733
+ ListTestExecutions = create_model(
734
+ "ListTestExecutions",
735
+ project_key=(Optional[str], Field(default=None, description="Project key to filter test executions.")),
736
+ test_cycle=(Optional[str], Field(default=None, description="Test cycle to filter test executions.")),
737
+ test_case=(Optional[str], Field(default=None, description="Test case to filter test executions.")),
738
+ max_results=(Optional[int], Field(default=None, description="Maximum number of results to return.")),
739
+ start_at=(Optional[int], Field(default=None, description="Starting index of the results."))
740
+ )
741
+
742
+ CreateTestExecution = create_model(
743
+ "CreateTestExecution",
744
+ json=(str, Field(description=("""
745
+ JSON body to create a test execution. Example:
746
+ {
747
+ "testCaseKey": "TEST_CASE_KEY",
748
+ "testCycleKey": "TEST_CYCLE_KEY",
749
+ "status": "PASS"
750
+ }
751
+ """
752
+ )))
753
+ )
754
+
755
+ GetTestExecution = create_model(
756
+ "GetTestExecution",
757
+ test_execution_id_or_key=(str, Field(description="ID or key of the test execution to retrieve."))
758
+ )
759
+
760
+ UpdateTestExecution = create_model(
761
+ "UpdateTestExecution",
762
+ test_execution_id_or_key=(str, Field(description="ID or key of the test execution to update.")),
763
+ json=(str, Field(description=("""
764
+ JSON body to update a test execution. Example:
765
+ {
766
+ "status": "FAIL",
767
+ "comment": "Updated comment"
768
+ }
769
+ """
770
+ )))
771
+ )
772
+
773
+ GetTestExecutionTestSteps = create_model(
774
+ "GetTestExecutionTestSteps",
775
+ test_execution_id_or_key=(str, Field(description="ID or key of the test execution to retrieve test steps for.")),
776
+ max_results=(Optional[int], Field(default=None, description="Maximum number of results to return.")),
777
+ start_at=(Optional[int], Field(default=None, description="Starting index of the results."))
778
+ )
779
+
780
+ UpdateTestExecutionTestSteps = create_model(
781
+ "UpdateTestExecutionTestSteps",
782
+ test_execution_id_or_key=(str, Field(description="ID or key of the test execution to update test steps for.")),
783
+ json=(str, Field(description=("""
784
+ "JSON body to update test steps. Example:
785
+ ["
786
+ {"
787
+ "step": "Step 1",
788
+ "status": "PASS"
789
+ }
790
+ ]
791
+ """
792
+ )))
793
+ )
794
+
795
+ SyncTestExecutionScript = create_model(
796
+ "SyncTestExecutionScript",
797
+ test_execution_id_or_key=(str, Field(description="ID or key of the test execution to sync the script for."))
798
+ )
799
+
800
+ ListTestExecutionLinks = create_model(
801
+ "ListTestExecutionLinks",
802
+ test_execution_id_or_key=(str, Field(description="ID or key of the test execution to retrieve links for."))
803
+ )
804
+
805
+ CreateTestExecutionIssueLink = create_model(
806
+ "CreateTestExecutionIssueLink",
807
+ test_execution_id_or_key=(str, Field(description="ID or key of the test execution to link an issue to.")),
808
+ json=(str, Field(description=("""
809
+ JSON body to create an issue link. Example:
810
+ {
811
+ "issueKey": "ISSUE_KEY",
812
+ "description": "Link Description"
813
+ }
814
+ """
815
+ )))
816
+ )
817
+
818
+ ListProjects = create_model(
819
+ "ListProjects",
820
+ max_results=(int, Field(default=None, description="Maximum number of results to return.")),
821
+ start_at=(int, Field(default=None, description="Starting index of the results."))
822
+ )
823
+
824
+ GetProject = create_model(
825
+ "GetProject",
826
+ project_id_or_key=(str, Field(description="ID or key of the project to retrieve."))
827
+ )
828
+
829
+ ListFolders = create_model(
830
+ "ListFolders",
831
+ project_key=(Optional[str], Field(default=None, description="Project key to filter folders.")),
832
+ folder_type=(Optional[str], Field(default=None, description="Folder type to filter folders.")),
833
+ max_results=(Optional[int], Field(default=None, description="Maximum number of results to return.")),
834
+ start_at=(Optional[int], Field(default=None, description="Starting index of the results."))
835
+ )
836
+
837
+ CreateFolder = create_model(
838
+ "CreateFolder",
839
+ json=(str, Field(description=("""
840
+ JSON body to create a folder. Example:
841
+ {
842
+ "name": "Folder Name",
843
+ "description": "Folder Description",
844
+ "projectKey": "PROJECT_KEY"
845
+ }
846
+ """
847
+ )))
848
+ )
849
+
850
+ GetFolder = create_model(
851
+ "GetFolder",
852
+ folder_id=(str, Field(description="ID of the folder to retrieve."))
853
+ )
854
+
855
+ DeleteLink = create_model(
856
+ "DeleteLink",
857
+ link_id=(str, Field(description="ID of the link to delete."))
858
+ )
859
+
860
+ GetIssueLinkTestCases = create_model(
861
+ "GetIssueLinkTestCases",
862
+ issue_key=(str, Field(description="Key of the issue to retrieve linked test cases for."))
863
+ )
864
+
865
+ GetIssueLinkTestCycles = create_model(
866
+ "GetIssueLinkTestCycles",
867
+ issue_key=(str, Field(description="Key of the issue to retrieve linked test cycles for."))
868
+ )
869
+
870
+ GetIssueLinkTestPlans = create_model(
871
+ "GetIssueLinkTestPlans",
872
+ issue_key=(str, Field(description="Key of the issue to retrieve linked test plans for."))
873
+ )
874
+
875
+ GetIssueLinkTestExecutions = create_model(
876
+ "GetIssueLinkTestExecutions",
877
+ issue_key=(str, Field(description="Key of the issue to retrieve linked test executions for."))
878
+ )
879
+
880
+ CreateCustomExecutions = create_model(
881
+ "CreateCustomExecutions",
882
+ project_key=(str, Field(description="Project key for the custom executions.")),
883
+ files=(str, Field(description="Path to the file for custom executions.")),
884
+ auto_create_test_cases=(Optional[bool], Field(default=False, description="Whether to auto-create test cases."))
885
+ )
886
+
887
+ CreateCucumberExecutions = create_model(
888
+ "CreateCucumberExecutions",
889
+ project_key=(str, Field(description="Project key for the cucumber executions.")),
890
+ files=(str, Field(description="Path to the file for cucumber executions.")),
891
+ auto_create_test_cases=(Optional[bool], Field(default=False, description="Whether to auto-create test cases."))
892
+ )
893
+
894
+ CreateJUnitExecutions = create_model(
895
+ "CreateJUnitExecutions",
896
+ project_key=(str, Field(description="Project key for the JUnit executions.")),
897
+ files=(str, Field(description="Path to the file for JUnit executions.")),
898
+ auto_create_test_cases=(Optional[bool], Field(default=False, description="Whether to auto-create test cases."))
899
+ )
900
+
901
+ RetrieveBDDTestCases = create_model(
902
+ "RetrieveBDDTestCases",
903
+ project_key=(str, Field(description="Project key to retrieve BDD test cases for."))
904
+ )