crypticorn 2.4.7__py3-none-any.whl → 2.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- crypticorn/cli/init.py +7 -4
- crypticorn/common/__init__.py +1 -0
- crypticorn/common/auth.py +7 -3
- crypticorn/common/errors.py +21 -0
- crypticorn/common/exceptions.py +83 -0
- crypticorn/common/utils.py +11 -4
- crypticorn/klines/client/__init__.py +10 -3
- crypticorn/klines/client/api/__init__.py +1 -0
- crypticorn/klines/client/api/change_in_timeframe_api.py +331 -0
- crypticorn/klines/client/api/funding_rates_api.py +13 -13
- crypticorn/klines/client/api/health_check_api.py +8 -8
- crypticorn/klines/client/api/ohlcv_data_api.py +38 -26
- crypticorn/klines/client/api/symbols_api.py +26 -20
- crypticorn/klines/client/api/udf_api.py +229 -229
- crypticorn/klines/client/api_client.py +8 -5
- crypticorn/klines/client/configuration.py +80 -37
- crypticorn/klines/client/models/__init__.py +9 -3
- crypticorn/klines/client/models/base_response_list_change_in_timeframe_response.py +123 -0
- crypticorn/klines/client/models/change_in_timeframe_response.py +86 -0
- crypticorn/klines/client/models/market_type.py +35 -0
- crypticorn/klines/client/models/response_get_udf_history.py +198 -0
- crypticorn/klines/client/rest.py +111 -159
- crypticorn/klines/main.py +32 -22
- crypticorn/metrics/main.py +39 -40
- crypticorn/pay/client/__init__.py +0 -3
- crypticorn/pay/client/api/now_payments_api.py +1 -53
- crypticorn/pay/client/models/__init__.py +0 -3
- crypticorn/pay/client/models/payment.py +3 -3
- crypticorn/pay/client/models/scope.py +6 -1
- crypticorn/trade/client/__init__.py +8 -6
- crypticorn/trade/client/api/__init__.py +0 -1
- crypticorn/trade/client/api/api_keys_api.py +167 -273
- crypticorn/trade/client/api/bots_api.py +140 -226
- crypticorn/trade/client/api/exchanges_api.py +31 -51
- crypticorn/trade/client/api/futures_trading_panel_api.py +169 -272
- crypticorn/trade/client/api/notifications_api.py +200 -323
- crypticorn/trade/client/api/orders_api.py +40 -60
- crypticorn/trade/client/api/status_api.py +31 -49
- crypticorn/trade/client/api/strategies_api.py +137 -223
- crypticorn/trade/client/api/trading_actions_api.py +106 -170
- crypticorn/trade/client/api_client.py +111 -153
- crypticorn/trade/client/api_response.py +2 -3
- crypticorn/trade/client/configuration.py +128 -115
- crypticorn/trade/client/exceptions.py +25 -21
- crypticorn/trade/client/models/__init__.py +8 -6
- crypticorn/trade/client/models/action_model.py +108 -54
- crypticorn/trade/client/models/api_error_identifier.py +76 -72
- crypticorn/trade/client/models/api_error_level.py +9 -11
- crypticorn/trade/client/models/api_error_type.py +9 -11
- crypticorn/trade/client/models/bot_model.py +57 -36
- crypticorn/trade/client/models/bot_status.py +9 -11
- crypticorn/trade/client/models/exchange.py +7 -9
- crypticorn/trade/client/models/exchange_key_model.py +43 -32
- crypticorn/trade/client/models/execution_ids.py +18 -18
- crypticorn/trade/client/models/futures_balance.py +43 -27
- crypticorn/trade/client/models/futures_trading_action.py +102 -50
- crypticorn/trade/client/models/http_validation_error.py +19 -15
- crypticorn/trade/client/models/margin_mode.py +7 -9
- crypticorn/trade/client/models/market_type.py +7 -9
- crypticorn/trade/client/models/notification_model.py +52 -32
- crypticorn/trade/client/models/order_model.py +112 -72
- crypticorn/trade/client/models/order_status.py +10 -12
- crypticorn/trade/client/models/post_futures_action.py +20 -16
- crypticorn/trade/client/models/strategy_exchange_info.py +15 -16
- crypticorn/trade/client/models/strategy_model_input.py +61 -33
- crypticorn/trade/client/models/strategy_model_output.py +61 -33
- crypticorn/trade/client/models/tpsl.py +39 -25
- crypticorn/trade/client/models/trading_action_type.py +9 -11
- crypticorn/trade/client/models/validation_error.py +24 -18
- crypticorn/trade/client/models/validation_error_loc_inner.py +37 -16
- crypticorn/trade/client/rest.py +23 -38
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/METADATA +1 -1
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/RECORD +76 -70
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/WHEEL +1 -1
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/top_level.txt +0 -0
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -24,9 +24,16 @@ import urllib3
|
|
24
24
|
|
25
25
|
|
26
26
|
JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
"multipleOf",
|
28
|
+
"maximum",
|
29
|
+
"exclusiveMaximum",
|
30
|
+
"minimum",
|
31
|
+
"exclusiveMinimum",
|
32
|
+
"maxLength",
|
33
|
+
"minLength",
|
34
|
+
"pattern",
|
35
|
+
"maxItems",
|
36
|
+
"minItems",
|
30
37
|
}
|
31
38
|
|
32
39
|
ServerVariablesT = Dict[str, str]
|
@@ -134,81 +141,80 @@ class HostSetting(TypedDict):
|
|
134
141
|
class Configuration:
|
135
142
|
"""This class contains various settings of the API client.
|
136
143
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
conf = client.Configuration(
|
181
|
-
|
182
|
-
|
183
|
-
)
|
184
|
-
|
185
|
-
|
186
|
-
|
144
|
+
:param host: Base url.
|
145
|
+
:param ignore_operation_servers
|
146
|
+
Boolean to ignore operation servers for the API client.
|
147
|
+
Config will use `host` as the base url regardless of the operation servers.
|
148
|
+
:param api_key: Dict to store API key(s).
|
149
|
+
Each entry in the dict specifies an API key.
|
150
|
+
The dict key is the name of the security scheme in the OAS specification.
|
151
|
+
The dict value is the API key secret.
|
152
|
+
:param api_key_prefix: Dict to store API prefix (e.g. Bearer).
|
153
|
+
The dict key is the name of the security scheme in the OAS specification.
|
154
|
+
The dict value is an API key prefix when generating the auth data.
|
155
|
+
:param username: Username for HTTP basic authentication.
|
156
|
+
:param password: Password for HTTP basic authentication.
|
157
|
+
:param access_token: Access token.
|
158
|
+
:param server_index: Index to servers configuration.
|
159
|
+
:param server_variables: Mapping with string values to replace variables in
|
160
|
+
templated server configuration. The validation of enums is performed for
|
161
|
+
variables with defined enum values before.
|
162
|
+
:param server_operation_index: Mapping from operation ID to an index to server
|
163
|
+
configuration.
|
164
|
+
:param server_operation_variables: Mapping from operation ID to a mapping with
|
165
|
+
string values to replace variables in templated server configuration.
|
166
|
+
The validation of enums is performed for variables with defined enum
|
167
|
+
values before.
|
168
|
+
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
169
|
+
in PEM format.
|
170
|
+
:param retries: Number of retries for API requests.
|
171
|
+
:param ca_cert_data: verify the peer using concatenated CA certificate data
|
172
|
+
in PEM (str) or DER (bytes) format.
|
173
|
+
|
174
|
+
:Example:
|
175
|
+
|
176
|
+
API Key Authentication Example.
|
177
|
+
Given the following security scheme in the OpenAPI specification:
|
178
|
+
components:
|
179
|
+
securitySchemes:
|
180
|
+
cookieAuth: # name for the security scheme
|
181
|
+
type: apiKey
|
182
|
+
in: cookie
|
183
|
+
name: JSESSIONID # cookie name
|
184
|
+
|
185
|
+
You can programmatically set the cookie:
|
186
|
+
|
187
|
+
conf = client.Configuration(
|
188
|
+
api_key={'cookieAuth': 'abc123'}
|
189
|
+
api_key_prefix={'cookieAuth': 'JSESSIONID'}
|
190
|
+
)
|
191
|
+
|
192
|
+
The following cookie will be added to the HTTP request:
|
193
|
+
Cookie: JSESSIONID abc123
|
187
194
|
"""
|
188
195
|
|
189
196
|
_default: ClassVar[Optional[Self]] = None
|
190
197
|
|
191
198
|
def __init__(
|
192
199
|
self,
|
193
|
-
host: Optional[str]=None,
|
194
|
-
api_key: Optional[Dict[str, str]]=None,
|
195
|
-
api_key_prefix: Optional[Dict[str, str]]=None,
|
196
|
-
username: Optional[str]=None,
|
197
|
-
password: Optional[str]=None,
|
198
|
-
access_token: Optional[str]=None,
|
199
|
-
server_index: Optional[int]=None,
|
200
|
-
server_variables: Optional[ServerVariablesT]=None,
|
201
|
-
server_operation_index: Optional[Dict[int, int]]=None,
|
202
|
-
server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
|
203
|
-
ignore_operation_servers: bool=False,
|
204
|
-
ssl_ca_cert: Optional[str]=None,
|
200
|
+
host: Optional[str] = None,
|
201
|
+
api_key: Optional[Dict[str, str]] = None,
|
202
|
+
api_key_prefix: Optional[Dict[str, str]] = None,
|
203
|
+
username: Optional[str] = None,
|
204
|
+
password: Optional[str] = None,
|
205
|
+
access_token: Optional[str] = None,
|
206
|
+
server_index: Optional[int] = None,
|
207
|
+
server_variables: Optional[ServerVariablesT] = None,
|
208
|
+
server_operation_index: Optional[Dict[int, int]] = None,
|
209
|
+
server_operation_variables: Optional[Dict[int, ServerVariablesT]] = None,
|
210
|
+
ignore_operation_servers: bool = False,
|
211
|
+
ssl_ca_cert: Optional[str] = None,
|
205
212
|
retries: Optional[int] = None,
|
206
213
|
ca_cert_data: Optional[Union[str, bytes]] = None,
|
207
214
|
*,
|
208
215
|
debug: Optional[bool] = None,
|
209
216
|
) -> None:
|
210
|
-
"""Constructor
|
211
|
-
"""
|
217
|
+
"""Constructor"""
|
212
218
|
self._base_path = "http://localhost/v1/trade" if host is None else host
|
213
219
|
"""Default Base url
|
214
220
|
"""
|
@@ -254,7 +260,7 @@ conf = client.Configuration(
|
|
254
260
|
"""
|
255
261
|
self.logger["package_logger"] = logging.getLogger("client")
|
256
262
|
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
|
257
|
-
self.logger_format =
|
263
|
+
self.logger_format = "%(asctime)s %(levelname)s %(message)s"
|
258
264
|
"""Log format
|
259
265
|
"""
|
260
266
|
self.logger_stream_handler = None
|
@@ -310,7 +316,7 @@ conf = client.Configuration(
|
|
310
316
|
self.proxy_headers = None
|
311
317
|
"""Proxy headers
|
312
318
|
"""
|
313
|
-
self.safe_chars_for_path_param =
|
319
|
+
self.safe_chars_for_path_param = ""
|
314
320
|
"""Safe chars for path_param
|
315
321
|
"""
|
316
322
|
self.retries = retries
|
@@ -331,12 +337,12 @@ conf = client.Configuration(
|
|
331
337
|
"""date format
|
332
338
|
"""
|
333
339
|
|
334
|
-
def __deepcopy__(self, memo:
|
340
|
+
def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
|
335
341
|
cls = self.__class__
|
336
342
|
result = cls.__new__(cls)
|
337
343
|
memo[id(self)] = result
|
338
344
|
for k, v in self.__dict__.items():
|
339
|
-
if k not in (
|
345
|
+
if k not in ("logger", "logger_file_handler"):
|
340
346
|
setattr(result, k, copy.deepcopy(v, memo))
|
341
347
|
# shallow copy of loggers
|
342
348
|
result.logger = copy.copy(self.logger)
|
@@ -468,7 +474,9 @@ conf = client.Configuration(
|
|
468
474
|
self.__logger_format = value
|
469
475
|
self.logger_formatter = logging.Formatter(self.__logger_format)
|
470
476
|
|
471
|
-
def get_api_key_with_prefix(
|
477
|
+
def get_api_key_with_prefix(
|
478
|
+
self, identifier: str, alias: Optional[str] = None
|
479
|
+
) -> Optional[str]:
|
472
480
|
"""Gets API key (with prefix if set).
|
473
481
|
|
474
482
|
:param identifier: The identifier of apiKey.
|
@@ -477,7 +485,9 @@ conf = client.Configuration(
|
|
477
485
|
"""
|
478
486
|
if self.refresh_api_key_hook is not None:
|
479
487
|
self.refresh_api_key_hook(self)
|
480
|
-
key = self.api_key.get(
|
488
|
+
key = self.api_key.get(
|
489
|
+
identifier, self.api_key.get(alias) if alias is not None else None
|
490
|
+
)
|
481
491
|
if key:
|
482
492
|
prefix = self.api_key_prefix.get(identifier)
|
483
493
|
if prefix:
|
@@ -498,31 +508,31 @@ conf = client.Configuration(
|
|
498
508
|
password = ""
|
499
509
|
if self.password is not None:
|
500
510
|
password = self.password
|
501
|
-
return urllib3.util.make_headers(
|
502
|
-
|
503
|
-
)
|
511
|
+
return urllib3.util.make_headers(basic_auth=username + ":" + password).get(
|
512
|
+
"authorization"
|
513
|
+
)
|
504
514
|
|
505
|
-
def auth_settings(self)-> AuthSettings:
|
515
|
+
def auth_settings(self) -> AuthSettings:
|
506
516
|
"""Gets Auth Settings dict for api client.
|
507
517
|
|
508
518
|
:return: The Auth Settings information dict.
|
509
519
|
"""
|
510
520
|
auth: AuthSettings = {}
|
511
521
|
if self.access_token is not None:
|
512
|
-
auth[
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
522
|
+
auth["HTTPBearer"] = {
|
523
|
+
"type": "bearer",
|
524
|
+
"in": "header",
|
525
|
+
"format": "JWT",
|
526
|
+
"key": "Authorization",
|
527
|
+
"value": "Bearer " + self.access_token,
|
518
528
|
}
|
519
|
-
if
|
520
|
-
auth[
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
529
|
+
if "APIKeyHeader" in self.api_key:
|
530
|
+
auth["APIKeyHeader"] = {
|
531
|
+
"type": "api_key",
|
532
|
+
"in": "header",
|
533
|
+
"key": "X-API-Key",
|
534
|
+
"value": self.get_api_key_with_prefix(
|
535
|
+
"APIKeyHeader",
|
526
536
|
),
|
527
537
|
}
|
528
538
|
return auth
|
@@ -532,12 +542,13 @@ conf = client.Configuration(
|
|
532
542
|
|
533
543
|
:return: The report for debugging.
|
534
544
|
"""
|
535
|
-
return
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
545
|
+
return (
|
546
|
+
"Python SDK Debug Report:\n"
|
547
|
+
"OS: {env}\n"
|
548
|
+
"Python Version: {pyversion}\n"
|
549
|
+
"Version of the API: 0.1.0\n"
|
550
|
+
"SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version)
|
551
|
+
)
|
541
552
|
|
542
553
|
def get_host_settings(self) -> List[HostSetting]:
|
543
554
|
"""Gets an array of host settings
|
@@ -546,16 +557,16 @@ conf = client.Configuration(
|
|
546
557
|
"""
|
547
558
|
return [
|
548
559
|
{
|
549
|
-
|
550
|
-
|
560
|
+
"url": "http://localhost/v1/trade",
|
561
|
+
"description": "No description provided",
|
551
562
|
}
|
552
563
|
]
|
553
564
|
|
554
565
|
def get_host_from_settings(
|
555
566
|
self,
|
556
567
|
index: Optional[int],
|
557
|
-
variables: Optional[ServerVariablesT]=None,
|
558
|
-
servers: Optional[List[HostSetting]]=None,
|
568
|
+
variables: Optional[ServerVariablesT] = None,
|
569
|
+
servers: Optional[List[HostSetting]] = None,
|
559
570
|
) -> str:
|
560
571
|
"""Gets host URL based on the index and variables
|
561
572
|
:param index: array index of the host settings
|
@@ -574,22 +585,22 @@ conf = client.Configuration(
|
|
574
585
|
except IndexError:
|
575
586
|
raise ValueError(
|
576
587
|
"Invalid index {0} when selecting the host settings. "
|
577
|
-
"Must be less than {1}".format(index, len(servers))
|
588
|
+
"Must be less than {1}".format(index, len(servers))
|
589
|
+
)
|
578
590
|
|
579
|
-
url = server[
|
591
|
+
url = server["url"]
|
580
592
|
|
581
593
|
# go through variables and replace placeholders
|
582
|
-
for variable_name, variable in server.get(
|
583
|
-
used_value = variables.get(
|
584
|
-
variable_name, variable['default_value'])
|
594
|
+
for variable_name, variable in server.get("variables", {}).items():
|
595
|
+
used_value = variables.get(variable_name, variable["default_value"])
|
585
596
|
|
586
|
-
if
|
587
|
-
and used_value not in variable['enum_values']:
|
597
|
+
if "enum_values" in variable and used_value not in variable["enum_values"]:
|
588
598
|
raise ValueError(
|
589
599
|
"The variable `{0}` in the host URL has invalid value "
|
590
600
|
"{1}. Must be {2}.".format(
|
591
|
-
variable_name, variables[variable_name],
|
592
|
-
|
601
|
+
variable_name, variables[variable_name], variable["enum_values"]
|
602
|
+
)
|
603
|
+
)
|
593
604
|
|
594
605
|
url = url.replace("{" + variable_name + "}", used_value)
|
595
606
|
|
@@ -598,7 +609,9 @@ conf = client.Configuration(
|
|
598
609
|
@property
|
599
610
|
def host(self) -> str:
|
600
611
|
"""Return generated host."""
|
601
|
-
return self.get_host_from_settings(
|
612
|
+
return self.get_host_from_settings(
|
613
|
+
self.server_index, variables=self.server_variables
|
614
|
+
)
|
602
615
|
|
603
616
|
@host.setter
|
604
617
|
def host(self, value: str) -> None:
|
@@ -1,27 +1,29 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
from typing import Any, Optional
|
15
15
|
from typing_extensions import Self
|
16
16
|
|
17
|
+
|
17
18
|
class OpenApiException(Exception):
|
18
19
|
"""The base exception class for all OpenAPIExceptions"""
|
19
20
|
|
20
21
|
|
21
22
|
class ApiTypeError(OpenApiException, TypeError):
|
22
|
-
def __init__(
|
23
|
-
|
24
|
-
|
23
|
+
def __init__(
|
24
|
+
self, msg, path_to_item=None, valid_classes=None, key_type=None
|
25
|
+
) -> None:
|
26
|
+
"""Raises an exception for TypeErrors
|
25
27
|
|
26
28
|
Args:
|
27
29
|
msg (str): the exception message
|
@@ -104,9 +106,9 @@ class ApiKeyError(OpenApiException, KeyError):
|
|
104
106
|
class ApiException(OpenApiException):
|
105
107
|
|
106
108
|
def __init__(
|
107
|
-
self,
|
108
|
-
status=None,
|
109
|
-
reason=None,
|
109
|
+
self,
|
110
|
+
status=None,
|
111
|
+
reason=None,
|
110
112
|
http_resp=None,
|
111
113
|
*,
|
112
114
|
body: Optional[str] = None,
|
@@ -125,17 +127,17 @@ class ApiException(OpenApiException):
|
|
125
127
|
self.reason = http_resp.reason
|
126
128
|
if self.body is None:
|
127
129
|
try:
|
128
|
-
self.body = http_resp.data.decode(
|
130
|
+
self.body = http_resp.data.decode("utf-8")
|
129
131
|
except Exception:
|
130
132
|
pass
|
131
133
|
self.headers = http_resp.getheaders()
|
132
134
|
|
133
135
|
@classmethod
|
134
136
|
def from_response(
|
135
|
-
cls,
|
136
|
-
*,
|
137
|
-
http_resp,
|
138
|
-
body: Optional[str],
|
137
|
+
cls,
|
138
|
+
*,
|
139
|
+
http_resp,
|
140
|
+
body: Optional[str],
|
139
141
|
data: Optional[Any],
|
140
142
|
) -> Self:
|
141
143
|
if http_resp.status == 400:
|
@@ -155,7 +157,9 @@ class ApiException(OpenApiException):
|
|
155
157
|
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
156
158
|
|
157
159
|
if http_resp.status == 422:
|
158
|
-
raise UnprocessableEntityException(
|
160
|
+
raise UnprocessableEntityException(
|
161
|
+
http_resp=http_resp, body=body, data=data
|
162
|
+
)
|
159
163
|
|
160
164
|
if 500 <= http_resp.status <= 599:
|
161
165
|
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
@@ -163,11 +167,9 @@ class ApiException(OpenApiException):
|
|
163
167
|
|
164
168
|
def __str__(self):
|
165
169
|
"""Custom error messages for exception"""
|
166
|
-
error_message = "({0})\n"\
|
167
|
-
"Reason: {1}\n".format(self.status, self.reason)
|
170
|
+
error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason)
|
168
171
|
if self.headers:
|
169
|
-
error_message += "HTTP response headers: {0}\n".format(
|
170
|
-
self.headers)
|
172
|
+
error_message += "HTTP response headers: {0}\n".format(self.headers)
|
171
173
|
|
172
174
|
if self.data or self.body:
|
173
175
|
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
@@ -197,11 +199,13 @@ class ServiceException(ApiException):
|
|
197
199
|
|
198
200
|
class ConflictException(ApiException):
|
199
201
|
"""Exception for HTTP 409 Conflict."""
|
202
|
+
|
200
203
|
pass
|
201
204
|
|
202
205
|
|
203
206
|
class UnprocessableEntityException(ApiException):
|
204
207
|
"""Exception for HTTP 422 Unprocessable Entity."""
|
208
|
+
|
205
209
|
pass
|
206
210
|
|
207
211
|
|
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
# flake8: noqa
|
4
4
|
"""
|
5
|
-
|
5
|
+
Trading API
|
6
6
|
|
7
|
-
|
7
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
The version of the OpenAPI document: 0.1.0
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
|
-
|
12
|
+
Do not edit the class manually.
|
13
13
|
""" # noqa: E501
|
14
14
|
|
15
15
|
|
@@ -38,4 +38,6 @@ from crypticorn.trade.client.models.strategy_model_output import StrategyModelOu
|
|
38
38
|
from crypticorn.trade.client.models.tpsl import TPSL
|
39
39
|
from crypticorn.trade.client.models.trading_action_type import TradingActionType
|
40
40
|
from crypticorn.trade.client.models.validation_error import ValidationError
|
41
|
-
from crypticorn.trade.client.models.validation_error_loc_inner import
|
41
|
+
from crypticorn.trade.client.models.validation_error_loc_inner import (
|
42
|
+
ValidationErrorLocInner,
|
43
|
+
)
|