qi-compute-api-client 0.7.0__py3-none-any.whl → 0.17.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of qi-compute-api-client might be problematic. Click here for more details.

Files changed (165) hide show
  1. compute_api_client/__init__.py +22 -19
  2. compute_api_client/api/__init__.py +5 -6
  3. compute_api_client/api/algorithms_api.py +1333 -553
  4. compute_api_client/api/backend_api.py +1501 -0
  5. compute_api_client/api/backend_types_api.py +684 -0
  6. compute_api_client/api/batch_jobs_api.py +1937 -0
  7. compute_api_client/api/commits_api.py +1068 -435
  8. compute_api_client/api/files_api.py +1075 -435
  9. compute_api_client/api/final_results_api.py +736 -338
  10. compute_api_client/api/jobs_api.py +1653 -0
  11. compute_api_client/api/languages_api.py +556 -217
  12. compute_api_client/api/members_api.py +1057 -435
  13. compute_api_client/api/metadata_api.py +736 -337
  14. compute_api_client/api/permissions_api.py +1055 -421
  15. compute_api_client/api/projects_api.py +1604 -676
  16. compute_api_client/api/reservations_api.py +1124 -427
  17. compute_api_client/api/results_api.py +738 -337
  18. compute_api_client/api/teams_api.py +567 -220
  19. compute_api_client/api/transactions_api.py +679 -218
  20. compute_api_client/api/users_api.py +1090 -435
  21. compute_api_client/api_client.py +346 -304
  22. compute_api_client/api_response.py +21 -0
  23. compute_api_client/configuration.py +54 -67
  24. compute_api_client/docs/Algorithm.md +20 -3
  25. compute_api_client/docs/AlgorithmIn.md +20 -3
  26. compute_api_client/docs/AlgorithmType.md +0 -1
  27. compute_api_client/docs/AlgorithmsApi.md +78 -77
  28. compute_api_client/docs/Backend.md +33 -0
  29. compute_api_client/docs/BackendApi.md +419 -0
  30. compute_api_client/docs/BackendPatch.md +29 -0
  31. compute_api_client/docs/{RunStatus.md → BackendStatus.md} +1 -2
  32. compute_api_client/docs/BackendType.md +36 -0
  33. compute_api_client/docs/{RuntimeTypesApi.md → BackendTypesApi.md} +58 -31
  34. compute_api_client/docs/BackendWithAuthentication.md +34 -0
  35. compute_api_client/docs/BatchJob.md +38 -0
  36. compute_api_client/docs/BatchJobIn.md +29 -0
  37. compute_api_client/docs/{RuntimeStatus.md → BatchJobStatus.md} +1 -2
  38. compute_api_client/docs/{BatchRunsApi.md → BatchJobsApi.md} +170 -147
  39. compute_api_client/docs/Commit.md +18 -1
  40. compute_api_client/docs/CommitIn.md +17 -0
  41. compute_api_client/docs/CommitsApi.md +62 -71
  42. compute_api_client/docs/CompileStage.md +0 -1
  43. compute_api_client/docs/Domain.md +0 -1
  44. compute_api_client/docs/File.md +21 -4
  45. compute_api_client/docs/FileIn.md +21 -4
  46. compute_api_client/docs/FilesApi.md +65 -71
  47. compute_api_client/docs/FinalResult.md +20 -3
  48. compute_api_client/docs/FinalResultIn.md +19 -2
  49. compute_api_client/docs/FinalResultsApi.md +44 -71
  50. compute_api_client/docs/HTTPNotFoundError.md +17 -0
  51. compute_api_client/docs/HTTPValidationError.md +18 -1
  52. compute_api_client/docs/Job.md +36 -0
  53. compute_api_client/docs/JobIn.md +31 -0
  54. compute_api_client/docs/JobPatch.md +28 -0
  55. compute_api_client/docs/{BatchRunStatus.md → JobStatus.md} +1 -2
  56. compute_api_client/docs/{RunsApi.md → JobsApi.md} +137 -122
  57. compute_api_client/docs/Language.md +17 -0
  58. compute_api_client/docs/LanguagesApi.md +30 -12
  59. compute_api_client/docs/LocationInner.md +17 -0
  60. compute_api_client/docs/Member.md +19 -2
  61. compute_api_client/docs/MemberIn.md +19 -2
  62. compute_api_client/docs/MembersApi.md +59 -24
  63. compute_api_client/docs/Metadata.md +20 -3
  64. compute_api_client/docs/MetadataApi.md +49 -33
  65. compute_api_client/docs/MetadataIn.md +19 -2
  66. compute_api_client/docs/Permission.md +17 -0
  67. compute_api_client/docs/PermissionGroup.md +17 -0
  68. compute_api_client/docs/PermissionsApi.md +68 -28
  69. compute_api_client/docs/Project.md +20 -3
  70. compute_api_client/docs/ProjectIn.md +18 -1
  71. compute_api_client/docs/ProjectPatch.md +19 -2
  72. compute_api_client/docs/ProjectsApi.md +84 -36
  73. compute_api_client/docs/Reservation.md +21 -4
  74. compute_api_client/docs/ReservationIn.md +19 -2
  75. compute_api_client/docs/ReservationsApi.md +66 -24
  76. compute_api_client/docs/Result.md +23 -6
  77. compute_api_client/docs/ResultIn.md +19 -2
  78. compute_api_client/docs/ResultsApi.md +42 -26
  79. compute_api_client/docs/Role.md +0 -1
  80. compute_api_client/docs/ShareType.md +0 -1
  81. compute_api_client/docs/Team.md +18 -1
  82. compute_api_client/docs/TeamsApi.md +37 -14
  83. compute_api_client/docs/Transaction.md +21 -4
  84. compute_api_client/docs/TransactionsApi.md +50 -14
  85. compute_api_client/docs/User.md +21 -4
  86. compute_api_client/docs/UserIn.md +17 -0
  87. compute_api_client/docs/UsersApi.md +62 -24
  88. compute_api_client/docs/ValidationError.md +18 -1
  89. compute_api_client/exceptions.py +19 -16
  90. compute_api_client/models/__init__.py +16 -14
  91. compute_api_client/models/algorithm.py +78 -237
  92. compute_api_client/models/algorithm_in.py +76 -204
  93. compute_api_client/models/algorithm_type.py +21 -87
  94. compute_api_client/models/backend.py +100 -0
  95. compute_api_client/models/backend_patch.py +90 -0
  96. compute_api_client/models/backend_status.py +47 -0
  97. compute_api_client/models/backend_type.py +105 -0
  98. compute_api_client/models/backend_with_authentication.py +102 -0
  99. compute_api_client/models/batch_job.py +129 -0
  100. compute_api_client/models/batch_job_in.py +89 -0
  101. compute_api_client/models/batch_job_status.py +48 -0
  102. compute_api_client/models/commit.py +72 -230
  103. compute_api_client/models/commit_in.py +67 -169
  104. compute_api_client/models/compile_stage.py +23 -89
  105. compute_api_client/models/domain.py +22 -88
  106. compute_api_client/models/file.py +74 -288
  107. compute_api_client/models/file_in.py +72 -254
  108. compute_api_client/models/final_result.py +68 -198
  109. compute_api_client/models/final_result_in.py +63 -137
  110. compute_api_client/models/http_not_found_error.py +60 -105
  111. compute_api_client/models/http_validation_error.py +69 -105
  112. compute_api_client/models/job.py +120 -0
  113. compute_api_client/models/job_in.py +99 -0
  114. compute_api_client/models/job_patch.py +88 -0
  115. compute_api_client/models/job_status.py +48 -0
  116. compute_api_client/models/language.py +67 -172
  117. compute_api_client/models/location_inner.py +125 -84
  118. compute_api_client/models/member.py +70 -236
  119. compute_api_client/models/member_in.py +68 -203
  120. compute_api_client/models/metadata.py +68 -198
  121. compute_api_client/models/metadata_in.py +68 -137
  122. compute_api_client/models/permission.py +67 -172
  123. compute_api_client/models/permission_group.py +65 -142
  124. compute_api_client/models/project.py +74 -256
  125. compute_api_client/models/project_in.py +69 -195
  126. compute_api_client/models/project_patch.py +89 -192
  127. compute_api_client/models/reservation.py +79 -290
  128. compute_api_client/models/reservation_in.py +68 -200
  129. compute_api_client/models/result.py +101 -359
  130. compute_api_client/models/result_in.py +95 -291
  131. compute_api_client/models/role.py +21 -87
  132. compute_api_client/models/share_type.py +22 -88
  133. compute_api_client/models/team.py +69 -198
  134. compute_api_client/models/transaction.py +93 -299
  135. compute_api_client/models/user.py +75 -276
  136. compute_api_client/models/user_in.py +73 -243
  137. compute_api_client/models/validation_error.py +73 -160
  138. compute_api_client/rest.py +55 -114
  139. {qi_compute_api_client-0.7.0.dist-info → qi_compute_api_client-0.17.0.dist-info}/METADATA +47 -40
  140. qi_compute_api_client-0.17.0.dist-info/RECORD +142 -0
  141. compute_api_client/api/batch_runs_api.py +0 -862
  142. compute_api_client/api/runs_api.py +0 -723
  143. compute_api_client/api/runtime_api.py +0 -449
  144. compute_api_client/api/runtime_types_api.py +0 -303
  145. compute_api_client/docs/BatchRun.md +0 -21
  146. compute_api_client/docs/BatchRunIn.md +0 -12
  147. compute_api_client/docs/Run.md +0 -19
  148. compute_api_client/docs/RunIn.md +0 -14
  149. compute_api_client/docs/Runtime.md +0 -16
  150. compute_api_client/docs/RuntimeApi.md +0 -229
  151. compute_api_client/docs/RuntimeType.md +0 -19
  152. compute_api_client/docs/RuntimeWithAuthentication.md +0 -17
  153. compute_api_client/models/batch_run.py +0 -423
  154. compute_api_client/models/batch_run_in.py +0 -171
  155. compute_api_client/models/batch_run_status.py +0 -114
  156. compute_api_client/models/run.py +0 -376
  157. compute_api_client/models/run_in.py +0 -233
  158. compute_api_client/models/run_status.py +0 -114
  159. compute_api_client/models/runtime.py +0 -290
  160. compute_api_client/models/runtime_status.py +0 -113
  161. compute_api_client/models/runtime_type.py +0 -357
  162. compute_api_client/models/runtime_with_authentication.py +0 -320
  163. qi_compute_api_client-0.7.0.dist-info/RECORD +0 -137
  164. {qi_compute_api_client-0.7.0.dist-info → qi_compute_api_client-0.17.0.dist-info}/LICENSE.md +0 -0
  165. {qi_compute_api_client-0.7.0.dist-info → qi_compute_api_client-0.17.0.dist-info}/WHEEL +0 -0
