qi-compute-api-client 0.7.0__py3-none-any.whl → 0.17.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 qi-compute-api-client might be problematic. Click here for more details.
- compute_api_client/__init__.py +22 -19
- compute_api_client/api/__init__.py +5 -6
- compute_api_client/api/algorithms_api.py +1333 -553
- compute_api_client/api/backend_api.py +1501 -0
- compute_api_client/api/backend_types_api.py +684 -0
- compute_api_client/api/batch_jobs_api.py +1937 -0
- compute_api_client/api/commits_api.py +1068 -435
- compute_api_client/api/files_api.py +1075 -435
- compute_api_client/api/final_results_api.py +736 -338
- compute_api_client/api/jobs_api.py +1653 -0
- compute_api_client/api/languages_api.py +556 -217
- compute_api_client/api/members_api.py +1057 -435
- compute_api_client/api/metadata_api.py +736 -337
- compute_api_client/api/permissions_api.py +1055 -421
- compute_api_client/api/projects_api.py +1604 -676
- compute_api_client/api/reservations_api.py +1124 -427
- compute_api_client/api/results_api.py +738 -337
- compute_api_client/api/teams_api.py +567 -220
- compute_api_client/api/transactions_api.py +679 -218
- compute_api_client/api/users_api.py +1090 -435
- compute_api_client/api_client.py +346 -304
- compute_api_client/api_response.py +21 -0
- compute_api_client/configuration.py +54 -67
- compute_api_client/docs/Algorithm.md +20 -3
- compute_api_client/docs/AlgorithmIn.md +20 -3
- compute_api_client/docs/AlgorithmType.md +0 -1
- compute_api_client/docs/AlgorithmsApi.md +78 -77
- compute_api_client/docs/Backend.md +33 -0
- compute_api_client/docs/BackendApi.md +419 -0
- compute_api_client/docs/BackendPatch.md +29 -0
- compute_api_client/docs/{RunStatus.md → BackendStatus.md} +1 -2
- compute_api_client/docs/BackendType.md +36 -0
- compute_api_client/docs/{RuntimeTypesApi.md → BackendTypesApi.md} +58 -31
- compute_api_client/docs/BackendWithAuthentication.md +34 -0
- compute_api_client/docs/BatchJob.md +38 -0
- compute_api_client/docs/BatchJobIn.md +29 -0
- compute_api_client/docs/{RuntimeStatus.md → BatchJobStatus.md} +1 -2
- compute_api_client/docs/{BatchRunsApi.md → BatchJobsApi.md} +170 -147
- compute_api_client/docs/Commit.md +18 -1
- compute_api_client/docs/CommitIn.md +17 -0
- compute_api_client/docs/CommitsApi.md +62 -71
- compute_api_client/docs/CompileStage.md +0 -1
- compute_api_client/docs/Domain.md +0 -1
- compute_api_client/docs/File.md +21 -4
- compute_api_client/docs/FileIn.md +21 -4
- compute_api_client/docs/FilesApi.md +65 -71
- compute_api_client/docs/FinalResult.md +20 -3
- compute_api_client/docs/FinalResultIn.md +19 -2
- compute_api_client/docs/FinalResultsApi.md +44 -71
- compute_api_client/docs/HTTPNotFoundError.md +17 -0
- compute_api_client/docs/HTTPValidationError.md +18 -1
- compute_api_client/docs/Job.md +36 -0
- compute_api_client/docs/JobIn.md +31 -0
- compute_api_client/docs/JobPatch.md +28 -0
- compute_api_client/docs/{BatchRunStatus.md → JobStatus.md} +1 -2
- compute_api_client/docs/{RunsApi.md → JobsApi.md} +137 -122
- compute_api_client/docs/Language.md +17 -0
- compute_api_client/docs/LanguagesApi.md +30 -12
- compute_api_client/docs/LocationInner.md +17 -0
- compute_api_client/docs/Member.md +19 -2
- compute_api_client/docs/MemberIn.md +19 -2
- compute_api_client/docs/MembersApi.md +59 -24
- compute_api_client/docs/Metadata.md +20 -3
- compute_api_client/docs/MetadataApi.md +49 -33
- compute_api_client/docs/MetadataIn.md +19 -2
- compute_api_client/docs/Permission.md +17 -0
- compute_api_client/docs/PermissionGroup.md +17 -0
- compute_api_client/docs/PermissionsApi.md +68 -28
- compute_api_client/docs/Project.md +20 -3
- compute_api_client/docs/ProjectIn.md +18 -1
- compute_api_client/docs/ProjectPatch.md +19 -2
- compute_api_client/docs/ProjectsApi.md +84 -36
- compute_api_client/docs/Reservation.md +21 -4
- compute_api_client/docs/ReservationIn.md +19 -2
- compute_api_client/docs/ReservationsApi.md +66 -24
- compute_api_client/docs/Result.md +23 -6
- compute_api_client/docs/ResultIn.md +19 -2
- compute_api_client/docs/ResultsApi.md +42 -26
- compute_api_client/docs/Role.md +0 -1
- compute_api_client/docs/ShareType.md +0 -1
- compute_api_client/docs/Team.md +18 -1
- compute_api_client/docs/TeamsApi.md +37 -14
- compute_api_client/docs/Transaction.md +21 -4
- compute_api_client/docs/TransactionsApi.md +50 -14
- compute_api_client/docs/User.md +21 -4
- compute_api_client/docs/UserIn.md +17 -0
- compute_api_client/docs/UsersApi.md +62 -24
- compute_api_client/docs/ValidationError.md +18 -1
- compute_api_client/exceptions.py +19 -16
- compute_api_client/models/__init__.py +16 -14
- compute_api_client/models/algorithm.py +78 -237
- compute_api_client/models/algorithm_in.py +76 -204
- compute_api_client/models/algorithm_type.py +21 -87
- compute_api_client/models/backend.py +100 -0
- compute_api_client/models/backend_patch.py +90 -0
- compute_api_client/models/backend_status.py +47 -0
- compute_api_client/models/backend_type.py +105 -0
- compute_api_client/models/backend_with_authentication.py +102 -0
- compute_api_client/models/batch_job.py +129 -0
- compute_api_client/models/batch_job_in.py +89 -0
- compute_api_client/models/batch_job_status.py +48 -0
- compute_api_client/models/commit.py +72 -230
- compute_api_client/models/commit_in.py +67 -169
- compute_api_client/models/compile_stage.py +23 -89
- compute_api_client/models/domain.py +22 -88
- compute_api_client/models/file.py +74 -288
- compute_api_client/models/file_in.py +72 -254
- compute_api_client/models/final_result.py +68 -198
- compute_api_client/models/final_result_in.py +63 -137
- compute_api_client/models/http_not_found_error.py +60 -105
- compute_api_client/models/http_validation_error.py +69 -105
- compute_api_client/models/job.py +120 -0
- compute_api_client/models/job_in.py +99 -0
- compute_api_client/models/job_patch.py +88 -0
- compute_api_client/models/job_status.py +48 -0
- compute_api_client/models/language.py +67 -172
- compute_api_client/models/location_inner.py +125 -84
- compute_api_client/models/member.py +70 -236
- compute_api_client/models/member_in.py +68 -203
- compute_api_client/models/metadata.py +68 -198
- compute_api_client/models/metadata_in.py +68 -137
- compute_api_client/models/permission.py +67 -172
- compute_api_client/models/permission_group.py +65 -142
- compute_api_client/models/project.py +74 -256
- compute_api_client/models/project_in.py +69 -195
- compute_api_client/models/project_patch.py +89 -192
- compute_api_client/models/reservation.py +79 -290
- compute_api_client/models/reservation_in.py +68 -200
- compute_api_client/models/result.py +101 -359
- compute_api_client/models/result_in.py +95 -291
- compute_api_client/models/role.py +21 -87
- compute_api_client/models/share_type.py +22 -88
- compute_api_client/models/team.py +69 -198
- compute_api_client/models/transaction.py +93 -299
- compute_api_client/models/user.py +75 -276
- compute_api_client/models/user_in.py +73 -243
- compute_api_client/models/validation_error.py +73 -160
- compute_api_client/rest.py +55 -114
- {qi_compute_api_client-0.7.0.dist-info → qi_compute_api_client-0.17.0.dist-info}/METADATA +47 -40
- qi_compute_api_client-0.17.0.dist-info/RECORD +142 -0
- compute_api_client/api/batch_runs_api.py +0 -862
- compute_api_client/api/runs_api.py +0 -723
- compute_api_client/api/runtime_api.py +0 -449
- compute_api_client/api/runtime_types_api.py +0 -303
- compute_api_client/docs/BatchRun.md +0 -21
- compute_api_client/docs/BatchRunIn.md +0 -12
- compute_api_client/docs/Run.md +0 -19
- compute_api_client/docs/RunIn.md +0 -14
- compute_api_client/docs/Runtime.md +0 -16
- compute_api_client/docs/RuntimeApi.md +0 -229
- compute_api_client/docs/RuntimeType.md +0 -19
- compute_api_client/docs/RuntimeWithAuthentication.md +0 -17
- compute_api_client/models/batch_run.py +0 -423
- compute_api_client/models/batch_run_in.py +0 -171
- compute_api_client/models/batch_run_status.py +0 -114
- compute_api_client/models/run.py +0 -376
- compute_api_client/models/run_in.py +0 -233
- compute_api_client/models/run_status.py +0 -114
- compute_api_client/models/runtime.py +0 -290
- compute_api_client/models/runtime_status.py +0 -113
- compute_api_client/models/runtime_type.py +0 -357
- compute_api_client/models/runtime_with_authentication.py +0 -320
- qi_compute_api_client-0.7.0.dist-info/RECORD +0 -137
- {qi_compute_api_client-0.7.0.dist-info → qi_compute_api_client-0.17.0.dist-info}/LICENSE.md +0 -0
- {qi_compute_api_client-0.7.0.dist-info → qi_compute_api_client-0.17.0.dist-info}/WHEEL +0 -0
|
@@ -3,227 +3,92 @@
|
|
|
3
3
|
"""
|
|
4
4
|
Quantum Inspire 2
|
|
5
5
|
|
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
7
|
|
|
8
8
|
The version of the OpenAPI document: 0.1.0
|
|
9
|
-
Generated by
|
|
10
|
-
"""
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
10
|
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
except ImportError:
|
|
16
|
-
from inspect import getargspec as getfullargspec
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
17
16
|
import pprint
|
|
18
17
|
import re # noqa: F401
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
from compute_api_client.configuration import Configuration
|
|
18
|
+
import json
|
|
22
19
|
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from pydantic import BaseModel, StrictBool, StrictInt
|
|
23
|
+
from compute_api_client.models.role import Role
|
|
24
|
+
try:
|
|
25
|
+
from typing import Self
|
|
26
|
+
except ImportError:
|
|
27
|
+
from typing_extensions import Self
|
|
30
28
|
|
|
29
|
+
class MemberIn(BaseModel):
|
|
31
30
|
"""
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
attribute_map = {
|
|
46
|
-
'role': 'role',
|
|
47
|
-
'is_active': 'is_active',
|
|
48
|
-
'team_id': 'team_id',
|
|
49
|
-
'user_id': 'user_id'
|
|
31
|
+
MemberIn
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
team_id: StrictInt
|
|
34
|
+
user_id: StrictInt
|
|
35
|
+
role: Role
|
|
36
|
+
is_active: Optional[StrictBool] = False
|
|
37
|
+
__properties: ClassVar[List[str]] = ["team_id", "user_id", "role", "is_active"]
|
|
38
|
+
|
|
39
|
+
model_config = {
|
|
40
|
+
"populate_by_name": True,
|
|
41
|
+
"validate_assignment": True
|
|
50
42
|
}
|
|
51
43
|
|
|
52
|
-
def __init__(self, role=None, is_active=False, team_id=None, user_id=None, local_vars_configuration=None): # noqa: E501
|
|
53
|
-
"""MemberIn - a model defined in OpenAPI""" # noqa: E501
|
|
54
|
-
if local_vars_configuration is None:
|
|
55
|
-
local_vars_configuration = Configuration.get_default_copy()
|
|
56
|
-
self.local_vars_configuration = local_vars_configuration
|
|
57
|
-
|
|
58
|
-
self._role = None
|
|
59
|
-
self._is_active = None
|
|
60
|
-
self._team_id = None
|
|
61
|
-
self._user_id = None
|
|
62
|
-
self.discriminator = None
|
|
63
|
-
|
|
64
|
-
self.role = role
|
|
65
|
-
if is_active is not None:
|
|
66
|
-
self.is_active = is_active
|
|
67
|
-
self.team_id = team_id
|
|
68
|
-
self.user_id = user_id
|
|
69
|
-
|
|
70
|
-
@property
|
|
71
|
-
def role(self):
|
|
72
|
-
"""Gets the role of this MemberIn. # noqa: E501
|
|
73
|
-
|
|
74
|
-
MEMBER: member<br/>ADMIN: admin # noqa: E501
|
|
75
|
-
|
|
76
|
-
:return: The role of this MemberIn. # noqa: E501
|
|
77
|
-
:rtype: Role
|
|
78
|
-
"""
|
|
79
|
-
return self._role
|
|
80
|
-
|
|
81
|
-
@role.setter
|
|
82
|
-
def role(self, role):
|
|
83
|
-
"""Sets the role of this MemberIn.
|
|
84
44
|
|
|
85
|
-
|
|
45
|
+
def to_str(self) -> str:
|
|
46
|
+
"""Returns the string representation of the model using alias"""
|
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
86
48
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
raise ValueError("Invalid value for `role`, must not be `None`") # noqa: E501
|
|
92
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
93
|
-
role is not None and len(role) > 6):
|
|
94
|
-
raise ValueError("Invalid value for `role`, length must be less than or equal to `6`") # noqa: E501
|
|
95
|
-
|
|
96
|
-
self._role = role
|
|
97
|
-
|
|
98
|
-
@property
|
|
99
|
-
def is_active(self):
|
|
100
|
-
"""Gets the is_active of this MemberIn. # noqa: E501
|
|
49
|
+
def to_json(self) -> str:
|
|
50
|
+
"""Returns the JSON representation of the model using alias"""
|
|
51
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
52
|
+
return json.dumps(self.to_dict())
|
|
101
53
|
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Self:
|
|
56
|
+
"""Create an instance of MemberIn from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
102
58
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"""
|
|
106
|
-
return self._is_active
|
|
107
|
-
|
|
108
|
-
@is_active.setter
|
|
109
|
-
def is_active(self, is_active):
|
|
110
|
-
"""Sets the is_active of this MemberIn.
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
111
61
|
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
112
64
|
|
|
113
|
-
|
|
114
|
-
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
115
68
|
"""
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
"""
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude={
|
|
72
|
+
},
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Dict) -> Self:
|
|
79
|
+
"""Create an instance of MemberIn from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"team_id": obj.get("team_id"),
|
|
88
|
+
"user_id": obj.get("user_id"),
|
|
89
|
+
"role": obj.get("role"),
|
|
90
|
+
"is_active": obj.get("is_active") if obj.get("is_active") is not None else False
|
|
91
|
+
})
|
|
92
|
+
return _obj
|
|
132
93
|
|
|
133
94
|
|
|
134
|
-
:param team_id: The team_id of this MemberIn. # noqa: E501
|
|
135
|
-
:type team_id: int
|
|
136
|
-
"""
|
|
137
|
-
if self.local_vars_configuration.client_side_validation and team_id is None: # noqa: E501
|
|
138
|
-
raise ValueError("Invalid value for `team_id`, must not be `None`") # noqa: E501
|
|
139
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
140
|
-
team_id is not None and team_id > 2147483647): # noqa: E501
|
|
141
|
-
raise ValueError("Invalid value for `team_id`, must be a value less than or equal to `2147483647`") # noqa: E501
|
|
142
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
143
|
-
team_id is not None and team_id < 1): # noqa: E501
|
|
144
|
-
raise ValueError("Invalid value for `team_id`, must be a value greater than or equal to `1`") # noqa: E501
|
|
145
|
-
|
|
146
|
-
self._team_id = team_id
|
|
147
|
-
|
|
148
|
-
@property
|
|
149
|
-
def user_id(self):
|
|
150
|
-
"""Gets the user_id of this MemberIn. # noqa: E501
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
:return: The user_id of this MemberIn. # noqa: E501
|
|
154
|
-
:rtype: int
|
|
155
|
-
"""
|
|
156
|
-
return self._user_id
|
|
157
|
-
|
|
158
|
-
@user_id.setter
|
|
159
|
-
def user_id(self, user_id):
|
|
160
|
-
"""Sets the user_id of this MemberIn.
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
:param user_id: The user_id of this MemberIn. # noqa: E501
|
|
164
|
-
:type user_id: int
|
|
165
|
-
"""
|
|
166
|
-
if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501
|
|
167
|
-
raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501
|
|
168
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
169
|
-
user_id is not None and user_id > 2147483647): # noqa: E501
|
|
170
|
-
raise ValueError("Invalid value for `user_id`, must be a value less than or equal to `2147483647`") # noqa: E501
|
|
171
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
172
|
-
user_id is not None and user_id < 1): # noqa: E501
|
|
173
|
-
raise ValueError("Invalid value for `user_id`, must be a value greater than or equal to `1`") # noqa: E501
|
|
174
|
-
|
|
175
|
-
self._user_id = user_id
|
|
176
|
-
|
|
177
|
-
def to_dict(self, serialize=False):
|
|
178
|
-
"""Returns the model properties as a dict"""
|
|
179
|
-
result = {}
|
|
180
|
-
|
|
181
|
-
def convert(x):
|
|
182
|
-
if hasattr(x, "to_dict"):
|
|
183
|
-
args = getfullargspec(x.to_dict).args
|
|
184
|
-
if len(args) == 1:
|
|
185
|
-
return x.to_dict()
|
|
186
|
-
else:
|
|
187
|
-
return x.to_dict(serialize)
|
|
188
|
-
else:
|
|
189
|
-
return x
|
|
190
|
-
|
|
191
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
|
192
|
-
value = getattr(self, attr)
|
|
193
|
-
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
|
194
|
-
if isinstance(value, list):
|
|
195
|
-
result[attr] = list(map(
|
|
196
|
-
lambda x: convert(x),
|
|
197
|
-
value
|
|
198
|
-
))
|
|
199
|
-
elif isinstance(value, dict):
|
|
200
|
-
result[attr] = dict(map(
|
|
201
|
-
lambda item: (item[0], convert(item[1])),
|
|
202
|
-
value.items()
|
|
203
|
-
))
|
|
204
|
-
else:
|
|
205
|
-
result[attr] = convert(value)
|
|
206
|
-
|
|
207
|
-
return result
|
|
208
|
-
|
|
209
|
-
def to_str(self):
|
|
210
|
-
"""Returns the string representation of the model"""
|
|
211
|
-
return pprint.pformat(self.to_dict())
|
|
212
|
-
|
|
213
|
-
def __repr__(self):
|
|
214
|
-
"""For `print` and `pprint`"""
|
|
215
|
-
return self.to_str()
|
|
216
|
-
|
|
217
|
-
def __eq__(self, other):
|
|
218
|
-
"""Returns true if both objects are equal"""
|
|
219
|
-
if not isinstance(other, MemberIn):
|
|
220
|
-
return False
|
|
221
|
-
|
|
222
|
-
return self.to_dict() == other.to_dict()
|
|
223
|
-
|
|
224
|
-
def __ne__(self, other):
|
|
225
|
-
"""Returns true if both objects are not equal"""
|
|
226
|
-
if not isinstance(other, MemberIn):
|
|
227
|
-
return True
|
|
228
|
-
|
|
229
|
-
return self.to_dict() != other.to_dict()
|
|
@@ -3,221 +3,91 @@
|
|
|
3
3
|
"""
|
|
4
4
|
Quantum Inspire 2
|
|
5
5
|
|
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
7
|
|
|
8
8
|
The version of the OpenAPI document: 0.1.0
|
|
9
|
-
Generated by
|
|
10
|
-
"""
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
10
|
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
except ImportError:
|
|
16
|
-
from inspect import getargspec as getfullargspec
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
17
16
|
import pprint
|
|
18
17
|
import re # noqa: F401
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
from compute_api_client.configuration import Configuration
|
|
18
|
+
import json
|
|
22
19
|
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Union
|
|
22
|
+
from pydantic import BaseModel, StrictInt
|
|
23
|
+
try:
|
|
24
|
+
from typing import Self
|
|
25
|
+
except ImportError:
|
|
26
|
+
from typing_extensions import Self
|
|
23
27
|
|
|
24
|
-
class Metadata(
|
|
25
|
-
"""NOTE: This class is auto generated by OpenAPI Generator.
|
|
26
|
-
Ref: https://openapi-generator.tech
|
|
27
|
-
|
|
28
|
-
Do not edit the class manually.
|
|
29
|
-
"""
|
|
30
|
-
|
|
31
|
-
"""
|
|
32
|
-
Attributes:
|
|
33
|
-
openapi_types (dict): The key is attribute name
|
|
34
|
-
and the value is attribute type.
|
|
35
|
-
attribute_map (dict): The key is attribute name
|
|
36
|
-
and the value is json key in definition.
|
|
28
|
+
class Metadata(BaseModel):
|
|
37
29
|
"""
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
Metadata
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
id: StrictInt
|
|
33
|
+
backend_id: StrictInt
|
|
34
|
+
created_on: datetime
|
|
35
|
+
data: Union[str, Any]
|
|
36
|
+
__properties: ClassVar[List[str]] = ["id", "backend_id", "created_on", "data"]
|
|
37
|
+
|
|
38
|
+
model_config = {
|
|
39
|
+
"populate_by_name": True,
|
|
40
|
+
"validate_assignment": True
|
|
43
41
|
}
|
|
44
42
|
|
|
45
|
-
attribute_map = {
|
|
46
|
-
'created_on': 'created_on',
|
|
47
|
-
'id': 'id',
|
|
48
|
-
'data': 'data',
|
|
49
|
-
'runtime_id': 'runtime_id'
|
|
50
|
-
}
|
|
51
43
|
|
|
52
|
-
def
|
|
53
|
-
"""
|
|
54
|
-
|
|
55
|
-
local_vars_configuration = Configuration.get_default_copy()
|
|
56
|
-
self.local_vars_configuration = local_vars_configuration
|
|
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))
|
|
57
47
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
self.
|
|
62
|
-
self.discriminator = None
|
|
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())
|
|
63
52
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Self:
|
|
55
|
+
"""Create an instance of Metadata from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
68
57
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"""Gets the created_on of this Metadata. # noqa: E501
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
72
60
|
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
73
63
|
|
|
74
|
-
|
|
75
|
-
|
|
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.
|
|
76
67
|
"""
|
|
77
|
-
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude={
|
|
71
|
+
},
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: Dict) -> Self:
|
|
78
|
+
"""Create an instance of Metadata from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return cls.model_validate(obj)
|
|
84
|
+
|
|
85
|
+
_obj = cls.model_validate({
|
|
86
|
+
"id": obj.get("id"),
|
|
87
|
+
"backend_id": obj.get("backend_id"),
|
|
88
|
+
"created_on": obj.get("created_on"),
|
|
89
|
+
"data": obj.get("data")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
78
92
|
|
|
79
|
-
@created_on.setter
|
|
80
|
-
def created_on(self, created_on):
|
|
81
|
-
"""Sets the created_on of this Metadata.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
:param created_on: The created_on of this Metadata. # noqa: E501
|
|
85
|
-
:type created_on: datetime
|
|
86
|
-
"""
|
|
87
|
-
if self.local_vars_configuration.client_side_validation and created_on is None: # noqa: E501
|
|
88
|
-
raise ValueError("Invalid value for `created_on`, must not be `None`") # noqa: E501
|
|
89
|
-
|
|
90
|
-
self._created_on = created_on
|
|
91
|
-
|
|
92
|
-
@property
|
|
93
|
-
def id(self):
|
|
94
|
-
"""Gets the id of this Metadata. # noqa: E501
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
:return: The id of this Metadata. # noqa: E501
|
|
98
|
-
:rtype: int
|
|
99
|
-
"""
|
|
100
|
-
return self._id
|
|
101
93
|
|
|
102
|
-
@id.setter
|
|
103
|
-
def id(self, id):
|
|
104
|
-
"""Sets the id of this Metadata.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
:param id: The id of this Metadata. # noqa: E501
|
|
108
|
-
:type id: int
|
|
109
|
-
"""
|
|
110
|
-
if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501
|
|
111
|
-
raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
|
|
112
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
113
|
-
id is not None and id > 2147483647): # noqa: E501
|
|
114
|
-
raise ValueError("Invalid value for `id`, must be a value less than or equal to `2147483647`") # noqa: E501
|
|
115
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
116
|
-
id is not None and id < 1): # noqa: E501
|
|
117
|
-
raise ValueError("Invalid value for `id`, must be a value greater than or equal to `1`") # noqa: E501
|
|
118
|
-
|
|
119
|
-
self._id = id
|
|
120
|
-
|
|
121
|
-
@property
|
|
122
|
-
def data(self):
|
|
123
|
-
"""Gets the data of this Metadata. # noqa: E501
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
:return: The data of this Metadata. # noqa: E501
|
|
127
|
-
:rtype: object
|
|
128
|
-
"""
|
|
129
|
-
return self._data
|
|
130
|
-
|
|
131
|
-
@data.setter
|
|
132
|
-
def data(self, data):
|
|
133
|
-
"""Sets the data of this Metadata.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
:param data: The data of this Metadata. # noqa: E501
|
|
137
|
-
:type data: object
|
|
138
|
-
"""
|
|
139
|
-
|
|
140
|
-
self._data = data
|
|
141
|
-
|
|
142
|
-
@property
|
|
143
|
-
def runtime_id(self):
|
|
144
|
-
"""Gets the runtime_id of this Metadata. # noqa: E501
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
:return: The runtime_id of this Metadata. # noqa: E501
|
|
148
|
-
:rtype: int
|
|
149
|
-
"""
|
|
150
|
-
return self._runtime_id
|
|
151
|
-
|
|
152
|
-
@runtime_id.setter
|
|
153
|
-
def runtime_id(self, runtime_id):
|
|
154
|
-
"""Sets the runtime_id of this Metadata.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
:param runtime_id: The runtime_id of this Metadata. # noqa: E501
|
|
158
|
-
:type runtime_id: int
|
|
159
|
-
"""
|
|
160
|
-
if self.local_vars_configuration.client_side_validation and runtime_id is None: # noqa: E501
|
|
161
|
-
raise ValueError("Invalid value for `runtime_id`, must not be `None`") # noqa: E501
|
|
162
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
163
|
-
runtime_id is not None and runtime_id > 2147483647): # noqa: E501
|
|
164
|
-
raise ValueError("Invalid value for `runtime_id`, must be a value less than or equal to `2147483647`") # noqa: E501
|
|
165
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
166
|
-
runtime_id is not None and runtime_id < 1): # noqa: E501
|
|
167
|
-
raise ValueError("Invalid value for `runtime_id`, must be a value greater than or equal to `1`") # noqa: E501
|
|
168
|
-
|
|
169
|
-
self._runtime_id = runtime_id
|
|
170
|
-
|
|
171
|
-
def to_dict(self, serialize=False):
|
|
172
|
-
"""Returns the model properties as a dict"""
|
|
173
|
-
result = {}
|
|
174
|
-
|
|
175
|
-
def convert(x):
|
|
176
|
-
if hasattr(x, "to_dict"):
|
|
177
|
-
args = getfullargspec(x.to_dict).args
|
|
178
|
-
if len(args) == 1:
|
|
179
|
-
return x.to_dict()
|
|
180
|
-
else:
|
|
181
|
-
return x.to_dict(serialize)
|
|
182
|
-
else:
|
|
183
|
-
return x
|
|
184
|
-
|
|
185
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
|
186
|
-
value = getattr(self, attr)
|
|
187
|
-
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
|
188
|
-
if isinstance(value, list):
|
|
189
|
-
result[attr] = list(map(
|
|
190
|
-
lambda x: convert(x),
|
|
191
|
-
value
|
|
192
|
-
))
|
|
193
|
-
elif isinstance(value, dict):
|
|
194
|
-
result[attr] = dict(map(
|
|
195
|
-
lambda item: (item[0], convert(item[1])),
|
|
196
|
-
value.items()
|
|
197
|
-
))
|
|
198
|
-
else:
|
|
199
|
-
result[attr] = convert(value)
|
|
200
|
-
|
|
201
|
-
return result
|
|
202
|
-
|
|
203
|
-
def to_str(self):
|
|
204
|
-
"""Returns the string representation of the model"""
|
|
205
|
-
return pprint.pformat(self.to_dict())
|
|
206
|
-
|
|
207
|
-
def __repr__(self):
|
|
208
|
-
"""For `print` and `pprint`"""
|
|
209
|
-
return self.to_str()
|
|
210
|
-
|
|
211
|
-
def __eq__(self, other):
|
|
212
|
-
"""Returns true if both objects are equal"""
|
|
213
|
-
if not isinstance(other, Metadata):
|
|
214
|
-
return False
|
|
215
|
-
|
|
216
|
-
return self.to_dict() == other.to_dict()
|
|
217
|
-
|
|
218
|
-
def __ne__(self, other):
|
|
219
|
-
"""Returns true if both objects are not equal"""
|
|
220
|
-
if not isinstance(other, Metadata):
|
|
221
|
-
return True
|
|
222
|
-
|
|
223
|
-
return self.to_dict() != other.to_dict()
|