qi-compute-api-client 0.53.0__py3-none-any.whl → 0.54.1__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 +194 -95
- compute_api_client/api/algorithms_api.py +75 -81
- compute_api_client/api/auth_config_api.py +16 -24
- compute_api_client/api/backend_api.py +70 -86
- compute_api_client/api/backend_types_api.py +43 -56
- compute_api_client/api/batch_jobs_api.py +102 -120
- compute_api_client/api/commits_api.py +85 -80
- compute_api_client/api/files_api.py +62 -67
- compute_api_client/api/final_results_api.py +42 -53
- compute_api_client/api/health_api.py +16 -25
- compute_api_client/api/jobs_api.py +76 -83
- compute_api_client/api/languages_api.py +30 -42
- compute_api_client/api/members_api.py +62 -67
- compute_api_client/api/permissions_api.py +56 -70
- compute_api_client/api/projects_api.py +89 -97
- compute_api_client/api/reservations_api.py +57 -72
- compute_api_client/api/results_api.py +76 -83
- compute_api_client/api/teams_api.py +30 -42
- compute_api_client/api/transactions_api.py +31 -44
- compute_api_client/api/users_api.py +62 -67
- compute_api_client/api_client.py +135 -75
- compute_api_client/api_response.py +3 -3
- compute_api_client/configuration.py +176 -36
- compute_api_client/docs/Algorithm.md +8 -7
- compute_api_client/docs/AlgorithmIn.md +7 -6
- compute_api_client/docs/AlgorithmType.md +5 -3
- compute_api_client/docs/AlgorithmsApi.md +15 -10
- compute_api_client/docs/AuthConfig.md +3 -2
- compute_api_client/docs/AuthConfigApi.md +3 -2
- compute_api_client/docs/Backend.md +9 -8
- compute_api_client/docs/BackendApi.md +15 -10
- compute_api_client/docs/BackendIn.md +8 -7
- compute_api_client/docs/BackendPatch.md +5 -4
- compute_api_client/docs/BackendStatus.md +9 -3
- compute_api_client/docs/BackendType.md +20 -19
- compute_api_client/docs/BackendTypePatch.md +3 -2
- compute_api_client/docs/BackendTypesApi.md +15 -8
- compute_api_client/docs/BackendWithAuthentication.md +10 -9
- compute_api_client/docs/BatchJob.md +10 -9
- compute_api_client/docs/BatchJobIn.md +4 -3
- compute_api_client/docs/BatchJobStatus.md +11 -3
- compute_api_client/docs/BatchJobsApi.md +23 -16
- compute_api_client/docs/Commit.md +8 -7
- compute_api_client/docs/CommitIn.md +5 -4
- compute_api_client/docs/CommitsApi.md +15 -10
- compute_api_client/docs/CompilePayload.md +4 -3
- compute_api_client/docs/CompileStage.md +11 -3
- compute_api_client/docs/Domain.md +7 -3
- compute_api_client/docs/File.md +10 -9
- compute_api_client/docs/FileIn.md +9 -8
- compute_api_client/docs/FilesApi.md +12 -8
- compute_api_client/docs/FinalResult.md +7 -6
- compute_api_client/docs/FinalResultIn.md +5 -4
- compute_api_client/docs/FinalResultsApi.md +9 -6
- compute_api_client/docs/HTTPBadRequestError.md +3 -2
- compute_api_client/docs/HTTPNotFoundError.md +3 -2
- compute_api_client/docs/HTTPValidationError.md +3 -2
- compute_api_client/docs/HealthApi.md +3 -2
- compute_api_client/docs/Job.md +13 -12
- compute_api_client/docs/JobIn.md +6 -5
- compute_api_client/docs/JobPatch.md +8 -7
- compute_api_client/docs/JobStatus.md +11 -3
- compute_api_client/docs/JobsApi.md +15 -10
- compute_api_client/docs/Language.md +6 -5
- compute_api_client/docs/LanguagesApi.md +6 -4
- compute_api_client/docs/Member.md +8 -7
- compute_api_client/docs/MemberId.md +28 -0
- compute_api_client/docs/MemberIn.md +7 -6
- compute_api_client/docs/MembersApi.md +12 -8
- compute_api_client/docs/PageAlgorithm.md +3 -2
- compute_api_client/docs/PageBackend.md +3 -2
- compute_api_client/docs/PageBackendType.md +3 -2
- compute_api_client/docs/PageBatchJob.md +3 -2
- compute_api_client/docs/PageCommit.md +3 -2
- compute_api_client/docs/PageFile.md +3 -2
- compute_api_client/docs/PageJob.md +3 -2
- compute_api_client/docs/PageLanguage.md +3 -2
- compute_api_client/docs/PageMember.md +3 -2
- compute_api_client/docs/PagePermission.md +3 -2
- compute_api_client/docs/PagePermissionGroup.md +3 -2
- compute_api_client/docs/PageProject.md +3 -2
- compute_api_client/docs/PageReservation.md +3 -2
- compute_api_client/docs/PageResult.md +3 -2
- compute_api_client/docs/PageTeam.md +3 -2
- compute_api_client/docs/PageTransaction.md +3 -2
- compute_api_client/docs/PageUser.md +3 -2
- compute_api_client/docs/Permission.md +6 -5
- compute_api_client/docs/PermissionGroup.md +5 -4
- compute_api_client/docs/PermissionsApi.md +12 -8
- compute_api_client/docs/Project.md +9 -8
- compute_api_client/docs/ProjectIn.md +7 -6
- compute_api_client/docs/ProjectPatch.md +3 -2
- compute_api_client/docs/ProjectsApi.md +23 -13
- compute_api_client/docs/Reservation.md +9 -8
- compute_api_client/docs/ReservationIn.md +7 -6
- compute_api_client/docs/ReservationsApi.md +12 -8
- compute_api_client/docs/Result.md +7 -6
- compute_api_client/docs/ResultIn.md +5 -4
- compute_api_client/docs/ResultsApi.md +15 -10
- compute_api_client/docs/Role.md +5 -3
- compute_api_client/docs/ShareType.md +7 -3
- compute_api_client/docs/Team.md +7 -6
- compute_api_client/docs/TeamsApi.md +6 -4
- compute_api_client/docs/Transaction.md +6 -5
- compute_api_client/docs/TransactionDomain.md +28 -0
- compute_api_client/docs/TransactionsApi.md +6 -4
- compute_api_client/docs/User.md +11 -10
- compute_api_client/docs/UserIn.md +10 -9
- compute_api_client/docs/UsersApi.md +12 -8
- compute_api_client/docs/ValidationError.md +4 -3
- compute_api_client/docs/ValidationErrorLocInner.md +28 -0
- compute_api_client/exceptions.py +74 -24
- compute_api_client/models/__init__.py +1 -1
- compute_api_client/models/algorithm.py +19 -20
- compute_api_client/models/algorithm_in.py +18 -19
- compute_api_client/models/algorithm_type.py +1 -9
- compute_api_client/models/auth_config.py +14 -14
- compute_api_client/models/backend.py +20 -20
- compute_api_client/models/backend_in.py +19 -19
- compute_api_client/models/backend_patch.py +16 -15
- compute_api_client/models/backend_status.py +1 -9
- compute_api_client/models/backend_type.py +31 -32
- compute_api_client/models/backend_type_patch.py +14 -15
- compute_api_client/models/backend_with_authentication.py +21 -21
- compute_api_client/models/batch_job.py +21 -20
- compute_api_client/models/batch_job_in.py +15 -15
- compute_api_client/models/batch_job_status.py +1 -9
- compute_api_client/models/commit.py +19 -19
- compute_api_client/models/commit_in.py +16 -16
- compute_api_client/models/compile_payload.py +15 -15
- compute_api_client/models/compile_stage.py +1 -9
- compute_api_client/models/domain.py +1 -9
- compute_api_client/models/file.py +21 -22
- compute_api_client/models/file_in.py +20 -21
- compute_api_client/models/final_result.py +18 -17
- compute_api_client/models/final_result_in.py +16 -16
- compute_api_client/models/http_bad_request_error.py +14 -14
- compute_api_client/models/http_not_found_error.py +14 -14
- compute_api_client/models/http_validation_error.py +18 -18
- compute_api_client/models/job.py +24 -24
- compute_api_client/models/job_in.py +17 -17
- compute_api_client/models/job_patch.py +19 -20
- compute_api_client/models/job_status.py +1 -9
- compute_api_client/models/language.py +17 -18
- compute_api_client/models/member.py +19 -19
- compute_api_client/models/member_id.py +144 -0
- compute_api_client/models/member_in.py +18 -18
- compute_api_client/models/page_algorithm.py +18 -19
- compute_api_client/models/page_backend.py +18 -19
- compute_api_client/models/page_backend_type.py +18 -19
- compute_api_client/models/page_batch_job.py +18 -19
- compute_api_client/models/page_commit.py +18 -19
- compute_api_client/models/page_file.py +18 -19
- compute_api_client/models/page_job.py +18 -19
- compute_api_client/models/page_language.py +18 -19
- compute_api_client/models/page_member.py +18 -19
- compute_api_client/models/page_permission.py +18 -19
- compute_api_client/models/page_permission_group.py +18 -19
- compute_api_client/models/page_project.py +18 -19
- compute_api_client/models/page_reservation.py +18 -19
- compute_api_client/models/page_result.py +18 -19
- compute_api_client/models/page_team.py +18 -19
- compute_api_client/models/page_transaction.py +18 -19
- compute_api_client/models/page_user.py +18 -19
- compute_api_client/models/permission.py +17 -18
- compute_api_client/models/permission_group.py +16 -17
- compute_api_client/models/project.py +20 -20
- compute_api_client/models/project_in.py +18 -19
- compute_api_client/models/project_patch.py +14 -15
- compute_api_client/models/reservation.py +20 -19
- compute_api_client/models/reservation_in.py +18 -17
- compute_api_client/models/result.py +18 -17
- compute_api_client/models/result_in.py +16 -16
- compute_api_client/models/role.py +1 -9
- compute_api_client/models/share_type.py +1 -9
- compute_api_client/models/team.py +18 -19
- compute_api_client/models/transaction.py +17 -17
- compute_api_client/models/transaction_domain.py +142 -0
- compute_api_client/models/user.py +22 -23
- compute_api_client/models/user_in.py +21 -22
- compute_api_client/models/validation_error.py +20 -20
- compute_api_client/models/validation_error_loc_inner.py +138 -0
- compute_api_client/rest.py +51 -26
- {qi_compute_api_client-0.53.0.dist-info → qi_compute_api_client-0.54.1.dist-info}/METADATA +12 -9
- qi_compute_api_client-0.54.1.dist-info/RECORD +203 -0
- qi_compute_api_client-0.53.0.dist-info/RECORD +0 -197
- {qi_compute_api_client-0.53.0.dist-info → qi_compute_api_client-0.54.1.dist-info}/WHEEL +0 -0
- {qi_compute_api_client-0.53.0.dist-info → qi_compute_api_client-0.54.1.dist-info}/licenses/LICENSE.md +0 -0
|
@@ -18,33 +18,31 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
|
21
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from pydantic import BaseModel, StrictInt
|
|
23
|
-
from pydantic import Field
|
|
24
23
|
from typing_extensions import Annotated
|
|
25
24
|
from compute_api_client.models.domain import Domain
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
except ImportError:
|
|
29
|
-
from typing_extensions import Self
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
30
27
|
|
|
31
28
|
class Transaction(BaseModel):
|
|
32
29
|
"""
|
|
33
30
|
Transaction
|
|
34
31
|
""" # noqa: E501
|
|
35
|
-
id: StrictInt
|
|
32
|
+
id: StrictInt = Field(description="The id of the transaction")
|
|
36
33
|
domain: Optional[Domain]
|
|
37
34
|
job: Optional[StrictInt]
|
|
38
|
-
team_id: StrictInt
|
|
35
|
+
team_id: StrictInt = Field(description="The id of the team who initiated the transaction")
|
|
39
36
|
member_id: Optional[StrictInt]
|
|
40
37
|
change: Annotated[int, Field(strict=True, ge=-32768)]
|
|
41
|
-
timestamp: datetime
|
|
38
|
+
timestamp: datetime = Field(description="Time when the transaction was started")
|
|
42
39
|
__properties: ClassVar[List[str]] = ["id", "domain", "job", "team_id", "member_id", "change", "timestamp"]
|
|
43
40
|
|
|
44
|
-
model_config =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
48
46
|
|
|
49
47
|
|
|
50
48
|
def to_str(self) -> str:
|
|
@@ -57,7 +55,7 @@ class Transaction(BaseModel):
|
|
|
57
55
|
return json.dumps(self.to_dict())
|
|
58
56
|
|
|
59
57
|
@classmethod
|
|
60
|
-
def from_json(cls, json_str: str) -> Self:
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
59
|
"""Create an instance of Transaction from a JSON string"""
|
|
62
60
|
return cls.from_dict(json.loads(json_str))
|
|
63
61
|
|
|
@@ -71,10 +69,12 @@ class Transaction(BaseModel):
|
|
|
71
69
|
were set at model initialization. Other fields with value `None`
|
|
72
70
|
are ignored.
|
|
73
71
|
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
74
75
|
_dict = self.model_dump(
|
|
75
76
|
by_alias=True,
|
|
76
|
-
exclude=
|
|
77
|
-
},
|
|
77
|
+
exclude=excluded_fields,
|
|
78
78
|
exclude_none=True,
|
|
79
79
|
)
|
|
80
80
|
# set to None if domain (nullable) is None
|
|
@@ -95,7 +95,7 @@ class Transaction(BaseModel):
|
|
|
95
95
|
return _dict
|
|
96
96
|
|
|
97
97
|
@classmethod
|
|
98
|
-
def from_dict(cls, obj: Dict) -> Self:
|
|
98
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
99
99
|
"""Create an instance of Transaction from a dict"""
|
|
100
100
|
if obj is None:
|
|
101
101
|
return None
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Quantum Inspire 2
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
from inspect import getfullargspec
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
|
|
21
|
+
from typing import Any, Optional
|
|
22
|
+
from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator
|
|
23
|
+
from compute_api_client.models.domain import Domain
|
|
24
|
+
from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict
|
|
25
|
+
from typing_extensions import Literal
|
|
26
|
+
from pydantic import StrictStr, Field
|
|
27
|
+
try:
|
|
28
|
+
from typing import Self
|
|
29
|
+
except ImportError:
|
|
30
|
+
from typing_extensions import Self
|
|
31
|
+
|
|
32
|
+
TRANSACTIONDOMAIN_ANY_OF_SCHEMAS = ["Domain", "object"]
|
|
33
|
+
|
|
34
|
+
class TransactionDomain(BaseModel):
|
|
35
|
+
"""
|
|
36
|
+
The domain type of the transaction
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
# data type: Domain
|
|
40
|
+
anyof_schema_1_validator: Optional[Domain] = None
|
|
41
|
+
# data type: object
|
|
42
|
+
anyof_schema_2_validator: Optional[Any] = None
|
|
43
|
+
if TYPE_CHECKING:
|
|
44
|
+
actual_instance: Optional[Union[Domain, object]] = None
|
|
45
|
+
else:
|
|
46
|
+
actual_instance: Any = None
|
|
47
|
+
any_of_schemas: List[str] = Literal[TRANSACTIONDOMAIN_ANY_OF_SCHEMAS]
|
|
48
|
+
|
|
49
|
+
model_config = {
|
|
50
|
+
"validate_assignment": True
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
54
|
+
if args:
|
|
55
|
+
if len(args) > 1:
|
|
56
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
57
|
+
if kwargs:
|
|
58
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
59
|
+
super().__init__(actual_instance=args[0])
|
|
60
|
+
else:
|
|
61
|
+
super().__init__(**kwargs)
|
|
62
|
+
|
|
63
|
+
@field_validator('actual_instance')
|
|
64
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
65
|
+
instance = TransactionDomain.model_construct()
|
|
66
|
+
error_messages = []
|
|
67
|
+
# validate data type: Domain
|
|
68
|
+
if not isinstance(v, Domain):
|
|
69
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `Domain`")
|
|
70
|
+
else:
|
|
71
|
+
return v
|
|
72
|
+
|
|
73
|
+
# validate data type: object
|
|
74
|
+
try:
|
|
75
|
+
instance.anyof_schema_2_validator = v
|
|
76
|
+
return v
|
|
77
|
+
except (ValidationError, ValueError) as e:
|
|
78
|
+
error_messages.append(str(e))
|
|
79
|
+
if error_messages:
|
|
80
|
+
# no match
|
|
81
|
+
raise ValueError("No match found when setting the actual_instance in TransactionDomain with anyOf schemas: Domain, object. Details: " + ", ".join(error_messages))
|
|
82
|
+
else:
|
|
83
|
+
return v
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def from_dict(cls, obj: dict) -> Self:
|
|
87
|
+
return cls.from_json(json.dumps(obj))
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_json(cls, json_str: str) -> Self:
|
|
91
|
+
"""Returns the object represented by the json string"""
|
|
92
|
+
instance = cls.model_construct()
|
|
93
|
+
error_messages = []
|
|
94
|
+
# anyof_schema_1_validator: Optional[Domain] = None
|
|
95
|
+
try:
|
|
96
|
+
instance.actual_instance = Domain.from_json(json_str)
|
|
97
|
+
return instance
|
|
98
|
+
except (ValidationError, ValueError) as e:
|
|
99
|
+
error_messages.append(str(e))
|
|
100
|
+
# deserialize data into object
|
|
101
|
+
try:
|
|
102
|
+
# validation
|
|
103
|
+
instance.anyof_schema_2_validator = json.loads(json_str)
|
|
104
|
+
# assign value to actual_instance
|
|
105
|
+
instance.actual_instance = instance.anyof_schema_2_validator
|
|
106
|
+
return instance
|
|
107
|
+
except (ValidationError, ValueError) as e:
|
|
108
|
+
error_messages.append(str(e))
|
|
109
|
+
|
|
110
|
+
if error_messages:
|
|
111
|
+
# no match
|
|
112
|
+
raise ValueError("No match found when deserializing the JSON string into TransactionDomain with anyOf schemas: Domain, object. Details: " + ", ".join(error_messages))
|
|
113
|
+
else:
|
|
114
|
+
return instance
|
|
115
|
+
|
|
116
|
+
def to_json(self) -> str:
|
|
117
|
+
"""Returns the JSON representation of the actual instance"""
|
|
118
|
+
if self.actual_instance is None:
|
|
119
|
+
return "null"
|
|
120
|
+
|
|
121
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
122
|
+
if callable(to_json):
|
|
123
|
+
return self.actual_instance.to_json()
|
|
124
|
+
else:
|
|
125
|
+
return json.dumps(self.actual_instance)
|
|
126
|
+
|
|
127
|
+
def to_dict(self) -> Dict:
|
|
128
|
+
"""Returns the dict representation of the actual instance"""
|
|
129
|
+
if self.actual_instance is None:
|
|
130
|
+
return "null"
|
|
131
|
+
|
|
132
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
133
|
+
if callable(to_json):
|
|
134
|
+
return self.actual_instance.to_dict()
|
|
135
|
+
else:
|
|
136
|
+
return json.dumps(self.actual_instance)
|
|
137
|
+
|
|
138
|
+
def to_str(self) -> str:
|
|
139
|
+
"""Returns the string representation of the actual instance"""
|
|
140
|
+
return pprint.pformat(self.model_dump())
|
|
141
|
+
|
|
142
|
+
|
|
@@ -17,34 +17,31 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from pydantic import BaseModel, StrictBool, StrictInt
|
|
23
|
-
from pydantic import Field
|
|
24
22
|
from typing_extensions import Annotated
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
except ImportError:
|
|
28
|
-
from typing_extensions import Self
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
29
25
|
|
|
30
26
|
class User(BaseModel):
|
|
31
27
|
"""
|
|
32
28
|
User
|
|
33
29
|
""" # noqa: E501
|
|
34
|
-
id: StrictInt
|
|
35
|
-
full_name: Annotated[str, Field(strict=True, max_length=64)]
|
|
36
|
-
email: Annotated[str, Field(strict=True, max_length=256)]
|
|
37
|
-
is_superuser: StrictBool
|
|
38
|
-
is_staff: StrictBool
|
|
39
|
-
is_active: StrictBool
|
|
40
|
-
is_confirmed: StrictBool
|
|
41
|
-
oidc_sub: Annotated[str, Field(strict=True, max_length=256)]
|
|
30
|
+
id: StrictInt = Field(description="The id of the user")
|
|
31
|
+
full_name: Annotated[str, Field(strict=True, max_length=64)] = Field(description="The full name of the user")
|
|
32
|
+
email: Annotated[str, Field(strict=True, max_length=256)] = Field(description="The email id of the user")
|
|
33
|
+
is_superuser: StrictBool = Field(description="If the user is superuser")
|
|
34
|
+
is_staff: StrictBool = Field(description="If the user is staff")
|
|
35
|
+
is_active: StrictBool = Field(description="If the user is active")
|
|
36
|
+
is_confirmed: StrictBool = Field(description="If the user is confirmed")
|
|
37
|
+
oidc_sub: Annotated[str, Field(strict=True, max_length=256)] = Field(description="User identifier from OIDC provider")
|
|
42
38
|
__properties: ClassVar[List[str]] = ["id", "full_name", "email", "is_superuser", "is_staff", "is_active", "is_confirmed", "oidc_sub"]
|
|
43
39
|
|
|
44
|
-
model_config =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
48
45
|
|
|
49
46
|
|
|
50
47
|
def to_str(self) -> str:
|
|
@@ -57,7 +54,7 @@ class User(BaseModel):
|
|
|
57
54
|
return json.dumps(self.to_dict())
|
|
58
55
|
|
|
59
56
|
@classmethod
|
|
60
|
-
def from_json(cls, json_str: str) -> Self:
|
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
58
|
"""Create an instance of User from a JSON string"""
|
|
62
59
|
return cls.from_dict(json.loads(json_str))
|
|
63
60
|
|
|
@@ -71,16 +68,18 @@ class User(BaseModel):
|
|
|
71
68
|
were set at model initialization. Other fields with value `None`
|
|
72
69
|
are ignored.
|
|
73
70
|
"""
|
|
71
|
+
excluded_fields: Set[str] = set([
|
|
72
|
+
])
|
|
73
|
+
|
|
74
74
|
_dict = self.model_dump(
|
|
75
75
|
by_alias=True,
|
|
76
|
-
exclude=
|
|
77
|
-
},
|
|
76
|
+
exclude=excluded_fields,
|
|
78
77
|
exclude_none=True,
|
|
79
78
|
)
|
|
80
79
|
return _dict
|
|
81
80
|
|
|
82
81
|
@classmethod
|
|
83
|
-
def from_dict(cls, obj: Dict) -> Self:
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
83
|
"""Create an instance of User from a dict"""
|
|
85
84
|
if obj is None:
|
|
86
85
|
return None
|
|
@@ -17,33 +17,30 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from pydantic import BaseModel, StrictBool
|
|
23
|
-
from pydantic import Field
|
|
24
22
|
from typing_extensions import Annotated
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
except ImportError:
|
|
28
|
-
from typing_extensions import Self
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
29
25
|
|
|
30
26
|
class UserIn(BaseModel):
|
|
31
27
|
"""
|
|
32
28
|
UserIn
|
|
33
29
|
""" # noqa: E501
|
|
34
|
-
full_name: Annotated[str, Field(strict=True, max_length=64)]
|
|
35
|
-
email: Annotated[str, Field(strict=True, max_length=256)]
|
|
36
|
-
is_superuser: Optional[StrictBool] = False
|
|
37
|
-
is_staff: Optional[StrictBool] = False
|
|
38
|
-
is_active: Optional[StrictBool] = False
|
|
39
|
-
is_confirmed: Optional[StrictBool] = False
|
|
40
|
-
oidc_sub: Annotated[str, Field(strict=True, max_length=256)]
|
|
30
|
+
full_name: Annotated[str, Field(strict=True, max_length=64)] = Field(description="The full name of the user")
|
|
31
|
+
email: Annotated[str, Field(strict=True, max_length=256)] = Field(description="The email id of the user")
|
|
32
|
+
is_superuser: Optional[StrictBool] = Field(default=False, description="If the user is superuser")
|
|
33
|
+
is_staff: Optional[StrictBool] = Field(default=False, description="If the user is staff")
|
|
34
|
+
is_active: Optional[StrictBool] = Field(default=False, description="If the user is active")
|
|
35
|
+
is_confirmed: Optional[StrictBool] = Field(default=False, description="If the user is confirmed")
|
|
36
|
+
oidc_sub: Annotated[str, Field(strict=True, max_length=256)] = Field(description="User identifier from OIDC provider")
|
|
41
37
|
__properties: ClassVar[List[str]] = ["full_name", "email", "is_superuser", "is_staff", "is_active", "is_confirmed", "oidc_sub"]
|
|
42
38
|
|
|
43
|
-
model_config =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
model_config = ConfigDict(
|
|
40
|
+
populate_by_name=True,
|
|
41
|
+
validate_assignment=True,
|
|
42
|
+
protected_namespaces=(),
|
|
43
|
+
)
|
|
47
44
|
|
|
48
45
|
|
|
49
46
|
def to_str(self) -> str:
|
|
@@ -56,7 +53,7 @@ class UserIn(BaseModel):
|
|
|
56
53
|
return json.dumps(self.to_dict())
|
|
57
54
|
|
|
58
55
|
@classmethod
|
|
59
|
-
def from_json(cls, json_str: str) -> Self:
|
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
57
|
"""Create an instance of UserIn from a JSON string"""
|
|
61
58
|
return cls.from_dict(json.loads(json_str))
|
|
62
59
|
|
|
@@ -70,16 +67,18 @@ class UserIn(BaseModel):
|
|
|
70
67
|
were set at model initialization. Other fields with value `None`
|
|
71
68
|
are ignored.
|
|
72
69
|
"""
|
|
70
|
+
excluded_fields: Set[str] = set([
|
|
71
|
+
])
|
|
72
|
+
|
|
73
73
|
_dict = self.model_dump(
|
|
74
74
|
by_alias=True,
|
|
75
|
-
exclude=
|
|
76
|
-
},
|
|
75
|
+
exclude=excluded_fields,
|
|
77
76
|
exclude_none=True,
|
|
78
77
|
)
|
|
79
78
|
return _dict
|
|
80
79
|
|
|
81
80
|
@classmethod
|
|
82
|
-
def from_dict(cls, obj: Dict) -> Self:
|
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
82
|
"""Create an instance of UserIn from a dict"""
|
|
84
83
|
if obj is None:
|
|
85
84
|
return None
|
|
@@ -17,28 +17,26 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
|
|
25
|
-
from typing import Self
|
|
26
|
-
except ImportError:
|
|
27
|
-
from typing_extensions import Self
|
|
22
|
+
from compute_api_client.models.validation_error_loc_inner import ValidationErrorLocInner
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
28
25
|
|
|
29
26
|
class ValidationError(BaseModel):
|
|
30
27
|
"""
|
|
31
28
|
ValidationError
|
|
32
29
|
""" # noqa: E501
|
|
33
|
-
loc: List[
|
|
30
|
+
loc: List[ValidationErrorLocInner]
|
|
34
31
|
msg: StrictStr
|
|
35
32
|
type: StrictStr
|
|
36
33
|
__properties: ClassVar[List[str]] = ["loc", "msg", "type"]
|
|
37
34
|
|
|
38
|
-
model_config =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
42
40
|
|
|
43
41
|
|
|
44
42
|
def to_str(self) -> str:
|
|
@@ -51,7 +49,7 @@ class ValidationError(BaseModel):
|
|
|
51
49
|
return json.dumps(self.to_dict())
|
|
52
50
|
|
|
53
51
|
@classmethod
|
|
54
|
-
def from_json(cls, json_str: str) -> Self:
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
53
|
"""Create an instance of ValidationError from a JSON string"""
|
|
56
54
|
return cls.from_dict(json.loads(json_str))
|
|
57
55
|
|
|
@@ -65,23 +63,25 @@ class ValidationError(BaseModel):
|
|
|
65
63
|
were set at model initialization. Other fields with value `None`
|
|
66
64
|
are ignored.
|
|
67
65
|
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
68
69
|
_dict = self.model_dump(
|
|
69
70
|
by_alias=True,
|
|
70
|
-
exclude=
|
|
71
|
-
},
|
|
71
|
+
exclude=excluded_fields,
|
|
72
72
|
exclude_none=True,
|
|
73
73
|
)
|
|
74
74
|
# override the default output from pydantic by calling `to_dict()` of each item in loc (list)
|
|
75
75
|
_items = []
|
|
76
76
|
if self.loc:
|
|
77
|
-
for
|
|
78
|
-
if
|
|
79
|
-
_items.append(
|
|
77
|
+
for _item_loc in self.loc:
|
|
78
|
+
if _item_loc:
|
|
79
|
+
_items.append(_item_loc.to_dict())
|
|
80
80
|
_dict['loc'] = _items
|
|
81
81
|
return _dict
|
|
82
82
|
|
|
83
83
|
@classmethod
|
|
84
|
-
def from_dict(cls, obj: Dict) -> Self:
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
85
|
"""Create an instance of ValidationError from a dict"""
|
|
86
86
|
if obj is None:
|
|
87
87
|
return None
|
|
@@ -90,7 +90,7 @@ class ValidationError(BaseModel):
|
|
|
90
90
|
return cls.model_validate(obj)
|
|
91
91
|
|
|
92
92
|
_obj = cls.model_validate({
|
|
93
|
-
"loc": [
|
|
93
|
+
"loc": [ValidationErrorLocInner.from_dict(_item) for _item in obj["loc"]] if obj.get("loc") is not None else None,
|
|
94
94
|
"msg": obj.get("msg"),
|
|
95
95
|
"type": obj.get("type")
|
|
96
96
|
})
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Quantum Inspire 2
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
from inspect import getfullargspec
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, ValidationError, field_validator
|
|
21
|
+
from typing import Optional
|
|
22
|
+
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
23
|
+
from typing_extensions import Literal, Self
|
|
24
|
+
from pydantic import Field
|
|
25
|
+
|
|
26
|
+
VALIDATIONERRORLOCINNER_ANY_OF_SCHEMAS = ["int", "str"]
|
|
27
|
+
|
|
28
|
+
class ValidationErrorLocInner(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
ValidationErrorLocInner
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
# data type: str
|
|
34
|
+
anyof_schema_1_validator: Optional[StrictStr] = None
|
|
35
|
+
# data type: int
|
|
36
|
+
anyof_schema_2_validator: Optional[StrictInt] = None
|
|
37
|
+
if TYPE_CHECKING:
|
|
38
|
+
actual_instance: Optional[Union[int, str]] = None
|
|
39
|
+
else:
|
|
40
|
+
actual_instance: Any = None
|
|
41
|
+
any_of_schemas: Set[str] = { "int", "str" }
|
|
42
|
+
|
|
43
|
+
model_config = {
|
|
44
|
+
"validate_assignment": True,
|
|
45
|
+
"protected_namespaces": (),
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
49
|
+
if args:
|
|
50
|
+
if len(args) > 1:
|
|
51
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
52
|
+
if kwargs:
|
|
53
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
54
|
+
super().__init__(actual_instance=args[0])
|
|
55
|
+
else:
|
|
56
|
+
super().__init__(**kwargs)
|
|
57
|
+
|
|
58
|
+
@field_validator('actual_instance')
|
|
59
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
60
|
+
instance = ValidationErrorLocInner.model_construct()
|
|
61
|
+
error_messages = []
|
|
62
|
+
# validate data type: str
|
|
63
|
+
try:
|
|
64
|
+
instance.anyof_schema_1_validator = v
|
|
65
|
+
return v
|
|
66
|
+
except (ValidationError, ValueError) as e:
|
|
67
|
+
error_messages.append(str(e))
|
|
68
|
+
# validate data type: int
|
|
69
|
+
try:
|
|
70
|
+
instance.anyof_schema_2_validator = v
|
|
71
|
+
return v
|
|
72
|
+
except (ValidationError, ValueError) as e:
|
|
73
|
+
error_messages.append(str(e))
|
|
74
|
+
if error_messages:
|
|
75
|
+
# no match
|
|
76
|
+
raise ValueError("No match found when setting the actual_instance in ValidationErrorLocInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages))
|
|
77
|
+
else:
|
|
78
|
+
return v
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls, obj: Dict[str, Any]) -> Self:
|
|
82
|
+
return cls.from_json(json.dumps(obj))
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_json(cls, json_str: str) -> Self:
|
|
86
|
+
"""Returns the object represented by the json string"""
|
|
87
|
+
instance = cls.model_construct()
|
|
88
|
+
error_messages = []
|
|
89
|
+
# deserialize data into str
|
|
90
|
+
try:
|
|
91
|
+
# validation
|
|
92
|
+
instance.anyof_schema_1_validator = json.loads(json_str)
|
|
93
|
+
# assign value to actual_instance
|
|
94
|
+
instance.actual_instance = instance.anyof_schema_1_validator
|
|
95
|
+
return instance
|
|
96
|
+
except (ValidationError, ValueError) as e:
|
|
97
|
+
error_messages.append(str(e))
|
|
98
|
+
# deserialize data into int
|
|
99
|
+
try:
|
|
100
|
+
# validation
|
|
101
|
+
instance.anyof_schema_2_validator = json.loads(json_str)
|
|
102
|
+
# assign value to actual_instance
|
|
103
|
+
instance.actual_instance = instance.anyof_schema_2_validator
|
|
104
|
+
return instance
|
|
105
|
+
except (ValidationError, ValueError) as e:
|
|
106
|
+
error_messages.append(str(e))
|
|
107
|
+
|
|
108
|
+
if error_messages:
|
|
109
|
+
# no match
|
|
110
|
+
raise ValueError("No match found when deserializing the JSON string into ValidationErrorLocInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages))
|
|
111
|
+
else:
|
|
112
|
+
return instance
|
|
113
|
+
|
|
114
|
+
def to_json(self) -> str:
|
|
115
|
+
"""Returns the JSON representation of the actual instance"""
|
|
116
|
+
if self.actual_instance is None:
|
|
117
|
+
return "null"
|
|
118
|
+
|
|
119
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
120
|
+
return self.actual_instance.to_json()
|
|
121
|
+
else:
|
|
122
|
+
return json.dumps(self.actual_instance)
|
|
123
|
+
|
|
124
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], int, str]]:
|
|
125
|
+
"""Returns the dict representation of the actual instance"""
|
|
126
|
+
if self.actual_instance is None:
|
|
127
|
+
return None
|
|
128
|
+
|
|
129
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
130
|
+
return self.actual_instance.to_dict()
|
|
131
|
+
else:
|
|
132
|
+
return self.actual_instance
|
|
133
|
+
|
|
134
|
+
def to_str(self) -> str:
|
|
135
|
+
"""Returns the string representation of the actual instance"""
|
|
136
|
+
return pprint.pformat(self.model_dump())
|
|
137
|
+
|
|
138
|
+
|