crypticorn 2.4.6__py3-none-any.whl → 2.4.7__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/auth.py +7 -9
- crypticorn/common/errors.py +5 -0
- crypticorn/common/utils.py +15 -5
- crypticorn/klines/main.py +10 -5
- crypticorn/metrics/main.py +5 -4
- crypticorn/trade/client/__init__.py +6 -8
- crypticorn/trade/client/api/__init__.py +1 -0
- crypticorn/trade/client/api/api_keys_api.py +273 -167
- crypticorn/trade/client/api/bots_api.py +226 -140
- crypticorn/trade/client/api/exchanges_api.py +51 -31
- crypticorn/trade/client/api/futures_trading_panel_api.py +272 -169
- crypticorn/trade/client/api/notifications_api.py +323 -200
- crypticorn/trade/client/api/orders_api.py +60 -40
- crypticorn/trade/client/api/status_api.py +49 -31
- crypticorn/trade/client/api/strategies_api.py +223 -137
- crypticorn/trade/client/api/trading_actions_api.py +170 -106
- crypticorn/trade/client/api_client.py +153 -111
- crypticorn/trade/client/api_response.py +3 -2
- crypticorn/trade/client/configuration.py +115 -128
- crypticorn/trade/client/exceptions.py +21 -25
- crypticorn/trade/client/models/__init__.py +6 -8
- crypticorn/trade/client/models/action_model.py +54 -108
- crypticorn/trade/client/models/api_error_identifier.py +72 -76
- crypticorn/trade/client/models/api_error_level.py +11 -9
- crypticorn/trade/client/models/api_error_type.py +11 -9
- crypticorn/trade/client/models/bot_model.py +36 -57
- crypticorn/trade/client/models/bot_status.py +11 -9
- crypticorn/trade/client/models/exchange.py +9 -7
- crypticorn/trade/client/models/exchange_key_model.py +34 -44
- crypticorn/trade/client/models/execution_ids.py +18 -18
- crypticorn/trade/client/models/futures_balance.py +27 -43
- crypticorn/trade/client/models/futures_trading_action.py +50 -102
- crypticorn/trade/client/models/http_validation_error.py +15 -19
- crypticorn/trade/client/models/margin_mode.py +9 -7
- crypticorn/trade/client/models/market_type.py +9 -7
- crypticorn/trade/client/models/notification_model.py +32 -52
- crypticorn/trade/client/models/order_model.py +72 -112
- crypticorn/trade/client/models/order_status.py +12 -10
- crypticorn/trade/client/models/post_futures_action.py +16 -20
- crypticorn/trade/client/models/strategy_exchange_info.py +16 -15
- crypticorn/trade/client/models/strategy_model_input.py +33 -61
- crypticorn/trade/client/models/strategy_model_output.py +33 -61
- crypticorn/trade/client/models/tpsl.py +25 -39
- crypticorn/trade/client/models/trading_action_type.py +11 -9
- crypticorn/trade/client/models/validation_error.py +18 -24
- crypticorn/trade/client/models/validation_error_loc_inner.py +16 -37
- crypticorn/trade/client/rest.py +38 -23
- {crypticorn-2.4.6.dist-info → crypticorn-2.4.7.dist-info}/METADATA +8 -2
- {crypticorn-2.4.6.dist-info → crypticorn-2.4.7.dist-info}/RECORD +52 -52
- {crypticorn-2.4.6.dist-info → crypticorn-2.4.7.dist-info}/WHEEL +0 -0
- {crypticorn-2.4.6.dist-info → crypticorn-2.4.7.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.4.6.dist-info → crypticorn-2.4.7.dist-info}/top_level.txt +0 -0
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
Trading API
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
Do not edit the class manually.
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -17,15 +17,7 @@ import pprint
|
|
17
17
|
import re # noqa: F401
|
18
18
|
import json
|
19
19
|
|
20
|
-
from pydantic import
|
21
|
-
BaseModel,
|
22
|
-
ConfigDict,
|
23
|
-
Field,
|
24
|
-
StrictBool,
|
25
|
-
StrictFloat,
|
26
|
-
StrictInt,
|
27
|
-
StrictStr,
|
28
|
-
)
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
|
29
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
30
22
|
from typing_extensions import Annotated
|
31
23
|
from crypticorn.trade.client.models.margin_mode import MarginMode
|
@@ -35,12 +27,10 @@ from crypticorn.trade.client.models.trading_action_type import TradingActionType
|
|
35
27
|
from typing import Optional, Set
|
36
28
|
from typing_extensions import Self
|
37
29
|
|
38
|
-
|
39
30
|
class FuturesTradingAction(BaseModel):
|
40
31
|
"""
|
41
32
|
Model for futures trading actions
|
42
|
-
"""
|
43
|
-
|
33
|
+
""" # noqa: E501
|
44
34
|
id: Optional[StrictStr] = None
|
45
35
|
execution_id: Optional[StrictStr] = None
|
46
36
|
open_order_execution_id: Optional[StrictStr] = None
|
@@ -48,45 +38,17 @@ class FuturesTradingAction(BaseModel):
|
|
48
38
|
action_type: TradingActionType = Field(description="The type of action.")
|
49
39
|
market_type: MarketType = Field(description="The type of market the action is for.")
|
50
40
|
strategy_id: StrictStr = Field(description="UID for the strategy.")
|
51
|
-
symbol: StrictStr = Field(
|
52
|
-
description="Trading symbol or asset pair in format: 'symbol/quote_currency' (see market service for valid symbols)"
|
53
|
-
)
|
41
|
+
symbol: StrictStr = Field(description="Trading symbol or asset pair in format: 'symbol/quote_currency' (see market service for valid symbols)")
|
54
42
|
is_limit: Optional[StrictBool] = None
|
55
43
|
limit_price: Optional[Union[StrictFloat, StrictInt]] = None
|
56
|
-
allocation: Optional[
|
57
|
-
Union[
|
58
|
-
Annotated[float, Field(le=1.0, strict=True)],
|
59
|
-
Annotated[int, Field(le=1, strict=True)],
|
60
|
-
]
|
61
|
-
] = Field(
|
62
|
-
default=None,
|
63
|
-
description="How much of bot's balance to use for the order (for open actions). How much of the reference open order (open_order_execution_id) to close (for close actions). 0=0%, 1=100%.",
|
64
|
-
)
|
44
|
+
allocation: Optional[Union[Annotated[float, Field(le=1.0, strict=True)], Annotated[int, Field(le=1, strict=True)]]] = Field(default=None, description="How much of bot's balance to use for the order (for open actions). How much of the reference open order (open_order_execution_id) to close (for close actions). 0=0%, 1=100%.")
|
65
45
|
take_profit: Optional[List[TPSL]] = None
|
66
46
|
stop_loss: Optional[List[TPSL]] = None
|
67
47
|
expiry_timestamp: Optional[StrictInt] = None
|
68
48
|
position_id: Optional[StrictStr] = None
|
69
49
|
leverage: Optional[Annotated[int, Field(strict=True, ge=1)]]
|
70
50
|
margin_mode: Optional[MarginMode] = None
|
71
|
-
__properties: ClassVar[List[str]] = [
|
72
|
-
"id",
|
73
|
-
"execution_id",
|
74
|
-
"open_order_execution_id",
|
75
|
-
"client_order_id",
|
76
|
-
"action_type",
|
77
|
-
"market_type",
|
78
|
-
"strategy_id",
|
79
|
-
"symbol",
|
80
|
-
"is_limit",
|
81
|
-
"limit_price",
|
82
|
-
"allocation",
|
83
|
-
"take_profit",
|
84
|
-
"stop_loss",
|
85
|
-
"expiry_timestamp",
|
86
|
-
"position_id",
|
87
|
-
"leverage",
|
88
|
-
"margin_mode",
|
89
|
-
]
|
51
|
+
__properties: ClassVar[List[str]] = ["id", "execution_id", "open_order_execution_id", "client_order_id", "action_type", "market_type", "strategy_id", "symbol", "is_limit", "limit_price", "allocation", "take_profit", "stop_loss", "expiry_timestamp", "position_id", "leverage", "margin_mode"]
|
90
52
|
|
91
53
|
model_config = ConfigDict(
|
92
54
|
populate_by_name=True,
|
@@ -94,6 +56,7 @@ class FuturesTradingAction(BaseModel):
|
|
94
56
|
protected_namespaces=(),
|
95
57
|
)
|
96
58
|
|
59
|
+
|
97
60
|
def to_str(self) -> str:
|
98
61
|
"""Returns the string representation of the model using alias"""
|
99
62
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -118,7 +81,8 @@ class FuturesTradingAction(BaseModel):
|
|
118
81
|
were set at model initialization. Other fields with value `None`
|
119
82
|
are ignored.
|
120
83
|
"""
|
121
|
-
excluded_fields: Set[str] = set([
|
84
|
+
excluded_fields: Set[str] = set([
|
85
|
+
])
|
122
86
|
|
123
87
|
_dict = self.model_dump(
|
124
88
|
by_alias=True,
|
@@ -131,79 +95,73 @@ class FuturesTradingAction(BaseModel):
|
|
131
95
|
for _item_take_profit in self.take_profit:
|
132
96
|
if _item_take_profit:
|
133
97
|
_items.append(_item_take_profit.to_dict())
|
134
|
-
_dict[
|
98
|
+
_dict['take_profit'] = _items
|
135
99
|
# override the default output from pydantic by calling `to_dict()` of each item in stop_loss (list)
|
136
100
|
_items = []
|
137
101
|
if self.stop_loss:
|
138
102
|
for _item_stop_loss in self.stop_loss:
|
139
103
|
if _item_stop_loss:
|
140
104
|
_items.append(_item_stop_loss.to_dict())
|
141
|
-
_dict[
|
105
|
+
_dict['stop_loss'] = _items
|
142
106
|
# set to None if id (nullable) is None
|
143
107
|
# and model_fields_set contains the field
|
144
108
|
if self.id is None and "id" in self.model_fields_set:
|
145
|
-
_dict[
|
109
|
+
_dict['id'] = None
|
146
110
|
|
147
111
|
# set to None if execution_id (nullable) is None
|
148
112
|
# and model_fields_set contains the field
|
149
113
|
if self.execution_id is None and "execution_id" in self.model_fields_set:
|
150
|
-
_dict[
|
114
|
+
_dict['execution_id'] = None
|
151
115
|
|
152
116
|
# set to None if open_order_execution_id (nullable) is None
|
153
117
|
# and model_fields_set contains the field
|
154
|
-
if
|
155
|
-
|
156
|
-
and "open_order_execution_id" in self.model_fields_set
|
157
|
-
):
|
158
|
-
_dict["open_order_execution_id"] = None
|
118
|
+
if self.open_order_execution_id is None and "open_order_execution_id" in self.model_fields_set:
|
119
|
+
_dict['open_order_execution_id'] = None
|
159
120
|
|
160
121
|
# set to None if client_order_id (nullable) is None
|
161
122
|
# and model_fields_set contains the field
|
162
123
|
if self.client_order_id is None and "client_order_id" in self.model_fields_set:
|
163
|
-
_dict[
|
124
|
+
_dict['client_order_id'] = None
|
164
125
|
|
165
126
|
# set to None if is_limit (nullable) is None
|
166
127
|
# and model_fields_set contains the field
|
167
128
|
if self.is_limit is None and "is_limit" in self.model_fields_set:
|
168
|
-
_dict[
|
129
|
+
_dict['is_limit'] = None
|
169
130
|
|
170
131
|
# set to None if limit_price (nullable) is None
|
171
132
|
# and model_fields_set contains the field
|
172
133
|
if self.limit_price is None and "limit_price" in self.model_fields_set:
|
173
|
-
_dict[
|
134
|
+
_dict['limit_price'] = None
|
174
135
|
|
175
136
|
# set to None if take_profit (nullable) is None
|
176
137
|
# and model_fields_set contains the field
|
177
138
|
if self.take_profit is None and "take_profit" in self.model_fields_set:
|
178
|
-
_dict[
|
139
|
+
_dict['take_profit'] = None
|
179
140
|
|
180
141
|
# set to None if stop_loss (nullable) is None
|
181
142
|
# and model_fields_set contains the field
|
182
143
|
if self.stop_loss is None and "stop_loss" in self.model_fields_set:
|
183
|
-
_dict[
|
144
|
+
_dict['stop_loss'] = None
|
184
145
|
|
185
146
|
# set to None if expiry_timestamp (nullable) is None
|
186
147
|
# and model_fields_set contains the field
|
187
|
-
if
|
188
|
-
|
189
|
-
and "expiry_timestamp" in self.model_fields_set
|
190
|
-
):
|
191
|
-
_dict["expiry_timestamp"] = None
|
148
|
+
if self.expiry_timestamp is None and "expiry_timestamp" in self.model_fields_set:
|
149
|
+
_dict['expiry_timestamp'] = None
|
192
150
|
|
193
151
|
# set to None if position_id (nullable) is None
|
194
152
|
# and model_fields_set contains the field
|
195
153
|
if self.position_id is None and "position_id" in self.model_fields_set:
|
196
|
-
_dict[
|
154
|
+
_dict['position_id'] = None
|
197
155
|
|
198
156
|
# set to None if leverage (nullable) is None
|
199
157
|
# and model_fields_set contains the field
|
200
158
|
if self.leverage is None and "leverage" in self.model_fields_set:
|
201
|
-
_dict[
|
159
|
+
_dict['leverage'] = None
|
202
160
|
|
203
161
|
# set to None if margin_mode (nullable) is None
|
204
162
|
# and model_fields_set contains the field
|
205
163
|
if self.margin_mode is None and "margin_mode" in self.model_fields_set:
|
206
|
-
_dict[
|
164
|
+
_dict['margin_mode'] = None
|
207
165
|
|
208
166
|
return _dict
|
209
167
|
|
@@ -216,35 +174,25 @@ class FuturesTradingAction(BaseModel):
|
|
216
174
|
if not isinstance(obj, dict):
|
217
175
|
return cls.model_validate(obj)
|
218
176
|
|
219
|
-
_obj = cls.model_validate(
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
[TPSL.from_dict(_item) for _item in obj["stop_loss"]]
|
239
|
-
if obj.get("stop_loss") is not None
|
240
|
-
else None
|
241
|
-
),
|
242
|
-
"expiry_timestamp": obj.get("expiry_timestamp"),
|
243
|
-
"position_id": obj.get("position_id"),
|
244
|
-
"leverage": (
|
245
|
-
obj.get("leverage") if obj.get("leverage") is not None else 1
|
246
|
-
),
|
247
|
-
"margin_mode": obj.get("margin_mode"),
|
248
|
-
}
|
249
|
-
)
|
177
|
+
_obj = cls.model_validate({
|
178
|
+
"id": obj.get("id"),
|
179
|
+
"execution_id": obj.get("execution_id"),
|
180
|
+
"open_order_execution_id": obj.get("open_order_execution_id"),
|
181
|
+
"client_order_id": obj.get("client_order_id"),
|
182
|
+
"action_type": obj.get("action_type"),
|
183
|
+
"market_type": obj.get("market_type"),
|
184
|
+
"strategy_id": obj.get("strategy_id"),
|
185
|
+
"symbol": obj.get("symbol"),
|
186
|
+
"is_limit": obj.get("is_limit"),
|
187
|
+
"limit_price": obj.get("limit_price"),
|
188
|
+
"allocation": obj.get("allocation"),
|
189
|
+
"take_profit": [TPSL.from_dict(_item) for _item in obj["take_profit"]] if obj.get("take_profit") is not None else None,
|
190
|
+
"stop_loss": [TPSL.from_dict(_item) for _item in obj["stop_loss"]] if obj.get("stop_loss") is not None else None,
|
191
|
+
"expiry_timestamp": obj.get("expiry_timestamp"),
|
192
|
+
"position_id": obj.get("position_id"),
|
193
|
+
"leverage": obj.get("leverage") if obj.get("leverage") is not None else 1,
|
194
|
+
"margin_mode": obj.get("margin_mode")
|
195
|
+
})
|
250
196
|
return _obj
|
197
|
+
|
198
|
+
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
Trading API
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
Do not edit the class manually.
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -23,12 +23,10 @@ from crypticorn.trade.client.models.validation_error import ValidationError
|
|
23
23
|
from typing import Optional, Set
|
24
24
|
from typing_extensions import Self
|
25
25
|
|
26
|
-
|
27
26
|
class HTTPValidationError(BaseModel):
|
28
27
|
"""
|
29
28
|
HTTPValidationError
|
30
|
-
"""
|
31
|
-
|
29
|
+
""" # noqa: E501
|
32
30
|
detail: Optional[List[ValidationError]] = None
|
33
31
|
__properties: ClassVar[List[str]] = ["detail"]
|
34
32
|
|
@@ -38,6 +36,7 @@ class HTTPValidationError(BaseModel):
|
|
38
36
|
protected_namespaces=(),
|
39
37
|
)
|
40
38
|
|
39
|
+
|
41
40
|
def to_str(self) -> str:
|
42
41
|
"""Returns the string representation of the model using alias"""
|
43
42
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -62,7 +61,8 @@ class HTTPValidationError(BaseModel):
|
|
62
61
|
were set at model initialization. Other fields with value `None`
|
63
62
|
are ignored.
|
64
63
|
"""
|
65
|
-
excluded_fields: Set[str] = set([
|
64
|
+
excluded_fields: Set[str] = set([
|
65
|
+
])
|
66
66
|
|
67
67
|
_dict = self.model_dump(
|
68
68
|
by_alias=True,
|
@@ -75,7 +75,7 @@ class HTTPValidationError(BaseModel):
|
|
75
75
|
for _item_detail in self.detail:
|
76
76
|
if _item_detail:
|
77
77
|
_items.append(_item_detail.to_dict())
|
78
|
-
_dict[
|
78
|
+
_dict['detail'] = _items
|
79
79
|
return _dict
|
80
80
|
|
81
81
|
@classmethod
|
@@ -87,13 +87,9 @@ class HTTPValidationError(BaseModel):
|
|
87
87
|
if not isinstance(obj, dict):
|
88
88
|
return cls.model_validate(obj)
|
89
89
|
|
90
|
-
_obj = cls.model_validate(
|
91
|
-
|
92
|
-
|
93
|
-
[ValidationError.from_dict(_item) for _item in obj["detail"]]
|
94
|
-
if obj.get("detail") is not None
|
95
|
-
else None
|
96
|
-
)
|
97
|
-
}
|
98
|
-
)
|
90
|
+
_obj = cls.model_validate({
|
91
|
+
"detail": [ValidationError.from_dict(_item) for _item in obj["detail"]] if obj.get("detail") is not None else None
|
92
|
+
})
|
99
93
|
return _obj
|
94
|
+
|
95
|
+
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
Trading API
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
Do not edit the class manually.
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -26,10 +26,12 @@ class MarginMode(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
ISOLATED =
|
30
|
-
CROSS =
|
29
|
+
ISOLATED = 'isolated'
|
30
|
+
CROSS = 'cross'
|
31
31
|
|
32
32
|
@classmethod
|
33
33
|
def from_json(cls, json_str: str) -> Self:
|
34
34
|
"""Create an instance of MarginMode from a JSON string"""
|
35
35
|
return cls(json.loads(json_str))
|
36
|
+
|
37
|
+
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
Trading API
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
Do not edit the class manually.
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -26,10 +26,12 @@ class MarketType(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
SPOT =
|
30
|
-
FUTURES =
|
29
|
+
SPOT = 'spot'
|
30
|
+
FUTURES = 'futures'
|
31
31
|
|
32
32
|
@classmethod
|
33
33
|
def from_json(cls, json_str: str) -> Self:
|
34
34
|
"""Create an instance of MarketType from a JSON string"""
|
35
35
|
return cls(json.loads(json_str))
|
36
|
+
|
37
|
+
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
Trading API
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
Do not edit the class manually.
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -25,42 +25,20 @@ from crypticorn.trade.client.models.api_error_type import ApiErrorType
|
|
25
25
|
from typing import Optional, Set
|
26
26
|
from typing_extensions import Self
|
27
27
|
|
28
|
-
|
29
28
|
class NotificationModel(BaseModel):
|
30
29
|
"""
|
31
30
|
NotificationModel
|
32
|
-
"""
|
33
|
-
|
31
|
+
""" # noqa: E501
|
34
32
|
created_at: Optional[StrictInt] = None
|
35
33
|
updated_at: Optional[StrictInt] = None
|
36
34
|
id: Optional[StrictStr] = None
|
37
|
-
identifier: ApiErrorIdentifier = Field(
|
38
|
-
|
39
|
-
)
|
40
|
-
level: ApiErrorLevel = Field(
|
41
|
-
description="Level of the notification. Of type ApiErrorLevel"
|
42
|
-
)
|
43
|
-
type: ApiErrorType = Field(
|
44
|
-
description="Type of the notification. Of type ApiErrorType"
|
45
|
-
)
|
35
|
+
identifier: ApiErrorIdentifier = Field(description="Identifier string. Must match the mapping key in the frontend.")
|
36
|
+
level: ApiErrorLevel = Field(description="Level of the notification. Of type ApiErrorLevel")
|
37
|
+
type: ApiErrorType = Field(description="Type of the notification. Of type ApiErrorType")
|
46
38
|
user_id: Optional[StrictStr] = None
|
47
|
-
viewed: Optional[StrictBool] = Field(
|
48
|
-
|
49
|
-
|
50
|
-
sent: Optional[StrictBool] = Field(
|
51
|
-
default=False, description="Whether the notification has been sent as an email"
|
52
|
-
)
|
53
|
-
__properties: ClassVar[List[str]] = [
|
54
|
-
"created_at",
|
55
|
-
"updated_at",
|
56
|
-
"id",
|
57
|
-
"identifier",
|
58
|
-
"level",
|
59
|
-
"type",
|
60
|
-
"user_id",
|
61
|
-
"viewed",
|
62
|
-
"sent",
|
63
|
-
]
|
39
|
+
viewed: Optional[StrictBool] = Field(default=False, description="Whether the notification has been marked as seen")
|
40
|
+
sent: Optional[StrictBool] = Field(default=False, description="Whether the notification has been sent as an email")
|
41
|
+
__properties: ClassVar[List[str]] = ["created_at", "updated_at", "id", "identifier", "level", "type", "user_id", "viewed", "sent"]
|
64
42
|
|
65
43
|
model_config = ConfigDict(
|
66
44
|
populate_by_name=True,
|
@@ -68,6 +46,7 @@ class NotificationModel(BaseModel):
|
|
68
46
|
protected_namespaces=(),
|
69
47
|
)
|
70
48
|
|
49
|
+
|
71
50
|
def to_str(self) -> str:
|
72
51
|
"""Returns the string representation of the model using alias"""
|
73
52
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -92,7 +71,8 @@ class NotificationModel(BaseModel):
|
|
92
71
|
were set at model initialization. Other fields with value `None`
|
93
72
|
are ignored.
|
94
73
|
"""
|
95
|
-
excluded_fields: Set[str] = set([
|
74
|
+
excluded_fields: Set[str] = set([
|
75
|
+
])
|
96
76
|
|
97
77
|
_dict = self.model_dump(
|
98
78
|
by_alias=True,
|
@@ -102,22 +82,22 @@ class NotificationModel(BaseModel):
|
|
102
82
|
# set to None if created_at (nullable) is None
|
103
83
|
# and model_fields_set contains the field
|
104
84
|
if self.created_at is None and "created_at" in self.model_fields_set:
|
105
|
-
_dict[
|
85
|
+
_dict['created_at'] = None
|
106
86
|
|
107
87
|
# set to None if updated_at (nullable) is None
|
108
88
|
# and model_fields_set contains the field
|
109
89
|
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
110
|
-
_dict[
|
90
|
+
_dict['updated_at'] = None
|
111
91
|
|
112
92
|
# set to None if id (nullable) is None
|
113
93
|
# and model_fields_set contains the field
|
114
94
|
if self.id is None and "id" in self.model_fields_set:
|
115
|
-
_dict[
|
95
|
+
_dict['id'] = None
|
116
96
|
|
117
97
|
# set to None if user_id (nullable) is None
|
118
98
|
# and model_fields_set contains the field
|
119
99
|
if self.user_id is None and "user_id" in self.model_fields_set:
|
120
|
-
_dict[
|
100
|
+
_dict['user_id'] = None
|
121
101
|
|
122
102
|
return _dict
|
123
103
|
|
@@ -130,17 +110,17 @@ class NotificationModel(BaseModel):
|
|
130
110
|
if not isinstance(obj, dict):
|
131
111
|
return cls.model_validate(obj)
|
132
112
|
|
133
|
-
_obj = cls.model_validate(
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
}
|
145
|
-
)
|
113
|
+
_obj = cls.model_validate({
|
114
|
+
"created_at": obj.get("created_at"),
|
115
|
+
"updated_at": obj.get("updated_at"),
|
116
|
+
"id": obj.get("id"),
|
117
|
+
"identifier": obj.get("identifier"),
|
118
|
+
"level": obj.get("level"),
|
119
|
+
"type": obj.get("type"),
|
120
|
+
"user_id": obj.get("user_id"),
|
121
|
+
"viewed": obj.get("viewed") if obj.get("viewed") is not None else False,
|
122
|
+
"sent": obj.get("sent") if obj.get("sent") is not None else False
|
123
|
+
})
|
146
124
|
return _obj
|
125
|
+
|
126
|
+
|