@@ -3,253 +3,95 @@
3
3
  """
4
4
  Quantum Inspire 2
5
5
 
6
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
 
8
8
  The version of the OpenAPI document: 0.1.0
9
- Generated by: https://openapi-generator.tech
10
- """
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
10
 
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
12
13
 
13
- try:
14
- from inspect import getfullargspec
15
- except ImportError:
16
- from inspect import getargspec as getfullargspec
14
+
15
+ from __future__ import annotations
17
16
  import pprint
18
17
  import re # noqa: F401
19
- import six
20
-
21
- from compute_api_client.configuration import Configuration
22
-
18
+ import json
23
19
 
24
- class Commit(object):
25
- """NOTE: This class is auto generated by OpenAPI Generator.
26
- Ref: https://openapi-generator.tech
27
-
28
- Do not edit the class manually.
29
- """
20
+ from datetime import datetime
21
+ from typing import Any, ClassVar, Dict, List
22
+ from pydantic import BaseModel, StrictInt, StrictStr
23
+ from pydantic import Field
24
+ from typing_extensions import Annotated
25
+ try:
26
+ from typing import Self
27
+ except ImportError:
28
+ from typing_extensions import Self
30
29
 
30
+ class Commit(BaseModel):
31
31
  """
32
- Attributes:
33
- openapi_types (dict): The key is attribute name
34
- and the value is attribute type.
35
- attribute_map (dict): The key is attribute name
36
- and the value is json key in definition.
37
- """
38
- openapi_types = {
39
- 'created_on': 'datetime',
40
- 'id': 'int',
41
- 'hash': 'str',
42
- 'description': 'str',
43
- 'algorithm_id': 'int'
32
+ Commit
33
+ """ # noqa: E501
34
+ id: StrictInt
35
+ created_on: datetime
36
+ hash: Annotated[str, Field(strict=True, max_length=32)]
37
+ description: StrictStr
38
+ algorithm_id: StrictInt
39
+ __properties: ClassVar[List[str]] = ["id", "created_on", "hash", "description", "algorithm_id"]
40
+
41
+ model_config = {
42
+ "populate_by_name": True,
43
+ "validate_assignment": True
44
44
  }
45
45
 
46
- attribute_map = {
47
- 'created_on': 'created_on',
48
- 'id': 'id',
49
- 'hash': 'hash',
50
- 'description': 'description',
51
- 'algorithm_id': 'algorithm_id'
52
- }
53
-
54
- def __init__(self, created_on=None, id=None, hash=None, description=None, algorithm_id=None, local_vars_configuration=None): # noqa: E501
55
- """Commit - a model defined in OpenAPI""" # noqa: E501
56
- if local_vars_configuration is None:
57
- local_vars_configuration = Configuration.get_default_copy()
58
- self.local_vars_configuration = local_vars_configuration
59
-
60
- self._created_on = None
61
- self._id = None
62
- self._hash = None
63
- self._description = None
64
- self._algorithm_id = None
65
- self.discriminator = None
66
-
67
- self.created_on = created_on
68
- self.id = id
69
- self.hash = hash
70
- self.description = description
71
- self.algorithm_id = algorithm_id
72
-
73
- @property
74
- def created_on(self):
75
- """Gets the created_on of this Commit. # noqa: E501
76
-
77
-
78
- :return: The created_on of this Commit. # noqa: E501
79
- :rtype: datetime
80
- """
81
- return self._created_on
82
-
83
- @created_on.setter
84
- def created_on(self, created_on):
85
- """Sets the created_on of this Commit.
86
-
87
-
88
- :param created_on: The created_on of this Commit. # noqa: E501
89
- :type created_on: datetime
90
- """
91
- if self.local_vars_configuration.client_side_validation and created_on is None: # noqa: E501
92
- raise ValueError("Invalid value for `created_on`, must not be `None`") # noqa: E501
93
-
94
- self._created_on = created_on
95
46
 
96
- @property
97
- def id(self):
98
- """Gets the id of this Commit. # noqa: E501
47
+ def to_str(self) -> str:
48
+ """Returns the string representation of the model using alias"""
49
+ return pprint.pformat(self.model_dump(by_alias=True))
99
50
 
51
+ def to_json(self) -> str:
52
+ """Returns the JSON representation of the model using alias"""
53
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
+ return json.dumps(self.to_dict())
100
55
 
101
- :return: The id of this Commit. # noqa: E501
102
- :rtype: int
103
- """
104
- return self._id
105
-
106
- @id.setter
107
- def id(self, id):
108
- """Sets the id of this Commit.
109
-
110
-
111
- :param id: The id of this Commit. # noqa: E501
112
- :type id: int
113
- """
114
- if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501
115
- raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
116
- if (self.local_vars_configuration.client_side_validation and
117
- id is not None and id > 2147483647): # noqa: E501
118
- raise ValueError("Invalid value for `id`, must be a value less than or equal to `2147483647`") # noqa: E501
119
- if (self.local_vars_configuration.client_side_validation and
120
- id is not None and id < 1): # noqa: E501
121
- raise ValueError("Invalid value for `id`, must be a value greater than or equal to `1`") # noqa: E501
122
-
123
- self._id = id
124
-
125
- @property
126
- def hash(self):
127
- """Gets the hash of this Commit. # noqa: E501
128
-
129
-
130
- :return: The hash of this Commit. # noqa: E501
131
- :rtype: str
132
- """
133
- return self._hash
134
-
135
- @hash.setter
136
- def hash(self, hash):
137
- """Sets the hash of this Commit.
138
-
139
-
140
- :param hash: The hash of this Commit. # noqa: E501
141
- :type hash: str
142
- """
143
- if self.local_vars_configuration.client_side_validation and hash is None: # noqa: E501
144
- raise ValueError("Invalid value for `hash`, must not be `None`") # noqa: E501
145
- if (self.local_vars_configuration.client_side_validation and
146
- hash is not None and len(hash) > 32):
147
- raise ValueError("Invalid value for `hash`, length must be less than or equal to `32`") # noqa: E501
148
-
149
- self._hash = hash
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Self:
58
+ """Create an instance of Commit from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
150
60
 
151
- @property
152
- def description(self):
153
- """Gets the description of this Commit. # noqa: E501
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
154
63
 
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
155
66
 
156
- :return: The description of this Commit. # noqa: E501
157
- :rtype: str
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
158
70
  """
159
- return self._description
160
-
161
- @description.setter
162
- def description(self, description):
163
- """Sets the description of this Commit.
164
-
165
-
166
- :param description: The description of this Commit. # noqa: E501
167
- :type description: str
168
- """
169
- if self.local_vars_configuration.client_side_validation and description is None: # noqa: E501
170
- raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501
171
-
172
- self._description = description
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude={
74
+ },
75
+ exclude_none=True,
76
+ )
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Dict) -> Self:
81
+ """Create an instance of Commit from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "id": obj.get("id"),
90
+ "created_on": obj.get("created_on"),
91
+ "hash": obj.get("hash"),
92
+ "description": obj.get("description"),
93
+ "algorithm_id": obj.get("algorithm_id")
94
+ })
95
+ return _obj
173
96
 
174
- @property
175
- def algorithm_id(self):
176
- """Gets the algorithm_id of this Commit. # noqa: E501
177
97
 
