gamsapi 52.2.0__cp314-cp314-win_amd64.whl → 52.4.0__cp314-cp314-win_amd64.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.
Files changed (294) hide show
  1. gams/__init__.py +2 -2
  2. gams/_version.py +1 -1
  3. gams/connect/__init__.py +2 -2
  4. gams/connect/agents/__init__.py +2 -2
  5. gams/connect/agents/_excel/__init__.py +2 -2
  6. gams/connect/agents/_excel/excelagent.py +2 -2
  7. gams/connect/agents/_excel/workbook.py +2 -2
  8. gams/connect/agents/_sqlconnectors/__init__.py +2 -2
  9. gams/connect/agents/_sqlconnectors/_accesshandler.py +2 -2
  10. gams/connect/agents/_sqlconnectors/_databasehandler.py +2 -2
  11. gams/connect/agents/_sqlconnectors/_mysqlhandler.py +2 -2
  12. gams/connect/agents/_sqlconnectors/_postgreshandler.py +2 -2
  13. gams/connect/agents/_sqlconnectors/_pyodbchandler.py +2 -2
  14. gams/connect/agents/_sqlconnectors/_sqlalchemyhandler.py +2 -2
  15. gams/connect/agents/_sqlconnectors/_sqlitehandler.py +2 -2
  16. gams/connect/agents/_sqlconnectors/_sqlserverhandler.py +2 -2
  17. gams/connect/agents/concatenate.py +2 -2
  18. gams/connect/agents/connectagent.py +2 -2
  19. gams/connect/agents/csvreader.py +2 -2
  20. gams/connect/agents/csvwriter.py +2 -2
  21. gams/connect/agents/domainwriter.py +2 -2
  22. gams/connect/agents/excelreader.py +2 -2
  23. gams/connect/agents/excelwriter.py +2 -2
  24. gams/connect/agents/filter.py +2 -2
  25. gams/connect/agents/gamsreader.py +2 -2
  26. gams/connect/agents/gamswriter.py +2 -2
  27. gams/connect/agents/gdxreader.py +2 -2
  28. gams/connect/agents/gdxwriter.py +2 -2
  29. gams/connect/agents/labelmanipulator.py +2 -2
  30. gams/connect/agents/projection.py +2 -2
  31. gams/connect/agents/pythoncode.py +2 -2
  32. gams/connect/agents/rawcsvreader.py +2 -2
  33. gams/connect/agents/rawexcelreader.py +2 -2
  34. gams/connect/agents/sqlreader.py +2 -2
  35. gams/connect/agents/sqlwriter.py +2 -2
  36. gams/connect/connectdatabase.py +2 -2
  37. gams/connect/connectvalidator.py +2 -2
  38. gams/connect/errors.py +2 -2
  39. gams/control/__init__.py +2 -2
  40. gams/control/database.py +2 -2
  41. gams/control/execution.py +2 -2
  42. gams/control/options.py +2 -2
  43. gams/control/workspace.py +2 -2
  44. gams/core/__init__.py +2 -2
  45. gams/core/cfg/__init__.py +2 -2
  46. gams/core/cfg/_cfgmcc.cp314-win_amd64.pyd +0 -0
  47. gams/core/dct/__init__.py +2 -2
  48. gams/core/dct/_dctmcc.cp314-win_amd64.pyd +0 -0
  49. gams/core/embedded/__init__.py +2 -2
  50. gams/core/embedded/gamsemb.py +2 -2
  51. gams/core/emp/__init__.py +2 -2
  52. gams/core/emp/emplexer.py +2 -2
  53. gams/core/emp/empyacc.py +2 -2
  54. gams/core/gdx/__init__.py +2 -2
  55. gams/core/gdx/_gdxcc.cp314-win_amd64.pyd +0 -0
  56. gams/core/gev/__init__.py +2 -2
  57. gams/core/gev/_gevmcc.cp314-win_amd64.pyd +0 -0
  58. gams/core/gmd/__init__.py +2 -2
  59. gams/core/gmd/_gmdcc.cp314-win_amd64.pyd +0 -0
  60. gams/core/gmo/__init__.py +2 -2
  61. gams/core/gmo/_gmomcc.cp314-win_amd64.pyd +0 -0
  62. gams/core/idx/__init__.py +2 -2
  63. gams/core/idx/_idxcc.cp314-win_amd64.pyd +0 -0
  64. gams/core/numpy/__init__.py +2 -2
  65. gams/core/numpy/_gams2numpy.cp314-win_amd64.pyd +0 -0
  66. gams/core/numpy/gams2numpy.py +2 -2
  67. gams/core/opt/__init__.py +2 -2
  68. gams/core/opt/_optcc.cp314-win_amd64.pyd +0 -0
  69. gams/engine/__init__.py +193 -16
  70. gams/engine/api/__init__.py +13 -3
  71. gams/engine/api/auth_api.py +7545 -3618
  72. gams/engine/api/cleanup_api.py +712 -320
  73. gams/engine/api/default_api.py +838 -369
  74. gams/engine/api/hypercube_api.py +2576 -1198
  75. gams/engine/api/jobs_api.py +5170 -2458
  76. gams/engine/api/licenses_api.py +2170 -1014
  77. gams/engine/api/namespaces_api.py +7663 -3557
  78. gams/engine/api/usage_api.py +5575 -1867
  79. gams/engine/api/users_api.py +5880 -2382
  80. gams/engine/api_client.py +579 -641
  81. gams/engine/api_response.py +21 -0
  82. gams/engine/configuration.py +233 -102
  83. gams/engine/exceptions.py +86 -29
  84. gams/engine/models/__init__.py +83 -68
  85. gams/engine/models/bad_input.py +89 -0
  86. gams/engine/models/cleanable_job_result.py +104 -0
  87. gams/engine/models/cleanable_job_result_page.py +113 -0
  88. gams/engine/models/engine_license.py +107 -0
  89. gams/engine/models/files_not_found.py +93 -0
  90. gams/engine/models/forwarded_token_response.py +112 -0
  91. gams/engine/models/generic_key_value_pair.py +89 -0
  92. gams/engine/models/hypercube.py +160 -0
  93. gams/engine/models/hypercube_page.py +111 -0
  94. gams/engine/models/hypercube_summary.py +91 -0
  95. gams/engine/models/hypercube_token.py +97 -0
  96. gams/engine/models/identity_provider.py +107 -0
  97. gams/engine/models/identity_provider_ldap.py +121 -0
  98. gams/engine/models/identity_provider_oauth2.py +146 -0
  99. gams/engine/models/identity_provider_oauth2_scope.py +89 -0
  100. gams/engine/models/identity_provider_oauth2_with_secret.py +152 -0
  101. gams/engine/models/identity_provider_oidc.py +133 -0
  102. gams/engine/models/identity_provider_oidc_with_secret.py +143 -0
  103. gams/engine/models/inex.py +91 -0
  104. gams/engine/models/invitation.py +136 -0
  105. gams/engine/models/invitation_quota.py +106 -0
  106. gams/engine/models/invitation_token.py +87 -0
  107. gams/engine/models/job.py +165 -0
  108. gams/engine/models/job_no_text_entry.py +138 -0
  109. gams/engine/models/job_no_text_entry_page.py +111 -0
  110. gams/engine/models/license.py +91 -0
  111. gams/engine/models/log_piece.py +96 -0
  112. gams/engine/models/message.py +87 -0
  113. gams/engine/models/message_and_token.py +99 -0
  114. gams/engine/models/message_with_webhook_id.py +89 -0
  115. gams/engine/models/model_auth_token.py +87 -0
  116. gams/engine/models/model_configuration.py +125 -0
  117. gams/engine/models/model_default_instance.py +99 -0
  118. gams/engine/models/model_default_user_instance.py +98 -0
  119. gams/engine/models/model_hypercube_job.py +106 -0
  120. gams/engine/models/model_hypercube_usage.py +130 -0
  121. gams/engine/models/model_instance_info.py +116 -0
  122. gams/engine/models/model_instance_info_full.py +123 -0
  123. gams/engine/models/model_instance_pool_info.py +112 -0
  124. gams/engine/models/model_job_labels.py +179 -0
  125. gams/engine/models/model_job_usage.py +133 -0
  126. gams/engine/models/model_pool_usage.py +124 -0
  127. gams/engine/models/model_usage.py +115 -0
  128. gams/engine/models/model_user.py +96 -0
  129. gams/engine/models/model_userinstance_info.py +119 -0
  130. gams/engine/models/model_userinstancepool_info.py +95 -0
  131. gams/engine/models/model_version.py +91 -0
  132. gams/engine/models/models.py +120 -0
  133. gams/engine/models/namespace.py +104 -0
  134. gams/engine/models/namespace_quota.py +96 -0
  135. gams/engine/models/namespace_with_permission.py +96 -0
  136. gams/engine/models/not_found.py +91 -0
  137. gams/engine/models/password_policy.py +97 -0
  138. gams/engine/models/perm_and_username.py +89 -0
  139. gams/engine/models/quota.py +117 -0
  140. gams/engine/models/quota_exceeded.py +97 -0
  141. gams/engine/models/status_code_meaning.py +89 -0
  142. gams/engine/models/stream_entry.py +89 -0
  143. gams/engine/models/system_wide_license.py +92 -0
  144. gams/engine/models/text_entries.py +87 -0
  145. gams/engine/models/text_entry.py +101 -0
  146. gams/engine/models/time_span.py +95 -0
  147. gams/engine/models/time_span_pool_worker.py +99 -0
  148. gams/engine/models/token_forward_error.py +87 -0
  149. gams/engine/models/user.py +127 -0
  150. gams/engine/models/user_group_member.py +96 -0
  151. gams/engine/models/user_groups.py +108 -0
  152. gams/engine/models/vapid_info.py +87 -0
  153. gams/engine/models/webhook.py +138 -0
  154. gams/engine/models/webhook_parameterized_event.py +99 -0
  155. gams/engine/py.typed +0 -0
  156. gams/engine/rest.py +141 -229
  157. gams/magic/__init__.py +2 -2
  158. gams/magic/gams_magic.py +2 -2
  159. gams/magic/interactive.py +2 -2
  160. gams/tools/__init__.py +2 -2
  161. gams/tools/errors.py +2 -2
  162. gams/tools/toolcollection/__init__.py +2 -2
  163. gams/tools/toolcollection/alg/__init__.py +2 -2
  164. gams/tools/toolcollection/alg/rank.py +2 -2
  165. gams/tools/toolcollection/data/__init__.py +2 -2
  166. gams/tools/toolcollection/data/csvread.py +2 -2
  167. gams/tools/toolcollection/data/exceldump.py +2 -2
  168. gams/tools/toolcollection/data/sqlitewrite.py +2 -2
  169. gams/tools/toolcollection/gdxservice/__init__.py +2 -2
  170. gams/tools/toolcollection/gdxservice/gdxencoding.py +2 -2
  171. gams/tools/toolcollection/gdxservice/gdxrename.py +2 -2
  172. gams/tools/toolcollection/linalg/__init__.py +2 -2
  173. gams/tools/toolcollection/linalg/cholesky.py +2 -2
  174. gams/tools/toolcollection/linalg/eigenvalue.py +2 -2
  175. gams/tools/toolcollection/linalg/eigenvector.py +2 -2
  176. gams/tools/toolcollection/linalg/invert.py +2 -2
  177. gams/tools/toolcollection/linalg/ols.py +2 -2
  178. gams/tools/toolcollection/tooltemplate.py +2 -2
  179. gams/tools/toolcollection/win32/__init__.py +2 -2
  180. gams/tools/toolcollection/win32/excelmerge.py +2 -2
  181. gams/tools/toolcollection/win32/exceltalk.py +2 -2
  182. gams/tools/toolcollection/win32/msappavail.py +2 -2
  183. gams/tools/toolcollection/win32/shellexecute.py +2 -2
  184. gams/tools/tools.py +2 -2
  185. gams/transfer/__init__.py +2 -2
  186. gams/transfer/_abcs/__init__.py +2 -2
  187. gams/transfer/_abcs/container_abcs.py +2 -2
  188. gams/transfer/_internals/__init__.py +2 -2
  189. gams/transfer/_internals/algorithms.py +2 -2
  190. gams/transfer/_internals/casepreservingdict.py +2 -2
  191. gams/transfer/_internals/constants.py +2 -2
  192. gams/transfer/_internals/domainviolation.py +2 -2
  193. gams/transfer/_internals/specialvalues.py +2 -2
  194. gams/transfer/containers/__init__.py +2 -2
  195. gams/transfer/containers/_container.py +2 -2
  196. gams/transfer/containers/_io/__init__.py +2 -2
  197. gams/transfer/containers/_io/containers.py +2 -2
  198. gams/transfer/containers/_io/gdx.py +2 -2
  199. gams/transfer/containers/_io/gmd.py +2 -2
  200. gams/transfer/containers/_mixins/__init__.py +2 -2
  201. gams/transfer/containers/_mixins/ccc.py +2 -2
  202. gams/transfer/syms/__init__.py +2 -2
  203. gams/transfer/syms/_methods/__init__.py +2 -2
  204. gams/transfer/syms/_methods/tables.py +2 -2
  205. gams/transfer/syms/_methods/toDict.py +2 -2
  206. gams/transfer/syms/_methods/toList.py +2 -2
  207. gams/transfer/syms/_methods/toValue.py +2 -2
  208. gams/transfer/syms/_mixins/__init__.py +2 -2
  209. gams/transfer/syms/_mixins/equals.py +2 -2
  210. gams/transfer/syms/_mixins/generateRecords.py +2 -2
  211. gams/transfer/syms/_mixins/pivot.py +2 -2
  212. gams/transfer/syms/_mixins/pve.py +2 -2
  213. gams/transfer/syms/_mixins/sa.py +2 -2
  214. gams/transfer/syms/_mixins/sapve.py +2 -2
  215. gams/transfer/syms/_mixins/saua.py +2 -2
  216. gams/transfer/syms/_mixins/sauapve.py +2 -2
  217. gams/transfer/syms/_mixins/spve.py +2 -2
  218. gams/transfer/syms/_mixins/ve.py +2 -2
  219. gams/transfer/syms/container_syms/__init__.py +2 -2
  220. gams/transfer/syms/container_syms/_alias.py +2 -2
  221. gams/transfer/syms/container_syms/_equation.py +2 -2
  222. gams/transfer/syms/container_syms/_parameter.py +2 -2
  223. gams/transfer/syms/container_syms/_set.py +2 -2
  224. gams/transfer/syms/container_syms/_universe_alias.py +2 -2
  225. gams/transfer/syms/container_syms/_variable.py +2 -2
  226. {gamsapi-52.2.0.dist-info → gamsapi-52.4.0.dist-info}/METADATA +12 -10
  227. gamsapi-52.4.0.dist-info/RECORD +257 -0
  228. {gamsapi-52.2.0.dist-info → gamsapi-52.4.0.dist-info}/licenses/LICENSE +2 -2
  229. gams/engine/apis/__init__.py +0 -25
  230. gams/engine/model/__init__.py +0 -5
  231. gams/engine/model/bad_input.py +0 -259
  232. gams/engine/model/cleanable_job_result.py +0 -285
  233. gams/engine/model/cleanable_job_result_page.py +0 -277
  234. gams/engine/model/engine_license.py +0 -263
  235. gams/engine/model/files_not_found.py +0 -267
  236. gams/engine/model/forwarded_token_response.py +0 -275
  237. gams/engine/model/generic_key_value_pair.py +0 -259
  238. gams/engine/model/hypercube.py +0 -331
  239. gams/engine/model/hypercube_page.py +0 -273
  240. gams/engine/model/hypercube_summary.py +0 -263
  241. gams/engine/model/hypercube_token.py +0 -265
  242. gams/engine/model/identity_provider.py +0 -287
  243. gams/engine/model/identity_provider_ldap.py +0 -303
  244. gams/engine/model/identity_provider_oauth2.py +0 -309
  245. gams/engine/model/identity_provider_oauth2_scope.py +0 -259
  246. gams/engine/model/identity_provider_oauth2_with_secret.py +0 -321
  247. gams/engine/model/identity_provider_oidc.py +0 -299
  248. gams/engine/model/identity_provider_oidc_with_secret.py +0 -319
  249. gams/engine/model/inex.py +0 -259
  250. gams/engine/model/invitation.py +0 -309
  251. gams/engine/model/invitation_quota.py +0 -263
  252. gams/engine/model/invitation_token.py +0 -255
  253. gams/engine/model/job.py +0 -337
  254. gams/engine/model/job_no_text_entry.py +0 -313
  255. gams/engine/model/job_no_text_entry_page.py +0 -273
  256. gams/engine/model/license.py +0 -263
  257. gams/engine/model/log_piece.py +0 -263
  258. gams/engine/model/message.py +0 -255
  259. gams/engine/model/message_and_token.py +0 -269
  260. gams/engine/model/model_auth_token.py +0 -255
  261. gams/engine/model/model_configuration.py +0 -268
  262. gams/engine/model/model_hypercube_job.py +0 -273
  263. gams/engine/model/model_hypercube_usage.py +0 -303
  264. gams/engine/model/model_instance_info.py +0 -285
  265. gams/engine/model/model_instance_info_full.py +0 -289
  266. gams/engine/model/model_job_labels.py +0 -295
  267. gams/engine/model/model_job_usage.py +0 -299
  268. gams/engine/model/model_usage.py +0 -267
  269. gams/engine/model/model_userinstance_info.py +0 -273
  270. gams/engine/model/model_version.py +0 -263
  271. gams/engine/model/models.py +0 -297
  272. gams/engine/model/namespace.py +0 -269
  273. gams/engine/model/namespace_quota.py +0 -263
  274. gams/engine/model/namespace_with_permission.py +0 -263
  275. gams/engine/model/not_found.py +0 -263
  276. gams/engine/model/perm_and_username.py +0 -259
  277. gams/engine/model/quota.py +0 -275
  278. gams/engine/model/quota_exceeded.py +0 -265
  279. gams/engine/model/result_user.py +0 -263
  280. gams/engine/model/status_code_meaning.py +0 -259
  281. gams/engine/model/stream_entry.py +0 -259
  282. gams/engine/model/system_wide_license.py +0 -255
  283. gams/engine/model/text_entries.py +0 -255
  284. gams/engine/model/text_entry.py +0 -263
  285. gams/engine/model/time_span.py +0 -259
  286. gams/engine/model/token_forward_error.py +0 -255
  287. gams/engine/model/user.py +0 -283
  288. gams/engine/model/user_group_member.py +0 -269
  289. gams/engine/model/user_groups.py +0 -279
  290. gams/engine/model/webhook.py +0 -292
  291. gams/engine/model_utils.py +0 -2037
  292. gamsapi-52.2.0.dist-info/RECORD +0 -248
  293. {gamsapi-52.2.0.dist-info → gamsapi-52.4.0.dist-info}/WHEEL +0 -0
  294. {gamsapi-52.2.0.dist-info → gamsapi-52.4.0.dist-info}/top_level.txt +0 -0
