qi-compute-api-client 0.52.0__py3-none-any.whl → 0.54.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 +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 +77 -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 +21 -19
- compute_api_client/docs/BackendTypePatch.md +4 -2
- compute_api_client/docs/BackendTypesApi.md +21 -10
- 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/Job1.md +28 -0
- 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 +42 -36
- compute_api_client/models/backend_type_patch.py +23 -17
- 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/job1.py +144 -0
- 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.52.0.dist-info → qi_compute_api_client-0.54.0.dist-info}/METADATA +12 -9
- qi_compute_api_client-0.54.0.dist-info/RECORD +205 -0
- qi_compute_api_client-0.52.0.dist-info/RECORD +0 -197
- {qi_compute_api_client-0.52.0.dist-info → qi_compute_api_client-0.54.0.dist-info}/WHEEL +0 -0
- {qi_compute_api_client-0.52.0.dist-info → qi_compute_api_client-0.54.0.dist-info}/licenses/LICENSE.md +0 -0
|
@@ -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
|
+
|
compute_api_client/rest.py
CHANGED
|
@@ -16,13 +16,17 @@ import io
|
|
|
16
16
|
import json
|
|
17
17
|
import re
|
|
18
18
|
import ssl
|
|
19
|
+
from typing import Optional, Union
|
|
19
20
|
|
|
20
21
|
import aiohttp
|
|
22
|
+
import aiohttp_retry
|
|
21
23
|
|
|
22
24
|
from compute_api_client.exceptions import ApiException, ApiValueError
|
|
23
25
|
|
|
24
26
|
RESTResponseType = aiohttp.ClientResponse
|
|
25
27
|
|
|
28
|
+
ALLOW_RETRY_METHODS = frozenset({'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'TRACE'})
|
|
29
|
+
|
|
26
30
|
class RESTResponse(io.IOBase):
|
|
27
31
|
|
|
28
32
|
def __init__(self, resp) -> None:
|
|
@@ -50,36 +54,34 @@ class RESTClientObject:
|
|
|
50
54
|
def __init__(self, configuration) -> None:
|
|
51
55
|
|
|
52
56
|
# maxsize is number of requests to host that are allowed in parallel
|
|
53
|
-
maxsize = configuration.connection_pool_maxsize
|
|
57
|
+
self.maxsize = configuration.connection_pool_maxsize
|
|
54
58
|
|
|
55
|
-
ssl_context = ssl.create_default_context(
|
|
56
|
-
cafile=configuration.ssl_ca_cert
|
|
59
|
+
self.ssl_context = ssl.create_default_context(
|
|
60
|
+
cafile=configuration.ssl_ca_cert,
|
|
61
|
+
cadata=configuration.ca_cert_data,
|
|
57
62
|
)
|
|
58
63
|
if configuration.cert_file:
|
|
59
|
-
ssl_context.load_cert_chain(
|
|
64
|
+
self.ssl_context.load_cert_chain(
|
|
60
65
|
configuration.cert_file, keyfile=configuration.key_file
|
|
61
66
|
)
|
|
62
67
|
|
|
63
68
|
if not configuration.verify_ssl:
|
|
64
|
-
ssl_context.check_hostname = False
|
|
65
|
-
ssl_context.verify_mode = ssl.CERT_NONE
|
|
66
|
-
|
|
67
|
-
connector = aiohttp.TCPConnector(
|
|
68
|
-
limit=maxsize,
|
|
69
|
-
ssl=ssl_context
|
|
70
|
-
)
|
|
69
|
+
self.ssl_context.check_hostname = False
|
|
70
|
+
self.ssl_context.verify_mode = ssl.CERT_NONE
|
|
71
71
|
|
|
72
72
|
self.proxy = configuration.proxy
|
|
73
73
|
self.proxy_headers = configuration.proxy_headers
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
)
|
|
75
|
+
self.retries = configuration.retries
|
|
76
|
+
|
|
77
|
+
self.pool_manager: Optional[aiohttp.ClientSession] = None
|
|
78
|
+
self.retry_client: Optional[aiohttp_retry.RetryClient] = None
|
|
80
79
|
|
|
81
|
-
async def close(self):
|
|
82
|
-
|
|
80
|
+
async def close(self) -> None:
|
|
81
|
+
if self.pool_manager:
|
|
82
|
+
await self.pool_manager.close()
|
|
83
|
+
if self.retry_client is not None:
|
|
84
|
+
await self.retry_client.close()
|
|
83
85
|
|
|
84
86
|
async def request(
|
|
85
87
|
self,
|
|
@@ -163,13 +165,18 @@ class RESTClientObject:
|
|
|
163
165
|
content_type=v[2]
|
|
164
166
|
)
|
|
165
167
|
else:
|
|
168
|
+
# Ensures that dict objects are serialized
|
|
169
|
+
if isinstance(v, dict):
|
|
170
|
+
v = json.dumps(v)
|
|
171
|
+
elif isinstance(v, int):
|
|
172
|
+
v = str(v)
|
|
166
173
|
data.add_field(k, v)
|
|
167
174
|
args["data"] = data
|
|
168
175
|
|
|
169
|
-
# Pass a `bytes` parameter directly in the body to support
|
|
176
|
+
# Pass a `bytes` or `str` parameter directly in the body to support
|
|
170
177
|
# other content types than Json when `body` argument is provided
|
|
171
178
|
# in serialized form
|
|
172
|
-
elif isinstance(body, bytes):
|
|
179
|
+
elif isinstance(body, str) or isinstance(body, bytes):
|
|
173
180
|
args["data"] = body
|
|
174
181
|
else:
|
|
175
182
|
# Cannot generate the request from given parameters
|
|
@@ -178,11 +185,29 @@ class RESTClientObject:
|
|
|
178
185
|
declared content type."""
|
|
179
186
|
raise ApiException(status=0, reason=msg)
|
|
180
187
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return RESTResponse(r)
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
188
|
+
pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient]
|
|
187
189
|
|
|
190
|
+
# https pool manager
|
|
191
|
+
if self.pool_manager is None:
|
|
192
|
+
self.pool_manager = aiohttp.ClientSession(
|
|
193
|
+
connector=aiohttp.TCPConnector(limit=self.maxsize, ssl=self.ssl_context),
|
|
194
|
+
trust_env=True,
|
|
195
|
+
)
|
|
196
|
+
pool_manager = self.pool_manager
|
|
197
|
+
|
|
198
|
+
if self.retries is not None and method in ALLOW_RETRY_METHODS:
|
|
199
|
+
if self.retry_client is None:
|
|
200
|
+
self.retry_client = aiohttp_retry.RetryClient(
|
|
201
|
+
client_session=self.pool_manager,
|
|
202
|
+
retry_options=aiohttp_retry.ExponentialRetry(
|
|
203
|
+
attempts=self.retries,
|
|
204
|
+
factor=2.0,
|
|
205
|
+
start_timeout=0.1,
|
|
206
|
+
max_timeout=120.0
|
|
207
|
+
)
|
|
208
|
+
)
|
|
209
|
+
pool_manager = self.retry_client
|
|
210
|
+
|
|
211
|
+
r = await pool_manager.request(**args)
|
|
188
212
|
|
|
213
|
+
return RESTResponse(r)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qi-compute-api-client
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.54.0
|
|
4
4
|
Summary: An API client for the Compute Job Manager of Quantum Inspire.
|
|
5
5
|
Project-URL: Repository, https://github.com/QuTech-Delft/compute-api-client
|
|
6
6
|
Author-email: Quantum Inspire <support@quantum-inspire.eu>
|
|
@@ -14,6 +14,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Requires-Python: ~=3.9
|
|
17
|
+
Requires-Dist: aiohttp-retry>=2.9.1
|
|
17
18
|
Requires-Dist: aiohttp<4,>=3.10.5
|
|
18
19
|
Requires-Dist: pydantic<3,>=2.10.4
|
|
19
20
|
Requires-Dist: python-dateutil<3,>=2.8.2
|
|
@@ -31,11 +32,12 @@ project:
|
|
|
31
32
|
|
|
32
33
|
- API version: 0.1.0
|
|
33
34
|
- Package version: 1.0.0
|
|
35
|
+
- Generator version: 7.14.0
|
|
34
36
|
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
|
|
35
37
|
|
|
36
38
|
## Requirements.
|
|
37
39
|
|
|
38
|
-
Python 3.
|
|
40
|
+
Python 3.9+
|
|
39
41
|
|
|
40
42
|
## Installation & Usage
|
|
41
43
|
|
|
@@ -43,10 +45,12 @@ This python library package is generated without supporting files like setup.py
|
|
|
43
45
|
|
|
44
46
|
To be able to use it, you will need these dependencies in your own package that uses this library:
|
|
45
47
|
|
|
46
|
-
- urllib3 >= 1.
|
|
47
|
-
- python-dateutil
|
|
48
|
-
- aiohttp
|
|
49
|
-
-
|
|
48
|
+
- urllib3 >= 2.1.0, < 3.0.0
|
|
49
|
+
- python-dateutil >= 2.8.2
|
|
50
|
+
- aiohttp >= 3.8.4
|
|
51
|
+
- aiohttp-retry >= 2.8.3
|
|
52
|
+
- pydantic >= 2
|
|
53
|
+
- typing-extensions >= 4.7.1
|
|
50
54
|
|
|
51
55
|
## Getting Started
|
|
52
56
|
|
|
@@ -54,7 +58,6 @@ In your own code, to use this library to connect and interact with compute-api-c
|
|
|
54
58
|
|
|
55
59
|
```python
|
|
56
60
|
|
|
57
|
-
import time
|
|
58
61
|
import compute_api_client
|
|
59
62
|
from compute_api_client.rest import ApiException
|
|
60
63
|
from pprint import pprint
|
|
@@ -201,7 +204,6 @@ All URIs are relative to _http://localhost_
|
|
|
201
204
|
- [JobPatch](compute_api_client/docs/JobPatch.md)
|
|
202
205
|
- [JobStatus](compute_api_client/docs/JobStatus.md)
|
|
203
206
|
- [Language](compute_api_client/docs/Language.md)
|
|
204
|
-
- [LocationInner](compute_api_client/docs/LocationInner.md)
|
|
205
207
|
- [Member](compute_api_client/docs/Member.md)
|
|
206
208
|
- [MemberIn](compute_api_client/docs/MemberIn.md)
|
|
207
209
|
- [PageAlgorithm](compute_api_client/docs/PageAlgorithm.md)
|
|
@@ -237,6 +239,7 @@ All URIs are relative to _http://localhost_
|
|
|
237
239
|
- [User](compute_api_client/docs/User.md)
|
|
238
240
|
- [UserIn](compute_api_client/docs/UserIn.md)
|
|
239
241
|
- [ValidationError](compute_api_client/docs/ValidationError.md)
|
|
242
|
+
- [ValidationErrorLocInner](compute_api_client/docs/ValidationErrorLocInner.md)
|
|
240
243
|
|
|
241
244
|
<a id="documentation-for-authorization"></a>
|
|
242
245
|
|
|
@@ -248,7 +251,7 @@ Authentication schemes defined for the API: <a id="user_bearer"></a>
|
|
|
248
251
|
|
|
249
252
|
- **Type**: OAuth
|
|
250
253
|
- **Flow**: accessCode
|
|
251
|
-
- **Authorization URL**: https://quantum-inspire
|
|
254
|
+
- **Authorization URL**: https://auth.qi2.quantum-inspire.com/realms/oidc_development/protocol/openid-connect/auth
|
|
252
255
|
- **Scopes**: N/A
|
|
253
256
|
|
|
254
257
|
<a id="backend"></a>
|