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,101 +3,142 @@
|
|
|
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
|
-
|
|
16
|
-
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
from inspect import getfullargspec
|
|
17
|
+
import json
|
|
17
18
|
import pprint
|
|
18
19
|
import re # noqa: F401
|
|
19
|
-
import six
|
|
20
|
-
|
|
21
|
-
from compute_api_client.configuration import Configuration
|
|
22
|
-
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
from typing import Optional
|
|
22
|
+
from pydantic import BaseModel, Field, StrictInt, StrictStr, ValidationError, field_validator
|
|
23
|
+
from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict
|
|
24
|
+
from typing_extensions import Literal
|
|
25
|
+
from pydantic import StrictStr, Field
|
|
26
|
+
try:
|
|
27
|
+
from typing import Self
|
|
28
|
+
except ImportError:
|
|
29
|
+
from typing_extensions import Self
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
"""
|
|
31
|
+
LOCATIONINNER_ANY_OF_SCHEMAS = ["int", "str"]
|
|
30
32
|
|
|
33
|
+
class LocationInner(BaseModel):
|
|
31
34
|
"""
|
|
32
|
-
|
|
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.
|
|
35
|
+
LocationInner
|
|
37
36
|
"""
|
|
38
|
-
openapi_types = {
|
|
39
|
-
}
|
|
40
37
|
|
|
41
|
-
|
|
38
|
+
# data type: str
|
|
39
|
+
anyof_schema_1_validator: Optional[StrictStr] = None
|
|
40
|
+
# data type: int
|
|
41
|
+
anyof_schema_2_validator: Optional[StrictInt] = None
|
|
42
|
+
if TYPE_CHECKING:
|
|
43
|
+
actual_instance: Optional[Union[int, str]] = None
|
|
44
|
+
else:
|
|
45
|
+
actual_instance: Any = None
|
|
46
|
+
any_of_schemas: List[str] = Literal[LOCATIONINNER_ANY_OF_SCHEMAS]
|
|
47
|
+
|
|
48
|
+
model_config = {
|
|
49
|
+
"validate_assignment": True
|
|
42
50
|
}
|
|
43
51
|
|
|
44
|
-
def __init__(self,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
52
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
53
|
+
if args:
|
|
54
|
+
if len(args) > 1:
|
|
55
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
56
|
+
if kwargs:
|
|
57
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
58
|
+
super().__init__(actual_instance=args[0])
|
|
59
|
+
else:
|
|
60
|
+
super().__init__(**kwargs)
|
|
61
|
+
|
|
62
|
+
@field_validator('actual_instance')
|
|
63
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
64
|
+
instance = LocationInner.model_construct()
|
|
65
|
+
error_messages = []
|
|
66
|
+
# validate data type: str
|
|
67
|
+
try:
|
|
68
|
+
instance.anyof_schema_1_validator = v
|
|
69
|
+
return v
|
|
70
|
+
except (ValidationError, ValueError) as e:
|
|
71
|
+
error_messages.append(str(e))
|
|
72
|
+
# validate data type: int
|
|
73
|
+
try:
|
|
74
|
+
instance.anyof_schema_2_validator = v
|
|
75
|
+
return v
|
|
76
|
+
except (ValidationError, ValueError) as e:
|
|
77
|
+
error_messages.append(str(e))
|
|
78
|
+
if error_messages:
|
|
79
|
+
# no match
|
|
80
|
+
raise ValueError("No match found when setting the actual_instance in LocationInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages))
|
|
81
|
+
else:
|
|
82
|
+
return v
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: dict) -> Self:
|
|
86
|
+
return cls.from_json(json.dumps(obj))
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_json(cls, json_str: str) -> Self:
|
|
90
|
+
"""Returns the object represented by the json string"""
|
|
91
|
+
instance = cls.model_construct()
|
|
92
|
+
error_messages = []
|
|
93
|
+
# deserialize data into str
|
|
94
|
+
try:
|
|
95
|
+
# validation
|
|
96
|
+
instance.anyof_schema_1_validator = json.loads(json_str)
|
|
97
|
+
# assign value to actual_instance
|
|
98
|
+
instance.actual_instance = instance.anyof_schema_1_validator
|
|
99
|
+
return instance
|
|
100
|
+
except (ValidationError, ValueError) as e:
|
|
101
|
+
error_messages.append(str(e))
|
|
102
|
+
# deserialize data into int
|
|
103
|
+
try:
|
|
104
|
+
# validation
|
|
105
|
+
instance.anyof_schema_2_validator = json.loads(json_str)
|
|
106
|
+
# assign value to actual_instance
|
|
107
|
+
instance.actual_instance = instance.anyof_schema_2_validator
|
|
108
|
+
return instance
|
|
109
|
+
except (ValidationError, ValueError) as e:
|
|
110
|
+
error_messages.append(str(e))
|
|
111
|
+
|
|
112
|
+
if error_messages:
|
|
113
|
+
# no match
|
|
114
|
+
raise ValueError("No match found when deserializing the JSON string into LocationInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages))
|
|
115
|
+
else:
|
|
116
|
+
return instance
|
|
117
|
+
|
|
118
|
+
def to_json(self) -> str:
|
|
119
|
+
"""Returns the JSON representation of the actual instance"""
|
|
120
|
+
if self.actual_instance is None:
|
|
121
|
+
return "null"
|
|
122
|
+
|
|
123
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
124
|
+
if callable(to_json):
|
|
125
|
+
return self.actual_instance.to_json()
|
|
126
|
+
else:
|
|
127
|
+
return json.dumps(self.actual_instance)
|
|
128
|
+
|
|
129
|
+
def to_dict(self) -> Dict:
|
|
130
|
+
"""Returns the dict representation of the actual instance"""
|
|
131
|
+
if self.actual_instance is None:
|
|
132
|
+
return "null"
|
|
133
|
+
|
|
134
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
135
|
+
if callable(to_json):
|
|
136
|
+
return self.actual_instance.to_dict()
|
|
137
|
+
else:
|
|
138
|
+
return json.dumps(self.actual_instance)
|
|
139
|
+
|
|
140
|
+
def to_str(self) -> str:
|
|
141
|
+
"""Returns the string representation of the actual instance"""
|
|
142
|
+
return pprint.pformat(self.model_dump())
|
|
143
|
+
|
|
144
|
+
|
|
@@ -3,260 +3,94 @@
|
|
|
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
|
|
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 Member(BaseModel):
|
|
31
30
|
"""
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
Member
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
id: StrictInt
|
|
34
|
+
team_id: StrictInt
|
|
35
|
+
user_id: StrictInt
|
|
36
|
+
role: Role
|
|
37
|
+
is_active: StrictBool
|
|
38
|
+
__properties: ClassVar[List[str]] = ["id", "team_id", "user_id", "role", "is_active"]
|
|
39
|
+
|
|
40
|
+
model_config = {
|
|
41
|
+
"populate_by_name": True,
|
|
42
|
+
"validate_assignment": True
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
attribute_map = {
|
|
47
|
-
'id': 'id',
|
|
48
|
-
'role': 'role',
|
|
49
|
-
'is_active': 'is_active',
|
|
50
|
-
'team_id': 'team_id',
|
|
51
|
-
'user_id': 'user_id'
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
def __init__(self, id=None, role=None, is_active=False, team_id=None, user_id=None, local_vars_configuration=None): # noqa: E501
|
|
55
|
-
"""Member - a model defined in OpenAPI""" # noqa: E501
|
|
56
|
-
if local_vars_configuration is None:
|
|
57
|
-
local_vars_configuration = Configuration.get_default_copy()
|
|
58
|
-
self.local_vars_configuration = local_vars_configuration
|
|
59
|
-
|
|
60
|
-
self._id = None
|
|
61
|
-
self._role = None
|
|
62
|
-
self._is_active = None
|
|
63
|
-
self._team_id = None
|
|
64
|
-
self._user_id = None
|
|
65
|
-
self.discriminator = None
|
|
66
|
-
|
|
67
|
-
self.id = id
|
|
68
|
-
self.role = role
|
|
69
|
-
if is_active is not None:
|
|
70
|
-
self.is_active = is_active
|
|
71
|
-
self.team_id = team_id
|
|
72
|
-
self.user_id = user_id
|
|
73
|
-
|
|
74
|
-
@property
|
|
75
|
-
def id(self):
|
|
76
|
-
"""Gets the id of this Member. # noqa: E501
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
:return: The id of this Member. # noqa: E501
|
|
80
|
-
:rtype: int
|
|
81
|
-
"""
|
|
82
|
-
return self._id
|
|
83
|
-
|
|
84
|
-
@id.setter
|
|
85
|
-
def id(self, id):
|
|
86
|
-
"""Sets the id of this Member.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
:param id: The id of this Member. # noqa: E501
|
|
90
|
-
:type id: int
|
|
91
|
-
"""
|
|
92
|
-
if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501
|
|
93
|
-
raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
|
|
94
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
95
|
-
id is not None and id > 2147483647): # noqa: E501
|
|
96
|
-
raise ValueError("Invalid value for `id`, must be a value less than or equal to `2147483647`") # noqa: E501
|
|
97
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
98
|
-
id is not None and id < 1): # noqa: E501
|
|
99
|
-
raise ValueError("Invalid value for `id`, must be a value greater than or equal to `1`") # noqa: E501
|
|
100
|
-
|
|
101
|
-
self._id = id
|
|
102
|
-
|
|
103
|
-
@property
|
|
104
|
-
def role(self):
|
|
105
|
-
"""Gets the role of this Member. # noqa: E501
|
|
106
|
-
|
|
107
|
-
MEMBER: member<br/>ADMIN: admin # noqa: E501
|
|
108
|
-
|
|
109
|
-
:return: The role of this Member. # noqa: E501
|
|
110
|
-
:rtype: Role
|
|
111
|
-
"""
|
|
112
|
-
return self._role
|
|
113
|
-
|
|
114
|
-
@role.setter
|
|
115
|
-
def role(self, role):
|
|
116
|
-
"""Sets the role of this Member.
|
|
117
|
-
|
|
118
|
-
MEMBER: member<br/>ADMIN: admin # noqa: E501
|
|
119
|
-
|
|
120
|
-
:param role: The role of this Member. # noqa: E501
|
|
121
|
-
:type role: Role
|
|
122
|
-
"""
|
|
123
|
-
if self.local_vars_configuration.client_side_validation and role is None: # noqa: E501
|
|
124
|
-
raise ValueError("Invalid value for `role`, must not be `None`") # noqa: E501
|
|
125
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
126
|
-
role is not None and len(role) > 6):
|
|
127
|
-
raise ValueError("Invalid value for `role`, length must be less than or equal to `6`") # noqa: E501
|
|
128
|
-
|
|
129
|
-
self._role = role
|
|
130
|
-
|
|
131
|
-
@property
|
|
132
|
-
def is_active(self):
|
|
133
|
-
"""Gets the is_active of this Member. # noqa: E501
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
:return: The is_active of this Member. # noqa: E501
|
|
137
|
-
:rtype: bool
|
|
138
|
-
"""
|
|
139
|
-
return self._is_active
|
|
140
|
-
|
|
141
|
-
@is_active.setter
|
|
142
|
-
def is_active(self, is_active):
|
|
143
|
-
"""Sets the is_active of this Member.
|
|
144
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))
|
|
145
49
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
self._is_active = is_active
|
|
151
|
-
|
|
152
|
-
@property
|
|
153
|
-
def team_id(self):
|
|
154
|
-
"""Gets the team_id of this Member. # noqa: E501
|
|
155
|
-
|
|
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())
|
|
156
54
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
"""
|
|
160
|
-
return
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Self:
|
|
57
|
+
"""Create an instance of Member from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
161
59
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
"""Sets the team_id of this Member.
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
165
62
|
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
166
65
|
|
|
167
|
-
|
|
168
|
-
|
|
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.
|
|
169
69
|
"""
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
:param user_id: The user_id of this Member. # noqa: E501
|
|
197
|
-
:type user_id: int
|
|
198
|
-
"""
|
|
199
|
-
if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501
|
|
200
|
-
raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501
|
|
201
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
202
|
-
user_id is not None and user_id > 2147483647): # noqa: E501
|
|
203
|
-
raise ValueError("Invalid value for `user_id`, must be a value less than or equal to `2147483647`") # noqa: E501
|
|
204
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
205
|
-
user_id is not None and user_id < 1): # noqa: E501
|
|
206
|
-
raise ValueError("Invalid value for `user_id`, must be a value greater than or equal to `1`") # noqa: E501
|
|
207
|
-
|
|
208
|
-
self._user_id = user_id
|
|
209
|
-
|
|
210
|
-
def to_dict(self, serialize=False):
|
|
211
|
-
"""Returns the model properties as a dict"""
|
|
212
|
-
result = {}
|
|
213
|
-
|
|
214
|
-
def convert(x):
|
|
215
|
-
if hasattr(x, "to_dict"):
|
|
216
|
-
args = getfullargspec(x.to_dict).args
|
|
217
|
-
if len(args) == 1:
|
|
218
|
-
return x.to_dict()
|
|
219
|
-
else:
|
|
220
|
-
return x.to_dict(serialize)
|
|
221
|
-
else:
|
|
222
|
-
return x
|
|
223
|
-
|
|
224
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
|
225
|
-
value = getattr(self, attr)
|
|
226
|
-
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
|
227
|
-
if isinstance(value, list):
|
|
228
|
-
result[attr] = list(map(
|
|
229
|
-
lambda x: convert(x),
|
|
230
|
-
value
|
|
231
|
-
))
|
|
232
|
-
elif isinstance(value, dict):
|
|
233
|
-
result[attr] = dict(map(
|
|
234
|
-
lambda item: (item[0], convert(item[1])),
|
|
235
|
-
value.items()
|
|
236
|
-
))
|
|
237
|
-
else:
|
|
238
|
-
result[attr] = convert(value)
|
|
239
|
-
|
|
240
|
-
return result
|
|
241
|
-
|
|
242
|
-
def to_str(self):
|
|
243
|
-
"""Returns the string representation of the model"""
|
|
244
|
-
return pprint.pformat(self.to_dict())
|
|
245
|
-
|
|
246
|
-
def __repr__(self):
|
|
247
|
-
"""For `print` and `pprint`"""
|
|
248
|
-
return self.to_str()
|
|
249
|
-
|
|
250
|
-
def __eq__(self, other):
|
|
251
|
-
"""Returns true if both objects are equal"""
|
|
252
|
-
if not isinstance(other, Member):
|
|
253
|
-
return False
|
|
254
|
-
|
|
255
|
-
return self.to_dict() == other.to_dict()
|
|
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 Member 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
|
+
"id": obj.get("id"),
|
|
89
|
+
"team_id": obj.get("team_id"),
|
|
90
|
+
"user_id": obj.get("user_id"),
|
|
91
|
+
"role": obj.get("role"),
|
|
92
|
+
"is_active": obj.get("is_active")
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
256
95
|
|
|
257
|
-
def __ne__(self, other):
|
|
258
|
-
"""Returns true if both objects are not equal"""
|
|
259
|
-
if not isinstance(other, Member):
|
|
260
|
-
return True
|
|
261
96
|
|
|
262
|
-
return self.to_dict() != other.to_dict()
|