178
-
179
- :return: The algorithm_id of this Commit. # noqa: E501
180
- :rtype: int
181
- """
182
- return self._algorithm_id
183
-
184
- @algorithm_id.setter
185
- def algorithm_id(self, algorithm_id):
186
- """Sets the algorithm_id of this Commit.
187
-
188
-
189
- :param algorithm_id: The algorithm_id of this Commit. # noqa: E501
190
- :type algorithm_id: int
191
- """
192
- if self.local_vars_configuration.client_side_validation and algorithm_id is None: # noqa: E501
193
- raise ValueError("Invalid value for `algorithm_id`, must not be `None`") # noqa: E501
194
- if (self.local_vars_configuration.client_side_validation and
195
- algorithm_id is not None and algorithm_id > 2147483647): # noqa: E501
196
- raise ValueError("Invalid value for `algorithm_id`, must be a value less than or equal to `2147483647`") # noqa: E501
197
- if (self.local_vars_configuration.client_side_validation and
198
- algorithm_id is not None and algorithm_id < 1): # noqa: E501
199
- raise ValueError("Invalid value for `algorithm_id`, must be a value greater than or equal to `1`") # noqa: E501
200
-
201
- self._algorithm_id = algorithm_id
202
-
203
- def to_dict(self, serialize=False):
204
- """Returns the model properties as a dict"""
205
- result = {}
206
-
207
- def convert(x):
208
- if hasattr(x, "to_dict"):
209
- args = getfullargspec(x.to_dict).args
210
- if len(args) == 1:
211
- return x.to_dict()
212
- else:
213
- return x.to_dict(serialize)
214
- else:
215
- return x
216
-
217
- for attr, _ in six.iteritems(self.openapi_types):
218
- value = getattr(self, attr)
219
- attr = self.attribute_map.get(attr, attr) if serialize else attr
220
- if isinstance(value, list):
221
- result[attr] = list(map(
222
- lambda x: convert(x),
223
- value
224
- ))
225
- elif isinstance(value, dict):
226
- result[attr] = dict(map(
227
- lambda item: (item[0], convert(item[1])),
228
- value.items()
229
- ))
230
- else:
231
- result[attr] = convert(value)
232
-
233
- return result
234
-
235
- def to_str(self):
236
- """Returns the string representation of the model"""
237
- return pprint.pformat(self.to_dict())
238
-
239
- def __repr__(self):
240
- """For `print` and `pprint`"""
241
- return self.to_str()
242
-
243
- def __eq__(self, other):
244
- """Returns true if both objects are equal"""
245
- if not isinstance(other, Commit):
246
- return False
247
-
248
- return self.to_dict() == other.to_dict()
249
-
250
- def __ne__(self, other):
251
- """Returns true if both objects are not equal"""
252
- if not isinstance(other, Commit):
253
- return True
254
-
255
- return self.to_dict() != other.to_dict()
@@ -3,193 +3,91 @@
3
3
  """
