crypticorn 2.1.4__py3-none-any.whl → 2.1.5__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/common/errors.py +1 -1
- crypticorn/common/sorter.py +9 -7
- crypticorn/pay/client/api/products_api.py +15 -15
- crypticorn/pay/client/models/now_webhook_payload.py +1 -1
- crypticorn/trade/client/api/futures_trading_panel_api.py +15 -15
- crypticorn/trade/client/models/api_error_identifier.py +49 -47
- crypticorn/trade/client/models/api_error_level.py +2 -2
- {crypticorn-2.1.4.dist-info → crypticorn-2.1.5.dist-info}/METADATA +3 -3
- {crypticorn-2.1.4.dist-info → crypticorn-2.1.5.dist-info}/RECORD +11 -14
- crypticorn/trade/client/models/notification_type.py +0 -37
- crypticorn/trade/client/models/strategy_model.py +0 -158
- crypticorn/trade/client/models/update_notification.py +0 -95
- {crypticorn-2.1.4.dist-info → crypticorn-2.1.5.dist-info}/WHEEL +0 -0
- {crypticorn-2.1.4.dist-info → crypticorn-2.1.5.dist-info}/top_level.txt +0 -0
crypticorn/common/errors.py
CHANGED
crypticorn/common/sorter.py
CHANGED
@@ -1,36 +1,38 @@
|
|
1
1
|
import re
|
2
2
|
import pyperclip
|
3
3
|
|
4
|
+
|
4
5
|
def sort_api_errors(file_content):
|
5
6
|
# Find the start of the ApiError class definition
|
6
7
|
class_start = file_content.find("class ApiErrorIdentifier(str, Enum):")
|
7
8
|
if class_start == -1:
|
8
9
|
return "Could not find ApiErrorIdentifier class"
|
9
|
-
|
10
|
+
|
10
11
|
# Find all enum definitions
|
11
12
|
enum_pattern = r' ([A-Z_]+)\s*=\s*"([a-z_]+)"'
|
12
13
|
enum_matches = re.finditer(enum_pattern, file_content)
|
13
|
-
|
14
|
+
|
14
15
|
# Extract all enum entries
|
15
16
|
enum_entries = []
|
16
17
|
for match in enum_matches:
|
17
18
|
full_match = match.group(0)
|
18
19
|
enum_name = match.group(1)
|
19
20
|
enum_entries.append((enum_name, full_match.strip()))
|
20
|
-
|
21
|
+
|
21
22
|
# Sort entries by enum name
|
22
23
|
sorted_entries = sorted(enum_entries, key=lambda x: x[0])
|
23
|
-
|
24
|
+
|
24
25
|
# Reconstruct the class content
|
25
26
|
class_header = "class ApiErrorIdentifier(str, Enum):\n\n"
|
26
27
|
sorted_content = class_header + "\n ".join(entry[1] for entry in sorted_entries)
|
27
|
-
|
28
|
+
|
28
29
|
return sorted_content
|
29
30
|
|
31
|
+
|
30
32
|
# Example usage:
|
31
33
|
if __name__ == "__main__":
|
32
34
|
with open("python/crypticorn/common/errors.py", "r") as f:
|
33
35
|
content = f.read()
|
34
|
-
|
36
|
+
|
35
37
|
sorted_content = sort_api_errors(content)
|
36
|
-
pyperclip.copy(sorted_content)
|
38
|
+
pyperclip.copy(sorted_content)
|
@@ -297,7 +297,7 @@ class ProductsApi:
|
|
297
297
|
self,
|
298
298
|
limit: Optional[StrictInt] = None,
|
299
299
|
offset: Optional[StrictInt] = None,
|
300
|
-
|
300
|
+
body: Optional[Dict[str, Any]] = None,
|
301
301
|
_request_timeout: Union[
|
302
302
|
None,
|
303
303
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -318,8 +318,8 @@ class ProductsApi:
|
|
318
318
|
:type limit: int
|
319
319
|
:param offset:
|
320
320
|
:type offset: int
|
321
|
-
:param
|
322
|
-
:type
|
321
|
+
:param body:
|
322
|
+
:type body: object
|
323
323
|
:param _request_timeout: timeout setting for this request. If one
|
324
324
|
number provided, it will be total request
|
325
325
|
timeout. It can also be a pair (tuple) of
|
@@ -345,7 +345,7 @@ class ProductsApi:
|
|
345
345
|
_param = self._get_products_serialize(
|
346
346
|
limit=limit,
|
347
347
|
offset=offset,
|
348
|
-
|
348
|
+
body=body,
|
349
349
|
_request_auth=_request_auth,
|
350
350
|
_content_type=_content_type,
|
351
351
|
_headers=_headers,
|
@@ -370,7 +370,7 @@ class ProductsApi:
|
|
370
370
|
self,
|
371
371
|
limit: Optional[StrictInt] = None,
|
372
372
|
offset: Optional[StrictInt] = None,
|
373
|
-
|
373
|
+
body: Optional[Dict[str, Any]] = None,
|
374
374
|
_request_timeout: Union[
|
375
375
|
None,
|
376
376
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -391,8 +391,8 @@ class ProductsApi:
|
|
391
391
|
:type limit: int
|
392
392
|
:param offset:
|
393
393
|
:type offset: int
|
394
|
-
:param
|
395
|
-
:type
|
394
|
+
:param body:
|
395
|
+
:type body: object
|
396
396
|
:param _request_timeout: timeout setting for this request. If one
|
397
397
|
number provided, it will be total request
|
398
398
|
timeout. It can also be a pair (tuple) of
|
@@ -418,7 +418,7 @@ class ProductsApi:
|
|
418
418
|
_param = self._get_products_serialize(
|
419
419
|
limit=limit,
|
420
420
|
offset=offset,
|
421
|
-
|
421
|
+
body=body,
|
422
422
|
_request_auth=_request_auth,
|
423
423
|
_content_type=_content_type,
|
424
424
|
_headers=_headers,
|
@@ -443,7 +443,7 @@ class ProductsApi:
|
|
443
443
|
self,
|
444
444
|
limit: Optional[StrictInt] = None,
|
445
445
|
offset: Optional[StrictInt] = None,
|
446
|
-
|
446
|
+
body: Optional[Dict[str, Any]] = None,
|
447
447
|
_request_timeout: Union[
|
448
448
|
None,
|
449
449
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -464,8 +464,8 @@ class ProductsApi:
|
|
464
464
|
:type limit: int
|
465
465
|
:param offset:
|
466
466
|
:type offset: int
|
467
|
-
:param
|
468
|
-
:type
|
467
|
+
:param body:
|
468
|
+
:type body: object
|
469
469
|
:param _request_timeout: timeout setting for this request. If one
|
470
470
|
number provided, it will be total request
|
471
471
|
timeout. It can also be a pair (tuple) of
|
@@ -491,7 +491,7 @@ class ProductsApi:
|
|
491
491
|
_param = self._get_products_serialize(
|
492
492
|
limit=limit,
|
493
493
|
offset=offset,
|
494
|
-
|
494
|
+
body=body,
|
495
495
|
_request_auth=_request_auth,
|
496
496
|
_content_type=_content_type,
|
497
497
|
_headers=_headers,
|
@@ -511,7 +511,7 @@ class ProductsApi:
|
|
511
511
|
self,
|
512
512
|
limit,
|
513
513
|
offset,
|
514
|
-
|
514
|
+
body,
|
515
515
|
_request_auth,
|
516
516
|
_content_type,
|
517
517
|
_headers,
|
@@ -544,8 +544,8 @@ class ProductsApi:
|
|
544
544
|
# process the header parameters
|
545
545
|
# process the form parameters
|
546
546
|
# process the body parameter
|
547
|
-
if
|
548
|
-
_body_params =
|
547
|
+
if body is not None:
|
548
|
+
_body_params = body
|
549
549
|
|
550
550
|
# set the HTTP header `Accept`
|
551
551
|
if "Accept" not in _header_params:
|
@@ -36,7 +36,7 @@ class NowWebhookPayload(BaseModel):
|
|
36
36
|
actually_paid_at_fiat: Union[StrictFloat, StrictInt] = Field(
|
37
37
|
description="Actually paid amount in fiat currency"
|
38
38
|
)
|
39
|
-
fee: NowFeeStructure
|
39
|
+
fee: NowFeeStructure = Field(description="Fee structure for the payment")
|
40
40
|
invoice_id: StrictInt = Field(description="Associated invoice ID")
|
41
41
|
order_description: StrictStr = Field(description="Order description")
|
42
42
|
order_id: StrictStr = Field(description="Internal order ID")
|
@@ -1031,7 +1031,7 @@ class FuturesTradingPanelApi:
|
|
1031
1031
|
async def place_futures_order(
|
1032
1032
|
self,
|
1033
1033
|
key: StrictStr,
|
1034
|
-
|
1034
|
+
body: Dict[str, Any],
|
1035
1035
|
_request_timeout: Union[
|
1036
1036
|
None,
|
1037
1037
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -1049,8 +1049,8 @@ class FuturesTradingPanelApi:
|
|
1049
1049
|
|
1050
1050
|
:param key: (required)
|
1051
1051
|
:type key: str
|
1052
|
-
:param
|
1053
|
-
:type
|
1052
|
+
:param body: (required)
|
1053
|
+
:type body: object
|
1054
1054
|
:param _request_timeout: timeout setting for this request. If one
|
1055
1055
|
number provided, it will be total request
|
1056
1056
|
timeout. It can also be a pair (tuple) of
|
@@ -1075,7 +1075,7 @@ class FuturesTradingPanelApi:
|
|
1075
1075
|
|
1076
1076
|
_param = self._place_futures_order_serialize(
|
1077
1077
|
key=key,
|
1078
|
-
|
1078
|
+
body=body,
|
1079
1079
|
_request_auth=_request_auth,
|
1080
1080
|
_content_type=_content_type,
|
1081
1081
|
_headers=_headers,
|
@@ -1099,7 +1099,7 @@ class FuturesTradingPanelApi:
|
|
1099
1099
|
async def place_futures_order_with_http_info(
|
1100
1100
|
self,
|
1101
1101
|
key: StrictStr,
|
1102
|
-
|
1102
|
+
body: Dict[str, Any],
|
1103
1103
|
_request_timeout: Union[
|
1104
1104
|
None,
|
1105
1105
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -1117,8 +1117,8 @@ class FuturesTradingPanelApi:
|
|
1117
1117
|
|
1118
1118
|
:param key: (required)
|
1119
1119
|
:type key: str
|
1120
|
-
:param
|
1121
|
-
:type
|
1120
|
+
:param body: (required)
|
1121
|
+
:type body: object
|
1122
1122
|
:param _request_timeout: timeout setting for this request. If one
|
1123
1123
|
number provided, it will be total request
|
1124
1124
|
timeout. It can also be a pair (tuple) of
|
@@ -1143,7 +1143,7 @@ class FuturesTradingPanelApi:
|
|
1143
1143
|
|
1144
1144
|
_param = self._place_futures_order_serialize(
|
1145
1145
|
key=key,
|
1146
|
-
|
1146
|
+
body=body,
|
1147
1147
|
_request_auth=_request_auth,
|
1148
1148
|
_content_type=_content_type,
|
1149
1149
|
_headers=_headers,
|
@@ -1167,7 +1167,7 @@ class FuturesTradingPanelApi:
|
|
1167
1167
|
async def place_futures_order_without_preload_content(
|
1168
1168
|
self,
|
1169
1169
|
key: StrictStr,
|
1170
|
-
|
1170
|
+
body: Dict[str, Any],
|
1171
1171
|
_request_timeout: Union[
|
1172
1172
|
None,
|
1173
1173
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -1185,8 +1185,8 @@ class FuturesTradingPanelApi:
|
|
1185
1185
|
|
1186
1186
|
:param key: (required)
|
1187
1187
|
:type key: str
|
1188
|
-
:param
|
1189
|
-
:type
|
1188
|
+
:param body: (required)
|
1189
|
+
:type body: object
|
1190
1190
|
:param _request_timeout: timeout setting for this request. If one
|
1191
1191
|
number provided, it will be total request
|
1192
1192
|
timeout. It can also be a pair (tuple) of
|
@@ -1211,7 +1211,7 @@ class FuturesTradingPanelApi:
|
|
1211
1211
|
|
1212
1212
|
_param = self._place_futures_order_serialize(
|
1213
1213
|
key=key,
|
1214
|
-
|
1214
|
+
body=body,
|
1215
1215
|
_request_auth=_request_auth,
|
1216
1216
|
_content_type=_content_type,
|
1217
1217
|
_headers=_headers,
|
@@ -1230,7 +1230,7 @@ class FuturesTradingPanelApi:
|
|
1230
1230
|
def _place_futures_order_serialize(
|
1231
1231
|
self,
|
1232
1232
|
key,
|
1233
|
-
|
1233
|
+
body,
|
1234
1234
|
_request_auth,
|
1235
1235
|
_content_type,
|
1236
1236
|
_headers,
|
@@ -1259,8 +1259,8 @@ class FuturesTradingPanelApi:
|
|
1259
1259
|
# process the header parameters
|
1260
1260
|
# process the form parameters
|
1261
1261
|
# process the body parameter
|
1262
|
-
if
|
1263
|
-
_body_params =
|
1262
|
+
if body is not None:
|
1263
|
+
_body_params = body
|
1264
1264
|
|
1265
1265
|
# set the HTTP header `Accept`
|
1266
1266
|
if "Accept" not in _header_params:
|
@@ -26,69 +26,71 @@ class ApiErrorIdentifier(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
API_KEY_ALREADY_EXISTS = "api_key_already_exists"
|
30
|
+
BLACK_SWAN = "black_swan"
|
31
|
+
BOT_ALREADY_DELETED = "bot_already_deleted"
|
32
|
+
BOT_DISABLED = "bot_disabled"
|
33
|
+
BOT_STOPPING_COMPLETED = "bot_stopping_completed"
|
34
|
+
CLIENT_ORDER_ID_ALREADY_EXISTS = "client_order_id_already_exists"
|
35
|
+
INVALID_CONTENT_TYPE = "invalid_content_type"
|
36
|
+
DELETE_BOT_ERROR = "delete_bot_error"
|
37
|
+
EXCHANGE_API_KEY_IN_USE = "exchange_api_key_in_use"
|
38
|
+
EXCHANGE_INVALID_SIGNATURE = "exchange_invalid_signature"
|
39
|
+
EXCHANGE_INVALID_TIMESTAMP = "exchange_invalid_timestamp"
|
40
|
+
EXCHANGE_IP_ADDRESS_IS_NOT_AUTHORIZED = "exchange_ip_address_is_not_authorized"
|
41
|
+
EXCHANGE_SYSTEM_UNDER_MAINTENANCE = "exchange_system_under_maintenance"
|
42
|
+
EXCHANGE_RATE_LIMIT_EXCEEDED = "exchange_rate_limit_exceeded"
|
43
|
+
EXCHANGE_SERVICE_TEMPORARILY_UNAVAILABLE = (
|
44
|
+
"exchange_service_temporarily_unavailable"
|
45
|
+
)
|
46
|
+
EXCHANGE_SYSTEM_IS_BUSY = "exchange_system_is_busy"
|
47
|
+
EXCHANGE_SYSTEM_CONFIGURATION_ERROR = "exchange_system_configuration_error"
|
48
|
+
EXCHANGE_INTERNAL_SYSTEM_ERROR = "exchange_internal_system_error"
|
49
|
+
EXCHANGE_USER_ACCOUNT_IS_FROZEN = "exchange_user_account_is_frozen"
|
34
50
|
INSUFFICIENT_PERMISSIONS_SPOT_AND_FUTURES_REQUIRED = (
|
35
51
|
"insufficient_permissions_spot_and_futures_required"
|
36
52
|
)
|
37
|
-
|
38
|
-
|
53
|
+
HEDGE_MODE_NOT_ACTIVE = "hedge_mode_not_active"
|
54
|
+
HTTP_REQUEST_ERROR = "http_request_error"
|
55
|
+
INSUFFICIENT_BALANCE = "insufficient_balance"
|
56
|
+
INSUFFICIENT_MARGIN = "insufficient_margin"
|
57
|
+
INSUFFICIENT_SCOPES = "insufficient_scopes"
|
58
|
+
INVALID_API_KEY = "invalid_api_key"
|
59
|
+
INVALID_BEARER = "invalid_bearer"
|
60
|
+
INVALID_EXCHANGE_API_KEY = "invalid_exchange_api_key"
|
61
|
+
INVALID_MARGIN_MODE = "invalid_margin_mode"
|
39
62
|
INVALID_PARAMETER_PROVIDED = "invalid_parameter_provided"
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
63
|
+
JWT_EXPIRED = "jwt_expired"
|
64
|
+
LEVERAGE_LIMIT_EXCEEDED = "leverage_limit_exceeded"
|
65
|
+
ORDER_VIOLATES_LIQUIDATION_PRICE_CONSTRAINTS = (
|
66
|
+
"order_violates_liquidation_price_constraints"
|
67
|
+
)
|
68
|
+
NO_CREDENTIALS = "no_credentials"
|
69
|
+
OBJECT_NOT_FOUND = "object_not_found"
|
44
70
|
ORDER_IS_ALREADY_FILLED = "order_is_already_filled"
|
45
71
|
ORDER_IS_BEING_PROCESSED = "order_is_being_processed"
|
46
72
|
ORDER_QUANTITY_LIMIT_EXCEEDED = "order_quantity_limit_exceeded"
|
73
|
+
ORDER_DOES_NOT_EXIST = "order_does_not_exist"
|
47
74
|
ORDER_PRICE_IS_INVALID = "order_price_is_invalid"
|
48
|
-
|
49
|
-
|
50
|
-
CLIENT_ORDER_ID_ALREADY_EXISTS = "client_order_id_already_exists"
|
51
|
-
POSITION_DOES_NOT_EXIST = "position_does_not_exist"
|
75
|
+
ORDER_SIZE_TOO_LARGE = "order_size_too_large"
|
76
|
+
ORDER_SIZE_TOO_SMALL = "order_size_too_small"
|
52
77
|
POSITION_LIMIT_EXCEEDED = "position_limit_exceeded"
|
78
|
+
POSITION_DOES_NOT_EXIST = "position_does_not_exist"
|
53
79
|
POSITION_OPENING_TEMPORARILY_SUSPENDED = "position_opening_temporarily_suspended"
|
54
|
-
|
55
|
-
|
56
|
-
LEVERAGE_LIMIT_EXCEEDED = "leverage_limit_exceeded"
|
80
|
+
POST_ONLY_ORDER_WOULD_IMMEDIATELY_MATCH = "post_only_order_would_immediately_match"
|
81
|
+
REQUEST_SCOPE_LIMIT_EXCEEDED = "request_scope_limit_exceeded"
|
57
82
|
RISK_LIMIT_EXCEEDED = "risk_limit_exceeded"
|
58
|
-
ORDER_VIOLATES_LIQUIDATION_PRICE_CONSTRAINTS = (
|
59
|
-
"order_violates_liquidation_price_constraints"
|
60
|
-
)
|
61
|
-
INVALID_MARGIN_MODE = "invalid_margin_mode"
|
62
|
-
INTERNAL_SYSTEM_ERROR = "internal_system_error"
|
63
|
-
SYSTEM_CONFIGURATION_ERROR = "system_configuration_error"
|
64
|
-
SERVICE_TEMPORARILY_UNAVAILABLE = "service_temporarily_unavailable"
|
65
|
-
SYSTEM_IS_BUSY_PLEASE_TRY_AGAIN_LATER = "system_is_busy_please_try_again_later"
|
66
|
-
SYSTEM_UNDER_MAINTENANCE = "system_under_maintenance"
|
67
83
|
RPC_TIMEOUT = "rpc_timeout"
|
68
84
|
SYSTEM_SETTLEMENT_IN_PROCESS = "system_settlement_in_process"
|
69
|
-
|
85
|
+
STRATEGY_DISABLED = "strategy_disabled"
|
86
|
+
SUCCESS = "success"
|
87
|
+
SYMBOL_DOES_NOT_EXIST = "symbol_does_not_exist"
|
70
88
|
TRADING_HAS_BEEN_LOCKED = "trading_has_been_locked"
|
71
|
-
UNKNOWN_ERROR_OCCURRED = "unknown_error_occurred"
|
72
|
-
HTTP_REQUEST_ERROR = "http_request_error"
|
73
|
-
BLACK_SWAN = "black_swan"
|
74
89
|
TRADING_ACTION_EXPIRED = "trading_action_expired"
|
75
90
|
TRADING_ACTION_SKIPPED = "trading_action_skipped"
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
HEDGE_MODE_NOT_ACTIVE = "hedge_mode_not_active"
|
80
|
-
API_KEY_ALREADY_EXISTS = "api_key_already_exists"
|
81
|
-
DELETE_BOT_ERROR = "delete_bot_error"
|
82
|
-
JWT_EXPIRED = "jwt_expired"
|
83
|
-
BOT_STOPPING_COMPLETED = "bot_stopping_completed"
|
84
|
-
OBJECT_NOT_FOUND = "object_not_found"
|
85
|
-
STRATEGY_DISABLED = "strategy_disabled"
|
86
|
-
API_KEY_IN_USE_BY_BOTS = "api_key_in_use_by_bots"
|
87
|
-
BOT_ALREADY_DELETED = "bot_already_deleted"
|
88
|
-
INVALID_API_KEY = "invalid_api_key"
|
89
|
-
INVALID_BEARER = "invalid_bearer"
|
90
|
-
NO_CREDENTIALS = "no_credentials"
|
91
|
-
INSUFFICIENT_SCOPES = "insufficient_scopes"
|
91
|
+
TRADING_IS_SUSPENDED = "trading_is_suspended"
|
92
|
+
UNKNOWN_ERROR_OCCURRED = "unknown_error_occurred"
|
93
|
+
REQUESTED_RESOURCE_NOT_FOUND = "requested_resource_not_found"
|
92
94
|
|
93
95
|
@classmethod
|
94
96
|
def from_json(cls, json_str: str) -> Self:
|
@@ -20,15 +20,15 @@ from typing_extensions import Self
|
|
20
20
|
|
21
21
|
class ApiErrorLevel(str, Enum):
|
22
22
|
"""
|
23
|
-
|
23
|
+
API error levels
|
24
24
|
"""
|
25
25
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
29
|
ERROR = "error"
|
30
|
-
SUCCESS = "success"
|
31
30
|
INFO = "info"
|
31
|
+
SUCCESS = "success"
|
32
32
|
WARNING = "warning"
|
33
33
|
|
34
34
|
@classmethod
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: crypticorn
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.5
|
4
4
|
Summary: Maximise Your Crypto Trading Profits with AI Predictions
|
5
5
|
Author-email: Crypticorn <timon@crypticorn.com>
|
6
6
|
Project-URL: Homepage, https://crypticorn.com
|
@@ -71,7 +71,7 @@ As of know the library is available in async mode only. There are two was of usi
|
|
71
71
|
|
72
72
|
## With Async Context Protocol
|
73
73
|
```python
|
74
|
-
async with ApiClient(base_url=
|
74
|
+
async with ApiClient(base_url=BaseUrl.Prod, api_key="your-api-key") as client:
|
75
75
|
# json response
|
76
76
|
response = await client.pay.products.get_products_without_preload_content()
|
77
77
|
print(await response.json())
|
@@ -86,7 +86,7 @@ async with ApiClient(base_url="http://localhost", jwt=jwt) as client:
|
|
86
86
|
## Without Async Context Protocol
|
87
87
|
Without the context you need to close the session manually.
|
88
88
|
```python
|
89
|
-
client = ApiClient(base_url=
|
89
|
+
client = ApiClient(base_url=BaseUrl.Prod, api_key="your-api-key")
|
90
90
|
response = asyncio.run(client.hive.models.get_all_models())
|
91
91
|
asyncio.run(client.close())
|
92
92
|
```
|
@@ -57,9 +57,9 @@ crypticorn/auth/client/models/whoami200_response.py,sha256=uehdq5epgeOphhrIR3tbr
|
|
57
57
|
crypticorn/common/__init__.py,sha256=lY87VMTkIEqto6kcEjC1YWsUvT03QuPmXwxCaeWE854,196
|
58
58
|
crypticorn/common/auth.py,sha256=LEnTh2bqbljCdTNJUqTOTo2Q39gEz0JRumF1Z5MHQz0,319
|
59
59
|
crypticorn/common/auth_client.py,sha256=7ICjLRPOIXzEJXW76BgVxkNfi_QjuRdLZBX6TNvTpJE,7588
|
60
|
-
crypticorn/common/errors.py,sha256=
|
60
|
+
crypticorn/common/errors.py,sha256=Yd3zLtrqCe0NvjfqxIHohT48T4yfSi-V4s_WyYAi8t4,12614
|
61
61
|
crypticorn/common/scopes.py,sha256=pRD9RauSRSxVGo8k5b2x66h3Wy2aaVEcluZvu6aMTE0,1418
|
62
|
-
crypticorn/common/sorter.py,sha256=
|
62
|
+
crypticorn/common/sorter.py,sha256=DPkQmxDeuti4onCiE8IJZUkTc5WZp1j4dIIc7wN9En0,1167
|
63
63
|
crypticorn/common/urls.py,sha256=_NMhvhZXOsZpDBbgucqu0yboRFox6JVMlOoQq_Y5SGA,432
|
64
64
|
crypticorn/hive/__init__.py,sha256=hRfTlEzEql4msytdUC_04vfaHzVKG5CGZle1M-9QFgY,81
|
65
65
|
crypticorn/hive/main.py,sha256=RmCYSR0jwmfYWTK89dt79DuGPjEaip9XQs_LWNWr_tc,1036
|
@@ -146,7 +146,7 @@ crypticorn/pay/client/rest.py,sha256=6ZLCKhRuEMURb6glMbPriHGoN0uspDC_hvlFDKCALxo
|
|
146
146
|
crypticorn/pay/client/api/__init__.py,sha256=vbisPmBd4c5G3_MHAlInKeu1obSr8witdtwxC43BnN8,302
|
147
147
|
crypticorn/pay/client/api/now_payments_api.py,sha256=bdqm_blpCcdYAy0cnl7QbGRajQMtsAjh7FN325Kw5es,32998
|
148
148
|
crypticorn/pay/client/api/payments_api.py,sha256=CguFpYEha5sTOwwDB2hcLPd0KxjP6gIFNvwI-SgoiG8,30358
|
149
|
-
crypticorn/pay/client/api/products_api.py,sha256=
|
149
|
+
crypticorn/pay/client/api/products_api.py,sha256=ecDZ5Y83KpPx5tehTBmbRm-GNJq2I668QjSTqLGF6HE,32947
|
150
150
|
crypticorn/pay/client/api/status_api.py,sha256=8QRvrCSHBRW0n7NlIEA6LDGhsy6Wx4WqPRH81e1X2gs,9928
|
151
151
|
crypticorn/pay/client/models/__init__.py,sha256=W2NnF4IInw7iBNVZnPTkxgxos0l-H1O39ebt--aB-Gk,1515
|
152
152
|
crypticorn/pay/client/models/api_status_res.py,sha256=Dt5g0wvtyIkkVcXyFjXzxokeqZb-Y0rJr_YljjeVcfw,2514
|
@@ -173,7 +173,7 @@ crypticorn/pay/client/models/now_create_invoice_res.py,sha256=xCxAJDXJWFThIeo-om
|
|
173
173
|
crypticorn/pay/client/models/now_fee_structure.py,sha256=aGsxYVU83iAVjzb_ui8Rm5KOA6Py73rkeHEoWt_mLa4,3240
|
174
174
|
crypticorn/pay/client/models/now_payment_model.py,sha256=8HRibX74KMJnXZE3IW8TC00JThmRY3jX9nWnCI16d34,4155
|
175
175
|
crypticorn/pay/client/models/now_payment_status.py,sha256=nvjz7KucgtqmDsLfd3Khg0IK-xtPRgzXuc5hWfSOdRw,975
|
176
|
-
crypticorn/pay/client/models/now_webhook_payload.py,sha256=
|
176
|
+
crypticorn/pay/client/models/now_webhook_payload.py,sha256=2h4qfzw6F0RgTv-8IxO2o2-nC3rM_3QkehYHFBRtm3s,6846
|
177
177
|
crypticorn/pay/client/models/payment.py,sha256=dPt7eMCNcdiZdZ_Mf_4W0tkufz95YJ9Cdyq8IuIQRgE,8797
|
178
178
|
crypticorn/pay/client/models/payment_status.py,sha256=Nr__kC34aCKqSk-Gq3-mt0SI5bOTlKB1uz9hKGj8sSc,897
|
179
179
|
crypticorn/pay/client/models/product.py,sha256=ndBOZ2ED2T37VDpgbdQOG_WqwK2zlOQYnkwuLcgGrC0,2592
|
@@ -197,7 +197,7 @@ crypticorn/trade/client/api/__init__.py,sha256=s6jcukWHyom8Bp9Vj0yrOL37-dNPNvdvM
|
|
197
197
|
crypticorn/trade/client/api/api_keys_api.py,sha256=iATzCULeKgd1rE2Oe8w4vn2ZoSvGJx5KLpD2ZyTs0qY,50862
|
198
198
|
crypticorn/trade/client/api/bots_api.py,sha256=WnrJK7zTGxJhaF6Blps3hXLUo03ud0aN-V3DjOsur20,41988
|
199
199
|
crypticorn/trade/client/api/exchanges_api.py,sha256=PX8yeVZFDWxmsortW0HdphbNtYRYWaLv8nkE8VUmPgg,10166
|
200
|
-
crypticorn/trade/client/api/futures_trading_panel_api.py,sha256=
|
200
|
+
crypticorn/trade/client/api/futures_trading_panel_api.py,sha256=lD_sf4OFg4BGx5LE8sbwriHXRYKCe58b7ExJaoHKfRY,50404
|
201
201
|
crypticorn/trade/client/api/notifications_api.py,sha256=wTwrEj_GxjpxaZNCezKN6BRsI1cgWB3npcNstYZ912E,61442
|
202
202
|
crypticorn/trade/client/api/orders_api.py,sha256=zibuEr3448IefONOEcgti06nxNtJCvi6WYRN7z8Z9mE,11217
|
203
203
|
crypticorn/trade/client/api/status_api.py,sha256=deaW23XWpUMqhFzxO9GqT0MI8ZlAIC_f4ewdPLExBMw,9934
|
@@ -205,8 +205,8 @@ crypticorn/trade/client/api/strategies_api.py,sha256=asNtn8mZDTRu36PGGGHLRtevQ3N
|
|
205
205
|
crypticorn/trade/client/api/trading_actions_api.py,sha256=BfW61jUsOZxhzcYgLLF19hGeSHElarxUeK1Re0q_wpY,32402
|
206
206
|
crypticorn/trade/client/models/__init__.py,sha256=qn31GdssVyCozLVuFZfK11ju9yDwY-Y3okMyn_ZmuRA,2234
|
207
207
|
crypticorn/trade/client/models/action_model.py,sha256=W-6IJl9KgeiBkZc95HH9kdvmmb-vzYtJ-HfKN0YzC_U,10131
|
208
|
-
crypticorn/trade/client/models/api_error_identifier.py,sha256=
|
209
|
-
crypticorn/trade/client/models/api_error_level.py,sha256=
|
208
|
+
crypticorn/trade/client/models/api_error_identifier.py,sha256=X1NwUsJJyIYQuoUVaByZ3msoctJIr9w7dzZZPQ-2h-Y,4136
|
209
|
+
crypticorn/trade/client/models/api_error_level.py,sha256=78zYTqbnUGvbjptf04e6-bpF8nN-YWqGxjGrdwNe4_4,799
|
210
210
|
crypticorn/trade/client/models/api_error_type.py,sha256=ANXQ3lPxQ9Jyh_-Q4ljHFHt5uH6ljBHPzK7SDy7etek,840
|
211
211
|
crypticorn/trade/client/models/api_key_model.py,sha256=CM6BeEc3ctmfLMnRht-_k_WDCjGWreOI7670h4KhhAM,5281
|
212
212
|
crypticorn/trade/client/models/bot_model.py,sha256=t1VetjZs20-ekukHlwBaOwvMiDuZ3-hjQa1V6iaUYtE,5875
|
@@ -219,20 +219,17 @@ crypticorn/trade/client/models/http_validation_error.py,sha256=7rSmsYpBLuxIkCgl2
|
|
219
219
|
crypticorn/trade/client/models/margin_mode.py,sha256=Y02aSytOfvROKDZHrdD2xHOCDbW6tT9YL3fNkDyGIus,767
|
220
220
|
crypticorn/trade/client/models/market_type.py,sha256=38cCEUR_8X0Fbxq6fa1-BagTfEuZ2gsO3kihYs7ngCA,747
|
221
221
|
crypticorn/trade/client/models/notification_model.py,sha256=pZc15SJRWPxGWjrKyEtJFLbBEPe-hBvQX9bOOjFeGQg,5010
|
222
|
-
crypticorn/trade/client/models/notification_type.py,sha256=-mFFlW34BEbhIDP_SuAgDWUGlMggvs1HLB2Q76QIa7I,801
|
223
222
|
crypticorn/trade/client/models/order_model.py,sha256=uAP7WxfiNpqV4qdX0UZxjKf70WaelEAVDJlgVTonc3M,12682
|
224
223
|
crypticorn/trade/client/models/order_status.py,sha256=cCS3aGJmqqVhoZ1JfLS-DeRj5qj-D82AI5OFblhAsik,842
|
225
224
|
crypticorn/trade/client/models/post_futures_action.py,sha256=b2HrhvawLj5zju-DXtUl6Cl9thb03-SkP48OEUIEWX8,3113
|
226
225
|
crypticorn/trade/client/models/strategy_exchange_info.py,sha256=YCxqNTgTM9uYKhkpMdMd3Ol681sIito5h37u94o0uSk,2831
|
227
|
-
crypticorn/trade/client/models/strategy_model.py,sha256=bflR-uWhIvrMjTBv6S0JpCO9NiYh588_vqZnmz-fcm4,5636
|
228
226
|
crypticorn/trade/client/models/strategy_model_input.py,sha256=fRHX4shmmFoTMW9FfASbxS4TqEixDxJ8COiOY99LtxE,5807
|
229
227
|
crypticorn/trade/client/models/strategy_model_output.py,sha256=e2bJnZ7IvWr9ch6cWiZzRy5fZODksgmr6wjbTku1gOM,5811
|
230
228
|
crypticorn/trade/client/models/tpsl.py,sha256=QGPhcgadjxAgyzpRSwlZJg_CDLnKxdZgseSpjNnkogo,4341
|
231
229
|
crypticorn/trade/client/models/trading_action_type.py,sha256=jW0OsNz_ZNXlITxAfh979BH5U12oTXSr6qUVcKcGHhw,847
|
232
|
-
crypticorn/trade/client/models/update_notification.py,sha256=B9QUuVRNpk1e5G8o0WFgIg3inm-OX7KJAJcjVnRzYx8,3046
|
233
230
|
crypticorn/trade/client/models/validation_error.py,sha256=uTkvsKrOAt-21UC0YPqCdRl_OMsuu7uhPtWuwRSYvv0,3228
|
234
231
|
crypticorn/trade/client/models/validation_error_loc_inner.py,sha256=22ql-H829xTBgfxNQZsqd8fS3zQt9tLW1pj0iobo0jY,5131
|
235
|
-
crypticorn-2.1.
|
236
|
-
crypticorn-2.1.
|
237
|
-
crypticorn-2.1.
|
238
|
-
crypticorn-2.1.
|
232
|
+
crypticorn-2.1.5.dist-info/METADATA,sha256=8UdisEy21DdJYWNydet6iAgvD2X5qrqANj9_lE5vFdo,3138
|
233
|
+
crypticorn-2.1.5.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
234
|
+
crypticorn-2.1.5.dist-info/top_level.txt,sha256=EP3NY216qIBYfmvGl0L2Zc9ItP0DjGSkiYqd9xJwGcM,11
|
235
|
+
crypticorn-2.1.5.dist-info/RECORD,,
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
FastAPI
|
5
|
-
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
-
|
11
|
-
Do not edit the class manually.
|
12
|
-
""" # noqa: E501
|
13
|
-
|
14
|
-
|
15
|
-
from __future__ import annotations
|
16
|
-
import json
|
17
|
-
from enum import Enum
|
18
|
-
from typing_extensions import Self
|
19
|
-
|
20
|
-
|
21
|
-
class NotificationType(str, Enum):
|
22
|
-
"""
|
23
|
-
NotificationType
|
24
|
-
"""
|
25
|
-
|
26
|
-
"""
|
27
|
-
allowed enum values
|
28
|
-
"""
|
29
|
-
ERROR = "error"
|
30
|
-
SUCCESS = "success"
|
31
|
-
INFO = "info"
|
32
|
-
WARNING = "warning"
|
33
|
-
|
34
|
-
@classmethod
|
35
|
-
def from_json(cls, json_str: str) -> Self:
|
36
|
-
"""Create an instance of NotificationType from a JSON string"""
|
37
|
-
return cls(json.loads(json_str))
|
@@ -1,158 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
Trading API
|
5
|
-
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
-
|
11
|
-
Do not edit the class manually.
|
12
|
-
""" # noqa: E501
|
13
|
-
|
14
|
-
|
15
|
-
from __future__ import annotations
|
16
|
-
import pprint
|
17
|
-
import re # noqa: F401
|
18
|
-
import json
|
19
|
-
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
|
-
from typing_extensions import Annotated
|
23
|
-
from crypticorn.trade.client.models.market_type import MarketType
|
24
|
-
from crypticorn.trade.client.models.strategy_exchange_info import StrategyExchangeInfo
|
25
|
-
from typing import Optional, Set
|
26
|
-
from typing_extensions import Self
|
27
|
-
|
28
|
-
|
29
|
-
class StrategyModel(BaseModel):
|
30
|
-
"""
|
31
|
-
StrategyModel
|
32
|
-
""" # noqa: E501
|
33
|
-
|
34
|
-
created_at: Optional[StrictInt] = None
|
35
|
-
updated_at: Optional[StrictInt] = None
|
36
|
-
id: Optional[StrictStr] = None
|
37
|
-
identifier: StrictStr = Field(
|
38
|
-
description="Unique human readable identifier for the strategy e.g. 'daily_trend_momentum'"
|
39
|
-
)
|
40
|
-
name: StrictStr = Field(description="Name of the strategy")
|
41
|
-
description: StrictStr = Field(description="Description of the strategy")
|
42
|
-
exchanges: List[StrategyExchangeInfo] = Field(
|
43
|
-
description="Exchanges supported by the strategy."
|
44
|
-
)
|
45
|
-
enabled: StrictBool = Field(description="Whether the strategy is enabled")
|
46
|
-
leverage: StrictInt = Field(description="Leverage for the strategy")
|
47
|
-
performance_fee: Union[
|
48
|
-
Annotated[float, Field(le=1.0, strict=True)],
|
49
|
-
Annotated[int, Field(le=1, strict=True)],
|
50
|
-
] = Field(description="Performance fee for the strategy")
|
51
|
-
market_type: MarketType = Field(description="Market of operation of the strategy")
|
52
|
-
__properties: ClassVar[List[str]] = [
|
53
|
-
"created_at",
|
54
|
-
"updated_at",
|
55
|
-
"id",
|
56
|
-
"identifier",
|
57
|
-
"name",
|
58
|
-
"description",
|
59
|
-
"exchanges",
|
60
|
-
"enabled",
|
61
|
-
"leverage",
|
62
|
-
"performance_fee",
|
63
|
-
"market_type",
|
64
|
-
]
|
65
|
-
|
66
|
-
model_config = ConfigDict(
|
67
|
-
populate_by_name=True,
|
68
|
-
validate_assignment=True,
|
69
|
-
protected_namespaces=(),
|
70
|
-
)
|
71
|
-
|
72
|
-
def to_str(self) -> str:
|
73
|
-
"""Returns the string representation of the model using alias"""
|
74
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
75
|
-
|
76
|
-
def to_json(self) -> str:
|
77
|
-
"""Returns the JSON representation of the model using alias"""
|
78
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
79
|
-
return json.dumps(self.to_dict())
|
80
|
-
|
81
|
-
@classmethod
|
82
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
83
|
-
"""Create an instance of StrategyModel from a JSON string"""
|
84
|
-
return cls.from_dict(json.loads(json_str))
|
85
|
-
|
86
|
-
def to_dict(self) -> Dict[str, Any]:
|
87
|
-
"""Return the dictionary representation of the model using alias.
|
88
|
-
|
89
|
-
This has the following differences from calling pydantic's
|
90
|
-
`self.model_dump(by_alias=True)`:
|
91
|
-
|
92
|
-
* `None` is only added to the output dict for nullable fields that
|
93
|
-
were set at model initialization. Other fields with value `None`
|
94
|
-
are ignored.
|
95
|
-
"""
|
96
|
-
excluded_fields: Set[str] = set([])
|
97
|
-
|
98
|
-
_dict = self.model_dump(
|
99
|
-
by_alias=True,
|
100
|
-
exclude=excluded_fields,
|
101
|
-
exclude_none=True,
|
102
|
-
)
|
103
|
-
# override the default output from pydantic by calling `to_dict()` of each item in exchanges (list)
|
104
|
-
_items = []
|
105
|
-
if self.exchanges:
|
106
|
-
for _item_exchanges in self.exchanges:
|
107
|
-
if _item_exchanges:
|
108
|
-
_items.append(_item_exchanges.to_dict())
|
109
|
-
_dict["exchanges"] = _items
|
110
|
-
# set to None if created_at (nullable) is None
|
111
|
-
# and model_fields_set contains the field
|
112
|
-
if self.created_at is None and "created_at" in self.model_fields_set:
|
113
|
-
_dict["created_at"] = None
|
114
|
-
|
115
|
-
# set to None if updated_at (nullable) is None
|
116
|
-
# and model_fields_set contains the field
|
117
|
-
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
118
|
-
_dict["updated_at"] = None
|
119
|
-
|
120
|
-
# set to None if id (nullable) is None
|
121
|
-
# and model_fields_set contains the field
|
122
|
-
if self.id is None and "id" in self.model_fields_set:
|
123
|
-
_dict["id"] = None
|
124
|
-
|
125
|
-
return _dict
|
126
|
-
|
127
|
-
@classmethod
|
128
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
129
|
-
"""Create an instance of StrategyModel from a dict"""
|
130
|
-
if obj is None:
|
131
|
-
return None
|
132
|
-
|
133
|
-
if not isinstance(obj, dict):
|
134
|
-
return cls.model_validate(obj)
|
135
|
-
|
136
|
-
_obj = cls.model_validate(
|
137
|
-
{
|
138
|
-
"created_at": obj.get("created_at"),
|
139
|
-
"updated_at": obj.get("updated_at"),
|
140
|
-
"id": obj.get("id"),
|
141
|
-
"identifier": obj.get("identifier"),
|
142
|
-
"name": obj.get("name"),
|
143
|
-
"description": obj.get("description"),
|
144
|
-
"exchanges": (
|
145
|
-
[
|
146
|
-
StrategyExchangeInfo.from_dict(_item)
|
147
|
-
for _item in obj["exchanges"]
|
148
|
-
]
|
149
|
-
if obj.get("exchanges") is not None
|
150
|
-
else None
|
151
|
-
),
|
152
|
-
"enabled": obj.get("enabled"),
|
153
|
-
"leverage": obj.get("leverage"),
|
154
|
-
"performance_fee": obj.get("performance_fee"),
|
155
|
-
"market_type": obj.get("market_type"),
|
156
|
-
}
|
157
|
-
)
|
158
|
-
return _obj
|
@@ -1,95 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
FastAPI
|
5
|
-
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
-
|
11
|
-
Do not edit the class manually.
|
12
|
-
""" # noqa: E501
|
13
|
-
|
14
|
-
|
15
|
-
from __future__ import annotations
|
16
|
-
import pprint
|
17
|
-
import re # noqa: F401
|
18
|
-
import json
|
19
|
-
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from typing import Optional, Set
|
23
|
-
from typing_extensions import Self
|
24
|
-
|
25
|
-
|
26
|
-
class UpdateNotification(BaseModel):
|
27
|
-
"""
|
28
|
-
UpdateNotification
|
29
|
-
""" # noqa: E501
|
30
|
-
|
31
|
-
id: StrictStr = Field(description="UID, required in the request body")
|
32
|
-
viewed: Optional[StrictBool] = Field(
|
33
|
-
default=False, description="Whether the notification has been marked as seen"
|
34
|
-
)
|
35
|
-
sent: Optional[StrictBool] = Field(
|
36
|
-
default=False, description="Whether the notification has been sent as an email"
|
37
|
-
)
|
38
|
-
__properties: ClassVar[List[str]] = ["id", "viewed", "sent"]
|
39
|
-
|
40
|
-
model_config = ConfigDict(
|
41
|
-
populate_by_name=True,
|
42
|
-
validate_assignment=True,
|
43
|
-
protected_namespaces=(),
|
44
|
-
)
|
45
|
-
|
46
|
-
def to_str(self) -> str:
|
47
|
-
"""Returns the string representation of the model using alias"""
|
48
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
49
|
-
|
50
|
-
def to_json(self) -> str:
|
51
|
-
"""Returns the JSON representation of the model using alias"""
|
52
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
53
|
-
return json.dumps(self.to_dict())
|
54
|
-
|
55
|
-
@classmethod
|
56
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
57
|
-
"""Create an instance of UpdateNotification from a JSON string"""
|
58
|
-
return cls.from_dict(json.loads(json_str))
|
59
|
-
|
60
|
-
def to_dict(self) -> Dict[str, Any]:
|
61
|
-
"""Return the dictionary representation of the model using alias.
|
62
|
-
|
63
|
-
This has the following differences from calling pydantic's
|
64
|
-
`self.model_dump(by_alias=True)`:
|
65
|
-
|
66
|
-
* `None` is only added to the output dict for nullable fields that
|
67
|
-
were set at model initialization. Other fields with value `None`
|
68
|
-
are ignored.
|
69
|
-
"""
|
70
|
-
excluded_fields: Set[str] = set([])
|
71
|
-
|
72
|
-
_dict = self.model_dump(
|
73
|
-
by_alias=True,
|
74
|
-
exclude=excluded_fields,
|
75
|
-
exclude_none=True,
|
76
|
-
)
|
77
|
-
return _dict
|
78
|
-
|
79
|
-
@classmethod
|
80
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
81
|
-
"""Create an instance of UpdateNotification from a dict"""
|
82
|
-
if obj is None:
|
83
|
-
return None
|
84
|
-
|
85
|
-
if not isinstance(obj, dict):
|
86
|
-
return cls.model_validate(obj)
|
87
|
-
|
88
|
-
_obj = cls.model_validate(
|
89
|
-
{
|
90
|
-
"id": obj.get("id"),
|
91
|
-
"viewed": obj.get("viewed") if obj.get("viewed") is not None else False,
|
92
|
-
"sent": obj.get("sent") if obj.get("sent") is not None else False,
|
93
|
-
}
|
94
|
-
)
|
95
|
-
return _obj
|
File without changes
|
File without changes
|