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,14 +3,13 @@
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
- """
11
-
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
10
 
13
- import six
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
14
13
 
15
14
 
16
15
  class OpenApiException(Exception):
@@ -19,7 +18,7 @@ class OpenApiException(Exception):
19
18
 
20
19
  class ApiTypeError(OpenApiException, TypeError):
21
20
  def __init__(self, msg, path_to_item=None, valid_classes=None,
22
- key_type=None):
21
+ key_type=None) -> None:
23
22
  """ Raises an exception for TypeErrors
24
23
 
25
24
  Args:
@@ -47,7 +46,7 @@ class ApiTypeError(OpenApiException, TypeError):
47
46
 
48
47
 
49
48
  class ApiValueError(OpenApiException, ValueError):
50
- def __init__(self, msg, path_to_item=None):
49
+ def __init__(self, msg, path_to_item=None) -> None:
51
50
  """
52
51
  Args:
53
52
  msg (str): the exception message
@@ -65,7 +64,7 @@ class ApiValueError(OpenApiException, ValueError):
65
64
 
66
65
 
67
66
  class ApiAttributeError(OpenApiException, AttributeError):
68
- def __init__(self, msg, path_to_item=None):
67
+ def __init__(self, msg, path_to_item=None) -> None:
69
68
  """
70
69
  Raised when an attribute reference or assignment fails.
71
70
 
@@ -84,7 +83,7 @@ class ApiAttributeError(OpenApiException, AttributeError):
84
83
 
85
84
 
86
85
  class ApiKeyError(OpenApiException, KeyError):
87
- def __init__(self, msg, path_to_item=None):
86
+ def __init__(self, msg, path_to_item=None) -> None:
88
87
  """
89
88
  Args:
90
89
  msg (str): the exception message
@@ -102,11 +101,11 @@ class ApiKeyError(OpenApiException, KeyError):
102
101
 
103
102
  class ApiException(OpenApiException):
104
103
 
105
- def __init__(self, status=None, reason=None, http_resp=None):
104
+ def __init__(self, status=None, reason=None, http_resp=None) -> None:
106
105
  if http_resp:
107
106
  self.status = http_resp.status
108
107
  self.reason = http_resp.reason
109
- self.body = http_resp.data
108
+ self.body = http_resp.data.decode('utf-8')
110
109
  self.headers = http_resp.getheaders()
111
110
  else:
112
111
  self.status = status
@@ -127,28 +126,32 @@ class ApiException(OpenApiException):
127
126
 
128
127
  return error_message
129
128
 
129
+ class BadRequestException(ApiException):
130
+
131
+ def __init__(self, status=None, reason=None, http_resp=None) -> None:
132
+ super(BadRequestException, self).__init__(status, reason, http_resp)
130
133
 
131
134
  class NotFoundException(ApiException):
132
135
 
133
- def __init__(self, status=None, reason=None, http_resp=None):
136
+ def __init__(self, status=None, reason=None, http_resp=None) -> None:
134
137
  super(NotFoundException, self).__init__(status, reason, http_resp)
135
138
 
136
139
 
137
140
  class UnauthorizedException(ApiException):
138
141
 
139
- def __init__(self, status=None, reason=None, http_resp=None):
142
+ def __init__(self, status=None, reason=None, http_resp=None) -> None:
140
143
  super(UnauthorizedException, self).__init__(status, reason, http_resp)
141
144
 
142
145
 
143
146
  class ForbiddenException(ApiException):
144
147
 
145
- def __init__(self, status=None, reason=None, http_resp=None):
148
+ def __init__(self, status=None, reason=None, http_resp=None) -> None:
146
149
  super(ForbiddenException, self).__init__(status, reason, http_resp)
147
150
 
148
151
 
149
152
  class ServiceException(ApiException):
150
153
 
151
- def __init__(self, status=None, reason=None, http_resp=None):
154
+ def __init__(self, status=None, reason=None, http_resp=None) -> None:
152
155
  super(ServiceException, self).__init__(status, reason, http_resp)
153
156
 
154
157
 
@@ -156,7 +159,7 @@ def render_path(path_to_item):
156
159
  """Returns a string representation of a path"""
157
160
  result = ""
158
161
  for pth in path_to_item:
159
- if isinstance(pth, six.integer_types):
162
+ if isinstance(pth, int):
160
163
  result += "[{0}]".format(pth)
161
164
  else:
162
165
  result += "['{0}']".format(pth)
@@ -4,22 +4,27 @@
4
4
  """
