pmxt 1.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 (56) hide show
  1. pmxt/__init__.py +58 -0
  2. pmxt/client.py +713 -0
  3. pmxt/models.py +296 -0
  4. pmxt/server_manager.py +242 -0
  5. pmxt-1.0.0.dist-info/METADATA +250 -0
  6. pmxt-1.0.0.dist-info/RECORD +56 -0
  7. pmxt-1.0.0.dist-info/WHEEL +5 -0
  8. pmxt-1.0.0.dist-info/top_level.txt +2 -0
  9. pmxt_internal/__init__.py +124 -0
  10. pmxt_internal/api/__init__.py +5 -0
  11. pmxt_internal/api/default_api.py +3722 -0
  12. pmxt_internal/api_client.py +804 -0
  13. pmxt_internal/api_response.py +21 -0
  14. pmxt_internal/configuration.py +578 -0
  15. pmxt_internal/exceptions.py +219 -0
  16. pmxt_internal/models/__init__.py +54 -0
  17. pmxt_internal/models/balance.py +93 -0
  18. pmxt_internal/models/base_request.py +91 -0
  19. pmxt_internal/models/base_response.py +93 -0
  20. pmxt_internal/models/cancel_order_request.py +94 -0
  21. pmxt_internal/models/create_order200_response.py +99 -0
  22. pmxt_internal/models/create_order_params.py +111 -0
  23. pmxt_internal/models/create_order_request.py +102 -0
  24. pmxt_internal/models/error_detail.py +87 -0
  25. pmxt_internal/models/error_response.py +93 -0
  26. pmxt_internal/models/exchange_credentials.py +93 -0
  27. pmxt_internal/models/fetch_balance200_response.py +103 -0
  28. pmxt_internal/models/fetch_markets200_response.py +103 -0
  29. pmxt_internal/models/fetch_markets_request.py +102 -0
  30. pmxt_internal/models/fetch_ohlcv200_response.py +103 -0
  31. pmxt_internal/models/fetch_ohlcv_request.py +102 -0
  32. pmxt_internal/models/fetch_ohlcv_request_args_inner.py +140 -0
  33. pmxt_internal/models/fetch_open_orders200_response.py +103 -0
  34. pmxt_internal/models/fetch_open_orders_request.py +94 -0
  35. pmxt_internal/models/fetch_order_book200_response.py +99 -0
  36. pmxt_internal/models/fetch_order_book_request.py +94 -0
  37. pmxt_internal/models/fetch_positions200_response.py +103 -0
  38. pmxt_internal/models/fetch_positions_request.py +94 -0
  39. pmxt_internal/models/fetch_trades200_response.py +103 -0
  40. pmxt_internal/models/fetch_trades_request.py +102 -0
  41. pmxt_internal/models/get_markets_by_slug_request.py +94 -0
  42. pmxt_internal/models/health_check200_response.py +89 -0
  43. pmxt_internal/models/history_filter_params.py +101 -0
  44. pmxt_internal/models/market_filter_params.py +113 -0
  45. pmxt_internal/models/market_outcome.py +95 -0
  46. pmxt_internal/models/order.py +139 -0
  47. pmxt_internal/models/order_book.py +106 -0
  48. pmxt_internal/models/order_level.py +89 -0
  49. pmxt_internal/models/position.py +101 -0
  50. pmxt_internal/models/price_candle.py +97 -0
  51. pmxt_internal/models/search_markets_request.py +102 -0
  52. pmxt_internal/models/search_markets_request_args_inner.py +140 -0
  53. pmxt_internal/models/trade.py +105 -0
  54. pmxt_internal/models/unified_market.py +120 -0
  55. pmxt_internal/py.typed +0 -0
  56. pmxt_internal/rest.py +263 -0