4
4
  Quantum Inspire 2
5
5
 
6
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
 
8
8
  The version of the OpenAPI document: 0.1.0
9
- Generated by: https://openapi-generator.tech
10
- """
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
10
 
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
12
13
 
13
- try:
14
- from inspect import getfullargspec
15
- except ImportError:
16
- from inspect import getargspec as getfullargspec
14
+
15
+ from __future__ import annotations
17
16
  import pprint
18
17
  import re # noqa: F401
19
- import six
18
+ import json
20
19
 
21
- from compute_api_client.configuration import Configuration
22
20
 
21
+ from typing import Any, ClassVar, Dict, List
22
+ from pydantic import BaseModel, StrictInt, StrictStr
23
+ from pydantic import Field
24
+ from typing_extensions import Annotated
25
+ try:
26
+ from typing import Self
27
+ except ImportError:
28
+ from typing_extensions import Self
23
29
 
24
- class CommitIn(object):
25
- """NOTE: This class is auto generated by OpenAPI Generator.
26
- Ref: https://openapi-generator.tech
27
-
28
- Do not edit the class manually.
29
- """
30
-
30
+ class CommitIn(BaseModel):
31
31
  """
32
- Attributes:
33
- openapi_types (dict): The key is attribute name
34
- and the value is attribute type.
35
- attribute_map (dict): The key is attribute name
36
- and the value is json key in definition.
37
- """
38
- openapi_types = {
39
- 'hash': 'str',
40
- 'description': 'str',
41
- 'algorithm_id': 'int'
42
- }
43
-
44
- attribute_map = {
45
- 'hash': 'hash',
46
- 'description': 'description',
47
- 'algorithm_id': 'algorithm_id'
32
+ CommitIn
33
+ """ # noqa: E501
34
+ hash: Annotated[str, Field(strict=True, max_length=32)]
35
+ description: StrictStr
36
+ algorithm_id: StrictInt
37
+ __properties: ClassVar[List[str]] = ["hash", "description", "algorithm_id"]
38
+
39
+ model_config = {
40
+ "populate_by_name": True,
41
+ "validate_assignment": True
48
42
  }