gams/engine/exceptions.py CHANGED
@@ -1,13 +1,18 @@
1
+ # coding: utf-8
2
+
1
3
  """
2
4
  GAMS Engine
3
5
 
4
- With GAMS Engine you can register and solve GAMS models. It has a namespace management system, so you can restrict your users to certain models. # noqa: E501
6
+ With GAMS Engine you can register and solve GAMS models. It has a namespace management system, so you can restrict your users to certain models.
5
7
 
6
8
  The version of the OpenAPI document: latest
7
- Generated by: https://openapi-generator.tech
8
- """
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
9
10
 
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
10
13
 
14
+ from typing import Any, Optional
15
+ from typing_extensions import Self
11
16
 
12
17
  class OpenApiException(Exception):
13
18
  """The base exception class for all OpenAPIExceptions"""
@@ -15,7 +20,7 @@ class OpenApiException(Exception):
15
20
 
16
21
  class ApiTypeError(OpenApiException, TypeError):
17
22
  def __init__(self, msg, path_to_item=None, valid_classes=None,
18
- key_type=None):
23
+ key_type=None) -> None:
19
24
  """ Raises an exception for TypeErrors
20
25
 
21
26
  Args:
@@ -43,7 +48,7 @@ class ApiTypeError(OpenApiException, TypeError):
43
48
 
44
49
 
45
50
  class ApiValueError(OpenApiException, ValueError):
46
- def __init__(self, msg, path_to_item=None):
51
+ def __init__(self, msg, path_to_item=None) -> None:
47
52
  """