@@ -0,0 +1,3722 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ PMXT Sidecar API
5
+
6
+ A unified local sidecar API for prediction markets (Polymarket, Kalshi). This API acts as a JSON-RPC-style gateway. Each endpoint corresponds to a specific method on the generic exchange implementation.
7
+
8
+ The version of the OpenAPI document: 0.4.4
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictStr, field_validator
20
+ from typing import Optional
21
+ from typing_extensions import Annotated
22
+ from pmxt_internal.models.cancel_order_request import CancelOrderRequest
23
+ from pmxt_internal.models.create_order200_response import CreateOrder200Response
24
+ from pmxt_internal.models.create_order_request import CreateOrderRequest
25
+ from pmxt_internal.models.fetch_balance200_response import FetchBalance200Response
26
+ from pmxt_internal.models.fetch_markets200_response import FetchMarkets200Response
27
+ from pmxt_internal.models.fetch_markets_request import FetchMarketsRequest
28
+ from pmxt_internal.models.fetch_ohlcv200_response import FetchOHLCV200Response
29
+ from pmxt_internal.models.fetch_ohlcv_request import FetchOHLCVRequest
30
+ from pmxt_internal.models.fetch_open_orders200_response import FetchOpenOrders200Response
31
+ from pmxt_internal.models.fetch_open_orders_request import FetchOpenOrdersRequest
32
+ from pmxt_internal.models.fetch_order_book200_response import FetchOrderBook200Response
33
+ from pmxt_internal.models.fetch_order_book_request import FetchOrderBookRequest
34
+ from pmxt_internal.models.fetch_positions200_response import FetchPositions200Response
35
+ from pmxt_internal.models.fetch_positions_request import FetchPositionsRequest
36
+ from pmxt_internal.models.fetch_trades200_response import FetchTrades200Response
37
+ from pmxt_internal.models.fetch_trades_request import FetchTradesRequest
38
+ from pmxt_internal.models.get_markets_by_slug_request import GetMarketsBySlugRequest
39
+ from pmxt_internal.models.health_check200_response import HealthCheck200Response
40
+ from pmxt_internal.models.search_markets_request import SearchMarketsRequest
41
+
42
+ from pmxt_internal.api_client import ApiClient, RequestSerialized
43
+ from pmxt_internal.api_response import ApiResponse
44
+ from pmxt_internal.rest import RESTResponseType
45
+
46
+
47
+ class DefaultApi:
48
+ """NOTE: This class is auto generated by OpenAPI Generator
49
+ Ref: https://openapi-generator.tech
50
+
51
+ Do not edit the class manually.
52
+ """
53
+
54
+ def __init__(self, api_client=None) -> None:
55
+ if api_client is None:
56
+ api_client = ApiClient.get_default()
57
+ self.api_client = api_client
58
+
59
+
60
+ @validate_call
61
+ def cancel_order(
62
+ self,
63
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
64
+ cancel_order_request: Optional[CancelOrderRequest] = None,
65
+ _request_timeout: Union[
66
+ None,
67
+ Annotated[StrictFloat, Field(gt=0)],
68
+ Tuple[
69
+ Annotated[StrictFloat, Field(gt=0)],
70
+ Annotated[StrictFloat, Field(gt=0)]
71
+ ]
72
+ ] = None,
73
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
74
+ _content_type: Optional[StrictStr] = None,
75
+ _headers: Optional[Dict[StrictStr, Any]] = None,
76
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
77
+ ) -> CreateOrder200Response:
78
+ """Cancel Order
79
+
80
+
81
+ :param exchange: The prediction market exchange to target. (required)
82
+ :type exchange: str
83
+ :param cancel_order_request:
84
+ :type cancel_order_request: CancelOrderRequest
85
+ :param _request_timeout: timeout setting for this request. If one
86
+ number provided, it will be total request
87
+ timeout. It can also be a pair (tuple) of
88
+ (connection, read) timeouts.
89
+ :type _request_timeout: int, tuple(int, int), optional
90
+ :param _request_auth: set to override the auth_settings for an a single
91
+ request; this effectively ignores the
92
+ authentication in the spec for a single request.
93
+ :type _request_auth: dict, optional
94
+ :param _content_type: force content-type for the request.
95
+ :type _content_type: str, Optional
96
+ :param _headers: set to override the headers for a single
97
+ request; this effectively ignores the headers
98
+ in the spec for a single request.
99
+ :type _headers: dict, optional
100
+ :param _host_index: set to override the host_index for a single
101
+ request; this effectively ignores the host_index
102
+ in the spec for a single request.
103
+ :type _host_index: int, optional
104
+ :return: Returns the result object.
105
+ """ # noqa: E501
106
+
107
+ _param = self._cancel_order_serialize(
108
+ exchange=exchange,
109
+ cancel_order_request=cancel_order_request,
110
+ _request_auth=_request_auth,
111
+ _content_type=_content_type,
112
+ _headers=_headers,
113
+ _host_index=_host_index
114
+ )
115
+
116
+ _response_types_map: Dict[str, Optional[str]] = {
117
+ '200': "CreateOrder200Response",
118
+ }
119
+ response_data = self.api_client.call_api(
120
+ *_param,
121
+ _request_timeout=_request_timeout
122
+ )
123
+ response_data.read()
124
+ return self.api_client.response_deserialize(
125
+ response_data=response_data,
126
+ response_types_map=_response_types_map,
127
+ ).data
128
+
129
+
130
+ @validate_call
131
+ def cancel_order_with_http_info(
132
+ self,
133
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
134
+ cancel_order_request: Optional[CancelOrderRequest] = None,
135
+ _request_timeout: Union[
136
+ None,
137
+ Annotated[StrictFloat, Field(gt=0)],
138
+ Tuple[
139
+ Annotated[StrictFloat, Field(gt=0)],
140
+ Annotated[StrictFloat, Field(gt=0)]
141
+ ]
142
+ ] = None,
143
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
144
+ _content_type: Optional[StrictStr] = None,
145
+ _headers: Optional[Dict[StrictStr, Any]] = None,
146
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
147
+ ) -> ApiResponse[CreateOrder200Response]:
148
+ """Cancel Order
149
+
150
+
151
+ :param exchange: The prediction market exchange to target. (required)
152
+ :type exchange: str
153
+ :param cancel_order_request:
154
+ :type cancel_order_request: CancelOrderRequest
155
+ :param _request_timeout: timeout setting for this request. If one
156
+ number provided, it will be total request
157
+ timeout. It can also be a pair (tuple) of
158
+ (connection, read) timeouts.
159
+ :type _request_timeout: int, tuple(int, int), optional
160
+ :param _request_auth: set to override the auth_settings for an a single
161
+ request; this effectively ignores the
162
+ authentication in the spec for a single request.
163
+ :type _request_auth: dict, optional
164
+ :param _content_type: force content-type for the request.
165
+ :type _content_type: str, Optional
166
+ :param _headers: set to override the headers for a single
167
+ request; this effectively ignores the headers
168
+ in the spec for a single request.
169
+ :type _headers: dict, optional
170
+ :param _host_index: set to override the host_index for a single
171
+ request; this effectively ignores the host_index
172
+ in the spec for a single request.
173
+ :type _host_index: int, optional
174
+ :return: Returns the result object.
175
+ """ # noqa: E501
176
+
177
+ _param = self._cancel_order_serialize(
178
+ exchange=exchange,
179
+ cancel_order_request=cancel_order_request,
180
+ _request_auth=_request_auth,
181
+ _content_type=_content_type,
182
+ _headers=_headers,
183
+ _host_index=_host_index
184
+ )
185
+
186
+ _response_types_map: Dict[str, Optional[str]] = {
187
+ '200': "CreateOrder200Response",
188
+ }
189
+ response_data = self.api_client.call_api(
190
+ *_param,
191
+ _request_timeout=_request_timeout
192
+ )
193
+ response_data.read()
194
+ return self.api_client.response_deserialize(
195
+ response_data=response_data,
196
+ response_types_map=_response_types_map,
197
+ )
198
+
199
+
200
+ @validate_call
201
+ def cancel_order_without_preload_content(
202
+ self,
203
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
204
+ cancel_order_request: Optional[CancelOrderRequest] = None,
205
+ _request_timeout: Union[
206
+ None,
207
+ Annotated[StrictFloat, Field(gt=0)],
208
+ Tuple[
209
+ Annotated[StrictFloat, Field(gt=0)],
210
+ Annotated[StrictFloat, Field(gt=0)]
211
+ ]
212
+ ] = None,
213
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
214
+ _content_type: Optional[StrictStr] = None,
215
+ _headers: Optional[Dict[StrictStr, Any]] = None,
216
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
217
+ ) -> RESTResponseType:
218
+ """Cancel Order
219
+
220
+
221
+ :param exchange: The prediction market exchange to target. (required)
222
+ :type exchange: str
223
+ :param cancel_order_request:
224
+ :type cancel_order_request: CancelOrderRequest
225
+ :param _request_timeout: timeout setting for this request. If one
226
+ number provided, it will be total request
227
+ timeout. It can also be a pair (tuple) of
228
+ (connection, read) timeouts.
229
+ :type _request_timeout: int, tuple(int, int), optional
230
+ :param _request_auth: set to override the auth_settings for an a single
231
+ request; this effectively ignores the
232
+ authentication in the spec for a single request.
233
+ :type _request_auth: dict, optional
234
+ :param _content_type: force content-type for the request.
235
+ :type _content_type: str, Optional
236
+ :param _headers: set to override the headers for a single
237
+ request; this effectively ignores the headers
238
+ in the spec for a single request.
239
+ :type _headers: dict, optional
240
+ :param _host_index: set to override the host_index for a single
241
+ request; this effectively ignores the host_index
242
+ in the spec for a single request.
243
+ :type _host_index: int, optional
244
+ :return: Returns the result object.
245
+ """ # noqa: E501
246
+
247
+ _param = self._cancel_order_serialize(
248
+ exchange=exchange,
249
+ cancel_order_request=cancel_order_request,
250
+ _request_auth=_request_auth,
251
+ _content_type=_content_type,
252
+ _headers=_headers,
253
+ _host_index=_host_index
254
+ )
255
+
256
+ _response_types_map: Dict[str, Optional[str]] = {
257
+ '200': "CreateOrder200Response",
258
+ }
259
+ response_data = self.api_client.call_api(
260
+ *_param,
261
+ _request_timeout=_request_timeout
262
+ )
263
+ return response_data.response
264
+
265
+
266
+ def _cancel_order_serialize(
267
+ self,
268
+ exchange,
269
+ cancel_order_request,
270
+ _request_auth,
271
+ _content_type,
272
+ _headers,
273
+ _host_index,
274
+ ) -> RequestSerialized:
275
+
276
+ _host = None
277
+
278
+ _collection_formats: Dict[str, str] = {
279
+ }
280
+
281
+ _path_params: Dict[str, str] = {}
282
+ _query_params: List[Tuple[str, str]] = []
283
+ _header_params: Dict[str, Optional[str]] = _headers or {}
284
+ _form_params: List[Tuple[str, str]] = []
285
+ _files: Dict[
286
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
287
+ ] = {}
288
+ _body_params: Optional[bytes] = None
289
+
290
+ # process the path parameters
291
+ if exchange is not None:
292
+ _path_params['exchange'] = exchange
293
+ # process the query parameters
294
+ # process the header parameters
295
+ # process the form parameters
296
+ # process the body parameter
297
+ if cancel_order_request is not None:
298
+ _body_params = cancel_order_request
299
+
300
+
301
+ # set the HTTP header `Accept`
302
+ if 'Accept' not in _header_params:
303
+ _header_params['Accept'] = self.api_client.select_header_accept(
304
+ [
305
+ 'application/json'
306
+ ]
307
+ )
308
+
309
+ # set the HTTP header `Content-Type`
310
+ if _content_type:
311
+ _header_params['Content-Type'] = _content_type
312
+ else:
313
+ _default_content_type = (
314
+ self.api_client.select_header_content_type(
315
+ [
316
+ 'application/json'
317
+ ]
318
+ )
319
+ )
320
+ if _default_content_type is not None:
321
+ _header_params['Content-Type'] = _default_content_type
322
+
323
+ # authentication setting
324
+ _auth_settings: List[str] = [
325
+ ]
326
+
327
+ return self.api_client.param_serialize(
328
+ method='POST',
329
+ resource_path='/api/{exchange}/cancelOrder',
330
+ path_params=_path_params,
331
+ query_params=_query_params,
332
+ header_params=_header_params,
333
+ body=_body_params,
334
+ post_params=_form_params,
335
+ files=_files,
336
+ auth_settings=_auth_settings,
337
+ collection_formats=_collection_formats,
338
+ _host=_host,
339
+ _request_auth=_request_auth
340
+ )
341
+
342
+
343
+
344
+
345
+ @validate_call
346
+ def create_order(
347
+ self,
348
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
349
+ create_order_request: Optional[CreateOrderRequest] = None,
350
+ _request_timeout: Union[
351
+ None,
352
+ Annotated[StrictFloat, Field(gt=0)],
353
+ Tuple[
354
+ Annotated[StrictFloat, Field(gt=0)],
355
+ Annotated[StrictFloat, Field(gt=0)]
356
+ ]
357
+ ] = None,
358
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
359
+ _content_type: Optional[StrictStr] = None,
360
+ _headers: Optional[Dict[StrictStr, Any]] = None,
361
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
362
+ ) -> CreateOrder200Response:
363
+ """Create Order
364
+
365
+
366
+ :param exchange: The prediction market exchange to target. (required)
367
+ :type exchange: str
368
+ :param create_order_request:
369
+ :type create_order_request: CreateOrderRequest
370
+ :param _request_timeout: timeout setting for this request. If one
371
+ number provided, it will be total request
372
+ timeout. It can also be a pair (tuple) of
373
+ (connection, read) timeouts.
374
+ :type _request_timeout: int, tuple(int, int), optional
375
+ :param _request_auth: set to override the auth_settings for an a single
376
+ request; this effectively ignores the
377
+ authentication in the spec for a single request.
378
+ :type _request_auth: dict, optional
379
+ :param _content_type: force content-type for the request.
380
+ :type _content_type: str, Optional
381
+ :param _headers: set to override the headers for a single
382
+ request; this effectively ignores the headers
383
+ in the spec for a single request.
384
+ :type _headers: dict, optional
385
+ :param _host_index: set to override the host_index for a single
386
+ request; this effectively ignores the host_index
387
+ in the spec for a single request.
388
+ :type _host_index: int, optional
389
+ :return: Returns the result object.
390
+ """ # noqa: E501
391
+
392
+ _param = self._create_order_serialize(
393
+ exchange=exchange,
394
+ create_order_request=create_order_request,
395
+ _request_auth=_request_auth,
396
+ _content_type=_content_type,
397
+ _headers=_headers,
398
+ _host_index=_host_index
399
+ )
400
+
401
+ _response_types_map: Dict[str, Optional[str]] = {
402
+ '200': "CreateOrder200Response",
403
+ }
404
+ response_data = self.api_client.call_api(
405
+ *_param,
406
+ _request_timeout=_request_timeout
407
+ )
408
+ response_data.read()
409
+ return self.api_client.response_deserialize(
410
+ response_data=response_data,
411
+ response_types_map=_response_types_map,
412
+ ).data
413
+
414
+
415
+ @validate_call
416
+ def create_order_with_http_info(
417
+ self,
418
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
419
+ create_order_request: Optional[CreateOrderRequest] = None,
420
+ _request_timeout: Union[
421
+ None,
422
+ Annotated[StrictFloat, Field(gt=0)],
423
+ Tuple[
424
+ Annotated[StrictFloat, Field(gt=0)],
425
+ Annotated[StrictFloat, Field(gt=0)]
426
+ ]
427
+ ] = None,
428
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
429
+ _content_type: Optional[StrictStr] = None,
430
+ _headers: Optional[Dict[StrictStr, Any]] = None,
431
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
432
+ ) -> ApiResponse[CreateOrder200Response]:
433
+ """Create Order
434
+
435
+
436
+ :param exchange: The prediction market exchange to target. (required)
437
+ :type exchange: str
438
+ :param create_order_request:
439
+ :type create_order_request: CreateOrderRequest
440
+ :param _request_timeout: timeout setting for this request. If one
441
+ number provided, it will be total request
442
+ timeout. It can also be a pair (tuple) of
443
+ (connection, read) timeouts.
444
+ :type _request_timeout: int, tuple(int, int), optional
445
+ :param _request_auth: set to override the auth_settings for an a single
446
+ request; this effectively ignores the
447
+ authentication in the spec for a single request.
448
+ :type _request_auth: dict, optional
449
+ :param _content_type: force content-type for the request.
450
+ :type _content_type: str, Optional
451
+ :param _headers: set to override the headers for a single
452
+ request; this effectively ignores the headers
453
+ in the spec for a single request.
454
+ :type _headers: dict, optional
455
+ :param _host_index: set to override the host_index for a single
456
+ request; this effectively ignores the host_index
457
+ in the spec for a single request.
458
+ :type _host_index: int, optional
459
+ :return: Returns the result object.
460
+ """ # noqa: E501
461
+
462
+ _param = self._create_order_serialize(
463
+ exchange=exchange,
464
+ create_order_request=create_order_request,
465
+ _request_auth=_request_auth,
466
+ _content_type=_content_type,
467
+ _headers=_headers,
468
+ _host_index=_host_index
469
+ )
470
+
471
+ _response_types_map: Dict[str, Optional[str]] = {
472
+ '200': "CreateOrder200Response",
473
+ }
474
+ response_data = self.api_client.call_api(
475
+ *_param,
476
+ _request_timeout=_request_timeout
477
+ )
478
+ response_data.read()
479
+ return self.api_client.response_deserialize(
480
+ response_data=response_data,
481
+ response_types_map=_response_types_map,
482
+ )
483
+
484
+
485
+ @validate_call
486
+ def create_order_without_preload_content(
487
+ self,
488
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
489
+ create_order_request: Optional[CreateOrderRequest] = None,
490
+ _request_timeout: Union[
491
+ None,
492
+ Annotated[StrictFloat, Field(gt=0)],
493
+ Tuple[
494
+ Annotated[StrictFloat, Field(gt=0)],
495
+ Annotated[StrictFloat, Field(gt=0)]
496
+ ]
497
+ ] = None,
498
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
499
+ _content_type: Optional[StrictStr] = None,
500
+ _headers: Optional[Dict[StrictStr, Any]] = None,
501
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
502
+ ) -> RESTResponseType:
503
+ """Create Order
504
+
505
+
506
+ :param exchange: The prediction market exchange to target. (required)
507
+ :type exchange: str
508
+ :param create_order_request:
509
+ :type create_order_request: CreateOrderRequest
510
+ :param _request_timeout: timeout setting for this request. If one
511
+ number provided, it will be total request
512
+ timeout. It can also be a pair (tuple) of
513
+ (connection, read) timeouts.
514
+ :type _request_timeout: int, tuple(int, int), optional
515
+ :param _request_auth: set to override the auth_settings for an a single
516
+ request; this effectively ignores the
517
+ authentication in the spec for a single request.
518
+ :type _request_auth: dict, optional
519
+ :param _content_type: force content-type for the request.
520
+ :type _content_type: str, Optional
521
+ :param _headers: set to override the headers for a single
522
+ request; this effectively ignores the headers
523
+ in the spec for a single request.
524
+ :type _headers: dict, optional
525
+ :param _host_index: set to override the host_index for a single
526
+ request; this effectively ignores the host_index
527
+ in the spec for a single request.
528
+ :type _host_index: int, optional
529
+ :return: Returns the result object.
530
+ """ # noqa: E501
531
+
532
+ _param = self._create_order_serialize(
533
+ exchange=exchange,
534
+ create_order_request=create_order_request,
535
+ _request_auth=_request_auth,
536
+ _content_type=_content_type,
537
+ _headers=_headers,
538
+ _host_index=_host_index
539
+ )
540
+
541
+ _response_types_map: Dict[str, Optional[str]] = {
542
+ '200': "CreateOrder200Response",
543
+ }
544
+ response_data = self.api_client.call_api(
545
+ *_param,
546
+ _request_timeout=_request_timeout
547
+ )
548
+ return response_data.response
549
+
550
+
551
+ def _create_order_serialize(
552
+ self,
553
+ exchange,
554
+ create_order_request,
555
+ _request_auth,
556
+ _content_type,
557
+ _headers,
558
+ _host_index,
559
+ ) -> RequestSerialized:
560
+
561
+ _host = None
562
+
563
+ _collection_formats: Dict[str, str] = {
564
+ }
565
+
566
+ _path_params: Dict[str, str] = {}
567
+ _query_params: List[Tuple[str, str]] = []
568
+ _header_params: Dict[str, Optional[str]] = _headers or {}
569
+ _form_params: List[Tuple[str, str]] = []
570
+ _files: Dict[
571
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
572
+ ] = {}
573
+ _body_params: Optional[bytes] = None
574
+
575
+ # process the path parameters
576
+ if exchange is not None:
577
+ _path_params['exchange'] = exchange
578
+ # process the query parameters
579
+ # process the header parameters
580
+ # process the form parameters
581
+ # process the body parameter
582
+ if create_order_request is not None:
583
+ _body_params = create_order_request
584
+
585
+
586
+ # set the HTTP header `Accept`
587
+ if 'Accept' not in _header_params:
588
+ _header_params['Accept'] = self.api_client.select_header_accept(
589
+ [
590
+ 'application/json'
591
+ ]
592
+ )
593
+
594
+ # set the HTTP header `Content-Type`
595
+ if _content_type:
596
+ _header_params['Content-Type'] = _content_type
597
+ else:
598
+ _default_content_type = (
599
+ self.api_client.select_header_content_type(
600
+ [
601
+ 'application/json'
602
+ ]
603
+ )
604
+ )
605
+ if _default_content_type is not None:
606
+ _header_params['Content-Type'] = _default_content_type
607
+
608
+ # authentication setting
609
+ _auth_settings: List[str] = [
610
+ ]
611
+
612
+ return self.api_client.param_serialize(
613
+ method='POST',
614
+ resource_path='/api/{exchange}/createOrder',
615
+ path_params=_path_params,
616
+ query_params=_query_params,
617
+ header_params=_header_params,
618
+ body=_body_params,
619
+ post_params=_form_params,
620
+ files=_files,
621
+ auth_settings=_auth_settings,
622
+ collection_formats=_collection_formats,
623
+ _host=_host,
624
+ _request_auth=_request_auth
625
+ )
626
+
627
+
628
+
629
+
630
+ @validate_call
631
+ def fetch_balance(
632
+ self,
633
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
634
+ fetch_positions_request: Optional[FetchPositionsRequest] = None,
635
+ _request_timeout: Union[
636
+ None,
637
+ Annotated[StrictFloat, Field(gt=0)],
638
+ Tuple[
639
+ Annotated[StrictFloat, Field(gt=0)],
640
+ Annotated[StrictFloat, Field(gt=0)]
641
+ ]
642
+ ] = None,
643
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
644
+ _content_type: Optional[StrictStr] = None,
645
+ _headers: Optional[Dict[StrictStr, Any]] = None,
646
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
647
+ ) -> FetchBalance200Response:
648
+ """Fetch Balance
649
+
650
+
651
+ :param exchange: The prediction market exchange to target. (required)
652
+ :type exchange: str
653
+ :param fetch_positions_request:
654
+ :type fetch_positions_request: FetchPositionsRequest
655
+ :param _request_timeout: timeout setting for this request. If one
656
+ number provided, it will be total request
657
+ timeout. It can also be a pair (tuple) of
658
+ (connection, read) timeouts.
659
+ :type _request_timeout: int, tuple(int, int), optional
660
+ :param _request_auth: set to override the auth_settings for an a single
661
+ request; this effectively ignores the
662
+ authentication in the spec for a single request.
663
+ :type _request_auth: dict, optional
664
+ :param _content_type: force content-type for the request.
665
+ :type _content_type: str, Optional
666
+ :param _headers: set to override the headers for a single
667
+ request; this effectively ignores the headers
668
+ in the spec for a single request.
669
+ :type _headers: dict, optional
670
+ :param _host_index: set to override the host_index for a single
671
+ request; this effectively ignores the host_index
672
+ in the spec for a single request.
673
+ :type _host_index: int, optional
674
+ :return: Returns the result object.
675
+ """ # noqa: E501
676
+
677
+ _param = self._fetch_balance_serialize(
678
+ exchange=exchange,
679
+ fetch_positions_request=fetch_positions_request,
680
+ _request_auth=_request_auth,
681
+ _content_type=_content_type,
682
+ _headers=_headers,
683
+ _host_index=_host_index
684
+ )
685
+
686
+ _response_types_map: Dict[str, Optional[str]] = {
687
+ '200': "FetchBalance200Response",
688
+ }
689
+ response_data = self.api_client.call_api(
690
+ *_param,
691
+ _request_timeout=_request_timeout
692
+ )
693
+ response_data.read()
694
+ return self.api_client.response_deserialize(
695
+ response_data=response_data,
696
+ response_types_map=_response_types_map,
697
+ ).data
698
+
699
+
700
+ @validate_call
701
+ def fetch_balance_with_http_info(
702
+ self,
703
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
704
+ fetch_positions_request: Optional[FetchPositionsRequest] = None,
705
+ _request_timeout: Union[
706
+ None,
707
+ Annotated[StrictFloat, Field(gt=0)],
708
+ Tuple[
709
+ Annotated[StrictFloat, Field(gt=0)],
710
+ Annotated[StrictFloat, Field(gt=0)]
711
+ ]
712
+ ] = None,
713
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
714
+ _content_type: Optional[StrictStr] = None,
715
+ _headers: Optional[Dict[StrictStr, Any]] = None,
716
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
717
+ ) -> ApiResponse[FetchBalance200Response]:
718
+ """Fetch Balance
719
+
720
+
721
+ :param exchange: The prediction market exchange to target. (required)
722
+ :type exchange: str
723
+ :param fetch_positions_request:
724
+ :type fetch_positions_request: FetchPositionsRequest
725
+ :param _request_timeout: timeout setting for this request. If one
726
+ number provided, it will be total request
727
+ timeout. It can also be a pair (tuple) of
728
+ (connection, read) timeouts.
729
+ :type _request_timeout: int, tuple(int, int), optional
730
+ :param _request_auth: set to override the auth_settings for an a single
731
+ request; this effectively ignores the
732
+ authentication in the spec for a single request.
733
+ :type _request_auth: dict, optional
734
+ :param _content_type: force content-type for the request.
735
+ :type _content_type: str, Optional
736
+ :param _headers: set to override the headers for a single
737
+ request; this effectively ignores the headers
738
+ in the spec for a single request.
739
+ :type _headers: dict, optional
740
+ :param _host_index: set to override the host_index for a single
741
+ request; this effectively ignores the host_index
742
+ in the spec for a single request.
743
+ :type _host_index: int, optional
744
+ :return: Returns the result object.
745
+ """ # noqa: E501
746
+
747
+ _param = self._fetch_balance_serialize(
748
+ exchange=exchange,
749
+ fetch_positions_request=fetch_positions_request,
750
+ _request_auth=_request_auth,
751
+ _content_type=_content_type,
752
+ _headers=_headers,
753
+ _host_index=_host_index
754
+ )
755
+
756
+ _response_types_map: Dict[str, Optional[str]] = {
757
+ '200': "FetchBalance200Response",
758
+ }
759
+ response_data = self.api_client.call_api(
760
+ *_param,
761
+ _request_timeout=_request_timeout
762
+ )
763
+ response_data.read()
764
+ return self.api_client.response_deserialize(
765
+ response_data=response_data,
766
+ response_types_map=_response_types_map,
767
+ )
768
+
769
+
770
+ @validate_call
771
+ def fetch_balance_without_preload_content(
772
+ self,
773
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
774
+ fetch_positions_request: Optional[FetchPositionsRequest] = None,
775
+ _request_timeout: Union[
776
+ None,
777
+ Annotated[StrictFloat, Field(gt=0)],
778
+ Tuple[
779
+ Annotated[StrictFloat, Field(gt=0)],
780
+ Annotated[StrictFloat, Field(gt=0)]
781
+ ]
782
+ ] = None,
783
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
784
+ _content_type: Optional[StrictStr] = None,
785
+ _headers: Optional[Dict[StrictStr, Any]] = None,
786
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
787
+ ) -> RESTResponseType:
788
+ """Fetch Balance
789
+
790
+
791
+ :param exchange: The prediction market exchange to target. (required)
792
+ :type exchange: str
793
+ :param fetch_positions_request:
794
+ :type fetch_positions_request: FetchPositionsRequest
795
+ :param _request_timeout: timeout setting for this request. If one
796
+ number provided, it will be total request
797
+ timeout. It can also be a pair (tuple) of
798
+ (connection, read) timeouts.
799
+ :type _request_timeout: int, tuple(int, int), optional
800
+ :param _request_auth: set to override the auth_settings for an a single
801
+ request; this effectively ignores the
802
+ authentication in the spec for a single request.
803
+ :type _request_auth: dict, optional
804
+ :param _content_type: force content-type for the request.
805
+ :type _content_type: str, Optional
806
+ :param _headers: set to override the headers for a single
807
+ request; this effectively ignores the headers
808
+ in the spec for a single request.
809
+ :type _headers: dict, optional
810
+ :param _host_index: set to override the host_index for a single
811
+ request; this effectively ignores the host_index
812
+ in the spec for a single request.
813
+ :type _host_index: int, optional
814
+ :return: Returns the result object.
815
+ """ # noqa: E501
816
+
817
+ _param = self._fetch_balance_serialize(
818
+ exchange=exchange,
819
+ fetch_positions_request=fetch_positions_request,
820
+ _request_auth=_request_auth,
821
+ _content_type=_content_type,
822
+ _headers=_headers,
823
+ _host_index=_host_index
824
+ )
825
+
826
+ _response_types_map: Dict[str, Optional[str]] = {
827
+ '200': "FetchBalance200Response",
828
+ }
829
+ response_data = self.api_client.call_api(
830
+ *_param,
831
+ _request_timeout=_request_timeout
832
+ )
833
+ return response_data.response
834
+
835
+
836
+ def _fetch_balance_serialize(
837
+ self,
838
+ exchange,
839
+ fetch_positions_request,
840
+ _request_auth,
841
+ _content_type,
842
+ _headers,
843
+ _host_index,
844
+ ) -> RequestSerialized:
845
+
846
+ _host = None
847
+
848
+ _collection_formats: Dict[str, str] = {
849
+ }
850
+
851
+ _path_params: Dict[str, str] = {}
852
+ _query_params: List[Tuple[str, str]] = []
853
+ _header_params: Dict[str, Optional[str]] = _headers or {}
854
+ _form_params: List[Tuple[str, str]] = []
855
+ _files: Dict[
856
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
857
+ ] = {}
858
+ _body_params: Optional[bytes] = None
859
+
860
+ # process the path parameters
861
+ if exchange is not None:
862
+ _path_params['exchange'] = exchange
863
+ # process the query parameters
864
+ # process the header parameters
865
+ # process the form parameters
866
+ # process the body parameter
867
+ if fetch_positions_request is not None:
868
+ _body_params = fetch_positions_request
869
+
870
+
871
+ # set the HTTP header `Accept`
872
+ if 'Accept' not in _header_params:
873
+ _header_params['Accept'] = self.api_client.select_header_accept(
874
+ [
875
+ 'application/json'
876
+ ]
877
+ )
878
+
879
+ # set the HTTP header `Content-Type`
880
+ if _content_type:
881
+ _header_params['Content-Type'] = _content_type
882
+ else:
883
+ _default_content_type = (
884
+ self.api_client.select_header_content_type(
885
+ [
886
+ 'application/json'
887
+ ]
888
+ )
889
+ )
890
+ if _default_content_type is not None:
891
+ _header_params['Content-Type'] = _default_content_type
892
+
893
+ # authentication setting
894
+ _auth_settings: List[str] = [
895
+ ]
896
+
897
+ return self.api_client.param_serialize(
898
+ method='POST',
899
+ resource_path='/api/{exchange}/fetchBalance',
900
+ path_params=_path_params,
901
+ query_params=_query_params,
902
+ header_params=_header_params,
903
+ body=_body_params,
904
+ post_params=_form_params,
905
+ files=_files,
906
+ auth_settings=_auth_settings,
907
+ collection_formats=_collection_formats,
908
+ _host=_host,
909
+ _request_auth=_request_auth
910
+ )
911
+
912
+
913
+
914
+
915
+ @validate_call
916
+ def fetch_markets(
917
+ self,
918
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
919
+ fetch_markets_request: Optional[FetchMarketsRequest] = None,
920
+ _request_timeout: Union[
921
+ None,
922
+ Annotated[StrictFloat, Field(gt=0)],
923
+ Tuple[
924
+ Annotated[StrictFloat, Field(gt=0)],
925
+ Annotated[StrictFloat, Field(gt=0)]
926
+ ]
927
+ ] = None,
928
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
929
+ _content_type: Optional[StrictStr] = None,
930
+ _headers: Optional[Dict[StrictStr, Any]] = None,
931
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
932
+ ) -> FetchMarkets200Response:
933
+ """Fetch Markets
934
+
935
+
936
+ :param exchange: The prediction market exchange to target. (required)
937
+ :type exchange: str
938
+ :param fetch_markets_request:
939
+ :type fetch_markets_request: FetchMarketsRequest
940
+ :param _request_timeout: timeout setting for this request. If one
941
+ number provided, it will be total request
942
+ timeout. It can also be a pair (tuple) of
943
+ (connection, read) timeouts.
944
+ :type _request_timeout: int, tuple(int, int), optional
945
+ :param _request_auth: set to override the auth_settings for an a single
946
+ request; this effectively ignores the
947
+ authentication in the spec for a single request.
948
+ :type _request_auth: dict, optional
949
+ :param _content_type: force content-type for the request.
950
+ :type _content_type: str, Optional
951
+ :param _headers: set to override the headers for a single
952
+ request; this effectively ignores the headers
953
+ in the spec for a single request.
954
+ :type _headers: dict, optional
955
+ :param _host_index: set to override the host_index for a single
956
+ request; this effectively ignores the host_index
957
+ in the spec for a single request.
958
+ :type _host_index: int, optional
959
+ :return: Returns the result object.
960
+ """ # noqa: E501
961
+
962
+ _param = self._fetch_markets_serialize(
963
+ exchange=exchange,
964
+ fetch_markets_request=fetch_markets_request,
965
+ _request_auth=_request_auth,
966
+ _content_type=_content_type,
967
+ _headers=_headers,
968
+ _host_index=_host_index
969
+ )
970
+
971
+ _response_types_map: Dict[str, Optional[str]] = {
972
+ '200': "FetchMarkets200Response",
973
+ }
974
+ response_data = self.api_client.call_api(
975
+ *_param,
976
+ _request_timeout=_request_timeout
977
+ )
978
+ response_data.read()
979
+ return self.api_client.response_deserialize(
980
+ response_data=response_data,
981
+ response_types_map=_response_types_map,
982
+ ).data
983
+
984
+
985
+ @validate_call
986
+ def fetch_markets_with_http_info(
987
+ self,
988
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
989
+ fetch_markets_request: Optional[FetchMarketsRequest] = None,
990
+ _request_timeout: Union[
991
+ None,
992
+ Annotated[StrictFloat, Field(gt=0)],
993
+ Tuple[
994
+ Annotated[StrictFloat, Field(gt=0)],
995
+ Annotated[StrictFloat, Field(gt=0)]
996
+ ]
997
+ ] = None,
998
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
999
+ _content_type: Optional[StrictStr] = None,
1000
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1001
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1002
+ ) -> ApiResponse[FetchMarkets200Response]:
1003
+ """Fetch Markets
1004
+
1005
+
1006
+ :param exchange: The prediction market exchange to target. (required)
1007
+ :type exchange: str
1008
+ :param fetch_markets_request:
1009
+ :type fetch_markets_request: FetchMarketsRequest
1010
+ :param _request_timeout: timeout setting for this request. If one
1011
+ number provided, it will be total request
1012
+ timeout. It can also be a pair (tuple) of
1013
+ (connection, read) timeouts.
1014
+ :type _request_timeout: int, tuple(int, int), optional
1015
+ :param _request_auth: set to override the auth_settings for an a single
1016
+ request; this effectively ignores the
1017
+ authentication in the spec for a single request.
1018
+ :type _request_auth: dict, optional
1019
+ :param _content_type: force content-type for the request.
1020
+ :type _content_type: str, Optional
1021
+ :param _headers: set to override the headers for a single
1022
+ request; this effectively ignores the headers
1023
+ in the spec for a single request.
1024
+ :type _headers: dict, optional
1025
+ :param _host_index: set to override the host_index for a single
1026
+ request; this effectively ignores the host_index
1027
+ in the spec for a single request.
1028
+ :type _host_index: int, optional
1029
+ :return: Returns the result object.
1030
+ """ # noqa: E501
1031
+
1032
+ _param = self._fetch_markets_serialize(
1033
+ exchange=exchange,
1034
+ fetch_markets_request=fetch_markets_request,
1035
+ _request_auth=_request_auth,
1036
+ _content_type=_content_type,
1037
+ _headers=_headers,
1038
+ _host_index=_host_index
1039
+ )
1040
+
1041
+ _response_types_map: Dict[str, Optional[str]] = {
1042
+ '200': "FetchMarkets200Response",
1043
+ }
1044
+ response_data = self.api_client.call_api(
1045
+ *_param,
1046
+ _request_timeout=_request_timeout
1047
+ )
1048
+ response_data.read()
1049
+ return self.api_client.response_deserialize(
1050
+ response_data=response_data,
1051
+ response_types_map=_response_types_map,
1052
+ )
1053
+
1054
+
1055
+ @validate_call
1056
+ def fetch_markets_without_preload_content(
1057
+ self,
1058
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
1059
+ fetch_markets_request: Optional[FetchMarketsRequest] = None,
1060
+ _request_timeout: Union[
1061
+ None,
1062
+ Annotated[StrictFloat, Field(gt=0)],
1063
+ Tuple[
1064
+ Annotated[StrictFloat, Field(gt=0)],
1065
+ Annotated[StrictFloat, Field(gt=0)]
1066
+ ]
1067
+ ] = None,
1068
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1069
+ _content_type: Optional[StrictStr] = None,
1070
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1071
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1072
+ ) -> RESTResponseType:
1073
+ """Fetch Markets
1074
+
1075
+
1076
+ :param exchange: The prediction market exchange to target. (required)
1077
+ :type exchange: str
1078
+ :param fetch_markets_request:
1079
+ :type fetch_markets_request: FetchMarketsRequest
1080
+ :param _request_timeout: timeout setting for this request. If one
1081
+ number provided, it will be total request
1082
+ timeout. It can also be a pair (tuple) of
1083
+ (connection, read) timeouts.
1084
+ :type _request_timeout: int, tuple(int, int), optional
1085
+ :param _request_auth: set to override the auth_settings for an a single
1086
+ request; this effectively ignores the
1087
+ authentication in the spec for a single request.
1088
+ :type _request_auth: dict, optional
1089
+ :param _content_type: force content-type for the request.
1090
+ :type _content_type: str, Optional
1091
+ :param _headers: set to override the headers for a single
1092
+ request; this effectively ignores the headers
1093
+ in the spec for a single request.
1094
+ :type _headers: dict, optional
1095
+ :param _host_index: set to override the host_index for a single
1096
+ request; this effectively ignores the host_index
1097
+ in the spec for a single request.
1098
+ :type _host_index: int, optional
1099
+ :return: Returns the result object.
1100
+ """ # noqa: E501
1101
+
1102
+ _param = self._fetch_markets_serialize(
1103
+ exchange=exchange,
1104
+ fetch_markets_request=fetch_markets_request,
1105
+ _request_auth=_request_auth,
1106
+ _content_type=_content_type,
1107
+ _headers=_headers,
1108
+ _host_index=_host_index
1109
+ )
1110
+
1111
+ _response_types_map: Dict[str, Optional[str]] = {
1112
+ '200': "FetchMarkets200Response",
1113
+ }
1114
+ response_data = self.api_client.call_api(
1115
+ *_param,
1116
+ _request_timeout=_request_timeout
1117
+ )
1118
+ return response_data.response
1119
+
1120
+
1121
+ def _fetch_markets_serialize(
1122
+ self,
1123
+ exchange,
1124
+ fetch_markets_request,
1125
+ _request_auth,
1126
+ _content_type,
1127
+ _headers,
1128
+ _host_index,
1129
+ ) -> RequestSerialized:
1130
+
1131
+ _host = None
1132
+
1133
+ _collection_formats: Dict[str, str] = {
1134
+ }
1135
+
1136
+ _path_params: Dict[str, str] = {}
1137
+ _query_params: List[Tuple[str, str]] = []
1138
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1139
+ _form_params: List[Tuple[str, str]] = []
1140
+ _files: Dict[
1141
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1142
+ ] = {}
1143
+ _body_params: Optional[bytes] = None
1144
+
1145
+ # process the path parameters
1146
+ if exchange is not None:
1147
+ _path_params['exchange'] = exchange
1148
+ # process the query parameters
1149
+ # process the header parameters
1150
+ # process the form parameters
1151
+ # process the body parameter
1152
+ if fetch_markets_request is not None:
1153
+ _body_params = fetch_markets_request
1154
+
1155
+
1156
+ # set the HTTP header `Accept`
1157
+ if 'Accept' not in _header_params:
1158
+ _header_params['Accept'] = self.api_client.select_header_accept(
1159
+ [
1160
+ 'application/json'
1161
+ ]
1162
+ )
1163
+
1164
+ # set the HTTP header `Content-Type`
1165
+ if _content_type:
1166
+ _header_params['Content-Type'] = _content_type
1167
+ else:
1168
+ _default_content_type = (
1169
+ self.api_client.select_header_content_type(
1170
+ [
1171
+ 'application/json'
1172
+ ]
1173
+ )
1174
+ )
1175
+ if _default_content_type is not None:
1176
+ _header_params['Content-Type'] = _default_content_type
1177
+
1178
+ # authentication setting
1179
+ _auth_settings: List[str] = [
1180
+ ]
1181
+
1182
+ return self.api_client.param_serialize(
1183
+ method='POST',
1184
+ resource_path='/api/{exchange}/fetchMarkets',
1185
+ path_params=_path_params,
1186
+ query_params=_query_params,
1187
+ header_params=_header_params,
1188
+ body=_body_params,
1189
+ post_params=_form_params,
1190
+ files=_files,
1191
+ auth_settings=_auth_settings,
1192
+ collection_formats=_collection_formats,
1193
+ _host=_host,
1194
+ _request_auth=_request_auth
1195
+ )
1196
+
1197
+
1198
+
1199
+
1200
+ @validate_call
1201
+ def fetch_ohlcv(
1202
+ self,
1203
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
1204
+ fetch_ohlcv_request: Optional[FetchOHLCVRequest] = None,
1205
+ _request_timeout: Union[
1206
+ None,
1207
+ Annotated[StrictFloat, Field(gt=0)],
1208
+ Tuple[
1209
+ Annotated[StrictFloat, Field(gt=0)],
1210
+ Annotated[StrictFloat, Field(gt=0)]
1211
+ ]
1212
+ ] = None,
1213
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1214
+ _content_type: Optional[StrictStr] = None,
1215
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1216
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1217
+ ) -> FetchOHLCV200Response:
1218
+ """Fetch OHLCV Candles
1219
+
1220
+
1221
+ :param exchange: The prediction market exchange to target. (required)
1222
+ :type exchange: str
1223
+ :param fetch_ohlcv_request:
1224
+ :type fetch_ohlcv_request: FetchOHLCVRequest
1225
+ :param _request_timeout: timeout setting for this request. If one
1226
+ number provided, it will be total request
1227
+ timeout. It can also be a pair (tuple) of
1228
+ (connection, read) timeouts.
1229
+ :type _request_timeout: int, tuple(int, int), optional
1230
+ :param _request_auth: set to override the auth_settings for an a single
1231
+ request; this effectively ignores the
1232
+ authentication in the spec for a single request.
1233
+ :type _request_auth: dict, optional
1234
+ :param _content_type: force content-type for the request.
1235
+ :type _content_type: str, Optional
1236
+ :param _headers: set to override the headers for a single
1237
+ request; this effectively ignores the headers
1238
+ in the spec for a single request.
1239
+ :type _headers: dict, optional
1240
+ :param _host_index: set to override the host_index for a single
1241
+ request; this effectively ignores the host_index
1242
+ in the spec for a single request.
1243
+ :type _host_index: int, optional
1244
+ :return: Returns the result object.
1245
+ """ # noqa: E501
1246
+
1247
+ _param = self._fetch_ohlcv_serialize(
1248
+ exchange=exchange,
1249
+ fetch_ohlcv_request=fetch_ohlcv_request,
1250
+ _request_auth=_request_auth,
1251
+ _content_type=_content_type,
1252
+ _headers=_headers,
1253
+ _host_index=_host_index
1254
+ )
1255
+
1256
+ _response_types_map: Dict[str, Optional[str]] = {
1257
+ '200': "FetchOHLCV200Response",
1258
+ }
1259
+ response_data = self.api_client.call_api(
1260
+ *_param,
1261
+ _request_timeout=_request_timeout
1262
+ )
1263
+ response_data.read()
1264
+ return self.api_client.response_deserialize(
1265
+ response_data=response_data,
1266
+ response_types_map=_response_types_map,
1267
+ ).data
1268
+
1269
+
1270
+ @validate_call
1271
+ def fetch_ohlcv_with_http_info(
1272
+ self,
1273
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
1274
+ fetch_ohlcv_request: Optional[FetchOHLCVRequest] = None,
1275
+ _request_timeout: Union[
1276
+ None,
1277
+ Annotated[StrictFloat, Field(gt=0)],
1278
+ Tuple[
1279
+ Annotated[StrictFloat, Field(gt=0)],
1280
+ Annotated[StrictFloat, Field(gt=0)]
1281
+ ]
1282
+ ] = None,
1283
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1284
+ _content_type: Optional[StrictStr] = None,
1285
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1286
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1287
+ ) -> ApiResponse[FetchOHLCV200Response]:
1288
+ """Fetch OHLCV Candles
1289
+
1290
+
1291
+ :param exchange: The prediction market exchange to target. (required)
1292
+ :type exchange: str
1293
+ :param fetch_ohlcv_request:
1294
+ :type fetch_ohlcv_request: FetchOHLCVRequest
1295
+ :param _request_timeout: timeout setting for this request. If one
1296
+ number provided, it will be total request
1297
+ timeout. It can also be a pair (tuple) of
1298
+ (connection, read) timeouts.
1299
+ :type _request_timeout: int, tuple(int, int), optional
1300
+ :param _request_auth: set to override the auth_settings for an a single
1301
+ request; this effectively ignores the
1302
+ authentication in the spec for a single request.
1303
+ :type _request_auth: dict, optional
1304
+ :param _content_type: force content-type for the request.
1305
+ :type _content_type: str, Optional
1306
+ :param _headers: set to override the headers for a single
1307
+ request; this effectively ignores the headers
1308
+ in the spec for a single request.
1309
+ :type _headers: dict, optional
1310
+ :param _host_index: set to override the host_index for a single
1311
+ request; this effectively ignores the host_index
1312
+ in the spec for a single request.
1313
+ :type _host_index: int, optional
1314
+ :return: Returns the result object.
1315
+ """ # noqa: E501
1316
+
1317
+ _param = self._fetch_ohlcv_serialize(
1318
+ exchange=exchange,
1319
+ fetch_ohlcv_request=fetch_ohlcv_request,
1320
+ _request_auth=_request_auth,
1321
+ _content_type=_content_type,
1322
+ _headers=_headers,
1323
+ _host_index=_host_index
1324
+ )
1325
+
1326
+ _response_types_map: Dict[str, Optional[str]] = {
1327
+ '200': "FetchOHLCV200Response",
1328
+ }
1329
+ response_data = self.api_client.call_api(
1330
+ *_param,
1331
+ _request_timeout=_request_timeout
1332
+ )
1333
+ response_data.read()
1334
+ return self.api_client.response_deserialize(
1335
+ response_data=response_data,
1336
+ response_types_map=_response_types_map,
1337
+ )
1338
+
1339
+
1340
+ @validate_call
1341
+ def fetch_ohlcv_without_preload_content(
1342
+ self,
1343
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
1344
+ fetch_ohlcv_request: Optional[FetchOHLCVRequest] = None,
1345
+ _request_timeout: Union[
1346
+ None,
1347
+ Annotated[StrictFloat, Field(gt=0)],
1348
+ Tuple[
1349
+ Annotated[StrictFloat, Field(gt=0)],
1350
+ Annotated[StrictFloat, Field(gt=0)]
1351
+ ]
1352
+ ] = None,
1353
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1354
+ _content_type: Optional[StrictStr] = None,
1355
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1356
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1357
+ ) -> RESTResponseType:
1358
+ """Fetch OHLCV Candles
1359
+
1360
+
1361
+ :param exchange: The prediction market exchange to target. (required)
1362
+ :type exchange: str
1363
+ :param fetch_ohlcv_request:
1364
+ :type fetch_ohlcv_request: FetchOHLCVRequest
1365
+ :param _request_timeout: timeout setting for this request. If one
1366
+ number provided, it will be total request
1367
+ timeout. It can also be a pair (tuple) of
1368
+ (connection, read) timeouts.
1369
+ :type _request_timeout: int, tuple(int, int), optional
1370
+ :param _request_auth: set to override the auth_settings for an a single
1371
+ request; this effectively ignores the
1372
+ authentication in the spec for a single request.
1373
+ :type _request_auth: dict, optional
1374
+ :param _content_type: force content-type for the request.
1375
+ :type _content_type: str, Optional
1376
+ :param _headers: set to override the headers for a single
1377
+ request; this effectively ignores the headers
1378
+ in the spec for a single request.
1379
+ :type _headers: dict, optional
1380
+ :param _host_index: set to override the host_index for a single
1381
+ request; this effectively ignores the host_index
1382
+ in the spec for a single request.
1383
+ :type _host_index: int, optional
1384
+ :return: Returns the result object.
1385
+ """ # noqa: E501
1386
+
1387
+ _param = self._fetch_ohlcv_serialize(
1388
+ exchange=exchange,
1389
+ fetch_ohlcv_request=fetch_ohlcv_request,
1390
+ _request_auth=_request_auth,
1391
+ _content_type=_content_type,
1392
+ _headers=_headers,
1393
+ _host_index=_host_index
1394
+ )
1395
+
1396
+ _response_types_map: Dict[str, Optional[str]] = {
1397
+ '200': "FetchOHLCV200Response",
1398
+ }
1399
+ response_data = self.api_client.call_api(
1400
+ *_param,
1401
+ _request_timeout=_request_timeout
1402
+ )
1403
+ return response_data.response
1404
+
1405
+
1406
+ def _fetch_ohlcv_serialize(
1407
+ self,
1408
+ exchange,
1409
+ fetch_ohlcv_request,
1410
+ _request_auth,
1411
+ _content_type,
1412
+ _headers,
1413
+ _host_index,
1414
+ ) -> RequestSerialized:
1415
+
1416
+ _host = None
1417
+
1418
+ _collection_formats: Dict[str, str] = {
1419
+ }
1420
+
1421
+ _path_params: Dict[str, str] = {}
1422
+ _query_params: List[Tuple[str, str]] = []
1423
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1424
+ _form_params: List[Tuple[str, str]] = []
1425
+ _files: Dict[
1426
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1427
+ ] = {}
1428
+ _body_params: Optional[bytes] = None
1429
+
1430
+ # process the path parameters
1431
+ if exchange is not None:
1432
+ _path_params['exchange'] = exchange
1433
+ # process the query parameters
1434
+ # process the header parameters
1435
+ # process the form parameters
1436
+ # process the body parameter
1437
+ if fetch_ohlcv_request is not None:
1438
+ _body_params = fetch_ohlcv_request
1439
+
1440
+
1441
+ # set the HTTP header `Accept`
1442
+ if 'Accept' not in _header_params:
1443
+ _header_params['Accept'] = self.api_client.select_header_accept(
1444
+ [
1445
+ 'application/json'
1446
+ ]
1447
+ )
1448
+
1449
+ # set the HTTP header `Content-Type`
1450
+ if _content_type:
1451
+ _header_params['Content-Type'] = _content_type
1452
+ else:
1453
+ _default_content_type = (
1454
+ self.api_client.select_header_content_type(
1455
+ [
1456
+ 'application/json'
1457
+ ]
1458
+ )
1459
+ )
1460
+ if _default_content_type is not None:
1461
+ _header_params['Content-Type'] = _default_content_type
1462
+
1463
+ # authentication setting
1464
+ _auth_settings: List[str] = [
1465
+ ]
1466
+
1467
+ return self.api_client.param_serialize(
1468
+ method='POST',
1469
+ resource_path='/api/{exchange}/fetchOHLCV',
1470
+ path_params=_path_params,
1471
+ query_params=_query_params,
1472
+ header_params=_header_params,
1473
+ body=_body_params,
1474
+ post_params=_form_params,
1475
+ files=_files,
1476
+ auth_settings=_auth_settings,
1477
+ collection_formats=_collection_formats,
1478
+ _host=_host,
1479
+ _request_auth=_request_auth
1480
+ )
1481
+
1482
+
1483
+
1484
+
1485
+ @validate_call
1486
+ def fetch_open_orders(
1487
+ self,
1488
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
1489
+ fetch_open_orders_request: Optional[FetchOpenOrdersRequest] = None,
1490
+ _request_timeout: Union[
1491
+ None,
1492
+ Annotated[StrictFloat, Field(gt=0)],
1493
+ Tuple[
1494
+ Annotated[StrictFloat, Field(gt=0)],
1495
+ Annotated[StrictFloat, Field(gt=0)]
1496
+ ]
1497
+ ] = None,
1498
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1499
+ _content_type: Optional[StrictStr] = None,
1500
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1501
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1502
+ ) -> FetchOpenOrders200Response:
1503
+ """Fetch Open Orders
1504
+
1505
+
1506
+ :param exchange: The prediction market exchange to target. (required)
1507
+ :type exchange: str
1508
+ :param fetch_open_orders_request:
1509
+ :type fetch_open_orders_request: FetchOpenOrdersRequest
1510
+ :param _request_timeout: timeout setting for this request. If one
1511
+ number provided, it will be total request
1512
+ timeout. It can also be a pair (tuple) of
1513
+ (connection, read) timeouts.
1514
+ :type _request_timeout: int, tuple(int, int), optional
1515
+ :param _request_auth: set to override the auth_settings for an a single
1516
+ request; this effectively ignores the
1517
+ authentication in the spec for a single request.
1518
+ :type _request_auth: dict, optional
1519
+ :param _content_type: force content-type for the request.
1520
+ :type _content_type: str, Optional
1521
+ :param _headers: set to override the headers for a single
1522
+ request; this effectively ignores the headers
1523
+ in the spec for a single request.
1524
+ :type _headers: dict, optional
1525
+ :param _host_index: set to override the host_index for a single
1526
+ request; this effectively ignores the host_index
1527
+ in the spec for a single request.
1528
+ :type _host_index: int, optional
1529
+ :return: Returns the result object.
1530
+ """ # noqa: E501
1531
+
1532
+ _param = self._fetch_open_orders_serialize(
1533
+ exchange=exchange,
1534
+ fetch_open_orders_request=fetch_open_orders_request,
1535
+ _request_auth=_request_auth,
1536
+ _content_type=_content_type,
1537
+ _headers=_headers,
1538
+ _host_index=_host_index
1539
+ )
1540
+
1541
+ _response_types_map: Dict[str, Optional[str]] = {
1542
+ '200': "FetchOpenOrders200Response",
1543
+ }
1544
+ response_data = self.api_client.call_api(
1545
+ *_param,
1546
+ _request_timeout=_request_timeout
1547
+ )
1548
+ response_data.read()
1549
+ return self.api_client.response_deserialize(
1550
+ response_data=response_data,
1551
+ response_types_map=_response_types_map,
1552
+ ).data
1553
+
1554
+
1555
+ @validate_call
1556
+ def fetch_open_orders_with_http_info(
1557
+ self,
1558
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
1559
+ fetch_open_orders_request: Optional[FetchOpenOrdersRequest] = None,
1560
+ _request_timeout: Union[
1561
+ None,
1562
+ Annotated[StrictFloat, Field(gt=0)],
1563
+ Tuple[
1564
+ Annotated[StrictFloat, Field(gt=0)],
1565
+ Annotated[StrictFloat, Field(gt=0)]
1566
+ ]
1567
+ ] = None,
1568
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1569
+ _content_type: Optional[StrictStr] = None,
1570
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1571
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1572
+ ) -> ApiResponse[FetchOpenOrders200Response]:
1573
+ """Fetch Open Orders
1574
+
1575
+
1576
+ :param exchange: The prediction market exchange to target. (required)
1577
+ :type exchange: str
1578
+ :param fetch_open_orders_request:
1579
+ :type fetch_open_orders_request: FetchOpenOrdersRequest
1580
+ :param _request_timeout: timeout setting for this request. If one
1581
+ number provided, it will be total request
1582
+ timeout. It can also be a pair (tuple) of
1583
+ (connection, read) timeouts.
1584
+ :type _request_timeout: int, tuple(int, int), optional
1585
+ :param _request_auth: set to override the auth_settings for an a single
1586
+ request; this effectively ignores the
1587
+ authentication in the spec for a single request.
1588
+ :type _request_auth: dict, optional
1589
+ :param _content_type: force content-type for the request.
1590
+ :type _content_type: str, Optional
1591
+ :param _headers: set to override the headers for a single
1592
+ request; this effectively ignores the headers
1593
+ in the spec for a single request.
1594
+ :type _headers: dict, optional
1595
+ :param _host_index: set to override the host_index for a single
1596
+ request; this effectively ignores the host_index
1597
+ in the spec for a single request.
1598
+ :type _host_index: int, optional
1599
+ :return: Returns the result object.
1600
+ """ # noqa: E501
1601
+
1602
+ _param = self._fetch_open_orders_serialize(
1603
+ exchange=exchange,
1604
+ fetch_open_orders_request=fetch_open_orders_request,
1605
+ _request_auth=_request_auth,
1606
+ _content_type=_content_type,
1607
+ _headers=_headers,
1608
+ _host_index=_host_index
1609
+ )
1610
+
1611
+ _response_types_map: Dict[str, Optional[str]] = {
1612
+ '200': "FetchOpenOrders200Response",
1613
+ }
1614
+ response_data = self.api_client.call_api(
1615
+ *_param,
1616
+ _request_timeout=_request_timeout
1617
+ )
1618
+ response_data.read()
1619
+ return self.api_client.response_deserialize(
1620
+ response_data=response_data,
1621
+ response_types_map=_response_types_map,
1622
+ )
1623
+
1624
+
1625
+ @validate_call
1626
+ def fetch_open_orders_without_preload_content(
1627
+ self,
1628
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
1629
+ fetch_open_orders_request: Optional[FetchOpenOrdersRequest] = None,
1630
+ _request_timeout: Union[
1631
+ None,
1632
+ Annotated[StrictFloat, Field(gt=0)],
1633
+ Tuple[
1634
+ Annotated[StrictFloat, Field(gt=0)],
1635
+ Annotated[StrictFloat, Field(gt=0)]
1636
+ ]
1637
+ ] = None,
1638
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1639
+ _content_type: Optional[StrictStr] = None,
1640
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1641
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1642
+ ) -> RESTResponseType:
1643
+ """Fetch Open Orders
1644
+
1645
+
1646
+ :param exchange: The prediction market exchange to target. (required)
1647
+ :type exchange: str
1648
+ :param fetch_open_orders_request:
1649
+ :type fetch_open_orders_request: FetchOpenOrdersRequest
1650
+ :param _request_timeout: timeout setting for this request. If one
1651
+ number provided, it will be total request
1652
+ timeout. It can also be a pair (tuple) of
1653
+ (connection, read) timeouts.
1654
+ :type _request_timeout: int, tuple(int, int), optional
1655
+ :param _request_auth: set to override the auth_settings for an a single
1656
+ request; this effectively ignores the
1657
+ authentication in the spec for a single request.
1658
+ :type _request_auth: dict, optional
1659
+ :param _content_type: force content-type for the request.
1660
+ :type _content_type: str, Optional
1661
+ :param _headers: set to override the headers for a single
1662
+ request; this effectively ignores the headers
1663
+ in the spec for a single request.
1664
+ :type _headers: dict, optional
1665
+ :param _host_index: set to override the host_index for a single
1666
+ request; this effectively ignores the host_index
1667
+ in the spec for a single request.
1668
+ :type _host_index: int, optional
1669
+ :return: Returns the result object.
1670
+ """ # noqa: E501
1671
+
1672
+ _param = self._fetch_open_orders_serialize(
1673
+ exchange=exchange,
1674
+ fetch_open_orders_request=fetch_open_orders_request,
1675
+ _request_auth=_request_auth,
1676
+ _content_type=_content_type,
1677
+ _headers=_headers,
1678
+ _host_index=_host_index
1679
+ )
1680
+
1681
+ _response_types_map: Dict[str, Optional[str]] = {
1682
+ '200': "FetchOpenOrders200Response",
1683
+ }
1684
+ response_data = self.api_client.call_api(
1685
+ *_param,
1686
+ _request_timeout=_request_timeout
1687
+ )
1688
+ return response_data.response
1689
+
1690
+
1691
+ def _fetch_open_orders_serialize(
1692
+ self,
1693
+ exchange,
1694
+ fetch_open_orders_request,
1695
+ _request_auth,
1696
+ _content_type,
1697
+ _headers,
1698
+ _host_index,
1699
+ ) -> RequestSerialized:
1700
+
1701
+ _host = None
1702
+
1703
+ _collection_formats: Dict[str, str] = {
1704
+ }
1705
+
1706
+ _path_params: Dict[str, str] = {}
1707
+ _query_params: List[Tuple[str, str]] = []
1708
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1709
+ _form_params: List[Tuple[str, str]] = []
1710
+ _files: Dict[
1711
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1712
+ ] = {}
1713
+ _body_params: Optional[bytes] = None
1714
+
1715
+ # process the path parameters
1716
+ if exchange is not None:
1717
+ _path_params['exchange'] = exchange
1718
+ # process the query parameters
1719
+ # process the header parameters
1720
+ # process the form parameters
1721
+ # process the body parameter
1722
+ if fetch_open_orders_request is not None:
1723
+ _body_params = fetch_open_orders_request
1724
+
1725
+
1726
+ # set the HTTP header `Accept`
1727
+ if 'Accept' not in _header_params:
1728
+ _header_params['Accept'] = self.api_client.select_header_accept(
1729
+ [
1730
+ 'application/json'
1731
+ ]
1732
+ )
1733
+
1734
+ # set the HTTP header `Content-Type`
1735
+ if _content_type:
1736
+ _header_params['Content-Type'] = _content_type
1737
+ else:
1738
+ _default_content_type = (
1739
+ self.api_client.select_header_content_type(
1740
+ [
1741
+ 'application/json'
1742
+ ]
1743
+ )
1744
+ )
1745
+ if _default_content_type is not None:
1746
+ _header_params['Content-Type'] = _default_content_type
1747
+
1748
+ # authentication setting
1749
+ _auth_settings: List[str] = [
1750
+ ]
1751
+
1752
+ return self.api_client.param_serialize(
1753
+ method='POST',
1754
+ resource_path='/api/{exchange}/fetchOpenOrders',
1755
+ path_params=_path_params,
1756
+ query_params=_query_params,
1757
+ header_params=_header_params,
1758
+ body=_body_params,
1759
+ post_params=_form_params,
1760
+ files=_files,
1761
+ auth_settings=_auth_settings,
1762
+ collection_formats=_collection_formats,
1763
+ _host=_host,
1764
+ _request_auth=_request_auth
1765
+ )
1766
+
1767
+
1768
+
1769
+
1770
+ @validate_call
1771
+ def fetch_order(
1772
+ self,
1773
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
1774
+ cancel_order_request: Optional[CancelOrderRequest] = None,
1775
+ _request_timeout: Union[
1776
+ None,
1777
+ Annotated[StrictFloat, Field(gt=0)],
1778
+ Tuple[
1779
+ Annotated[StrictFloat, Field(gt=0)],
1780
+ Annotated[StrictFloat, Field(gt=0)]
1781
+ ]
1782
+ ] = None,
1783
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1784
+ _content_type: Optional[StrictStr] = None,
1785
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1786
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1787
+ ) -> CreateOrder200Response:
1788
+ """Fetch Order
1789
+
1790
+
1791
+ :param exchange: The prediction market exchange to target. (required)
1792
+ :type exchange: str
1793
+ :param cancel_order_request:
1794
+ :type cancel_order_request: CancelOrderRequest
1795
+ :param _request_timeout: timeout setting for this request. If one
1796
+ number provided, it will be total request
1797
+ timeout. It can also be a pair (tuple) of
1798
+ (connection, read) timeouts.
1799
+ :type _request_timeout: int, tuple(int, int), optional
1800
+ :param _request_auth: set to override the auth_settings for an a single
1801
+ request; this effectively ignores the
1802
+ authentication in the spec for a single request.
1803
+ :type _request_auth: dict, optional
1804
+ :param _content_type: force content-type for the request.
1805
+ :type _content_type: str, Optional
1806
+ :param _headers: set to override the headers for a single
1807
+ request; this effectively ignores the headers
1808
+ in the spec for a single request.
1809
+ :type _headers: dict, optional
1810
+ :param _host_index: set to override the host_index for a single
1811
+ request; this effectively ignores the host_index
1812
+ in the spec for a single request.
1813
+ :type _host_index: int, optional
1814
+ :return: Returns the result object.
1815
+ """ # noqa: E501
1816
+
1817
+ _param = self._fetch_order_serialize(
1818
+ exchange=exchange,
1819
+ cancel_order_request=cancel_order_request,
1820
+ _request_auth=_request_auth,
1821
+ _content_type=_content_type,
1822
+ _headers=_headers,
1823
+ _host_index=_host_index
1824
+ )
1825
+
1826
+ _response_types_map: Dict[str, Optional[str]] = {
1827
+ '200': "CreateOrder200Response",
1828
+ }
1829
+ response_data = self.api_client.call_api(
1830
+ *_param,
1831
+ _request_timeout=_request_timeout
1832
+ )
1833
+ response_data.read()
1834
+ return self.api_client.response_deserialize(
1835
+ response_data=response_data,
1836
+ response_types_map=_response_types_map,
1837
+ ).data
1838
+
1839
+
1840
+ @validate_call
1841
+ def fetch_order_with_http_info(
1842
+ self,
1843
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
1844
+ cancel_order_request: Optional[CancelOrderRequest] = None,
1845
+ _request_timeout: Union[
1846
+ None,
1847
+ Annotated[StrictFloat, Field(gt=0)],
1848
+ Tuple[
1849
+ Annotated[StrictFloat, Field(gt=0)],
1850
+ Annotated[StrictFloat, Field(gt=0)]
1851
+ ]
1852
+ ] = None,
1853
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1854
+ _content_type: Optional[StrictStr] = None,
1855
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1856
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1857
+ ) -> ApiResponse[CreateOrder200Response]:
1858
+ """Fetch Order
1859
+
1860
+
1861
+ :param exchange: The prediction market exchange to target. (required)
1862
+ :type exchange: str
1863
+ :param cancel_order_request:
1864
+ :type cancel_order_request: CancelOrderRequest
1865
+ :param _request_timeout: timeout setting for this request. If one
1866
+ number provided, it will be total request
1867
+ timeout. It can also be a pair (tuple) of
1868
+ (connection, read) timeouts.
1869
+ :type _request_timeout: int, tuple(int, int), optional
1870
+ :param _request_auth: set to override the auth_settings for an a single
1871
+ request; this effectively ignores the
1872
+ authentication in the spec for a single request.
1873
+ :type _request_auth: dict, optional
1874
+ :param _content_type: force content-type for the request.
1875
+ :type _content_type: str, Optional
1876
+ :param _headers: set to override the headers for a single
1877
+ request; this effectively ignores the headers
1878
+ in the spec for a single request.
1879
+ :type _headers: dict, optional
1880
+ :param _host_index: set to override the host_index for a single
1881
+ request; this effectively ignores the host_index
1882
+ in the spec for a single request.
1883
+ :type _host_index: int, optional
1884
+ :return: Returns the result object.
1885
+ """ # noqa: E501
1886
+
1887
+ _param = self._fetch_order_serialize(
1888
+ exchange=exchange,
1889
+ cancel_order_request=cancel_order_request,
1890
+ _request_auth=_request_auth,
1891
+ _content_type=_content_type,
1892
+ _headers=_headers,
1893
+ _host_index=_host_index
1894
+ )
1895
+
1896
+ _response_types_map: Dict[str, Optional[str]] = {
1897
+ '200': "CreateOrder200Response",
1898
+ }
1899
+ response_data = self.api_client.call_api(
1900
+ *_param,
1901
+ _request_timeout=_request_timeout
1902
+ )
1903
+ response_data.read()
1904
+ return self.api_client.response_deserialize(
1905
+ response_data=response_data,
1906
+ response_types_map=_response_types_map,
1907
+ )
1908
+
1909
+
1910
+ @validate_call
1911
+ def fetch_order_without_preload_content(
1912
+ self,
1913
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
1914
+ cancel_order_request: Optional[CancelOrderRequest] = None,
1915
+ _request_timeout: Union[
1916
+ None,
1917
+ Annotated[StrictFloat, Field(gt=0)],
1918
+ Tuple[
1919
+ Annotated[StrictFloat, Field(gt=0)],
1920
+ Annotated[StrictFloat, Field(gt=0)]
1921
+ ]
1922
+ ] = None,
1923
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1924
+ _content_type: Optional[StrictStr] = None,
1925
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1926
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1927
+ ) -> RESTResponseType:
1928
+ """Fetch Order
1929
+
1930
+
1931
+ :param exchange: The prediction market exchange to target. (required)
1932
+ :type exchange: str
1933
+ :param cancel_order_request:
1934
+ :type cancel_order_request: CancelOrderRequest
1935
+ :param _request_timeout: timeout setting for this request. If one
1936
+ number provided, it will be total request
1937
+ timeout. It can also be a pair (tuple) of
1938
+ (connection, read) timeouts.
1939
+ :type _request_timeout: int, tuple(int, int), optional
1940
+ :param _request_auth: set to override the auth_settings for an a single
1941
+ request; this effectively ignores the
1942
+ authentication in the spec for a single request.
1943
+ :type _request_auth: dict, optional
1944
+ :param _content_type: force content-type for the request.
1945
+ :type _content_type: str, Optional
1946
+ :param _headers: set to override the headers for a single
1947
+ request; this effectively ignores the headers
1948
+ in the spec for a single request.
1949
+ :type _headers: dict, optional
1950
+ :param _host_index: set to override the host_index for a single
1951
+ request; this effectively ignores the host_index
1952
+ in the spec for a single request.
1953
+ :type _host_index: int, optional
1954
+ :return: Returns the result object.
1955
+ """ # noqa: E501
1956
+
1957
+ _param = self._fetch_order_serialize(
1958
+ exchange=exchange,
1959
+ cancel_order_request=cancel_order_request,
1960
+ _request_auth=_request_auth,
1961
+ _content_type=_content_type,
1962
+ _headers=_headers,
1963
+ _host_index=_host_index
1964
+ )
1965
+
1966
+ _response_types_map: Dict[str, Optional[str]] = {
1967
+ '200': "CreateOrder200Response",
1968
+ }
1969
+ response_data = self.api_client.call_api(
1970
+ *_param,
1971
+ _request_timeout=_request_timeout
1972
+ )
1973
+ return response_data.response
1974
+
1975
+
1976
+ def _fetch_order_serialize(
1977
+ self,
1978
+ exchange,
1979
+ cancel_order_request,
1980
+ _request_auth,
1981
+ _content_type,
1982
+ _headers,
1983
+ _host_index,
1984
+ ) -> RequestSerialized:
1985
+
1986
+ _host = None
1987
+
1988
+ _collection_formats: Dict[str, str] = {
1989
+ }
1990
+
1991
+ _path_params: Dict[str, str] = {}
1992
+ _query_params: List[Tuple[str, str]] = []
1993
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1994
+ _form_params: List[Tuple[str, str]] = []
1995
+ _files: Dict[
1996
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1997
+ ] = {}
1998
+ _body_params: Optional[bytes] = None
1999
+
2000
+ # process the path parameters
2001
+ if exchange is not None:
2002
+ _path_params['exchange'] = exchange
2003
+ # process the query parameters
2004
+ # process the header parameters
2005
+ # process the form parameters
2006
+ # process the body parameter
2007
+ if cancel_order_request is not None:
2008
+ _body_params = cancel_order_request
2009
+
2010
+
2011
+ # set the HTTP header `Accept`
2012
+ if 'Accept' not in _header_params:
2013
+ _header_params['Accept'] = self.api_client.select_header_accept(
2014
+ [
2015
+ 'application/json'
2016
+ ]
2017
+ )
2018
+
2019
+ # set the HTTP header `Content-Type`
2020
+ if _content_type:
2021
+ _header_params['Content-Type'] = _content_type
2022
+ else:
2023
+ _default_content_type = (
2024
+ self.api_client.select_header_content_type(
2025
+ [
2026
+ 'application/json'
2027
+ ]
2028
+ )
2029
+ )
2030
+ if _default_content_type is not None:
2031
+ _header_params['Content-Type'] = _default_content_type
2032
+
2033
+ # authentication setting
2034
+ _auth_settings: List[str] = [
2035
+ ]
2036
+
2037
+ return self.api_client.param_serialize(
2038
+ method='POST',
2039
+ resource_path='/api/{exchange}/fetchOrder',
2040
+ path_params=_path_params,
2041
+ query_params=_query_params,
2042
+ header_params=_header_params,
2043
+ body=_body_params,
2044
+ post_params=_form_params,
2045
+ files=_files,
2046
+ auth_settings=_auth_settings,
2047
+ collection_formats=_collection_formats,
2048
+ _host=_host,
2049
+ _request_auth=_request_auth
2050
+ )
2051
+
2052
+
2053
+
2054
+
2055
+ @validate_call
2056
+ def fetch_order_book(
2057
+ self,
2058
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
2059
+ fetch_order_book_request: Optional[FetchOrderBookRequest] = None,
2060
+ _request_timeout: Union[
2061
+ None,
2062
+ Annotated[StrictFloat, Field(gt=0)],
2063
+ Tuple[
2064
+ Annotated[StrictFloat, Field(gt=0)],
2065
+ Annotated[StrictFloat, Field(gt=0)]
2066
+ ]
2067
+ ] = None,
2068
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2069
+ _content_type: Optional[StrictStr] = None,
2070
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2071
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2072
+ ) -> FetchOrderBook200Response:
2073
+ """Fetch Order Book
2074
+
2075
+
2076
+ :param exchange: The prediction market exchange to target. (required)
2077
+ :type exchange: str
2078
+ :param fetch_order_book_request:
2079
+ :type fetch_order_book_request: FetchOrderBookRequest
2080
+ :param _request_timeout: timeout setting for this request. If one
2081
+ number provided, it will be total request
2082
+ timeout. It can also be a pair (tuple) of
2083
+ (connection, read) timeouts.
2084
+ :type _request_timeout: int, tuple(int, int), optional
2085
+ :param _request_auth: set to override the auth_settings for an a single
2086
+ request; this effectively ignores the
2087
+ authentication in the spec for a single request.
2088
+ :type _request_auth: dict, optional
2089
+ :param _content_type: force content-type for the request.
2090
+ :type _content_type: str, Optional
2091
+ :param _headers: set to override the headers for a single
2092
+ request; this effectively ignores the headers
2093
+ in the spec for a single request.
2094
+ :type _headers: dict, optional
2095
+ :param _host_index: set to override the host_index for a single
2096
+ request; this effectively ignores the host_index
2097
+ in the spec for a single request.
2098
+ :type _host_index: int, optional
2099
+ :return: Returns the result object.
2100
+ """ # noqa: E501
2101
+
2102
+ _param = self._fetch_order_book_serialize(
2103
+ exchange=exchange,
2104
+ fetch_order_book_request=fetch_order_book_request,
2105
+ _request_auth=_request_auth,
2106
+ _content_type=_content_type,
2107
+ _headers=_headers,
2108
+ _host_index=_host_index
2109
+ )
2110
+
2111
+ _response_types_map: Dict[str, Optional[str]] = {
2112
+ '200': "FetchOrderBook200Response",
2113
+ }
2114
+ response_data = self.api_client.call_api(
2115
+ *_param,
2116
+ _request_timeout=_request_timeout
2117
+ )
2118
+ response_data.read()
2119
+ return self.api_client.response_deserialize(
2120
+ response_data=response_data,
2121
+ response_types_map=_response_types_map,
2122
+ ).data
2123
+
2124
+
2125
+ @validate_call
2126
+ def fetch_order_book_with_http_info(
2127
+ self,
2128
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
2129
+ fetch_order_book_request: Optional[FetchOrderBookRequest] = None,
2130
+ _request_timeout: Union[
2131
+ None,
2132
+ Annotated[StrictFloat, Field(gt=0)],
2133
+ Tuple[
2134
+ Annotated[StrictFloat, Field(gt=0)],
2135
+ Annotated[StrictFloat, Field(gt=0)]
2136
+ ]
2137
+ ] = None,
2138
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2139
+ _content_type: Optional[StrictStr] = None,
2140
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2141
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2142
+ ) -> ApiResponse[FetchOrderBook200Response]:
2143
+ """Fetch Order Book
2144
+
2145
+
2146
+ :param exchange: The prediction market exchange to target. (required)
2147
+ :type exchange: str
2148
+ :param fetch_order_book_request:
2149
+ :type fetch_order_book_request: FetchOrderBookRequest
2150
+ :param _request_timeout: timeout setting for this request. If one
2151
+ number provided, it will be total request
2152
+ timeout. It can also be a pair (tuple) of
2153
+ (connection, read) timeouts.
2154
+ :type _request_timeout: int, tuple(int, int), optional
2155
+ :param _request_auth: set to override the auth_settings for an a single
2156
+ request; this effectively ignores the
2157
+ authentication in the spec for a single request.
2158
+ :type _request_auth: dict, optional
2159
+ :param _content_type: force content-type for the request.
2160
+ :type _content_type: str, Optional
2161
+ :param _headers: set to override the headers for a single
2162
+ request; this effectively ignores the headers
2163
+ in the spec for a single request.
2164
+ :type _headers: dict, optional
2165
+ :param _host_index: set to override the host_index for a single
2166
+ request; this effectively ignores the host_index
2167
+ in the spec for a single request.
2168
+ :type _host_index: int, optional
2169
+ :return: Returns the result object.
2170
+ """ # noqa: E501
2171
+
2172
+ _param = self._fetch_order_book_serialize(
2173
+ exchange=exchange,
2174
+ fetch_order_book_request=fetch_order_book_request,
2175
+ _request_auth=_request_auth,
2176
+ _content_type=_content_type,
2177
+ _headers=_headers,
2178
+ _host_index=_host_index
2179
+ )
2180
+
2181
+ _response_types_map: Dict[str, Optional[str]] = {
2182
+ '200': "FetchOrderBook200Response",
2183
+ }
2184
+ response_data = self.api_client.call_api(
2185
+ *_param,
2186
+ _request_timeout=_request_timeout
2187
+ )
2188
+ response_data.read()
2189
+ return self.api_client.response_deserialize(
2190
+ response_data=response_data,
2191
+ response_types_map=_response_types_map,
2192
+ )
2193
+
2194
+
2195
+ @validate_call
2196
+ def fetch_order_book_without_preload_content(
2197
+ self,
2198
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
2199
+ fetch_order_book_request: Optional[FetchOrderBookRequest] = None,
2200
+ _request_timeout: Union[
2201
+ None,
2202
+ Annotated[StrictFloat, Field(gt=0)],
2203
+ Tuple[
2204
+ Annotated[StrictFloat, Field(gt=0)],
2205
+ Annotated[StrictFloat, Field(gt=0)]
2206
+ ]
2207
+ ] = None,
2208
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2209
+ _content_type: Optional[StrictStr] = None,
2210
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2211
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2212
+ ) -> RESTResponseType:
2213
+ """Fetch Order Book
2214
+
2215
+
2216
+ :param exchange: The prediction market exchange to target. (required)
2217
+ :type exchange: str
2218
+ :param fetch_order_book_request:
2219
+ :type fetch_order_book_request: FetchOrderBookRequest
2220
+ :param _request_timeout: timeout setting for this request. If one
2221
+ number provided, it will be total request
2222
+ timeout. It can also be a pair (tuple) of
2223
+ (connection, read) timeouts.
2224
+ :type _request_timeout: int, tuple(int, int), optional
2225
+ :param _request_auth: set to override the auth_settings for an a single
2226
+ request; this effectively ignores the
2227
+ authentication in the spec for a single request.
2228
+ :type _request_auth: dict, optional
2229
+ :param _content_type: force content-type for the request.
2230
+ :type _content_type: str, Optional
2231
+ :param _headers: set to override the headers for a single
2232
+ request; this effectively ignores the headers
2233
+ in the spec for a single request.
2234
+ :type _headers: dict, optional
2235
+ :param _host_index: set to override the host_index for a single
2236
+ request; this effectively ignores the host_index
2237
+ in the spec for a single request.
2238
+ :type _host_index: int, optional
2239
+ :return: Returns the result object.
2240
+ """ # noqa: E501
2241
+
2242
+ _param = self._fetch_order_book_serialize(
2243
+ exchange=exchange,
2244
+ fetch_order_book_request=fetch_order_book_request,
2245
+ _request_auth=_request_auth,
2246
+ _content_type=_content_type,
2247
+ _headers=_headers,
2248
+ _host_index=_host_index
2249
+ )
2250
+
2251
+ _response_types_map: Dict[str, Optional[str]] = {
2252
+ '200': "FetchOrderBook200Response",
2253
+ }
2254
+ response_data = self.api_client.call_api(
2255
+ *_param,
2256
+ _request_timeout=_request_timeout
2257
+ )
2258
+ return response_data.response
2259
+
2260
+
2261
+ def _fetch_order_book_serialize(
2262
+ self,
2263
+ exchange,
2264
+ fetch_order_book_request,
2265
+ _request_auth,
2266
+ _content_type,
2267
+ _headers,
2268
+ _host_index,
2269
+ ) -> RequestSerialized:
2270
+
2271
+ _host = None
2272
+
2273
+ _collection_formats: Dict[str, str] = {
2274
+ }
2275
+
2276
+ _path_params: Dict[str, str] = {}
2277
+ _query_params: List[Tuple[str, str]] = []
2278
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2279
+ _form_params: List[Tuple[str, str]] = []
2280
+ _files: Dict[
2281
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2282
+ ] = {}
2283
+ _body_params: Optional[bytes] = None
2284
+
2285
+ # process the path parameters
2286
+ if exchange is not None:
2287
+ _path_params['exchange'] = exchange
2288
+ # process the query parameters
2289
+ # process the header parameters
2290
+ # process the form parameters
2291
+ # process the body parameter
2292
+ if fetch_order_book_request is not None:
2293
+ _body_params = fetch_order_book_request
2294
+
2295
+
2296
+ # set the HTTP header `Accept`
2297
+ if 'Accept' not in _header_params:
2298
+ _header_params['Accept'] = self.api_client.select_header_accept(
2299
+ [
2300
+ 'application/json'
2301
+ ]
2302
+ )
2303
+
2304
+ # set the HTTP header `Content-Type`
2305
+ if _content_type:
2306
+ _header_params['Content-Type'] = _content_type
2307
+ else:
2308
+ _default_content_type = (
2309
+ self.api_client.select_header_content_type(
2310
+ [
2311
+ 'application/json'
2312
+ ]
2313
+ )
2314
+ )
2315
+ if _default_content_type is not None:
2316
+ _header_params['Content-Type'] = _default_content_type
2317
+
2318
+ # authentication setting
2319
+ _auth_settings: List[str] = [
2320
+ ]
2321
+
2322
+ return self.api_client.param_serialize(
2323
+ method='POST',
2324
+ resource_path='/api/{exchange}/fetchOrderBook',
2325
+ path_params=_path_params,
2326
+ query_params=_query_params,
2327
+ header_params=_header_params,
2328
+ body=_body_params,
2329
+ post_params=_form_params,
2330
+ files=_files,
2331
+ auth_settings=_auth_settings,
2332
+ collection_formats=_collection_formats,
2333
+ _host=_host,
2334
+ _request_auth=_request_auth
2335
+ )
2336
+
2337
+
2338
+
2339
+
2340
+ @validate_call
2341
+ def fetch_positions(
2342
+ self,
2343
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
2344
+ fetch_positions_request: Optional[FetchPositionsRequest] = None,
2345
+ _request_timeout: Union[
2346
+ None,
2347
+ Annotated[StrictFloat, Field(gt=0)],
2348
+ Tuple[
2349
+ Annotated[StrictFloat, Field(gt=0)],
2350
+ Annotated[StrictFloat, Field(gt=0)]
2351
+ ]
2352
+ ] = None,
2353
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2354
+ _content_type: Optional[StrictStr] = None,
2355
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2356
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2357
+ ) -> FetchPositions200Response:
2358
+ """Fetch Positions
2359
+
2360
+
2361
+ :param exchange: The prediction market exchange to target. (required)
2362
+ :type exchange: str
2363
+ :param fetch_positions_request:
2364
+ :type fetch_positions_request: FetchPositionsRequest
2365
+ :param _request_timeout: timeout setting for this request. If one
2366
+ number provided, it will be total request
2367
+ timeout. It can also be a pair (tuple) of
2368
+ (connection, read) timeouts.
2369
+ :type _request_timeout: int, tuple(int, int), optional
2370
+ :param _request_auth: set to override the auth_settings for an a single
2371
+ request; this effectively ignores the
2372
+ authentication in the spec for a single request.
2373
+ :type _request_auth: dict, optional
2374
+ :param _content_type: force content-type for the request.
2375
+ :type _content_type: str, Optional
2376
+ :param _headers: set to override the headers for a single
2377
+ request; this effectively ignores the headers
2378
+ in the spec for a single request.
2379
+ :type _headers: dict, optional
2380
+ :param _host_index: set to override the host_index for a single
2381
+ request; this effectively ignores the host_index
2382
+ in the spec for a single request.
2383
+ :type _host_index: int, optional
2384
+ :return: Returns the result object.
2385
+ """ # noqa: E501
2386
+
2387
+ _param = self._fetch_positions_serialize(
2388
+ exchange=exchange,
2389
+ fetch_positions_request=fetch_positions_request,
2390
+ _request_auth=_request_auth,
2391
+ _content_type=_content_type,
2392
+ _headers=_headers,
2393
+ _host_index=_host_index
2394
+ )
2395
+
2396
+ _response_types_map: Dict[str, Optional[str]] = {
2397
+ '200': "FetchPositions200Response",
2398
+ }
2399
+ response_data = self.api_client.call_api(
2400
+ *_param,
2401
+ _request_timeout=_request_timeout
2402
+ )
2403
+ response_data.read()
2404
+ return self.api_client.response_deserialize(
2405
+ response_data=response_data,
2406
+ response_types_map=_response_types_map,
2407
+ ).data
2408
+
2409
+
2410
+ @validate_call
2411
+ def fetch_positions_with_http_info(
2412
+ self,
2413
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
2414
+ fetch_positions_request: Optional[FetchPositionsRequest] = None,
2415
+ _request_timeout: Union[
2416
+ None,
2417
+ Annotated[StrictFloat, Field(gt=0)],
2418
+ Tuple[
2419
+ Annotated[StrictFloat, Field(gt=0)],
2420
+ Annotated[StrictFloat, Field(gt=0)]
2421
+ ]
2422
+ ] = None,
2423
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2424
+ _content_type: Optional[StrictStr] = None,
2425
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2426
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2427
+ ) -> ApiResponse[FetchPositions200Response]:
2428
+ """Fetch Positions
2429
+
2430
+
2431
+ :param exchange: The prediction market exchange to target. (required)
2432
+ :type exchange: str
2433
+ :param fetch_positions_request:
2434
+ :type fetch_positions_request: FetchPositionsRequest
2435
+ :param _request_timeout: timeout setting for this request. If one
2436
+ number provided, it will be total request
2437
+ timeout. It can also be a pair (tuple) of
2438
+ (connection, read) timeouts.
2439
+ :type _request_timeout: int, tuple(int, int), optional
2440
+ :param _request_auth: set to override the auth_settings for an a single
2441
+ request; this effectively ignores the
2442
+ authentication in the spec for a single request.
2443
+ :type _request_auth: dict, optional
2444
+ :param _content_type: force content-type for the request.
2445
+ :type _content_type: str, Optional
2446
+ :param _headers: set to override the headers for a single
2447
+ request; this effectively ignores the headers
2448
+ in the spec for a single request.
2449
+ :type _headers: dict, optional
2450
+ :param _host_index: set to override the host_index for a single
2451
+ request; this effectively ignores the host_index
2452
+ in the spec for a single request.
2453
+ :type _host_index: int, optional
2454
+ :return: Returns the result object.
2455
+ """ # noqa: E501
2456
+
2457
+ _param = self._fetch_positions_serialize(
2458
+ exchange=exchange,
2459
+ fetch_positions_request=fetch_positions_request,
2460
+ _request_auth=_request_auth,
2461
+ _content_type=_content_type,
2462
+ _headers=_headers,
2463
+ _host_index=_host_index
2464
+ )
2465
+
2466
+ _response_types_map: Dict[str, Optional[str]] = {
2467
+ '200': "FetchPositions200Response",
2468
+ }
2469
+ response_data = self.api_client.call_api(
2470
+ *_param,
2471
+ _request_timeout=_request_timeout
2472
+ )
2473
+ response_data.read()
2474
+ return self.api_client.response_deserialize(
2475
+ response_data=response_data,
2476
+ response_types_map=_response_types_map,
2477
+ )
2478
+
2479
+
2480
+ @validate_call
2481
+ def fetch_positions_without_preload_content(
2482
+ self,
2483
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
2484
+ fetch_positions_request: Optional[FetchPositionsRequest] = None,
2485
+ _request_timeout: Union[
2486
+ None,
2487
+ Annotated[StrictFloat, Field(gt=0)],
2488
+ Tuple[
2489
+ Annotated[StrictFloat, Field(gt=0)],
2490
+ Annotated[StrictFloat, Field(gt=0)]
2491
+ ]
2492
+ ] = None,
2493
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2494
+ _content_type: Optional[StrictStr] = None,
2495
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2496
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2497
+ ) -> RESTResponseType:
2498
+ """Fetch Positions
2499
+
2500
+
2501
+ :param exchange: The prediction market exchange to target. (required)
2502
+ :type exchange: str
2503
+ :param fetch_positions_request:
2504
+ :type fetch_positions_request: FetchPositionsRequest
2505
+ :param _request_timeout: timeout setting for this request. If one
2506
+ number provided, it will be total request
2507
+ timeout. It can also be a pair (tuple) of
2508
+ (connection, read) timeouts.
2509
+ :type _request_timeout: int, tuple(int, int), optional
2510
+ :param _request_auth: set to override the auth_settings for an a single
2511
+ request; this effectively ignores the
2512
+ authentication in the spec for a single request.
2513
+ :type _request_auth: dict, optional
2514
+ :param _content_type: force content-type for the request.
2515
+ :type _content_type: str, Optional
2516
+ :param _headers: set to override the headers for a single
2517
+ request; this effectively ignores the headers
2518
+ in the spec for a single request.
2519
+ :type _headers: dict, optional
2520
+ :param _host_index: set to override the host_index for a single
2521
+ request; this effectively ignores the host_index
2522
+ in the spec for a single request.
2523
+ :type _host_index: int, optional
2524
+ :return: Returns the result object.
2525
+ """ # noqa: E501
2526
+
2527
+ _param = self._fetch_positions_serialize(
2528
+ exchange=exchange,
2529
+ fetch_positions_request=fetch_positions_request,
2530
+ _request_auth=_request_auth,
2531
+ _content_type=_content_type,
2532
+ _headers=_headers,
2533
+ _host_index=_host_index
2534
+ )
2535
+
2536
+ _response_types_map: Dict[str, Optional[str]] = {
2537
+ '200': "FetchPositions200Response",
2538
+ }
2539
+ response_data = self.api_client.call_api(
2540
+ *_param,
2541
+ _request_timeout=_request_timeout
2542
+ )
2543
+ return response_data.response
2544
+
2545
+
2546
+ def _fetch_positions_serialize(
2547
+ self,
2548
+ exchange,
2549
+ fetch_positions_request,
2550
+ _request_auth,
2551
+ _content_type,
2552
+ _headers,
2553
+ _host_index,
2554
+ ) -> RequestSerialized:
2555
+
2556
+ _host = None
2557
+
2558
+ _collection_formats: Dict[str, str] = {
2559
+ }
2560
+
2561
+ _path_params: Dict[str, str] = {}
2562
+ _query_params: List[Tuple[str, str]] = []
2563
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2564
+ _form_params: List[Tuple[str, str]] = []
2565
+ _files: Dict[
2566
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2567
+ ] = {}
2568
+ _body_params: Optional[bytes] = None
2569
+
2570
+ # process the path parameters
2571
+ if exchange is not None:
2572
+ _path_params['exchange'] = exchange
2573
+ # process the query parameters
2574
+ # process the header parameters
2575
+ # process the form parameters
2576
+ # process the body parameter
2577
+ if fetch_positions_request is not None:
2578
+ _body_params = fetch_positions_request
2579
+
2580
+
2581
+ # set the HTTP header `Accept`
2582
+ if 'Accept' not in _header_params:
2583
+ _header_params['Accept'] = self.api_client.select_header_accept(
2584
+ [
2585
+ 'application/json'
2586
+ ]
2587
+ )
2588
+
2589
+ # set the HTTP header `Content-Type`
2590
+ if _content_type:
2591
+ _header_params['Content-Type'] = _content_type
2592
+ else:
2593
+ _default_content_type = (
2594
+ self.api_client.select_header_content_type(
2595
+ [
2596
+ 'application/json'
2597
+ ]
2598
+ )
2599
+ )
2600
+ if _default_content_type is not None:
2601
+ _header_params['Content-Type'] = _default_content_type
2602
+
2603
+ # authentication setting
2604
+ _auth_settings: List[str] = [
2605
+ ]
2606
+
2607
+ return self.api_client.param_serialize(
2608
+ method='POST',
2609
+ resource_path='/api/{exchange}/fetchPositions',
2610
+ path_params=_path_params,
2611
+ query_params=_query_params,
2612
+ header_params=_header_params,
2613
+ body=_body_params,
2614
+ post_params=_form_params,
2615
+ files=_files,
2616
+ auth_settings=_auth_settings,
2617
+ collection_formats=_collection_formats,
2618
+ _host=_host,
2619
+ _request_auth=_request_auth
2620
+ )
2621
+
2622
+
2623
+
2624
+
2625
+ @validate_call
2626
+ def fetch_trades(
2627
+ self,
2628
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
2629
+ fetch_trades_request: Optional[FetchTradesRequest] = None,
2630
+ _request_timeout: Union[
2631
+ None,
2632
+ Annotated[StrictFloat, Field(gt=0)],
2633
+ Tuple[
2634
+ Annotated[StrictFloat, Field(gt=0)],
2635
+ Annotated[StrictFloat, Field(gt=0)]
2636
+ ]
2637
+ ] = None,
2638
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2639
+ _content_type: Optional[StrictStr] = None,
2640
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2641
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2642
+ ) -> FetchTrades200Response:
2643
+ """Fetch Trades
2644
+
2645
+
2646
+ :param exchange: The prediction market exchange to target. (required)
2647
+ :type exchange: str
2648
+ :param fetch_trades_request:
2649
+ :type fetch_trades_request: FetchTradesRequest
2650
+ :param _request_timeout: timeout setting for this request. If one
2651
+ number provided, it will be total request
2652
+ timeout. It can also be a pair (tuple) of
2653
+ (connection, read) timeouts.
2654
+ :type _request_timeout: int, tuple(int, int), optional
2655
+ :param _request_auth: set to override the auth_settings for an a single
2656
+ request; this effectively ignores the
2657
+ authentication in the spec for a single request.
2658
+ :type _request_auth: dict, optional
2659
+ :param _content_type: force content-type for the request.
2660
+ :type _content_type: str, Optional
2661
+ :param _headers: set to override the headers for a single
2662
+ request; this effectively ignores the headers
2663
+ in the spec for a single request.
2664
+ :type _headers: dict, optional
2665
+ :param _host_index: set to override the host_index for a single
2666
+ request; this effectively ignores the host_index
2667
+ in the spec for a single request.
2668
+ :type _host_index: int, optional
2669
+ :return: Returns the result object.
2670
+ """ # noqa: E501
2671
+
2672
+ _param = self._fetch_trades_serialize(
2673
+ exchange=exchange,
2674
+ fetch_trades_request=fetch_trades_request,
2675
+ _request_auth=_request_auth,
2676
+ _content_type=_content_type,
2677
+ _headers=_headers,
2678
+ _host_index=_host_index
2679
+ )
2680
+
2681
+ _response_types_map: Dict[str, Optional[str]] = {
2682
+ '200': "FetchTrades200Response",
2683
+ }
2684
+ response_data = self.api_client.call_api(
2685
+ *_param,
2686
+ _request_timeout=_request_timeout
2687
+ )
2688
+ response_data.read()
2689
+ return self.api_client.response_deserialize(
2690
+ response_data=response_data,
2691
+ response_types_map=_response_types_map,
2692
+ ).data
2693
+
2694
+
2695
+ @validate_call
2696
+ def fetch_trades_with_http_info(
2697
+ self,
2698
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
2699
+ fetch_trades_request: Optional[FetchTradesRequest] = None,
2700
+ _request_timeout: Union[
2701
+ None,
2702
+ Annotated[StrictFloat, Field(gt=0)],
2703
+ Tuple[
2704
+ Annotated[StrictFloat, Field(gt=0)],
2705
+ Annotated[StrictFloat, Field(gt=0)]
2706
+ ]
2707
+ ] = None,
2708
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2709
+ _content_type: Optional[StrictStr] = None,
2710
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2711
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2712
+ ) -> ApiResponse[FetchTrades200Response]:
2713
+ """Fetch Trades
2714
+
2715
+
2716
+ :param exchange: The prediction market exchange to target. (required)
2717
+ :type exchange: str
2718
+ :param fetch_trades_request:
2719
+ :type fetch_trades_request: FetchTradesRequest
2720
+ :param _request_timeout: timeout setting for this request. If one
2721
+ number provided, it will be total request
2722
+ timeout. It can also be a pair (tuple) of
2723
+ (connection, read) timeouts.
2724
+ :type _request_timeout: int, tuple(int, int), optional
2725
+ :param _request_auth: set to override the auth_settings for an a single
2726
+ request; this effectively ignores the
2727
+ authentication in the spec for a single request.
2728
+ :type _request_auth: dict, optional
2729
+ :param _content_type: force content-type for the request.
2730
+ :type _content_type: str, Optional
2731
+ :param _headers: set to override the headers for a single
2732
+ request; this effectively ignores the headers
2733
+ in the spec for a single request.
2734
+ :type _headers: dict, optional
2735
+ :param _host_index: set to override the host_index for a single
2736
+ request; this effectively ignores the host_index
2737
+ in the spec for a single request.
2738
+ :type _host_index: int, optional
2739
+ :return: Returns the result object.
2740
+ """ # noqa: E501
2741
+
2742
+ _param = self._fetch_trades_serialize(
2743
+ exchange=exchange,
2744
+ fetch_trades_request=fetch_trades_request,
2745
+ _request_auth=_request_auth,
2746
+ _content_type=_content_type,
2747
+ _headers=_headers,
2748
+ _host_index=_host_index
2749
+ )
2750
+
2751
+ _response_types_map: Dict[str, Optional[str]] = {
2752
+ '200': "FetchTrades200Response",
2753
+ }
2754
+ response_data = self.api_client.call_api(
2755
+ *_param,
2756
+ _request_timeout=_request_timeout
2757
+ )
2758
+ response_data.read()
2759
+ return self.api_client.response_deserialize(
2760
+ response_data=response_data,
2761
+ response_types_map=_response_types_map,
2762
+ )
2763
+
2764
+
2765
+ @validate_call
2766
+ def fetch_trades_without_preload_content(
2767
+ self,
2768
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
2769
+ fetch_trades_request: Optional[FetchTradesRequest] = None,
2770
+ _request_timeout: Union[
2771
+ None,
2772
+ Annotated[StrictFloat, Field(gt=0)],
2773
+ Tuple[
2774
+ Annotated[StrictFloat, Field(gt=0)],
2775
+ Annotated[StrictFloat, Field(gt=0)]
2776
+ ]
2777
+ ] = None,
2778
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2779
+ _content_type: Optional[StrictStr] = None,
2780
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2781
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2782
+ ) -> RESTResponseType:
2783
+ """Fetch Trades
2784
+
2785
+
2786
+ :param exchange: The prediction market exchange to target. (required)
2787
+ :type exchange: str
2788
+ :param fetch_trades_request:
2789
+ :type fetch_trades_request: FetchTradesRequest
2790
+ :param _request_timeout: timeout setting for this request. If one
2791
+ number provided, it will be total request
2792
+ timeout. It can also be a pair (tuple) of
2793
+ (connection, read) timeouts.
2794
+ :type _request_timeout: int, tuple(int, int), optional
2795
+ :param _request_auth: set to override the auth_settings for an a single
2796
+ request; this effectively ignores the
2797
+ authentication in the spec for a single request.
2798
+ :type _request_auth: dict, optional
2799
+ :param _content_type: force content-type for the request.
2800
+ :type _content_type: str, Optional
2801
+ :param _headers: set to override the headers for a single
2802
+ request; this effectively ignores the headers
2803
+ in the spec for a single request.
2804
+ :type _headers: dict, optional
2805
+ :param _host_index: set to override the host_index for a single
2806
+ request; this effectively ignores the host_index
2807
+ in the spec for a single request.
2808
+ :type _host_index: int, optional
2809
+ :return: Returns the result object.
2810
+ """ # noqa: E501
2811
+
2812
+ _param = self._fetch_trades_serialize(
2813
+ exchange=exchange,
2814
+ fetch_trades_request=fetch_trades_request,
2815
+ _request_auth=_request_auth,
2816
+ _content_type=_content_type,
2817
+ _headers=_headers,
2818
+ _host_index=_host_index
2819
+ )
2820
+
2821
+ _response_types_map: Dict[str, Optional[str]] = {
2822
+ '200': "FetchTrades200Response",
2823
+ }
2824
+ response_data = self.api_client.call_api(
2825
+ *_param,
2826
+ _request_timeout=_request_timeout
2827
+ )
2828
+ return response_data.response
2829
+
2830
+
2831
+ def _fetch_trades_serialize(
2832
+ self,
2833
+ exchange,
2834
+ fetch_trades_request,
2835
+ _request_auth,
2836
+ _content_type,
2837
+ _headers,
2838
+ _host_index,
2839
+ ) -> RequestSerialized:
2840
+
2841
+ _host = None
2842
+
2843
+ _collection_formats: Dict[str, str] = {
2844
+ }
2845
+
2846
+ _path_params: Dict[str, str] = {}
2847
+ _query_params: List[Tuple[str, str]] = []
2848
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2849
+ _form_params: List[Tuple[str, str]] = []
2850
+ _files: Dict[
2851
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2852
+ ] = {}
2853
+ _body_params: Optional[bytes] = None
2854
+
2855
+ # process the path parameters
2856
+ if exchange is not None:
2857
+ _path_params['exchange'] = exchange
2858
+ # process the query parameters
2859
+ # process the header parameters
2860
+ # process the form parameters
2861
+ # process the body parameter
2862
+ if fetch_trades_request is not None:
2863
+ _body_params = fetch_trades_request
2864
+
2865
+
2866
+ # set the HTTP header `Accept`
2867
+ if 'Accept' not in _header_params:
2868
+ _header_params['Accept'] = self.api_client.select_header_accept(
2869
+ [
2870
+ 'application/json'
2871
+ ]
2872
+ )
2873
+
2874
+ # set the HTTP header `Content-Type`
2875
+ if _content_type:
2876
+ _header_params['Content-Type'] = _content_type
2877
+ else:
2878
+ _default_content_type = (
2879
+ self.api_client.select_header_content_type(
2880
+ [
2881
+ 'application/json'
2882
+ ]
2883
+ )
2884
+ )
2885
+ if _default_content_type is not None:
2886
+ _header_params['Content-Type'] = _default_content_type
2887
+
2888
+ # authentication setting
2889
+ _auth_settings: List[str] = [
2890
+ ]
2891
+
2892
+ return self.api_client.param_serialize(
2893
+ method='POST',
2894
+ resource_path='/api/{exchange}/fetchTrades',
2895
+ path_params=_path_params,
2896
+ query_params=_query_params,
2897
+ header_params=_header_params,
2898
+ body=_body_params,
2899
+ post_params=_form_params,
2900
+ files=_files,
2901
+ auth_settings=_auth_settings,
2902
+ collection_formats=_collection_formats,
2903
+ _host=_host,
2904
+ _request_auth=_request_auth
2905
+ )
2906
+
2907
+
2908
+
2909
+
2910
+ @validate_call
2911
+ def get_markets_by_slug(
2912
+ self,
2913
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
2914
+ get_markets_by_slug_request: Optional[GetMarketsBySlugRequest] = None,
2915
+ _request_timeout: Union[
2916
+ None,
2917
+ Annotated[StrictFloat, Field(gt=0)],
2918
+ Tuple[
2919
+ Annotated[StrictFloat, Field(gt=0)],
2920
+ Annotated[StrictFloat, Field(gt=0)]
2921
+ ]
2922
+ ] = None,
2923
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2924
+ _content_type: Optional[StrictStr] = None,
2925
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2926
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2927
+ ) -> FetchMarkets200Response:
2928
+ """Get Market by Slug
2929
+
2930
+
2931
+ :param exchange: The prediction market exchange to target. (required)
2932
+ :type exchange: str
2933
+ :param get_markets_by_slug_request:
2934
+ :type get_markets_by_slug_request: GetMarketsBySlugRequest
2935
+ :param _request_timeout: timeout setting for this request. If one
2936
+ number provided, it will be total request
2937
+ timeout. It can also be a pair (tuple) of
2938
+ (connection, read) timeouts.
2939
+ :type _request_timeout: int, tuple(int, int), optional
2940
+ :param _request_auth: set to override the auth_settings for an a single
2941
+ request; this effectively ignores the
2942
+ authentication in the spec for a single request.
2943
+ :type _request_auth: dict, optional
2944
+ :param _content_type: force content-type for the request.
2945
+ :type _content_type: str, Optional
2946
+ :param _headers: set to override the headers for a single
2947
+ request; this effectively ignores the headers
2948
+ in the spec for a single request.
2949
+ :type _headers: dict, optional
2950
+ :param _host_index: set to override the host_index for a single
2951
+ request; this effectively ignores the host_index
2952
+ in the spec for a single request.
2953
+ :type _host_index: int, optional
2954
+ :return: Returns the result object.
2955
+ """ # noqa: E501
2956
+
2957
+ _param = self._get_markets_by_slug_serialize(
2958
+ exchange=exchange,
2959
+ get_markets_by_slug_request=get_markets_by_slug_request,
2960
+ _request_auth=_request_auth,
2961
+ _content_type=_content_type,
2962
+ _headers=_headers,
2963
+ _host_index=_host_index
2964
+ )
2965
+
2966
+ _response_types_map: Dict[str, Optional[str]] = {
2967
+ '200': "FetchMarkets200Response",
2968
+ }
2969
+ response_data = self.api_client.call_api(
2970
+ *_param,
2971
+ _request_timeout=_request_timeout
2972
+ )
2973
+ response_data.read()
2974
+ return self.api_client.response_deserialize(
2975
+ response_data=response_data,
2976
+ response_types_map=_response_types_map,
2977
+ ).data
2978
+
2979
+
2980
+ @validate_call
2981
+ def get_markets_by_slug_with_http_info(
2982
+ self,
2983
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
2984
+ get_markets_by_slug_request: Optional[GetMarketsBySlugRequest] = None,
2985
+ _request_timeout: Union[
2986
+ None,
2987
+ Annotated[StrictFloat, Field(gt=0)],
2988
+ Tuple[
2989
+ Annotated[StrictFloat, Field(gt=0)],
2990
+ Annotated[StrictFloat, Field(gt=0)]
2991
+ ]
2992
+ ] = None,
2993
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2994
+ _content_type: Optional[StrictStr] = None,
2995
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2996
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2997
+ ) -> ApiResponse[FetchMarkets200Response]:
2998
+ """Get Market by Slug
2999
+
3000
+
3001
+ :param exchange: The prediction market exchange to target. (required)
3002
+ :type exchange: str
3003
+ :param get_markets_by_slug_request:
3004
+ :type get_markets_by_slug_request: GetMarketsBySlugRequest
3005
+ :param _request_timeout: timeout setting for this request. If one
3006
+ number provided, it will be total request
3007
+ timeout. It can also be a pair (tuple) of
3008
+ (connection, read) timeouts.
3009
+ :type _request_timeout: int, tuple(int, int), optional
3010
+ :param _request_auth: set to override the auth_settings for an a single
3011
+ request; this effectively ignores the
3012
+ authentication in the spec for a single request.
3013
+ :type _request_auth: dict, optional
3014
+ :param _content_type: force content-type for the request.
3015
+ :type _content_type: str, Optional
3016
+ :param _headers: set to override the headers for a single
3017
+ request; this effectively ignores the headers
3018
+ in the spec for a single request.
3019
+ :type _headers: dict, optional
3020
+ :param _host_index: set to override the host_index for a single
3021
+ request; this effectively ignores the host_index
3022
+ in the spec for a single request.
3023
+ :type _host_index: int, optional
3024
+ :return: Returns the result object.
3025
+ """ # noqa: E501
3026
+
3027
+ _param = self._get_markets_by_slug_serialize(
3028
+ exchange=exchange,
3029
+ get_markets_by_slug_request=get_markets_by_slug_request,
3030
+ _request_auth=_request_auth,
3031
+ _content_type=_content_type,
3032
+ _headers=_headers,
3033
+ _host_index=_host_index
3034
+ )
3035
+
3036
+ _response_types_map: Dict[str, Optional[str]] = {
3037
+ '200': "FetchMarkets200Response",
3038
+ }
3039
+ response_data = self.api_client.call_api(
3040
+ *_param,
3041
+ _request_timeout=_request_timeout
3042
+ )
3043
+ response_data.read()
3044
+ return self.api_client.response_deserialize(
3045
+ response_data=response_data,
3046
+ response_types_map=_response_types_map,
3047
+ )
3048
+
3049
+
3050
+ @validate_call
3051
+ def get_markets_by_slug_without_preload_content(
3052
+ self,
3053
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
3054
+ get_markets_by_slug_request: Optional[GetMarketsBySlugRequest] = None,
3055
+ _request_timeout: Union[
3056
+ None,
3057
+ Annotated[StrictFloat, Field(gt=0)],
3058
+ Tuple[
3059
+ Annotated[StrictFloat, Field(gt=0)],
3060
+ Annotated[StrictFloat, Field(gt=0)]
3061
+ ]
3062
+ ] = None,
3063
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3064
+ _content_type: Optional[StrictStr] = None,
3065
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3066
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3067
+ ) -> RESTResponseType:
3068
+ """Get Market by Slug
3069
+
3070
+
3071
+ :param exchange: The prediction market exchange to target. (required)
3072
+ :type exchange: str
3073
+ :param get_markets_by_slug_request:
3074
+ :type get_markets_by_slug_request: GetMarketsBySlugRequest
3075
+ :param _request_timeout: timeout setting for this request. If one
3076
+ number provided, it will be total request
3077
+ timeout. It can also be a pair (tuple) of
3078
+ (connection, read) timeouts.
3079
+ :type _request_timeout: int, tuple(int, int), optional
3080
+ :param _request_auth: set to override the auth_settings for an a single
3081
+ request; this effectively ignores the
3082
+ authentication in the spec for a single request.
3083
+ :type _request_auth: dict, optional
3084
+ :param _content_type: force content-type for the request.
3085
+ :type _content_type: str, Optional
3086
+ :param _headers: set to override the headers for a single
3087
+ request; this effectively ignores the headers
3088
+ in the spec for a single request.
3089
+ :type _headers: dict, optional
3090
+ :param _host_index: set to override the host_index for a single
3091
+ request; this effectively ignores the host_index
3092
+ in the spec for a single request.
3093
+ :type _host_index: int, optional
3094
+ :return: Returns the result object.
3095
+ """ # noqa: E501
3096
+
3097
+ _param = self._get_markets_by_slug_serialize(
3098
+ exchange=exchange,
3099
+ get_markets_by_slug_request=get_markets_by_slug_request,
3100
+ _request_auth=_request_auth,
3101
+ _content_type=_content_type,
3102
+ _headers=_headers,
3103
+ _host_index=_host_index
3104
+ )
3105
+
3106
+ _response_types_map: Dict[str, Optional[str]] = {
3107
+ '200': "FetchMarkets200Response",
3108
+ }
3109
+ response_data = self.api_client.call_api(
3110
+ *_param,
3111
+ _request_timeout=_request_timeout
3112
+ )
3113
+ return response_data.response
3114
+
3115
+
3116
+ def _get_markets_by_slug_serialize(
3117
+ self,
3118
+ exchange,
3119
+ get_markets_by_slug_request,
3120
+ _request_auth,
3121
+ _content_type,
3122
+ _headers,
3123
+ _host_index,
3124
+ ) -> RequestSerialized:
3125
+
3126
+ _host = None
3127
+
3128
+ _collection_formats: Dict[str, str] = {
3129
+ }
3130
+
3131
+ _path_params: Dict[str, str] = {}
3132
+ _query_params: List[Tuple[str, str]] = []
3133
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3134
+ _form_params: List[Tuple[str, str]] = []
3135
+ _files: Dict[
3136
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3137
+ ] = {}
3138
+ _body_params: Optional[bytes] = None
3139
+
3140
+ # process the path parameters
3141
+ if exchange is not None:
3142
+ _path_params['exchange'] = exchange
3143
+ # process the query parameters
3144
+ # process the header parameters
3145
+ # process the form parameters
3146
+ # process the body parameter
3147
+ if get_markets_by_slug_request is not None:
3148
+ _body_params = get_markets_by_slug_request
3149
+
3150
+
3151
+ # set the HTTP header `Accept`
3152
+ if 'Accept' not in _header_params:
3153
+ _header_params['Accept'] = self.api_client.select_header_accept(
3154
+ [
3155
+ 'application/json'
3156
+ ]
3157
+ )
3158
+
3159
+ # set the HTTP header `Content-Type`
3160
+ if _content_type:
3161
+ _header_params['Content-Type'] = _content_type
3162
+ else:
3163
+ _default_content_type = (
3164
+ self.api_client.select_header_content_type(
3165
+ [
3166
+ 'application/json'
3167
+ ]
3168
+ )
3169
+ )
3170
+ if _default_content_type is not None:
3171
+ _header_params['Content-Type'] = _default_content_type
3172
+
3173
+ # authentication setting
3174
+ _auth_settings: List[str] = [
3175
+ ]
3176
+
3177
+ return self.api_client.param_serialize(
3178
+ method='POST',
3179
+ resource_path='/api/{exchange}/getMarketsBySlug',
3180
+ path_params=_path_params,
3181
+ query_params=_query_params,
3182
+ header_params=_header_params,
3183
+ body=_body_params,
3184
+ post_params=_form_params,
3185
+ files=_files,
3186
+ auth_settings=_auth_settings,
3187
+ collection_formats=_collection_formats,
3188
+ _host=_host,
3189
+ _request_auth=_request_auth
3190
+ )
3191
+
3192
+
3193
+
3194
+
3195
+ @validate_call
3196
+ def health_check(
3197
+ self,
3198
+ _request_timeout: Union[
3199
+ None,
3200
+ Annotated[StrictFloat, Field(gt=0)],
3201
+ Tuple[
3202
+ Annotated[StrictFloat, Field(gt=0)],
3203
+ Annotated[StrictFloat, Field(gt=0)]
3204
+ ]
3205
+ ] = None,
3206
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3207
+ _content_type: Optional[StrictStr] = None,
3208
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3209
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3210
+ ) -> HealthCheck200Response:
3211
+ """Server Health Check
3212
+
3213
+
3214
+ :param _request_timeout: timeout setting for this request. If one
3215
+ number provided, it will be total request
3216
+ timeout. It can also be a pair (tuple) of
3217
+ (connection, read) timeouts.
3218
+ :type _request_timeout: int, tuple(int, int), optional
3219
+ :param _request_auth: set to override the auth_settings for an a single
3220
+ request; this effectively ignores the
3221
+ authentication in the spec for a single request.
3222
+ :type _request_auth: dict, optional
3223
+ :param _content_type: force content-type for the request.
3224
+ :type _content_type: str, Optional
3225
+ :param _headers: set to override the headers for a single
3226
+ request; this effectively ignores the headers
3227
+ in the spec for a single request.
3228
+ :type _headers: dict, optional
3229
+ :param _host_index: set to override the host_index for a single
3230
+ request; this effectively ignores the host_index
3231
+ in the spec for a single request.
3232
+ :type _host_index: int, optional
3233
+ :return: Returns the result object.
3234
+ """ # noqa: E501
3235
+
3236
+ _param = self._health_check_serialize(
3237
+ _request_auth=_request_auth,
3238
+ _content_type=_content_type,
3239
+ _headers=_headers,
3240
+ _host_index=_host_index
3241
+ )
3242
+
3243
+ _response_types_map: Dict[str, Optional[str]] = {
3244
+ '200': "HealthCheck200Response",
3245
+ }
3246
+ response_data = self.api_client.call_api(
3247
+ *_param,
3248
+ _request_timeout=_request_timeout
3249
+ )
3250
+ response_data.read()
3251
+ return self.api_client.response_deserialize(
3252
+ response_data=response_data,
3253
+ response_types_map=_response_types_map,
3254
+ ).data
3255
+
3256
+
3257
+ @validate_call
3258
+ def health_check_with_http_info(
3259
+ self,
3260
+ _request_timeout: Union[
3261
+ None,
3262
+ Annotated[StrictFloat, Field(gt=0)],
3263
+ Tuple[
3264
+ Annotated[StrictFloat, Field(gt=0)],
3265
+ Annotated[StrictFloat, Field(gt=0)]
3266
+ ]
3267
+ ] = None,
3268
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3269
+ _content_type: Optional[StrictStr] = None,
3270
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3271
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3272
+ ) -> ApiResponse[HealthCheck200Response]:
3273
+ """Server Health Check
3274
+
3275
+
3276
+ :param _request_timeout: timeout setting for this request. If one
3277
+ number provided, it will be total request
3278
+ timeout. It can also be a pair (tuple) of
3279
+ (connection, read) timeouts.
3280
+ :type _request_timeout: int, tuple(int, int), optional
3281
+ :param _request_auth: set to override the auth_settings for an a single
3282
+ request; this effectively ignores the
3283
+ authentication in the spec for a single request.
3284
+ :type _request_auth: dict, optional
3285
+ :param _content_type: force content-type for the request.
3286
+ :type _content_type: str, Optional
3287
+ :param _headers: set to override the headers for a single
3288
+ request; this effectively ignores the headers
3289
+ in the spec for a single request.
3290
+ :type _headers: dict, optional
3291
+ :param _host_index: set to override the host_index for a single
3292
+ request; this effectively ignores the host_index
3293
+ in the spec for a single request.
3294
+ :type _host_index: int, optional
3295
+ :return: Returns the result object.
3296
+ """ # noqa: E501
3297
+
3298
+ _param = self._health_check_serialize(
3299
+ _request_auth=_request_auth,
3300
+ _content_type=_content_type,
3301
+ _headers=_headers,
3302
+ _host_index=_host_index
3303
+ )
3304
+
3305
+ _response_types_map: Dict[str, Optional[str]] = {
3306
+ '200': "HealthCheck200Response",
3307
+ }
3308
+ response_data = self.api_client.call_api(
3309
+ *_param,
3310
+ _request_timeout=_request_timeout
3311
+ )
3312
+ response_data.read()
3313
+ return self.api_client.response_deserialize(
3314
+ response_data=response_data,
3315
+ response_types_map=_response_types_map,
3316
+ )
3317
+
3318
+
3319
+ @validate_call
3320
+ def health_check_without_preload_content(
3321
+ self,
3322
+ _request_timeout: Union[
3323
+ None,
3324
+ Annotated[StrictFloat, Field(gt=0)],
3325
+ Tuple[
3326
+ Annotated[StrictFloat, Field(gt=0)],
3327
+ Annotated[StrictFloat, Field(gt=0)]
3328
+ ]
3329
+ ] = None,
3330
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3331
+ _content_type: Optional[StrictStr] = None,
3332
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3333
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3334
+ ) -> RESTResponseType:
3335
+ """Server Health Check
3336
+
3337
+
3338
+ :param _request_timeout: timeout setting for this request. If one
3339
+ number provided, it will be total request
3340
+ timeout. It can also be a pair (tuple) of
3341
+ (connection, read) timeouts.
3342
+ :type _request_timeout: int, tuple(int, int), optional
3343
+ :param _request_auth: set to override the auth_settings for an a single
3344
+ request; this effectively ignores the
3345
+ authentication in the spec for a single request.
3346
+ :type _request_auth: dict, optional
3347
+ :param _content_type: force content-type for the request.
3348
+ :type _content_type: str, Optional
3349
+ :param _headers: set to override the headers for a single
3350
+ request; this effectively ignores the headers
3351
+ in the spec for a single request.
3352
+ :type _headers: dict, optional
3353
+ :param _host_index: set to override the host_index for a single
3354
+ request; this effectively ignores the host_index
3355
+ in the spec for a single request.
3356
+ :type _host_index: int, optional
3357
+ :return: Returns the result object.
3358
+ """ # noqa: E501
3359
+
3360
+ _param = self._health_check_serialize(
3361
+ _request_auth=_request_auth,
3362
+ _content_type=_content_type,
3363
+ _headers=_headers,
3364
+ _host_index=_host_index
3365
+ )
3366
+
3367
+ _response_types_map: Dict[str, Optional[str]] = {
3368
+ '200': "HealthCheck200Response",
3369
+ }
3370
+ response_data = self.api_client.call_api(
3371
+ *_param,
3372
+ _request_timeout=_request_timeout
3373
+ )
3374
+ return response_data.response
3375
+
3376
+
3377
+ def _health_check_serialize(
3378
+ self,
3379
+ _request_auth,
3380
+ _content_type,
3381
+ _headers,
3382
+ _host_index,
3383
+ ) -> RequestSerialized:
3384
+
3385
+ _host = None
3386
+
3387
+ _collection_formats: Dict[str, str] = {
3388
+ }
3389
+
3390
+ _path_params: Dict[str, str] = {}
3391
+ _query_params: List[Tuple[str, str]] = []
3392
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3393
+ _form_params: List[Tuple[str, str]] = []
3394
+ _files: Dict[
3395
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3396
+ ] = {}
3397
+ _body_params: Optional[bytes] = None
3398
+
3399
+ # process the path parameters
3400
+ # process the query parameters
3401
+ # process the header parameters
3402
+ # process the form parameters
3403
+ # process the body parameter
3404
+
3405
+
3406
+ # set the HTTP header `Accept`
3407
+ if 'Accept' not in _header_params:
3408
+ _header_params['Accept'] = self.api_client.select_header_accept(
3409
+ [
3410
+ 'application/json'
3411
+ ]
3412
+ )
3413
+
3414
+
3415
+ # authentication setting
3416
+ _auth_settings: List[str] = [
3417
+ ]
3418
+
3419
+ return self.api_client.param_serialize(
3420
+ method='GET',
3421
+ resource_path='/health',
3422
+ path_params=_path_params,
3423
+ query_params=_query_params,
3424
+ header_params=_header_params,
3425
+ body=_body_params,
3426
+ post_params=_form_params,
3427
+ files=_files,
3428
+ auth_settings=_auth_settings,
3429
+ collection_formats=_collection_formats,
3430
+ _host=_host,
3431
+ _request_auth=_request_auth
3432
+ )
3433
+
3434
+
3435
+
3436
+
3437
+ @validate_call
3438
+ def search_markets(
3439
+ self,
3440
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
3441
+ search_markets_request: Optional[SearchMarketsRequest] = None,
3442
+ _request_timeout: Union[
3443
+ None,
3444
+ Annotated[StrictFloat, Field(gt=0)],
3445
+ Tuple[
3446
+ Annotated[StrictFloat, Field(gt=0)],
3447
+ Annotated[StrictFloat, Field(gt=0)]
3448
+ ]
3449
+ ] = None,
3450
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3451
+ _content_type: Optional[StrictStr] = None,
3452
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3453
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3454
+ ) -> FetchMarkets200Response:
3455
+ """Search Markets
3456
+
3457
+ Search for markets by title or description.
3458
+
3459
+ :param exchange: The prediction market exchange to target. (required)
3460
+ :type exchange: str
3461
+ :param search_markets_request:
3462
+ :type search_markets_request: SearchMarketsRequest
3463
+ :param _request_timeout: timeout setting for this request. If one
3464
+ number provided, it will be total request
3465
+ timeout. It can also be a pair (tuple) of
3466
+ (connection, read) timeouts.
3467
+ :type _request_timeout: int, tuple(int, int), optional
3468
+ :param _request_auth: set to override the auth_settings for an a single
3469
+ request; this effectively ignores the
3470
+ authentication in the spec for a single request.
3471
+ :type _request_auth: dict, optional
3472
+ :param _content_type: force content-type for the request.
3473
+ :type _content_type: str, Optional
3474
+ :param _headers: set to override the headers for a single
3475
+ request; this effectively ignores the headers
3476
+ in the spec for a single request.
3477
+ :type _headers: dict, optional
3478
+ :param _host_index: set to override the host_index for a single
3479
+ request; this effectively ignores the host_index
3480
+ in the spec for a single request.
3481
+ :type _host_index: int, optional
3482
+ :return: Returns the result object.
3483
+ """ # noqa: E501
3484
+
3485
+ _param = self._search_markets_serialize(
3486
+ exchange=exchange,
3487
+ search_markets_request=search_markets_request,
3488
+ _request_auth=_request_auth,
3489
+ _content_type=_content_type,
3490
+ _headers=_headers,
3491
+ _host_index=_host_index
3492
+ )
3493
+
3494
+ _response_types_map: Dict[str, Optional[str]] = {
3495
+ '200': "FetchMarkets200Response",
3496
+ }
3497
+ response_data = self.api_client.call_api(
3498
+ *_param,
3499
+ _request_timeout=_request_timeout
3500
+ )
3501
+ response_data.read()
3502
+ return self.api_client.response_deserialize(
3503
+ response_data=response_data,
3504
+ response_types_map=_response_types_map,
3505
+ ).data
3506
+
3507
+
3508
+ @validate_call
3509
+ def search_markets_with_http_info(
3510
+ self,
3511
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
3512
+ search_markets_request: Optional[SearchMarketsRequest] = None,
3513
+ _request_timeout: Union[
3514
+ None,
3515
+ Annotated[StrictFloat, Field(gt=0)],
3516
+ Tuple[
3517
+ Annotated[StrictFloat, Field(gt=0)],
3518
+ Annotated[StrictFloat, Field(gt=0)]
3519
+ ]
3520
+ ] = None,
3521
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3522
+ _content_type: Optional[StrictStr] = None,
3523
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3524
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3525
+ ) -> ApiResponse[FetchMarkets200Response]:
3526
+ """Search Markets
3527
+
3528
+ Search for markets by title or description.
3529
+
3530
+ :param exchange: The prediction market exchange to target. (required)
3531
+ :type exchange: str
3532
+ :param search_markets_request:
3533
+ :type search_markets_request: SearchMarketsRequest
3534
+ :param _request_timeout: timeout setting for this request. If one
3535
+ number provided, it will be total request
3536
+ timeout. It can also be a pair (tuple) of
3537
+ (connection, read) timeouts.
3538
+ :type _request_timeout: int, tuple(int, int), optional
3539
+ :param _request_auth: set to override the auth_settings for an a single
3540
+ request; this effectively ignores the
3541
+ authentication in the spec for a single request.
3542
+ :type _request_auth: dict, optional
3543
+ :param _content_type: force content-type for the request.
3544
+ :type _content_type: str, Optional
3545
+ :param _headers: set to override the headers for a single
3546
+ request; this effectively ignores the headers
3547
+ in the spec for a single request.
3548
+ :type _headers: dict, optional
3549
+ :param _host_index: set to override the host_index for a single
3550
+ request; this effectively ignores the host_index
3551
+ in the spec for a single request.
3552
+ :type _host_index: int, optional
3553
+ :return: Returns the result object.
3554
+ """ # noqa: E501
3555
+
3556
+ _param = self._search_markets_serialize(
3557
+ exchange=exchange,
3558
+ search_markets_request=search_markets_request,
3559
+ _request_auth=_request_auth,
3560
+ _content_type=_content_type,
3561
+ _headers=_headers,
3562
+ _host_index=_host_index
3563
+ )
3564
+
3565
+ _response_types_map: Dict[str, Optional[str]] = {
3566
+ '200': "FetchMarkets200Response",
3567
+ }
3568
+ response_data = self.api_client.call_api(
3569
+ *_param,
3570
+ _request_timeout=_request_timeout
3571
+ )
3572
+ response_data.read()
3573
+ return self.api_client.response_deserialize(
3574
+ response_data=response_data,
3575
+ response_types_map=_response_types_map,
3576
+ )
3577
+
3578
+
3579
+ @validate_call
3580
+ def search_markets_without_preload_content(
3581
+ self,
3582
+ exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
3583
+ search_markets_request: Optional[SearchMarketsRequest] = None,
3584
+ _request_timeout: Union[
3585
+ None,
3586
+ Annotated[StrictFloat, Field(gt=0)],
3587
+ Tuple[
3588
+ Annotated[StrictFloat, Field(gt=0)],
3589
+ Annotated[StrictFloat, Field(gt=0)]
3590
+ ]
3591
+ ] = None,
3592
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3593
+ _content_type: Optional[StrictStr] = None,
3594
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3595
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3596
+ ) -> RESTResponseType:
3597
+ """Search Markets
3598
+
3599
+ Search for markets by title or description.
3600
+
3601
+ :param exchange: The prediction market exchange to target. (required)
3602
+ :type exchange: str
3603
+ :param search_markets_request:
3604
+ :type search_markets_request: SearchMarketsRequest
3605
+ :param _request_timeout: timeout setting for this request. If one
3606
+ number provided, it will be total request
3607
+ timeout. It can also be a pair (tuple) of
3608
+ (connection, read) timeouts.
3609
+ :type _request_timeout: int, tuple(int, int), optional
3610
+ :param _request_auth: set to override the auth_settings for an a single
3611
+ request; this effectively ignores the
3612
+ authentication in the spec for a single request.
3613
+ :type _request_auth: dict, optional
3614
+ :param _content_type: force content-type for the request.
3615
+ :type _content_type: str, Optional
3616
+ :param _headers: set to override the headers for a single
3617
+ request; this effectively ignores the headers
3618
+ in the spec for a single request.
3619
+ :type _headers: dict, optional
3620
+ :param _host_index: set to override the host_index for a single
3621
+ request; this effectively ignores the host_index
3622
+ in the spec for a single request.
3623
+ :type _host_index: int, optional
3624
+ :return: Returns the result object.
3625
+ """ # noqa: E501
3626
+
3627
+ _param = self._search_markets_serialize(
3628
+ exchange=exchange,
3629
+ search_markets_request=search_markets_request,
3630
+ _request_auth=_request_auth,
3631
+ _content_type=_content_type,
3632
+ _headers=_headers,
3633
+ _host_index=_host_index
3634
+ )
3635
+
3636
+ _response_types_map: Dict[str, Optional[str]] = {
3637
+ '200': "FetchMarkets200Response",
3638
+ }
3639
+ response_data = self.api_client.call_api(
3640
+ *_param,
3641
+ _request_timeout=_request_timeout
3642
+ )
3643
+ return response_data.response
3644
+
3645
+
3646
+ def _search_markets_serialize(
3647
+ self,
3648
+ exchange,
3649
+ search_markets_request,
3650
+ _request_auth,
3651
+ _content_type,
3652
+ _headers,
3653
+ _host_index,
3654
+ ) -> RequestSerialized:
3655
+
3656
+ _host = None
3657
+
3658
+ _collection_formats: Dict[str, str] = {
3659
+ }
3660
+
3661
+ _path_params: Dict[str, str] = {}
3662
+ _query_params: List[Tuple[str, str]] = []
3663
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3664
+ _form_params: List[Tuple[str, str]] = []
3665
+ _files: Dict[
3666
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3667
+ ] = {}
3668
+ _body_params: Optional[bytes] = None
3669
+
3670
+ # process the path parameters
3671
+ if exchange is not None:
3672
+ _path_params['exchange'] = exchange
3673
+ # process the query parameters
3674
+ # process the header parameters
3675
+ # process the form parameters
3676
+ # process the body parameter
3677
+ if search_markets_request is not None:
3678
+ _body_params = search_markets_request
3679
+
3680
+
3681
+ # set the HTTP header `Accept`
3682
+ if 'Accept' not in _header_params:
3683
+ _header_params['Accept'] = self.api_client.select_header_accept(
3684
+ [
3685
+ 'application/json'
3686
+ ]
3687
+ )
3688
+
3689
+ # set the HTTP header `Content-Type`
3690
+ if _content_type:
3691
+ _header_params['Content-Type'] = _content_type
3692
+ else:
3693
+ _default_content_type = (
3694
+ self.api_client.select_header_content_type(
3695
+ [
3696
+ 'application/json'
3697
+ ]
3698
+ )
3699
+ )
3700
+ if _default_content_type is not None:
3701
+ _header_params['Content-Type'] = _default_content_type
3702
+
3703
+ # authentication setting
3704
+ _auth_settings: List[str] = [
3705
+ ]
3706
+
3707
+ return self.api_client.param_serialize(
3708
+ method='POST',
3709
+ resource_path='/api/{exchange}/searchMarkets',
3710
+ path_params=_path_params,
3711
+ query_params=_query_params,
3712
+ header_params=_header_params,
3713
+ body=_body_params,
3714
+ post_params=_form_params,
3715
+ files=_files,
3716
+ auth_settings=_auth_settings,
3717
+ collection_formats=_collection_formats,
3718
+ _host=_host,
3719
+ _request_auth=_request_auth
3720
+ )
3721
+
3722
+