crypticorn 1.0.2rc3__py3-none-any.whl → 2.0.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/__init__.py +3 -3
- crypticorn/auth/__init__.py +2 -0
- crypticorn/auth/client/__init__.py +112 -0
- crypticorn/auth/client/api/__init__.py +8 -0
- crypticorn/auth/client/api/admin_api.py +522 -0
- crypticorn/auth/client/api/auth_api.py +2089 -0
- crypticorn/auth/client/api/service_api.py +309 -0
- crypticorn/auth/client/api/user_api.py +2540 -0
- crypticorn/auth/client/api/wallet_api.py +1698 -0
- crypticorn/auth/client/api_client.py +758 -0
- crypticorn/auth/client/api_response.py +20 -0
- crypticorn/auth/client/configuration.py +584 -0
- crypticorn/auth/client/exceptions.py +220 -0
- crypticorn/auth/client/models/__init__.py +91 -0
- crypticorn/auth/client/models/add_wallet200_response.py +86 -0
- crypticorn/auth/client/models/add_wallet_request.py +107 -0
- crypticorn/auth/client/models/authorize_user200_response.py +107 -0
- crypticorn/auth/client/models/authorize_user200_response_auth.py +101 -0
- crypticorn/auth/client/models/authorize_user_request.py +96 -0
- crypticorn/auth/client/models/create_user_request.py +114 -0
- crypticorn/auth/client/models/list_wallets200_response.py +137 -0
- crypticorn/auth/client/models/list_wallets200_response_balances_inner.py +115 -0
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_sale_round.py +115 -0
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet.py +168 -0
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet_vesting_wallets_inner.py +191 -0
- crypticorn/auth/client/models/list_wallets200_response_data_inner.py +102 -0
- crypticorn/auth/client/models/list_wallets200_response_user_value.py +118 -0
- crypticorn/auth/client/models/logout_default_response.py +108 -0
- crypticorn/auth/client/models/logout_default_response_issues_inner.py +83 -0
- crypticorn/auth/client/models/refresh_token_info200_response.py +97 -0
- crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +105 -0
- crypticorn/auth/client/models/resend_verification_email_request.py +84 -0
- crypticorn/auth/client/models/revoke_user_tokens_request.py +83 -0
- crypticorn/auth/client/models/rotate_tokens200_response.py +110 -0
- crypticorn/auth/client/models/token_info200_response.py +97 -0
- crypticorn/auth/client/models/unlink_wallet_request.py +83 -0
- crypticorn/auth/client/models/update_user_request.py +93 -0
- crypticorn/auth/client/models/user_reset_password_request.py +87 -0
- crypticorn/auth/client/models/user_set_password_request.py +89 -0
- crypticorn/auth/client/models/verify200_response.py +110 -0
- crypticorn/auth/client/models/verify_email200_response.py +107 -0
- crypticorn/auth/client/models/verify_email200_response_auth.py +101 -0
- crypticorn/auth/client/models/verify_email200_response_auth_auth.py +110 -0
- crypticorn/auth/client/models/verify_email_request.py +83 -0
- crypticorn/auth/client/models/verify_wallet_request.py +91 -0
- crypticorn/auth/client/models/wallet_verified200_response.py +83 -0
- crypticorn/auth/client/models/whoami200_response.py +104 -0
- crypticorn/auth/client/rest.py +195 -0
- crypticorn/auth/main.py +45 -0
- crypticorn/client.py +46 -8
- crypticorn/common/__init__.py +5 -0
- crypticorn/common/auth.py +43 -0
- crypticorn/common/auth_client.py +163 -0
- crypticorn/common/errors.py +432 -0
- crypticorn/common/scopes.py +29 -0
- crypticorn/common/urls.py +25 -0
- crypticorn/hive/__init__.py +2 -1
- crypticorn/hive/client/__init__.py +57 -0
- crypticorn/hive/client/api/__init__.py +6 -0
- crypticorn/hive/client/api/data_api.py +594 -0
- crypticorn/hive/client/api/models_api.py +1680 -0
- crypticorn/hive/client/api/status_api.py +263 -0
- crypticorn/hive/client/api_client.py +758 -0
- crypticorn/hive/client/api_response.py +20 -0
- crypticorn/hive/client/configuration.py +612 -0
- crypticorn/hive/client/exceptions.py +220 -0
- crypticorn/hive/client/models/__init__.py +38 -0
- crypticorn/hive/client/models/coins.py +44 -0
- crypticorn/hive/client/models/data_download_response.py +113 -0
- crypticorn/hive/client/models/data_info.py +115 -0
- crypticorn/hive/client/models/data_value_value_value_inner.py +154 -0
- crypticorn/hive/client/models/data_version.py +35 -0
- crypticorn/hive/client/models/download_links.py +91 -0
- crypticorn/hive/client/models/evaluation.py +86 -0
- crypticorn/hive/client/models/evaluation_response.py +85 -0
- crypticorn/hive/client/models/feature_size.py +36 -0
- crypticorn/hive/client/models/http_validation_error.py +99 -0
- crypticorn/hive/client/models/model.py +133 -0
- crypticorn/hive/client/models/model_create.py +93 -0
- crypticorn/hive/client/models/model_status.py +35 -0
- crypticorn/hive/client/models/model_update.py +83 -0
- crypticorn/hive/client/models/target.py +36 -0
- crypticorn/hive/client/models/target_type.py +35 -0
- crypticorn/hive/client/models/validation_error.py +105 -0
- crypticorn/hive/client/models/validation_error_loc_inner.py +159 -0
- crypticorn/hive/client/py.typed +0 -0
- crypticorn/hive/client/rest.py +195 -0
- crypticorn/hive/main.py +27 -100
- crypticorn/klines/client/__init__.py +21 -7
- crypticorn/klines/client/api/__init__.py +0 -1
- crypticorn/klines/client/api/funding_rates_api.py +90 -79
- crypticorn/klines/client/api/health_check_api.py +29 -45
- crypticorn/klines/client/api/ohlcv_data_api.py +104 -87
- crypticorn/klines/client/api/symbols_api.py +36 -54
- crypticorn/klines/client/api/udf_api.py +228 -352
- crypticorn/klines/client/api_client.py +106 -148
- crypticorn/klines/client/api_response.py +2 -3
- crypticorn/klines/client/configuration.py +64 -50
- crypticorn/klines/client/exceptions.py +20 -16
- crypticorn/klines/client/models/__init__.py +21 -7
- crypticorn/klines/client/models/base_response_health_check_response.py +21 -15
- crypticorn/klines/client/models/base_response_list_funding_rate_response.py +21 -15
- crypticorn/klines/client/models/base_response_list_str.py +16 -14
- crypticorn/klines/client/models/base_response_ohlcv_response.py +21 -15
- crypticorn/klines/client/models/error_response.py +23 -15
- crypticorn/klines/client/models/exchange.py +11 -11
- crypticorn/klines/client/models/funding_rate_response.py +11 -11
- crypticorn/klines/client/models/health_check_response.py +14 -12
- crypticorn/klines/client/models/history_error_response.py +11 -11
- crypticorn/klines/client/models/history_no_data_response.py +16 -16
- crypticorn/klines/client/models/history_success_response.py +16 -16
- crypticorn/klines/client/models/http_validation_error.py +14 -10
- crypticorn/klines/client/models/market.py +2 -4
- crypticorn/klines/client/models/ohlcv_response.py +22 -15
- crypticorn/klines/client/models/resolution.py +5 -7
- crypticorn/klines/client/models/response_get_history_udf_history_get.py +71 -22
- crypticorn/klines/client/models/search_symbol_response.py +22 -15
- crypticorn/klines/client/models/sort_direction.py +2 -4
- crypticorn/klines/client/models/symbol_group_response.py +5 -9
- crypticorn/klines/client/models/symbol_info_response.py +40 -24
- crypticorn/klines/client/models/symbol_type.py +5 -10
- crypticorn/klines/client/models/timeframe.py +5 -7
- crypticorn/klines/client/models/udf_config_response.py +60 -21
- crypticorn/klines/client/models/validation_error.py +19 -13
- crypticorn/klines/client/models/validation_error_loc_inner.py +32 -11
- crypticorn/klines/client/rest.py +30 -41
- crypticorn/klines/main.py +52 -15
- crypticorn/pay/__init__.py +2 -0
- crypticorn/pay/client/__init__.py +52 -0
- crypticorn/pay/client/api/__init__.py +7 -0
- crypticorn/pay/client/api/now_payments_api.py +813 -0
- crypticorn/pay/client/api/payments_api.py +799 -0
- crypticorn/pay/client/api/products_api.py +891 -0
- crypticorn/pay/client/api/status_api.py +260 -0
- crypticorn/pay/client/api_client.py +758 -0
- crypticorn/pay/client/api_response.py +20 -0
- crypticorn/pay/client/configuration.py +612 -0
- crypticorn/pay/client/exceptions.py +220 -0
- crypticorn/pay/client/models/__init__.py +32 -0
- crypticorn/pay/client/models/api_status_res.py +83 -0
- crypticorn/pay/client/models/combined_payment_history.py +101 -0
- crypticorn/pay/client/models/create_invoice_req.py +188 -0
- crypticorn/pay/client/models/create_invoice_res.py +188 -0
- crypticorn/pay/client/models/currency.py +165 -0
- crypticorn/pay/client/models/estimate_price_req.py +91 -0
- crypticorn/pay/client/models/estimate_price_res.py +102 -0
- crypticorn/pay/client/models/get_currencies_res.py +99 -0
- crypticorn/pay/client/models/get_payment_status_res.py +222 -0
- crypticorn/pay/client/models/get_payments_list_res.py +109 -0
- crypticorn/pay/client/models/http_validation_error.py +99 -0
- crypticorn/pay/client/models/min_amount_req.py +124 -0
- crypticorn/pay/client/models/min_amount_res.py +105 -0
- crypticorn/pay/client/models/now_api_status_res.py +83 -0
- crypticorn/pay/client/models/now_create_invoice_req.py +188 -0
- crypticorn/pay/client/models/now_create_invoice_res.py +188 -0
- crypticorn/pay/client/models/now_fee_structure.py +104 -0
- crypticorn/pay/client/models/now_payment_model.py +124 -0
- crypticorn/pay/client/models/now_payment_status.py +42 -0
- crypticorn/pay/client/models/now_webhook_payload.py +181 -0
- crypticorn/pay/client/models/payment.py +231 -0
- crypticorn/pay/client/models/payment_status.py +40 -0
- crypticorn/pay/client/models/product.py +87 -0
- crypticorn/pay/client/models/product_model.py +119 -0
- crypticorn/pay/client/models/product_subs_model.py +108 -0
- crypticorn/pay/client/models/services.py +34 -0
- crypticorn/pay/client/models/unified_payment_model.py +112 -0
- crypticorn/pay/client/models/validation_error.py +105 -0
- crypticorn/pay/client/models/validation_error_loc_inner.py +159 -0
- crypticorn/pay/client/py.typed +0 -0
- crypticorn/pay/client/rest.py +195 -0
- crypticorn/pay/main.py +35 -0
- crypticorn/trade/client/__init__.py +9 -4
- crypticorn/trade/client/api/__init__.py +0 -1
- crypticorn/trade/client/api/api_keys_api.py +203 -304
- crypticorn/trade/client/api/bots_api.py +177 -250
- crypticorn/trade/client/api/exchanges_api.py +38 -57
- crypticorn/trade/client/api/futures_trading_panel_api.py +223 -321
- crypticorn/trade/client/api/notifications_api.py +247 -364
- crypticorn/trade/client/api/orders_api.py +44 -63
- crypticorn/trade/client/api/status_api.py +35 -53
- crypticorn/trade/client/api/strategies_api.py +852 -64
- crypticorn/trade/client/api/trading_actions_api.py +126 -203
- crypticorn/trade/client/api_client.py +115 -154
- crypticorn/trade/client/api_response.py +2 -3
- crypticorn/trade/client/configuration.py +128 -90
- crypticorn/trade/client/exceptions.py +21 -17
- crypticorn/trade/client/models/__init__.py +9 -4
- crypticorn/trade/client/models/action_model.py +114 -50
- crypticorn/trade/client/models/api_error_identifier.py +60 -51
- crypticorn/trade/client/models/api_error_level.py +37 -0
- crypticorn/trade/client/models/api_error_type.py +37 -0
- crypticorn/trade/client/models/api_key_model.py +49 -28
- crypticorn/trade/client/models/bot_model.py +76 -31
- crypticorn/trade/client/models/bot_status.py +37 -0
- crypticorn/trade/client/models/exchange.py +3 -5
- crypticorn/trade/client/models/execution_ids.py +14 -14
- crypticorn/trade/client/models/futures_balance.py +39 -23
- crypticorn/trade/client/models/futures_trading_action.py +98 -46
- crypticorn/trade/client/models/http_validation_error.py +15 -11
- crypticorn/trade/client/models/margin_mode.py +3 -5
- crypticorn/trade/client/models/market_type.py +3 -5
- crypticorn/trade/client/models/notification_model.py +60 -27
- crypticorn/trade/client/models/notification_type.py +4 -6
- crypticorn/trade/client/models/order_model.py +125 -65
- crypticorn/trade/client/models/order_status.py +6 -8
- crypticorn/trade/client/models/post_futures_action.py +16 -12
- crypticorn/trade/client/models/strategy_exchange_info.py +11 -12
- crypticorn/trade/client/models/strategy_model.py +66 -27
- crypticorn/trade/client/models/strategy_model_input.py +160 -0
- crypticorn/trade/client/models/strategy_model_output.py +160 -0
- crypticorn/trade/client/models/tpsl.py +35 -21
- crypticorn/trade/client/models/trading_action_type.py +5 -7
- crypticorn/trade/client/models/update_notification.py +17 -13
- crypticorn/trade/client/models/validation_error.py +20 -14
- crypticorn/trade/client/models/validation_error_loc_inner.py +33 -12
- crypticorn/trade/client/rest.py +108 -170
- crypticorn/trade/main.py +26 -19
- crypticorn-2.0.0.dist-info/METADATA +74 -0
- crypticorn-2.0.0.dist-info/RECORD +226 -0
- {crypticorn-1.0.2rc3.dist-info → crypticorn-2.0.0.dist-info}/WHEEL +1 -1
- crypticorn/hive/requirements.txt +0 -4
- crypticorn/hive/utils.py +0 -109
- crypticorn/klines/requirements.txt +0 -4
- crypticorn/klines/test/test_base_response_health_check_response.py +0 -56
- crypticorn/klines/test/test_base_response_list_funding_rate_response.py +0 -59
- crypticorn/klines/test/test_base_response_list_str.py +0 -56
- crypticorn/klines/test/test_base_response_ohlcv_response.py +0 -72
- crypticorn/klines/test/test_error_response.py +0 -57
- crypticorn/klines/test/test_exchange.py +0 -56
- crypticorn/klines/test/test_funding_rate_response.py +0 -56
- crypticorn/klines/test/test_funding_rates_api.py +0 -38
- crypticorn/klines/test/test_health_check_api.py +0 -38
- crypticorn/klines/test/test_health_check_response.py +0 -52
- crypticorn/klines/test/test_history_error_response.py +0 -53
- crypticorn/klines/test/test_history_no_data_response.py +0 -69
- crypticorn/klines/test/test_history_success_response.py +0 -87
- crypticorn/klines/test/test_http_validation_error.py +0 -58
- crypticorn/klines/test/test_market.py +0 -33
- crypticorn/klines/test/test_ohlcv_data_api.py +0 -38
- crypticorn/klines/test/test_ohlcv_response.py +0 -86
- crypticorn/klines/test/test_resolution.py +0 -33
- crypticorn/klines/test/test_response_get_history_udf_history_get.py +0 -89
- crypticorn/klines/test/test_search_symbol_response.py +0 -62
- crypticorn/klines/test/test_sort_direction.py +0 -33
- crypticorn/klines/test/test_symbol_group_response.py +0 -53
- crypticorn/klines/test/test_symbol_info_response.py +0 -84
- crypticorn/klines/test/test_symbol_type.py +0 -54
- crypticorn/klines/test/test_symbols_api.py +0 -38
- crypticorn/klines/test/test_timeframe.py +0 -33
- crypticorn/klines/test/test_udf_api.py +0 -80
- crypticorn/klines/test/test_udf_config_response.py +0 -95
- crypticorn/klines/test/test_validation_error.py +0 -60
- crypticorn/klines/test/test_validation_error_loc_inner.py +0 -50
- crypticorn/trade/requirements.txt +0 -4
- crypticorn-1.0.2rc3.dist-info/LICENSE.md +0 -19
- crypticorn-1.0.2rc3.dist-info/METADATA +0 -47
- crypticorn-1.0.2rc3.dist-info/RECORD +0 -128
- /crypticorn/{klines/test/__init__.py → auth/client/py.typed} +0 -0
- {crypticorn-1.0.2rc3.dist-info → crypticorn-2.0.0.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
|
|
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
|
|
@@ -23,16 +23,32 @@ from typing_extensions import Annotated
|
|
23
23
|
from typing import Optional, Set
|
24
24
|
from typing_extensions import Self
|
25
25
|
|
26
|
+
|
26
27
|
class TPSL(BaseModel):
|
27
28
|
"""
|
28
29
|
Model for take profit and stop loss targets
|
29
|
-
"""
|
30
|
-
|
30
|
+
""" # noqa: E501
|
31
|
+
|
32
|
+
price_delta: Optional[
|
33
|
+
Union[
|
34
|
+
Annotated[float, Field(strict=True, ge=0.0)],
|
35
|
+
Annotated[int, Field(strict=True, ge=0)],
|
36
|
+
]
|
37
|
+
] = None
|
31
38
|
price: Optional[Union[StrictFloat, StrictInt]] = None
|
32
|
-
allocation: Union[
|
39
|
+
allocation: Union[
|
40
|
+
Annotated[float, Field(le=1.0, strict=True, ge=0.0)],
|
41
|
+
Annotated[int, Field(le=1, strict=True, ge=0)],
|
42
|
+
] = Field(description="Percentage of the order to sell")
|
33
43
|
execution_id: Optional[StrictStr] = None
|
34
44
|
client_order_id: Optional[StrictStr] = None
|
35
|
-
__properties: ClassVar[List[str]] = [
|
45
|
+
__properties: ClassVar[List[str]] = [
|
46
|
+
"price_delta",
|
47
|
+
"price",
|
48
|
+
"allocation",
|
49
|
+
"execution_id",
|
50
|
+
"client_order_id",
|
51
|
+
]
|
36
52
|
|
37
53
|
model_config = ConfigDict(
|
38
54
|
populate_by_name=True,
|
@@ -40,7 +56,6 @@ class TPSL(BaseModel):
|
|
40
56
|
protected_namespaces=(),
|
41
57
|
)
|
42
58
|
|
43
|
-
|
44
59
|
def to_str(self) -> str:
|
45
60
|
"""Returns the string representation of the model using alias"""
|
46
61
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -65,8 +80,7 @@ class TPSL(BaseModel):
|
|
65
80
|
were set at model initialization. Other fields with value `None`
|
66
81
|
are ignored.
|
67
82
|
"""
|
68
|
-
excluded_fields: Set[str] = set([
|
69
|
-
])
|
83
|
+
excluded_fields: Set[str] = set([])
|
70
84
|
|
71
85
|
_dict = self.model_dump(
|
72
86
|
by_alias=True,
|
@@ -76,22 +90,22 @@ class TPSL(BaseModel):
|
|
76
90
|
# set to None if price_delta (nullable) is None
|
77
91
|
# and model_fields_set contains the field
|
78
92
|
if self.price_delta is None and "price_delta" in self.model_fields_set:
|
79
|
-
_dict[
|
93
|
+
_dict["price_delta"] = None
|
80
94
|
|
81
95
|
# set to None if price (nullable) is None
|
82
96
|
# and model_fields_set contains the field
|
83
97
|
if self.price is None and "price" in self.model_fields_set:
|
84
|
-
_dict[
|
98
|
+
_dict["price"] = None
|
85
99
|
|
86
100
|
# set to None if execution_id (nullable) is None
|
87
101
|
# and model_fields_set contains the field
|
88
102
|
if self.execution_id is None and "execution_id" in self.model_fields_set:
|
89
|
-
_dict[
|
103
|
+
_dict["execution_id"] = None
|
90
104
|
|
91
105
|
# set to None if client_order_id (nullable) is None
|
92
106
|
# and model_fields_set contains the field
|
93
107
|
if self.client_order_id is None and "client_order_id" in self.model_fields_set:
|
94
|
-
_dict[
|
108
|
+
_dict["client_order_id"] = None
|
95
109
|
|
96
110
|
return _dict
|
97
111
|
|
@@ -104,13 +118,13 @@ class TPSL(BaseModel):
|
|
104
118
|
if not isinstance(obj, dict):
|
105
119
|
return cls.model_validate(obj)
|
106
120
|
|
107
|
-
_obj = cls.model_validate(
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
121
|
+
_obj = cls.model_validate(
|
122
|
+
{
|
123
|
+
"price_delta": obj.get("price_delta"),
|
124
|
+
"price": obj.get("price"),
|
125
|
+
"allocation": obj.get("allocation"),
|
126
|
+
"execution_id": obj.get("execution_id"),
|
127
|
+
"client_order_id": obj.get("client_order_id"),
|
128
|
+
}
|
129
|
+
)
|
114
130
|
return _obj
|
115
|
-
|
116
|
-
|
@@ -1,7 +1,7 @@
|
|
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
|
|
@@ -26,14 +26,12 @@ class TradingActionType(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
OPEN_LONG =
|
30
|
-
OPEN_SHORT =
|
31
|
-
CLOSE_LONG =
|
32
|
-
CLOSE_SHORT =
|
29
|
+
OPEN_LONG = "open_long"
|
30
|
+
OPEN_SHORT = "open_short"
|
31
|
+
CLOSE_LONG = "close_long"
|
32
|
+
CLOSE_SHORT = "close_short"
|
33
33
|
|
34
34
|
@classmethod
|
35
35
|
def from_json(cls, json_str: str) -> Self:
|
36
36
|
"""Create an instance of TradingActionType from a JSON string"""
|
37
37
|
return cls(json.loads(json_str))
|
38
|
-
|
39
|
-
|
@@ -22,13 +22,19 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing import Optional, Set
|
23
23
|
from typing_extensions import Self
|
24
24
|
|
25
|
+
|
25
26
|
class UpdateNotification(BaseModel):
|
26
27
|
"""
|
27
28
|
UpdateNotification
|
28
|
-
"""
|
29
|
+
""" # noqa: E501
|
30
|
+
|
29
31
|
id: StrictStr = Field(description="UID, required in the request body")
|
30
|
-
viewed: Optional[StrictBool] = Field(
|
31
|
-
|
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
|
+
)
|
32
38
|
__properties: ClassVar[List[str]] = ["id", "viewed", "sent"]
|
33
39
|
|
34
40
|
model_config = ConfigDict(
|
@@ -37,7 +43,6 @@ class UpdateNotification(BaseModel):
|
|
37
43
|
protected_namespaces=(),
|
38
44
|
)
|
39
45
|
|
40
|
-
|
41
46
|
def to_str(self) -> str:
|
42
47
|
"""Returns the string representation of the model using alias"""
|
43
48
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -62,8 +67,7 @@ class UpdateNotification(BaseModel):
|
|
62
67
|
were set at model initialization. Other fields with value `None`
|
63
68
|
are ignored.
|
64
69
|
"""
|
65
|
-
excluded_fields: Set[str] = set([
|
66
|
-
])
|
70
|
+
excluded_fields: Set[str] = set([])
|
67
71
|
|
68
72
|
_dict = self.model_dump(
|
69
73
|
by_alias=True,
|
@@ -81,11 +85,11 @@ class UpdateNotification(BaseModel):
|
|
81
85
|
if not isinstance(obj, dict):
|
82
86
|
return cls.model_validate(obj)
|
83
87
|
|
84
|
-
_obj = cls.model_validate(
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
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
|
+
)
|
89
95
|
return _obj
|
90
|
-
|
91
|
-
|
@@ -1,7 +1,7 @@
|
|
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
|
|
@@ -19,14 +19,18 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
22
|
-
from crypticorn.trade.client.models.validation_error_loc_inner import
|
22
|
+
from crypticorn.trade.client.models.validation_error_loc_inner import (
|
23
|
+
ValidationErrorLocInner,
|
24
|
+
)
|
23
25
|
from typing import Optional, Set
|
24
26
|
from typing_extensions import Self
|
25
27
|
|
28
|
+
|
26
29
|
class ValidationError(BaseModel):
|
27
30
|
"""
|
28
31
|
ValidationError
|
29
|
-
"""
|
32
|
+
""" # noqa: E501
|
33
|
+
|
30
34
|
loc: List[ValidationErrorLocInner]
|
31
35
|
msg: StrictStr
|
32
36
|
type: StrictStr
|
@@ -38,7 +42,6 @@ class ValidationError(BaseModel):
|
|
38
42
|
protected_namespaces=(),
|
39
43
|
)
|
40
44
|
|
41
|
-
|
42
45
|
def to_str(self) -> str:
|
43
46
|
"""Returns the string representation of the model using alias"""
|
44
47
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -63,8 +66,7 @@ class ValidationError(BaseModel):
|
|
63
66
|
were set at model initialization. Other fields with value `None`
|
64
67
|
are ignored.
|
65
68
|
"""
|
66
|
-
excluded_fields: Set[str] = set([
|
67
|
-
])
|
69
|
+
excluded_fields: Set[str] = set([])
|
68
70
|
|
69
71
|
_dict = self.model_dump(
|
70
72
|
by_alias=True,
|
@@ -77,7 +79,7 @@ class ValidationError(BaseModel):
|
|
77
79
|
for _item_loc in self.loc:
|
78
80
|
if _item_loc:
|
79
81
|
_items.append(_item_loc.to_dict())
|
80
|
-
_dict[
|
82
|
+
_dict["loc"] = _items
|
81
83
|
return _dict
|
82
84
|
|
83
85
|
@classmethod
|
@@ -89,11 +91,15 @@ class ValidationError(BaseModel):
|
|
89
91
|
if not isinstance(obj, dict):
|
90
92
|
return cls.model_validate(obj)
|
91
93
|
|
92
|
-
_obj = cls.model_validate(
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
94
|
+
_obj = cls.model_validate(
|
95
|
+
{
|
96
|
+
"loc": (
|
97
|
+
[ValidationErrorLocInner.from_dict(_item) for _item in obj["loc"]]
|
98
|
+
if obj.get("loc") is not None
|
99
|
+
else None
|
100
|
+
),
|
101
|
+
"msg": obj.get("msg"),
|
102
|
+
"type": obj.get("type"),
|
103
|
+
}
|
104
|
+
)
|
97
105
|
return _obj
|
98
|
-
|
99
|
-
|
@@ -1,7 +1,7 @@
|
|
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
|
|
@@ -17,7 +17,15 @@ from inspect import getfullargspec
|
|
17
17
|
import json
|
18
18
|
import pprint
|
19
19
|
import re # noqa: F401
|
20
|
-
from pydantic import
|
20
|
+
from pydantic import (
|
21
|
+
BaseModel,
|
22
|
+
ConfigDict,
|
23
|
+
Field,
|
24
|
+
StrictInt,
|
25
|
+
StrictStr,
|
26
|
+
ValidationError,
|
27
|
+
field_validator,
|
28
|
+
)
|
21
29
|
from typing import Optional
|
22
30
|
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
23
31
|
from typing_extensions import Literal, Self
|
@@ -25,6 +33,7 @@ from pydantic import Field
|
|
25
33
|
|
26
34
|
VALIDATIONERRORLOCINNER_ANY_OF_SCHEMAS = ["int", "str"]
|
27
35
|
|
36
|
+
|
28
37
|
class ValidationErrorLocInner(BaseModel):
|
29
38
|
"""
|
30
39
|
ValidationErrorLocInner
|
@@ -38,7 +47,7 @@ class ValidationErrorLocInner(BaseModel):
|
|
38
47
|
actual_instance: Optional[Union[int, str]] = None
|
39
48
|
else:
|
40
49
|
actual_instance: Any = None
|
41
|
-
any_of_schemas: Set[str] = {
|
50
|
+
any_of_schemas: Set[str] = {"int", "str"}
|
42
51
|
|
43
52
|
model_config = {
|
44
53
|
"validate_assignment": True,
|
@@ -48,14 +57,18 @@ class ValidationErrorLocInner(BaseModel):
|
|
48
57
|
def __init__(self, *args, **kwargs) -> None:
|
49
58
|
if args:
|
50
59
|
if len(args) > 1:
|
51
|
-
raise ValueError(
|
60
|
+
raise ValueError(
|
61
|
+
"If a position argument is used, only 1 is allowed to set `actual_instance`"
|
62
|
+
)
|
52
63
|
if kwargs:
|
53
|
-
raise ValueError(
|
64
|
+
raise ValueError(
|
65
|
+
"If a position argument is used, keyword arguments cannot be used."
|
66
|
+
)
|
54
67
|
super().__init__(actual_instance=args[0])
|
55
68
|
else:
|
56
69
|
super().__init__(**kwargs)
|
57
70
|
|
58
|
-
@field_validator(
|
71
|
+
@field_validator("actual_instance")
|
59
72
|
def actual_instance_must_validate_anyof(cls, v):
|
60
73
|
instance = ValidationErrorLocInner.model_construct()
|
61
74
|
error_messages = []
|
@@ -73,7 +86,10 @@ class ValidationErrorLocInner(BaseModel):
|
|
73
86
|
error_messages.append(str(e))
|
74
87
|
if error_messages:
|
75
88
|
# no match
|
76
|
-
raise ValueError(
|
89
|
+
raise ValueError(
|
90
|
+
"No match found when setting the actual_instance in ValidationErrorLocInner with anyOf schemas: int, str. Details: "
|
91
|
+
+ ", ".join(error_messages)
|
92
|
+
)
|
77
93
|
else:
|
78
94
|
return v
|
79
95
|
|
@@ -107,7 +123,10 @@ class ValidationErrorLocInner(BaseModel):
|
|
107
123
|
|
108
124
|
if error_messages:
|
109
125
|
# no match
|
110
|
-
raise ValueError(
|
126
|
+
raise ValueError(
|
127
|
+
"No match found when deserializing the JSON string into ValidationErrorLocInner with anyOf schemas: int, str. Details: "
|
128
|
+
+ ", ".join(error_messages)
|
129
|
+
)
|
111
130
|
else:
|
112
131
|
return instance
|
113
132
|
|
@@ -116,7 +135,9 @@ class ValidationErrorLocInner(BaseModel):
|
|
116
135
|
if self.actual_instance is None:
|
117
136
|
return "null"
|
118
137
|
|
119
|
-
if hasattr(self.actual_instance, "to_json") and callable(
|
138
|
+
if hasattr(self.actual_instance, "to_json") and callable(
|
139
|
+
self.actual_instance.to_json
|
140
|
+
):
|
120
141
|
return self.actual_instance.to_json()
|
121
142
|
else:
|
122
143
|
return json.dumps(self.actual_instance)
|
@@ -126,7 +147,9 @@ class ValidationErrorLocInner(BaseModel):
|
|
126
147
|
if self.actual_instance is None:
|
127
148
|
return None
|
128
149
|
|
129
|
-
if hasattr(self.actual_instance, "to_dict") and callable(
|
150
|
+
if hasattr(self.actual_instance, "to_dict") and callable(
|
151
|
+
self.actual_instance.to_dict
|
152
|
+
):
|
130
153
|
return self.actual_instance.to_dict()
|
131
154
|
else:
|
132
155
|
return self.actual_instance
|
@@ -134,5 +157,3 @@ class ValidationErrorLocInner(BaseModel):
|
|
134
157
|
def to_str(self) -> str:
|
135
158
|
"""Returns the string representation of the actual instance"""
|
136
159
|
return pprint.pformat(self.model_dump())
|
137
|
-
|
138
|
-
|