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,219 +3,93 @@
|
|
|
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, StrictStr
|
|
23
|
+
from pydantic import Field
|
|
24
|
+
from typing_extensions import Annotated
|
|
25
|
+
try:
|
|
26
|
+
from typing import Self
|
|
27
|
+
except ImportError:
|
|
28
|
+
from typing_extensions import Self
|
|
30
29
|
|
|
30
|
+
class ProjectIn(BaseModel):
|
|
31
31
|
"""
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
attribute_map = {
|
|
46
|
-
'name': 'name',
|
|
47
|
-
'description': 'description',
|
|
48
|
-
'starred': 'starred',
|
|
49
|
-
'owner_id': 'owner_id'
|
|
32
|
+
ProjectIn
|
|
33
|
+
""" # noqa: E501
|
|
34
|
+
owner_id: StrictInt
|
|
35
|
+
name: Annotated[str, Field(strict=True, max_length=255)]
|
|
36
|
+
description: StrictStr
|
|
37
|
+
starred: Optional[StrictBool] = False
|
|
38
|
+
__properties: ClassVar[List[str]] = ["owner_id", "name", "description", "starred"]
|
|
39
|
+
|
|
40
|
+
model_config = {
|
|
41
|
+
"populate_by_name": True,
|
|
42
|
+
"validate_assignment": True
|
|
50
43
|
}
|
|
51
44
|
|
|
52
|
-
def __init__(self, name=None, description=None, starred=False, owner_id=None, local_vars_configuration=None): # noqa: E501
|
|
53
|
-
"""ProjectIn - 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._name = None
|
|
59
|
-
self._description = None
|
|
60
|
-
self._starred = None
|
|
61
|
-
self._owner_id = None
|
|
62
|
-
self.discriminator = None
|
|
63
|
-
|
|
64
|
-
self.name = name
|
|
65
|
-
self.description = description
|
|
66
|
-
if starred is not None:
|
|
67
|
-
self.starred = starred
|
|
68
|
-
self.owner_id = owner_id
|
|
69
|
-
|
|
70
|
-
@property
|
|
71
|
-
def name(self):
|
|
72
|
-
"""Gets the name of this ProjectIn. # noqa: E501
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
:return: The name of this ProjectIn. # noqa: E501
|
|
76
|
-
:rtype: str
|
|
77
|
-
"""
|
|
78
|
-
return self._name
|
|
79
|
-
|
|
80
|
-
@name.setter
|
|
81
|
-
def name(self, name):
|
|
82
|
-
"""Sets the name of this ProjectIn.
|
|
83
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))
|
|
84
49
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
|
|
90
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
91
|
-
name is not None and len(name) > 255):
|
|
92
|
-
raise ValueError("Invalid value for `name`, length must be less than or equal to `255`") # noqa: E501
|
|
93
|
-
|
|
94
|
-
self._name = name
|
|
95
|
-
|
|
96
|
-
@property
|
|
97
|
-
def description(self):
|
|
98
|
-
"""Gets the description of this ProjectIn. # noqa: E501
|
|
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())
|
|
99
54
|
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Self:
|
|
57
|
+
"""Create an instance of ProjectIn from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
100
59
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"""
|
|
104
|
-
return self._description
|
|
105
|
-
|
|
106
|
-
@description.setter
|
|
107
|
-
def description(self, description):
|
|
108
|
-
"""Sets the description of this ProjectIn.
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
109
62
|
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
110
65
|
|
|
111
|
-
|
|
112
|
-
|
|
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.
|
|
113
69
|
"""
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude={
|
|
73
|
+
},
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Dict) -> Self:
|
|
80
|
+
"""Create an instance of ProjectIn 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
|
+
"owner_id": obj.get("owner_id"),
|
|
89
|
+
"name": obj.get("name"),
|
|
90
|
+
"description": obj.get("description"),
|
|
91
|
+
"starred": obj.get("starred") if obj.get("starred") is not None else False
|
|
92
|
+
})
|
|
93
|
+
return _obj
|
|
132
94
|
|
|
133
95
|
|
|
134
|
-
:param starred: The starred of this ProjectIn. # noqa: E501
|
|
135
|
-
:type starred: bool
|
|
136
|
-
"""
|
|
137
|
-
|
|
138
|
-
self._starred = starred
|
|
139
|
-
|
|
140
|
-
@property
|
|
141
|
-
def owner_id(self):
|
|
142
|
-
"""Gets the owner_id of this ProjectIn. # noqa: E501
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
:return: The owner_id of this ProjectIn. # noqa: E501
|
|
146
|
-
:rtype: int
|
|
147
|
-
"""
|
|
148
|
-
return self._owner_id
|
|
149
|
-
|
|
150
|
-
@owner_id.setter
|
|
151
|
-
def owner_id(self, owner_id):
|
|
152
|
-
"""Sets the owner_id of this ProjectIn.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
:param owner_id: The owner_id of this ProjectIn. # noqa: E501
|
|
156
|
-
:type owner_id: int
|
|
157
|
-
"""
|
|
158
|
-
if self.local_vars_configuration.client_side_validation and owner_id is None: # noqa: E501
|
|
159
|
-
raise ValueError("Invalid value for `owner_id`, must not be `None`") # noqa: E501
|
|
160
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
161
|
-
owner_id is not None and owner_id > 2147483647): # noqa: E501
|
|
162
|
-
raise ValueError("Invalid value for `owner_id`, must be a value less than or equal to `2147483647`") # noqa: E501
|
|
163
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
164
|
-
owner_id is not None and owner_id < 1): # noqa: E501
|
|
165
|
-
raise ValueError("Invalid value for `owner_id`, must be a value greater than or equal to `1`") # noqa: E501
|
|
166
|
-
|
|
167
|
-
self._owner_id = owner_id
|
|
168
|
-
|
|
169
|
-
def to_dict(self, serialize=False):
|
|
170
|
-
"""Returns the model properties as a dict"""
|
|
171
|
-
result = {}
|
|
172
|
-
|
|
173
|
-
def convert(x):
|
|
174
|
-
if hasattr(x, "to_dict"):
|
|
175
|
-
args = getfullargspec(x.to_dict).args
|
|
176
|
-
if len(args) == 1:
|
|
177
|
-
return x.to_dict()
|
|
178
|
-
else:
|
|
179
|
-
return x.to_dict(serialize)
|
|
180
|
-
else:
|
|
181
|
-
return x
|
|
182
|
-
|
|
183
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
|
184
|
-
value = getattr(self, attr)
|
|
185
|
-
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
|
186
|
-
if isinstance(value, list):
|
|
187
|
-
result[attr] = list(map(
|
|
188
|
-
lambda x: convert(x),
|
|
189
|
-
value
|
|
190
|
-
))
|
|
191
|
-
elif isinstance(value, dict):
|
|
192
|
-
result[attr] = dict(map(
|
|
193
|
-
lambda item: (item[0], convert(item[1])),
|
|
194
|
-
value.items()
|
|
195
|
-
))
|
|
196
|
-
else:
|
|
197
|
-
result[attr] = convert(value)
|
|
198
|
-
|
|
199
|
-
return result
|
|
200
|
-
|
|
201
|
-
def to_str(self):
|
|
202
|
-
"""Returns the string representation of the model"""
|
|
203
|
-
return pprint.pformat(self.to_dict())
|
|
204
|
-
|
|
205
|
-
def __repr__(self):
|
|
206
|
-
"""For `print` and `pprint`"""
|
|
207
|
-
return self.to_str()
|
|
208
|
-
|
|
209
|
-
def __eq__(self, other):
|
|
210
|
-
"""Returns true if both objects are equal"""
|
|
211
|
-
if not isinstance(other, ProjectIn):
|
|
212
|
-
return False
|
|
213
|
-
|
|
214
|
-
return self.to_dict() == other.to_dict()
|
|
215
|
-
|
|
216
|
-
def __ne__(self, other):
|
|
217
|
-
"""Returns true if both objects are not equal"""
|
|
218
|
-
if not isinstance(other, ProjectIn):
|
|
219
|
-
return True
|
|
220
|
-
|
|
221
|
-
return self.to_dict() != other.to_dict()
|
|
@@ -3,216 +3,113 @@
|
|
|
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
|
|
18
|
+
import json
|
|
20
19
|
|
|
21
|
-
from compute_api_client.configuration import Configuration
|
|
22
20
|
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from pydantic import BaseModel, StrictBool, StrictInt, StrictStr
|
|
23
|
+
from pydantic import Field
|
|
24
|
+
from typing_extensions import Annotated
|
|
25
|
+
try:
|
|
26
|
+
from typing import Self
|
|
27
|
+
except ImportError:
|
|
28
|
+
from typing_extensions import Self
|
|
23
29
|
|
|
24
|
-
class ProjectPatch(
|
|
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.
|
|
30
|
+
class ProjectPatch(BaseModel):
|
|
37
31
|
"""
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
ProjectPatch
|
|
33
|
+
""" # noqa: E501
|
|
34
|
+
owner_id: Optional[StrictInt] = None
|
|
35
|
+
name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None
|
|
36
|
+
description: Optional[StrictStr] = None
|
|
37
|
+
starred: Optional[StrictBool] = None
|
|
38
|
+
__properties: ClassVar[List[str]] = ["owner_id", "name", "description", "starred"]
|
|
39
|
+
|
|
40
|
+
model_config = {
|
|
41
|
+
"populate_by_name": True,
|
|
42
|
+
"validate_assignment": True
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
attribute_map = {
|
|
46
|
-
'name': 'name',
|
|
47
|
-
'description': 'description',
|
|
48
|
-
'starred': 'starred',
|
|
49
|
-
'owner_id': 'owner_id'
|
|
50
|
-
}
|
|
51
45
|
|
|
52
|
-
def
|
|
53
|
-
"""
|
|
54
|
-
|
|
55
|
-
local_vars_configuration = Configuration.get_default_copy()
|
|
56
|
-
self.local_vars_configuration = local_vars_configuration
|
|
57
|
-
|
|
58
|
-
self._name = None
|
|
59
|
-
self._description = None
|
|
60
|
-
self._starred = None
|
|
61
|
-
self._owner_id = None
|
|
62
|
-
self.discriminator = None
|
|
63
|
-
|
|
64
|
-
if name is not None:
|
|
65
|
-
self.name = name
|
|
66
|
-
if description is not None:
|
|
67
|
-
self.description = description
|
|
68
|
-
if starred is not None:
|
|
69
|
-
self.starred = starred
|
|
70
|
-
if owner_id is not None:
|
|
71
|
-
self.owner_id = owner_id
|
|
72
|
-
|
|
73
|
-
@property
|
|
74
|
-
def name(self):
|
|
75
|
-
"""Gets the name of this ProjectPatch. # noqa: E501
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
:return: The name of this ProjectPatch. # noqa: E501
|
|
79
|
-
:rtype: str
|
|
80
|
-
"""
|
|
81
|
-
return self._name
|
|
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))
|
|
82
49
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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())
|
|
86
54
|
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Self:
|
|
57
|
+
"""Create an instance of ProjectPatch from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
87
59
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"""
|
|
91
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
92
|
-
name is not None and len(name) > 255):
|
|
93
|
-
raise ValueError("Invalid value for `name`, length must be less than or equal to `255`") # noqa: E501
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
94
62
|
|
|
95
|
-
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
96
65
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
:return: The description of this ProjectPatch. # noqa: E501
|
|
103
|
-
:rtype: str
|
|
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.
|
|
104
69
|
"""
|
|
105
|
-
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude={
|
|
73
|
+
},
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# set to None if owner_id (nullable) is None
|
|
77
|
+
# and model_fields_set contains the field
|
|
78
|
+
if self.owner_id is None and "owner_id" in self.model_fields_set:
|
|
79
|
+
_dict['owner_id'] = None
|
|
80
|
+
|
|
81
|
+
# set to None if name (nullable) is None
|
|
82
|
+
# and model_fields_set contains the field
|
|
83
|
+
if self.name is None and "name" in self.model_fields_set:
|
|
84
|
+
_dict['name'] = None
|
|
85
|
+
|
|
86
|
+
# set to None if description (nullable) is None
|
|
87
|
+
# and model_fields_set contains the field
|
|
88
|
+
if self.description is None and "description" in self.model_fields_set:
|
|
89
|
+
_dict['description'] = None
|
|
90
|
+
|
|
91
|
+
# set to None if starred (nullable) is None
|
|
92
|
+
# and model_fields_set contains the field
|
|
93
|
+
if self.starred is None and "starred" in self.model_fields_set:
|
|
94
|
+
_dict['starred'] = None
|
|
95
|
+
|
|
96
|
+
return _dict
|
|
97
|
+
|
|
98
|
+
@classmethod
|
|
99
|
+
def from_dict(cls, obj: Dict) -> Self:
|
|
100
|
+
"""Create an instance of ProjectPatch from a dict"""
|
|
101
|
+
if obj is None:
|
|
102
|
+
return None
|
|
103
|
+
|
|
104
|
+
if not isinstance(obj, dict):
|
|
105
|
+
return cls.model_validate(obj)
|
|
106
|
+
|
|
107
|
+
_obj = cls.model_validate({
|
|
108
|
+
"owner_id": obj.get("owner_id"),
|
|
109
|
+
"name": obj.get("name"),
|
|
110
|
+
"description": obj.get("description"),
|
|
111
|
+
"starred": obj.get("starred")
|
|
112
|
+
})
|
|
113
|
+
return _obj
|
|
106
114
|
|
|
107
|
-
@description.setter
|
|
108
|
-
def description(self, description):
|
|
109
|
-
"""Sets the description of this ProjectPatch.
|
|
110
115
|
|
|
111
|
-
|
|
112
|
-
:param description: The description of this ProjectPatch. # noqa: E501
|
|
113
|
-
:type description: str
|
|
114
|
-
"""
|
|
115
|
-
|
|
116
|
-
self._description = description
|
|
117
|
-
|
|
118
|
-
@property
|
|
119
|
-
def starred(self):
|
|
120
|
-
"""Gets the starred of this ProjectPatch. # noqa: E501
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
:return: The starred of this ProjectPatch. # noqa: E501
|
|
124
|
-
:rtype: bool
|
|
125
|
-
"""
|
|
126
|
-
return self._starred
|
|
127
|
-
|
|
128
|
-
@starred.setter
|
|
129
|
-
def starred(self, starred):
|
|
130
|
-
"""Sets the starred of this ProjectPatch.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
:param starred: The starred of this ProjectPatch. # noqa: E501
|
|
134
|
-
:type starred: bool
|
|
135
|
-
"""
|
|
136
|
-
|
|
137
|
-
self._starred = starred
|
|
138
|
-
|
|
139
|
-
@property
|
|
140
|
-
def owner_id(self):
|
|
141
|
-
"""Gets the owner_id of this ProjectPatch. # noqa: E501
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
:return: The owner_id of this ProjectPatch. # noqa: E501
|
|
145
|
-
:rtype: int
|
|
146
|
-
"""
|
|
147
|
-
return self._owner_id
|
|
148
|
-
|
|
149
|
-
@owner_id.setter
|
|
150
|
-
def owner_id(self, owner_id):
|
|
151
|
-
"""Sets the owner_id of this ProjectPatch.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
:param owner_id: The owner_id of this ProjectPatch. # noqa: E501
|
|
155
|
-
:type owner_id: int
|
|
156
|
-
"""
|
|
157
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
158
|
-
owner_id is not None and owner_id > 2147483647): # noqa: E501
|
|
159
|
-
raise ValueError("Invalid value for `owner_id`, must be a value less than or equal to `2147483647`") # noqa: E501
|
|
160
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
161
|
-
owner_id is not None and owner_id < 1): # noqa: E501
|
|
162
|
-
raise ValueError("Invalid value for `owner_id`, must be a value greater than or equal to `1`") # noqa: E501
|
|
163
|
-
|
|
164
|
-
self._owner_id = owner_id
|
|
165
|
-
|
|
166
|
-
def to_dict(self, serialize=False):
|
|
167
|
-
"""Returns the model properties as a dict"""
|
|
168
|
-
result = {}
|
|
169
|
-
|
|
170
|
-
def convert(x):
|
|
171
|
-
if hasattr(x, "to_dict"):
|
|
172
|
-
args = getfullargspec(x.to_dict).args
|
|
173
|
-
if len(args) == 1:
|
|
174
|
-
return x.to_dict()
|
|
175
|
-
else:
|
|
176
|
-
return x.to_dict(serialize)
|
|
177
|
-
else:
|
|
178
|
-
return x
|
|
179
|
-
|
|
180
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
|
181
|
-
value = getattr(self, attr)
|
|
182
|
-
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
|
183
|
-
if isinstance(value, list):
|
|
184
|
-
result[attr] = list(map(
|
|
185
|
-
lambda x: convert(x),
|
|
186
|
-
value
|
|
187
|
-
))
|
|
188
|
-
elif isinstance(value, dict):
|
|
189
|
-
result[attr] = dict(map(
|
|
190
|
-
lambda item: (item[0], convert(item[1])),
|
|
191
|
-
value.items()
|
|
192
|
-
))
|
|
193
|
-
else:
|
|
194
|
-
result[attr] = convert(value)
|
|
195
|
-
|
|
196
|
-
return result
|
|
197
|
-
|
|
198
|
-
def to_str(self):
|
|
199
|
-
"""Returns the string representation of the model"""
|
|
200
|
-
return pprint.pformat(self.to_dict())
|
|
201
|
-
|
|
202
|
-
def __repr__(self):
|
|
203
|
-
"""For `print` and `pprint`"""
|
|
204
|
-
return self.to_str()
|
|
205
|
-
|
|
206
|
-
def __eq__(self, other):
|
|
207
|
-
"""Returns true if both objects are equal"""
|
|
208
|
-
if not isinstance(other, ProjectPatch):
|
|
209
|
-
return False
|
|
210
|
-
|
|
211
|
-
return self.to_dict() == other.to_dict()
|
|
212
|
-
|
|
213
|
-
def __ne__(self, other):
|
|
214
|
-
"""Returns true if both objects are not equal"""
|
|
215
|
-
if not isinstance(other, ProjectPatch):
|
|
216
|
-
return True
|
|
217
|
-
|
|
218
|
-
return self.to_dict() != other.to_dict()
|