49
43
 
50
- def __init__(self, hash=None, description=None, algorithm_id=None, local_vars_configuration=None): # noqa: E501
51
- """CommitIn - a model defined in OpenAPI""" # noqa: E501
52
- if local_vars_configuration is None:
53
- local_vars_configuration = Configuration.get_default_copy()
54
- self.local_vars_configuration = local_vars_configuration
55
-
56
- self._hash = None
57
- self._description = None
58
- self._algorithm_id = None
59
- self.discriminator = None
60
44
 
61
- self.hash = hash
62
- self.description = description
63
- self.algorithm_id = algorithm_id
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
64
48
 
65
- @property
66
- def hash(self):
67
- """Gets the hash of this CommitIn. # noqa: E501
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
68
53
 
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Self:
56
+ """Create an instance of CommitIn from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
69
58
 
70
- :return: The hash of this CommitIn. # noqa: E501
71
- :rtype: str
72
- """
73
- return self._hash
74
-
75
- @hash.setter
76
- def hash(self, hash):
77
- """Sets the hash of this CommitIn.
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
78
61
 
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
79
64
 
80
- :param hash: The hash of this CommitIn. # noqa: E501
81
- :type hash: str
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
82
68
  """
83
- if self.local_vars_configuration.client_side_validation and hash is None: # noqa: E501
84
- raise ValueError("Invalid value for `hash`, must not be `None`") # noqa: E501
85
- if (self.local_vars_configuration.client_side_validation and
86
- hash is not None and len(hash) > 32):
87
- raise ValueError("Invalid value for `hash`, length must be less than or equal to `32`") # noqa: E501
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude={
72
+ },
73
+ exclude_none=True,
74
+ )
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Dict) -> Self:
79
+ """Create an instance of CommitIn from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ _obj = cls.model_validate({
87
+ "hash": obj.get("hash"),
88
+ "description": obj.get("description"),
89
+ "algorithm_id": obj.get("algorithm_id")
90
+ })
91
+ return _obj
88
92
 