5
5
  Quantum Inspire 2
6
6
 
7
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
7
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
8
8
 
9
9
  The version of the OpenAPI document: 0.1.0
10
- Generated by: https://openapi-generator.tech
11
- """
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
11
 
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
13
14
 
14
- from __future__ import absolute_import
15
15
 
16
16
  # import models into model package
17
17
  from compute_api_client.models.algorithm import Algorithm
18
18
  from compute_api_client.models.algorithm_in import AlgorithmIn
19
19
  from compute_api_client.models.algorithm_type import AlgorithmType
20
- from compute_api_client.models.batch_run import BatchRun
21
- from compute_api_client.models.batch_run_in import BatchRunIn
22
- from compute_api_client.models.batch_run_status import BatchRunStatus
20
+ from compute_api_client.models.backend import Backend
21
+ from compute_api_client.models.backend_patch import BackendPatch
22
+ from compute_api_client.models.backend_status import BackendStatus
23
+ from compute_api_client.models.backend_type import BackendType
24
+ from compute_api_client.models.backend_with_authentication import BackendWithAuthentication
25
+ from compute_api_client.models.batch_job import BatchJob
26
+ from compute_api_client.models.batch_job_in import BatchJobIn
27
+ from compute_api_client.models.batch_job_status import BatchJobStatus
23
28
  from compute_api_client.models.commit import Commit
24
29
  from compute_api_client.models.commit_in import CommitIn
25
30
  from compute_api_client.models.compile_stage import CompileStage
@@ -30,6 +35,10 @@ from compute_api_client.models.final_result import FinalResult
30
35
  from compute_api_client.models.final_result_in import FinalResultIn
31
36
  from compute_api_client.models.http_not_found_error import HTTPNotFoundError
32
37
  from compute_api_client.models.http_validation_error import HTTPValidationError
38
+ from compute_api_client.models.job import Job
39
+ from compute_api_client.models.job_in import JobIn
40
+ from compute_api_client.models.job_patch import JobPatch
41
+ from compute_api_client.models.job_status import JobStatus
33
42
  from compute_api_client.models.language import Language
34
43
  from compute_api_client.models.location_inner import LocationInner
35
44
  from compute_api_client.models.member import Member
@@ -46,13 +55,6 @@ from compute_api_client.models.reservation_in import ReservationIn
46
55
  from compute_api_client.models.result import Result
47
56
  from compute_api_client.models.result_in import ResultIn
48
57
  from compute_api_client.models.role import Role
49
- from compute_api_client.models.run import Run
50
- from compute_api_client.models.run_in import RunIn
51
- from compute_api_client.models.run_status import RunStatus
52
- from compute_api_client.models.runtime import Runtime
53
- from compute_api_client.models.runtime_status import RuntimeStatus
54
- from compute_api_client.models.runtime_type import RuntimeType
55
- from compute_api_client.models.runtime_with_authentication import RuntimeWithAuthentication
56
58
  from compute_api_client.models.share_type import ShareType
57
59
  from compute_api_client.models.team import Team
58
60
  from compute_api_client.models.transaction import Transaction
@@ -3,261 +3,102 @@
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
18
+ import json
22
19
 
23
20
 
24
- class Algorithm(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
- """
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from pydantic import BaseModel, StrictInt
23
+ from pydantic import Field
24
+ from typing_extensions import Annotated
25
+ from compute_api_client.models.algorithm_type import AlgorithmType
26
+ from compute_api_client.models.share_type import ShareType
27
+ try:
28
+ from typing import Self
29
+ except ImportError:
30
+ from typing_extensions import Self
30
31
 
32
+ class Algorithm(BaseModel):
31
33
  """
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
- 'id': 'int',
40
- 'type': 'AlgorithmType',
41
- 'shared': 'ShareType',
42
- 'link': 'str',
43
- 'project_id': 'int'
34
+ Algorithm
35
+ """ # noqa: E501
36
+ id: StrictInt
37
+ project_id: StrictInt
38
+ type: AlgorithmType
39
+ shared: ShareType
40
+ link: Optional[Annotated[str, Field(strict=True, max_length=255)]]
41
+ __properties: ClassVar[List[str]] = ["id", "project_id", "type", "shared", "link"]
42
+
43
+ model_config = {
44
+ "populate_by_name": True,
45
+ "validate_assignment": True
44
46
  }
