kalshi-python-async 3.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.
- kalshi_python_async/__init__.py +272 -0
- kalshi_python_async/api/__init__.py +19 -0
- kalshi_python_async/api/api_keys_api.py +1098 -0
- kalshi_python_async/api/communications_api.py +3216 -0
- kalshi_python_async/api/events_api.py +1941 -0
- kalshi_python_async/api/exchange_api.py +1263 -0
- kalshi_python_async/api/fcm_api.py +792 -0
- kalshi_python_async/api/incentive_programs_api.py +346 -0
- kalshi_python_async/api/live_data_api.py +564 -0
- kalshi_python_async/api/market_api.py +2568 -0
- kalshi_python_async/api/milestone_api.py +689 -0
- kalshi_python_async/api/multivariate_api.py +1486 -0
- kalshi_python_async/api/order_groups_api.py +1375 -0
- kalshi_python_async/api/orders_api.py +2913 -0
- kalshi_python_async/api/portfolio_api.py +1572 -0
- kalshi_python_async/api/search_api.py +516 -0
- kalshi_python_async/api/structured_targets_api.py +605 -0
- kalshi_python_async/api_client.py +833 -0
- kalshi_python_async/api_response.py +21 -0
- kalshi_python_async/auth.py +89 -0
- kalshi_python_async/configuration.py +622 -0
- kalshi_python_async/exceptions.py +216 -0
- kalshi_python_async/models/__init__.py +136 -0
- kalshi_python_async/models/accept_quote_request.py +94 -0
- kalshi_python_async/models/amend_order_request.py +120 -0
- kalshi_python_async/models/amend_order_response.py +96 -0
- kalshi_python_async/models/announcement.py +108 -0
- kalshi_python_async/models/api_key.py +89 -0
- kalshi_python_async/models/associated_event.py +105 -0
- kalshi_python_async/models/batch_cancel_orders_individual_response.py +111 -0
- kalshi_python_async/models/batch_cancel_orders_request.py +87 -0
- kalshi_python_async/models/batch_cancel_orders_response.py +95 -0
- kalshi_python_async/models/batch_create_orders_individual_response.py +114 -0
- kalshi_python_async/models/batch_create_orders_request.py +95 -0
- kalshi_python_async/models/batch_create_orders_response.py +95 -0
- kalshi_python_async/models/batch_get_market_candlesticks_response.py +95 -0
- kalshi_python_async/models/bid_ask_distribution.py +101 -0
- kalshi_python_async/models/cancel_order_response.py +93 -0
- kalshi_python_async/models/create_api_key_request.py +89 -0
- kalshi_python_async/models/create_api_key_response.py +87 -0
- kalshi_python_async/models/create_market_in_multivariate_event_collection_request.py +95 -0
- kalshi_python_async/models/create_market_in_multivariate_event_collection_response.py +89 -0
- kalshi_python_async/models/create_order_group_request.py +88 -0
- kalshi_python_async/models/create_order_group_response.py +87 -0
- kalshi_python_async/models/create_order_request.py +159 -0
- kalshi_python_async/models/create_order_response.py +91 -0
- kalshi_python_async/models/create_quote_request.py +93 -0
- kalshi_python_async/models/create_quote_response.py +87 -0
- kalshi_python_async/models/create_rfq_request.py +97 -0
- kalshi_python_async/models/create_rfq_response.py +87 -0
- kalshi_python_async/models/daily_schedule.py +89 -0
- kalshi_python_async/models/decrease_order_request.py +90 -0
- kalshi_python_async/models/decrease_order_response.py +91 -0
- kalshi_python_async/models/error_response.py +93 -0
- kalshi_python_async/models/event_data.py +133 -0
- kalshi_python_async/models/event_position.py +105 -0
- kalshi_python_async/models/exchange_status.py +97 -0
- kalshi_python_async/models/fill.py +134 -0
- kalshi_python_async/models/forecast_percentiles_point.py +101 -0
- kalshi_python_async/models/generate_api_key_request.py +87 -0
- kalshi_python_async/models/generate_api_key_response.py +89 -0
- kalshi_python_async/models/get_api_keys_response.py +95 -0
- kalshi_python_async/models/get_balance_response.py +91 -0
- kalshi_python_async/models/get_communications_id_response.py +87 -0
- kalshi_python_async/models/get_event_candlesticks_response.py +104 -0
- kalshi_python_async/models/get_event_forecast_percentiles_history_response.py +95 -0
- kalshi_python_async/models/get_event_metadata_response.py +123 -0
- kalshi_python_async/models/get_event_response.py +101 -0
- kalshi_python_async/models/get_events_candlesticks_response.py +95 -0
- kalshi_python_async/models/get_events_candlesticks_response_events_inner.py +106 -0
- kalshi_python_async/models/get_events_response.py +107 -0
- kalshi_python_async/models/get_exchange_announcements_response.py +95 -0
- kalshi_python_async/models/get_exchange_schedule_response.py +91 -0
- kalshi_python_async/models/get_fills_response.py +97 -0
- kalshi_python_async/models/get_filters_by_sports_response.py +102 -0
- kalshi_python_async/models/get_incentive_programs_response.py +97 -0
- kalshi_python_async/models/get_live_data_response.py +91 -0
- kalshi_python_async/models/get_live_datas_response.py +95 -0
- kalshi_python_async/models/get_market_candlesticks_response.py +97 -0
- kalshi_python_async/models/get_market_orderbook_response.py +91 -0
- kalshi_python_async/models/get_market_response.py +91 -0
- kalshi_python_async/models/get_markets_response.py +97 -0
- kalshi_python_async/models/get_milestone_response.py +91 -0
- kalshi_python_async/models/get_milestones_response.py +97 -0
- kalshi_python_async/models/get_multivariate_event_collection_lookup_history_response.py +95 -0
- kalshi_python_async/models/get_multivariate_event_collection_response.py +91 -0
- kalshi_python_async/models/get_multivariate_event_collections_response.py +97 -0
- kalshi_python_async/models/get_multivariate_events_response.py +97 -0
- kalshi_python_async/models/get_order_group_response.py +89 -0
- kalshi_python_async/models/get_order_groups_response.py +95 -0
- kalshi_python_async/models/get_order_queue_position_response.py +87 -0
- kalshi_python_async/models/get_order_queue_positions_response.py +95 -0
- kalshi_python_async/models/get_order_response.py +91 -0
- kalshi_python_async/models/get_orders_response.py +97 -0
- kalshi_python_async/models/get_portfolio_resting_order_total_value_response.py +87 -0
- kalshi_python_async/models/get_positions_response.py +107 -0
- kalshi_python_async/models/get_quote_response.py +91 -0
- kalshi_python_async/models/get_quotes_response.py +97 -0
- kalshi_python_async/models/get_rfq_response.py +91 -0
- kalshi_python_async/models/get_rfqs_response.py +97 -0
- kalshi_python_async/models/get_series_fee_changes_response.py +95 -0
- kalshi_python_async/models/get_series_list_response.py +95 -0
- kalshi_python_async/models/get_series_response.py +91 -0
- kalshi_python_async/models/get_settlements_response.py +97 -0
- kalshi_python_async/models/get_structured_target_response.py +91 -0
- kalshi_python_async/models/get_structured_targets_response.py +97 -0
- kalshi_python_async/models/get_tags_for_series_categories_response.py +87 -0
- kalshi_python_async/models/get_trades_response.py +97 -0
- kalshi_python_async/models/get_user_data_timestamp_response.py +88 -0
- kalshi_python_async/models/incentive_program.py +121 -0
- kalshi_python_async/models/live_data.py +91 -0
- kalshi_python_async/models/lookup_point.py +102 -0
- kalshi_python_async/models/lookup_tickers_for_market_in_multivariate_event_collection_request.py +95 -0
- kalshi_python_async/models/lookup_tickers_for_market_in_multivariate_event_collection_response.py +89 -0
- kalshi_python_async/models/maintenance_window.py +90 -0
- kalshi_python_async/models/market.py +307 -0
- kalshi_python_async/models/market_candlestick.py +108 -0
- kalshi_python_async/models/market_candlesticks_response.py +97 -0
- kalshi_python_async/models/market_metadata.py +91 -0
- kalshi_python_async/models/market_position.py +110 -0
- kalshi_python_async/models/milestone.py +120 -0
- kalshi_python_async/models/multivariate_event_collection.py +122 -0
- kalshi_python_async/models/mve_selected_leg.py +91 -0
- kalshi_python_async/models/order.py +189 -0
- kalshi_python_async/models/order_group.py +89 -0
- kalshi_python_async/models/order_queue_position.py +91 -0
- kalshi_python_async/models/order_status.py +38 -0
- kalshi_python_async/models/orderbook.py +94 -0
- kalshi_python_async/models/percentile_point.py +93 -0
- kalshi_python_async/models/price_distribution.py +157 -0
- kalshi_python_async/models/price_range.py +91 -0
- kalshi_python_async/models/quote.py +153 -0
- kalshi_python_async/models/rfq.py +129 -0
- kalshi_python_async/models/schedule.py +105 -0
- kalshi_python_async/models/scope_list.py +87 -0
- kalshi_python_async/models/self_trade_prevention_type.py +37 -0
- kalshi_python_async/models/series.py +129 -0
- kalshi_python_async/models/series_fee_change.py +103 -0
- kalshi_python_async/models/settlement.py +118 -0
- kalshi_python_async/models/settlement_source.py +89 -0
- kalshi_python_async/models/sport_filter_details.py +102 -0
- kalshi_python_async/models/structured_target.py +98 -0
- kalshi_python_async/models/ticker_pair.py +98 -0
- kalshi_python_async/models/trade.py +113 -0
- kalshi_python_async/models/weekly_schedule.py +154 -0
- kalshi_python_async/py.typed +0 -0
- kalshi_python_async/rest.py +213 -0
- kalshi_python_async-3.0.0.dist-info/METADATA +78 -0
- kalshi_python_async-3.0.0.dist-info/RECORD +151 -0
- kalshi_python_async-3.0.0.dist-info/WHEEL +5 -0
- kalshi_python_async-3.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Kalshi Trade API Manual Endpoints
|
|
5
|
+
|
|
6
|
+
Manually defined OpenAPI spec for endpoints being migrated to spec-first approach
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 3.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from typing import Any, Optional
|
|
15
|
+
from typing_extensions import Self
|
|
16
|
+
|
|
17
|
+
class OpenApiException(Exception):
|
|
18
|
+
"""The base exception class for all OpenAPIExceptions"""
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ApiTypeError(OpenApiException, TypeError):
|
|
22
|
+
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
|
23
|
+
key_type=None) -> None:
|
|
24
|
+
""" Raises an exception for TypeErrors
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
msg (str): the exception message
|
|
28
|
+
|
|
29
|
+
Keyword Args:
|
|
30
|
+
path_to_item (list): a list of keys an indices to get to the
|
|
31
|
+
current_item
|
|
32
|
+
None if unset
|
|
33
|
+
valid_classes (tuple): the primitive classes that current item
|
|
34
|
+
should be an instance of
|
|
35
|
+
None if unset
|
|
36
|
+
key_type (bool): False if our value is a value in a dict
|
|
37
|
+
True if it is a key in a dict
|
|
38
|
+
False if our item is an item in a list
|
|
39
|
+
None if unset
|
|
40
|
+
"""
|
|
41
|
+
self.path_to_item = path_to_item
|
|
42
|
+
self.valid_classes = valid_classes
|
|
43
|
+
self.key_type = key_type
|
|
44
|
+
full_msg = msg
|
|
45
|
+
if path_to_item:
|
|
46
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
47
|
+
super(ApiTypeError, self).__init__(full_msg)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class ApiValueError(OpenApiException, ValueError):
|
|
51
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
52
|
+
"""
|
|
53
|
+
Args:
|
|
54
|
+
msg (str): the exception message
|
|
55
|
+
|
|
56
|
+
Keyword Args:
|
|
57
|
+
path_to_item (list) the path to the exception in the
|
|
58
|
+
received_data dict. None if unset
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
self.path_to_item = path_to_item
|
|
62
|
+
full_msg = msg
|
|
63
|
+
if path_to_item:
|
|
64
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
65
|
+
super(ApiValueError, self).__init__(full_msg)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class ApiAttributeError(OpenApiException, AttributeError):
|
|
69
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
70
|
+
"""
|
|
71
|
+
Raised when an attribute reference or assignment fails.
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
msg (str): the exception message
|
|
75
|
+
|
|
76
|
+
Keyword Args:
|
|
77
|
+
path_to_item (None/list) the path to the exception in the
|
|
78
|
+
received_data dict
|
|
79
|
+
"""
|
|
80
|
+
self.path_to_item = path_to_item
|
|
81
|
+
full_msg = msg
|
|
82
|
+
if path_to_item:
|
|
83
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
84
|
+
super(ApiAttributeError, self).__init__(full_msg)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class ApiKeyError(OpenApiException, KeyError):
|
|
88
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
89
|
+
"""
|
|
90
|
+
Args:
|
|
91
|
+
msg (str): the exception message
|
|
92
|
+
|
|
93
|
+
Keyword Args:
|
|
94
|
+
path_to_item (None/list) the path to the exception in the
|
|
95
|
+
received_data dict
|
|
96
|
+
"""
|
|
97
|
+
self.path_to_item = path_to_item
|
|
98
|
+
full_msg = msg
|
|
99
|
+
if path_to_item:
|
|
100
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
101
|
+
super(ApiKeyError, self).__init__(full_msg)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class ApiException(OpenApiException):
|
|
105
|
+
|
|
106
|
+
def __init__(
|
|
107
|
+
self,
|
|
108
|
+
status=None,
|
|
109
|
+
reason=None,
|
|
110
|
+
http_resp=None,
|
|
111
|
+
*,
|
|
112
|
+
body: Optional[str] = None,
|
|
113
|
+
data: Optional[Any] = None,
|
|
114
|
+
) -> None:
|
|
115
|
+
self.status = status
|
|
116
|
+
self.reason = reason
|
|
117
|
+
self.body = body
|
|
118
|
+
self.data = data
|
|
119
|
+
self.headers = None
|
|
120
|
+
|
|
121
|
+
if http_resp:
|
|
122
|
+
if self.status is None:
|
|
123
|
+
self.status = http_resp.status
|
|
124
|
+
if self.reason is None:
|
|
125
|
+
self.reason = http_resp.reason
|
|
126
|
+
if self.body is None:
|
|
127
|
+
try:
|
|
128
|
+
self.body = http_resp.data.decode('utf-8')
|
|
129
|
+
except Exception:
|
|
130
|
+
pass
|
|
131
|
+
self.headers = http_resp.getheaders()
|
|
132
|
+
|
|
133
|
+
@classmethod
|
|
134
|
+
def from_response(
|
|
135
|
+
cls,
|
|
136
|
+
*,
|
|
137
|
+
http_resp,
|
|
138
|
+
body: Optional[str],
|
|
139
|
+
data: Optional[Any],
|
|
140
|
+
) -> Self:
|
|
141
|
+
if http_resp.status == 400:
|
|
142
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
|
143
|
+
|
|
144
|
+
if http_resp.status == 401:
|
|
145
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
|
146
|
+
|
|
147
|
+
if http_resp.status == 403:
|
|
148
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
|
149
|
+
|
|
150
|
+
if http_resp.status == 404:
|
|
151
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
|
152
|
+
|
|
153
|
+
# Added new conditions for 409 and 422
|
|
154
|
+
if http_resp.status == 409:
|
|
155
|
+
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
|
156
|
+
|
|
157
|
+
if http_resp.status == 422:
|
|
158
|
+
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
|
159
|
+
|
|
160
|
+
if 500 <= http_resp.status <= 599:
|
|
161
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
|
162
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
|
163
|
+
|
|
164
|
+
def __str__(self):
|
|
165
|
+
"""Custom error messages for exception"""
|
|
166
|
+
error_message = "({0})\n"\
|
|
167
|
+
"Reason: {1}\n".format(self.status, self.reason)
|
|
168
|
+
if self.headers:
|
|
169
|
+
error_message += "HTTP response headers: {0}\n".format(
|
|
170
|
+
self.headers)
|
|
171
|
+
|
|
172
|
+
if self.data or self.body:
|
|
173
|
+
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
|
174
|
+
|
|
175
|
+
return error_message
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
class BadRequestException(ApiException):
|
|
179
|
+
pass
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class NotFoundException(ApiException):
|
|
183
|
+
pass
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
class UnauthorizedException(ApiException):
|
|
187
|
+
pass
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
class ForbiddenException(ApiException):
|
|
191
|
+
pass
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
class ServiceException(ApiException):
|
|
195
|
+
pass
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
class ConflictException(ApiException):
|
|
199
|
+
"""Exception for HTTP 409 Conflict."""
|
|
200
|
+
pass
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
class UnprocessableEntityException(ApiException):
|
|
204
|
+
"""Exception for HTTP 422 Unprocessable Entity."""
|
|
205
|
+
pass
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def render_path(path_to_item):
|
|
209
|
+
"""Returns a string representation of a path"""
|
|
210
|
+
result = ""
|
|
211
|
+
for pth in path_to_item:
|
|
212
|
+
if isinstance(pth, int):
|
|
213
|
+
result += "[{0}]".format(pth)
|
|
214
|
+
else:
|
|
215
|
+
result += "['{0}']".format(pth)
|
|
216
|
+
return result
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
"""
|
|
5
|
+
Kalshi Trade API Manual Endpoints
|
|
6
|
+
|
|
7
|
+
Manually defined OpenAPI spec for endpoints being migrated to spec-first approach
|
|
8
|
+
|
|
9
|
+
The version of the OpenAPI document: 3.0.0
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
# import models into model package
|
|
16
|
+
from kalshi_python_async.models.accept_quote_request import AcceptQuoteRequest
|
|
17
|
+
from kalshi_python_async.models.amend_order_request import AmendOrderRequest
|
|
18
|
+
from kalshi_python_async.models.amend_order_response import AmendOrderResponse
|
|
19
|
+
from kalshi_python_async.models.announcement import Announcement
|
|
20
|
+
from kalshi_python_async.models.api_key import ApiKey
|
|
21
|
+
from kalshi_python_async.models.associated_event import AssociatedEvent
|
|
22
|
+
from kalshi_python_async.models.batch_cancel_orders_individual_response import BatchCancelOrdersIndividualResponse
|
|
23
|
+
from kalshi_python_async.models.batch_cancel_orders_request import BatchCancelOrdersRequest
|
|
24
|
+
from kalshi_python_async.models.batch_cancel_orders_response import BatchCancelOrdersResponse
|
|
25
|
+
from kalshi_python_async.models.batch_create_orders_individual_response import BatchCreateOrdersIndividualResponse
|
|
26
|
+
from kalshi_python_async.models.batch_create_orders_request import BatchCreateOrdersRequest
|
|
27
|
+
from kalshi_python_async.models.batch_create_orders_response import BatchCreateOrdersResponse
|
|
28
|
+
from kalshi_python_async.models.batch_get_market_candlesticks_response import BatchGetMarketCandlesticksResponse
|
|
29
|
+
from kalshi_python_async.models.bid_ask_distribution import BidAskDistribution
|
|
30
|
+
from kalshi_python_async.models.cancel_order_response import CancelOrderResponse
|
|
31
|
+
from kalshi_python_async.models.create_api_key_request import CreateApiKeyRequest
|
|
32
|
+
from kalshi_python_async.models.create_api_key_response import CreateApiKeyResponse
|
|
33
|
+
from kalshi_python_async.models.create_market_in_multivariate_event_collection_request import CreateMarketInMultivariateEventCollectionRequest
|
|
34
|
+
from kalshi_python_async.models.create_market_in_multivariate_event_collection_response import CreateMarketInMultivariateEventCollectionResponse
|
|
35
|
+
from kalshi_python_async.models.create_order_group_request import CreateOrderGroupRequest
|
|
36
|
+
from kalshi_python_async.models.create_order_group_response import CreateOrderGroupResponse
|
|
37
|
+
from kalshi_python_async.models.create_order_request import CreateOrderRequest
|
|
38
|
+
from kalshi_python_async.models.create_order_response import CreateOrderResponse
|
|
39
|
+
from kalshi_python_async.models.create_quote_request import CreateQuoteRequest
|
|
40
|
+
from kalshi_python_async.models.create_quote_response import CreateQuoteResponse
|
|
41
|
+
from kalshi_python_async.models.create_rfq_request import CreateRFQRequest
|
|
42
|
+
from kalshi_python_async.models.create_rfq_response import CreateRFQResponse
|
|
43
|
+
from kalshi_python_async.models.daily_schedule import DailySchedule
|
|
44
|
+
from kalshi_python_async.models.decrease_order_request import DecreaseOrderRequest
|
|
45
|
+
from kalshi_python_async.models.decrease_order_response import DecreaseOrderResponse
|
|
46
|
+
from kalshi_python_async.models.error_response import ErrorResponse
|
|
47
|
+
from kalshi_python_async.models.event_data import EventData
|
|
48
|
+
from kalshi_python_async.models.event_position import EventPosition
|
|
49
|
+
from kalshi_python_async.models.exchange_status import ExchangeStatus
|
|
50
|
+
from kalshi_python_async.models.fill import Fill
|
|
51
|
+
from kalshi_python_async.models.forecast_percentiles_point import ForecastPercentilesPoint
|
|
52
|
+
from kalshi_python_async.models.generate_api_key_request import GenerateApiKeyRequest
|
|
53
|
+
from kalshi_python_async.models.generate_api_key_response import GenerateApiKeyResponse
|
|
54
|
+
from kalshi_python_async.models.get_api_keys_response import GetApiKeysResponse
|
|
55
|
+
from kalshi_python_async.models.get_balance_response import GetBalanceResponse
|
|
56
|
+
from kalshi_python_async.models.get_communications_id_response import GetCommunicationsIDResponse
|
|
57
|
+
from kalshi_python_async.models.get_event_candlesticks_response import GetEventCandlesticksResponse
|
|
58
|
+
from kalshi_python_async.models.get_event_forecast_percentiles_history_response import GetEventForecastPercentilesHistoryResponse
|
|
59
|
+
from kalshi_python_async.models.get_event_metadata_response import GetEventMetadataResponse
|
|
60
|
+
from kalshi_python_async.models.get_event_response import GetEventResponse
|
|
61
|
+
from kalshi_python_async.models.get_events_response import GetEventsResponse
|
|
62
|
+
from kalshi_python_async.models.get_exchange_announcements_response import GetExchangeAnnouncementsResponse
|
|
63
|
+
from kalshi_python_async.models.get_exchange_schedule_response import GetExchangeScheduleResponse
|
|
64
|
+
from kalshi_python_async.models.get_fills_response import GetFillsResponse
|
|
65
|
+
from kalshi_python_async.models.get_filters_by_sports_response import GetFiltersBySportsResponse
|
|
66
|
+
from kalshi_python_async.models.get_incentive_programs_response import GetIncentiveProgramsResponse
|
|
67
|
+
from kalshi_python_async.models.get_live_data_response import GetLiveDataResponse
|
|
68
|
+
from kalshi_python_async.models.get_live_datas_response import GetLiveDatasResponse
|
|
69
|
+
from kalshi_python_async.models.get_market_candlesticks_response import GetMarketCandlesticksResponse
|
|
70
|
+
from kalshi_python_async.models.get_market_orderbook_response import GetMarketOrderbookResponse
|
|
71
|
+
from kalshi_python_async.models.get_market_response import GetMarketResponse
|
|
72
|
+
from kalshi_python_async.models.get_markets_response import GetMarketsResponse
|
|
73
|
+
from kalshi_python_async.models.get_milestone_response import GetMilestoneResponse
|
|
74
|
+
from kalshi_python_async.models.get_milestones_response import GetMilestonesResponse
|
|
75
|
+
from kalshi_python_async.models.get_multivariate_event_collection_lookup_history_response import GetMultivariateEventCollectionLookupHistoryResponse
|
|
76
|
+
from kalshi_python_async.models.get_multivariate_event_collection_response import GetMultivariateEventCollectionResponse
|
|
77
|
+
from kalshi_python_async.models.get_multivariate_event_collections_response import GetMultivariateEventCollectionsResponse
|
|
78
|
+
from kalshi_python_async.models.get_multivariate_events_response import GetMultivariateEventsResponse
|
|
79
|
+
from kalshi_python_async.models.get_order_group_response import GetOrderGroupResponse
|
|
80
|
+
from kalshi_python_async.models.get_order_groups_response import GetOrderGroupsResponse
|
|
81
|
+
from kalshi_python_async.models.get_order_queue_position_response import GetOrderQueuePositionResponse
|
|
82
|
+
from kalshi_python_async.models.get_order_queue_positions_response import GetOrderQueuePositionsResponse
|
|
83
|
+
from kalshi_python_async.models.get_order_response import GetOrderResponse
|
|
84
|
+
from kalshi_python_async.models.get_orders_response import GetOrdersResponse
|
|
85
|
+
from kalshi_python_async.models.get_portfolio_resting_order_total_value_response import GetPortfolioRestingOrderTotalValueResponse
|
|
86
|
+
from kalshi_python_async.models.get_positions_response import GetPositionsResponse
|
|
87
|
+
from kalshi_python_async.models.get_quote_response import GetQuoteResponse
|
|
88
|
+
from kalshi_python_async.models.get_quotes_response import GetQuotesResponse
|
|
89
|
+
from kalshi_python_async.models.get_rfq_response import GetRFQResponse
|
|
90
|
+
from kalshi_python_async.models.get_rfqs_response import GetRFQsResponse
|
|
91
|
+
from kalshi_python_async.models.get_series_fee_changes_response import GetSeriesFeeChangesResponse
|
|
92
|
+
from kalshi_python_async.models.get_series_list_response import GetSeriesListResponse
|
|
93
|
+
from kalshi_python_async.models.get_series_response import GetSeriesResponse
|
|
94
|
+
from kalshi_python_async.models.get_settlements_response import GetSettlementsResponse
|
|
95
|
+
from kalshi_python_async.models.get_structured_target_response import GetStructuredTargetResponse
|
|
96
|
+
from kalshi_python_async.models.get_structured_targets_response import GetStructuredTargetsResponse
|
|
97
|
+
from kalshi_python_async.models.get_tags_for_series_categories_response import GetTagsForSeriesCategoriesResponse
|
|
98
|
+
from kalshi_python_async.models.get_trades_response import GetTradesResponse
|
|
99
|
+
from kalshi_python_async.models.get_user_data_timestamp_response import GetUserDataTimestampResponse
|
|
100
|
+
from kalshi_python_async.models.incentive_program import IncentiveProgram
|
|
101
|
+
from kalshi_python_async.models.live_data import LiveData
|
|
102
|
+
from kalshi_python_async.models.lookup_point import LookupPoint
|
|
103
|
+
from kalshi_python_async.models.lookup_tickers_for_market_in_multivariate_event_collection_request import LookupTickersForMarketInMultivariateEventCollectionRequest
|
|
104
|
+
from kalshi_python_async.models.lookup_tickers_for_market_in_multivariate_event_collection_response import LookupTickersForMarketInMultivariateEventCollectionResponse
|
|
105
|
+
from kalshi_python_async.models.maintenance_window import MaintenanceWindow
|
|
106
|
+
from kalshi_python_async.models.market import Market
|
|
107
|
+
from kalshi_python_async.models.market_candlestick import MarketCandlestick
|
|
108
|
+
from kalshi_python_async.models.market_candlesticks_response import MarketCandlesticksResponse
|
|
109
|
+
from kalshi_python_async.models.market_metadata import MarketMetadata
|
|
110
|
+
from kalshi_python_async.models.market_position import MarketPosition
|
|
111
|
+
from kalshi_python_async.models.milestone import Milestone
|
|
112
|
+
from kalshi_python_async.models.multivariate_event_collection import MultivariateEventCollection
|
|
113
|
+
from kalshi_python_async.models.mve_selected_leg import MveSelectedLeg
|
|
114
|
+
from kalshi_python_async.models.order import Order
|
|
115
|
+
from kalshi_python_async.models.order_group import OrderGroup
|
|
116
|
+
from kalshi_python_async.models.order_queue_position import OrderQueuePosition
|
|
117
|
+
from kalshi_python_async.models.order_status import OrderStatus
|
|
118
|
+
from kalshi_python_async.models.orderbook import Orderbook
|
|
119
|
+
from kalshi_python_async.models.percentile_point import PercentilePoint
|
|
120
|
+
from kalshi_python_async.models.price_distribution import PriceDistribution
|
|
121
|
+
from kalshi_python_async.models.price_range import PriceRange
|
|
122
|
+
from kalshi_python_async.models.quote import Quote
|
|
123
|
+
from kalshi_python_async.models.rfq import RFQ
|
|
124
|
+
from kalshi_python_async.models.schedule import Schedule
|
|
125
|
+
from kalshi_python_async.models.scope_list import ScopeList
|
|
126
|
+
from kalshi_python_async.models.self_trade_prevention_type import SelfTradePreventionType
|
|
127
|
+
from kalshi_python_async.models.series import Series
|
|
128
|
+
from kalshi_python_async.models.series_fee_change import SeriesFeeChange
|
|
129
|
+
from kalshi_python_async.models.settlement import Settlement
|
|
130
|
+
from kalshi_python_async.models.settlement_source import SettlementSource
|
|
131
|
+
from kalshi_python_async.models.sport_filter_details import SportFilterDetails
|
|
132
|
+
from kalshi_python_async.models.structured_target import StructuredTarget
|
|
133
|
+
from kalshi_python_async.models.ticker_pair import TickerPair
|
|
134
|
+
from kalshi_python_async.models.trade import Trade
|
|
135
|
+
from kalshi_python_async.models.weekly_schedule import WeeklySchedule
|
|
136
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Kalshi Trade API Manual Endpoints
|
|
5
|
+
|
|
6
|
+
Manually defined OpenAPI spec for endpoints being migrated to spec-first approach
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 3.0.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, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class AcceptQuoteRequest(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
AcceptQuoteRequest
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
accepted_side: StrictStr = Field(description="The side of the quote to accept (yes or no)")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["accepted_side"]
|
|
31
|
+
|
|
32
|
+
@field_validator('accepted_side')
|
|
33
|
+
def accepted_side_validate_enum(cls, value):
|
|
34
|
+
"""Validates the enum"""
|
|
35
|
+
if value not in set(['true', 'false']):
|
|
36
|
+
raise ValueError("must be one of enum values ('true', 'false')")
|
|
37
|
+
return value
|
|
38
|
+
|
|
39
|
+
model_config = ConfigDict(
|
|
40
|
+
populate_by_name=True,
|
|
41
|
+
validate_assignment=True,
|
|
42
|
+
protected_namespaces=(),
|
|
43
|
+
)
|
|
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 AcceptQuoteRequest 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
|
+
|
|
73
|
+
_dict = self.model_dump(
|
|
74
|
+
by_alias=True,
|
|
75
|
+
exclude=excluded_fields,
|
|
76
|
+
exclude_none=True,
|
|
77
|
+
)
|
|
78
|
+
return _dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
|
+
"""Create an instance of AcceptQuoteRequest from a dict"""
|
|
83
|
+
if obj is None:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
if not isinstance(obj, dict):
|
|
87
|
+
return cls.model_validate(obj)
|
|
88
|
+
|
|
89
|
+
_obj = cls.model_validate({
|
|
90
|
+
"accepted_side": obj.get("accepted_side")
|
|
91
|
+
})
|
|
92
|
+
return _obj
|
|
93
|
+
|
|
94
|
+
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Kalshi Trade API Manual Endpoints
|
|
5
|
+
|
|
6
|
+
Manually defined OpenAPI spec for endpoints being migrated to spec-first approach
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 3.0.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, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class AmendOrderRequest(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
AmendOrderRequest
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
ticker: StrictStr = Field(description="Market ticker")
|
|
31
|
+
side: StrictStr = Field(description="Side of the order")
|
|
32
|
+
action: StrictStr = Field(description="Action of the order")
|
|
33
|
+
client_order_id: StrictStr = Field(description="The original client-specified order ID to be amended")
|
|
34
|
+
updated_client_order_id: StrictStr = Field(description="The new client-specified order ID after amendment")
|
|
35
|
+
yes_price: Optional[Annotated[int, Field(le=99, strict=True, ge=1)]] = Field(default=None, description="Updated yes price for the order in cents")
|
|
36
|
+
no_price: Optional[Annotated[int, Field(le=99, strict=True, ge=1)]] = Field(default=None, description="Updated no price for the order in cents")
|
|
37
|
+
yes_price_dollars: Optional[StrictStr] = Field(default=None, description="US dollar amount as a fixed-point decimal string with exactly 4 decimal places")
|
|
38
|
+
no_price_dollars: Optional[StrictStr] = Field(default=None, description="US dollar amount as a fixed-point decimal string with exactly 4 decimal places")
|
|
39
|
+
count: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Updated quantity for the order")
|
|
40
|
+
__properties: ClassVar[List[str]] = ["ticker", "side", "action", "client_order_id", "updated_client_order_id", "yes_price", "no_price", "yes_price_dollars", "no_price_dollars", "count"]
|
|
41
|
+
|
|
42
|
+
@field_validator('side')
|
|
43
|
+
def side_validate_enum(cls, value):
|
|
44
|
+
"""Validates the enum"""
|
|
45
|
+
if value not in set(['yes', 'no']):
|
|
46
|
+
raise ValueError("must be one of enum values ('yes', 'no')")
|
|
47
|
+
return value
|
|
48
|
+
|
|
49
|
+
@field_validator('action')
|
|
50
|
+
def action_validate_enum(cls, value):
|
|
51
|
+
"""Validates the enum"""
|
|
52
|
+
if value not in set(['buy', 'sell']):
|
|
53
|
+
raise ValueError("must be one of enum values ('buy', 'sell')")
|
|
54
|
+
return value
|
|
55
|
+
|
|
56
|
+
model_config = ConfigDict(
|
|
57
|
+
populate_by_name=True,
|
|
58
|
+
validate_assignment=True,
|
|
59
|
+
protected_namespaces=(),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def to_str(self) -> str:
|
|
64
|
+
"""Returns the string representation of the model using alias"""
|
|
65
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
66
|
+
|
|
67
|
+
def to_json(self) -> str:
|
|
68
|
+
"""Returns the JSON representation of the model using alias"""
|
|
69
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
70
|
+
return json.dumps(self.to_dict())
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
74
|
+
"""Create an instance of AmendOrderRequest from a JSON string"""
|
|
75
|
+
return cls.from_dict(json.loads(json_str))
|
|
76
|
+
|
|
77
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
78
|
+
"""Return the dictionary representation of the model using alias.
|
|
79
|
+
|
|
80
|
+
This has the following differences from calling pydantic's
|
|
81
|
+
`self.model_dump(by_alias=True)`:
|
|
82
|
+
|
|
83
|
+
* `None` is only added to the output dict for nullable fields that
|
|
84
|
+
were set at model initialization. Other fields with value `None`
|
|
85
|
+
are ignored.
|
|
86
|
+
"""
|
|
87
|
+
excluded_fields: Set[str] = set([
|
|
88
|
+
])
|
|
89
|
+
|
|
90
|
+
_dict = self.model_dump(
|
|
91
|
+
by_alias=True,
|
|
92
|
+
exclude=excluded_fields,
|
|
93
|
+
exclude_none=True,
|
|
94
|
+
)
|
|
95
|
+
return _dict
|
|
96
|
+
|
|
97
|
+
@classmethod
|
|
98
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
99
|
+
"""Create an instance of AmendOrderRequest from a dict"""
|
|
100
|
+
if obj is None:
|
|
101
|
+
return None
|
|
102
|
+
|
|
103
|
+
if not isinstance(obj, dict):
|
|
104
|
+
return cls.model_validate(obj)
|
|
105
|
+
|
|
106
|
+
_obj = cls.model_validate({
|
|
107
|
+
"ticker": obj.get("ticker"),
|
|
108
|
+
"side": obj.get("side"),
|
|
109
|
+
"action": obj.get("action"),
|
|
110
|
+
"client_order_id": obj.get("client_order_id"),
|
|
111
|
+
"updated_client_order_id": obj.get("updated_client_order_id"),
|
|
112
|
+
"yes_price": obj.get("yes_price"),
|
|
113
|
+
"no_price": obj.get("no_price"),
|
|
114
|
+
"yes_price_dollars": obj.get("yes_price_dollars"),
|
|
115
|
+
"no_price_dollars": obj.get("no_price_dollars"),
|
|
116
|
+
"count": obj.get("count")
|
|
117
|
+
})
|
|
118
|
+
return _obj
|
|
119
|
+
|
|
120
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Kalshi Trade API Manual Endpoints
|
|
5
|
+
|
|
6
|
+
Manually defined OpenAPI spec for endpoints being migrated to spec-first approach
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 3.0.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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from kalshi_python_async.models.order import Order
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class AmendOrderResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
AmendOrderResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
old_order: Order
|
|
31
|
+
order: Order
|
|
32
|
+
__properties: ClassVar[List[str]] = ["old_order", "order"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of AmendOrderResponse from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# override the default output from pydantic by calling `to_dict()` of old_order
|
|
74
|
+
if self.old_order:
|
|
75
|
+
_dict['old_order'] = self.old_order.to_dict()
|
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of order
|
|
77
|
+
if self.order:
|
|
78
|
+
_dict['order'] = self.order.to_dict()
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of AmendOrderResponse from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"old_order": Order.from_dict(obj["old_order"]) if obj.get("old_order") is not None else None,
|
|
92
|
+
"order": Order.from_dict(obj["order"]) if obj.get("order") is not None else None
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|