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.
Files changed (151) hide show
  1. kalshi_python_async/__init__.py +272 -0
  2. kalshi_python_async/api/__init__.py +19 -0
  3. kalshi_python_async/api/api_keys_api.py +1098 -0
  4. kalshi_python_async/api/communications_api.py +3216 -0
  5. kalshi_python_async/api/events_api.py +1941 -0
  6. kalshi_python_async/api/exchange_api.py +1263 -0
  7. kalshi_python_async/api/fcm_api.py +792 -0
  8. kalshi_python_async/api/incentive_programs_api.py +346 -0
  9. kalshi_python_async/api/live_data_api.py +564 -0
  10. kalshi_python_async/api/market_api.py +2568 -0
  11. kalshi_python_async/api/milestone_api.py +689 -0
  12. kalshi_python_async/api/multivariate_api.py +1486 -0
  13. kalshi_python_async/api/order_groups_api.py +1375 -0
  14. kalshi_python_async/api/orders_api.py +2913 -0
  15. kalshi_python_async/api/portfolio_api.py +1572 -0
  16. kalshi_python_async/api/search_api.py +516 -0
  17. kalshi_python_async/api/structured_targets_api.py +605 -0
  18. kalshi_python_async/api_client.py +833 -0
  19. kalshi_python_async/api_response.py +21 -0
  20. kalshi_python_async/auth.py +89 -0
  21. kalshi_python_async/configuration.py +622 -0
  22. kalshi_python_async/exceptions.py +216 -0
  23. kalshi_python_async/models/__init__.py +136 -0
  24. kalshi_python_async/models/accept_quote_request.py +94 -0
  25. kalshi_python_async/models/amend_order_request.py +120 -0
  26. kalshi_python_async/models/amend_order_response.py +96 -0
  27. kalshi_python_async/models/announcement.py +108 -0
  28. kalshi_python_async/models/api_key.py +89 -0
  29. kalshi_python_async/models/associated_event.py +105 -0
  30. kalshi_python_async/models/batch_cancel_orders_individual_response.py +111 -0
  31. kalshi_python_async/models/batch_cancel_orders_request.py +87 -0
  32. kalshi_python_async/models/batch_cancel_orders_response.py +95 -0
  33. kalshi_python_async/models/batch_create_orders_individual_response.py +114 -0
  34. kalshi_python_async/models/batch_create_orders_request.py +95 -0
  35. kalshi_python_async/models/batch_create_orders_response.py +95 -0
  36. kalshi_python_async/models/batch_get_market_candlesticks_response.py +95 -0
  37. kalshi_python_async/models/bid_ask_distribution.py +101 -0
  38. kalshi_python_async/models/cancel_order_response.py +93 -0
  39. kalshi_python_async/models/create_api_key_request.py +89 -0
  40. kalshi_python_async/models/create_api_key_response.py +87 -0
  41. kalshi_python_async/models/create_market_in_multivariate_event_collection_request.py +95 -0
  42. kalshi_python_async/models/create_market_in_multivariate_event_collection_response.py +89 -0
  43. kalshi_python_async/models/create_order_group_request.py +88 -0
  44. kalshi_python_async/models/create_order_group_response.py +87 -0
  45. kalshi_python_async/models/create_order_request.py +159 -0
  46. kalshi_python_async/models/create_order_response.py +91 -0
  47. kalshi_python_async/models/create_quote_request.py +93 -0
  48. kalshi_python_async/models/create_quote_response.py +87 -0
  49. kalshi_python_async/models/create_rfq_request.py +97 -0
  50. kalshi_python_async/models/create_rfq_response.py +87 -0
  51. kalshi_python_async/models/daily_schedule.py +89 -0
  52. kalshi_python_async/models/decrease_order_request.py +90 -0
  53. kalshi_python_async/models/decrease_order_response.py +91 -0
  54. kalshi_python_async/models/error_response.py +93 -0
  55. kalshi_python_async/models/event_data.py +133 -0
  56. kalshi_python_async/models/event_position.py +105 -0
  57. kalshi_python_async/models/exchange_status.py +97 -0
  58. kalshi_python_async/models/fill.py +134 -0
  59. kalshi_python_async/models/forecast_percentiles_point.py +101 -0
  60. kalshi_python_async/models/generate_api_key_request.py +87 -0
  61. kalshi_python_async/models/generate_api_key_response.py +89 -0
  62. kalshi_python_async/models/get_api_keys_response.py +95 -0
  63. kalshi_python_async/models/get_balance_response.py +91 -0
  64. kalshi_python_async/models/get_communications_id_response.py +87 -0
  65. kalshi_python_async/models/get_event_candlesticks_response.py +104 -0
  66. kalshi_python_async/models/get_event_forecast_percentiles_history_response.py +95 -0
  67. kalshi_python_async/models/get_event_metadata_response.py +123 -0
  68. kalshi_python_async/models/get_event_response.py +101 -0
  69. kalshi_python_async/models/get_events_candlesticks_response.py +95 -0
  70. kalshi_python_async/models/get_events_candlesticks_response_events_inner.py +106 -0
  71. kalshi_python_async/models/get_events_response.py +107 -0
  72. kalshi_python_async/models/get_exchange_announcements_response.py +95 -0
  73. kalshi_python_async/models/get_exchange_schedule_response.py +91 -0
  74. kalshi_python_async/models/get_fills_response.py +97 -0
  75. kalshi_python_async/models/get_filters_by_sports_response.py +102 -0
  76. kalshi_python_async/models/get_incentive_programs_response.py +97 -0
  77. kalshi_python_async/models/get_live_data_response.py +91 -0
  78. kalshi_python_async/models/get_live_datas_response.py +95 -0
  79. kalshi_python_async/models/get_market_candlesticks_response.py +97 -0
  80. kalshi_python_async/models/get_market_orderbook_response.py +91 -0
  81. kalshi_python_async/models/get_market_response.py +91 -0
  82. kalshi_python_async/models/get_markets_response.py +97 -0
  83. kalshi_python_async/models/get_milestone_response.py +91 -0
  84. kalshi_python_async/models/get_milestones_response.py +97 -0
  85. kalshi_python_async/models/get_multivariate_event_collection_lookup_history_response.py +95 -0
  86. kalshi_python_async/models/get_multivariate_event_collection_response.py +91 -0
  87. kalshi_python_async/models/get_multivariate_event_collections_response.py +97 -0
  88. kalshi_python_async/models/get_multivariate_events_response.py +97 -0
  89. kalshi_python_async/models/get_order_group_response.py +89 -0
  90. kalshi_python_async/models/get_order_groups_response.py +95 -0
  91. kalshi_python_async/models/get_order_queue_position_response.py +87 -0
  92. kalshi_python_async/models/get_order_queue_positions_response.py +95 -0
  93. kalshi_python_async/models/get_order_response.py +91 -0
  94. kalshi_python_async/models/get_orders_response.py +97 -0
  95. kalshi_python_async/models/get_portfolio_resting_order_total_value_response.py +87 -0
  96. kalshi_python_async/models/get_positions_response.py +107 -0
  97. kalshi_python_async/models/get_quote_response.py +91 -0
  98. kalshi_python_async/models/get_quotes_response.py +97 -0
  99. kalshi_python_async/models/get_rfq_response.py +91 -0
  100. kalshi_python_async/models/get_rfqs_response.py +97 -0
  101. kalshi_python_async/models/get_series_fee_changes_response.py +95 -0
  102. kalshi_python_async/models/get_series_list_response.py +95 -0
  103. kalshi_python_async/models/get_series_response.py +91 -0
  104. kalshi_python_async/models/get_settlements_response.py +97 -0
  105. kalshi_python_async/models/get_structured_target_response.py +91 -0
  106. kalshi_python_async/models/get_structured_targets_response.py +97 -0
  107. kalshi_python_async/models/get_tags_for_series_categories_response.py +87 -0
  108. kalshi_python_async/models/get_trades_response.py +97 -0
  109. kalshi_python_async/models/get_user_data_timestamp_response.py +88 -0
  110. kalshi_python_async/models/incentive_program.py +121 -0
  111. kalshi_python_async/models/live_data.py +91 -0
  112. kalshi_python_async/models/lookup_point.py +102 -0
  113. kalshi_python_async/models/lookup_tickers_for_market_in_multivariate_event_collection_request.py +95 -0
  114. kalshi_python_async/models/lookup_tickers_for_market_in_multivariate_event_collection_response.py +89 -0
  115. kalshi_python_async/models/maintenance_window.py +90 -0
  116. kalshi_python_async/models/market.py +307 -0
  117. kalshi_python_async/models/market_candlestick.py +108 -0
  118. kalshi_python_async/models/market_candlesticks_response.py +97 -0
  119. kalshi_python_async/models/market_metadata.py +91 -0
  120. kalshi_python_async/models/market_position.py +110 -0
  121. kalshi_python_async/models/milestone.py +120 -0
  122. kalshi_python_async/models/multivariate_event_collection.py +122 -0
  123. kalshi_python_async/models/mve_selected_leg.py +91 -0
  124. kalshi_python_async/models/order.py +189 -0
  125. kalshi_python_async/models/order_group.py +89 -0
  126. kalshi_python_async/models/order_queue_position.py +91 -0
  127. kalshi_python_async/models/order_status.py +38 -0
  128. kalshi_python_async/models/orderbook.py +94 -0
  129. kalshi_python_async/models/percentile_point.py +93 -0
  130. kalshi_python_async/models/price_distribution.py +157 -0
  131. kalshi_python_async/models/price_range.py +91 -0
  132. kalshi_python_async/models/quote.py +153 -0
  133. kalshi_python_async/models/rfq.py +129 -0
  134. kalshi_python_async/models/schedule.py +105 -0
  135. kalshi_python_async/models/scope_list.py +87 -0
  136. kalshi_python_async/models/self_trade_prevention_type.py +37 -0
  137. kalshi_python_async/models/series.py +129 -0
  138. kalshi_python_async/models/series_fee_change.py +103 -0
  139. kalshi_python_async/models/settlement.py +118 -0
  140. kalshi_python_async/models/settlement_source.py +89 -0
  141. kalshi_python_async/models/sport_filter_details.py +102 -0
  142. kalshi_python_async/models/structured_target.py +98 -0
  143. kalshi_python_async/models/ticker_pair.py +98 -0
  144. kalshi_python_async/models/trade.py +113 -0
  145. kalshi_python_async/models/weekly_schedule.py +154 -0
  146. kalshi_python_async/py.typed +0 -0
  147. kalshi_python_async/rest.py +213 -0
  148. kalshi_python_async-3.0.0.dist-info/METADATA +78 -0
  149. kalshi_python_async-3.0.0.dist-info/RECORD +151 -0
  150. kalshi_python_async-3.0.0.dist-info/WHEEL +5 -0
  151. kalshi_python_async-3.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1375 @@
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
+ import warnings
14
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt, StrictBool
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from typing_extensions import Annotated
17
+
18
+ from pydantic import Field, StrictStr
19
+ from typing import Any, Dict, Optional
20
+ from typing_extensions import Annotated
21
+ from kalshi_python_async.models.create_order_group_request import CreateOrderGroupRequest
22
+ from kalshi_python_async.models.create_order_group_response import CreateOrderGroupResponse
23
+ from kalshi_python_async.models.get_order_group_response import GetOrderGroupResponse
24
+ from kalshi_python_async.models.get_order_groups_response import GetOrderGroupsResponse
25
+
26
+ from kalshi_python_async.api_client import ApiClient, RequestSerialized
27
+ from kalshi_python_async.api_response import ApiResponse
28
+ from kalshi_python_async.rest import RESTResponseType
29
+
30
+
31
+ class OrderGroupsApi:
32
+ """NOTE: This class is auto generated by OpenAPI Generator
33
+ Ref: https://openapi-generator.tech
34
+
35
+ Do not edit the class manually.
36
+ """
37
+
38
+ def __init__(self, api_client=None) -> None:
39
+ if api_client is None:
40
+ api_client = ApiClient.get_default()
41
+ self.api_client = api_client
42
+
43
+
44
+ @validate_call
45
+ async def create_order_group(
46
+ self,
47
+ # Request body parameters as keyword arguments
48
+ **kwargs: Any,
49
+ ) -> CreateOrderGroupResponse:
50
+ """Create Order Group
51
+
52
+ Creates a new order group with a contracts limit. When the limit is hit, all orders in the group are cancelled and no new orders can be placed until reset.
53
+
54
+ :param create_order_group_request: (required)
55
+ :type create_order_group_request: CreateOrderGroupRequest
56
+ :param _request_timeout: timeout setting for this request. If one
57
+ number provided, it will be total request
58
+ timeout. It can also be a pair (tuple) of
59
+ (connection, read) timeouts.
60
+ :type _request_timeout: int, tuple(int, int), optional
61
+ :param _request_auth: set to override the auth_settings for an a single
62
+ request; this effectively ignores the
63
+ authentication in the spec for a single request.
64
+ :type _request_auth: dict, optional
65
+ :param _content_type: force content-type for the request.
66
+ :type _content_type: str, Optional
67
+ :param _headers: set to override the headers for a single
68
+ request; this effectively ignores the headers
69
+ in the spec for a single request.
70
+ :type _headers: dict, optional
71
+ :param _host_index: set to override the host_index for a single
72
+ request; this effectively ignores the host_index
73
+ in the spec for a single request.
74
+ :type _host_index: int, optional
75
+ :return: Returns the result object.
76
+ """ # noqa: E501
77
+
78
+ # Create request object from kwargs
79
+ create_order_group_request = CreateOrderGroupRequest(**kwargs) if kwargs else None
80
+
81
+ _param = self._create_order_group_serialize(
82
+ create_order_group_request=create_order_group_request,
83
+ _request_auth=kwargs.get('_request_auth'),
84
+ _content_type=kwargs.get('_content_type'),
85
+ _headers=kwargs.get('_headers'),
86
+ _host_index=kwargs.get('_host_index', 0)
87
+ )
88
+
89
+ _response_types_map: Dict[str, Optional[str]] = {
90
+ '201': "CreateOrderGroupResponse",
91
+ '400': "ErrorResponse",
92
+ '401': "ErrorResponse",
93
+ '500': "ErrorResponse",
94
+ }
95
+ response_data = await self.api_client.call_api(
96
+ *_param,
97
+ _request_timeout=kwargs.get('_request_timeout'),
98
+ )
99
+ await response_data.read()
100
+ return self.api_client.response_deserialize(
101
+ response_data=response_data,
102
+ response_types_map=_response_types_map,
103
+ ).data
104
+
105
+
106
+ @validate_call
107
+ async def create_order_group_with_http_info(
108
+ self,
109
+ create_order_group_request: CreateOrderGroupRequest,
110
+ _request_timeout: Union[
111
+ None,
112
+ Annotated[StrictFloat, Field(gt=0)],
113
+ Tuple[
114
+ Annotated[StrictFloat, Field(gt=0)],
115
+ Annotated[StrictFloat, Field(gt=0)]
116
+ ]
117
+ ] = None,
118
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
119
+ _content_type: Optional[StrictStr] = None,
120
+ _headers: Optional[Dict[StrictStr, Any]] = None,
121
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
122
+ ) -> ApiResponse[CreateOrderGroupResponse]:
123
+ """Create Order Group
124
+
125
+ Creates a new order group with a contracts limit. When the limit is hit, all orders in the group are cancelled and no new orders can be placed until reset.
126
+
127
+ :param create_order_group_request: (required)
128
+ :type create_order_group_request: CreateOrderGroupRequest
129
+ :param _request_timeout: timeout setting for this request. If one
130
+ number provided, it will be total request
131
+ timeout. It can also be a pair (tuple) of
132
+ (connection, read) timeouts.
133
+ :type _request_timeout: int, tuple(int, int), optional
134
+ :param _request_auth: set to override the auth_settings for an a single
135
+ request; this effectively ignores the
136
+ authentication in the spec for a single request.
137
+ :type _request_auth: dict, optional
138
+ :param _content_type: force content-type for the request.
139
+ :type _content_type: str, Optional
140
+ :param _headers: set to override the headers for a single
141
+ request; this effectively ignores the headers
142
+ in the spec for a single request.
143
+ :type _headers: dict, optional
144
+ :param _host_index: set to override the host_index for a single
145
+ request; this effectively ignores the host_index
146
+ in the spec for a single request.
147
+ :type _host_index: int, optional
148
+ :return: Returns the result object.
149
+ """ # noqa: E501
150
+
151
+ _param = self._create_order_group_serialize(
152
+ create_order_group_request=create_order_group_request,
153
+ _request_auth=_request_auth,
154
+ _content_type=_content_type,
155
+ _headers=_headers,
156
+ _host_index=_host_index
157
+ )
158
+
159
+ _response_types_map: Dict[str, Optional[str]] = {
160
+ '201': "CreateOrderGroupResponse",
161
+ '400': "ErrorResponse",
162
+ '401': "ErrorResponse",
163
+ '500': "ErrorResponse",
164
+ }
165
+ response_data = await self.api_client.call_api(
166
+ *_param,
167
+ _request_timeout=_request_timeout
168
+ )
169
+ await response_data.read()
170
+ return self.api_client.response_deserialize(
171
+ response_data=response_data,
172
+ response_types_map=_response_types_map,
173
+ )
174
+
175
+
176
+ @validate_call
177
+ async def create_order_group_without_preload_content(
178
+ self,
179
+ create_order_group_request: CreateOrderGroupRequest,
180
+ _request_timeout: Union[
181
+ None,
182
+ Annotated[StrictFloat, Field(gt=0)],
183
+ Tuple[
184
+ Annotated[StrictFloat, Field(gt=0)],
185
+ Annotated[StrictFloat, Field(gt=0)]
186
+ ]
187
+ ] = None,
188
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
189
+ _content_type: Optional[StrictStr] = None,
190
+ _headers: Optional[Dict[StrictStr, Any]] = None,
191
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
192
+ ) -> RESTResponseType:
193
+ """Create Order Group
194
+
195
+ Creates a new order group with a contracts limit. When the limit is hit, all orders in the group are cancelled and no new orders can be placed until reset.
196
+
197
+ :param create_order_group_request: (required)
198
+ :type create_order_group_request: CreateOrderGroupRequest
199
+ :param _request_timeout: timeout setting for this request. If one
200
+ number provided, it will be total request
201
+ timeout. It can also be a pair (tuple) of
202
+ (connection, read) timeouts.
203
+ :type _request_timeout: int, tuple(int, int), optional
204
+ :param _request_auth: set to override the auth_settings for an a single
205
+ request; this effectively ignores the
206
+ authentication in the spec for a single request.
207
+ :type _request_auth: dict, optional
208
+ :param _content_type: force content-type for the request.
209
+ :type _content_type: str, Optional
210
+ :param _headers: set to override the headers for a single
211
+ request; this effectively ignores the headers
212
+ in the spec for a single request.
213
+ :type _headers: dict, optional
214
+ :param _host_index: set to override the host_index for a single
215
+ request; this effectively ignores the host_index
216
+ in the spec for a single request.
217
+ :type _host_index: int, optional
218
+ :return: Returns the result object.
219
+ """ # noqa: E501
220
+
221
+ _param = self._create_order_group_serialize(
222
+ create_order_group_request=create_order_group_request,
223
+ _request_auth=_request_auth,
224
+ _content_type=_content_type,
225
+ _headers=_headers,
226
+ _host_index=_host_index
227
+ )
228
+
229
+ _response_types_map: Dict[str, Optional[str]] = {
230
+ '201': "CreateOrderGroupResponse",
231
+ '400': "ErrorResponse",
232
+ '401': "ErrorResponse",
233
+ '500': "ErrorResponse",
234
+ }
235
+ response_data = await self.api_client.call_api(
236
+ *_param,
237
+ _request_timeout=_request_timeout
238
+ )
239
+ return response_data.response
240
+
241
+
242
+ def _create_order_group_serialize(
243
+ self,
244
+ create_order_group_request,
245
+ _request_auth,
246
+ _content_type,
247
+ _headers,
248
+ _host_index,
249
+ ) -> RequestSerialized:
250
+
251
+ _host = None
252
+
253
+ _collection_formats: Dict[str, str] = {
254
+ }
255
+
256
+ _path_params: Dict[str, str] = {}
257
+ _query_params: List[Tuple[str, str]] = []
258
+ _header_params: Dict[str, Optional[str]] = _headers or {}
259
+ _form_params: List[Tuple[str, str]] = []
260
+ _files: Dict[
261
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
262
+ ] = {}
263
+ _body_params: Optional[bytes] = None
264
+
265
+ # process the path parameters
266
+ # process the query parameters
267
+ # process the header parameters
268
+ # process the form parameters
269
+ # process the body parameter
270
+ if create_order_group_request is not None:
271
+ _body_params = create_order_group_request
272
+
273
+
274
+ # set the HTTP header `Accept`
275
+ if 'Accept' not in _header_params:
276
+ _header_params['Accept'] = self.api_client.select_header_accept(
277
+ [
278
+ 'application/json'
279
+ ]
280
+ )
281
+
282
+ # set the HTTP header `Content-Type`
283
+ if _content_type:
284
+ _header_params['Content-Type'] = _content_type
285
+ else:
286
+ _default_content_type = (
287
+ self.api_client.select_header_content_type(
288
+ [
289
+ 'application/json'
290
+ ]
291
+ )
292
+ )
293
+ if _default_content_type is not None:
294
+ _header_params['Content-Type'] = _default_content_type
295
+
296
+ # authentication setting
297
+ _auth_settings: List[str] = [
298
+ 'kalshiAccessSignature',
299
+ 'kalshiAccessKey',
300
+ 'kalshiAccessTimestamp'
301
+ ]
302
+
303
+ return self.api_client.param_serialize(
304
+ method='POST',
305
+ resource_path='/portfolio/order_groups/create',
306
+ path_params=_path_params,
307
+ query_params=_query_params,
308
+ header_params=_header_params,
309
+ body=_body_params,
310
+ post_params=_form_params,
311
+ files=_files,
312
+ auth_settings=_auth_settings,
313
+ collection_formats=_collection_formats,
314
+ _host=_host,
315
+ _request_auth=_request_auth
316
+ )
317
+
318
+
319
+
320
+
321
+ @validate_call
322
+ async def delete_order_group(
323
+ self,
324
+ order_group_id: StrictStr,
325
+ ) -> object:
326
+ """Delete Order Group
327
+
328
+ Deletes an order group and cancels all orders within it. This permanently removes the group.
329
+
330
+ :param order_group_id: Order group ID (required)
331
+ :type order_group_id: str
332
+ :param _request_timeout: timeout setting for this request. If one
333
+ number provided, it will be total request
334
+ timeout. It can also be a pair (tuple) of
335
+ (connection, read) timeouts.
336
+ :type _request_timeout: int, tuple(int, int), optional
337
+ :param _request_auth: set to override the auth_settings for an a single
338
+ request; this effectively ignores the
339
+ authentication in the spec for a single request.
340
+ :type _request_auth: dict, optional
341
+ :param _content_type: force content-type for the request.
342
+ :type _content_type: str, Optional
343
+ :param _headers: set to override the headers for a single
344
+ request; this effectively ignores the headers
345
+ in the spec for a single request.
346
+ :type _headers: dict, optional
347
+ :param _host_index: set to override the host_index for a single
348
+ request; this effectively ignores the host_index
349
+ in the spec for a single request.
350
+ :type _host_index: int, optional
351
+ :return: Returns the result object.
352
+ """ # noqa: E501
353
+
354
+
355
+ _param = self._delete_order_group_serialize(
356
+ order_group_id=order_group_id,
357
+ _request_auth=None,
358
+ _content_type=None,
359
+ _headers=None,
360
+ _host_index=0
361
+ )
362
+
363
+ _response_types_map: Dict[str, Optional[str]] = {
364
+ '200': "object",
365
+ '401': "ErrorResponse",
366
+ '404': "ErrorResponse",
367
+ '500': "ErrorResponse",
368
+ }
369
+ response_data = await self.api_client.call_api(
370
+ *_param,
371
+ _request_timeout=None,
372
+ )
373
+ await response_data.read()
374
+ return self.api_client.response_deserialize(
375
+ response_data=response_data,
376
+ response_types_map=_response_types_map,
377
+ ).data
378
+
379
+
380
+ @validate_call
381
+ async def delete_order_group_with_http_info(
382
+ self,
383
+ order_group_id: Annotated[StrictStr, Field(description="Order group ID")],
384
+ _request_timeout: Union[
385
+ None,
386
+ Annotated[StrictFloat, Field(gt=0)],
387
+ Tuple[
388
+ Annotated[StrictFloat, Field(gt=0)],
389
+ Annotated[StrictFloat, Field(gt=0)]
390
+ ]
391
+ ] = None,
392
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
393
+ _content_type: Optional[StrictStr] = None,
394
+ _headers: Optional[Dict[StrictStr, Any]] = None,
395
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
396
+ ) -> ApiResponse[object]:
397
+ """Delete Order Group
398
+
399
+ Deletes an order group and cancels all orders within it. This permanently removes the group.
400
+
401
+ :param order_group_id: Order group ID (required)
402
+ :type order_group_id: str
403
+ :param _request_timeout: timeout setting for this request. If one
404
+ number provided, it will be total request
405
+ timeout. It can also be a pair (tuple) of
406
+ (connection, read) timeouts.
407
+ :type _request_timeout: int, tuple(int, int), optional
408
+ :param _request_auth: set to override the auth_settings for an a single
409
+ request; this effectively ignores the
410
+ authentication in the spec for a single request.
411
+ :type _request_auth: dict, optional
412
+ :param _content_type: force content-type for the request.
413
+ :type _content_type: str, Optional
414
+ :param _headers: set to override the headers for a single
415
+ request; this effectively ignores the headers
416
+ in the spec for a single request.
417
+ :type _headers: dict, optional
418
+ :param _host_index: set to override the host_index for a single
419
+ request; this effectively ignores the host_index
420
+ in the spec for a single request.
421
+ :type _host_index: int, optional
422
+ :return: Returns the result object.
423
+ """ # noqa: E501
424
+
425
+ _param = self._delete_order_group_serialize(
426
+ order_group_id=order_group_id,
427
+ _request_auth=_request_auth,
428
+ _content_type=_content_type,
429
+ _headers=_headers,
430
+ _host_index=_host_index
431
+ )
432
+
433
+ _response_types_map: Dict[str, Optional[str]] = {
434
+ '200': "object",
435
+ '401': "ErrorResponse",
436
+ '404': "ErrorResponse",
437
+ '500': "ErrorResponse",
438
+ }
439
+ response_data = await self.api_client.call_api(
440
+ *_param,
441
+ _request_timeout=_request_timeout
442
+ )
443
+ await response_data.read()
444
+ return self.api_client.response_deserialize(
445
+ response_data=response_data,
446
+ response_types_map=_response_types_map,
447
+ )
448
+
449
+
450
+ @validate_call
451
+ async def delete_order_group_without_preload_content(
452
+ self,
453
+ order_group_id: Annotated[StrictStr, Field(description="Order group ID")],
454
+ _request_timeout: Union[
455
+ None,
456
+ Annotated[StrictFloat, Field(gt=0)],
457
+ Tuple[
458
+ Annotated[StrictFloat, Field(gt=0)],
459
+ Annotated[StrictFloat, Field(gt=0)]
460
+ ]
461
+ ] = None,
462
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
463
+ _content_type: Optional[StrictStr] = None,
464
+ _headers: Optional[Dict[StrictStr, Any]] = None,
465
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
466
+ ) -> RESTResponseType:
467
+ """Delete Order Group
468
+
469
+ Deletes an order group and cancels all orders within it. This permanently removes the group.
470
+
471
+ :param order_group_id: Order group ID (required)
472
+ :type order_group_id: str
473
+ :param _request_timeout: timeout setting for this request. If one
474
+ number provided, it will be total request
475
+ timeout. It can also be a pair (tuple) of
476
+ (connection, read) timeouts.
477
+ :type _request_timeout: int, tuple(int, int), optional
478
+ :param _request_auth: set to override the auth_settings for an a single
479
+ request; this effectively ignores the
480
+ authentication in the spec for a single request.
481
+ :type _request_auth: dict, optional
482
+ :param _content_type: force content-type for the request.
483
+ :type _content_type: str, Optional
484
+ :param _headers: set to override the headers for a single
485
+ request; this effectively ignores the headers
486
+ in the spec for a single request.
487
+ :type _headers: dict, optional
488
+ :param _host_index: set to override the host_index for a single
489
+ request; this effectively ignores the host_index
490
+ in the spec for a single request.
491
+ :type _host_index: int, optional
492
+ :return: Returns the result object.
493
+ """ # noqa: E501
494
+
495
+ _param = self._delete_order_group_serialize(
496
+ order_group_id=order_group_id,
497
+ _request_auth=_request_auth,
498
+ _content_type=_content_type,
499
+ _headers=_headers,
500
+ _host_index=_host_index
501
+ )
502
+
503
+ _response_types_map: Dict[str, Optional[str]] = {
504
+ '200': "object",
505
+ '401': "ErrorResponse",
506
+ '404': "ErrorResponse",
507
+ '500': "ErrorResponse",
508
+ }
509
+ response_data = await self.api_client.call_api(
510
+ *_param,
511
+ _request_timeout=_request_timeout
512
+ )
513
+ return response_data.response
514
+
515
+
516
+ def _delete_order_group_serialize(
517
+ self,
518
+ order_group_id,
519
+ _request_auth,
520
+ _content_type,
521
+ _headers,
522
+ _host_index,
523
+ ) -> RequestSerialized:
524
+
525
+ _host = None
526
+
527
+ _collection_formats: Dict[str, str] = {
528
+ }
529
+
530
+ _path_params: Dict[str, str] = {}
531
+ _query_params: List[Tuple[str, str]] = []
532
+ _header_params: Dict[str, Optional[str]] = _headers or {}
533
+ _form_params: List[Tuple[str, str]] = []
534
+ _files: Dict[
535
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
536
+ ] = {}
537
+ _body_params: Optional[bytes] = None
538
+
539
+ # process the path parameters
540
+ if order_group_id is not None:
541
+ _path_params['order_group_id'] = order_group_id
542
+ # process the query parameters
543
+ # process the header parameters
544
+ # process the form parameters
545
+ # process the body parameter
546
+
547
+
548
+ # set the HTTP header `Accept`
549
+ if 'Accept' not in _header_params:
550
+ _header_params['Accept'] = self.api_client.select_header_accept(
551
+ [
552
+ 'application/json'
553
+ ]
554
+ )
555
+
556
+
557
+ # authentication setting
558
+ _auth_settings: List[str] = [
559
+ 'kalshiAccessSignature',
560
+ 'kalshiAccessKey',
561
+ 'kalshiAccessTimestamp'
562
+ ]
563
+
564
+ return self.api_client.param_serialize(
565
+ method='DELETE',
566
+ resource_path='/portfolio/order_groups/{order_group_id}',
567
+ path_params=_path_params,
568
+ query_params=_query_params,
569
+ header_params=_header_params,
570
+ body=_body_params,
571
+ post_params=_form_params,
572
+ files=_files,
573
+ auth_settings=_auth_settings,
574
+ collection_formats=_collection_formats,
575
+ _host=_host,
576
+ _request_auth=_request_auth
577
+ )
578
+
579
+
580
+
581
+
582
+ @validate_call
583
+ async def get_order_group(
584
+ self,
585
+ order_group_id: StrictStr,
586
+ ) -> GetOrderGroupResponse:
587
+ """Get Order Group
588
+
589
+ Retrieves details for a single order group including all order IDs and auto-cancel status.
590
+
591
+ :param order_group_id: Order group ID (required)
592
+ :type order_group_id: str
593
+ :param _request_timeout: timeout setting for this request. If one
594
+ number provided, it will be total request
595
+ timeout. It can also be a pair (tuple) of
596
+ (connection, read) timeouts.
597
+ :type _request_timeout: int, tuple(int, int), optional
598
+ :param _request_auth: set to override the auth_settings for an a single
599
+ request; this effectively ignores the
600
+ authentication in the spec for a single request.
601
+ :type _request_auth: dict, optional
602
+ :param _content_type: force content-type for the request.
603
+ :type _content_type: str, Optional
604
+ :param _headers: set to override the headers for a single
605
+ request; this effectively ignores the headers
606
+ in the spec for a single request.
607
+ :type _headers: dict, optional
608
+ :param _host_index: set to override the host_index for a single
609
+ request; this effectively ignores the host_index
610
+ in the spec for a single request.
611
+ :type _host_index: int, optional
612
+ :return: Returns the result object.
613
+ """ # noqa: E501
614
+
615
+
616
+ _param = self._get_order_group_serialize(
617
+ order_group_id=order_group_id,
618
+ _request_auth=None,
619
+ _content_type=None,
620
+ _headers=None,
621
+ _host_index=0
622
+ )
623
+
624
+ _response_types_map: Dict[str, Optional[str]] = {
625
+ '200': "GetOrderGroupResponse",
626
+ '401': "ErrorResponse",
627
+ '404': "ErrorResponse",
628
+ '500': "ErrorResponse",
629
+ }
630
+ response_data = await self.api_client.call_api(
631
+ *_param,
632
+ _request_timeout=None,
633
+ )
634
+ await response_data.read()
635
+ return self.api_client.response_deserialize(
636
+ response_data=response_data,
637
+ response_types_map=_response_types_map,
638
+ ).data
639
+
640
+
641
+ @validate_call
642
+ async def get_order_group_with_http_info(
643
+ self,
644
+ order_group_id: Annotated[StrictStr, Field(description="Order group ID")],
645
+ _request_timeout: Union[
646
+ None,
647
+ Annotated[StrictFloat, Field(gt=0)],
648
+ Tuple[
649
+ Annotated[StrictFloat, Field(gt=0)],
650
+ Annotated[StrictFloat, Field(gt=0)]
651
+ ]
652
+ ] = None,
653
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
654
+ _content_type: Optional[StrictStr] = None,
655
+ _headers: Optional[Dict[StrictStr, Any]] = None,
656
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
657
+ ) -> ApiResponse[GetOrderGroupResponse]:
658
+ """Get Order Group
659
+
660
+ Retrieves details for a single order group including all order IDs and auto-cancel status.
661
+
662
+ :param order_group_id: Order group ID (required)
663
+ :type order_group_id: str
664
+ :param _request_timeout: timeout setting for this request. If one
665
+ number provided, it will be total request
666
+ timeout. It can also be a pair (tuple) of
667
+ (connection, read) timeouts.
668
+ :type _request_timeout: int, tuple(int, int), optional
669
+ :param _request_auth: set to override the auth_settings for an a single
670
+ request; this effectively ignores the
671
+ authentication in the spec for a single request.
672
+ :type _request_auth: dict, optional
673
+ :param _content_type: force content-type for the request.
674
+ :type _content_type: str, Optional
675
+ :param _headers: set to override the headers for a single
676
+ request; this effectively ignores the headers
677
+ in the spec for a single request.
678
+ :type _headers: dict, optional
679
+ :param _host_index: set to override the host_index for a single
680
+ request; this effectively ignores the host_index
681
+ in the spec for a single request.
682
+ :type _host_index: int, optional
683
+ :return: Returns the result object.
684
+ """ # noqa: E501
685
+
686
+ _param = self._get_order_group_serialize(
687
+ order_group_id=order_group_id,
688
+ _request_auth=_request_auth,
689
+ _content_type=_content_type,
690
+ _headers=_headers,
691
+ _host_index=_host_index
692
+ )
693
+
694
+ _response_types_map: Dict[str, Optional[str]] = {
695
+ '200': "GetOrderGroupResponse",
696
+ '401': "ErrorResponse",
697
+ '404': "ErrorResponse",
698
+ '500': "ErrorResponse",
699
+ }
700
+ response_data = await self.api_client.call_api(
701
+ *_param,
702
+ _request_timeout=_request_timeout
703
+ )
704
+ await response_data.read()
705
+ return self.api_client.response_deserialize(
706
+ response_data=response_data,
707
+ response_types_map=_response_types_map,
708
+ )
709
+
710
+
711
+ @validate_call
712
+ async def get_order_group_without_preload_content(
713
+ self,
714
+ order_group_id: Annotated[StrictStr, Field(description="Order group ID")],
715
+ _request_timeout: Union[
716
+ None,
717
+ Annotated[StrictFloat, Field(gt=0)],
718
+ Tuple[
719
+ Annotated[StrictFloat, Field(gt=0)],
720
+ Annotated[StrictFloat, Field(gt=0)]
721
+ ]
722
+ ] = None,
723
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
724
+ _content_type: Optional[StrictStr] = None,
725
+ _headers: Optional[Dict[StrictStr, Any]] = None,
726
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
727
+ ) -> RESTResponseType:
728
+ """Get Order Group
729
+
730
+ Retrieves details for a single order group including all order IDs and auto-cancel status.
731
+
732
+ :param order_group_id: Order group ID (required)
733
+ :type order_group_id: str
734
+ :param _request_timeout: timeout setting for this request. If one
735
+ number provided, it will be total request
736
+ timeout. It can also be a pair (tuple) of
737
+ (connection, read) timeouts.
738
+ :type _request_timeout: int, tuple(int, int), optional
739
+ :param _request_auth: set to override the auth_settings for an a single
740
+ request; this effectively ignores the
741
+ authentication in the spec for a single request.
742
+ :type _request_auth: dict, optional
743
+ :param _content_type: force content-type for the request.
744
+ :type _content_type: str, Optional
745
+ :param _headers: set to override the headers for a single
746
+ request; this effectively ignores the headers
747
+ in the spec for a single request.
748
+ :type _headers: dict, optional
749
+ :param _host_index: set to override the host_index for a single
750
+ request; this effectively ignores the host_index
751
+ in the spec for a single request.
752
+ :type _host_index: int, optional
753
+ :return: Returns the result object.
754
+ """ # noqa: E501
755
+
756
+ _param = self._get_order_group_serialize(
757
+ order_group_id=order_group_id,
758
+ _request_auth=_request_auth,
759
+ _content_type=_content_type,
760
+ _headers=_headers,
761
+ _host_index=_host_index
762
+ )
763
+
764
+ _response_types_map: Dict[str, Optional[str]] = {
765
+ '200': "GetOrderGroupResponse",
766
+ '401': "ErrorResponse",
767
+ '404': "ErrorResponse",
768
+ '500': "ErrorResponse",
769
+ }
770
+ response_data = await self.api_client.call_api(
771
+ *_param,
772
+ _request_timeout=_request_timeout
773
+ )
774
+ return response_data.response
775
+
776
+
777
+ def _get_order_group_serialize(
778
+ self,
779
+ order_group_id,
780
+ _request_auth,
781
+ _content_type,
782
+ _headers,
783
+ _host_index,
784
+ ) -> RequestSerialized:
785
+
786
+ _host = None
787
+
788
+ _collection_formats: Dict[str, str] = {
789
+ }
790
+
791
+ _path_params: Dict[str, str] = {}
792
+ _query_params: List[Tuple[str, str]] = []
793
+ _header_params: Dict[str, Optional[str]] = _headers or {}
794
+ _form_params: List[Tuple[str, str]] = []
795
+ _files: Dict[
796
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
797
+ ] = {}
798
+ _body_params: Optional[bytes] = None
799
+
800
+ # process the path parameters
801
+ if order_group_id is not None:
802
+ _path_params['order_group_id'] = order_group_id
803
+ # process the query parameters
804
+ # process the header parameters
805
+ # process the form parameters
806
+ # process the body parameter
807
+
808
+
809
+ # set the HTTP header `Accept`
810
+ if 'Accept' not in _header_params:
811
+ _header_params['Accept'] = self.api_client.select_header_accept(
812
+ [
813
+ 'application/json'
814
+ ]
815
+ )
816
+
817
+
818
+ # authentication setting
819
+ _auth_settings: List[str] = [
820
+ 'kalshiAccessSignature',
821
+ 'kalshiAccessKey',
822
+ 'kalshiAccessTimestamp'
823
+ ]
824
+
825
+ return self.api_client.param_serialize(
826
+ method='GET',
827
+ resource_path='/portfolio/order_groups/{order_group_id}',
828
+ path_params=_path_params,
829
+ query_params=_query_params,
830
+ header_params=_header_params,
831
+ body=_body_params,
832
+ post_params=_form_params,
833
+ files=_files,
834
+ auth_settings=_auth_settings,
835
+ collection_formats=_collection_formats,
836
+ _host=_host,
837
+ _request_auth=_request_auth
838
+ )
839
+
840
+
841
+
842
+
843
+ @validate_call
844
+ async def get_order_groups(
845
+ self,
846
+ ) -> GetOrderGroupsResponse:
847
+ """Get Order Groups
848
+
849
+ Retrieves all order groups for the authenticated user.
850
+
851
+ :param _request_timeout: timeout setting for this request. If one
852
+ number provided, it will be total request
853
+ timeout. It can also be a pair (tuple) of
854
+ (connection, read) timeouts.
855
+ :type _request_timeout: int, tuple(int, int), optional
856
+ :param _request_auth: set to override the auth_settings for an a single
857
+ request; this effectively ignores the
858
+ authentication in the spec for a single request.
859
+ :type _request_auth: dict, optional
860
+ :param _content_type: force content-type for the request.
861
+ :type _content_type: str, Optional
862
+ :param _headers: set to override the headers for a single
863
+ request; this effectively ignores the headers
864
+ in the spec for a single request.
865
+ :type _headers: dict, optional
866
+ :param _host_index: set to override the host_index for a single
867
+ request; this effectively ignores the host_index
868
+ in the spec for a single request.
869
+ :type _host_index: int, optional
870
+ :return: Returns the result object.
871
+ """ # noqa: E501
872
+
873
+
874
+ _param = self._get_order_groups_serialize(
875
+ _request_auth=None,
876
+ _content_type=None,
877
+ _headers=None,
878
+ _host_index=0
879
+ )
880
+
881
+ _response_types_map: Dict[str, Optional[str]] = {
882
+ '200': "GetOrderGroupsResponse",
883
+ '400': "ErrorResponse",
884
+ '401': "ErrorResponse",
885
+ '500': "ErrorResponse",
886
+ }
887
+ response_data = await self.api_client.call_api(
888
+ *_param,
889
+ _request_timeout=None,
890
+ )
891
+ await response_data.read()
892
+ return self.api_client.response_deserialize(
893
+ response_data=response_data,
894
+ response_types_map=_response_types_map,
895
+ ).data
896
+
897
+
898
+ @validate_call
899
+ async def get_order_groups_with_http_info(
900
+ self,
901
+ _request_timeout: Union[
902
+ None,
903
+ Annotated[StrictFloat, Field(gt=0)],
904
+ Tuple[
905
+ Annotated[StrictFloat, Field(gt=0)],
906
+ Annotated[StrictFloat, Field(gt=0)]
907
+ ]
908
+ ] = None,
909
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
910
+ _content_type: Optional[StrictStr] = None,
911
+ _headers: Optional[Dict[StrictStr, Any]] = None,
912
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
913
+ ) -> ApiResponse[GetOrderGroupsResponse]:
914
+ """Get Order Groups
915
+
916
+ Retrieves all order groups for the authenticated user.
917
+
918
+ :param _request_timeout: timeout setting for this request. If one
919
+ number provided, it will be total request
920
+ timeout. It can also be a pair (tuple) of
921
+ (connection, read) timeouts.
922
+ :type _request_timeout: int, tuple(int, int), optional
923
+ :param _request_auth: set to override the auth_settings for an a single
924
+ request; this effectively ignores the
925
+ authentication in the spec for a single request.
926
+ :type _request_auth: dict, optional
927
+ :param _content_type: force content-type for the request.
928
+ :type _content_type: str, Optional
929
+ :param _headers: set to override the headers for a single
930
+ request; this effectively ignores the headers
931
+ in the spec for a single request.
932
+ :type _headers: dict, optional
933
+ :param _host_index: set to override the host_index for a single
934
+ request; this effectively ignores the host_index
935
+ in the spec for a single request.
936
+ :type _host_index: int, optional
937
+ :return: Returns the result object.
938
+ """ # noqa: E501
939
+
940
+ _param = self._get_order_groups_serialize(
941
+ _request_auth=_request_auth,
942
+ _content_type=_content_type,
943
+ _headers=_headers,
944
+ _host_index=_host_index
945
+ )
946
+
947
+ _response_types_map: Dict[str, Optional[str]] = {
948
+ '200': "GetOrderGroupsResponse",
949
+ '400': "ErrorResponse",
950
+ '401': "ErrorResponse",
951
+ '500': "ErrorResponse",
952
+ }
953
+ response_data = await self.api_client.call_api(
954
+ *_param,
955
+ _request_timeout=_request_timeout
956
+ )
957
+ await response_data.read()
958
+ return self.api_client.response_deserialize(
959
+ response_data=response_data,
960
+ response_types_map=_response_types_map,
961
+ )
962
+
963
+
964
+ @validate_call
965
+ async def get_order_groups_without_preload_content(
966
+ self,
967
+ _request_timeout: Union[
968
+ None,
969
+ Annotated[StrictFloat, Field(gt=0)],
970
+ Tuple[
971
+ Annotated[StrictFloat, Field(gt=0)],
972
+ Annotated[StrictFloat, Field(gt=0)]
973
+ ]
974
+ ] = None,
975
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
976
+ _content_type: Optional[StrictStr] = None,
977
+ _headers: Optional[Dict[StrictStr, Any]] = None,
978
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
979
+ ) -> RESTResponseType:
980
+ """Get Order Groups
981
+
982
+ Retrieves all order groups for the authenticated user.
983
+
984
+ :param _request_timeout: timeout setting for this request. If one
985
+ number provided, it will be total request
986
+ timeout. It can also be a pair (tuple) of
987
+ (connection, read) timeouts.
988
+ :type _request_timeout: int, tuple(int, int), optional
989
+ :param _request_auth: set to override the auth_settings for an a single
990
+ request; this effectively ignores the
991
+ authentication in the spec for a single request.
992
+ :type _request_auth: dict, optional
993
+ :param _content_type: force content-type for the request.
994
+ :type _content_type: str, Optional
995
+ :param _headers: set to override the headers for a single
996
+ request; this effectively ignores the headers
997
+ in the spec for a single request.
998
+ :type _headers: dict, optional
999
+ :param _host_index: set to override the host_index for a single
1000
+ request; this effectively ignores the host_index
1001
+ in the spec for a single request.
1002
+ :type _host_index: int, optional
1003
+ :return: Returns the result object.
1004
+ """ # noqa: E501
1005
+
1006
+ _param = self._get_order_groups_serialize(
1007
+ _request_auth=_request_auth,
1008
+ _content_type=_content_type,
1009
+ _headers=_headers,
1010
+ _host_index=_host_index
1011
+ )
1012
+
1013
+ _response_types_map: Dict[str, Optional[str]] = {
1014
+ '200': "GetOrderGroupsResponse",
1015
+ '400': "ErrorResponse",
1016
+ '401': "ErrorResponse",
1017
+ '500': "ErrorResponse",
1018
+ }
1019
+ response_data = await self.api_client.call_api(
1020
+ *_param,
1021
+ _request_timeout=_request_timeout
1022
+ )
1023
+ return response_data.response
1024
+
1025
+
1026
+ def _get_order_groups_serialize(
1027
+ self,
1028
+ _request_auth,
1029
+ _content_type,
1030
+ _headers,
1031
+ _host_index,
1032
+ ) -> RequestSerialized:
1033
+
1034
+ _host = None
1035
+
1036
+ _collection_formats: Dict[str, str] = {
1037
+ }
1038
+
1039
+ _path_params: Dict[str, str] = {}
1040
+ _query_params: List[Tuple[str, str]] = []
1041
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1042
+ _form_params: List[Tuple[str, str]] = []
1043
+ _files: Dict[
1044
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1045
+ ] = {}
1046
+ _body_params: Optional[bytes] = None
1047
+
1048
+ # process the path parameters
1049
+ # process the query parameters
1050
+ # process the header parameters
1051
+ # process the form parameters
1052
+ # process the body parameter
1053
+
1054
+
1055
+ # set the HTTP header `Accept`
1056
+ if 'Accept' not in _header_params:
1057
+ _header_params['Accept'] = self.api_client.select_header_accept(
1058
+ [
1059
+ 'application/json'
1060
+ ]
1061
+ )
1062
+
1063
+
1064
+ # authentication setting
1065
+ _auth_settings: List[str] = [
1066
+ 'kalshiAccessSignature',
1067
+ 'kalshiAccessKey',
1068
+ 'kalshiAccessTimestamp'
1069
+ ]
1070
+
1071
+ return self.api_client.param_serialize(
1072
+ method='GET',
1073
+ resource_path='/portfolio/order_groups',
1074
+ path_params=_path_params,
1075
+ query_params=_query_params,
1076
+ header_params=_header_params,
1077
+ body=_body_params,
1078
+ post_params=_form_params,
1079
+ files=_files,
1080
+ auth_settings=_auth_settings,
1081
+ collection_formats=_collection_formats,
1082
+ _host=_host,
1083
+ _request_auth=_request_auth
1084
+ )
1085
+
1086
+
1087
+
1088
+
1089
+ @validate_call
1090
+ async def reset_order_group(
1091
+ self,
1092
+ order_group_id: StrictStr,
1093
+ body: Any = None,
1094
+ ) -> object:
1095
+ """Reset Order Group
1096
+
1097
+ Resets the order group's matched contracts counter to zero, allowing new orders to be placed again after the limit was hit.
1098
+
1099
+ :param order_group_id: Order group ID (required)
1100
+ :type order_group_id: str
1101
+ :param body:
1102
+ :type body: object
1103
+ :param _request_timeout: timeout setting for this request. If one
1104
+ number provided, it will be total request
1105
+ timeout. It can also be a pair (tuple) of
1106
+ (connection, read) timeouts.
1107
+ :type _request_timeout: int, tuple(int, int), optional
1108
+ :param _request_auth: set to override the auth_settings for an a single
1109
+ request; this effectively ignores the
1110
+ authentication in the spec for a single request.
1111
+ :type _request_auth: dict, optional
1112
+ :param _content_type: force content-type for the request.
1113
+ :type _content_type: str, Optional
1114
+ :param _headers: set to override the headers for a single
1115
+ request; this effectively ignores the headers
1116
+ in the spec for a single request.
1117
+ :type _headers: dict, optional
1118
+ :param _host_index: set to override the host_index for a single
1119
+ request; this effectively ignores the host_index
1120
+ in the spec for a single request.
1121
+ :type _host_index: int, optional
1122
+ :return: Returns the result object.
1123
+ """ # noqa: E501
1124
+
1125
+
1126
+ _param = self._reset_order_group_serialize(
1127
+ order_group_id=order_group_id,
1128
+ body=body,
1129
+ _request_auth=None,
1130
+ _content_type=None,
1131
+ _headers=None,
1132
+ _host_index=0
1133
+ )
1134
+
1135
+ _response_types_map: Dict[str, Optional[str]] = {
1136
+ '200': "object",
1137
+ '401': "ErrorResponse",
1138
+ '404': "ErrorResponse",
1139
+ '500': "ErrorResponse",
1140
+ }
1141
+ response_data = await self.api_client.call_api(
1142
+ *_param,
1143
+ _request_timeout=None,
1144
+ )
1145
+ await response_data.read()
1146
+ return self.api_client.response_deserialize(
1147
+ response_data=response_data,
1148
+ response_types_map=_response_types_map,
1149
+ ).data
1150
+
1151
+
1152
+ @validate_call
1153
+ async def reset_order_group_with_http_info(
1154
+ self,
1155
+ order_group_id: Annotated[StrictStr, Field(description="Order group ID")],
1156
+ body: Optional[Dict[str, Any]] = None,
1157
+ _request_timeout: Union[
1158
+ None,
1159
+ Annotated[StrictFloat, Field(gt=0)],
1160
+ Tuple[
1161
+ Annotated[StrictFloat, Field(gt=0)],
1162
+ Annotated[StrictFloat, Field(gt=0)]
1163
+ ]
1164
+ ] = None,
1165
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1166
+ _content_type: Optional[StrictStr] = None,
1167
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1168
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1169
+ ) -> ApiResponse[object]:
1170
+ """Reset Order Group
1171
+
1172
+ Resets the order group's matched contracts counter to zero, allowing new orders to be placed again after the limit was hit.
1173
+
1174
+ :param order_group_id: Order group ID (required)
1175
+ :type order_group_id: str
1176
+ :param body:
1177
+ :type body: object
1178
+ :param _request_timeout: timeout setting for this request. If one
1179
+ number provided, it will be total request
1180
+ timeout. It can also be a pair (tuple) of
1181
+ (connection, read) timeouts.
1182
+ :type _request_timeout: int, tuple(int, int), optional
1183
+ :param _request_auth: set to override the auth_settings for an a single
1184
+ request; this effectively ignores the
1185
+ authentication in the spec for a single request.
1186
+ :type _request_auth: dict, optional
1187
+ :param _content_type: force content-type for the request.
1188
+ :type _content_type: str, Optional
1189
+ :param _headers: set to override the headers for a single
1190
+ request; this effectively ignores the headers
1191
+ in the spec for a single request.
1192
+ :type _headers: dict, optional
1193
+ :param _host_index: set to override the host_index for a single
1194
+ request; this effectively ignores the host_index
1195
+ in the spec for a single request.
1196
+ :type _host_index: int, optional
1197
+ :return: Returns the result object.
1198
+ """ # noqa: E501
1199
+
1200
+ _param = self._reset_order_group_serialize(
1201
+ order_group_id=order_group_id,
1202
+ body=body,
1203
+ _request_auth=_request_auth,
1204
+ _content_type=_content_type,
1205
+ _headers=_headers,
1206
+ _host_index=_host_index
1207
+ )
1208
+
1209
+ _response_types_map: Dict[str, Optional[str]] = {
1210
+ '200': "object",
1211
+ '401': "ErrorResponse",
1212
+ '404': "ErrorResponse",
1213
+ '500': "ErrorResponse",
1214
+ }
1215
+ response_data = await self.api_client.call_api(
1216
+ *_param,
1217
+ _request_timeout=_request_timeout
1218
+ )
1219
+ await response_data.read()
1220
+ return self.api_client.response_deserialize(
1221
+ response_data=response_data,
1222
+ response_types_map=_response_types_map,
1223
+ )
1224
+
1225
+
1226
+ @validate_call
1227
+ async def reset_order_group_without_preload_content(
1228
+ self,
1229
+ order_group_id: Annotated[StrictStr, Field(description="Order group ID")],
1230
+ body: Optional[Dict[str, Any]] = None,
1231
+ _request_timeout: Union[
1232
+ None,
1233
+ Annotated[StrictFloat, Field(gt=0)],
1234
+ Tuple[
1235
+ Annotated[StrictFloat, Field(gt=0)],
1236
+ Annotated[StrictFloat, Field(gt=0)]
1237
+ ]
1238
+ ] = None,
1239
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1240
+ _content_type: Optional[StrictStr] = None,
1241
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1242
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1243
+ ) -> RESTResponseType:
1244
+ """Reset Order Group
1245
+
1246
+ Resets the order group's matched contracts counter to zero, allowing new orders to be placed again after the limit was hit.
1247
+
1248
+ :param order_group_id: Order group ID (required)
1249
+ :type order_group_id: str
1250
+ :param body:
1251
+ :type body: object
1252
+ :param _request_timeout: timeout setting for this request. If one
1253
+ number provided, it will be total request
1254
+ timeout. It can also be a pair (tuple) of
1255
+ (connection, read) timeouts.
1256
+ :type _request_timeout: int, tuple(int, int), optional
1257
+ :param _request_auth: set to override the auth_settings for an a single
1258
+ request; this effectively ignores the
1259
+ authentication in the spec for a single request.
1260
+ :type _request_auth: dict, optional
1261
+ :param _content_type: force content-type for the request.
1262
+ :type _content_type: str, Optional
1263
+ :param _headers: set to override the headers for a single
1264
+ request; this effectively ignores the headers
1265
+ in the spec for a single request.
1266
+ :type _headers: dict, optional
1267
+ :param _host_index: set to override the host_index for a single
1268
+ request; this effectively ignores the host_index
1269
+ in the spec for a single request.
1270
+ :type _host_index: int, optional
1271
+ :return: Returns the result object.
1272
+ """ # noqa: E501
1273
+
1274
+ _param = self._reset_order_group_serialize(
1275
+ order_group_id=order_group_id,
1276
+ body=body,
1277
+ _request_auth=_request_auth,
1278
+ _content_type=_content_type,
1279
+ _headers=_headers,
1280
+ _host_index=_host_index
1281
+ )
1282
+
1283
+ _response_types_map: Dict[str, Optional[str]] = {
1284
+ '200': "object",
1285
+ '401': "ErrorResponse",
1286
+ '404': "ErrorResponse",
1287
+ '500': "ErrorResponse",
1288
+ }
1289
+ response_data = await self.api_client.call_api(
1290
+ *_param,
1291
+ _request_timeout=_request_timeout
1292
+ )
1293
+ return response_data.response
1294
+
1295
+
1296
+ def _reset_order_group_serialize(
1297
+ self,
1298
+ order_group_id,
1299
+ body,
1300
+ _request_auth,
1301
+ _content_type,
1302
+ _headers,
1303
+ _host_index,
1304
+ ) -> RequestSerialized:
1305
+
1306
+ _host = None
1307
+
1308
+ _collection_formats: Dict[str, str] = {
1309
+ }
1310
+
1311
+ _path_params: Dict[str, str] = {}
1312
+ _query_params: List[Tuple[str, str]] = []
1313
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1314
+ _form_params: List[Tuple[str, str]] = []
1315
+ _files: Dict[
1316
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1317
+ ] = {}
1318
+ _body_params: Optional[bytes] = None
1319
+
1320
+ # process the path parameters
1321
+ if order_group_id is not None:
1322
+ _path_params['order_group_id'] = order_group_id
1323
+ # process the query parameters
1324
+ # process the header parameters
1325
+ # process the form parameters
1326
+ # process the body parameter
1327
+ if body is not None:
1328
+ _body_params = body
1329
+
1330
+
1331
+ # set the HTTP header `Accept`
1332
+ if 'Accept' not in _header_params:
1333
+ _header_params['Accept'] = self.api_client.select_header_accept(
1334
+ [
1335
+ 'application/json'
1336
+ ]
1337
+ )
1338
+
1339
+ # set the HTTP header `Content-Type`
1340
+ if _content_type:
1341
+ _header_params['Content-Type'] = _content_type
1342
+ else:
1343
+ _default_content_type = (
1344
+ self.api_client.select_header_content_type(
1345
+ [
1346
+ 'application/json'
1347
+ ]
1348
+ )
1349
+ )
1350
+ if _default_content_type is not None:
1351
+ _header_params['Content-Type'] = _default_content_type
1352
+
1353
+ # authentication setting
1354
+ _auth_settings: List[str] = [
1355
+ 'kalshiAccessSignature',
1356
+ 'kalshiAccessKey',
1357
+ 'kalshiAccessTimestamp'
1358
+ ]
1359
+
1360
+ return self.api_client.param_serialize(
1361
+ method='PUT',
1362
+ resource_path='/portfolio/order_groups/{order_group_id}/reset',
1363
+ path_params=_path_params,
1364
+ query_params=_query_params,
1365
+ header_params=_header_params,
1366
+ body=_body_params,
1367
+ post_params=_form_params,
1368
+ files=_files,
1369
+ auth_settings=_auth_settings,
1370
+ collection_formats=_collection_formats,
1371
+ _host=_host,
1372
+ _request_auth=_request_auth
1373
+ )
1374
+
1375
+