48
53
  Args:
49
54
  msg (str): the exception message
@@ -61,7 +66,7 @@ class ApiValueError(OpenApiException, ValueError):
61
66
 
62
67
 
63
68
  class ApiAttributeError(OpenApiException, AttributeError):
64
- def __init__(self, msg, path_to_item=None):
69
+ def __init__(self, msg, path_to_item=None) -> None:
65
70
  """
66
71
  Raised when an attribute reference or assignment fails.
67
72
 
@@ -80,7 +85,7 @@ class ApiAttributeError(OpenApiException, AttributeError):
80
85
 
81
86
 
82
87
  class ApiKeyError(OpenApiException, KeyError):
83
- def __init__(self, msg, path_to_item=None):
88
+ def __init__(self, msg, path_to_item=None) -> None:
84
89
  """
85
90
  Args:
86
91
  msg (str): the exception message
@@ -98,17 +103,63 @@ class ApiKeyError(OpenApiException, KeyError):
98
103
 
99
104
  class ApiException(OpenApiException):
100
105
 
101
- def __init__(self, status=None, reason=None, http_resp=None):
106
+ def __init__(
107
+ self,
108
+ status=None,
109
+ reason=None,
110
+ http_resp=None,
111
+ *,
112
+ body: Optional[str] = None,
113
+ data: Optional[Any] = None,
114
+ ) -> None:
115
+ self.status = status
116
+ self.reason = reason
117
+ self.body = body
118
+ self.data = data
119
+ self.headers = None
120
+
102
121
  if http_resp:
