snaptrade-python-sdk 11.0.142__py3-none-any.whl → 11.0.144__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 (49) hide show
  1. snaptrade_client/__init__.py +1 -1
  2. snaptrade_client/api_client.py +1 -1
  3. snaptrade_client/apis/path_to_api.py +6 -0
  4. snaptrade_client/apis/paths/accounts_account_id_orders_v2.py +7 -0
  5. snaptrade_client/apis/paths/accounts_account_id_recent_orders_v2.py +7 -0
  6. snaptrade_client/apis/tag_to_api.py +3 -0
  7. snaptrade_client/apis/tags/__init__.py +1 -0
  8. snaptrade_client/apis/tags/experimental_endpoints_api.py +6 -0
  9. snaptrade_client/apis/tags/experimental_endpoints_api_generated.py +23 -0
  10. snaptrade_client/client.py +2 -0
  11. snaptrade_client/client.pyi +2 -0
  12. snaptrade_client/configuration.py +1 -1
  13. snaptrade_client/model/account_order_record_leg.py +252 -0
  14. snaptrade_client/model/account_order_record_leg.pyi +252 -0
  15. snaptrade_client/model/account_order_record_leg_instrument.py +137 -0
  16. snaptrade_client/model/account_order_record_leg_instrument.pyi +137 -0
  17. snaptrade_client/model/account_order_record_status.py +18 -0
  18. snaptrade_client/model/account_order_record_status.pyi +18 -0
  19. snaptrade_client/model/account_order_record_status_v2.py +90 -0
  20. snaptrade_client/model/account_order_record_status_v2.pyi +75 -0
  21. snaptrade_client/model/account_order_record_status_v2_nullable.py +105 -0
  22. snaptrade_client/model/account_order_record_status_v2_nullable.pyi +105 -0
  23. snaptrade_client/model/account_order_record_v2.py +309 -0
  24. snaptrade_client/model/account_order_record_v2.pyi +309 -0
  25. snaptrade_client/model/account_orders_v2_response.py +110 -0
  26. snaptrade_client/model/account_orders_v2_response.pyi +110 -0
  27. snaptrade_client/model/action_strict_v2.py +25 -0
  28. snaptrade_client/model/action_strict_v2.pyi +25 -0
  29. snaptrade_client/models/__init__.py +7 -0
  30. snaptrade_client/operation_parameter_map.py +35 -0
  31. snaptrade_client/paths/__init__.py +2 -0
  32. snaptrade_client/paths/accounts_account_id_orders_v2/__init__.py +7 -0
  33. snaptrade_client/paths/accounts_account_id_orders_v2/get.py +592 -0
  34. snaptrade_client/paths/accounts_account_id_orders_v2/get.pyi +569 -0
  35. snaptrade_client/paths/accounts_account_id_recent_orders_v2/__init__.py +7 -0
  36. snaptrade_client/paths/accounts_account_id_recent_orders_v2/get.py +561 -0
  37. snaptrade_client/paths/accounts_account_id_recent_orders_v2/get.pyi +549 -0
  38. snaptrade_client/type/account_order_record_leg.py +48 -0
  39. snaptrade_client/type/account_order_record_leg_instrument.py +39 -0
  40. snaptrade_client/type/account_order_record_status_v2.py +19 -0
  41. snaptrade_client/type/account_order_record_status_v2_nullable.py +19 -0
  42. snaptrade_client/type/account_order_record_v2.py +58 -0
  43. snaptrade_client/type/account_orders_v2_response.py +28 -0
  44. snaptrade_client/type/account_universal_activity.py +1 -1
  45. snaptrade_client/type/action_strict_v2.py +19 -0
  46. {snaptrade_python_sdk-11.0.142.dist-info → snaptrade_python_sdk-11.0.144.dist-info}/METADATA +103 -4
  47. {snaptrade_python_sdk-11.0.142.dist-info → snaptrade_python_sdk-11.0.144.dist-info}/RECORD +49 -18
  48. {snaptrade_python_sdk-11.0.142.dist-info → snaptrade_python_sdk-11.0.144.dist-info}/LICENSE +0 -0
  49. {snaptrade_python_sdk-11.0.142.dist-info → snaptrade_python_sdk-11.0.144.dist-info}/WHEEL +0 -0
