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.
- gams/__init__.py +2 -2
- gams/_version.py +1 -1
- gams/connect/__init__.py +2 -2
- gams/connect/agents/__init__.py +2 -2
- gams/connect/agents/_excel/__init__.py +2 -2
- gams/connect/agents/_excel/excelagent.py +2 -2
- gams/connect/agents/_excel/workbook.py +2 -2
- gams/connect/agents/_sqlconnectors/__init__.py +2 -2
- gams/connect/agents/_sqlconnectors/_accesshandler.py +2 -2
- gams/connect/agents/_sqlconnectors/_databasehandler.py +2 -2
- gams/connect/agents/_sqlconnectors/_mysqlhandler.py +2 -2
- gams/connect/agents/_sqlconnectors/_postgreshandler.py +2 -2
- gams/connect/agents/_sqlconnectors/_pyodbchandler.py +2 -2
- gams/connect/agents/_sqlconnectors/_sqlalchemyhandler.py +2 -2
- gams/connect/agents/_sqlconnectors/_sqlitehandler.py +2 -2
- gams/connect/agents/_sqlconnectors/_sqlserverhandler.py +2 -2
- gams/connect/agents/concatenate.py +2 -2
- gams/connect/agents/connectagent.py +2 -2
- gams/connect/agents/csvreader.py +2 -2
- gams/connect/agents/csvwriter.py +2 -2
- gams/connect/agents/domainwriter.py +2 -2
- gams/connect/agents/excelreader.py +2 -2
- gams/connect/agents/excelwriter.py +2 -2
- gams/connect/agents/filter.py +2 -2
- gams/connect/agents/gamsreader.py +2 -2
- gams/connect/agents/gamswriter.py +2 -2
- gams/connect/agents/gdxreader.py +2 -2
- gams/connect/agents/gdxwriter.py +2 -2
- gams/connect/agents/labelmanipulator.py +2 -2
- gams/connect/agents/projection.py +2 -2
- gams/connect/agents/pythoncode.py +2 -2
- gams/connect/agents/rawcsvreader.py +2 -2
- gams/connect/agents/rawexcelreader.py +2 -2
- gams/connect/agents/sqlreader.py +2 -2
- gams/connect/agents/sqlwriter.py +2 -2
- gams/connect/connectdatabase.py +2 -2
- gams/connect/connectvalidator.py +2 -2
- gams/connect/errors.py +2 -2
- gams/control/__init__.py +2 -2
- gams/control/database.py +2 -2
- gams/control/execution.py +2 -2
- gams/control/options.py +2 -2
- gams/control/workspace.py +2 -2
- gams/core/__init__.py +2 -2
- gams/core/cfg/__init__.py +2 -2
- gams/core/cfg/_cfgmcc.cp314-win_amd64.pyd +0 -0
- gams/core/dct/__init__.py +2 -2
- gams/core/dct/_dctmcc.cp314-win_amd64.pyd +0 -0
- gams/core/embedded/__init__.py +2 -2
- gams/core/embedded/gamsemb.py +2 -2
- gams/core/emp/__init__.py +2 -2
- gams/core/emp/emplexer.py +2 -2
- gams/core/emp/empyacc.py +2 -2
- gams/core/gdx/__init__.py +2 -2
- gams/core/gdx/_gdxcc.cp314-win_amd64.pyd +0 -0
- gams/core/gev/__init__.py +2 -2
- gams/core/gev/_gevmcc.cp314-win_amd64.pyd +0 -0
- gams/core/gmd/__init__.py +2 -2
- gams/core/gmd/_gmdcc.cp314-win_amd64.pyd +0 -0
- gams/core/gmo/__init__.py +2 -2
- gams/core/gmo/_gmomcc.cp314-win_amd64.pyd +0 -0
- gams/core/idx/__init__.py +2 -2
- gams/core/idx/_idxcc.cp314-win_amd64.pyd +0 -0
- gams/core/numpy/__init__.py +2 -2
- gams/core/numpy/_gams2numpy.cp314-win_amd64.pyd +0 -0
- gams/core/numpy/gams2numpy.py +2 -2
- gams/core/opt/__init__.py +2 -2
- gams/core/opt/_optcc.cp314-win_amd64.pyd +0 -0
- gams/engine/__init__.py +193 -16
- gams/engine/api/__init__.py +13 -3
- gams/engine/api/auth_api.py +7545 -3618
- gams/engine/api/cleanup_api.py +712 -320
- gams/engine/api/default_api.py +838 -369
- gams/engine/api/hypercube_api.py +2576 -1198
- gams/engine/api/jobs_api.py +5170 -2458
- gams/engine/api/licenses_api.py +2170 -1014
- gams/engine/api/namespaces_api.py +7663 -3557
- gams/engine/api/usage_api.py +5575 -1867
- gams/engine/api/users_api.py +5880 -2382
- gams/engine/api_client.py +579 -641
- gams/engine/api_response.py +21 -0
- gams/engine/configuration.py +233 -102
- gams/engine/exceptions.py +86 -29
- gams/engine/models/__init__.py +83 -68
- gams/engine/models/bad_input.py +89 -0
- gams/engine/models/cleanable_job_result.py +104 -0
- gams/engine/models/cleanable_job_result_page.py +113 -0
- gams/engine/models/engine_license.py +107 -0
- gams/engine/models/files_not_found.py +93 -0
- gams/engine/models/forwarded_token_response.py +112 -0
- gams/engine/models/generic_key_value_pair.py +89 -0
- gams/engine/models/hypercube.py +160 -0
- gams/engine/models/hypercube_page.py +111 -0
- gams/engine/models/hypercube_summary.py +91 -0
- gams/engine/models/hypercube_token.py +97 -0
- gams/engine/models/identity_provider.py +107 -0
- gams/engine/models/identity_provider_ldap.py +121 -0
- gams/engine/models/identity_provider_oauth2.py +146 -0
- gams/engine/models/identity_provider_oauth2_scope.py +89 -0
- gams/engine/models/identity_provider_oauth2_with_secret.py +152 -0
- gams/engine/models/identity_provider_oidc.py +133 -0
- gams/engine/models/identity_provider_oidc_with_secret.py +143 -0
- gams/engine/models/inex.py +91 -0
- gams/engine/models/invitation.py +136 -0
- gams/engine/models/invitation_quota.py +106 -0
- gams/engine/models/invitation_token.py +87 -0
- gams/engine/models/job.py +165 -0
- gams/engine/models/job_no_text_entry.py +138 -0
- gams/engine/models/job_no_text_entry_page.py +111 -0
- gams/engine/models/license.py +91 -0
- gams/engine/models/log_piece.py +96 -0
- gams/engine/models/message.py +87 -0
- gams/engine/models/message_and_token.py +99 -0
- gams/engine/models/message_with_webhook_id.py +89 -0
- gams/engine/models/model_auth_token.py +87 -0
- gams/engine/models/model_configuration.py +125 -0
- gams/engine/models/model_default_instance.py +99 -0
- gams/engine/models/model_default_user_instance.py +98 -0
- gams/engine/models/model_hypercube_job.py +106 -0
- gams/engine/models/model_hypercube_usage.py +130 -0
- gams/engine/models/model_instance_info.py +116 -0
- gams/engine/models/model_instance_info_full.py +123 -0
- gams/engine/models/model_instance_pool_info.py +112 -0
- gams/engine/models/model_job_labels.py +179 -0
- gams/engine/models/model_job_usage.py +133 -0
- gams/engine/models/model_pool_usage.py +124 -0
- gams/engine/models/model_usage.py +115 -0
- gams/engine/models/model_user.py +96 -0
- gams/engine/models/model_userinstance_info.py +119 -0
- gams/engine/models/model_userinstancepool_info.py +95 -0
- gams/engine/models/model_version.py +91 -0
- gams/engine/models/models.py +120 -0
- gams/engine/models/namespace.py +104 -0
- gams/engine/models/namespace_quota.py +96 -0
- gams/engine/models/namespace_with_permission.py +96 -0
- gams/engine/models/not_found.py +91 -0
- gams/engine/models/password_policy.py +97 -0
- gams/engine/models/perm_and_username.py +89 -0
- gams/engine/models/quota.py +117 -0
- gams/engine/models/quota_exceeded.py +97 -0
- gams/engine/models/status_code_meaning.py +89 -0
- gams/engine/models/stream_entry.py +89 -0
- gams/engine/models/system_wide_license.py +92 -0
- gams/engine/models/text_entries.py +87 -0
- gams/engine/models/text_entry.py +101 -0
- gams/engine/models/time_span.py +95 -0
- gams/engine/models/time_span_pool_worker.py +99 -0
- gams/engine/models/token_forward_error.py +87 -0
- gams/engine/models/user.py +127 -0
- gams/engine/models/user_group_member.py +96 -0
- gams/engine/models/user_groups.py +108 -0
- gams/engine/models/vapid_info.py +87 -0
- gams/engine/models/webhook.py +138 -0
- gams/engine/models/webhook_parameterized_event.py +99 -0
- gams/engine/py.typed +0 -0
- gams/engine/rest.py +141 -229
- gams/magic/__init__.py +2 -2
- gams/magic/gams_magic.py +2 -2
- gams/magic/interactive.py +2 -2
- gams/tools/__init__.py +2 -2
- gams/tools/errors.py +2 -2
- gams/tools/toolcollection/__init__.py +2 -2
- gams/tools/toolcollection/alg/__init__.py +2 -2
- gams/tools/toolcollection/alg/rank.py +2 -2
- gams/tools/toolcollection/data/__init__.py +2 -2
- gams/tools/toolcollection/data/csvread.py +2 -2
- gams/tools/toolcollection/data/exceldump.py +2 -2
- gams/tools/toolcollection/data/sqlitewrite.py +2 -2
- gams/tools/toolcollection/gdxservice/__init__.py +2 -2
- gams/tools/toolcollection/gdxservice/gdxencoding.py +2 -2
- gams/tools/toolcollection/gdxservice/gdxrename.py +2 -2
- gams/tools/toolcollection/linalg/__init__.py +2 -2
- gams/tools/toolcollection/linalg/cholesky.py +2 -2
- gams/tools/toolcollection/linalg/eigenvalue.py +2 -2
- gams/tools/toolcollection/linalg/eigenvector.py +2 -2
- gams/tools/toolcollection/linalg/invert.py +2 -2
- gams/tools/toolcollection/linalg/ols.py +2 -2
- gams/tools/toolcollection/tooltemplate.py +2 -2
- gams/tools/toolcollection/win32/__init__.py +2 -2
- gams/tools/toolcollection/win32/excelmerge.py +2 -2
- gams/tools/toolcollection/win32/exceltalk.py +2 -2
- gams/tools/toolcollection/win32/msappavail.py +2 -2
- gams/tools/toolcollection/win32/shellexecute.py +2 -2
- gams/tools/tools.py +2 -2
- gams/transfer/__init__.py +2 -2
- gams/transfer/_abcs/__init__.py +2 -2
- gams/transfer/_abcs/container_abcs.py +2 -2
- gams/transfer/_internals/__init__.py +2 -2
- gams/transfer/_internals/algorithms.py +2 -2
- gams/transfer/_internals/casepreservingdict.py +2 -2
- gams/transfer/_internals/constants.py +2 -2
- gams/transfer/_internals/domainviolation.py +2 -2
- gams/transfer/_internals/specialvalues.py +2 -2
- gams/transfer/containers/__init__.py +2 -2
- gams/transfer/containers/_container.py +2 -2
- gams/transfer/containers/_io/__init__.py +2 -2
- gams/transfer/containers/_io/containers.py +2 -2
- gams/transfer/containers/_io/gdx.py +2 -2
- gams/transfer/containers/_io/gmd.py +2 -2
- gams/transfer/containers/_mixins/__init__.py +2 -2
- gams/transfer/containers/_mixins/ccc.py +2 -2
- gams/transfer/syms/__init__.py +2 -2
- gams/transfer/syms/_methods/__init__.py +2 -2
- gams/transfer/syms/_methods/tables.py +2 -2
- gams/transfer/syms/_methods/toDict.py +2 -2
- gams/transfer/syms/_methods/toList.py +2 -2
- gams/transfer/syms/_methods/toValue.py +2 -2
- gams/transfer/syms/_mixins/__init__.py +2 -2
- gams/transfer/syms/_mixins/equals.py +2 -2
- gams/transfer/syms/_mixins/generateRecords.py +2 -2
- gams/transfer/syms/_mixins/pivot.py +2 -2
- gams/transfer/syms/_mixins/pve.py +2 -2
- gams/transfer/syms/_mixins/sa.py +2 -2
- gams/transfer/syms/_mixins/sapve.py +2 -2
- gams/transfer/syms/_mixins/saua.py +2 -2
- gams/transfer/syms/_mixins/sauapve.py +2 -2
- gams/transfer/syms/_mixins/spve.py +2 -2
- gams/transfer/syms/_mixins/ve.py +2 -2
- gams/transfer/syms/container_syms/__init__.py +2 -2
- gams/transfer/syms/container_syms/_alias.py +2 -2
- gams/transfer/syms/container_syms/_equation.py +2 -2
- gams/transfer/syms/container_syms/_parameter.py +2 -2
- gams/transfer/syms/container_syms/_set.py +2 -2
- gams/transfer/syms/container_syms/_universe_alias.py +2 -2
- gams/transfer/syms/container_syms/_variable.py +2 -2
- {gamsapi-52.2.0.dist-info → gamsapi-52.4.0.dist-info}/METADATA +12 -10
- gamsapi-52.4.0.dist-info/RECORD +257 -0
- {gamsapi-52.2.0.dist-info → gamsapi-52.4.0.dist-info}/licenses/LICENSE +2 -2
- gams/engine/apis/__init__.py +0 -25
- gams/engine/model/__init__.py +0 -5
- gams/engine/model/bad_input.py +0 -259
- gams/engine/model/cleanable_job_result.py +0 -285
- gams/engine/model/cleanable_job_result_page.py +0 -277
- gams/engine/model/engine_license.py +0 -263
- gams/engine/model/files_not_found.py +0 -267
- gams/engine/model/forwarded_token_response.py +0 -275
- gams/engine/model/generic_key_value_pair.py +0 -259
- gams/engine/model/hypercube.py +0 -331
- gams/engine/model/hypercube_page.py +0 -273
- gams/engine/model/hypercube_summary.py +0 -263
- gams/engine/model/hypercube_token.py +0 -265
- gams/engine/model/identity_provider.py +0 -287
- gams/engine/model/identity_provider_ldap.py +0 -303
- gams/engine/model/identity_provider_oauth2.py +0 -309
- gams/engine/model/identity_provider_oauth2_scope.py +0 -259
- gams/engine/model/identity_provider_oauth2_with_secret.py +0 -321
- gams/engine/model/identity_provider_oidc.py +0 -299
- gams/engine/model/identity_provider_oidc_with_secret.py +0 -319
- gams/engine/model/inex.py +0 -259
- gams/engine/model/invitation.py +0 -309
- gams/engine/model/invitation_quota.py +0 -263
- gams/engine/model/invitation_token.py +0 -255
- gams/engine/model/job.py +0 -337
- gams/engine/model/job_no_text_entry.py +0 -313
- gams/engine/model/job_no_text_entry_page.py +0 -273
- gams/engine/model/license.py +0 -263
- gams/engine/model/log_piece.py +0 -263
- gams/engine/model/message.py +0 -255
- gams/engine/model/message_and_token.py +0 -269
- gams/engine/model/model_auth_token.py +0 -255
- gams/engine/model/model_configuration.py +0 -268
- gams/engine/model/model_hypercube_job.py +0 -273
- gams/engine/model/model_hypercube_usage.py +0 -303
- gams/engine/model/model_instance_info.py +0 -285
- gams/engine/model/model_instance_info_full.py +0 -289
- gams/engine/model/model_job_labels.py +0 -295
- gams/engine/model/model_job_usage.py +0 -299
- gams/engine/model/model_usage.py +0 -267
- gams/engine/model/model_userinstance_info.py +0 -273
- gams/engine/model/model_version.py +0 -263
- gams/engine/model/models.py +0 -297
- gams/engine/model/namespace.py +0 -269
- gams/engine/model/namespace_quota.py +0 -263
- gams/engine/model/namespace_with_permission.py +0 -263
- gams/engine/model/not_found.py +0 -263
- gams/engine/model/perm_and_username.py +0 -259
- gams/engine/model/quota.py +0 -275
- gams/engine/model/quota_exceeded.py +0 -265
- gams/engine/model/result_user.py +0 -263
- gams/engine/model/status_code_meaning.py +0 -259
- gams/engine/model/stream_entry.py +0 -259
- gams/engine/model/system_wide_license.py +0 -255
- gams/engine/model/text_entries.py +0 -255
- gams/engine/model/text_entry.py +0 -263
- gams/engine/model/time_span.py +0 -259
- gams/engine/model/token_forward_error.py +0 -255
- gams/engine/model/user.py +0 -283
- gams/engine/model/user_group_member.py +0 -269
- gams/engine/model/user_groups.py +0 -279
- gams/engine/model/webhook.py +0 -292
- gams/engine/model_utils.py +0 -2037
- gamsapi-52.2.0.dist-info/RECORD +0 -248
- {gamsapi-52.2.0.dist-info → gamsapi-52.4.0.dist-info}/WHEEL +0 -0
- {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
|
+
}
|
gams/engine/configuration.py
CHANGED
|
@@ -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.
|
|
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
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
|
|
22
|
+
from typing_extensions import NotRequired, Self
|
|
16
23
|
|
|
17
|
-
|
|
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
|
-
|
|
28
|
-
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
33
|
+
ServerVariablesT = Dict[str, str]
|
|
29
34
|
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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__(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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.
|
|
148
|
-
|
|
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
|
-
|
|
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.
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
364
|
+
cls._default = default
|
|
251
365
|
|
|
252
366
|
@classmethod
|
|
253
|
-
def get_default_copy(cls):
|
|
254
|
-
"""
|
|
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
|
|
382
|
+
configuration.
|
|
259
383
|
|
|
260
384
|
:return: The configuration object.
|
|
261
385
|
"""
|
|
262
|
-
if cls._default is
|
|
263
|
-
|
|
264
|
-
return
|
|
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
|
|
319
|
-
|
|
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
|
|
326
|
-
|
|
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
|
-
|
|
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:
|
|
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(
|
|
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
|