103
- self.status = http_resp.status
104
- self.reason = http_resp.reason
105
- self.body = http_resp.data
122
+ if self.status is None:
123
+ self.status = http_resp.status
124
+ if self.reason is None:
125
+ self.reason = http_resp.reason
126
+ if self.body is None:
127
+ try:
128
+ self.body = http_resp.data.decode('utf-8')
129
+ except Exception:
130
+ pass
106
131
  self.headers = http_resp.getheaders()
107
- else:
108
- self.status = status
109
- self.reason = reason
110
- self.body = None
111
- self.headers = None
132
+
133
+ @classmethod
134
+ def from_response(
135
+ cls,
136
+ *,
137
+ http_resp,
138
+ body: Optional[str],
139
+ data: Optional[Any],
140
+ ) -> Self:
141
+ if http_resp.status == 400:
142
+ raise BadRequestException(http_resp=http_resp, body=body, data=data)
143
+
144
+ if http_resp.status == 401:
145
+ raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
146
+
147
+ if http_resp.status == 403:
148
+ raise ForbiddenException(http_resp=http_resp, body=body, data=data)
149
+
150
+ if http_resp.status == 404:
151
+ raise NotFoundException(http_resp=http_resp, body=body, data=data)
152
+
153
+ # Added new conditions for 409 and 422
154
+ if http_resp.status == 409:
155
+ raise ConflictException(http_resp=http_resp, body=body, data=data)
156
+
157
+ if http_resp.status == 422:
158
+ raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
159
+
160
+ if 500 <= http_resp.status <= 599:
161
+ raise ServiceException(http_resp=http_resp, body=body, data=data)
162
+ raise ApiException(http_resp=http_resp, body=body, data=data)
112
163
 