45
47
 
46
- attribute_map = {
47
- 'id': 'id',
48
- 'type': 'type',
49
- 'shared': 'shared',
50
- 'link': 'link',
51
- 'project_id': 'project_id'
52
- }
53
-
54
- def __init__(self, id=None, type=None, shared=None, link=None, project_id=None, local_vars_configuration=None): # noqa: E501
55
- """Algorithm - a model defined in OpenAPI""" # noqa: E501
56
- if local_vars_configuration is None:
57
- local_vars_configuration = Configuration.get_default_copy()
58
- self.local_vars_configuration = local_vars_configuration
59
-
60
- self._id = None
61
- self._type = None
62
- self._shared = None
63
- self._link = None
64
- self._project_id = None
65
- self.discriminator = None
66
-
67
- self.id = id
68
- self.type = type
69
- self.shared = shared
70
- self.link = link
71
- self.project_id = project_id
72
-
73
- @property
74
- def id(self):
75
- """Gets the id of this Algorithm. # noqa: E501
76
-
77
-
78
- :return: The id of this Algorithm. # noqa: E501
79
- :rtype: int
80
- """
81
- return self._id
82
-
83
- @id.setter
84
- def id(self, id):
85
- """Sets the id of this Algorithm.
86
-
87
-
88
- :param id: The id of this Algorithm. # noqa: E501
89
- :type id: int
90
- """
91
- if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501
92
- raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
93
- if (self.local_vars_configuration.client_side_validation and
94
- id is not None and id > 2147483647): # noqa: E501
95
- raise ValueError("Invalid value for `id`, must be a value less than or equal to `2147483647`") # noqa: E501
96
- if (self.local_vars_configuration.client_side_validation and
97
- id is not None and id < 1): # noqa: E501
98
- raise ValueError("Invalid value for `id`, must be a value greater than or equal to `1`") # noqa: E501
99
-
100
- self._id = id
101
-
102
- @property
103
- def type(self):
104
- """Gets the type of this Algorithm. # noqa: E501
105
-
106
- HYBRID: hybrid<br/>QUANTUM: quantum # noqa: E501
107
-
108
- :return: The type of this Algorithm. # noqa: E501
109
- :rtype: AlgorithmType
110
- """
111
- return self._type
112
-
113
- @type.setter
114
- def type(self, type):
115
- """Sets the type of this Algorithm.
116
-
117
- HYBRID: hybrid<br/>QUANTUM: quantum # noqa: E501
118
48
 
119
- :param type: The type of this Algorithm. # noqa: E501
120
- :type type: AlgorithmType
121
- """
122
- if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501
123
- raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
124
- if (self.local_vars_configuration.client_side_validation and
125
- type is not None and len(type) > 7):
126
- raise ValueError("Invalid value for `type`, length must be less than or equal to `7`") # noqa: E501
127
-
128
- self._type = type
129
-
130
- @property
131
- def shared(self):
132
- """Gets the shared of this Algorithm. # noqa: E501
133
-
134
- PRIVATE: private<br/>LINK_ONLY: link_only<br/>TEAM: team # noqa: E501
135
-
136
- :return: The shared of this Algorithm. # noqa: E501
137
- :rtype: ShareType
138
- """
139
- return self._shared
140
-
141
- @shared.setter
142
- def shared(self, shared):
143
- """Sets the shared of this Algorithm.
144
-
145
- PRIVATE: private<br/>LINK_ONLY: link_only<br/>TEAM: team # noqa: E501
146
-
147
- :param shared: The shared of this Algorithm. # noqa: E501
148
- :type shared: ShareType
149
- """
150
- if self.local_vars_configuration.client_side_validation and shared is None: # noqa: E501
151
- raise ValueError("Invalid value for `shared`, must not be `None`") # noqa: E501
152
- if (self.local_vars_configuration.client_side_validation and
153
- shared is not None and len(shared) > 9):
154
- raise ValueError("Invalid value for `shared`, length must be less than or equal to `9`") # noqa: E501
155
-
156
- self._shared = shared
157
-
158
- @property
159
- def link(self):
160
- """Gets the link of this Algorithm. # noqa: E501
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.model_dump(by_alias=True))
161
52
 
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
+ return json.dumps(self.to_dict())
162
57
 
163
- :return: The link of this Algorithm. # noqa: E501
164
- :rtype: str
165
- """
166
- return self._link
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Self:
60
+ """Create an instance of Algorithm from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
167
62
 
168
- @link.setter
169
- def link(self, link):
170
- """Sets the link of this Algorithm.
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
171
65
 
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
172
68
 
