terra-scientific-pipelines-service-api-client 0.0.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.

Potentially problematic release.


This version of terra-scientific-pipelines-service-api-client might be problematic. Click here for more details.

Files changed (39) hide show
  1. teaspoons_client/__init__.py +58 -0
  2. teaspoons_client/api/__init__.py +9 -0
  3. teaspoons_client/api/admin_api.py +599 -0
  4. teaspoons_client/api/jobs_api.py +588 -0
  5. teaspoons_client/api/pipeline_runs_api.py +1203 -0
  6. teaspoons_client/api/pipelines_api.py +547 -0
  7. teaspoons_client/api/public_api.py +528 -0
  8. teaspoons_client/api_client.py +788 -0
  9. teaspoons_client/api_response.py +21 -0
  10. teaspoons_client/configuration.py +465 -0
  11. teaspoons_client/exceptions.py +199 -0
  12. teaspoons_client/models/__init__.py +37 -0
  13. teaspoons_client/models/admin_pipeline.py +101 -0
  14. teaspoons_client/models/async_pipeline_run_response.py +103 -0
  15. teaspoons_client/models/error_report.py +91 -0
  16. teaspoons_client/models/get_jobs_response.py +99 -0
  17. teaspoons_client/models/get_pipeline_runs_response.py +97 -0
  18. teaspoons_client/models/get_pipelines_result.py +95 -0
  19. teaspoons_client/models/job_control.py +87 -0
  20. teaspoons_client/models/job_report.py +106 -0
  21. teaspoons_client/models/job_result.py +97 -0
  22. teaspoons_client/models/pipeline.py +91 -0
  23. teaspoons_client/models/pipeline_run.py +91 -0
  24. teaspoons_client/models/pipeline_run_report.py +93 -0
  25. teaspoons_client/models/pipeline_user_provided_input_definition.py +91 -0
  26. teaspoons_client/models/pipeline_with_details.py +103 -0
  27. teaspoons_client/models/prepare_pipeline_run_request_body.py +91 -0
  28. teaspoons_client/models/prepare_pipeline_run_response.py +89 -0
  29. teaspoons_client/models/start_pipeline_run_request_body.py +93 -0
  30. teaspoons_client/models/system_status.py +102 -0
  31. teaspoons_client/models/system_status_systems_value.py +89 -0
  32. teaspoons_client/models/update_pipeline_request_body.py +91 -0
  33. teaspoons_client/models/version_properties.py +93 -0
  34. teaspoons_client/py.typed +0 -0
  35. teaspoons_client/rest.py +257 -0
  36. terra_scientific_pipelines_service_api_client-0.0.0.dist-info/METADATA +16 -0
  37. terra_scientific_pipelines_service_api_client-0.0.0.dist-info/RECORD +39 -0
  38. terra_scientific_pipelines_service_api_client-0.0.0.dist-info/WHEEL +5 -0
  39. terra_scientific_pipelines_service_api_client-0.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+ """
5
+ Terra Scientific Pipelines Service
6
+
7
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
8
+
9
+ The version of the OpenAPI document: 1.0.0
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ # import models into model package
17
+ from teaspoons_client.models.admin_pipeline import AdminPipeline
18
+ from teaspoons_client.models.async_pipeline_run_response import AsyncPipelineRunResponse
19
+ from teaspoons_client.models.error_report import ErrorReport
20
+ from teaspoons_client.models.get_jobs_response import GetJobsResponse
21
+ from teaspoons_client.models.get_pipeline_runs_response import GetPipelineRunsResponse
22
+ from teaspoons_client.models.get_pipelines_result import GetPipelinesResult
23
+ from teaspoons_client.models.job_control import JobControl
24
+ from teaspoons_client.models.job_report import JobReport
25
+ from teaspoons_client.models.job_result import JobResult
26
+ from teaspoons_client.models.pipeline import Pipeline
27
+ from teaspoons_client.models.pipeline_run import PipelineRun
28
+ from teaspoons_client.models.pipeline_run_report import PipelineRunReport
29
+ from teaspoons_client.models.pipeline_user_provided_input_definition import PipelineUserProvidedInputDefinition
30
+ from teaspoons_client.models.pipeline_with_details import PipelineWithDetails
31
+ from teaspoons_client.models.prepare_pipeline_run_request_body import PreparePipelineRunRequestBody
32
+ from teaspoons_client.models.prepare_pipeline_run_response import PreparePipelineRunResponse
33
+ from teaspoons_client.models.start_pipeline_run_request_body import StartPipelineRunRequestBody
34
+ from teaspoons_client.models.system_status import SystemStatus
35
+ from teaspoons_client.models.system_status_systems_value import SystemStatusSystemsValue
36
+ from teaspoons_client.models.update_pipeline_request_body import UpdatePipelineRequestBody
37
+ from teaspoons_client.models.version_properties import VersionProperties
@@ -0,0 +1,101 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Terra Scientific Pipelines Service
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class AdminPipeline(BaseModel):
26
+ """
27
+ Object containing the pipeline identifier, display name, description, and control workspace information for a Pipeline.
28
+ """ # noqa: E501
29
+ pipeline_name: StrictStr = Field(description="The identifier string for the Pipeline. ", alias="pipelineName")
30
+ display_name: StrictStr = Field(description="The display name for the Pipeline. ", alias="displayName")
31
+ description: StrictStr = Field(description="The description for the Pipeline. ")
32
+ wdl_method_version: StrictStr = Field(description="An identifier string for the Pipeline Wdl Version i.e. github repo tag/branch/release ", alias="wdlMethodVersion")
33
+ workspace_billing_project: StrictStr = Field(description="The Terra billing project of the workspace to run the pipeline in. ", alias="workspaceBillingProject")
34
+ workspace_name: StrictStr = Field(description="The name of the workspace to run the pipeline in. ", alias="workspaceName")
35
+ workspace_storage_container_name: StrictStr = Field(description="The name of the workspace storage container (e.g. google bucket name, without gs:// prefix). ", alias="workspaceStorageContainerName")
36
+ workspace_google_project: StrictStr = Field(description="The google project of the workspace to run the pipeline in. ", alias="workspaceGoogleProject")
37
+ __properties: ClassVar[List[str]] = ["pipelineName", "displayName", "description", "wdlMethodVersion", "workspaceBillingProject", "workspaceName", "workspaceStorageContainerName", "workspaceGoogleProject"]
38
+
39
+ model_config = ConfigDict(
40
+ populate_by_name=True,
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
44
+
45
+
46
+ def to_str(self) -> str:
47
+ """Returns the string representation of the model using alias"""
48
+ return pprint.pformat(self.model_dump(by_alias=True))
49
+
50
+ def to_json(self) -> str:
51
+ """Returns the JSON representation of the model using alias"""
52
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
+ return json.dumps(self.to_dict())
54
+
55
+ @classmethod
56
+ def from_json(cls, json_str: str) -> Optional[Self]:
57
+ """Create an instance of AdminPipeline from a JSON string"""
58
+ return cls.from_dict(json.loads(json_str))
59
+
60
+ def to_dict(self) -> Dict[str, Any]:
61
+ """Return the dictionary representation of the model using alias.
62
+
63
+ This has the following differences from calling pydantic's
64
+ `self.model_dump(by_alias=True)`:
65
+
66
+ * `None` is only added to the output dict for nullable fields that
67
+ were set at model initialization. Other fields with value `None`
68
+ are ignored.
69
+ """
70
+ excluded_fields: Set[str] = set([
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of AdminPipeline from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({
90
+ "pipelineName": obj.get("pipelineName"),
91
+ "displayName": obj.get("displayName"),
92
+ "description": obj.get("description"),
93
+ "wdlMethodVersion": obj.get("wdlMethodVersion"),
94
+ "workspaceBillingProject": obj.get("workspaceBillingProject"),
95
+ "workspaceName": obj.get("workspaceName"),
96
+ "workspaceStorageContainerName": obj.get("workspaceStorageContainerName"),
97
+ "workspaceGoogleProject": obj.get("workspaceGoogleProject")
98
+ })
99
+ return _obj
100
+
101
+
@@ -0,0 +1,103 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Terra Scientific Pipelines Service
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from teaspoons_client.models.error_report import ErrorReport
23
+ from teaspoons_client.models.job_report import JobReport
24
+ from teaspoons_client.models.pipeline_run_report import PipelineRunReport
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class AsyncPipelineRunResponse(BaseModel):
29
+ """
30
+ Result of an asynchronous pipeline run request.
31
+ """ # noqa: E501
32
+ job_report: JobReport = Field(alias="jobReport")
33
+ error_report: Optional[ErrorReport] = Field(default=None, alias="errorReport")
34
+ pipeline_run_report: PipelineRunReport = Field(alias="pipelineRunReport")
35
+ __properties: ClassVar[List[str]] = ["jobReport", "errorReport", "pipelineRunReport"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of AsyncPipelineRunResponse from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # override the default output from pydantic by calling `to_dict()` of job_report
77
+ if self.job_report:
78
+ _dict['jobReport'] = self.job_report.to_dict()
79
+ # override the default output from pydantic by calling `to_dict()` of error_report
80
+ if self.error_report:
81
+ _dict['errorReport'] = self.error_report.to_dict()
82
+ # override the default output from pydantic by calling `to_dict()` of pipeline_run_report
83
+ if self.pipeline_run_report:
84
+ _dict['pipelineRunReport'] = self.pipeline_run_report.to_dict()
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of AsyncPipelineRunResponse from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "jobReport": JobReport.from_dict(obj["jobReport"]) if obj.get("jobReport") is not None else None,
98
+ "errorReport": ErrorReport.from_dict(obj["errorReport"]) if obj.get("errorReport") is not None else None,
99
+ "pipelineRunReport": PipelineRunReport.from_dict(obj["pipelineRunReport"]) if obj.get("pipelineRunReport") is not None else None
100
+ })
101
+ return _obj
102
+
103
+
@@ -0,0 +1,91 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Terra Scientific Pipelines Service
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ErrorReport(BaseModel):
26
+ """
27
+ ErrorReport
28
+ """ # noqa: E501
29
+ message: StrictStr
30
+ status_code: StrictInt = Field(alias="statusCode")
31
+ causes: List[StrictStr]
32
+ __properties: ClassVar[List[str]] = ["message", "statusCode", "causes"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of ErrorReport from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of ErrorReport from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "message": obj.get("message"),
86
+ "statusCode": obj.get("statusCode"),
87
+ "causes": obj.get("causes")
88
+ })
89
+ return _obj
90
+
91
+
@@ -0,0 +1,99 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Terra Scientific Pipelines Service
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from teaspoons_client.models.job_report import JobReport
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetJobsResponse(BaseModel):
27
+ """
28
+ result of a getJobs request
29
+ """ # noqa: E501
30
+ total_results: Optional[StrictInt] = Field(default=None, alias="totalResults")
31
+ page_token: Optional[StrictStr] = Field(default=None, alias="pageToken")
32
+ results: Optional[List[JobReport]] = Field(default=None, description="List of retrieved jobs")
33
+ __properties: ClassVar[List[str]] = ["totalResults", "pageToken", "results"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of GetJobsResponse from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
75
+ _items = []
76
+ if self.results:
77
+ for _item_results in self.results:
78
+ if _item_results:
79
+ _items.append(_item_results.to_dict())
80
+ _dict['results'] = _items
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of GetJobsResponse from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "totalResults": obj.get("totalResults"),
94
+ "pageToken": obj.get("pageToken"),
95
+ "results": [JobReport.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
96
+ })
97
+ return _obj
98
+
99
+
@@ -0,0 +1,97 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Terra Scientific Pipelines Service
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from teaspoons_client.models.pipeline_run import PipelineRun
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetPipelineRunsResponse(BaseModel):
27
+ """
28
+ GetPipelineRunsResponse
29
+ """ # noqa: E501
30
+ page_token: Optional[StrictStr] = Field(default=None, alias="pageToken")
31
+ results: Optional[List[PipelineRun]] = Field(default=None, description="List of pipeline runs")
32
+ __properties: ClassVar[List[str]] = ["pageToken", "results"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of GetPipelineRunsResponse from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
74
+ _items = []
75
+ if self.results:
76
+ for _item_results in self.results:
77
+ if _item_results:
78
+ _items.append(_item_results.to_dict())
79
+ _dict['results'] = _items
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of GetPipelineRunsResponse from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "pageToken": obj.get("pageToken"),
93
+ "results": [PipelineRun.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
94
+ })
95
+ return _obj
96
+
97
+
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Terra Scientific Pipelines Service
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from teaspoons_client.models.pipeline import Pipeline
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetPipelinesResult(BaseModel):
27
+ """
28
+ result of a getPipelines request
29
+ """ # noqa: E501
30
+ results: Optional[List[Pipeline]] = Field(default=None, description="List of retrieved pipelines")
31
+ __properties: ClassVar[List[str]] = ["results"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of GetPipelinesResult from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
73
+ _items = []
74
+ if self.results:
75
+ for _item_results in self.results:
76
+ if _item_results:
77
+ _items.append(_item_results.to_dict())
78
+ _dict['results'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of GetPipelinesResult from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "results": [Pipeline.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
92
+ })
93
+ return _obj
94
+
95
+