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
@@ -0,0 +1,21 @@
1
+ """API response object."""
2
+
3
+ from __future__ import annotations
4
+ from typing import Optional, Generic, Mapping, TypeVar
5
+ from pydantic import Field, StrictInt, StrictBytes, BaseModel
6
+
7
+ T = TypeVar("T")
8
+
9
+ class ApiResponse(BaseModel, Generic[T]):
10
+ """
11
+ API response object
12
+ """
13
+
14
+ status_code: StrictInt = Field(description="HTTP status code")
15
+ headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
16
+ data: T = Field(description="Deserialized data given the data type")
17
+ raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
18
+
19
+ model_config = {
20
+ "arbitrary_types_allowed": True
21
+ }
@@ -1,21 +1,27 @@
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)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
9
13
 
10
14
 
11
15
  import copy
16
+ import http.client as httplib
12
17
  import logging
18
+ from logging import FileHandler
13
19
  import multiprocessing
14
20
  import sys
15
- import urllib3
21
+ from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
22
+ from typing_extensions import NotRequired, Self
16
23
 
17
- from http import client as http_client
18
- from gams.engine.exceptions import ApiValueError
24
+ import urllib3
19
25
 
20
26
 
21
27
  JSON_SCHEMA_VALIDATION_KEYWORDS = {
@@ -24,46 +30,124 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = {
24
30
  'minLength', 'pattern', 'maxItems', 'minItems'
25
31
  }
26
32
 
27
- class Configuration(object):
28
- """NOTE: This class is auto generated by OpenAPI Generator
33
+ ServerVariablesT = Dict[str, str]
29
34
 
30
- Ref: https://openapi-generator.tech
31
- Do not edit the class manually.
35
+ GenericAuthSetting = TypedDict(
36
+ "GenericAuthSetting",
37
+ {
38
+ "type": str,
39
+ "in": str,
40
+ "key": str,
41
+ "value": str,
42
+ },
43
+ )
44
+
45
+
46
+ OAuth2AuthSetting = TypedDict(
47
+ "OAuth2AuthSetting",
48
+ {
49
+ "type": Literal["oauth2"],
50
+ "in": Literal["header"],
51
+ "key": Literal["Authorization"],
52
+ "value": str,
53
+ },
54
+ )
55
+
56
+
57
+ APIKeyAuthSetting = TypedDict(
58
+ "APIKeyAuthSetting",
59
+ {
60
+ "type": Literal["api_key"],
61
+ "in": str,
62
+ "key": str,
63
+ "value": Optional[str],
64
+ },
65
+ )
32
66
 
33
- :param host: Base url
67
+
68
+ BasicAuthSetting = TypedDict(
69
+ "BasicAuthSetting",
70
+ {
71
+ "type": Literal["basic"],
72
+ "in": Literal["header"],
73
+ "key": Literal["Authorization"],
74
+ "value": Optional[str],
75
+ },
76
+ )
77
+
78
+
79
+ BearerFormatAuthSetting = TypedDict(
80
+ "BearerFormatAuthSetting",
81
+ {
82
+ "type": Literal["bearer"],
83
+ "in": Literal["header"],
84
+ "format": Literal["JWT"],
85
+ "key": Literal["Authorization"],
86
+ "value": str,
87
+ },
88
+ )
89
+
90
+
91
+ BearerAuthSetting = TypedDict(
92
+ "BearerAuthSetting",
93
+ {
94
+ "type": Literal["bearer"],
95
+ "in": Literal["header"],
96
+ "key": Literal["Authorization"],
97
+ "value": str,
98
+ },
99
+ )
100
+
101
+
102
+ HTTPSignatureAuthSetting = TypedDict(
103
+ "HTTPSignatureAuthSetting",
104
+ {
105
+ "type": Literal["http-signature"],
106
+ "in": Literal["header"],
107
+ "key": Literal["Authorization"],
108
+ "value": None,
109
+ },
110
+ )
111
+
112
+
113
+ AuthSettings = TypedDict(
114
+ "AuthSettings",
115
+ {
116
+ "BasicAuth": BasicAuthSetting,
117
+ },
118
+ total=False,
119
+ )
120
+
121
+
122
+ class HostSettingVariable(TypedDict):
123
+ description: str
124
+ default_value: str
125
+ enum_values: List[str]
126
+
127
+
128
+ class HostSetting(TypedDict):
129
+ url: str
130
+ description: str
131
+ variables: NotRequired[Dict[str, HostSettingVariable]]
132
+
133
+
134
+ class Configuration:
135
+ """This class contains various settings of the API client.
136
+
137
+ :param host: Base url.
138
+ :param ignore_operation_servers
139
+ Boolean to ignore operation servers for the API client.
140
+ Config will use `host` as the base url regardless of the operation servers.
34
141
  :param api_key: Dict to store API key(s).
35
142
  Each entry in the dict specifies an API key.
36
143
  The dict key is the name of the security scheme in the OAS specification.
37
144
  The dict value is the API key secret.
38
- :param api_key_prefix: Dict to store API prefix (e.g. Bearer)
145
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
39
146
  The dict key is the name of the security scheme in the OAS specification.
40
147
  The dict value is an API key prefix when generating the auth data.
41
- :param username: Username for HTTP basic authentication
42
- :param password: Password for HTTP basic authentication
43
- :param discard_unknown_keys: Boolean value indicating whether to discard
44
- unknown properties. A server may send a response that includes additional
45
- properties that are not known by the client in the following scenarios:
46
- 1. The OpenAPI document is incomplete, i.e. it does not match the server
47
- implementation.
48
- 2. The client was generated using an older version of the OpenAPI document
49
- and the server has been upgraded since then.
50
- If a schema in the OpenAPI document defines the additionalProperties attribute,
51
- then all undeclared properties received by the server are injected into the
52
- additional properties map. In that case, there are undeclared properties, and
53
- nothing to discard.
54
- :param disabled_client_side_validations (string): Comma-separated list of
55
- JSON schema validation keywords to disable JSON schema structural validation
56
- rules. The following keywords may be specified: multipleOf, maximum,
57
- exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern,
58
- maxItems, minItems.
59
- By default, the validation is performed for data generated locally by the client
60
- and data received from the server, independent of any validation performed by
61
- the server side. If the input data does not satisfy the JSON schema validation
62
- rules specified in the OpenAPI document, an exception is raised.
63
- If disabled_client_side_validations is set, structural validation is
64
- disabled. This can be useful to troubleshoot data validation problem, such as
65
- when the OpenAPI document validation rules do not match the actual API data
66
- received by the server.
148
+ :param username: Username for HTTP basic authentication.
149
+ :param password: Password for HTTP basic authentication.
150
+ :param access_token: Access token.
67
151
  :param server_index: Index to servers configuration.
68
152
  :param server_variables: Mapping with string values to replace variables in
69
153
  templated server configuration. The validation of enums is performed for
@@ -72,9 +156,15 @@ class Configuration(object):
72
156
  configuration.
73
157
  :param server_operation_variables: Mapping from operation ID to a mapping with
74
158
  string values to replace variables in templated server configuration.
75
- The validation of enums is performed for variables with defined enum values before.
159
+ The validation of enums is performed for variables with defined enum
160
+ values before.
76
161
  :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
77
- in PEM format
162
+ in PEM format.
163
+ :param retries: Number of retries for API requests.
164
+ :param ca_cert_data: verify the peer using concatenated CA certificate data
165
+ in PEM (str) or DER (bytes) format.
166
+ :param cert_file: the path to a client certificate file, for mTLS.
167
+ :param key_file: the path to a client key file, for mTLS.
78
168
 
79
169
  :Example:
80
170
 
@@ -95,18 +185,29 @@ conf = gams.engine.Configuration(
95
185
 
96
186
  """
97
187
 
98
- _default = None
99
-
100
- def __init__(self, host=None,
101
- api_key=None, api_key_prefix=None,
102
- access_token=None,
103
- username=None, password=None,
104
- discard_unknown_keys=False,
105
- disabled_client_side_validations="",
106
- server_index=None, server_variables=None,
107
- server_operation_index=None, server_operation_variables=None,
108
- ssl_ca_cert=None,
109
- ):
188
+ _default: ClassVar[Optional[Self]] = None
189
+
190
+ def __init__(
191
+ self,
192
+ host: Optional[str]=None,
193
+ api_key: Optional[Dict[str, str]]=None,
194
+ api_key_prefix: Optional[Dict[str, str]]=None,
195
+ username: Optional[str]=None,
196
+ password: Optional[str]=None,
197
+ access_token: Optional[str]=None,
198
+ server_index: Optional[int]=None,
199
+ server_variables: Optional[ServerVariablesT]=None,
200
+ server_operation_index: Optional[Dict[int, int]]=None,
201
+ server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
202
+ ignore_operation_servers: bool=False,
203
+ ssl_ca_cert: Optional[str]=None,
204
+ retries: Optional[int] = None,
205
+ ca_cert_data: Optional[Union[str, bytes]] = None,
206
+ cert_file: Optional[str]=None,
207
+ key_file: Optional[str]=None,
208
+ *,
209
+ debug: Optional[bool] = None,
210
+ ) -> None:
110
211
  """Constructor
111
212
  """
112
213
  self._base_path = "http://localhost" if host is None else host
@@ -120,11 +221,13 @@ conf = gams.engine.Configuration(
120
221
  self.server_operation_variables = server_operation_variables or {}
121
222
  """Default server variables
122
223
  """
224
+ self.ignore_operation_servers = ignore_operation_servers
225
+ """Ignore operation servers
226
+ """
123
227
  self.temp_folder_path = None
124
228
  """Temp file folder for downloading files
125
229
  """
126
230
  # Authentication Settings
127
- self.access_token = access_token
128
231
  self.api_key = {}
129
232
  if api_key:
130
233
  self.api_key = api_key
@@ -144,8 +247,9 @@ conf = gams.engine.Configuration(
144
247
  self.password = password
145
248
  """Password for HTTP basic authentication
146
249
  """
147
- self.discard_unknown_keys = discard_unknown_keys
148
- self.disabled_client_side_validations = disabled_client_side_validations
250
+ self.access_token = access_token
251
+ """Access token
252
+ """
149
253
  self.logger = {}
150
254
  """Logging Settings
151
255
  """
@@ -157,13 +261,16 @@ conf = gams.engine.Configuration(
157
261
  self.logger_stream_handler = None
158
262
  """Log stream handler
159
263
  """
160
- self.logger_file_handler = None
264
+ self.logger_file_handler: Optional[FileHandler] = None
161
265
  """Log file handler
162
266
  """
163
267
  self.logger_file = None
164
268
  """Debug file location
165
269
  """
166
- self.debug = False
270
+ if debug is not None:
271
+ self.debug = debug
272
+ else:
273
+ self.__debug = False
167
274
  """Debug switch
168
275
  """
169
276
 
@@ -175,15 +282,23 @@ conf = gams.engine.Configuration(
175
282
  self.ssl_ca_cert = ssl_ca_cert
176
283
  """Set this to customize the certificate file to verify the peer.
177
284
  """
178
- self.cert_file = None
285
+ self.ca_cert_data = ca_cert_data
286
+ """Set this to verify the peer using PEM (str) or DER (bytes)
287
+ certificate data.
288
+ """
289
+ self.cert_file = cert_file
179
290
  """client certificate file
180
291
  """
181
- self.key_file = None
292
+ self.key_file = key_file
182
293
  """client key file
183
294
  """
184
295
  self.assert_hostname = None
185
296
  """Set this to True/False to enable/disable SSL hostname verification.
186
297
  """
298
+ self.tls_server_name = None
299
+ """SSL/TLS Server Name Indication (SNI)
300
+ Set this to the SNI value expected by the server.
301
+ """
187
302
 
188
303
  self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
189
304
  """urllib3 connection pool's maximum number of connections saved
@@ -193,28 +308,34 @@ conf = gams.engine.Configuration(
193
308
  cpu_count * 5 is used as default value to increase performance.
194
309
  """
195
310
 
196
- self.proxy = None
311
+ self.proxy: Optional[str] = None
197
312
  """Proxy URL
198
313
  """
199
- self.no_proxy = None
200
- """bypass proxy for host in the no_proxy list.
201
- """
202
314
  self.proxy_headers = None
203
315
  """Proxy headers
204
316
  """
205
317
  self.safe_chars_for_path_param = ''
206
318
  """Safe chars for path_param
207
319
  """
208
- self.retries = None
320
+ self.retries = retries
209
321
  """Adding retries to override urllib3 default value 3
210
322
  """
211
323
  # Enable client side validation
212
324
  self.client_side_validation = True
213
325
 
214
- # Options to pass down to the underlying urllib3 socket
215
326
  self.socket_options = None
327
+ """Options to pass down to the underlying urllib3 socket
328
+ """
329
+
330
+ self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
331
+ """datetime format
332
+ """
216
333
 
217
- def __deepcopy__(self, memo):
334
+ self.date_format = "%Y-%m-%d"
335
+ """date format
336
+ """
337
+
338
+ def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
218
339
  cls = self.__class__
219
340
  result = cls.__new__(cls)
220
341
  memo[id(self)] = result
@@ -228,18 +349,11 @@ conf = gams.engine.Configuration(
228
349
  result.debug = self.debug
229
350
  return result
230
351
 
231
- def __setattr__(self, name, value):
352
+ def __setattr__(self, name: str, value: Any) -> None:
232
353
  object.__setattr__(self, name, value)
233
- if name == 'disabled_client_side_validations':
234
- s = set(filter(None, value.split(',')))
235
- for v in s:
236
- if v not in JSON_SCHEMA_VALIDATION_KEYWORDS:
237
- raise ApiValueError(
238
- "Invalid keyword: '{0}''".format(v))
239
- self._disabled_client_side_validations = s
240
354
 
241
355
  @classmethod
242
- def set_default(cls, default):
356
+ def set_default(cls, default: Optional[Self]) -> None:
243
357
  """Set default instance of configuration.
244
358
 
245
359
  It stores default configuration, which can be
@@ -247,24 +361,34 @@ conf = gams.engine.Configuration(
247
361
 
248
362
  :param default: object of Configuration
249
363
  """
250
- cls._default = copy.deepcopy(default)
364
+ cls._default = default
251
365
 
252
366
  @classmethod
253
- def get_default_copy(cls):
254
- """Return new instance of configuration.
367
+ def get_default_copy(cls) -> Self:
368
+ """Deprecated. Please use `get_default` instead.
369
+
370
+ Deprecated. Please use `get_default` instead.
371
+
372
+ :return: The configuration object.
373
+ """
374
+ return cls.get_default()
375
+
376
+ @classmethod
377
+ def get_default(cls) -> Self:
378
+ """Return the default configuration.
255
379
 
256
380
  This method returns newly created, based on default constructor,
257
381
  object of Configuration class or returns a copy of default
258
- configuration passed by the set_default method.
382
+ configuration.
259
383
 
260
384
  :return: The configuration object.
261
385
  """
262
- if cls._default is not None:
263
- return copy.deepcopy(cls._default)
264
- return Configuration()
386
+ if cls._default is None:
387
+ cls._default = cls()
388
+ return cls._default
265
389
 
266
390
  @property
267
- def logger_file(self):
391
+ def logger_file(self) -> Optional[str]:
268
392
  """The logger file.
269
393
 
270
394
  If the logger_file is None, then add stream handler and remove file
@@ -276,7 +400,7 @@ conf = gams.engine.Configuration(
276
400
  return self.__logger_file
277
401
 
278
402
  @logger_file.setter
279
- def logger_file(self, value):
403
+ def logger_file(self, value: Optional[str]) -> None:
280
404
  """The logger file.
281
405
 
282
406
  If the logger_file is None, then add stream handler and remove file
@@ -295,7 +419,7 @@ conf = gams.engine.Configuration(
295
419
  logger.addHandler(self.logger_file_handler)
296
420
 
297
421
  @property
298
- def debug(self):
422
+ def debug(self) -> bool:
299
423
  """Debug status
300
424
 
301
425
  :param value: The debug status, True or False.
@@ -304,7 +428,7 @@ conf = gams.engine.Configuration(
304
428
  return self.__debug
305
429
 
306
430
  @debug.setter
307
- def debug(self, value):
431
+ def debug(self, value: bool) -> None:
308
432
  """Debug status
309
433
 
310
434
  :param value: The debug status, True or False.
@@ -315,18 +439,18 @@ conf = gams.engine.Configuration(
315
439
  # if debug status is True, turn on debug logging
316
440
  for _, logger in self.logger.items():
317
441
  logger.setLevel(logging.DEBUG)
318
- # turn on http_client debug
319
- http_client.HTTPConnection.debuglevel = 1
442
+ # turn on httplib debug
443
+ httplib.HTTPConnection.debuglevel = 1
320
444
  else:
321
445
  # if debug status is False, turn off debug logging,
322
446
  # setting log level to default `logging.WARNING`
323
447
  for _, logger in self.logger.items():
324
448
  logger.setLevel(logging.WARNING)
325
- # turn off http_client debug
326
- http_client.HTTPConnection.debuglevel = 0
449
+ # turn off httplib debug
450
+ httplib.HTTPConnection.debuglevel = 0
327
451
 
328
452
  @property
329
- def logger_format(self):
453
+ def logger_format(self) -> str:
330
454
  """The logger format.
331
455
 
332
456
  The logger_formatter will be updated when sets logger_format.
@@ -337,7 +461,7 @@ conf = gams.engine.Configuration(
337
461
  return self.__logger_format
338
462
 
339
463
  @logger_format.setter
340
- def logger_format(self, value):
464
+ def logger_format(self, value: str) -> None:
341
465
  """The logger format.
342
466
 
343
467
  The logger_formatter will be updated when sets logger_format.
@@ -348,7 +472,7 @@ conf = gams.engine.Configuration(
348
472
  self.__logger_format = value
349
473
  self.logger_formatter = logging.Formatter(self.__logger_format)
350
474
 
351
- def get_api_key_with_prefix(self, identifier, alias=None):
475
+ def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]:
352
476
  """Gets API key (with prefix if set).
353
477
 
354
478
  :param identifier: The identifier of apiKey.
@@ -365,7 +489,9 @@ conf = gams.engine.Configuration(
365
489
  else:
366
490
  return key
367
491
 
368
- def get_basic_auth_token(self):
492
+ return None
493
+
494
+ def get_basic_auth_token(self) -> Optional[str]:
369
495
  """Gets HTTP basic authentication header (string).
370
496
 
371
497
  :return: The token for basic HTTP authentication.
@@ -380,12 +506,12 @@ conf = gams.engine.Configuration(
380
506
  basic_auth=username + ':' + password
381
507
  ).get('authorization')
382
508
 
383
- def auth_settings(self):
509
+ def auth_settings(self)-> AuthSettings:
384
510
  """Gets Auth Settings dict for api client.
385
511
 
386
512
  :return: The Auth Settings information dict.
387
513
  """
388
- auth = {}
514
+ auth: AuthSettings = {}
389
515
  if self.username is not None and self.password is not None:
390
516
  auth['BasicAuth'] = {
391
517
  'type': 'basic',
@@ -395,7 +521,7 @@ conf = gams.engine.Configuration(
395
521
  }
396
522
  return auth
397
523
 
398
- def to_debug_report(self):
524
+ def to_debug_report(self) -> str:
399
525
  """Gets the essential information for debugging.
400
526
 
401
527
  :return: The report for debugging.
@@ -404,10 +530,10 @@ conf = gams.engine.Configuration(
404
530
  "OS: {env}\n"\
405
531
  "Python Version: {pyversion}\n"\
406
532
  "Version of the API: latest\n"\
407
- "SDK Package Version: 23.03.31".\
533
+ "SDK Package Version: 25.11.13".\
408
534
  format(env=sys.platform, pyversion=sys.version)
409
535
 
410
- def get_host_settings(self):
536
+ def get_host_settings(self) -> List[HostSetting]:
411
537
  """Gets an array of host settings
412
538
 
413
539
  :return: An array of host settings
@@ -419,7 +545,12 @@ conf = gams.engine.Configuration(
419
545
  }
420
546
  ]
421
547
 
422
- def get_host_from_settings(self, index, variables=None, servers=None):
548
+ def get_host_from_settings(
549
+ self,
550
+ index: Optional[int],
551
+ variables: Optional[ServerVariablesT]=None,
552
+ servers: Optional[List[HostSetting]]=None,
553
+ ) -> str:
423
554
  """Gets host URL based on the index and variables
424
555
  :param index: array index of the host settings
425
556
  :param variables: hash of variable and the corresponding value
@@ -459,12 +590,12 @@ conf = gams.engine.Configuration(
459
590
  return url
460
591
 
461
592
  @property
462
- def host(self):
593
+ def host(self) -> str:
463
594
  """Return generated host."""
464
595
  return self.get_host_from_settings(self.server_index, variables=self.server_variables)
465
596
 
466
597
  @host.setter
467
- def host(self, value):
598
+ def host(self, value: str) -> None:
468
599
  """Fix base path."""
469
600
  self._base_path = value
470
601
  self.server_index = None