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