89
- self._hash = hash
90
93
 
91
- @property
92
- def description(self):
93
- """Gets the description of this CommitIn. # noqa: E501
94
-
95
-
96
- :return: The description of this CommitIn. # noqa: E501
97
- :rtype: str
98
- """
99
- return self._description
100
-
101
- @description.setter
102
- def description(self, description):
103
- """Sets the description of this CommitIn.
104
-
105
-
106
- :param description: The description of this CommitIn. # noqa: E501
107
- :type description: str
108
- """
109
- if self.local_vars_configuration.client_side_validation and description is None: # noqa: E501
110
- raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501
111
-
112
- self._description = description
113
-
114
- @property
115
- def algorithm_id(self):
116
- """Gets the algorithm_id of this CommitIn. # noqa: E501
117
-
118
-
119
- :return: The algorithm_id of this CommitIn. # noqa: E501
120
- :rtype: int
121
- """
122
- return self._algorithm_id
123
-
124
- @algorithm_id.setter
125
- def algorithm_id(self, algorithm_id):
126
- """Sets the algorithm_id of this CommitIn.
127
-
128
-
129
- :param algorithm_id: The algorithm_id of this CommitIn. # noqa: E501
130
- :type algorithm_id: int
131
- """
132
- if self.local_vars_configuration.client_side_validation and algorithm_id is None: # noqa: E501
133
- raise ValueError("Invalid value for `algorithm_id`, must not be `None`") # noqa: E501
134
- if (self.local_vars_configuration.client_side_validation and
135
- algorithm_id is not None and algorithm_id > 2147483647): # noqa: E501
136
- raise ValueError("Invalid value for `algorithm_id`, must be a value less than or equal to `2147483647`") # noqa: E501
137
- if (self.local_vars_configuration.client_side_validation and
138
- algorithm_id is not None and algorithm_id < 1): # noqa: E501
139
- raise ValueError("Invalid value for `algorithm_id`, must be a value greater than or equal to `1`") # noqa: E501
140
-
141
- self._algorithm_id = algorithm_id
142
-
143
- def to_dict(self, serialize=False):
144
- """Returns the model properties as a dict"""
145
- result = {}
146
-
147
- def convert(x):
148
- if hasattr(x, "to_dict"):
149
- args = getfullargspec(x.to_dict).args
150
- if len(args) == 1:
151
- return x.to_dict()
152
- else:
153
- return x.to_dict(serialize)
154
- else:
155
- return x
156
-
157
- for attr, _ in six.iteritems(self.openapi_types):
158
- value = getattr(self, attr)
159
- attr = self.attribute_map.get(attr, attr) if serialize else attr
160
- if isinstance(value, list):
161
- result[attr] = list(map(
162
- lambda x: convert(x),
163
- value
164
- ))
165
- elif isinstance(value, dict):
166
- result[attr] = dict(map(
167
- lambda item: (item[0], convert(item[1])),
168
- value.items()
169
- ))
170
- else:
171
- result[attr] = convert(value)
172
-
173
- return result
174
-
175
- def to_str(self):
176
- """Returns the string representation of the model"""
177
- return pprint.pformat(self.to_dict())
178
-
179
- def __repr__(self):
180
- """For `print` and `pprint`"""
181
- return self.to_str()
182
-
183
- def __eq__(self, other):
184
- """Returns true if both objects are equal"""
185
- if not isinstance(other, CommitIn):
186
- return False
187
-
188
- return self.to_dict() == other.to_dict()
189
-
190
- def __ne__(self, other):
191
- """Returns true if both objects are not equal"""
192
- if not isinstance(other, CommitIn):
193
- return True
194
-
195
- return self.to_dict() != other.to_dict()