113
164
  def __str__(self):
114
165
  """Custom error messages for exception"""
@@ -118,34 +169,40 @@ class ApiException(OpenApiException):
118
169
  error_message += "HTTP response headers: {0}\n".format(
119
170
  self.headers)
120
171
 
121
- if self.body:
122
- error_message += "HTTP response body: {0}\n".format(self.body)
172
+ if self.data or self.body:
173
+ error_message += "HTTP response body: {0}\n".format(self.data or self.body)
123
174
 
124
175
  return error_message
125
176
 
126
177
 
127
- class NotFoundException(ApiException):
178
+ class BadRequestException(ApiException):
179
+ pass
128
180
 
129
- def __init__(self, status=None, reason=None, http_resp=None):
130
- super(NotFoundException, self).__init__(status, reason, http_resp)
131
181
 
182
+ class NotFoundException(ApiException):
183
+ pass
132
184
 
133
- class UnauthorizedException(ApiException):
134
185
 
135
- def __init__(self, status=None, reason=None, http_resp=None):
136
- super(UnauthorizedException, self).__init__(status, reason, http_resp)
186
+ class UnauthorizedException(ApiException):
187
+ pass
137
188
 
138
189
 
139
190
  class ForbiddenException(ApiException):
140
-
141
- def __init__(self, status=None, reason=None, http_resp=None):
142
- super(ForbiddenException, self).__init__(status, reason, http_resp)
191
+ pass
143
192
 
