qi-compute-api-client 0.53.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.

Files changed (190) hide show
  1. compute_api_client/__init__.py +194 -95
  2. compute_api_client/api/algorithms_api.py +75 -81
  3. compute_api_client/api/auth_config_api.py +16 -24
  4. compute_api_client/api/backend_api.py +70 -86
  5. compute_api_client/api/backend_types_api.py +43 -56
  6. compute_api_client/api/batch_jobs_api.py +102 -120
  7. compute_api_client/api/commits_api.py +85 -80
  8. compute_api_client/api/files_api.py +62 -67
  9. compute_api_client/api/final_results_api.py +42 -53
  10. compute_api_client/api/health_api.py +16 -25
  11. compute_api_client/api/jobs_api.py +76 -83
  12. compute_api_client/api/languages_api.py +30 -42
  13. compute_api_client/api/members_api.py +62 -67
  14. compute_api_client/api/permissions_api.py +56 -70
  15. compute_api_client/api/projects_api.py +89 -97
  16. compute_api_client/api/reservations_api.py +57 -72
  17. compute_api_client/api/results_api.py +76 -83
  18. compute_api_client/api/teams_api.py +30 -42
  19. compute_api_client/api/transactions_api.py +31 -44
  20. compute_api_client/api/users_api.py +62 -67
  21. compute_api_client/api_client.py +135 -75
  22. compute_api_client/api_response.py +3 -3
  23. compute_api_client/configuration.py +176 -36
  24. compute_api_client/docs/Algorithm.md +8 -7
  25. compute_api_client/docs/AlgorithmIn.md +7 -6
  26. compute_api_client/docs/AlgorithmType.md +5 -3
  27. compute_api_client/docs/AlgorithmsApi.md +15 -10
  28. compute_api_client/docs/AuthConfig.md +3 -2
  29. compute_api_client/docs/AuthConfigApi.md +3 -2
  30. compute_api_client/docs/Backend.md +9 -8
  31. compute_api_client/docs/BackendApi.md +15 -10
  32. compute_api_client/docs/BackendIn.md +8 -7
  33. compute_api_client/docs/BackendPatch.md +5 -4
  34. compute_api_client/docs/BackendStatus.md +9 -3
  35. compute_api_client/docs/BackendType.md +20 -19
  36. compute_api_client/docs/BackendTypePatch.md +3 -2
  37. compute_api_client/docs/BackendTypesApi.md +15 -8
  38. compute_api_client/docs/BackendWithAuthentication.md +10 -9
  39. compute_api_client/docs/BatchJob.md +10 -9
  40. compute_api_client/docs/BatchJobIn.md +4 -3
  41. compute_api_client/docs/BatchJobStatus.md +11 -3
  42. compute_api_client/docs/BatchJobsApi.md +23 -16
  43. compute_api_client/docs/Commit.md +8 -7
  44. compute_api_client/docs/CommitIn.md +5 -4
  45. compute_api_client/docs/CommitsApi.md +15 -10
  46. compute_api_client/docs/CompilePayload.md +4 -3
  47. compute_api_client/docs/CompileStage.md +11 -3
  48. compute_api_client/docs/Domain.md +7 -3
  49. compute_api_client/docs/File.md +10 -9
  50. compute_api_client/docs/FileIn.md +9 -8
  51. compute_api_client/docs/FilesApi.md +12 -8
  52. compute_api_client/docs/FinalResult.md +7 -6
  53. compute_api_client/docs/FinalResultIn.md +5 -4
  54. compute_api_client/docs/FinalResultsApi.md +9 -6
  55. compute_api_client/docs/HTTPBadRequestError.md +3 -2
  56. compute_api_client/docs/HTTPNotFoundError.md +3 -2
  57. compute_api_client/docs/HTTPValidationError.md +3 -2
  58. compute_api_client/docs/HealthApi.md +3 -2
  59. compute_api_client/docs/Job.md +13 -12
  60. compute_api_client/docs/Job1.md +28 -0
  61. compute_api_client/docs/JobIn.md +6 -5
  62. compute_api_client/docs/JobPatch.md +8 -7
  63. compute_api_client/docs/JobStatus.md +11 -3
  64. compute_api_client/docs/JobsApi.md +15 -10
  65. compute_api_client/docs/Language.md +6 -5
  66. compute_api_client/docs/LanguagesApi.md +6 -4
  67. compute_api_client/docs/Member.md +8 -7
  68. compute_api_client/docs/MemberId.md +28 -0
  69. compute_api_client/docs/MemberIn.md +7 -6
  70. compute_api_client/docs/MembersApi.md +12 -8
  71. compute_api_client/docs/PageAlgorithm.md +3 -2
  72. compute_api_client/docs/PageBackend.md +3 -2
  73. compute_api_client/docs/PageBackendType.md +3 -2
  74. compute_api_client/docs/PageBatchJob.md +3 -2
  75. compute_api_client/docs/PageCommit.md +3 -2
  76. compute_api_client/docs/PageFile.md +3 -2
  77. compute_api_client/docs/PageJob.md +3 -2
  78. compute_api_client/docs/PageLanguage.md +3 -2
  79. compute_api_client/docs/PageMember.md +3 -2
  80. compute_api_client/docs/PagePermission.md +3 -2
  81. compute_api_client/docs/PagePermissionGroup.md +3 -2
  82. compute_api_client/docs/PageProject.md +3 -2
  83. compute_api_client/docs/PageReservation.md +3 -2
  84. compute_api_client/docs/PageResult.md +3 -2
  85. compute_api_client/docs/PageTeam.md +3 -2
  86. compute_api_client/docs/PageTransaction.md +3 -2
  87. compute_api_client/docs/PageUser.md +3 -2
  88. compute_api_client/docs/Permission.md +6 -5
  89. compute_api_client/docs/PermissionGroup.md +5 -4
  90. compute_api_client/docs/PermissionsApi.md +12 -8
  91. compute_api_client/docs/Project.md +9 -8
  92. compute_api_client/docs/ProjectIn.md +7 -6
  93. compute_api_client/docs/ProjectPatch.md +3 -2
  94. compute_api_client/docs/ProjectsApi.md +23 -13
  95. compute_api_client/docs/Reservation.md +9 -8
  96. compute_api_client/docs/ReservationIn.md +7 -6
  97. compute_api_client/docs/ReservationsApi.md +12 -8
  98. compute_api_client/docs/Result.md +7 -6
  99. compute_api_client/docs/ResultIn.md +5 -4
  100. compute_api_client/docs/ResultsApi.md +15 -10
  101. compute_api_client/docs/Role.md +5 -3
  102. compute_api_client/docs/ShareType.md +7 -3
  103. compute_api_client/docs/Team.md +7 -6
  104. compute_api_client/docs/TeamsApi.md +6 -4
  105. compute_api_client/docs/Transaction.md +6 -5
  106. compute_api_client/docs/TransactionDomain.md +28 -0
  107. compute_api_client/docs/TransactionsApi.md +6 -4
  108. compute_api_client/docs/User.md +11 -10
  109. compute_api_client/docs/UserIn.md +10 -9
  110. compute_api_client/docs/UsersApi.md +12 -8
  111. compute_api_client/docs/ValidationError.md +4 -3
  112. compute_api_client/docs/ValidationErrorLocInner.md +28 -0
  113. compute_api_client/exceptions.py +74 -24
  114. compute_api_client/models/__init__.py +1 -1
  115. compute_api_client/models/algorithm.py +19 -20
  116. compute_api_client/models/algorithm_in.py +18 -19
  117. compute_api_client/models/algorithm_type.py +1 -9
  118. compute_api_client/models/auth_config.py +14 -14
  119. compute_api_client/models/backend.py +20 -20
  120. compute_api_client/models/backend_in.py +19 -19
  121. compute_api_client/models/backend_patch.py +16 -15
  122. compute_api_client/models/backend_status.py +1 -9
  123. compute_api_client/models/backend_type.py +31 -32
  124. compute_api_client/models/backend_type_patch.py +14 -15
  125. compute_api_client/models/backend_with_authentication.py +21 -21
  126. compute_api_client/models/batch_job.py +21 -20
  127. compute_api_client/models/batch_job_in.py +15 -15
  128. compute_api_client/models/batch_job_status.py +1 -9
  129. compute_api_client/models/commit.py +19 -19
  130. compute_api_client/models/commit_in.py +16 -16
  131. compute_api_client/models/compile_payload.py +15 -15
  132. compute_api_client/models/compile_stage.py +1 -9
  133. compute_api_client/models/domain.py +1 -9
  134. compute_api_client/models/file.py +21 -22
  135. compute_api_client/models/file_in.py +20 -21
  136. compute_api_client/models/final_result.py +18 -17
  137. compute_api_client/models/final_result_in.py +16 -16
  138. compute_api_client/models/http_bad_request_error.py +14 -14
  139. compute_api_client/models/http_not_found_error.py +14 -14
  140. compute_api_client/models/http_validation_error.py +18 -18
  141. compute_api_client/models/job.py +24 -24
  142. compute_api_client/models/job1.py +144 -0
  143. compute_api_client/models/job_in.py +17 -17
  144. compute_api_client/models/job_patch.py +19 -20
  145. compute_api_client/models/job_status.py +1 -9
  146. compute_api_client/models/language.py +17 -18
  147. compute_api_client/models/member.py +19 -19
  148. compute_api_client/models/member_id.py +144 -0
  149. compute_api_client/models/member_in.py +18 -18
  150. compute_api_client/models/page_algorithm.py +18 -19
  151. compute_api_client/models/page_backend.py +18 -19
  152. compute_api_client/models/page_backend_type.py +18 -19
  153. compute_api_client/models/page_batch_job.py +18 -19
  154. compute_api_client/models/page_commit.py +18 -19
  155. compute_api_client/models/page_file.py +18 -19
  156. compute_api_client/models/page_job.py +18 -19
  157. compute_api_client/models/page_language.py +18 -19
  158. compute_api_client/models/page_member.py +18 -19
  159. compute_api_client/models/page_permission.py +18 -19
  160. compute_api_client/models/page_permission_group.py +18 -19
  161. compute_api_client/models/page_project.py +18 -19
  162. compute_api_client/models/page_reservation.py +18 -19
  163. compute_api_client/models/page_result.py +18 -19
  164. compute_api_client/models/page_team.py +18 -19
  165. compute_api_client/models/page_transaction.py +18 -19
  166. compute_api_client/models/page_user.py +18 -19
  167. compute_api_client/models/permission.py +17 -18
  168. compute_api_client/models/permission_group.py +16 -17
  169. compute_api_client/models/project.py +20 -20
  170. compute_api_client/models/project_in.py +18 -19
  171. compute_api_client/models/project_patch.py +14 -15
  172. compute_api_client/models/reservation.py +20 -19
  173. compute_api_client/models/reservation_in.py +18 -17
  174. compute_api_client/models/result.py +18 -17
  175. compute_api_client/models/result_in.py +16 -16
  176. compute_api_client/models/role.py +1 -9
  177. compute_api_client/models/share_type.py +1 -9
  178. compute_api_client/models/team.py +18 -19
  179. compute_api_client/models/transaction.py +17 -17
  180. compute_api_client/models/transaction_domain.py +142 -0
  181. compute_api_client/models/user.py +22 -23
  182. compute_api_client/models/user_in.py +21 -22
  183. compute_api_client/models/validation_error.py +20 -20
  184. compute_api_client/models/validation_error_loc_inner.py +138 -0
  185. compute_api_client/rest.py +51 -26
  186. {qi_compute_api_client-0.53.0.dist-info → qi_compute_api_client-0.54.0.dist-info}/METADATA +12 -9
  187. qi_compute_api_client-0.54.0.dist-info/RECORD +205 -0
  188. qi_compute_api_client-0.53.0.dist-info/RECORD +0 -197
  189. {qi_compute_api_client-0.53.0.dist-info → qi_compute_api_client-0.54.0.dist-info}/WHEEL +0 -0
  190. {qi_compute_api_client-0.53.0.dist-info → qi_compute_api_client-0.54.0.dist-info}/licenses/LICENSE.md +0 -0
