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,1941 @@
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, StrictBool, StrictInt, StrictStr, field_validator
19
+ from typing import List, Optional
20
+ from typing_extensions import Annotated
21
+ from kalshi_python_async.models.get_event_candlesticks_response import GetEventCandlesticksResponse
22
+ from kalshi_python_async.models.get_event_forecast_percentiles_history_response import GetEventForecastPercentilesHistoryResponse
23
+ from kalshi_python_async.models.get_event_metadata_response import GetEventMetadataResponse
24
+ from kalshi_python_async.models.get_event_response import GetEventResponse
25
+ from kalshi_python_async.models.get_events_response import GetEventsResponse
26
+ from kalshi_python_async.models.get_multivariate_events_response import GetMultivariateEventsResponse
27
+
28
+ from kalshi_python_async.api_client import ApiClient, RequestSerialized
29
+ from kalshi_python_async.api_response import ApiResponse
30
+ from kalshi_python_async.rest import RESTResponseType
31
+
32
+
33
+ class EventsApi:
34
+ """NOTE: This class is auto generated by OpenAPI Generator
35
+ Ref: https://openapi-generator.tech
36
+
37
+ Do not edit the class manually.
38
+ """
39
+
40
+ def __init__(self, api_client=None) -> None:
41
+ if api_client is None:
42
+ api_client = ApiClient.get_default()
43
+ self.api_client = api_client
44
+
45
+
46
+ @validate_call
47
+ async def get_event(
48
+ self,
49
+ event_ticker: StrictStr,
50
+ with_nested_markets: Any = None,
51
+ ) -> GetEventResponse:
52
+ """Get Event
53
+
54
+ Endpoint for getting data about an event by its ticker. An event represents a real-world occurrence that can be traded on, such as an election, sports game, or economic indicator release. Events contain one or more markets where users can place trades on different outcomes.
55
+
56
+ :param event_ticker: Event ticker (required)
57
+ :type event_ticker: str
58
+ :param with_nested_markets: If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response.
59
+ :type with_nested_markets: bool
60
+ :param _request_timeout: timeout setting for this request. If one
61
+ number provided, it will be total request
62
+ timeout. It can also be a pair (tuple) of
63
+ (connection, read) timeouts.
64
+ :type _request_timeout: int, tuple(int, int), optional
65
+ :param _request_auth: set to override the auth_settings for an a single
66
+ request; this effectively ignores the
67
+ authentication in the spec for a single request.
68
+ :type _request_auth: dict, optional
69
+ :param _content_type: force content-type for the request.
70
+ :type _content_type: str, Optional
71
+ :param _headers: set to override the headers for a single
72
+ request; this effectively ignores the headers
73
+ in the spec for a single request.
74
+ :type _headers: dict, optional
75
+ :param _host_index: set to override the host_index for a single
76
+ request; this effectively ignores the host_index
77
+ in the spec for a single request.
78
+ :type _host_index: int, optional
79
+ :return: Returns the result object.
80
+ """ # noqa: E501
81
+
82
+
83
+ _param = self._get_event_serialize(
84
+ event_ticker=event_ticker,
85
+ with_nested_markets=with_nested_markets,
86
+ _request_auth=None,
87
+ _content_type=None,
88
+ _headers=None,
89
+ _host_index=0
90
+ )
91
+
92
+ _response_types_map: Dict[str, Optional[str]] = {
93
+ '200': "GetEventResponse",
94
+ '400': None,
95
+ '404': None,
96
+ '401': None,
97
+ '500': None,
98
+ }
99
+ response_data = await self.api_client.call_api(
100
+ *_param,
101
+ _request_timeout=None,
102
+ )
103
+ await response_data.read()
104
+ return self.api_client.response_deserialize(
105
+ response_data=response_data,
106
+ response_types_map=_response_types_map,
107
+ ).data
108
+
109
+
110
+ @validate_call
111
+ async def get_event_with_http_info(
112
+ self,
113
+ event_ticker: Annotated[StrictStr, Field(description="Event ticker")],
114
+ with_nested_markets: Annotated[Optional[StrictBool], Field(description="If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response.")] = None,
115
+ _request_timeout: Union[
116
+ None,
117
+ Annotated[StrictFloat, Field(gt=0)],
118
+ Tuple[
119
+ Annotated[StrictFloat, Field(gt=0)],
120
+ Annotated[StrictFloat, Field(gt=0)]
121
+ ]
122
+ ] = None,
123
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
124
+ _content_type: Optional[StrictStr] = None,
125
+ _headers: Optional[Dict[StrictStr, Any]] = None,
126
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
127
+ ) -> ApiResponse[GetEventResponse]:
128
+ """Get Event
129
+
130
+ Endpoint for getting data about an event by its ticker. An event represents a real-world occurrence that can be traded on, such as an election, sports game, or economic indicator release. Events contain one or more markets where users can place trades on different outcomes.
131
+
132
+ :param event_ticker: Event ticker (required)
133
+ :type event_ticker: str
134
+ :param with_nested_markets: If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response.
135
+ :type with_nested_markets: bool
136
+ :param _request_timeout: timeout setting for this request. If one
137
+ number provided, it will be total request
138
+ timeout. It can also be a pair (tuple) of
139
+ (connection, read) timeouts.
140
+ :type _request_timeout: int, tuple(int, int), optional
141
+ :param _request_auth: set to override the auth_settings for an a single
142
+ request; this effectively ignores the
143
+ authentication in the spec for a single request.
144
+ :type _request_auth: dict, optional
145
+ :param _content_type: force content-type for the request.
146
+ :type _content_type: str, Optional
147
+ :param _headers: set to override the headers for a single
148
+ request; this effectively ignores the headers
149
+ in the spec for a single request.
150
+ :type _headers: dict, optional
151
+ :param _host_index: set to override the host_index for a single
152
+ request; this effectively ignores the host_index
153
+ in the spec for a single request.
154
+ :type _host_index: int, optional
155
+ :return: Returns the result object.
156
+ """ # noqa: E501
157
+
158
+ _param = self._get_event_serialize(
159
+ event_ticker=event_ticker,
160
+ with_nested_markets=with_nested_markets,
161
+ _request_auth=_request_auth,
162
+ _content_type=_content_type,
163
+ _headers=_headers,
164
+ _host_index=_host_index
165
+ )
166
+
167
+ _response_types_map: Dict[str, Optional[str]] = {
168
+ '200': "GetEventResponse",
169
+ '400': None,
170
+ '404': None,
171
+ '401': None,
172
+ '500': None,
173
+ }
174
+ response_data = await self.api_client.call_api(
175
+ *_param,
176
+ _request_timeout=_request_timeout
177
+ )
178
+ await response_data.read()
179
+ return self.api_client.response_deserialize(
180
+ response_data=response_data,
181
+ response_types_map=_response_types_map,
182
+ )
183
+
184
+
185
+ @validate_call
186
+ async def get_event_without_preload_content(
187
+ self,
188
+ event_ticker: Annotated[StrictStr, Field(description="Event ticker")],
189
+ with_nested_markets: Annotated[Optional[StrictBool], Field(description="If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response.")] = None,
190
+ _request_timeout: Union[
191
+ None,
192
+ Annotated[StrictFloat, Field(gt=0)],
193
+ Tuple[
194
+ Annotated[StrictFloat, Field(gt=0)],
195
+ Annotated[StrictFloat, Field(gt=0)]
196
+ ]
197
+ ] = None,
198
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
199
+ _content_type: Optional[StrictStr] = None,
200
+ _headers: Optional[Dict[StrictStr, Any]] = None,
201
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
202
+ ) -> RESTResponseType:
203
+ """Get Event
204
+
205
+ Endpoint for getting data about an event by its ticker. An event represents a real-world occurrence that can be traded on, such as an election, sports game, or economic indicator release. Events contain one or more markets where users can place trades on different outcomes.
206
+
207
+ :param event_ticker: Event ticker (required)
208
+ :type event_ticker: str
209
+ :param with_nested_markets: If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response.
210
+ :type with_nested_markets: bool
211
+ :param _request_timeout: timeout setting for this request. If one
212
+ number provided, it will be total request
213
+ timeout. It can also be a pair (tuple) of
214
+ (connection, read) timeouts.
215
+ :type _request_timeout: int, tuple(int, int), optional
216
+ :param _request_auth: set to override the auth_settings for an a single
217
+ request; this effectively ignores the
218
+ authentication in the spec for a single request.
219
+ :type _request_auth: dict, optional
220
+ :param _content_type: force content-type for the request.
221
+ :type _content_type: str, Optional
222
+ :param _headers: set to override the headers for a single
223
+ request; this effectively ignores the headers
224
+ in the spec for a single request.
225
+ :type _headers: dict, optional
226
+ :param _host_index: set to override the host_index for a single
227
+ request; this effectively ignores the host_index
228
+ in the spec for a single request.
229
+ :type _host_index: int, optional
230
+ :return: Returns the result object.
231
+ """ # noqa: E501
232
+
233
+ _param = self._get_event_serialize(
234
+ event_ticker=event_ticker,
235
+ with_nested_markets=with_nested_markets,
236
+ _request_auth=_request_auth,
237
+ _content_type=_content_type,
238
+ _headers=_headers,
239
+ _host_index=_host_index
240
+ )
241
+
242
+ _response_types_map: Dict[str, Optional[str]] = {
243
+ '200': "GetEventResponse",
244
+ '400': None,
245
+ '404': None,
246
+ '401': None,
247
+ '500': None,
248
+ }
249
+ response_data = await self.api_client.call_api(
250
+ *_param,
251
+ _request_timeout=_request_timeout
252
+ )
253
+ return response_data.response
254
+
255
+
256
+ def _get_event_serialize(
257
+ self,
258
+ event_ticker,
259
+ with_nested_markets,
260
+ _request_auth,
261
+ _content_type,
262
+ _headers,
263
+ _host_index,
264
+ ) -> RequestSerialized:
265
+
266
+ _host = None
267
+
268
+ _collection_formats: Dict[str, str] = {
269
+ }
270
+
271
+ _path_params: Dict[str, str] = {}
272
+ _query_params: List[Tuple[str, str]] = []
273
+ _header_params: Dict[str, Optional[str]] = _headers or {}
274
+ _form_params: List[Tuple[str, str]] = []
275
+ _files: Dict[
276
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
277
+ ] = {}
278
+ _body_params: Optional[bytes] = None
279
+
280
+ # process the path parameters
281
+ if event_ticker is not None:
282
+ _path_params['event_ticker'] = event_ticker
283
+ # process the query parameters
284
+ if with_nested_markets is not None:
285
+
286
+ _query_params.append(('with_nested_markets', with_nested_markets))
287
+
288
+ # process the header parameters
289
+ # process the form parameters
290
+ # process the body parameter
291
+
292
+
293
+ # set the HTTP header `Accept`
294
+ if 'Accept' not in _header_params:
295
+ _header_params['Accept'] = self.api_client.select_header_accept(
296
+ [
297
+ 'application/json'
298
+ ]
299
+ )
300
+
301
+
302
+ # authentication setting
303
+ _auth_settings: List[str] = [
304
+ ]
305
+
306
+ return self.api_client.param_serialize(
307
+ method='GET',
308
+ resource_path='/events/{event_ticker}',
309
+ path_params=_path_params,
310
+ query_params=_query_params,
311
+ header_params=_header_params,
312
+ body=_body_params,
313
+ post_params=_form_params,
314
+ files=_files,
315
+ auth_settings=_auth_settings,
316
+ collection_formats=_collection_formats,
317
+ _host=_host,
318
+ _request_auth=_request_auth
319
+ )
320
+
321
+
322
+
323
+
324
+ @validate_call
325
+ async def get_event_forecast_percentiles_history(
326
+ self,
327
+ ticker: StrictStr,
328
+ series_ticker: StrictStr,
329
+ percentiles: Any,
330
+ start_ts: Any,
331
+ end_ts: Any,
332
+ period_interval: Any,
333
+ ) -> GetEventForecastPercentilesHistoryResponse:
334
+ """Get Event Forecast Percentile History
335
+
336
+ Endpoint for getting the historical raw and formatted forecast numbers for an event at specific percentiles.
337
+
338
+ :param ticker: The event ticker (required)
339
+ :type ticker: str
340
+ :param series_ticker: The series ticker (required)
341
+ :type series_ticker: str
342
+ :param percentiles: Array of percentile values to retrieve (0-10000, max 10 values) (required)
343
+ :type percentiles: List[int]
344
+ :param start_ts: Start timestamp for the range (required)
345
+ :type start_ts: int
346
+ :param end_ts: End timestamp for the range (required)
347
+ :type end_ts: int
348
+ :param period_interval: Specifies the length of each forecast period, in minutes. 0 for 5-second intervals, or 1, 60, or 1440 for minute-based intervals. (required)
349
+ :type period_interval: int
350
+ :param _request_timeout: timeout setting for this request. If one
351
+ number provided, it will be total request
352
+ timeout. It can also be a pair (tuple) of
353
+ (connection, read) timeouts.
354
+ :type _request_timeout: int, tuple(int, int), optional
355
+ :param _request_auth: set to override the auth_settings for an a single
356
+ request; this effectively ignores the
357
+ authentication in the spec for a single request.
358
+ :type _request_auth: dict, optional
359
+ :param _content_type: force content-type for the request.
360
+ :type _content_type: str, Optional
361
+ :param _headers: set to override the headers for a single
362
+ request; this effectively ignores the headers
363
+ in the spec for a single request.
364
+ :type _headers: dict, optional
365
+ :param _host_index: set to override the host_index for a single
366
+ request; this effectively ignores the host_index
367
+ in the spec for a single request.
368
+ :type _host_index: int, optional
369
+ :return: Returns the result object.
370
+ """ # noqa: E501
371
+
372
+
373
+ _param = self._get_event_forecast_percentiles_history_serialize(
374
+ ticker=ticker,
375
+ series_ticker=series_ticker,
376
+ percentiles=percentiles,
377
+ start_ts=start_ts,
378
+ end_ts=end_ts,
379
+ period_interval=period_interval,
380
+ _request_auth=None,
381
+ _content_type=None,
382
+ _headers=None,
383
+ _host_index=0
384
+ )
385
+
386
+ _response_types_map: Dict[str, Optional[str]] = {
387
+ '200': "GetEventForecastPercentilesHistoryResponse",
388
+ '400': None,
389
+ '401': None,
390
+ '500': None,
391
+ }
392
+ response_data = await self.api_client.call_api(
393
+ *_param,
394
+ _request_timeout=None,
395
+ )
396
+ await response_data.read()
397
+ return self.api_client.response_deserialize(
398
+ response_data=response_data,
399
+ response_types_map=_response_types_map,
400
+ ).data
401
+
402
+
403
+ @validate_call
404
+ async def get_event_forecast_percentiles_history_with_http_info(
405
+ self,
406
+ ticker: Annotated[StrictStr, Field(description="The event ticker")],
407
+ series_ticker: Annotated[StrictStr, Field(description="The series ticker")],
408
+ percentiles: Annotated[List[Annotated[int, Field(le=10000, strict=True, ge=0)]], Field(max_length=10, description="Array of percentile values to retrieve (0-10000, max 10 values)")],
409
+ start_ts: Annotated[StrictInt, Field(description="Start timestamp for the range")],
410
+ end_ts: Annotated[StrictInt, Field(description="End timestamp for the range")],
411
+ period_interval: Annotated[StrictInt, Field(description="Specifies the length of each forecast period, in minutes. 0 for 5-second intervals, or 1, 60, or 1440 for minute-based intervals.")],
412
+ _request_timeout: Union[
413
+ None,
414
+ Annotated[StrictFloat, Field(gt=0)],
415
+ Tuple[
416
+ Annotated[StrictFloat, Field(gt=0)],
417
+ Annotated[StrictFloat, Field(gt=0)]
418
+ ]
419
+ ] = None,
420
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
421
+ _content_type: Optional[StrictStr] = None,
422
+ _headers: Optional[Dict[StrictStr, Any]] = None,
423
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
424
+ ) -> ApiResponse[GetEventForecastPercentilesHistoryResponse]:
425
+ """Get Event Forecast Percentile History
426
+
427
+ Endpoint for getting the historical raw and formatted forecast numbers for an event at specific percentiles.
428
+
429
+ :param ticker: The event ticker (required)
430
+ :type ticker: str
431
+ :param series_ticker: The series ticker (required)
432
+ :type series_ticker: str
433
+ :param percentiles: Array of percentile values to retrieve (0-10000, max 10 values) (required)
434
+ :type percentiles: List[int]
435
+ :param start_ts: Start timestamp for the range (required)
436
+ :type start_ts: int
437
+ :param end_ts: End timestamp for the range (required)
438
+ :type end_ts: int
439
+ :param period_interval: Specifies the length of each forecast period, in minutes. 0 for 5-second intervals, or 1, 60, or 1440 for minute-based intervals. (required)
440
+ :type period_interval: int
441
+ :param _request_timeout: timeout setting for this request. If one
442
+ number provided, it will be total request
443
+ timeout. It can also be a pair (tuple) of
444
+ (connection, read) timeouts.
445
+ :type _request_timeout: int, tuple(int, int), optional
446
+ :param _request_auth: set to override the auth_settings for an a single
447
+ request; this effectively ignores the
448
+ authentication in the spec for a single request.
449
+ :type _request_auth: dict, optional
450
+ :param _content_type: force content-type for the request.
451
+ :type _content_type: str, Optional
452
+ :param _headers: set to override the headers for a single
453
+ request; this effectively ignores the headers
454
+ in the spec for a single request.
455
+ :type _headers: dict, optional
456
+ :param _host_index: set to override the host_index for a single
457
+ request; this effectively ignores the host_index
458
+ in the spec for a single request.
459
+ :type _host_index: int, optional
460
+ :return: Returns the result object.
461
+ """ # noqa: E501
462
+
463
+ _param = self._get_event_forecast_percentiles_history_serialize(
464
+ ticker=ticker,
465
+ series_ticker=series_ticker,
466
+ percentiles=percentiles,
467
+ start_ts=start_ts,
468
+ end_ts=end_ts,
469
+ period_interval=period_interval,
470
+ _request_auth=_request_auth,
471
+ _content_type=_content_type,
472
+ _headers=_headers,
473
+ _host_index=_host_index
474
+ )
475
+
476
+ _response_types_map: Dict[str, Optional[str]] = {
477
+ '200': "GetEventForecastPercentilesHistoryResponse",
478
+ '400': None,
479
+ '401': None,
480
+ '500': None,
481
+ }
482
+ response_data = await self.api_client.call_api(
483
+ *_param,
484
+ _request_timeout=_request_timeout
485
+ )
486
+ await response_data.read()
487
+ return self.api_client.response_deserialize(
488
+ response_data=response_data,
489
+ response_types_map=_response_types_map,
490
+ )
491
+
492
+
493
+ @validate_call
494
+ async def get_event_forecast_percentiles_history_without_preload_content(
495
+ self,
496
+ ticker: Annotated[StrictStr, Field(description="The event ticker")],
497
+ series_ticker: Annotated[StrictStr, Field(description="The series ticker")],
498
+ percentiles: Annotated[List[Annotated[int, Field(le=10000, strict=True, ge=0)]], Field(max_length=10, description="Array of percentile values to retrieve (0-10000, max 10 values)")],
499
+ start_ts: Annotated[StrictInt, Field(description="Start timestamp for the range")],
500
+ end_ts: Annotated[StrictInt, Field(description="End timestamp for the range")],
501
+ period_interval: Annotated[StrictInt, Field(description="Specifies the length of each forecast period, in minutes. 0 for 5-second intervals, or 1, 60, or 1440 for minute-based intervals.")],
502
+ _request_timeout: Union[
503
+ None,
504
+ Annotated[StrictFloat, Field(gt=0)],
505
+ Tuple[
506
+ Annotated[StrictFloat, Field(gt=0)],
507
+ Annotated[StrictFloat, Field(gt=0)]
508
+ ]
509
+ ] = None,
510
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
511
+ _content_type: Optional[StrictStr] = None,
512
+ _headers: Optional[Dict[StrictStr, Any]] = None,
513
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
514
+ ) -> RESTResponseType:
515
+ """Get Event Forecast Percentile History
516
+
517
+ Endpoint for getting the historical raw and formatted forecast numbers for an event at specific percentiles.
518
+
519
+ :param ticker: The event ticker (required)
520
+ :type ticker: str
521
+ :param series_ticker: The series ticker (required)
522
+ :type series_ticker: str
523
+ :param percentiles: Array of percentile values to retrieve (0-10000, max 10 values) (required)
524
+ :type percentiles: List[int]
525
+ :param start_ts: Start timestamp for the range (required)
526
+ :type start_ts: int
527
+ :param end_ts: End timestamp for the range (required)
528
+ :type end_ts: int
529
+ :param period_interval: Specifies the length of each forecast period, in minutes. 0 for 5-second intervals, or 1, 60, or 1440 for minute-based intervals. (required)
530
+ :type period_interval: int
531
+ :param _request_timeout: timeout setting for this request. If one
532
+ number provided, it will be total request
533
+ timeout. It can also be a pair (tuple) of
534
+ (connection, read) timeouts.
535
+ :type _request_timeout: int, tuple(int, int), optional
536
+ :param _request_auth: set to override the auth_settings for an a single
537
+ request; this effectively ignores the
538
+ authentication in the spec for a single request.
539
+ :type _request_auth: dict, optional
540
+ :param _content_type: force content-type for the request.
541
+ :type _content_type: str, Optional
542
+ :param _headers: set to override the headers for a single
543
+ request; this effectively ignores the headers
544
+ in the spec for a single request.
545
+ :type _headers: dict, optional
546
+ :param _host_index: set to override the host_index for a single
547
+ request; this effectively ignores the host_index
548
+ in the spec for a single request.
549
+ :type _host_index: int, optional
550
+ :return: Returns the result object.
551
+ """ # noqa: E501
552
+
553
+ _param = self._get_event_forecast_percentiles_history_serialize(
554
+ ticker=ticker,
555
+ series_ticker=series_ticker,
556
+ percentiles=percentiles,
557
+ start_ts=start_ts,
558
+ end_ts=end_ts,
559
+ period_interval=period_interval,
560
+ _request_auth=_request_auth,
561
+ _content_type=_content_type,
562
+ _headers=_headers,
563
+ _host_index=_host_index
564
+ )
565
+
566
+ _response_types_map: Dict[str, Optional[str]] = {
567
+ '200': "GetEventForecastPercentilesHistoryResponse",
568
+ '400': None,
569
+ '401': None,
570
+ '500': None,
571
+ }
572
+ response_data = await self.api_client.call_api(
573
+ *_param,
574
+ _request_timeout=_request_timeout
575
+ )
576
+ return response_data.response
577
+
578
+
579
+ def _get_event_forecast_percentiles_history_serialize(
580
+ self,
581
+ ticker,
582
+ series_ticker,
583
+ percentiles,
584
+ start_ts,
585
+ end_ts,
586
+ period_interval,
587
+ _request_auth,
588
+ _content_type,
589
+ _headers,
590
+ _host_index,
591
+ ) -> RequestSerialized:
592
+
593
+ _host = None
594
+
595
+ _collection_formats: Dict[str, str] = {
596
+ 'percentiles': 'multi',
597
+ }
598
+
599
+ _path_params: Dict[str, str] = {}
600
+ _query_params: List[Tuple[str, str]] = []
601
+ _header_params: Dict[str, Optional[str]] = _headers or {}
602
+ _form_params: List[Tuple[str, str]] = []
603
+ _files: Dict[
604
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
605
+ ] = {}
606
+ _body_params: Optional[bytes] = None
607
+
608
+ # process the path parameters
609
+ if ticker is not None:
610
+ _path_params['ticker'] = ticker
611
+ if series_ticker is not None:
612
+ _path_params['series_ticker'] = series_ticker
613
+ # process the query parameters
614
+ if percentiles is not None:
615
+
616
+ _query_params.append(('percentiles', percentiles))
617
+
618
+ if start_ts is not None:
619
+
620
+ _query_params.append(('start_ts', start_ts))
621
+
622
+ if end_ts is not None:
623
+
624
+ _query_params.append(('end_ts', end_ts))
625
+
626
+ if period_interval is not None:
627
+
628
+ _query_params.append(('period_interval', period_interval))
629
+
630
+ # process the header parameters
631
+ # process the form parameters
632
+ # process the body parameter
633
+
634
+
635
+ # set the HTTP header `Accept`
636
+ if 'Accept' not in _header_params:
637
+ _header_params['Accept'] = self.api_client.select_header_accept(
638
+ [
639
+ 'application/json'
640
+ ]
641
+ )
642
+
643
+
644
+ # authentication setting
645
+ _auth_settings: List[str] = [
646
+ 'kalshiAccessSignature',
647
+ 'kalshiAccessKey',
648
+ 'kalshiAccessTimestamp'
649
+ ]
650
+
651
+ return self.api_client.param_serialize(
652
+ method='GET',
653
+ resource_path='/series/{series_ticker}/events/{ticker}/forecast_percentile_history',
654
+ path_params=_path_params,
655
+ query_params=_query_params,
656
+ header_params=_header_params,
657
+ body=_body_params,
658
+ post_params=_form_params,
659
+ files=_files,
660
+ auth_settings=_auth_settings,
661
+ collection_formats=_collection_formats,
662
+ _host=_host,
663
+ _request_auth=_request_auth
664
+ )
665
+
666
+
667
+
668
+
669
+ @validate_call
670
+ async def get_event_metadata(
671
+ self,
672
+ event_ticker: StrictStr,
673
+ ) -> GetEventMetadataResponse:
674
+ """Get Event Metadata
675
+
676
+ Endpoint for getting metadata about an event by its ticker. Returns only the metadata information for an event.
677
+
678
+ :param event_ticker: Event ticker (required)
679
+ :type event_ticker: str
680
+ :param _request_timeout: timeout setting for this request. If one
681
+ number provided, it will be total request
682
+ timeout. It can also be a pair (tuple) of
683
+ (connection, read) timeouts.
684
+ :type _request_timeout: int, tuple(int, int), optional
685
+ :param _request_auth: set to override the auth_settings for an a single
686
+ request; this effectively ignores the
687
+ authentication in the spec for a single request.
688
+ :type _request_auth: dict, optional
689
+ :param _content_type: force content-type for the request.
690
+ :type _content_type: str, Optional
691
+ :param _headers: set to override the headers for a single
692
+ request; this effectively ignores the headers
693
+ in the spec for a single request.
694
+ :type _headers: dict, optional
695
+ :param _host_index: set to override the host_index for a single
696
+ request; this effectively ignores the host_index
697
+ in the spec for a single request.
698
+ :type _host_index: int, optional
699
+ :return: Returns the result object.
700
+ """ # noqa: E501
701
+
702
+
703
+ _param = self._get_event_metadata_serialize(
704
+ event_ticker=event_ticker,
705
+ _request_auth=None,
706
+ _content_type=None,
707
+ _headers=None,
708
+ _host_index=0
709
+ )
710
+
711
+ _response_types_map: Dict[str, Optional[str]] = {
712
+ '200': "GetEventMetadataResponse",
713
+ '400': None,
714
+ '404': None,
715
+ '401': None,
716
+ '500': None,
717
+ }
718
+ response_data = await self.api_client.call_api(
719
+ *_param,
720
+ _request_timeout=None,
721
+ )
722
+ await response_data.read()
723
+ return self.api_client.response_deserialize(
724
+ response_data=response_data,
725
+ response_types_map=_response_types_map,
726
+ ).data
727
+
728
+
729
+ @validate_call
730
+ async def get_event_metadata_with_http_info(
731
+ self,
732
+ event_ticker: Annotated[StrictStr, Field(description="Event ticker")],
733
+ _request_timeout: Union[
734
+ None,
735
+ Annotated[StrictFloat, Field(gt=0)],
736
+ Tuple[
737
+ Annotated[StrictFloat, Field(gt=0)],
738
+ Annotated[StrictFloat, Field(gt=0)]
739
+ ]
740
+ ] = None,
741
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
742
+ _content_type: Optional[StrictStr] = None,
743
+ _headers: Optional[Dict[StrictStr, Any]] = None,
744
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
745
+ ) -> ApiResponse[GetEventMetadataResponse]:
746
+ """Get Event Metadata
747
+
748
+ Endpoint for getting metadata about an event by its ticker. Returns only the metadata information for an event.
749
+
750
+ :param event_ticker: Event ticker (required)
751
+ :type event_ticker: str
752
+ :param _request_timeout: timeout setting for this request. If one
753
+ number provided, it will be total request
754
+ timeout. It can also be a pair (tuple) of
755
+ (connection, read) timeouts.
756
+ :type _request_timeout: int, tuple(int, int), optional
757
+ :param _request_auth: set to override the auth_settings for an a single
758
+ request; this effectively ignores the
759
+ authentication in the spec for a single request.
760
+ :type _request_auth: dict, optional
761
+ :param _content_type: force content-type for the request.
762
+ :type _content_type: str, Optional
763
+ :param _headers: set to override the headers for a single
764
+ request; this effectively ignores the headers
765
+ in the spec for a single request.
766
+ :type _headers: dict, optional
767
+ :param _host_index: set to override the host_index for a single
768
+ request; this effectively ignores the host_index
769
+ in the spec for a single request.
770
+ :type _host_index: int, optional
771
+ :return: Returns the result object.
772
+ """ # noqa: E501
773
+
774
+ _param = self._get_event_metadata_serialize(
775
+ event_ticker=event_ticker,
776
+ _request_auth=_request_auth,
777
+ _content_type=_content_type,
778
+ _headers=_headers,
779
+ _host_index=_host_index
780
+ )
781
+
782
+ _response_types_map: Dict[str, Optional[str]] = {
783
+ '200': "GetEventMetadataResponse",
784
+ '400': None,
785
+ '404': None,
786
+ '401': None,
787
+ '500': None,
788
+ }
789
+ response_data = await self.api_client.call_api(
790
+ *_param,
791
+ _request_timeout=_request_timeout
792
+ )
793
+ await response_data.read()
794
+ return self.api_client.response_deserialize(
795
+ response_data=response_data,
796
+ response_types_map=_response_types_map,
797
+ )
798
+
799
+
800
+ @validate_call
801
+ async def get_event_metadata_without_preload_content(
802
+ self,
803
+ event_ticker: Annotated[StrictStr, Field(description="Event ticker")],
804
+ _request_timeout: Union[
805
+ None,
806
+ Annotated[StrictFloat, Field(gt=0)],
807
+ Tuple[
808
+ Annotated[StrictFloat, Field(gt=0)],
809
+ Annotated[StrictFloat, Field(gt=0)]
810
+ ]
811
+ ] = None,
812
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
813
+ _content_type: Optional[StrictStr] = None,
814
+ _headers: Optional[Dict[StrictStr, Any]] = None,
815
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
816
+ ) -> RESTResponseType:
817
+ """Get Event Metadata
818
+
819
+ Endpoint for getting metadata about an event by its ticker. Returns only the metadata information for an event.
820
+
821
+ :param event_ticker: Event ticker (required)
822
+ :type event_ticker: str
823
+ :param _request_timeout: timeout setting for this request. If one
824
+ number provided, it will be total request
825
+ timeout. It can also be a pair (tuple) of
826
+ (connection, read) timeouts.
827
+ :type _request_timeout: int, tuple(int, int), optional
828
+ :param _request_auth: set to override the auth_settings for an a single
829
+ request; this effectively ignores the
830
+ authentication in the spec for a single request.
831
+ :type _request_auth: dict, optional
832
+ :param _content_type: force content-type for the request.
833
+ :type _content_type: str, Optional
834
+ :param _headers: set to override the headers for a single
835
+ request; this effectively ignores the headers
836
+ in the spec for a single request.
837
+ :type _headers: dict, optional
838
+ :param _host_index: set to override the host_index for a single
839
+ request; this effectively ignores the host_index
840
+ in the spec for a single request.
841
+ :type _host_index: int, optional
842
+ :return: Returns the result object.
843
+ """ # noqa: E501
844
+
845
+ _param = self._get_event_metadata_serialize(
846
+ event_ticker=event_ticker,
847
+ _request_auth=_request_auth,
848
+ _content_type=_content_type,
849
+ _headers=_headers,
850
+ _host_index=_host_index
851
+ )
852
+
853
+ _response_types_map: Dict[str, Optional[str]] = {
854
+ '200': "GetEventMetadataResponse",
855
+ '400': None,
856
+ '404': None,
857
+ '401': None,
858
+ '500': None,
859
+ }
860
+ response_data = await self.api_client.call_api(
861
+ *_param,
862
+ _request_timeout=_request_timeout
863
+ )
864
+ return response_data.response
865
+
866
+
867
+ def _get_event_metadata_serialize(
868
+ self,
869
+ event_ticker,
870
+ _request_auth,
871
+ _content_type,
872
+ _headers,
873
+ _host_index,
874
+ ) -> RequestSerialized:
875
+
876
+ _host = None
877
+
878
+ _collection_formats: Dict[str, str] = {
879
+ }
880
+
881
+ _path_params: Dict[str, str] = {}
882
+ _query_params: List[Tuple[str, str]] = []
883
+ _header_params: Dict[str, Optional[str]] = _headers or {}
884
+ _form_params: List[Tuple[str, str]] = []
885
+ _files: Dict[
886
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
887
+ ] = {}
888
+ _body_params: Optional[bytes] = None
889
+
890
+ # process the path parameters
891
+ if event_ticker is not None:
892
+ _path_params['event_ticker'] = event_ticker
893
+ # process the query parameters
894
+ # process the header parameters
895
+ # process the form parameters
896
+ # process the body parameter
897
+
898
+
899
+ # set the HTTP header `Accept`
900
+ if 'Accept' not in _header_params:
901
+ _header_params['Accept'] = self.api_client.select_header_accept(
902
+ [
903
+ 'application/json'
904
+ ]
905
+ )
906
+
907
+
908
+ # authentication setting
909
+ _auth_settings: List[str] = [
910
+ ]
911
+
912
+ return self.api_client.param_serialize(
913
+ method='GET',
914
+ resource_path='/events/{event_ticker}/metadata',
915
+ path_params=_path_params,
916
+ query_params=_query_params,
917
+ header_params=_header_params,
918
+ body=_body_params,
919
+ post_params=_form_params,
920
+ files=_files,
921
+ auth_settings=_auth_settings,
922
+ collection_formats=_collection_formats,
923
+ _host=_host,
924
+ _request_auth=_request_auth
925
+ )
926
+
927
+
928
+
929
+
930
+ @validate_call
931
+ async def get_events(
932
+ self,
933
+ limit: Any = None,
934
+ cursor: Any = None,
935
+ with_nested_markets: Any = None,
936
+ with_milestones: Any = None,
937
+ status: Any = None,
938
+ series_ticker: Any = None,
939
+ min_close_ts: Any = None,
940
+ ) -> GetEventsResponse:
941
+ """Get Events
942
+
943
+ Filter by event status. Possible values: 'open', 'closed', 'settled'. Leave empty to return events with any status.
944
+
945
+ :param limit: Parameter to specify the number of results per page. Defaults to 200. Maximum value is 200.
946
+ :type limit: int
947
+ :param cursor: Parameter to specify the pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
948
+ :type cursor: str
949
+ :param with_nested_markets: Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.
950
+ :type with_nested_markets: bool
951
+ :param with_milestones: If true, includes related milestones as a field alongside events.
952
+ :type with_milestones: bool
953
+ :param status: Filter by event status. Possible values are 'open', 'closed', 'settled'. Leave empty to return events with any status.
954
+ :type status: str
955
+ :param series_ticker: Filter by series ticker
956
+ :type series_ticker: str
957
+ :param min_close_ts: Filter events with at least one market with close timestamp greater than this Unix timestamp (in seconds).
958
+ :type min_close_ts: int
959
+ :param _request_timeout: timeout setting for this request. If one
960
+ number provided, it will be total request
961
+ timeout. It can also be a pair (tuple) of
962
+ (connection, read) timeouts.
963
+ :type _request_timeout: int, tuple(int, int), optional
964
+ :param _request_auth: set to override the auth_settings for an a single
965
+ request; this effectively ignores the
966
+ authentication in the spec for a single request.
967
+ :type _request_auth: dict, optional
968
+ :param _content_type: force content-type for the request.
969
+ :type _content_type: str, Optional
970
+ :param _headers: set to override the headers for a single
971
+ request; this effectively ignores the headers
972
+ in the spec for a single request.
973
+ :type _headers: dict, optional
974
+ :param _host_index: set to override the host_index for a single
975
+ request; this effectively ignores the host_index
976
+ in the spec for a single request.
977
+ :type _host_index: int, optional
978
+ :return: Returns the result object.
979
+ """ # noqa: E501
980
+
981
+
982
+ _param = self._get_events_serialize(
983
+ limit=limit,
984
+ cursor=cursor,
985
+ with_nested_markets=with_nested_markets,
986
+ with_milestones=with_milestones,
987
+ status=status,
988
+ series_ticker=series_ticker,
989
+ min_close_ts=min_close_ts,
990
+ _request_auth=None,
991
+ _content_type=None,
992
+ _headers=None,
993
+ _host_index=0
994
+ )
995
+
996
+ _response_types_map: Dict[str, Optional[str]] = {
997
+ '200': "GetEventsResponse",
998
+ '400': None,
999
+ '401': None,
1000
+ '500': None,
1001
+ }
1002
+ response_data = await self.api_client.call_api(
1003
+ *_param,
1004
+ _request_timeout=None,
1005
+ )
1006
+ await response_data.read()
1007
+ return self.api_client.response_deserialize(
1008
+ response_data=response_data,
1009
+ response_types_map=_response_types_map,
1010
+ ).data
1011
+
1012
+
1013
+ @validate_call
1014
+ async def get_events_with_http_info(
1015
+ self,
1016
+ limit: Annotated[Optional[Annotated[int, Field(le=200, strict=True, ge=1)]], Field(description="Parameter to specify the number of results per page. Defaults to 200. Maximum value is 200.")] = None,
1017
+ cursor: Annotated[Optional[StrictStr], Field(description="Parameter to specify the pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.")] = None,
1018
+ with_nested_markets: Annotated[Optional[StrictBool], Field(description="Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.")] = None,
1019
+ with_milestones: Annotated[Optional[StrictBool], Field(description="If true, includes related milestones as a field alongside events.")] = None,
1020
+ status: Annotated[Optional[StrictStr], Field(description="Filter by event status. Possible values are 'open', 'closed', 'settled'. Leave empty to return events with any status.")] = None,
1021
+ series_ticker: Annotated[Optional[StrictStr], Field(description="Filter by series ticker")] = None,
1022
+ min_close_ts: Annotated[Optional[StrictInt], Field(description="Filter events with at least one market with close timestamp greater than this Unix timestamp (in seconds).")] = None,
1023
+ _request_timeout: Union[
1024
+ None,
1025
+ Annotated[StrictFloat, Field(gt=0)],
1026
+ Tuple[
1027
+ Annotated[StrictFloat, Field(gt=0)],
1028
+ Annotated[StrictFloat, Field(gt=0)]
1029
+ ]
1030
+ ] = None,
1031
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1032
+ _content_type: Optional[StrictStr] = None,
1033
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1034
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1035
+ ) -> ApiResponse[GetEventsResponse]:
1036
+ """Get Events
1037
+
1038
+ Filter by event status. Possible values: 'open', 'closed', 'settled'. Leave empty to return events with any status.
1039
+
1040
+ :param limit: Parameter to specify the number of results per page. Defaults to 200. Maximum value is 200.
1041
+ :type limit: int
1042
+ :param cursor: Parameter to specify the pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
1043
+ :type cursor: str
1044
+ :param with_nested_markets: Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.
1045
+ :type with_nested_markets: bool
1046
+ :param with_milestones: If true, includes related milestones as a field alongside events.
1047
+ :type with_milestones: bool
1048
+ :param status: Filter by event status. Possible values are 'open', 'closed', 'settled'. Leave empty to return events with any status.
1049
+ :type status: str
1050
+ :param series_ticker: Filter by series ticker
1051
+ :type series_ticker: str
1052
+ :param min_close_ts: Filter events with at least one market with close timestamp greater than this Unix timestamp (in seconds).
1053
+ :type min_close_ts: int
1054
+ :param _request_timeout: timeout setting for this request. If one
1055
+ number provided, it will be total request
1056
+ timeout. It can also be a pair (tuple) of
1057
+ (connection, read) timeouts.
1058
+ :type _request_timeout: int, tuple(int, int), optional
1059
+ :param _request_auth: set to override the auth_settings for an a single
1060
+ request; this effectively ignores the
1061
+ authentication in the spec for a single request.
1062
+ :type _request_auth: dict, optional
1063
+ :param _content_type: force content-type for the request.
1064
+ :type _content_type: str, Optional
1065
+ :param _headers: set to override the headers for a single
1066
+ request; this effectively ignores the headers
1067
+ in the spec for a single request.
1068
+ :type _headers: dict, optional
1069
+ :param _host_index: set to override the host_index for a single
1070
+ request; this effectively ignores the host_index
1071
+ in the spec for a single request.
1072
+ :type _host_index: int, optional
1073
+ :return: Returns the result object.
1074
+ """ # noqa: E501
1075
+
1076
+ _param = self._get_events_serialize(
1077
+ limit=limit,
1078
+ cursor=cursor,
1079
+ with_nested_markets=with_nested_markets,
1080
+ with_milestones=with_milestones,
1081
+ status=status,
1082
+ series_ticker=series_ticker,
1083
+ min_close_ts=min_close_ts,
1084
+ _request_auth=_request_auth,
1085
+ _content_type=_content_type,
1086
+ _headers=_headers,
1087
+ _host_index=_host_index
1088
+ )
1089
+
1090
+ _response_types_map: Dict[str, Optional[str]] = {
1091
+ '200': "GetEventsResponse",
1092
+ '400': None,
1093
+ '401': None,
1094
+ '500': None,
1095
+ }
1096
+ response_data = await self.api_client.call_api(
1097
+ *_param,
1098
+ _request_timeout=_request_timeout
1099
+ )
1100
+ await response_data.read()
1101
+ return self.api_client.response_deserialize(
1102
+ response_data=response_data,
1103
+ response_types_map=_response_types_map,
1104
+ )
1105
+
1106
+
1107
+ @validate_call
1108
+ async def get_events_without_preload_content(
1109
+ self,
1110
+ limit: Annotated[Optional[Annotated[int, Field(le=200, strict=True, ge=1)]], Field(description="Parameter to specify the number of results per page. Defaults to 200. Maximum value is 200.")] = None,
1111
+ cursor: Annotated[Optional[StrictStr], Field(description="Parameter to specify the pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.")] = None,
1112
+ with_nested_markets: Annotated[Optional[StrictBool], Field(description="Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.")] = None,
1113
+ with_milestones: Annotated[Optional[StrictBool], Field(description="If true, includes related milestones as a field alongside events.")] = None,
1114
+ status: Annotated[Optional[StrictStr], Field(description="Filter by event status. Possible values are 'open', 'closed', 'settled'. Leave empty to return events with any status.")] = None,
1115
+ series_ticker: Annotated[Optional[StrictStr], Field(description="Filter by series ticker")] = None,
1116
+ min_close_ts: Annotated[Optional[StrictInt], Field(description="Filter events with at least one market with close timestamp greater than this Unix timestamp (in seconds).")] = None,
1117
+ _request_timeout: Union[
1118
+ None,
1119
+ Annotated[StrictFloat, Field(gt=0)],
1120
+ Tuple[
1121
+ Annotated[StrictFloat, Field(gt=0)],
1122
+ Annotated[StrictFloat, Field(gt=0)]
1123
+ ]
1124
+ ] = None,
1125
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1126
+ _content_type: Optional[StrictStr] = None,
1127
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1128
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1129
+ ) -> RESTResponseType:
1130
+ """Get Events
1131
+
1132
+ Filter by event status. Possible values: 'open', 'closed', 'settled'. Leave empty to return events with any status.
1133
+
1134
+ :param limit: Parameter to specify the number of results per page. Defaults to 200. Maximum value is 200.
1135
+ :type limit: int
1136
+ :param cursor: Parameter to specify the pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
1137
+ :type cursor: str
1138
+ :param with_nested_markets: Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.
1139
+ :type with_nested_markets: bool
1140
+ :param with_milestones: If true, includes related milestones as a field alongside events.
1141
+ :type with_milestones: bool
1142
+ :param status: Filter by event status. Possible values are 'open', 'closed', 'settled'. Leave empty to return events with any status.
1143
+ :type status: str
1144
+ :param series_ticker: Filter by series ticker
1145
+ :type series_ticker: str
1146
+ :param min_close_ts: Filter events with at least one market with close timestamp greater than this Unix timestamp (in seconds).
1147
+ :type min_close_ts: int
1148
+ :param _request_timeout: timeout setting for this request. If one
1149
+ number provided, it will be total request
1150
+ timeout. It can also be a pair (tuple) of
1151
+ (connection, read) timeouts.
1152
+ :type _request_timeout: int, tuple(int, int), optional
1153
+ :param _request_auth: set to override the auth_settings for an a single
1154
+ request; this effectively ignores the
1155
+ authentication in the spec for a single request.
1156
+ :type _request_auth: dict, optional
1157
+ :param _content_type: force content-type for the request.
1158
+ :type _content_type: str, Optional
1159
+ :param _headers: set to override the headers for a single
1160
+ request; this effectively ignores the headers
1161
+ in the spec for a single request.
1162
+ :type _headers: dict, optional
1163
+ :param _host_index: set to override the host_index for a single
1164
+ request; this effectively ignores the host_index
1165
+ in the spec for a single request.
1166
+ :type _host_index: int, optional
1167
+ :return: Returns the result object.
1168
+ """ # noqa: E501
1169
+
1170
+ _param = self._get_events_serialize(
1171
+ limit=limit,
1172
+ cursor=cursor,
1173
+ with_nested_markets=with_nested_markets,
1174
+ with_milestones=with_milestones,
1175
+ status=status,
1176
+ series_ticker=series_ticker,
1177
+ min_close_ts=min_close_ts,
1178
+ _request_auth=_request_auth,
1179
+ _content_type=_content_type,
1180
+ _headers=_headers,
1181
+ _host_index=_host_index
1182
+ )
1183
+
1184
+ _response_types_map: Dict[str, Optional[str]] = {
1185
+ '200': "GetEventsResponse",
1186
+ '400': None,
1187
+ '401': None,
1188
+ '500': None,
1189
+ }
1190
+ response_data = await self.api_client.call_api(
1191
+ *_param,
1192
+ _request_timeout=_request_timeout
1193
+ )
1194
+ return response_data.response
1195
+
1196
+
1197
+ def _get_events_serialize(
1198
+ self,
1199
+ limit,
1200
+ cursor,
1201
+ with_nested_markets,
1202
+ with_milestones,
1203
+ status,
1204
+ series_ticker,
1205
+ min_close_ts,
1206
+ _request_auth,
1207
+ _content_type,
1208
+ _headers,
1209
+ _host_index,
1210
+ ) -> RequestSerialized:
1211
+
1212
+ _host = None
1213
+
1214
+ _collection_formats: Dict[str, str] = {
1215
+ }
1216
+
1217
+ _path_params: Dict[str, str] = {}
1218
+ _query_params: List[Tuple[str, str]] = []
1219
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1220
+ _form_params: List[Tuple[str, str]] = []
1221
+ _files: Dict[
1222
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1223
+ ] = {}
1224
+ _body_params: Optional[bytes] = None
1225
+
1226
+ # process the path parameters
1227
+ # process the query parameters
1228
+ if limit is not None:
1229
+
1230
+ _query_params.append(('limit', limit))
1231
+
1232
+ if cursor is not None:
1233
+
1234
+ _query_params.append(('cursor', cursor))
1235
+
1236
+ if with_nested_markets is not None:
1237
+
1238
+ _query_params.append(('with_nested_markets', with_nested_markets))
1239
+
1240
+ if with_milestones is not None:
1241
+
1242
+ _query_params.append(('with_milestones', with_milestones))
1243
+
1244
+ if status is not None:
1245
+
1246
+ _query_params.append(('status', status))
1247
+
1248
+ if series_ticker is not None:
1249
+
1250
+ _query_params.append(('series_ticker', series_ticker))
1251
+
1252
+ if min_close_ts is not None:
1253
+
1254
+ _query_params.append(('min_close_ts', min_close_ts))
1255
+
1256
+ # process the header parameters
1257
+ # process the form parameters
1258
+ # process the body parameter
1259
+
1260
+
1261
+ # set the HTTP header `Accept`
1262
+ if 'Accept' not in _header_params:
1263
+ _header_params['Accept'] = self.api_client.select_header_accept(
1264
+ [
1265
+ 'application/json'
1266
+ ]
1267
+ )
1268
+
1269
+
1270
+ # authentication setting
1271
+ _auth_settings: List[str] = [
1272
+ ]
1273
+
1274
+ return self.api_client.param_serialize(
1275
+ method='GET',
1276
+ resource_path='/events',
1277
+ path_params=_path_params,
1278
+ query_params=_query_params,
1279
+ header_params=_header_params,
1280
+ body=_body_params,
1281
+ post_params=_form_params,
1282
+ files=_files,
1283
+ auth_settings=_auth_settings,
1284
+ collection_formats=_collection_formats,
1285
+ _host=_host,
1286
+ _request_auth=_request_auth
1287
+ )
1288
+
1289
+
1290
+
1291
+
1292
+ @validate_call
1293
+ async def get_market_candlesticks_by_event(
1294
+ self,
1295
+ ticker: StrictStr,
1296
+ series_ticker: StrictStr,
1297
+ start_ts: Any,
1298
+ end_ts: Any,
1299
+ period_interval: Any,
1300
+ ) -> GetEventCandlesticksResponse:
1301
+ """Get Event Candlesticks
1302
+
1303
+ End-point for returning aggregated data across all markets corresponding to an event.
1304
+
1305
+ :param ticker: The event ticker (required)
1306
+ :type ticker: str
1307
+ :param series_ticker: The series ticker (required)
1308
+ :type series_ticker: str
1309
+ :param start_ts: Start timestamp for the range (required)
1310
+ :type start_ts: int
1311
+ :param end_ts: End timestamp for the range (required)
1312
+ :type end_ts: int
1313
+ :param period_interval: Specifies the length of each candlestick period, in minutes. Must be one minute, one hour, or one day. (required)
1314
+ :type period_interval: int
1315
+ :param _request_timeout: timeout setting for this request. If one
1316
+ number provided, it will be total request
1317
+ timeout. It can also be a pair (tuple) of
1318
+ (connection, read) timeouts.
1319
+ :type _request_timeout: int, tuple(int, int), optional
1320
+ :param _request_auth: set to override the auth_settings for an a single
1321
+ request; this effectively ignores the
1322
+ authentication in the spec for a single request.
1323
+ :type _request_auth: dict, optional
1324
+ :param _content_type: force content-type for the request.
1325
+ :type _content_type: str, Optional
1326
+ :param _headers: set to override the headers for a single
1327
+ request; this effectively ignores the headers
1328
+ in the spec for a single request.
1329
+ :type _headers: dict, optional
1330
+ :param _host_index: set to override the host_index for a single
1331
+ request; this effectively ignores the host_index
1332
+ in the spec for a single request.
1333
+ :type _host_index: int, optional
1334
+ :return: Returns the result object.
1335
+ """ # noqa: E501
1336
+
1337
+
1338
+ _param = self._get_market_candlesticks_by_event_serialize(
1339
+ ticker=ticker,
1340
+ series_ticker=series_ticker,
1341
+ start_ts=start_ts,
1342
+ end_ts=end_ts,
1343
+ period_interval=period_interval,
1344
+ _request_auth=None,
1345
+ _content_type=None,
1346
+ _headers=None,
1347
+ _host_index=0
1348
+ )
1349
+
1350
+ _response_types_map: Dict[str, Optional[str]] = {
1351
+ '200': "GetEventCandlesticksResponse",
1352
+ '400': None,
1353
+ '401': None,
1354
+ '500': None,
1355
+ }
1356
+ response_data = await self.api_client.call_api(
1357
+ *_param,
1358
+ _request_timeout=None,
1359
+ )
1360
+ await response_data.read()
1361
+ return self.api_client.response_deserialize(
1362
+ response_data=response_data,
1363
+ response_types_map=_response_types_map,
1364
+ ).data
1365
+
1366
+
1367
+ @validate_call
1368
+ async def get_market_candlesticks_by_event_with_http_info(
1369
+ self,
1370
+ ticker: Annotated[StrictStr, Field(description="The event ticker")],
1371
+ series_ticker: Annotated[StrictStr, Field(description="The series ticker")],
1372
+ start_ts: Annotated[StrictInt, Field(description="Start timestamp for the range")],
1373
+ end_ts: Annotated[StrictInt, Field(description="End timestamp for the range")],
1374
+ period_interval: Annotated[StrictInt, Field(description="Specifies the length of each candlestick period, in minutes. Must be one minute, one hour, or one day.")],
1375
+ _request_timeout: Union[
1376
+ None,
1377
+ Annotated[StrictFloat, Field(gt=0)],
1378
+ Tuple[
1379
+ Annotated[StrictFloat, Field(gt=0)],
1380
+ Annotated[StrictFloat, Field(gt=0)]
1381
+ ]
1382
+ ] = None,
1383
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1384
+ _content_type: Optional[StrictStr] = None,
1385
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1386
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1387
+ ) -> ApiResponse[GetEventCandlesticksResponse]:
1388
+ """Get Event Candlesticks
1389
+
1390
+ End-point for returning aggregated data across all markets corresponding to an event.
1391
+
1392
+ :param ticker: The event ticker (required)
1393
+ :type ticker: str
1394
+ :param series_ticker: The series ticker (required)
1395
+ :type series_ticker: str
1396
+ :param start_ts: Start timestamp for the range (required)
1397
+ :type start_ts: int
1398
+ :param end_ts: End timestamp for the range (required)
1399
+ :type end_ts: int
1400
+ :param period_interval: Specifies the length of each candlestick period, in minutes. Must be one minute, one hour, or one day. (required)
1401
+ :type period_interval: int
1402
+ :param _request_timeout: timeout setting for this request. If one
1403
+ number provided, it will be total request
1404
+ timeout. It can also be a pair (tuple) of
1405
+ (connection, read) timeouts.
1406
+ :type _request_timeout: int, tuple(int, int), optional
1407
+ :param _request_auth: set to override the auth_settings for an a single
1408
+ request; this effectively ignores the
1409
+ authentication in the spec for a single request.
1410
+ :type _request_auth: dict, optional
1411
+ :param _content_type: force content-type for the request.
1412
+ :type _content_type: str, Optional
1413
+ :param _headers: set to override the headers for a single
1414
+ request; this effectively ignores the headers
1415
+ in the spec for a single request.
1416
+ :type _headers: dict, optional
1417
+ :param _host_index: set to override the host_index for a single
1418
+ request; this effectively ignores the host_index
1419
+ in the spec for a single request.
1420
+ :type _host_index: int, optional
1421
+ :return: Returns the result object.
1422
+ """ # noqa: E501
1423
+
1424
+ _param = self._get_market_candlesticks_by_event_serialize(
1425
+ ticker=ticker,
1426
+ series_ticker=series_ticker,
1427
+ start_ts=start_ts,
1428
+ end_ts=end_ts,
1429
+ period_interval=period_interval,
1430
+ _request_auth=_request_auth,
1431
+ _content_type=_content_type,
1432
+ _headers=_headers,
1433
+ _host_index=_host_index
1434
+ )
1435
+
1436
+ _response_types_map: Dict[str, Optional[str]] = {
1437
+ '200': "GetEventCandlesticksResponse",
1438
+ '400': None,
1439
+ '401': None,
1440
+ '500': None,
1441
+ }
1442
+ response_data = await self.api_client.call_api(
1443
+ *_param,
1444
+ _request_timeout=_request_timeout
1445
+ )
1446
+ await response_data.read()
1447
+ return self.api_client.response_deserialize(
1448
+ response_data=response_data,
1449
+ response_types_map=_response_types_map,
1450
+ )
1451
+
1452
+
1453
+ @validate_call
1454
+ async def get_market_candlesticks_by_event_without_preload_content(
1455
+ self,
1456
+ ticker: Annotated[StrictStr, Field(description="The event ticker")],
1457
+ series_ticker: Annotated[StrictStr, Field(description="The series ticker")],
1458
+ start_ts: Annotated[StrictInt, Field(description="Start timestamp for the range")],
1459
+ end_ts: Annotated[StrictInt, Field(description="End timestamp for the range")],
1460
+ period_interval: Annotated[StrictInt, Field(description="Specifies the length of each candlestick period, in minutes. Must be one minute, one hour, or one day.")],
1461
+ _request_timeout: Union[
1462
+ None,
1463
+ Annotated[StrictFloat, Field(gt=0)],
1464
+ Tuple[
1465
+ Annotated[StrictFloat, Field(gt=0)],
1466
+ Annotated[StrictFloat, Field(gt=0)]
1467
+ ]
1468
+ ] = None,
1469
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1470
+ _content_type: Optional[StrictStr] = None,
1471
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1472
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1473
+ ) -> RESTResponseType:
1474
+ """Get Event Candlesticks
1475
+
1476
+ End-point for returning aggregated data across all markets corresponding to an event.
1477
+
1478
+ :param ticker: The event ticker (required)
1479
+ :type ticker: str
1480
+ :param series_ticker: The series ticker (required)
1481
+ :type series_ticker: str
1482
+ :param start_ts: Start timestamp for the range (required)
1483
+ :type start_ts: int
1484
+ :param end_ts: End timestamp for the range (required)
1485
+ :type end_ts: int
1486
+ :param period_interval: Specifies the length of each candlestick period, in minutes. Must be one minute, one hour, or one day. (required)
1487
+ :type period_interval: int
1488
+ :param _request_timeout: timeout setting for this request. If one
1489
+ number provided, it will be total request
1490
+ timeout. It can also be a pair (tuple) of
1491
+ (connection, read) timeouts.
1492
+ :type _request_timeout: int, tuple(int, int), optional
1493
+ :param _request_auth: set to override the auth_settings for an a single
1494
+ request; this effectively ignores the
1495
+ authentication in the spec for a single request.
1496
+ :type _request_auth: dict, optional
1497
+ :param _content_type: force content-type for the request.
1498
+ :type _content_type: str, Optional
1499
+ :param _headers: set to override the headers for a single
1500
+ request; this effectively ignores the headers
1501
+ in the spec for a single request.
1502
+ :type _headers: dict, optional
1503
+ :param _host_index: set to override the host_index for a single
1504
+ request; this effectively ignores the host_index
1505
+ in the spec for a single request.
1506
+ :type _host_index: int, optional
1507
+ :return: Returns the result object.
1508
+ """ # noqa: E501
1509
+
1510
+ _param = self._get_market_candlesticks_by_event_serialize(
1511
+ ticker=ticker,
1512
+ series_ticker=series_ticker,
1513
+ start_ts=start_ts,
1514
+ end_ts=end_ts,
1515
+ period_interval=period_interval,
1516
+ _request_auth=_request_auth,
1517
+ _content_type=_content_type,
1518
+ _headers=_headers,
1519
+ _host_index=_host_index
1520
+ )
1521
+
1522
+ _response_types_map: Dict[str, Optional[str]] = {
1523
+ '200': "GetEventCandlesticksResponse",
1524
+ '400': None,
1525
+ '401': None,
1526
+ '500': None,
1527
+ }
1528
+ response_data = await self.api_client.call_api(
1529
+ *_param,
1530
+ _request_timeout=_request_timeout
1531
+ )
1532
+ return response_data.response
1533
+
1534
+
1535
+ def _get_market_candlesticks_by_event_serialize(
1536
+ self,
1537
+ ticker,
1538
+ series_ticker,
1539
+ start_ts,
1540
+ end_ts,
1541
+ period_interval,
1542
+ _request_auth,
1543
+ _content_type,
1544
+ _headers,
1545
+ _host_index,
1546
+ ) -> RequestSerialized:
1547
+
1548
+ _host = None
1549
+
1550
+ _collection_formats: Dict[str, str] = {
1551
+ }
1552
+
1553
+ _path_params: Dict[str, str] = {}
1554
+ _query_params: List[Tuple[str, str]] = []
1555
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1556
+ _form_params: List[Tuple[str, str]] = []
1557
+ _files: Dict[
1558
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1559
+ ] = {}
1560
+ _body_params: Optional[bytes] = None
1561
+
1562
+ # process the path parameters
1563
+ if ticker is not None:
1564
+ _path_params['ticker'] = ticker
1565
+ if series_ticker is not None:
1566
+ _path_params['series_ticker'] = series_ticker
1567
+ # process the query parameters
1568
+ if start_ts is not None:
1569
+
1570
+ _query_params.append(('start_ts', start_ts))
1571
+
1572
+ if end_ts is not None:
1573
+
1574
+ _query_params.append(('end_ts', end_ts))
1575
+
1576
+ if period_interval is not None:
1577
+
1578
+ _query_params.append(('period_interval', period_interval))
1579
+
1580
+ # process the header parameters
1581
+ # process the form parameters
1582
+ # process the body parameter
1583
+
1584
+
1585
+ # set the HTTP header `Accept`
1586
+ if 'Accept' not in _header_params:
1587
+ _header_params['Accept'] = self.api_client.select_header_accept(
1588
+ [
1589
+ 'application/json'
1590
+ ]
1591
+ )
1592
+
1593
+
1594
+ # authentication setting
1595
+ _auth_settings: List[str] = [
1596
+ ]
1597
+
1598
+ return self.api_client.param_serialize(
1599
+ method='GET',
1600
+ resource_path='/series/{series_ticker}/events/{ticker}/candlesticks',
1601
+ path_params=_path_params,
1602
+ query_params=_query_params,
1603
+ header_params=_header_params,
1604
+ body=_body_params,
1605
+ post_params=_form_params,
1606
+ files=_files,
1607
+ auth_settings=_auth_settings,
1608
+ collection_formats=_collection_formats,
1609
+ _host=_host,
1610
+ _request_auth=_request_auth
1611
+ )
1612
+
1613
+
1614
+
1615
+
1616
+ @validate_call
1617
+ async def get_multivariate_events(
1618
+ self,
1619
+ limit: Any = None,
1620
+ cursor: Any = None,
1621
+ series_ticker: Any = None,
1622
+ collection_ticker: Any = None,
1623
+ with_nested_markets: Any = None,
1624
+ ) -> GetMultivariateEventsResponse:
1625
+ """Get Multivariate Events
1626
+
1627
+ Retrieve multivariate (combo) events. These are dynamically created events from multivariate event collections. Supports filtering by series and collection ticker.
1628
+
1629
+ :param limit: Number of results per page. Defaults to 100. Maximum value is 200.
1630
+ :type limit: int
1631
+ :param cursor: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results.
1632
+ :type cursor: str
1633
+ :param series_ticker: Filter by series ticker
1634
+ :type series_ticker: str
1635
+ :param collection_ticker: Filter events by collection ticker. Returns only multivariate events belonging to the specified collection. Cannot be used together with series_ticker.
1636
+ :type collection_ticker: str
1637
+ :param with_nested_markets: Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.
1638
+ :type with_nested_markets: bool
1639
+ :param _request_timeout: timeout setting for this request. If one
1640
+ number provided, it will be total request
1641
+ timeout. It can also be a pair (tuple) of
1642
+ (connection, read) timeouts.
1643
+ :type _request_timeout: int, tuple(int, int), optional
1644
+ :param _request_auth: set to override the auth_settings for an a single
1645
+ request; this effectively ignores the
1646
+ authentication in the spec for a single request.
1647
+ :type _request_auth: dict, optional
1648
+ :param _content_type: force content-type for the request.
1649
+ :type _content_type: str, Optional
1650
+ :param _headers: set to override the headers for a single
1651
+ request; this effectively ignores the headers
1652
+ in the spec for a single request.
1653
+ :type _headers: dict, optional
1654
+ :param _host_index: set to override the host_index for a single
1655
+ request; this effectively ignores the host_index
1656
+ in the spec for a single request.
1657
+ :type _host_index: int, optional
1658
+ :return: Returns the result object.
1659
+ """ # noqa: E501
1660
+
1661
+
1662
+ _param = self._get_multivariate_events_serialize(
1663
+ limit=limit,
1664
+ cursor=cursor,
1665
+ series_ticker=series_ticker,
1666
+ collection_ticker=collection_ticker,
1667
+ with_nested_markets=with_nested_markets,
1668
+ _request_auth=None,
1669
+ _content_type=None,
1670
+ _headers=None,
1671
+ _host_index=0
1672
+ )
1673
+
1674
+ _response_types_map: Dict[str, Optional[str]] = {
1675
+ '200': "GetMultivariateEventsResponse",
1676
+ '400': None,
1677
+ '401': None,
1678
+ '500': None,
1679
+ }
1680
+ response_data = await self.api_client.call_api(
1681
+ *_param,
1682
+ _request_timeout=None,
1683
+ )
1684
+ await response_data.read()
1685
+ return self.api_client.response_deserialize(
1686
+ response_data=response_data,
1687
+ response_types_map=_response_types_map,
1688
+ ).data
1689
+
1690
+
1691
+ @validate_call
1692
+ async def get_multivariate_events_with_http_info(
1693
+ self,
1694
+ limit: Annotated[Optional[Annotated[int, Field(le=200, strict=True, ge=1)]], Field(description="Number of results per page. Defaults to 100. Maximum value is 200.")] = None,
1695
+ cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor. Use the cursor value returned from the previous response to get the next page of results.")] = None,
1696
+ series_ticker: Annotated[Optional[StrictStr], Field(description="Filter by series ticker")] = None,
1697
+ collection_ticker: Annotated[Optional[StrictStr], Field(description="Filter events by collection ticker. Returns only multivariate events belonging to the specified collection. Cannot be used together with series_ticker.")] = None,
1698
+ with_nested_markets: Annotated[Optional[StrictBool], Field(description="Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.")] = None,
1699
+ _request_timeout: Union[
1700
+ None,
1701
+ Annotated[StrictFloat, Field(gt=0)],
1702
+ Tuple[
1703
+ Annotated[StrictFloat, Field(gt=0)],
1704
+ Annotated[StrictFloat, Field(gt=0)]
1705
+ ]
1706
+ ] = None,
1707
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1708
+ _content_type: Optional[StrictStr] = None,
1709
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1710
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1711
+ ) -> ApiResponse[GetMultivariateEventsResponse]:
1712
+ """Get Multivariate Events
1713
+
1714
+ Retrieve multivariate (combo) events. These are dynamically created events from multivariate event collections. Supports filtering by series and collection ticker.
1715
+
1716
+ :param limit: Number of results per page. Defaults to 100. Maximum value is 200.
1717
+ :type limit: int
1718
+ :param cursor: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results.
1719
+ :type cursor: str
1720
+ :param series_ticker: Filter by series ticker
1721
+ :type series_ticker: str
1722
+ :param collection_ticker: Filter events by collection ticker. Returns only multivariate events belonging to the specified collection. Cannot be used together with series_ticker.
1723
+ :type collection_ticker: str
1724
+ :param with_nested_markets: Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.
1725
+ :type with_nested_markets: bool
1726
+ :param _request_timeout: timeout setting for this request. If one
1727
+ number provided, it will be total request
1728
+ timeout. It can also be a pair (tuple) of
1729
+ (connection, read) timeouts.
1730
+ :type _request_timeout: int, tuple(int, int), optional
1731
+ :param _request_auth: set to override the auth_settings for an a single
1732
+ request; this effectively ignores the
1733
+ authentication in the spec for a single request.
1734
+ :type _request_auth: dict, optional
1735
+ :param _content_type: force content-type for the request.
1736
+ :type _content_type: str, Optional
1737
+ :param _headers: set to override the headers for a single
1738
+ request; this effectively ignores the headers
1739
+ in the spec for a single request.
1740
+ :type _headers: dict, optional
1741
+ :param _host_index: set to override the host_index for a single
1742
+ request; this effectively ignores the host_index
1743
+ in the spec for a single request.
1744
+ :type _host_index: int, optional
1745
+ :return: Returns the result object.
1746
+ """ # noqa: E501
1747
+
1748
+ _param = self._get_multivariate_events_serialize(
1749
+ limit=limit,
1750
+ cursor=cursor,
1751
+ series_ticker=series_ticker,
1752
+ collection_ticker=collection_ticker,
1753
+ with_nested_markets=with_nested_markets,
1754
+ _request_auth=_request_auth,
1755
+ _content_type=_content_type,
1756
+ _headers=_headers,
1757
+ _host_index=_host_index
1758
+ )
1759
+
1760
+ _response_types_map: Dict[str, Optional[str]] = {
1761
+ '200': "GetMultivariateEventsResponse",
1762
+ '400': None,
1763
+ '401': None,
1764
+ '500': None,
1765
+ }
1766
+ response_data = await self.api_client.call_api(
1767
+ *_param,
1768
+ _request_timeout=_request_timeout
1769
+ )
1770
+ await response_data.read()
1771
+ return self.api_client.response_deserialize(
1772
+ response_data=response_data,
1773
+ response_types_map=_response_types_map,
1774
+ )
1775
+
1776
+
1777
+ @validate_call
1778
+ async def get_multivariate_events_without_preload_content(
1779
+ self,
1780
+ limit: Annotated[Optional[Annotated[int, Field(le=200, strict=True, ge=1)]], Field(description="Number of results per page. Defaults to 100. Maximum value is 200.")] = None,
1781
+ cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor. Use the cursor value returned from the previous response to get the next page of results.")] = None,
1782
+ series_ticker: Annotated[Optional[StrictStr], Field(description="Filter by series ticker")] = None,
1783
+ collection_ticker: Annotated[Optional[StrictStr], Field(description="Filter events by collection ticker. Returns only multivariate events belonging to the specified collection. Cannot be used together with series_ticker.")] = None,
1784
+ with_nested_markets: Annotated[Optional[StrictBool], Field(description="Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.")] = None,
1785
+ _request_timeout: Union[
1786
+ None,
1787
+ Annotated[StrictFloat, Field(gt=0)],
1788
+ Tuple[
1789
+ Annotated[StrictFloat, Field(gt=0)],
1790
+ Annotated[StrictFloat, Field(gt=0)]
1791
+ ]
1792
+ ] = None,
1793
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1794
+ _content_type: Optional[StrictStr] = None,
1795
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1796
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1797
+ ) -> RESTResponseType:
1798
+ """Get Multivariate Events
1799
+
1800
+ Retrieve multivariate (combo) events. These are dynamically created events from multivariate event collections. Supports filtering by series and collection ticker.
1801
+
1802
+ :param limit: Number of results per page. Defaults to 100. Maximum value is 200.
1803
+ :type limit: int
1804
+ :param cursor: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results.
1805
+ :type cursor: str
1806
+ :param series_ticker: Filter by series ticker
1807
+ :type series_ticker: str
1808
+ :param collection_ticker: Filter events by collection ticker. Returns only multivariate events belonging to the specified collection. Cannot be used together with series_ticker.
1809
+ :type collection_ticker: str
1810
+ :param with_nested_markets: Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.
1811
+ :type with_nested_markets: bool
1812
+ :param _request_timeout: timeout setting for this request. If one
1813
+ number provided, it will be total request
1814
+ timeout. It can also be a pair (tuple) of
1815
+ (connection, read) timeouts.
1816
+ :type _request_timeout: int, tuple(int, int), optional
1817
+ :param _request_auth: set to override the auth_settings for an a single
1818
+ request; this effectively ignores the
1819
+ authentication in the spec for a single request.
1820
+ :type _request_auth: dict, optional
1821
+ :param _content_type: force content-type for the request.
1822
+ :type _content_type: str, Optional
1823
+ :param _headers: set to override the headers for a single
1824
+ request; this effectively ignores the headers
1825
+ in the spec for a single request.
1826
+ :type _headers: dict, optional
1827
+ :param _host_index: set to override the host_index for a single
1828
+ request; this effectively ignores the host_index
1829
+ in the spec for a single request.
1830
+ :type _host_index: int, optional
1831
+ :return: Returns the result object.
1832
+ """ # noqa: E501
1833
+
1834
+ _param = self._get_multivariate_events_serialize(
1835
+ limit=limit,
1836
+ cursor=cursor,
1837
+ series_ticker=series_ticker,
1838
+ collection_ticker=collection_ticker,
1839
+ with_nested_markets=with_nested_markets,
1840
+ _request_auth=_request_auth,
1841
+ _content_type=_content_type,
1842
+ _headers=_headers,
1843
+ _host_index=_host_index
1844
+ )
1845
+
1846
+ _response_types_map: Dict[str, Optional[str]] = {
1847
+ '200': "GetMultivariateEventsResponse",
1848
+ '400': None,
1849
+ '401': None,
1850
+ '500': None,
1851
+ }
1852
+ response_data = await self.api_client.call_api(
1853
+ *_param,
1854
+ _request_timeout=_request_timeout
1855
+ )
1856
+ return response_data.response
1857
+
1858
+
1859
+ def _get_multivariate_events_serialize(
1860
+ self,
1861
+ limit,
1862
+ cursor,
1863
+ series_ticker,
1864
+ collection_ticker,
1865
+ with_nested_markets,
1866
+ _request_auth,
1867
+ _content_type,
1868
+ _headers,
1869
+ _host_index,
1870
+ ) -> RequestSerialized:
1871
+
1872
+ _host = None
1873
+
1874
+ _collection_formats: Dict[str, str] = {
1875
+ }
1876
+
1877
+ _path_params: Dict[str, str] = {}
1878
+ _query_params: List[Tuple[str, str]] = []
1879
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1880
+ _form_params: List[Tuple[str, str]] = []
1881
+ _files: Dict[
1882
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1883
+ ] = {}
1884
+ _body_params: Optional[bytes] = None
1885
+
1886
+ # process the path parameters
1887
+ # process the query parameters
1888
+ if limit is not None:
1889
+
1890
+ _query_params.append(('limit', limit))
1891
+
1892
+ if cursor is not None:
1893
+
1894
+ _query_params.append(('cursor', cursor))
1895
+
1896
+ if series_ticker is not None:
1897
+
1898
+ _query_params.append(('series_ticker', series_ticker))
1899
+
1900
+ if collection_ticker is not None:
1901
+
1902
+ _query_params.append(('collection_ticker', collection_ticker))
1903
+
1904
+ if with_nested_markets is not None:
1905
+
1906
+ _query_params.append(('with_nested_markets', with_nested_markets))
1907
+
1908
+ # process the header parameters
1909
+ # process the form parameters
1910
+ # process the body parameter
1911
+
1912
+
1913
+ # set the HTTP header `Accept`
1914
+ if 'Accept' not in _header_params:
1915
+ _header_params['Accept'] = self.api_client.select_header_accept(
1916
+ [
1917
+ 'application/json'
1918
+ ]
1919
+ )
1920
+
1921
+
1922
+ # authentication setting
1923
+ _auth_settings: List[str] = [
1924
+ ]
1925
+
1926
+ return self.api_client.param_serialize(
1927
+ method='GET',
1928
+ resource_path='/events/multivariate',
1929
+ path_params=_path_params,
1930
+ query_params=_query_params,
1931
+ header_params=_header_params,
1932
+ body=_body_params,
1933
+ post_params=_form_params,
1934
+ files=_files,
1935
+ auth_settings=_auth_settings,
1936
+ collection_formats=_collection_formats,
1937
+ _host=_host,
1938
+ _request_auth=_request_auth
1939
+ )
1940
+
1941
+