144
193
 
145
194
  class ServiceException(ApiException):
195
+ pass
196
+
197
+
198
+ class ConflictException(ApiException):
199
+ """Exception for HTTP 409 Conflict."""
200
+ pass
201
+
146
202
 
147
- def __init__(self, status=None, reason=None, http_resp=None):
148
- super(ServiceException, self).__init__(status, reason, http_resp)
203
+ class UnprocessableEntityException(ApiException):
204
+ """Exception for HTTP 422 Unprocessable Entity."""
205
+ pass
149
206
 
150
207
 
151
208
  def render_path(path_to_item):
@@ -1,71 +1,86 @@
1
+ # coding: utf-8
2
+
1
3
  # flake8: noqa
4
+ """
5
+ GAMS Engine
6
+
7
+ With GAMS Engine you can register and solve GAMS models. It has a namespace management system, so you can restrict your users to certain models.
8
+
9
+ The version of the OpenAPI document: latest
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
2
14
 
3
- # import all models into this package
4
- # if you have many models here with many references from one model to another this may
5
- # raise a RecursionError
6
- # to avoid this, import only the models that you directly need like:
7
- # from from gams.engine.model.pet import Pet
8
- # or import this package, but before doing it, use:
9
- # import sys
10
- # sys.setrecursionlimit(n)
15
+ # import models into model package
16
+ from gams.engine.models.bad_input import BadInput
17
+ from gams.engine.models.cleanable_job_result import CleanableJobResult
18
+ from gams.engine.models.cleanable_job_result_page import CleanableJobResultPage
19
+ from gams.engine.models.engine_license import EngineLicense
20
+ from gams.engine.models.files_not_found import FilesNotFound
21
+ from gams.engine.models.forwarded_token_response import ForwardedTokenResponse
22
+ from gams.engine.models.generic_key_value_pair import GenericKeyValuePair
23
+ from gams.engine.models.hypercube import Hypercube
24
+ from gams.engine.models.hypercube_page import HypercubePage
25
+ from gams.engine.models.hypercube_summary import HypercubeSummary
26
+ from gams.engine.models.hypercube_token import HypercubeToken
27
+ from gams.engine.models.identity_provider import IdentityProvider
28
+ from gams.engine.models.identity_provider_ldap import IdentityProviderLdap
29
+ from gams.engine.models.identity_provider_oauth2 import IdentityProviderOauth2
30
+ from gams.engine.models.identity_provider_oauth2_scope import IdentityProviderOauth2Scope
31
+ from gams.engine.models.identity_provider_oauth2_with_secret import IdentityProviderOauth2WithSecret
32
+ from gams.engine.models.identity_provider_oidc import IdentityProviderOidc
33
+ from gams.engine.models.identity_provider_oidc_with_secret import IdentityProviderOidcWithSecret
34
+ from gams.engine.models.inex import Inex
35
+ from gams.engine.models.invitation import Invitation
36
+ from gams.engine.models.invitation_quota import InvitationQuota
37
+ from gams.engine.models.invitation_token import InvitationToken
38
+ from gams.engine.models.job import Job
39
+ from gams.engine.models.job_no_text_entry import JobNoTextEntry
40
+ from gams.engine.models.job_no_text_entry_page import JobNoTextEntryPage
41
+ from gams.engine.models.license import License
42
+ from gams.engine.models.log_piece import LogPiece
43
+ from gams.engine.models.message import Message
44
+ from gams.engine.models.message_and_token import MessageAndToken
45
+ from gams.engine.models.message_with_webhook_id import MessageWithWebhookId
46
+ from gams.engine.models.model_auth_token import ModelAuthToken
47
+ from gams.engine.models.model_configuration import ModelConfiguration
48
+ from gams.engine.models.model_default_instance import ModelDefaultInstance
49
+ from gams.engine.models.model_default_user_instance import ModelDefaultUserInstance
50
+ from gams.engine.models.model_hypercube_job import ModelHypercubeJob
51
+ from gams.engine.models.model_hypercube_usage import ModelHypercubeUsage
52
+ from gams.engine.models.model_instance_info import ModelInstanceInfo
53
+ from gams.engine.models.model_instance_info_full import ModelInstanceInfoFull
54
+ from gams.engine.models.model_instance_pool_info import ModelInstancePoolInfo
55
+ from gams.engine.models.model_job_labels import ModelJobLabels
56
+ from gams.engine.models.model_job_usage import ModelJobUsage
57
+ from gams.engine.models.model_pool_usage import ModelPoolUsage
58
+ from gams.engine.models.model_usage import ModelUsage
59
+ from gams.engine.models.model_user import ModelUser
60
+ from gams.engine.models.model_userinstance_info import ModelUserinstanceInfo
61
+ from gams.engine.models.model_userinstancepool_info import ModelUserinstancepoolInfo
62
+ from gams.engine.models.model_version import ModelVersion
63
+ from gams.engine.models.models import Models
64
+ from gams.engine.models.namespace import Namespace
65
+ from gams.engine.models.namespace_quota import NamespaceQuota
66
+ from gams.engine.models.namespace_with_permission import NamespaceWithPermission
67
+ from gams.engine.models.not_found import NotFound
68
+ from gams.engine.models.password_policy import PasswordPolicy
69
+ from gams.engine.models.perm_and_username import PermAndUsername
70
+ from gams.engine.models.quota import Quota
71
+ from gams.engine.models.quota_exceeded import QuotaExceeded
72
+ from gams.engine.models.status_code_meaning import StatusCodeMeaning
73
+ from gams.engine.models.stream_entry import StreamEntry
74
+ from gams.engine.models.system_wide_license import SystemWideLicense
75
+ from gams.engine.models.text_entries import TextEntries
76
+ from gams.engine.models.text_entry import TextEntry
77
+ from gams.engine.models.time_span import TimeSpan
78
+ from gams.engine.models.time_span_pool_worker import TimeSpanPoolWorker
79
+ from gams.engine.models.token_forward_error import TokenForwardError
80
+ from gams.engine.models.user import User
81
+ from gams.engine.models.user_group_member import UserGroupMember
82
+ from gams.engine.models.user_groups import UserGroups
83
+ from gams.engine.models.vapid_info import VapidInfo
84
+ from gams.engine.models.webhook import Webhook
85
+ from gams.engine.models.webhook_parameterized_event import WebhookParameterizedEvent
11
86
 
12
- from gams.engine.model.bad_input import BadInput
13
- from gams.engine.model.cleanable_job_result import CleanableJobResult
14
- from gams.engine.model.cleanable_job_result_page import CleanableJobResultPage
15
- from gams.engine.model.engine_license import EngineLicense
16
- from gams.engine.model.files_not_found import FilesNotFound
17
- from gams.engine.model.forwarded_token_response import ForwardedTokenResponse
18
- from gams.engine.model.generic_key_value_pair import GenericKeyValuePair
19
- from gams.engine.model.hypercube import Hypercube
20
- from gams.engine.model.hypercube_page import HypercubePage
21
- from gams.engine.model.hypercube_summary import HypercubeSummary
22
- from gams.engine.model.hypercube_token import HypercubeToken
23
- from gams.engine.model.identity_provider import IdentityProvider
24
- from gams.engine.model.identity_provider_ldap import IdentityProviderLdap
25
- from gams.engine.model.identity_provider_oauth2 import IdentityProviderOauth2
26
- from gams.engine.model.identity_provider_oauth2_scope import IdentityProviderOauth2Scope
27
- from gams.engine.model.identity_provider_oauth2_with_secret import IdentityProviderOauth2WithSecret
28
- from gams.engine.model.identity_provider_oidc import IdentityProviderOidc
29
- from gams.engine.model.identity_provider_oidc_with_secret import IdentityProviderOidcWithSecret
30
- from gams.engine.model.inex import Inex
31
- from gams.engine.model.invitation import Invitation
32
- from gams.engine.model.invitation_quota import InvitationQuota
33
- from gams.engine.model.invitation_token import InvitationToken
34
- from gams.engine.model.job import Job
35
- from gams.engine.model.job_no_text_entry import JobNoTextEntry
36
- from gams.engine.model.job_no_text_entry_page import JobNoTextEntryPage
37
- from gams.engine.model.license import License
38
- from gams.engine.model.log_piece import LogPiece
39
- from gams.engine.model.message import Message
40
- from gams.engine.model.message_and_token import MessageAndToken
41
- from gams.engine.model.model_auth_token import ModelAuthToken
42
- from gams.engine.model.model_configuration import ModelConfiguration
43
- from gams.engine.model.model_hypercube_job import ModelHypercubeJob
44
- from gams.engine.model.model_hypercube_usage import ModelHypercubeUsage
45
- from gams.engine.model.model_instance_info import ModelInstanceInfo
46
- from gams.engine.model.model_instance_info_full import ModelInstanceInfoFull
47
- from gams.engine.model.model_job_labels import ModelJobLabels
48
- from gams.engine.model.model_job_usage import ModelJobUsage
49
- from gams.engine.model.model_usage import ModelUsage
50
- from gams.engine.model.model_userinstance_info import ModelUserinstanceInfo
51
- from gams.engine.model.model_version import ModelVersion
52
- from gams.engine.model.models import Models
53
- from gams.engine.model.namespace import Namespace
54
- from gams.engine.model.namespace_quota import NamespaceQuota
55
- from gams.engine.model.namespace_with_permission import NamespaceWithPermission
56
- from gams.engine.model.not_found import NotFound
57
- from gams.engine.model.perm_and_username import PermAndUsername
58
- from gams.engine.model.quota import Quota
59
- from gams.engine.model.quota_exceeded import QuotaExceeded
60
- from gams.engine.model.result_user import ResultUser
61
- from gams.engine.model.status_code_meaning import StatusCodeMeaning
62
- from gams.engine.model.stream_entry import StreamEntry
63
- from gams.engine.model.system_wide_license import SystemWideLicense
64
- from gams.engine.model.text_entries import TextEntries
65
- from gams.engine.model.text_entry import TextEntry
66
- from gams.engine.model.time_span import TimeSpan
67
- from gams.engine.model.token_forward_error import TokenForwardError
68
- from gams.engine.model.user import User
69
- from gams.engine.model.user_group_member import UserGroupMember
70
- from gams.engine.model.user_groups import UserGroups
71
- from gams.engine.model.webhook import Webhook
@@ -0,0 +1,89 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ GAMS Engine
5
+
6
+ With GAMS Engine you can register and solve GAMS models. It has a namespace management system, so you can restrict your users to certain models.
7
+
8
+ The version of the OpenAPI document: latest
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
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class BadInput(BaseModel):
26
+ """
27
+ BadInput
28
+ """ # noqa: E501
29
+ errors: Optional[Dict[str, StrictStr]] = None
30
+ message: Optional[StrictStr] = None
31
+ __properties: ClassVar[List[str]] = ["errors", "message"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of BadInput from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of BadInput from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "errors": obj.get("errors"),
85
+ "message": obj.get("message")
86
+ })
87
+ return _obj
88
+
89
+
@@ -0,0 +1,104 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ GAMS Engine
5
+
6
+ With GAMS Engine you can register and solve GAMS models. It has a namespace management system, so you can restrict your users to certain models.
7
+
8
+ The version of the OpenAPI document: latest
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
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from gams.engine.models.model_user import ModelUser
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class CleanableJobResult(BaseModel):
28
+ """
29
+ CleanableJobResult
30
+ """ # noqa: E501
31
+ filename: Optional[StrictStr] = None
32
+ length: Optional[StrictInt] = None
33
+ namespace: Optional[StrictStr] = None
34
+ token: Optional[StrictStr] = None
35
+ type: Optional[StrictStr] = None
36
+ upload_date: Optional[datetime] = None
37
+ user: Optional[ModelUser] = None
38
+ __properties: ClassVar[List[str]] = ["filename", "length", "namespace", "token", "type", "upload_date", "user"]
39
+
40
+ model_config = ConfigDict(
41
+ populate_by_name=True,
42
+ validate_assignment=True,
43
+ protected_namespaces=(),
44
+ )
45
+
46
+
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))
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())
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
+ """Create an instance of CleanableJobResult from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
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.
70
+ """
71
+ excluded_fields: Set[str] = set([
72
+ ])
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ # override the default output from pydantic by calling `to_dict()` of user
80
+ if self.user:
81
+ _dict['user'] = self.user.to_dict()
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
+ """Create an instance of CleanableJobResult from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return cls.model_validate(obj)
92
+
93
+ _obj = cls.model_validate({
94
+ "filename": obj.get("filename"),
95
+ "length": obj.get("length"),
96
+ "namespace": obj.get("namespace"),
97
+ "token": obj.get("token"),
98
+ "type": obj.get("type"),
99
+ "upload_date": obj.get("upload_date"),
100
+ "user": ModelUser.from_dict(obj["user"]) if obj.get("user") is not None else None
101
+ })
102
+ return _obj
103
+
104
+
@@ -0,0 +1,113 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ GAMS Engine
5
+
6
+ With GAMS Engine you can register and solve GAMS models. It has a namespace management system, so you can restrict your users to certain models.
7
+
8
+ The version of the OpenAPI document: latest
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
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from gams.engine.models.cleanable_job_result import CleanableJobResult
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class CleanableJobResultPage(BaseModel):
27
+ """
28
+ CleanableJobResultPage
29
+ """ # noqa: E501
30
+ count: Optional[StrictInt] = None
31
+ next: Optional[StrictStr] = None
32
+ previous: Optional[StrictStr] = None
33
+ results: Optional[List[CleanableJobResult]] = None
34
+ total_length: Optional[StrictInt] = None
35
+ __properties: ClassVar[List[str]] = ["count", "next", "previous", "results", "total_length"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of CleanableJobResultPage from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
77
+ _items = []
78
+ if self.results:
79
+ for _item_results in self.results:
80
+ if _item_results:
81
+ _items.append(_item_results.to_dict())
82
+ _dict['results'] = _items
83
+ # set to None if next (nullable) is None
84
+ # and model_fields_set contains the field
85
+ if self.next is None and "next" in self.model_fields_set:
86
+ _dict['next'] = None
87
+
88
+ # set to None if previous (nullable) is None
89
+ # and model_fields_set contains the field
90
+ if self.previous is None and "previous" in self.model_fields_set:
91
+ _dict['previous'] = None
92
+
93
+ return _dict
94
+
95
+ @classmethod
96
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
97
+ """Create an instance of CleanableJobResultPage from a dict"""
98
+ if obj is None:
99
+ return None
100
+
101
+ if not isinstance(obj, dict):
102
+ return cls.model_validate(obj)
103
+
104
+ _obj = cls.model_validate({
105
+ "count": obj.get("count"),
106
+ "next": obj.get("next"),
107
+ "previous": obj.get("previous"),
108
+ "results": [CleanableJobResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None,
109
+ "total_length": obj.get("total_length")
110
+ })
111
+ return _obj
112
+
113
+