@@ -0,0 +1,592 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ SnapTrade
5
+
6
+ Connect brokerage accounts to your app for live positions and trading
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: api@snaptrade.com
10
+ Created by: https://snaptrade.com/
11
+ """
12
+
13
+ from dataclasses import dataclass
14
+ import typing_extensions
15
+ import urllib3
16
+ from snaptrade_client.request_before_hook import request_before_hook
17
+ import json
18
+ from urllib3._collections import HTTPHeaderDict
19
+
20
+ from snaptrade_client.api_response import AsyncGeneratorResponse
21
+ from snaptrade_client import api_client, exceptions
22
+ from datetime import date, datetime # noqa: F401
23
+ import decimal # noqa: F401
24
+ import functools # noqa: F401
25
+ import io # noqa: F401
26
+ import re # noqa: F401
27
+ import typing # noqa: F401
28
+ import typing_extensions # noqa: F401
29
+ import uuid # noqa: F401
30
+
31
+ import frozendict # noqa: F401
32
+
33
+ from snaptrade_client import schemas # noqa: F401
34
+
35
+ from snaptrade_client.model.account_orders_v2_response import AccountOrdersV2Response as AccountOrdersV2ResponseSchema
36
+ from snaptrade_client.model.model500_unexpected_exception_response import Model500UnexpectedExceptionResponse as Model500UnexpectedExceptionResponseSchema
37
+
38
+ from snaptrade_client.type.account_orders_v2_response import AccountOrdersV2Response
39
+ from snaptrade_client.type.model500_unexpected_exception_response import Model500UnexpectedExceptionResponse
40
+
41
+ from . import path
42
+
43
+ # Query params
44
+ UserIdSchema = schemas.StrSchema
45
+ UserSecretSchema = schemas.StrSchema
46
+
47
+
48
+ class StateSchema(
49
+ schemas.EnumBase,
50
+ schemas.StrSchema
51
+ ):
52
+
53
+
54
+ class MetaOapg:
55
+ enum_value_to_name = {
56
+ "all": "ALL",
57
+ "open": "OPEN",
58
+ "executed": "EXECUTED",
59
+ }
60
+
61
+ @schemas.classproperty
62
+ def ALL(cls):
63
+ return cls("all")
64
+
65
+ @schemas.classproperty
66
+ def OPEN(cls):
67
+ return cls("open")
68
+
69
+ @schemas.classproperty
70
+ def EXECUTED(cls):
71
+ return cls("executed")
72
+
73
+
74
+ class DaysSchema(
75
+ schemas.Int32Schema
76
+ ):
77
+
78
+
79
+ class MetaOapg:
80
+ format = 'int32'
81
+ inclusive_minimum = 1
82
+ RequestRequiredQueryParams = typing_extensions.TypedDict(
83
+ 'RequestRequiredQueryParams',
84
+ {
85
+ 'userId': typing.Union[UserIdSchema, str, ],
86
+ 'userSecret': typing.Union[UserSecretSchema, str, ],
87
+ }
88
+ )
89
+ RequestOptionalQueryParams = typing_extensions.TypedDict(
90
+ 'RequestOptionalQueryParams',
91
+ {
92
+ 'state': typing.Union[StateSchema, str, ],
93
+ 'days': typing.Union[DaysSchema, decimal.Decimal, int, ],
94
+ },
95
+ total=False
96
+ )
97
+
98
+
99
+ class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams):
100
+ pass
101
+
102
+
103
+ request_query_user_id = api_client.QueryParameter(
104
+ name="userId",
105
+ style=api_client.ParameterStyle.FORM,
106
+ schema=UserIdSchema,
107
+ required=True,
108
+ explode=True,
109
+ )
110
+ request_query_user_secret = api_client.QueryParameter(
111
+ name="userSecret",
112
+ style=api_client.ParameterStyle.FORM,
113
+ schema=UserSecretSchema,
114
+ required=True,
115
+ explode=True,
116
+ )
117
+ request_query_state = api_client.QueryParameter(
118
+ name="state",
119
+ style=api_client.ParameterStyle.FORM,
120
+ schema=StateSchema,
121
+ explode=True,
122
+ )
123
+ request_query_days = api_client.QueryParameter(
124
+ name="days",
125
+ style=api_client.ParameterStyle.FORM,
126
+ schema=DaysSchema,
127
+ explode=True,
128
+ )
129
+ # Path params
130
+ AccountIdSchema = schemas.UUIDSchema
131
+ RequestRequiredPathParams = typing_extensions.TypedDict(
132
+ 'RequestRequiredPathParams',
133
+ {
134
+ 'accountId': typing.Union[AccountIdSchema, str, uuid.UUID, ],
135
+ }
136
+ )
137
+ RequestOptionalPathParams = typing_extensions.TypedDict(
138
+ 'RequestOptionalPathParams',
139
+ {
140
+ },
141
+ total=False
142
+ )
143
+
144
+
145
+ class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams):
146
+ pass
147
+
148
+
149
+ request_path_account_id = api_client.PathParameter(
150
+ name="accountId",
151
+ style=api_client.ParameterStyle.SIMPLE,
152
+ schema=AccountIdSchema,
153
+ required=True,
154
+ )
155
+ _auth = [
156
+ 'PartnerClientId',
157
+ 'PartnerSignature',
158
+ 'PartnerTimestamp',
159
+ ]
160
+ SchemaFor200ResponseBodyApplicationJson = AccountOrdersV2ResponseSchema
161
+
162
+
163
+ @dataclass
164
+ class ApiResponseFor200(api_client.ApiResponse):
165
+ body: AccountOrdersV2Response
166
+
167
+
168
+ @dataclass
169
+ class ApiResponseFor200Async(api_client.AsyncApiResponse):
170
+ body: AccountOrdersV2Response
171
+
172
+
173
+ _response_for_200 = api_client.OpenApiResponse(
174
+ response_cls=ApiResponseFor200,
175
+ response_cls_async=ApiResponseFor200Async,
176
+ content={
177
+ 'application/json': api_client.MediaType(
178
+ schema=SchemaFor200ResponseBodyApplicationJson),
179
+ },
180
+ )
181
+ SchemaFor500ResponseBodyApplicationJson = Model500UnexpectedExceptionResponseSchema
182
+
183
+
184
+ @dataclass
185
+ class ApiResponseFor500(api_client.ApiResponse):
186
+ body: Model500UnexpectedExceptionResponse
187
+
188
+
189
+ @dataclass
190
+ class ApiResponseFor500Async(api_client.AsyncApiResponse):
191
+ body: Model500UnexpectedExceptionResponse
192
+
193
+
194
+ _response_for_500 = api_client.OpenApiResponse(
195
+ response_cls=ApiResponseFor500,
196
+ response_cls_async=ApiResponseFor500Async,
197
+ content={
198
+ 'application/json': api_client.MediaType(
199
+ schema=SchemaFor500ResponseBodyApplicationJson),
200
+ },
201
+ )
202
+ _status_code_to_response = {
203
+ '200': _response_for_200,
204
+ '500': _response_for_500,
205
+ }
206
+ _all_accept_content_types = (
207
+ 'application/json',
208
+ )
209
+
210
+
211
+ class BaseApi(api_client.Api):
212
+
213
+ def _get_user_account_orders_v2_mapped_args(
214
+ self,
215
+ user_id: typing.Optional[str] = None,
216
+ user_secret: typing.Optional[str] = None,
217
+ account_id: typing.Optional[str] = None,
218
+ state: typing.Optional[str] = None,
219
+ days: typing.Optional[int] = None,
220
+ query_params: typing.Optional[dict] = {},
221
+ path_params: typing.Optional[dict] = {},
222
+ ) -> api_client.MappedArgs:
223
+ args: api_client.MappedArgs = api_client.MappedArgs()
224
+ _query_params = {}
225
+ _path_params = {}
226
+ if user_id is not None:
227
+ _query_params["userId"] = user_id
228
+ if user_secret is not None:
229
+ _query_params["userSecret"] = user_secret
230
+ if state is not None:
231
+ _query_params["state"] = state
232
+ if days is not None:
233
+ _query_params["days"] = days
234
+ if account_id is not None:
235
+ _path_params["accountId"] = account_id
236
+ args.query = query_params if query_params else _query_params
237
+ args.path = path_params if path_params else _path_params
238
+ return args
239
+
240
+ async def _aget_user_account_orders_v2_oapg(
241
+ self,
242
+ query_params: typing.Optional[dict] = {},
243
+ path_params: typing.Optional[dict] = {},
244
+ skip_deserialization: bool = True,
245
+ timeout: typing.Optional[typing.Union[float, typing.Tuple]] = None,
246
+ accept_content_types: typing.Tuple[str] = _all_accept_content_types,
247
+ stream: bool = False,
248
+ **kwargs,
249
+ ) -> typing.Union[
250
+ ApiResponseFor200Async,
251
+ api_client.ApiResponseWithoutDeserializationAsync,
252
+ AsyncGeneratorResponse,
253
+ ]:
254
+ """
255
+ List account orders v2
256
+ :param skip_deserialization: If true then api_response.response will be set but
257
+ api_response.body and api_response.headers will not be deserialized into schema
258
+ class instances
259
+ """
260
+ self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params)
261
+ self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params)
262
+ used_path = path.value
263
+
264
+ _path_params = {}
265
+ for parameter in (
266
+ request_path_account_id,
267
+ ):
268
+ parameter_data = path_params.get(parameter.name, schemas.unset)
269
+ if parameter_data is schemas.unset:
270
+ continue
271
+ serialized_data = parameter.serialize(parameter_data)
272
+ _path_params.update(serialized_data)
273
+
274
+ for k, v in _path_params.items():
275
+ used_path = used_path.replace('{%s}' % k, v)
276
+
277
+ prefix_separator_iterator = None
278
+ for parameter in (
279
+ request_query_user_id,
280
+ request_query_user_secret,
281
+ request_query_state,
282
+ request_query_days,
283
+ ):
284
+ parameter_data = query_params.get(parameter.name, schemas.unset)
285
+ if parameter_data is schemas.unset:
286
+ continue
287
+ if prefix_separator_iterator is None:
288
+ prefix_separator_iterator = parameter.get_prefix_separator_iterator()
289
+ serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator)
290
+ for serialized_value in serialized_data.values():
291
+ used_path += serialized_value
292
+
293
+ _headers = HTTPHeaderDict()
294
+ # TODO add cookie handling
295
+ if accept_content_types:
296
+ for accept_content_type in accept_content_types:
297
+ _headers.add('Accept', accept_content_type)
298
+ method = 'get'.upper()
299
+ request_before_hook(
300
+ resource_path=used_path,
301
+ method=method,
302
+ configuration=self.api_client.configuration,
303
+ path_template='/accounts/{accountId}/orders/v2',
304
+ auth_settings=_auth,
305
+ headers=_headers,
306
+ )
307
+
308
+ response = await self.api_client.async_call_api(
309
+ resource_path=used_path,
310
+ method=method,
311
+ headers=_headers,
312
+ auth_settings=_auth,
313
+ prefix_separator_iterator=prefix_separator_iterator,
314
+ timeout=timeout,
315
+ **kwargs
316
+ )
317
+
318
+ if stream:
319
+ if not 200 <= response.http_response.status <= 299:
320
+ body = (await response.http_response.content.read()).decode("utf-8")
321
+ raise exceptions.ApiStreamingException(
322
+ status=response.http_response.status,
323
+ reason=response.http_response.reason,
324
+ body=body,
325
+ )
326
+
327
+ async def stream_iterator():
328
+ """
329
+ iterates over response.http_response.content and closes connection once iteration has finished
330
+ """
331
+ async for line in response.http_response.content:
332
+ if line == b'\r\n':
333
+ continue
334
+ yield line
335
+ response.http_response.close()
336
+ await response.session.close()
337
+ return AsyncGeneratorResponse(
338
+ content=stream_iterator(),
339
+ headers=response.http_response.headers,
340
+ status=response.http_response.status,
341
+ response=response.http_response
342
+ )
343
+
344
+ response_for_status = _status_code_to_response.get(str(response.http_response.status))
345
+ if response_for_status:
346
+ api_response = await response_for_status.deserialize_async(
347
+ response,
348
+ self.api_client.configuration,
349
+ skip_deserialization=skip_deserialization
350
+ )
351
+ else:
352
+ # If response data is JSON then deserialize for SDK consumer convenience
353
+ is_json = api_client.JSONDetector._content_type_is_json(response.http_response.headers.get('Content-Type', ''))
354
+ api_response = api_client.ApiResponseWithoutDeserializationAsync(
355
+ body=await response.http_response.json() if is_json else await response.http_response.text(),
356
+ response=response.http_response,
357
+ round_trip_time=response.round_trip_time,
358
+ status=response.http_response.status,
359
+ headers=response.http_response.headers,
360
+ )
361
+
362
+ if not 200 <= api_response.status <= 299:
363
+ raise exceptions.ApiException(api_response=api_response)
364
+
365
+ # cleanup session / response
366
+ response.http_response.close()
367
+ await response.session.close()
368
+
369
+ return api_response
370
+
371
+
372
+ def _get_user_account_orders_v2_oapg(
373
+ self,
374
+ query_params: typing.Optional[dict] = {},
375
+ path_params: typing.Optional[dict] = {},
376
+ skip_deserialization: bool = True,
377
+ timeout: typing.Optional[typing.Union[float, typing.Tuple]] = None,
378
+ accept_content_types: typing.Tuple[str] = _all_accept_content_types,
379
+ stream: bool = False,
380
+ ) -> typing.Union[
381
+ ApiResponseFor200,
382
+ api_client.ApiResponseWithoutDeserialization,
383
+ ]:
384
+ """
385
+ List account orders v2
386
+ :param skip_deserialization: If true then api_response.response will be set but
387
+ api_response.body and api_response.headers will not be deserialized into schema
388
+ class instances
389
+ """
390
+ self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params)
391
+ self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params)
392
+ used_path = path.value
393
+
394
+ _path_params = {}
395
+ for parameter in (
396
+ request_path_account_id,
397
+ ):
398
+ parameter_data = path_params.get(parameter.name, schemas.unset)
399
+ if parameter_data is schemas.unset:
400
+ continue
401
+ serialized_data = parameter.serialize(parameter_data)
402
+ _path_params.update(serialized_data)
403
+
404
+ for k, v in _path_params.items():
405
+ used_path = used_path.replace('{%s}' % k, v)
406
+
407
+ prefix_separator_iterator = None
408
+ for parameter in (
409
+ request_query_user_id,
410
+ request_query_user_secret,
411
+ request_query_state,
412
+ request_query_days,
413
+ ):
414
+ parameter_data = query_params.get(parameter.name, schemas.unset)
415
+ if parameter_data is schemas.unset:
416
+ continue
417
+ if prefix_separator_iterator is None:
418
+ prefix_separator_iterator = parameter.get_prefix_separator_iterator()
419
+ serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator)
420
+ for serialized_value in serialized_data.values():
421
+ used_path += serialized_value
422
+
423
+ _headers = HTTPHeaderDict()
424
+ # TODO add cookie handling
425
+ if accept_content_types:
426
+ for accept_content_type in accept_content_types:
427
+ _headers.add('Accept', accept_content_type)
428
+ method = 'get'.upper()
429
+ request_before_hook(
430
+ resource_path=used_path,
431
+ method=method,
432
+ configuration=self.api_client.configuration,
433
+ path_template='/accounts/{accountId}/orders/v2',
434
+ auth_settings=_auth,
435
+ headers=_headers,
436
+ )
437
+
438
+ response = self.api_client.call_api(
439
+ resource_path=used_path,
440
+ method=method,
441
+ headers=_headers,
442
+ auth_settings=_auth,
443
+ prefix_separator_iterator=prefix_separator_iterator,
444
+ timeout=timeout,
445
+ )
446
+
447
+ response_for_status = _status_code_to_response.get(str(response.http_response.status))
448
+ if response_for_status:
449
+ api_response = response_for_status.deserialize(
450
+ response,
451
+ self.api_client.configuration,
452
+ skip_deserialization=skip_deserialization
453
+ )
454
+ else:
455
+ # If response data is JSON then deserialize for SDK consumer convenience
456
+ is_json = api_client.JSONDetector._content_type_is_json(response.http_response.headers.get('Content-Type', ''))
457
+ api_response = api_client.ApiResponseWithoutDeserialization(
458
+ body=json.loads(response.http_response.data) if is_json else response.http_response.data,
459
+ response=response.http_response,
460
+ round_trip_time=response.round_trip_time,
461
+ status=response.http_response.status,
462
+ headers=response.http_response.headers,
463
+ )
464
+
465
+ if not 200 <= api_response.status <= 299:
466
+ raise exceptions.ApiException(api_response=api_response)
467
+
468
+ return api_response
469
+
470
+
471
+ class GetUserAccountOrdersV2(BaseApi):
472
+ # this class is used by api classes that refer to endpoints with operationId fn names
473
+
474
+ async def aget_user_account_orders_v2(
475
+ self,
476
+ user_id: typing.Optional[str] = None,
477
+ user_secret: typing.Optional[str] = None,
478
+ account_id: typing.Optional[str] = None,
479
+ state: typing.Optional[str] = None,
480
+ days: typing.Optional[int] = None,
481
+ query_params: typing.Optional[dict] = {},
482
+ path_params: typing.Optional[dict] = {},
483
+ **kwargs,
484
+ ) -> typing.Union[
485
+ ApiResponseFor200Async,
486
+ api_client.ApiResponseWithoutDeserializationAsync,
487
+ AsyncGeneratorResponse,
488
+ ]:
489
+ args = self._get_user_account_orders_v2_mapped_args(
490
+ query_params=query_params,
491
+ path_params=path_params,
492
+ user_id=user_id,
493
+ user_secret=user_secret,
494
+ account_id=account_id,
495
+ state=state,
496
+ days=days,
497
+ )
498
+ return await self._aget_user_account_orders_v2_oapg(
499
+ query_params=args.query,
500
+ path_params=args.path,
501
+ **kwargs,
502
+ )
503
+
504
+ def get_user_account_orders_v2(
505
+ self,
506
+ user_id: typing.Optional[str] = None,
507
+ user_secret: typing.Optional[str] = None,
508
+ account_id: typing.Optional[str] = None,
509
+ state: typing.Optional[str] = None,
510
+ days: typing.Optional[int] = None,
511
+ query_params: typing.Optional[dict] = {},
512
+ path_params: typing.Optional[dict] = {},
513
+ ) -> typing.Union[
514
+ ApiResponseFor200,
515
+ api_client.ApiResponseWithoutDeserialization,
516
+ ]:
517
+ """ Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. """
518
+ args = self._get_user_account_orders_v2_mapped_args(
519
+ query_params=query_params,
520
+ path_params=path_params,
521
+ user_id=user_id,
522
+ user_secret=user_secret,
523
+ account_id=account_id,
524
+ state=state,
525
+ days=days,
526
+ )
527
+ return self._get_user_account_orders_v2_oapg(
528
+ query_params=args.query,
529
+ path_params=args.path,
530
+ )
531
+
532
+ class ApiForget(BaseApi):
533
+ # this class is used by api classes that refer to endpoints by path and http method names
534
+
535
+ async def aget(
536
+ self,
537
+ user_id: typing.Optional[str] = None,
538
+ user_secret: typing.Optional[str] = None,
539
+ account_id: typing.Optional[str] = None,
540
+ state: typing.Optional[str] = None,
541
+ days: typing.Optional[int] = None,
542
+ query_params: typing.Optional[dict] = {},
543
+ path_params: typing.Optional[dict] = {},
544
+ **kwargs,
545
+ ) -> typing.Union[
546
+ ApiResponseFor200Async,
547
+ api_client.ApiResponseWithoutDeserializationAsync,
548
+ AsyncGeneratorResponse,
549
+ ]:
550
+ args = self._get_user_account_orders_v2_mapped_args(
551
+ query_params=query_params,
552
+ path_params=path_params,
553
+ user_id=user_id,
554
+ user_secret=user_secret,
555
+ account_id=account_id,
556
+ state=state,
557
+ days=days,
558
+ )
559
+ return await self._aget_user_account_orders_v2_oapg(
560
+ query_params=args.query,
561
+ path_params=args.path,
562
+ **kwargs,
563
+ )
564
+
565
+ def get(
566
+ self,
567
+ user_id: typing.Optional[str] = None,
568
+ user_secret: typing.Optional[str] = None,
569
+ account_id: typing.Optional[str] = None,
570
+ state: typing.Optional[str] = None,
571
+ days: typing.Optional[int] = None,
572
+ query_params: typing.Optional[dict] = {},
573
+ path_params: typing.Optional[dict] = {},
574
+ ) -> typing.Union[
575
+ ApiResponseFor200,
576
+ api_client.ApiResponseWithoutDeserialization,
577
+ ]:
578
+ """ Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. """
579
+ args = self._get_user_account_orders_v2_mapped_args(
580
+ query_params=query_params,
581
+ path_params=path_params,
582
+ user_id=user_id,
583
+ user_secret=user_secret,
584
+ account_id=account_id,
585
+ state=state,
586
+ days=days,
587
+ )
588
+ return self._get_user_account_orders_v2_oapg(
589
+ query_params=args.query,
590
+ path_params=args.path,
591
+ )
592
+