173
- :param link: The link of this Algorithm. # noqa: E501
174
- :type link: str
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
175
72
  """
176
- if (self.local_vars_configuration.client_side_validation and
177
- link is not None and len(link) > 255):
178
- raise ValueError("Invalid value for `link`, length must be less than or equal to `255`") # noqa: E501
179
-
180
- self._link = link
181
-
182
- @property
183
- def project_id(self):
184
- """Gets the project_id of this Algorithm. # noqa: E501
185
-
186
-
187
- :return: The project_id of this Algorithm. # noqa: E501
188
- :rtype: int
189
- """
190
- return self._project_id
191
-
192
- @project_id.setter
193
- def project_id(self, project_id):
194
- """Sets the project_id of this Algorithm.
195
-
196
-
197
- :param project_id: The project_id of this Algorithm. # noqa: E501
198
- :type project_id: int
199
- """
200
- if self.local_vars_configuration.client_side_validation and project_id is None: # noqa: E501
201
- raise ValueError("Invalid value for `project_id`, must not be `None`") # noqa: E501
202
- if (self.local_vars_configuration.client_side_validation and
203
- project_id is not None and project_id > 2147483647): # noqa: E501
204
- raise ValueError("Invalid value for `project_id`, must be a value less than or equal to `2147483647`") # noqa: E501
205
- if (self.local_vars_configuration.client_side_validation and
206
- project_id is not None and project_id < 1): # noqa: E501
207
- raise ValueError("Invalid value for `project_id`, must be a value greater than or equal to `1`") # noqa: E501
208
-
209
- self._project_id = project_id
210
-
211
- def to_dict(self, serialize=False):
212
- """Returns the model properties as a dict"""
213
- result = {}
214
-
215
- def convert(x):
216
- if hasattr(x, "to_dict"):
217
- args = getfullargspec(x.to_dict).args
218
- if len(args) == 1:
219
- return x.to_dict()
220
- else:
221
- return x.to_dict(serialize)
222
- else:
223
- return x
224
-
225
- for attr, _ in six.iteritems(self.openapi_types):
226
- value = getattr(self, attr)
227
- attr = self.attribute_map.get(attr, attr) if serialize else attr
228
- if isinstance(value, list):
229
- result[attr] = list(map(
230
- lambda x: convert(x),
231
- value
232
- ))
233
- elif isinstance(value, dict):
234
- result[attr] = dict(map(
235
- lambda item: (item[0], convert(item[1])),
236
- value.items()
237
- ))
238
- else:
239
- result[attr] = convert(value)
240
-
241
- return result
242
-
243
- def to_str(self):
244
- """Returns the string representation of the model"""
245
- return pprint.pformat(self.to_dict())
246
-
247
- def __repr__(self):
248
- """For `print` and `pprint`"""
249
- return self.to_str()
250
-
251
- def __eq__(self, other):
252
- """Returns true if both objects are equal"""
253
- if not isinstance(other, Algorithm):
254
- return False
255
-
256
- return self.to_dict() == other.to_dict()
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude={
76
+ },
77
+ exclude_none=True,
78
+ )
79
+ # set to None if link (nullable) is None
80
+ # and model_fields_set contains the field
81
+ if self.link is None and "link" in self.model_fields_set:
82
+ _dict['link'] = None
83
+
84
+ return _dict
85
+
86
+ @classmethod
87
+ def from_dict(cls, obj: Dict) -> Self:
88
+ """Create an instance of Algorithm from a dict"""
89
+ if obj is None:
90
+ return None
91
+
92
+ if not isinstance(obj, dict):
93
+ return cls.model_validate(obj)
94
+
95
+ _obj = cls.model_validate({
96
+ "id": obj.get("id"),
97
+ "project_id": obj.get("project_id"),
98
+ "type": obj.get("type"),
99
+ "shared": obj.get("shared"),
100
+ "link": obj.get("link")
101
+ })
102
+ return _obj
257
103
 
258
- def __ne__(self, other):
259
- """Returns true if both objects are not equal"""
260
- if not isinstance(other, Algorithm):
261
- return True
262
104
 
263
- return self.to_dict() != other.to_dict()