wds-client 0.6.0__py3-none-any.whl → 0.8.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- wds_client/__init__.py +8 -10
- wds_client/api/__init__.py +1 -2
- wds_client/api/capabilities_api.py +237 -102
- wds_client/api/cloning_api.py +782 -329
- wds_client/api/general_wds_information_api.py +463 -191
- wds_client/api/import_api.py +288 -127
- wds_client/api/instances_api.py +783 -333
- wds_client/api/job_api.py +518 -215
- wds_client/api/records_api.py +2512 -1089
- wds_client/api/schema_api.py +1450 -626
- wds_client/api_client.py +414 -310
- wds_client/api_response.py +21 -0
- wds_client/configuration.py +110 -53
- wds_client/exceptions.py +99 -20
- wds_client/models/__init__.py +4 -8
- wds_client/models/app.py +68 -125
- wds_client/models/attribute_data_type.py +31 -94
- wds_client/models/attribute_schema.py +71 -157
- wds_client/models/attribute_schema_update.py +69 -127
- wds_client/models/backup_job.py +96 -298
- wds_client/models/backup_response.py +70 -157
- wds_client/models/backup_restore_request.py +68 -129
- wds_client/models/batch_operation.py +83 -137
- wds_client/models/batch_record_request.py +70 -160
- wds_client/models/batch_response.py +68 -127
- wds_client/models/build.py +79 -207
- wds_client/models/capabilities.py +83 -103
- wds_client/models/clone_job.py +96 -298
- wds_client/models/clone_response.py +68 -129
- wds_client/models/commit.py +69 -125
- wds_client/models/error_response.py +78 -222
- wds_client/models/generic_job.py +102 -334
- wds_client/models/git.py +76 -129
- wds_client/models/import_request.py +77 -165
- wds_client/models/job.py +87 -243
- wds_client/models/job_v1.py +97 -277
- wds_client/models/record_query_response.py +86 -162
- wds_client/models/record_request.py +60 -96
- wds_client/models/record_response.py +70 -160
- wds_client/models/record_type_schema.py +84 -191
- wds_client/models/search_filter.py +60 -95
- wds_client/models/search_request.py +84 -220
- wds_client/models/search_sort_direction.py +17 -80
- wds_client/models/status_response.py +68 -125
- wds_client/models/tsv_upload_response.py +68 -127
- wds_client/models/version_response.py +86 -155
- wds_client/py.typed +0 -0
- wds_client/rest.py +136 -170
- wds_client-0.8.0.dist-info/METADATA +17 -0
- wds_client-0.8.0.dist-info/RECORD +52 -0
- wds_client/models/backup_job_all_of.py +0 -148
- wds_client/models/clone_job_all_of.py +0 -148
- wds_client/models/generic_job_all_of.py +0 -150
- wds_client/models/inline_object.py +0 -123
- wds_client-0.6.0.dist-info/METADATA +0 -16
- wds_client-0.6.0.dist-info/RECORD +0 -54
- {wds_client-0.6.0.dist-info → wds_client-0.8.0.dist-info}/WHEEL +0 -0
- {wds_client-0.6.0.dist-info → wds_client-0.8.0.dist-info}/top_level.txt +0 -0
@@ -3,184 +3,96 @@
|
|
3
3
|
"""
|
4
4
|
Workspace Data Service
|
5
5
|
|
6
|
-
This page lists current APIs.
|
6
|
+
This page lists current APIs. All v0.2 APIs are subject to change without notice. Changelog at [https://github.com/DataBiosphere/terra-workspace-data-service/releases](https://github.com/DataBiosphere/terra-workspace-data-service/releases)
|
7
7
|
|
8
8
|
The version of the OpenAPI document: v0.2
|
9
|
-
Generated by
|
10
|
-
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
11
13
|
|
12
14
|
|
15
|
+
from __future__ import annotations
|
13
16
|
import pprint
|
14
17
|
import re # noqa: F401
|
18
|
+
import json
|
15
19
|
|
16
|
-
import
|
17
|
-
|
18
|
-
from
|
19
|
-
|
20
|
-
|
21
|
-
class ImportRequest(object):
|
22
|
-
"""NOTE: This class is auto generated by OpenAPI Generator.
|
23
|
-
Ref: https://openapi-generator.tech
|
24
|
-
|
25
|
-
Do not edit the class manually.
|
26
|
-
"""
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
27
24
|
|
25
|
+
class ImportRequest(BaseModel):
|
28
26
|
"""
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
"""
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
def
|
65
|
-
"""
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
27
|
+
ImportRequest
|
28
|
+
""" # noqa: E501
|
29
|
+
type: StrictStr = Field(description="format of file to import")
|
30
|
+
url: StrictStr = Field(description="url from which to import")
|
31
|
+
options: Optional[Dict[str, Any]] = Field(default=None, description="key-value pairs to configure this import. Options vary based on the import file type.")
|
32
|
+
__properties: ClassVar[List[str]] = ["type", "url", "options"]
|
33
|
+
|
34
|
+
@field_validator('type')
|
35
|
+
def type_validate_enum(cls, value):
|
36
|
+
"""Validates the enum"""
|
37
|
+
if value not in set(['PFB', 'RAWLSJSON', 'TDRMANIFEST']):
|
38
|
+
raise ValueError("must be one of enum values ('PFB', 'RAWLSJSON', 'TDRMANIFEST')")
|
39
|
+
return value
|
40
|
+
|
41
|
+
model_config = ConfigDict(
|
42
|
+
populate_by_name=True,
|
43
|
+
validate_assignment=True,
|
44
|
+
protected_namespaces=(),
|
45
|
+
)
|
46
|
+
|
47
|
+
|
48
|
+
def to_str(self) -> str:
|
49
|
+
"""Returns the string representation of the model using alias"""
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
51
|
+
|
52
|
+
def to_json(self) -> str:
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
55
|
+
return json.dumps(self.to_dict())
|
56
|
+
|
57
|
+
@classmethod
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
59
|
+
"""Create an instance of ImportRequest from a JSON string"""
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
61
|
+
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
64
|
+
|
65
|
+
This has the following differences from calling pydantic's
|
66
|
+
`self.model_dump(by_alias=True)`:
|
67
|
+
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
69
|
+
were set at model initialization. Other fields with value `None`
|
70
|
+
are ignored.
|
71
71
|
"""
|
72
|
-
|
72
|
+
excluded_fields: Set[str] = set([
|
73
|
+
])
|
73
74
|
|
74
|
-
|
75
|
-
|
76
|
-
|
75
|
+
_dict = self.model_dump(
|
76
|
+
by_alias=True,
|
77
|
+
exclude=excluded_fields,
|
78
|
+
exclude_none=True,
|
79
|
+
)
|
80
|
+
return _dict
|
77
81
|
|
78
|
-
|
82
|
+
@classmethod
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
84
|
+
"""Create an instance of ImportRequest from a dict"""
|
85
|
+
if obj is None:
|
86
|
+
return None
|
79
87
|
|
80
|
-
|
81
|
-
|
82
|
-
"""
|
83
|
-
if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501
|
84
|
-
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
|
85
|
-
allowed_values = ["PFB", "RAWLSJSON", "TDRMANIFEST"] # noqa: E501
|
86
|
-
if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501
|
87
|
-
raise ValueError(
|
88
|
-
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
|
89
|
-
.format(type, allowed_values)
|
90
|
-
)
|
88
|
+
if not isinstance(obj, dict):
|
89
|
+
return cls.model_validate(obj)
|
91
90
|
|
92
|
-
|
91
|
+
_obj = cls.model_validate({
|
92
|
+
"type": obj.get("type"),
|
93
|
+
"url": obj.get("url"),
|
94
|
+
"options": obj.get("options")
|
95
|
+
})
|
96
|
+
return _obj
|
93
97
|
|
94
|
-
@property
|
95
|
-
def url(self):
|
96
|
-
"""Gets the url of this ImportRequest. # noqa: E501
|
97
|
-
|
98
|
-
url from which to import # noqa: E501
|
99
|
-
|
100
|
-
:return: The url of this ImportRequest. # noqa: E501
|
101
|
-
:rtype: str
|
102
|
-
"""
|
103
|
-
return self._url
|
104
|
-
|
105
|
-
@url.setter
|
106
|
-
def url(self, url):
|
107
|
-
"""Sets the url of this ImportRequest.
|
108
|
-
|
109
|
-
url from which to import # noqa: E501
|
110
|
-
|
111
|
-
:param url: The url of this ImportRequest. # noqa: E501
|
112
|
-
:type: str
|
113
|
-
"""
|
114
|
-
if self.local_vars_configuration.client_side_validation and url is None: # noqa: E501
|
115
|
-
raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501
|
116
|
-
|
117
|
-
self._url = url
|
118
|
-
|
119
|
-
@property
|
120
|
-
def options(self):
|
121
|
-
"""Gets the options of this ImportRequest. # noqa: E501
|
122
|
-
|
123
|
-
key-value pairs to configure this import. Options vary based on the import file type. # noqa: E501
|
124
|
-
|
125
|
-
:return: The options of this ImportRequest. # noqa: E501
|
126
|
-
:rtype: dict(str, object)
|
127
|
-
"""
|
128
|
-
return self._options
|
129
|
-
|
130
|
-
@options.setter
|
131
|
-
def options(self, options):
|
132
|
-
"""Sets the options of this ImportRequest.
|
133
|
-
|
134
|
-
key-value pairs to configure this import. Options vary based on the import file type. # noqa: E501
|
135
|
-
|
136
|
-
:param options: The options of this ImportRequest. # noqa: E501
|
137
|
-
:type: dict(str, object)
|
138
|
-
"""
|
139
98
|
|
140
|
-
self._options = options
|
141
|
-
|
142
|
-
def to_dict(self):
|
143
|
-
"""Returns the model properties as a dict"""
|
144
|
-
result = {}
|
145
|
-
|
146
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
147
|
-
value = getattr(self, attr)
|
148
|
-
if isinstance(value, list):
|
149
|
-
result[attr] = list(map(
|
150
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
151
|
-
value
|
152
|
-
))
|
153
|
-
elif hasattr(value, "to_dict"):
|
154
|
-
result[attr] = value.to_dict()
|
155
|
-
elif isinstance(value, dict):
|
156
|
-
result[attr] = dict(map(
|
157
|
-
lambda item: (item[0], item[1].to_dict())
|
158
|
-
if hasattr(item[1], "to_dict") else item,
|
159
|
-
value.items()
|
160
|
-
))
|
161
|
-
else:
|
162
|
-
result[attr] = value
|
163
|
-
|
164
|
-
return result
|
165
|
-
|
166
|
-
def to_str(self):
|
167
|
-
"""Returns the string representation of the model"""
|
168
|
-
return pprint.pformat(self.to_dict())
|
169
|
-
|
170
|
-
def __repr__(self):
|
171
|
-
"""For `print` and `pprint`"""
|
172
|
-
return self.to_str()
|
173
|
-
|
174
|
-
def __eq__(self, other):
|
175
|
-
"""Returns true if both objects are equal"""
|
176
|
-
if not isinstance(other, ImportRequest):
|
177
|
-
return False
|
178
|
-
|
179
|
-
return self.to_dict() == other.to_dict()
|
180
|
-
|
181
|
-
def __ne__(self, other):
|
182
|
-
"""Returns true if both objects are not equal"""
|
183
|
-
if not isinstance(other, ImportRequest):
|
184
|
-
return True
|
185
|
-
|
186
|
-
return self.to_dict() != other.to_dict()
|
wds_client/models/job.py
CHANGED
@@ -3,258 +3,102 @@
|
|
3
3
|
"""
|
4
4
|
Workspace Data Service
|
5
5
|
|
6
|
-
This page lists current APIs.
|
6
|
+
This page lists current APIs. All v0.2 APIs are subject to change without notice. Changelog at [https://github.com/DataBiosphere/terra-workspace-data-service/releases](https://github.com/DataBiosphere/terra-workspace-data-service/releases)
|
7
7
|
|
8
8
|
The version of the OpenAPI document: v0.2
|
9
|
-
Generated by
|
10
|
-
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
11
13
|
|
12
14
|
|
15
|
+
from __future__ import annotations
|
13
16
|
import pprint
|
14
17
|
import re # noqa: F401
|
18
|
+
import json
|
15
19
|
|
16
|
-
import
|
17
|
-
|
18
|
-
from
|
19
|
-
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
20
24
|
|
21
|
-
class Job(
|
22
|
-
"""NOTE: This class is auto generated by OpenAPI Generator.
|
23
|
-
Ref: https://openapi-generator.tech
|
24
|
-
|
25
|
-
Do not edit the class manually.
|
26
|
-
"""
|
27
|
-
|
28
|
-
"""
|
29
|
-
Attributes:
|
30
|
-
openapi_types (dict): The key is attribute name
|
31
|
-
and the value is attribute type.
|
32
|
-
attribute_map (dict): The key is attribute name
|
33
|
-
and the value is json key in definition.
|
25
|
+
class Job(BaseModel):
|
34
26
|
"""
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
'
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
self.
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
:rtype: str
|
83
|
-
"""
|
84
|
-
return self._job_id
|
85
|
-
|
86
|
-
@job_id.setter
|
87
|
-
def job_id(self, job_id):
|
88
|
-
"""Sets the job_id of this Job.
|
89
|
-
|
90
|
-
|
91
|
-
:param job_id: The job_id of this Job. # noqa: E501
|
92
|
-
:type: str
|
93
|
-
"""
|
94
|
-
if self.local_vars_configuration.client_side_validation and job_id is None: # noqa: E501
|
95
|
-
raise ValueError("Invalid value for `job_id`, must not be `None`") # noqa: E501
|
96
|
-
|
97
|
-
self._job_id = job_id
|
98
|
-
|
99
|
-
@property
|
100
|
-
def job_type(self):
|
101
|
-
"""Gets the job_type of this Job. # noqa: E501
|
102
|
-
|
103
|
-
|
104
|
-
:return: The job_type of this Job. # noqa: E501
|
105
|
-
:rtype: str
|
106
|
-
"""
|
107
|
-
return self._job_type
|
108
|
-
|
109
|
-
@job_type.setter
|
110
|
-
def job_type(self, job_type):
|
111
|
-
"""Sets the job_type of this Job.
|
112
|
-
|
113
|
-
|
114
|
-
:param job_type: The job_type of this Job. # noqa: E501
|
115
|
-
:type: str
|
116
|
-
"""
|
117
|
-
|
118
|
-
self._job_type = job_type
|
119
|
-
|
120
|
-
@property
|
121
|
-
def status(self):
|
122
|
-
"""Gets the status of this Job. # noqa: E501
|
123
|
-
|
124
|
-
|
125
|
-
:return: The status of this Job. # noqa: E501
|
126
|
-
:rtype: str
|
127
|
-
"""
|
128
|
-
return self._status
|
129
|
-
|
130
|
-
@status.setter
|
131
|
-
def status(self, status):
|
132
|
-
"""Sets the status of this Job.
|
133
|
-
|
134
|
-
|
135
|
-
:param status: The status of this Job. # noqa: E501
|
136
|
-
:type: str
|
137
|
-
"""
|
138
|
-
if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501
|
139
|
-
raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501
|
140
|
-
allowed_values = ["QUEUED", "RUNNING", "SUCCEEDED", "ERROR", "CANCELLED", "UNKNOWN"] # noqa: E501
|
141
|
-
if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501
|
142
|
-
raise ValueError(
|
143
|
-
"Invalid value for `status` ({0}), must be one of {1}" # noqa: E501
|
144
|
-
.format(status, allowed_values)
|
145
|
-
)
|
146
|
-
|
147
|
-
self._status = status
|
148
|
-
|
149
|
-
@property
|
150
|
-
def created(self):
|
151
|
-
"""Gets the created of this Job. # noqa: E501
|
152
|
-
|
153
|
-
|
154
|
-
:return: The created of this Job. # noqa: E501
|
155
|
-
:rtype: str
|
27
|
+
Job
|
28
|
+
""" # noqa: E501
|
29
|
+
job_id: StrictStr = Field(alias="jobId")
|
30
|
+
job_type: Optional[StrictStr] = Field(default=None, alias="jobType")
|
31
|
+
status: StrictStr
|
32
|
+
created: StrictStr
|
33
|
+
updated: StrictStr
|
34
|
+
error_message: Optional[StrictStr] = Field(default=None, alias="errorMessage")
|
35
|
+
__properties: ClassVar[List[str]] = ["jobId", "jobType", "status", "created", "updated", "errorMessage"]
|
36
|
+
|
37
|
+
@field_validator('status')
|
38
|
+
def status_validate_enum(cls, value):
|
39
|
+
"""Validates the enum"""
|
40
|
+
if value not in set(['QUEUED', 'RUNNING', 'SUCCEEDED', 'ERROR', 'CANCELLED', 'UNKNOWN']):
|
41
|
+
raise ValueError("must be one of enum values ('QUEUED', 'RUNNING', 'SUCCEEDED', 'ERROR', 'CANCELLED', 'UNKNOWN')")
|
42
|
+
return value
|
43
|
+
|
44
|
+
model_config = ConfigDict(
|
45
|
+
populate_by_name=True,
|
46
|
+
validate_assignment=True,
|
47
|
+
protected_namespaces=(),
|
48
|
+
)
|
49
|
+
|
50
|
+
|
51
|
+
def to_str(self) -> str:
|
52
|
+
"""Returns the string representation of the model using alias"""
|
53
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
54
|
+
|
55
|
+
def to_json(self) -> str:
|
56
|
+
"""Returns the JSON representation of the model using alias"""
|
57
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
58
|
+
return json.dumps(self.to_dict())
|
59
|
+
|
60
|
+
@classmethod
|
61
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
62
|
+
"""Create an instance of Job from a JSON string"""
|
63
|
+
return cls.from_dict(json.loads(json_str))
|
64
|
+
|
65
|
+
def to_dict(self) -> Dict[str, Any]:
|
66
|
+
"""Return the dictionary representation of the model using alias.
|
67
|
+
|
68
|
+
This has the following differences from calling pydantic's
|
69
|
+
`self.model_dump(by_alias=True)`:
|
70
|
+
|
71
|
+
* `None` is only added to the output dict for nullable fields that
|
72
|
+
were set at model initialization. Other fields with value `None`
|
73
|
+
are ignored.
|
156
74
|
"""
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
:param updated: The updated of this Job. # noqa: E501
|
188
|
-
:type: str
|
189
|
-
"""
|
190
|
-
if self.local_vars_configuration.client_side_validation and updated is None: # noqa: E501
|
191
|
-
raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501
|
192
|
-
|
193
|
-
self._updated = updated
|
194
|
-
|
195
|
-
@property
|
196
|
-
def error_message(self):
|
197
|
-
"""Gets the error_message of this Job. # noqa: E501
|
198
|
-
|
199
|
-
|
200
|
-
:return: The error_message of this Job. # noqa: E501
|
201
|
-
:rtype: str
|
202
|
-
"""
|
203
|
-
return self._error_message
|
204
|
-
|
205
|
-
@error_message.setter
|
206
|
-
def error_message(self, error_message):
|
207
|
-
"""Sets the error_message of this Job.
|
208
|
-
|
209
|
-
|
210
|
-
:param error_message: The error_message of this Job. # noqa: E501
|
211
|
-
:type: str
|
212
|
-
"""
|
213
|
-
|
214
|
-
self._error_message = error_message
|
215
|
-
|
216
|
-
def to_dict(self):
|
217
|
-
"""Returns the model properties as a dict"""
|
218
|
-
result = {}
|
219
|
-
|
220
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
221
|
-
value = getattr(self, attr)
|
222
|
-
if isinstance(value, list):
|
223
|
-
result[attr] = list(map(
|
224
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
225
|
-
value
|
226
|
-
))
|
227
|
-
elif hasattr(value, "to_dict"):
|
228
|
-
result[attr] = value.to_dict()
|
229
|
-
elif isinstance(value, dict):
|
230
|
-
result[attr] = dict(map(
|
231
|
-
lambda item: (item[0], item[1].to_dict())
|
232
|
-
if hasattr(item[1], "to_dict") else item,
|
233
|
-
value.items()
|
234
|
-
))
|
235
|
-
else:
|
236
|
-
result[attr] = value
|
237
|
-
|
238
|
-
return result
|
239
|
-
|
240
|
-
def to_str(self):
|
241
|
-
"""Returns the string representation of the model"""
|
242
|
-
return pprint.pformat(self.to_dict())
|
243
|
-
|
244
|
-
def __repr__(self):
|
245
|
-
"""For `print` and `pprint`"""
|
246
|
-
return self.to_str()
|
247
|
-
|
248
|
-
def __eq__(self, other):
|
249
|
-
"""Returns true if both objects are equal"""
|
250
|
-
if not isinstance(other, Job):
|
251
|
-
return False
|
252
|
-
|
253
|
-
return self.to_dict() == other.to_dict()
|
75
|
+
excluded_fields: Set[str] = set([
|
76
|
+
])
|
77
|
+
|
78
|
+
_dict = self.model_dump(
|
79
|
+
by_alias=True,
|
80
|
+
exclude=excluded_fields,
|
81
|
+
exclude_none=True,
|
82
|
+
)
|
83
|
+
return _dict
|
84
|
+
|
85
|
+
@classmethod
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
87
|
+
"""Create an instance of Job from a dict"""
|
88
|
+
if obj is None:
|
89
|
+
return None
|
90
|
+
|
91
|
+
if not isinstance(obj, dict):
|
92
|
+
return cls.model_validate(obj)
|
93
|
+
|
94
|
+
_obj = cls.model_validate({
|
95
|
+
"jobId": obj.get("jobId"),
|
96
|
+
"jobType": obj.get("jobType"),
|
97
|
+
"status": obj.get("status"),
|
98
|
+
"created": obj.get("created"),
|
99
|
+
"updated": obj.get("updated"),
|
100
|
+
"errorMessage": obj.get("errorMessage")
|
101
|
+
})
|
102
|
+
return _obj
|
254
103
|
|
255
|
-
def __ne__(self, other):
|
256
|
-
"""Returns true if both objects are not equal"""
|
257
|
-
if not isinstance(other, Job):
|
258
|
-
return True
|
259
104
|
|
260
|
-
return self.to_dict() != other.to_dict()
|