wds-client 0.7.0__py3-none-any.whl → 0.9.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.
- 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.9.0.dist-info/METADATA +17 -0
- wds_client-0.9.0.dist-info/RECORD +52 -0
- {wds_client-0.7.0.dist-info → wds_client-0.9.0.dist-info}/WHEEL +1 -1
- 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.7.0.dist-info/METADATA +0 -16
- wds_client-0.7.0.dist-info/RECORD +0 -54
- {wds_client-0.7.0.dist-info → wds_client-0.9.0.dist-info}/top_level.txt +0 -0
wds_client/models/generic_job.py
CHANGED
@@ -3,348 +3,116 @@
|
|
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
|
20
|
+
from datetime import datetime
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
19
25
|
|
20
|
-
|
21
|
-
class GenericJob(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
|
+
class GenericJob(BaseModel):
|
26
27
|
"""
|
28
|
+
Generic representation of a job, no opinion on inputs and result for the job. See individual APIs for more guidance on expected input and result payloads.
|
29
|
+
""" # noqa: E501
|
30
|
+
job_id: StrictStr = Field(alias="jobId")
|
31
|
+
job_type: StrictStr = Field(alias="jobType")
|
32
|
+
instance_id: StrictStr = Field(alias="instanceId")
|
33
|
+
status: StrictStr
|
34
|
+
created: datetime
|
35
|
+
updated: datetime
|
36
|
+
error_message: Optional[StrictStr] = Field(default=None, alias="errorMessage")
|
37
|
+
input: Optional[Dict[str, Any]] = Field(default=None, description="Input arguments for this job")
|
38
|
+
result: Optional[Dict[str, Any]] = Field(default=None, description="Result of this job")
|
39
|
+
__properties: ClassVar[List[str]] = ["jobId", "jobType", "instanceId", "status", "created", "updated", "errorMessage", "input", "result"]
|
40
|
+
|
41
|
+
@field_validator('job_type')
|
42
|
+
def job_type_validate_enum(cls, value):
|
43
|
+
"""Validates the enum"""
|
44
|
+
if value not in set(['DATA_IMPORT', 'UNKNOWN']):
|
45
|
+
raise ValueError("must be one of enum values ('DATA_IMPORT', 'UNKNOWN')")
|
46
|
+
return value
|
47
|
+
|
48
|
+
@field_validator('status')
|
49
|
+
def status_validate_enum(cls, value):
|
50
|
+
"""Validates the enum"""
|
51
|
+
if value not in set(['CREATED', 'QUEUED', 'RUNNING', 'SUCCEEDED', 'ERROR', 'CANCELLED', 'UNKNOWN']):
|
52
|
+
raise ValueError("must be one of enum values ('CREATED', 'QUEUED', 'RUNNING', 'SUCCEEDED', 'ERROR', 'CANCELLED', 'UNKNOWN')")
|
53
|
+
return value
|
54
|
+
|
55
|
+
model_config = ConfigDict(
|
56
|
+
populate_by_name=True,
|
57
|
+
validate_assignment=True,
|
58
|
+
protected_namespaces=(),
|
59
|
+
)
|
60
|
+
|
61
|
+
|
62
|
+
def to_str(self) -> str:
|
63
|
+
"""Returns the string representation of the model using alias"""
|
64
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
65
|
+
|
66
|
+
def to_json(self) -> str:
|
67
|
+
"""Returns the JSON representation of the model using alias"""
|
68
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
69
|
+
return json.dumps(self.to_dict())
|
70
|
+
|
71
|
+
@classmethod
|
72
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
73
|
+
"""Create an instance of GenericJob from a JSON string"""
|
74
|
+
return cls.from_dict(json.loads(json_str))
|
75
|
+
|
76
|
+
def to_dict(self) -> Dict[str, Any]:
|
77
|
+
"""Return the dictionary representation of the model using alias.
|
78
|
+
|
79
|
+
This has the following differences from calling pydantic's
|
80
|
+
`self.model_dump(by_alias=True)`:
|
81
|
+
|
82
|
+
* `None` is only added to the output dict for nullable fields that
|
83
|
+
were set at model initialization. Other fields with value `None`
|
84
|
+
are ignored.
|
85
|
+
"""
|
86
|
+
excluded_fields: Set[str] = set([
|
87
|
+
])
|
88
|
+
|
89
|
+
_dict = self.model_dump(
|
90
|
+
by_alias=True,
|
91
|
+
exclude=excluded_fields,
|
92
|
+
exclude_none=True,
|
93
|
+
)
|
94
|
+
return _dict
|
95
|
+
|
96
|
+
@classmethod
|
97
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
98
|
+
"""Create an instance of GenericJob from a dict"""
|
99
|
+
if obj is None:
|
100
|
+
return None
|
101
|
+
|
102
|
+
if not isinstance(obj, dict):
|
103
|
+
return cls.model_validate(obj)
|
104
|
+
|
105
|
+
_obj = cls.model_validate({
|
106
|
+
"jobId": obj.get("jobId"),
|
107
|
+
"jobType": obj.get("jobType"),
|
108
|
+
"instanceId": obj.get("instanceId"),
|
109
|
+
"status": obj.get("status"),
|
110
|
+
"created": obj.get("created"),
|
111
|
+
"updated": obj.get("updated"),
|
112
|
+
"errorMessage": obj.get("errorMessage"),
|
113
|
+
"input": obj.get("input"),
|
114
|
+
"result": obj.get("result")
|
115
|
+
})
|
116
|
+
return _obj
|
27
117
|
|
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.
|
34
|
-
"""
|
35
|
-
openapi_types = {
|
36
|
-
'job_id': 'str',
|
37
|
-
'job_type': 'str',
|
38
|
-
'instance_id': 'str',
|
39
|
-
'status': 'str',
|
40
|
-
'created': 'datetime',
|
41
|
-
'updated': 'datetime',
|
42
|
-
'error_message': 'str',
|
43
|
-
'input': 'object',
|
44
|
-
'result': 'object'
|
45
|
-
}
|
46
|
-
|
47
|
-
attribute_map = {
|
48
|
-
'job_id': 'jobId',
|
49
|
-
'job_type': 'jobType',
|
50
|
-
'instance_id': 'instanceId',
|
51
|
-
'status': 'status',
|
52
|
-
'created': 'created',
|
53
|
-
'updated': 'updated',
|
54
|
-
'error_message': 'errorMessage',
|
55
|
-
'input': 'input',
|
56
|
-
'result': 'result'
|
57
|
-
}
|
58
|
-
|
59
|
-
def __init__(self, job_id=None, job_type=None, instance_id=None, status=None, created=None, updated=None, error_message=None, input=None, result=None, local_vars_configuration=None): # noqa: E501
|
60
|
-
"""GenericJob - a model defined in OpenAPI""" # noqa: E501
|
61
|
-
if local_vars_configuration is None:
|
62
|
-
local_vars_configuration = Configuration()
|
63
|
-
self.local_vars_configuration = local_vars_configuration
|
64
|
-
|
65
|
-
self._job_id = None
|
66
|
-
self._job_type = None
|
67
|
-
self._instance_id = None
|
68
|
-
self._status = None
|
69
|
-
self._created = None
|
70
|
-
self._updated = None
|
71
|
-
self._error_message = None
|
72
|
-
self._input = None
|
73
|
-
self._result = None
|
74
|
-
self.discriminator = None
|
75
|
-
|
76
|
-
self.job_id = job_id
|
77
|
-
self.job_type = job_type
|
78
|
-
self.instance_id = instance_id
|
79
|
-
self.status = status
|
80
|
-
self.created = created
|
81
|
-
self.updated = updated
|
82
|
-
if error_message is not None:
|
83
|
-
self.error_message = error_message
|
84
|
-
if input is not None:
|
85
|
-
self.input = input
|
86
|
-
if result is not None:
|
87
|
-
self.result = result
|
88
|
-
|
89
|
-
@property
|
90
|
-
def job_id(self):
|
91
|
-
"""Gets the job_id of this GenericJob. # noqa: E501
|
92
|
-
|
93
|
-
|
94
|
-
:return: The job_id of this GenericJob. # noqa: E501
|
95
|
-
:rtype: str
|
96
|
-
"""
|
97
|
-
return self._job_id
|
98
|
-
|
99
|
-
@job_id.setter
|
100
|
-
def job_id(self, job_id):
|
101
|
-
"""Sets the job_id of this GenericJob.
|
102
|
-
|
103
|
-
|
104
|
-
:param job_id: The job_id of this GenericJob. # noqa: E501
|
105
|
-
:type: str
|
106
|
-
"""
|
107
|
-
if self.local_vars_configuration.client_side_validation and job_id is None: # noqa: E501
|
108
|
-
raise ValueError("Invalid value for `job_id`, must not be `None`") # noqa: E501
|
109
|
-
|
110
|
-
self._job_id = job_id
|
111
|
-
|
112
|
-
@property
|
113
|
-
def job_type(self):
|
114
|
-
"""Gets the job_type of this GenericJob. # noqa: E501
|
115
|
-
|
116
|
-
|
117
|
-
:return: The job_type of this GenericJob. # noqa: E501
|
118
|
-
:rtype: str
|
119
|
-
"""
|
120
|
-
return self._job_type
|
121
|
-
|
122
|
-
@job_type.setter
|
123
|
-
def job_type(self, job_type):
|
124
|
-
"""Sets the job_type of this GenericJob.
|
125
|
-
|
126
|
-
|
127
|
-
:param job_type: The job_type of this GenericJob. # noqa: E501
|
128
|
-
:type: str
|
129
|
-
"""
|
130
|
-
if self.local_vars_configuration.client_side_validation and job_type is None: # noqa: E501
|
131
|
-
raise ValueError("Invalid value for `job_type`, must not be `None`") # noqa: E501
|
132
|
-
allowed_values = ["DATA_IMPORT", "UNKNOWN"] # noqa: E501
|
133
|
-
if self.local_vars_configuration.client_side_validation and job_type not in allowed_values: # noqa: E501
|
134
|
-
raise ValueError(
|
135
|
-
"Invalid value for `job_type` ({0}), must be one of {1}" # noqa: E501
|
136
|
-
.format(job_type, allowed_values)
|
137
|
-
)
|
138
|
-
|
139
|
-
self._job_type = job_type
|
140
|
-
|
141
|
-
@property
|
142
|
-
def instance_id(self):
|
143
|
-
"""Gets the instance_id of this GenericJob. # noqa: E501
|
144
|
-
|
145
|
-
|
146
|
-
:return: The instance_id of this GenericJob. # noqa: E501
|
147
|
-
:rtype: str
|
148
|
-
"""
|
149
|
-
return self._instance_id
|
150
|
-
|
151
|
-
@instance_id.setter
|
152
|
-
def instance_id(self, instance_id):
|
153
|
-
"""Sets the instance_id of this GenericJob.
|
154
|
-
|
155
|
-
|
156
|
-
:param instance_id: The instance_id of this GenericJob. # noqa: E501
|
157
|
-
:type: str
|
158
|
-
"""
|
159
|
-
if self.local_vars_configuration.client_side_validation and instance_id is None: # noqa: E501
|
160
|
-
raise ValueError("Invalid value for `instance_id`, must not be `None`") # noqa: E501
|
161
|
-
|
162
|
-
self._instance_id = instance_id
|
163
|
-
|
164
|
-
@property
|
165
|
-
def status(self):
|
166
|
-
"""Gets the status of this GenericJob. # noqa: E501
|
167
|
-
|
168
|
-
|
169
|
-
:return: The status of this GenericJob. # noqa: E501
|
170
|
-
:rtype: str
|
171
|
-
"""
|
172
|
-
return self._status
|
173
|
-
|
174
|
-
@status.setter
|
175
|
-
def status(self, status):
|
176
|
-
"""Sets the status of this GenericJob.
|
177
|
-
|
178
|
-
|
179
|
-
:param status: The status of this GenericJob. # noqa: E501
|
180
|
-
:type: str
|
181
|
-
"""
|
182
|
-
if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501
|
183
|
-
raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501
|
184
|
-
allowed_values = ["CREATED", "QUEUED", "RUNNING", "SUCCEEDED", "ERROR", "CANCELLED", "UNKNOWN"] # noqa: E501
|
185
|
-
if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501
|
186
|
-
raise ValueError(
|
187
|
-
"Invalid value for `status` ({0}), must be one of {1}" # noqa: E501
|
188
|
-
.format(status, allowed_values)
|
189
|
-
)
|
190
|
-
|
191
|
-
self._status = status
|
192
|
-
|
193
|
-
@property
|
194
|
-
def created(self):
|
195
|
-
"""Gets the created of this GenericJob. # noqa: E501
|
196
|
-
|
197
|
-
|
198
|
-
:return: The created of this GenericJob. # noqa: E501
|
199
|
-
:rtype: datetime
|
200
|
-
"""
|
201
|
-
return self._created
|
202
|
-
|
203
|
-
@created.setter
|
204
|
-
def created(self, created):
|
205
|
-
"""Sets the created of this GenericJob.
|
206
|
-
|
207
|
-
|
208
|
-
:param created: The created of this GenericJob. # noqa: E501
|
209
|
-
:type: datetime
|
210
|
-
"""
|
211
|
-
if self.local_vars_configuration.client_side_validation and created is None: # noqa: E501
|
212
|
-
raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501
|
213
|
-
|
214
|
-
self._created = created
|
215
|
-
|
216
|
-
@property
|
217
|
-
def updated(self):
|
218
|
-
"""Gets the updated of this GenericJob. # noqa: E501
|
219
|
-
|
220
|
-
|
221
|
-
:return: The updated of this GenericJob. # noqa: E501
|
222
|
-
:rtype: datetime
|
223
|
-
"""
|
224
|
-
return self._updated
|
225
|
-
|
226
|
-
@updated.setter
|
227
|
-
def updated(self, updated):
|
228
|
-
"""Sets the updated of this GenericJob.
|
229
|
-
|
230
|
-
|
231
|
-
:param updated: The updated of this GenericJob. # noqa: E501
|
232
|
-
:type: datetime
|
233
|
-
"""
|
234
|
-
if self.local_vars_configuration.client_side_validation and updated is None: # noqa: E501
|
235
|
-
raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501
|
236
|
-
|
237
|
-
self._updated = updated
|
238
|
-
|
239
|
-
@property
|
240
|
-
def error_message(self):
|
241
|
-
"""Gets the error_message of this GenericJob. # noqa: E501
|
242
|
-
|
243
|
-
|
244
|
-
:return: The error_message of this GenericJob. # noqa: E501
|
245
|
-
:rtype: str
|
246
|
-
"""
|
247
|
-
return self._error_message
|
248
|
-
|
249
|
-
@error_message.setter
|
250
|
-
def error_message(self, error_message):
|
251
|
-
"""Sets the error_message of this GenericJob.
|
252
|
-
|
253
|
-
|
254
|
-
:param error_message: The error_message of this GenericJob. # noqa: E501
|
255
|
-
:type: str
|
256
|
-
"""
|
257
|
-
|
258
|
-
self._error_message = error_message
|
259
|
-
|
260
|
-
@property
|
261
|
-
def input(self):
|
262
|
-
"""Gets the input of this GenericJob. # noqa: E501
|
263
|
-
|
264
|
-
Input arguments for this job # noqa: E501
|
265
|
-
|
266
|
-
:return: The input of this GenericJob. # noqa: E501
|
267
|
-
:rtype: object
|
268
|
-
"""
|
269
|
-
return self._input
|
270
|
-
|
271
|
-
@input.setter
|
272
|
-
def input(self, input):
|
273
|
-
"""Sets the input of this GenericJob.
|
274
|
-
|
275
|
-
Input arguments for this job # noqa: E501
|
276
|
-
|
277
|
-
:param input: The input of this GenericJob. # noqa: E501
|
278
|
-
:type: object
|
279
|
-
"""
|
280
|
-
|
281
|
-
self._input = input
|
282
|
-
|
283
|
-
@property
|
284
|
-
def result(self):
|
285
|
-
"""Gets the result of this GenericJob. # noqa: E501
|
286
|
-
|
287
|
-
Result of this job # noqa: E501
|
288
|
-
|
289
|
-
:return: The result of this GenericJob. # noqa: E501
|
290
|
-
:rtype: object
|
291
|
-
"""
|
292
|
-
return self._result
|
293
|
-
|
294
|
-
@result.setter
|
295
|
-
def result(self, result):
|
296
|
-
"""Sets the result of this GenericJob.
|
297
|
-
|
298
|
-
Result of this job # noqa: E501
|
299
|
-
|
300
|
-
:param result: The result of this GenericJob. # noqa: E501
|
301
|
-
:type: object
|
302
|
-
"""
|
303
|
-
|
304
|
-
self._result = result
|
305
|
-
|
306
|
-
def to_dict(self):
|
307
|
-
"""Returns the model properties as a dict"""
|
308
|
-
result = {}
|
309
|
-
|
310
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
311
|
-
value = getattr(self, attr)
|
312
|
-
if isinstance(value, list):
|
313
|
-
result[attr] = list(map(
|
314
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
315
|
-
value
|
316
|
-
))
|
317
|
-
elif hasattr(value, "to_dict"):
|
318
|
-
result[attr] = value.to_dict()
|
319
|
-
elif isinstance(value, dict):
|
320
|
-
result[attr] = dict(map(
|
321
|
-
lambda item: (item[0], item[1].to_dict())
|
322
|
-
if hasattr(item[1], "to_dict") else item,
|
323
|
-
value.items()
|
324
|
-
))
|
325
|
-
else:
|
326
|
-
result[attr] = value
|
327
|
-
|
328
|
-
return result
|
329
|
-
|
330
|
-
def to_str(self):
|
331
|
-
"""Returns the string representation of the model"""
|
332
|
-
return pprint.pformat(self.to_dict())
|
333
|
-
|
334
|
-
def __repr__(self):
|
335
|
-
"""For `print` and `pprint`"""
|
336
|
-
return self.to_str()
|
337
|
-
|
338
|
-
def __eq__(self, other):
|
339
|
-
"""Returns true if both objects are equal"""
|
340
|
-
if not isinstance(other, GenericJob):
|
341
|
-
return False
|
342
|
-
|
343
|
-
return self.to_dict() == other.to_dict()
|
344
|
-
|
345
|
-
def __ne__(self, other):
|
346
|
-
"""Returns true if both objects are not equal"""
|
347
|
-
if not isinstance(other, GenericJob):
|
348
|
-
return True
|
349
118
|
|
350
|
-
return self.to_dict() != other.to_dict()
|
wds_client/models/git.py
CHANGED
@@ -3,144 +3,91 @@
|
|
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 wds_client.
|
19
|
-
|
20
|
-
|
21
|
-
class Git(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, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from wds_client.models.commit import Commit
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
27
25
|
|
26
|
+
class Git(BaseModel):
|
28
27
|
"""
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
self.
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
:return: The branch of this Git. # noqa: E501
|
66
|
-
:rtype: str
|
67
|
-
"""
|
68
|
-
return self._branch
|
69
|
-
|
70
|
-
@branch.setter
|
71
|
-
def branch(self, branch):
|
72
|
-
"""Sets the branch of this Git.
|
73
|
-
|
74
|
-
|
75
|
-
:param branch: The branch of this Git. # noqa: E501
|
76
|
-
:type: str
|
28
|
+
Git
|
29
|
+
""" # noqa: E501
|
30
|
+
branch: Optional[StrictStr] = None
|
31
|
+
commit: Optional[Commit] = None
|
32
|
+
__properties: ClassVar[List[str]] = ["branch", "commit"]
|
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 Git 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.
|
77
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 commit
|
74
|
+
if self.commit:
|
75
|
+
_dict['commit'] = self.commit.to_dict()
|
76
|
+
return _dict
|
77
|
+
|
78
|
+
@classmethod
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
80
|
+
"""Create an instance of Git from a dict"""
|
81
|
+
if obj is None:
|
82
|
+
return None
|
83
|
+
|
84
|
+
if not isinstance(obj, dict):
|
85
|
+
return cls.model_validate(obj)
|
86
|
+
|
87
|
+
_obj = cls.model_validate({
|
88
|
+
"branch": obj.get("branch"),
|
89
|
+
"commit": Commit.from_dict(obj["commit"]) if obj.get("commit") is not None else None
|
90
|
+
})
|
91
|
+
return _obj
|
78
92
|
|
79
|
-
self._branch = branch
|
80
|
-
|
81
|
-
@property
|
82
|
-
def commit(self):
|
83
|
-
"""Gets the commit of this Git. # noqa: E501
|
84
|
-
|
85
|
-
|
86
|
-
:return: The commit of this Git. # noqa: E501
|
87
|
-
:rtype: Commit
|
88
|
-
"""
|
89
|
-
return self._commit
|
90
|
-
|
91
|
-
@commit.setter
|
92
|
-
def commit(self, commit):
|
93
|
-
"""Sets the commit of this Git.
|
94
|
-
|
95
|
-
|
96
|
-
:param commit: The commit of this Git. # noqa: E501
|
97
|
-
:type: Commit
|
98
|
-
"""
|
99
93
|
|
100
|
-
self._commit = commit
|
101
|
-
|
102
|
-
def to_dict(self):
|
103
|
-
"""Returns the model properties as a dict"""
|
104
|
-
result = {}
|
105
|
-
|
106
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
107
|
-
value = getattr(self, attr)
|
108
|
-
if isinstance(value, list):
|
109
|
-
result[attr] = list(map(
|
110
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
111
|
-
value
|
112
|
-
))
|
113
|
-
elif hasattr(value, "to_dict"):
|
114
|
-
result[attr] = value.to_dict()
|
115
|
-
elif isinstance(value, dict):
|
116
|
-
result[attr] = dict(map(
|
117
|
-
lambda item: (item[0], item[1].to_dict())
|
118
|
-
if hasattr(item[1], "to_dict") else item,
|
119
|
-
value.items()
|
120
|
-
))
|
121
|
-
else:
|
122
|
-
result[attr] = value
|
123
|
-
|
124
|
-
return result
|
125
|
-
|
126
|
-
def to_str(self):
|
127
|
-
"""Returns the string representation of the model"""
|
128
|
-
return pprint.pformat(self.to_dict())
|
129
|
-
|
130
|
-
def __repr__(self):
|
131
|
-
"""For `print` and `pprint`"""
|
132
|
-
return self.to_str()
|
133
|
-
|
134
|
-
def __eq__(self, other):
|
135
|
-
"""Returns true if both objects are equal"""
|
136
|
-
if not isinstance(other, Git):
|
137
|
-
return False
|
138
|
-
|
139
|
-
return self.to_dict() == other.to_dict()
|
140
|
-
|
141
|
-
def __ne__(self, other):
|
142
|
-
"""Returns true if both objects are not equal"""
|
143
|
-
if not isinstance(other, Git):
|
144
|
-
return True
|
145
|
-
|
146
|
-
return self.to_dict() != other.to_dict()
|