@@ -18,30 +18,29 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
  from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt
21
22
  from typing import Any, ClassVar, Dict, List, Optional
22
- from pydantic import BaseModel, StrictBool, StrictInt
23
- try:
24
- from typing import Self
25
- except ImportError:
26
- from typing_extensions import Self
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
27
25
 
28
26
  class Reservation(BaseModel):
29
27
  """
30
28
  Reservation
31
29
  """ # noqa: E501
32
- id: StrictInt
33
- member_id: StrictInt
34
- start_time: datetime
35
- end_time: datetime
36
- backend_type_id: StrictInt
30
+ id: StrictInt = Field(description="The id of the reservation")
31
+ member_id: StrictInt = Field(description="The id of the member who made the reservation")
32
+ start_time: datetime = Field(description="Starting time of lthe reservation")
33
+ end_time: datetime = Field(description="End time of the reservation")
34
+ backend_type_id: StrictInt = Field(description="The id of the backend_type")
37
35
  backend_id: Optional[StrictInt]
38
- is_terminated: StrictBool
36
+ is_terminated: StrictBool = Field(description="If the reservation has been terminated")
39
37
  __properties: ClassVar[List[str]] = ["id", "member_id", "start_time", "end_time", "backend_type_id", "backend_id", "is_terminated"]
40
38
 
41
- model_config = {
42
- "populate_by_name": True,
43
- "validate_assignment": True
44
- }
39
+ model_config = ConfigDict(
40
+ populate_by_name=True,
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
45
44
 
46
45
 
47
46
  def to_str(self) -> str:
@@ -54,7 +53,7 @@ class Reservation(BaseModel):
54
53
  return json.dumps(self.to_dict())
55
54
 
56
55
  @classmethod
57
- def from_json(cls, json_str: str) -> Self:
56
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
57
  """Create an instance of Reservation from a JSON string"""
59
58
  return cls.from_dict(json.loads(json_str))
60
59
 
@@ -68,10 +67,12 @@ class Reservation(BaseModel):
68
67
  were set at model initialization. Other fields with value `None`
69
68
  are ignored.
70
69
  """
70
+ excluded_fields: Set[str] = set([
71
+ ])
72
+
71
73
  _dict = self.model_dump(
72
74
  by_alias=True,
73
- exclude={
74
- },
75
+ exclude=excluded_fields,
75
76
  exclude_none=True,
76
77
  )
77
78
  # set to None if backend_id (nullable) is None
@@ -82,7 +83,7 @@ class Reservation(BaseModel):
82
83
  return _dict
83
84
 
84
85
  @classmethod
85
- def from_dict(cls, obj: Dict) -> Self:
86
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
87
  """Create an instance of Reservation from a dict"""
87
88
  if obj is None:
88
89
  return None
@@ -18,27 +18,26 @@ 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
22
- from pydantic import BaseModel, StrictInt
23
- try:
24
- from typing import Self
25
- except ImportError:
26
- from typing_extensions import Self
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
27
25
 
28
26
  class ReservationIn(BaseModel):
29
27
  """
30
28
  ReservationIn
31
29
  """ # noqa: E501
32
- member_id: StrictInt
33
- start_time: datetime
34
- end_time: datetime
35
- backend_type_id: StrictInt
30
+ member_id: StrictInt = Field(description="The id of the member who made the reservation")
31
+ start_time: datetime = Field(description="Starting time of lthe reservation")
32
+ end_time: datetime = Field(description="End time of the reservation")
33
+ backend_type_id: StrictInt = Field(description="The id of the backend_type")
36
34
  __properties: ClassVar[List[str]] = ["member_id", "start_time", "end_time", "backend_type_id"]
37
35
 
38
- model_config = {
39
- "populate_by_name": True,
40
- "validate_assignment": True
41
- }
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
42
41
 
43
42
 
44
43
  def to_str(self) -> str:
@@ -51,7 +50,7 @@ class ReservationIn(BaseModel):
51
50
  return json.dumps(self.to_dict())
52
51
 
53
52
  @classmethod
54
- def from_json(cls, json_str: str) -> Self:
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
54
  """Create an instance of ReservationIn from a JSON string"""
56
55
  return cls.from_dict(json.loads(json_str))
57
56
 
@@ -65,16 +64,18 @@ class ReservationIn(BaseModel):
65
64
  were set at model initialization. Other fields with value `None`
66
65
  are ignored.
67
66
  """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
68
70
  _dict = self.model_dump(
69
71
  by_alias=True,
70
- exclude={
71
- },
72
+ exclude=excluded_fields,
72
73
  exclude_none=True,
73
74
  )
74
75
  return _dict
75
76
 
76
77
  @classmethod
77
- def from_dict(cls, obj: Dict) -> Self:
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
79
  """Create an instance of ReservationIn from a dict"""
79
80
  if obj is None:
80
81
  return None
@@ -18,31 +18,30 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
  from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
21
22
  from typing import Any, ClassVar, Dict, List, Optional, Union
22
- from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr
23
- try:
24
- from typing import Self
25
- except ImportError:
26
- from typing_extensions import Self
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
27
25
 
28
26
  class Result(BaseModel):
29
27
  """
30
28
  Result
31
29
  """ # noqa: E501
32
- id: StrictInt
33
- created_on: datetime
34
- job_id: StrictInt
35
- execution_time_in_seconds: Union[StrictFloat, StrictInt]
30
+ id: StrictInt = Field(description="The ID of the result")
31
+ created_on: datetime = Field(description="Time of creation of the result")
32
+ job_id: StrictInt = Field(description="The ID of the job")
33
+ execution_time_in_seconds: Union[StrictFloat, StrictInt] = Field(description="Time it took to compute the result")
36
34
  shots_requested: Optional[StrictInt]
37
35
  shots_done: Optional[StrictInt]
38
36
  results: Optional[Dict[str, Any]]
39
37
  raw_data: Optional[List[StrictStr]]
40
38
  __properties: ClassVar[List[str]] = ["id", "created_on", "job_id", "execution_time_in_seconds", "shots_requested", "shots_done", "results", "raw_data"]
41
39
 
42
- model_config = {
43
- "populate_by_name": True,
44
- "validate_assignment": True
45
- }
40
+ model_config = ConfigDict(
41
+ populate_by_name=True,
42
+ validate_assignment=True,
43
+ protected_namespaces=(),
44
+ )
46
45
 
47
46
 
48
47
  def to_str(self) -> str:
@@ -55,7 +54,7 @@ class Result(BaseModel):
55
54
  return json.dumps(self.to_dict())
56
55
 
57
56
  @classmethod
58
- def from_json(cls, json_str: str) -> Self:
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
59
58
  """Create an instance of Result from a JSON string"""
60
59
  return cls.from_dict(json.loads(json_str))
61
60
 
@@ -69,10 +68,12 @@ class Result(BaseModel):
69
68
  were set at model initialization. Other fields with value `None`
70
69
  are ignored.
71
70
  """
71
+ excluded_fields: Set[str] = set([
72
+ ])
73
+
72
74
  _dict = self.model_dump(
73
75
  by_alias=True,
74
- exclude={
75
- },
76
+ exclude=excluded_fields,
76
77
  exclude_none=True,
77
78
  )
78
79
  # set to None if shots_requested (nullable) is None
@@ -98,7 +99,7 @@ class Result(BaseModel):
98
99
  return _dict
99
100
 
100
101
  @classmethod
101
- def from_dict(cls, obj: Dict) -> Self:
102
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
102
103
  """Create an instance of Result from a dict"""
103
104
  if obj is None:
104
105
  return None
@@ -17,30 +17,28 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
-
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Optional, Union
22
- from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr
23
- try:
24
- from typing import Self
25
- except ImportError:
26
- from typing_extensions import Self
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
27
24
 
28
25
  class ResultIn(BaseModel):
29
26
  """
30
27
  ResultIn
31
28
  """ # noqa: E501
32
- job_id: StrictInt
33
- execution_time_in_seconds: Union[StrictFloat, StrictInt]
29
+ job_id: StrictInt = Field(description="The ID of the result")
30
+ execution_time_in_seconds: Union[StrictFloat, StrictInt] = Field(description="Time it took to compute the result")
34
31
  shots_requested: Optional[StrictInt] = None
35
32
  shots_done: Optional[StrictInt] = None
36
33
  results: Optional[Dict[str, Any]] = None
37
34
  raw_data: Optional[List[StrictStr]] = None
38
35
  __properties: ClassVar[List[str]] = ["job_id", "execution_time_in_seconds", "shots_requested", "shots_done", "results", "raw_data"]
39
36
 
40
- model_config = {
41
- "populate_by_name": True,
42
- "validate_assignment": True
43
- }
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
44
42
 
45
43
 
46
44
  def to_str(self) -> str:
@@ -53,7 +51,7 @@ class ResultIn(BaseModel):
53
51
  return json.dumps(self.to_dict())
54
52
 
55
53
  @classmethod
56
- def from_json(cls, json_str: str) -> Self:
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
57
55
  """Create an instance of ResultIn from a JSON string"""
58
56
  return cls.from_dict(json.loads(json_str))
59
57
 
@@ -67,10 +65,12 @@ class ResultIn(BaseModel):
67
65
  were set at model initialization. Other fields with value `None`
68
66
  are ignored.
69
67
  """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
70
71
  _dict = self.model_dump(
71
72
  by_alias=True,
72
- exclude={
73
- },
73
+ exclude=excluded_fields,
74
74
  exclude_none=True,
75
75
  )
76
76
  # set to None if shots_requested (nullable) is None
@@ -96,7 +96,7 @@ class ResultIn(BaseModel):
96
96
  return _dict
97
97
 
98
98
  @classmethod
99
- def from_dict(cls, obj: Dict) -> Self:
99
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
100
100
  """Create an instance of ResultIn from a dict"""
101
101
  if obj is None:
102
102
  return None
@@ -14,16 +14,8 @@
14
14
 
15
15
  from __future__ import annotations
16
16
  import json
17
- import pprint
18
- import re # noqa: F401
19
17
  from enum import Enum
20
-
21
-
22
-
23
- try:
24
- from typing import Self
25
- except ImportError:
26
- from typing_extensions import Self
18
+ from typing_extensions import Self
27
19
 
28
20
 
29
21
  class Role(str, Enum):
@@ -14,16 +14,8 @@
14
14
 
15
15
  from __future__ import annotations
16
16
  import json
17
- import pprint
18
- import re # noqa: F401
19
17
  from enum import Enum
20
-
21
-
22
-
23
- try:
24
- from typing import Self
25
- except ImportError:
26
- from typing_extensions import Self
18
+ from typing_extensions import Self
27
19
 
28
20
 
29
21
  class ShareType(str, Enum):
@@ -17,30 +17,27 @@ 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
- try:
26
- from typing import Self
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 Team(BaseModel):
31
27
  """
32
28
  Team
33
29
  """ # noqa: E501
34
- id: StrictInt
35
- name: Annotated[str, Field(strict=True, max_length=64)]
36
- slug: Annotated[str, Field(strict=True, max_length=64)]
37
- individual_user: StrictBool
30
+ id: StrictInt = Field(description="The id of the team")
31
+ name: Annotated[str, Field(strict=True, max_length=64)] = Field(description="The name of the team")
32
+ slug: Annotated[str, Field(strict=True, max_length=64)] = Field(description="The slugified name")
33
+ individual_user: StrictBool = Field(description="If it is an individual user")
38
34
  __properties: ClassVar[List[str]] = ["id", "name", "slug", "individual_user"]
39
35
 
40
- model_config = {
41
- "populate_by_name": True,
42
- "validate_assignment": True
43
- }
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
44
41
 
45
42
 
46
43
  def to_str(self) -> str:
@@ -53,7 +50,7 @@ class Team(BaseModel):
53
50
  return json.dumps(self.to_dict())
54
51
 
55
52
  @classmethod
56
- def from_json(cls, json_str: str) -> Self:
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
57
54
  """Create an instance of Team from a JSON string"""
58
55
  return cls.from_dict(json.loads(json_str))
59
56
 
@@ -67,16 +64,18 @@ class Team(BaseModel):
67
64
  were set at model initialization. Other fields with value `None`
68
65
  are ignored.
69
66
  """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
70
  _dict = self.model_dump(
71
71
  by_alias=True,
72
- exclude={
73
- },
72
+ exclude=excluded_fields,
74
73
  exclude_none=True,
75
74
  )
76
75
  return _dict
77
76
 
78
77
  @classmethod
79
- def from_dict(cls, obj: Dict) -> Self:
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
79
  """Create an instance of Team from a dict"""
81
80
  if obj is None:
82
81
  return None
@@ -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
- try:
27
- from typing import Self
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
- "populate_by_name": True,
46
- "validate_assignment": True
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
+