snaptrade-python-sdk 11.0.126__py3-none-any.whl → 11.0.128__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.
- snaptrade_client/__init__.py +1 -1
- snaptrade_client/api_client.py +1 -1
- snaptrade_client/apis/path_to_api.py +6 -6
- snaptrade_client/apis/paths/accounts_account_id_orders_details.py +7 -0
- snaptrade_client/apis/paths/brokerages_slug_instruments.py +7 -0
- snaptrade_client/apis/tags/account_information_api_generated.py +1 -1
- snaptrade_client/apis/tags/reference_data_api_generated.py +1 -1
- snaptrade_client/configuration.py +1 -1
- snaptrade_client/model/brokerage_instrument.py +7 -2
- snaptrade_client/model/brokerage_instrument.pyi +7 -2
- snaptrade_client/operation_parameter_map.py +7 -7
- snaptrade_client/paths/__init__.py +2 -2
- snaptrade_client/paths/{brokerages_brokerage_id_instruments → accounts_account_id_orders_details}/__init__.py +2 -2
- snaptrade_client/paths/{accounts_account_id_orders_brokerage_order_id/get.py → accounts_account_id_orders_details/post.py} +167 -37
- snaptrade_client/paths/{accounts_account_id_orders_brokerage_order_id/get.pyi → accounts_account_id_orders_details/post.pyi} +166 -37
- snaptrade_client/paths/{accounts_account_id_orders_brokerage_order_id → brokerages_slug_instruments}/__init__.py +2 -2
- snaptrade_client/paths/{brokerages_brokerage_id_instruments → brokerages_slug_instruments}/get.py +20 -20
- snaptrade_client/paths/{brokerages_brokerage_id_instruments → brokerages_slug_instruments}/get.pyi +20 -20
- snaptrade_client/type/brokerage_instrument.py +2 -3
- {snaptrade_python_sdk-11.0.126.dist-info → snaptrade_python_sdk-11.0.128.dist-info}/METADATA +20 -13
- {snaptrade_python_sdk-11.0.126.dist-info → snaptrade_python_sdk-11.0.128.dist-info}/RECORD +23 -23
- snaptrade_client/apis/paths/accounts_account_id_orders_brokerage_order_id.py +0 -7
- snaptrade_client/apis/paths/brokerages_brokerage_id_instruments.py +0 -7
- {snaptrade_python_sdk-11.0.126.dist-info → snaptrade_python_sdk-11.0.128.dist-info}/LICENSE +0 -0
- {snaptrade_python_sdk-11.0.126.dist-info → snaptrade_python_sdk-11.0.128.dist-info}/WHEEL +0 -0
|
@@ -32,10 +32,12 @@ import frozendict # noqa: F401
|
|
|
32
32
|
|
|
33
33
|
from snaptrade_client import schemas # noqa: F401
|
|
34
34
|
|
|
35
|
+
from snaptrade_client.model.model400_failed_request_response import Model400FailedRequestResponse as Model400FailedRequestResponseSchema
|
|
35
36
|
from snaptrade_client.model.account_order_record import AccountOrderRecord as AccountOrderRecordSchema
|
|
36
37
|
from snaptrade_client.model.model500_unexpected_exception_response import Model500UnexpectedExceptionResponse as Model500UnexpectedExceptionResponseSchema
|
|
37
38
|
from snaptrade_client.model.model404_failed_request_response import Model404FailedRequestResponse as Model404FailedRequestResponseSchema
|
|
38
39
|
|
|
40
|
+
from snaptrade_client.type.model400_failed_request_response import Model400FailedRequestResponse
|
|
39
41
|
from snaptrade_client.type.model500_unexpected_exception_response import Model500UnexpectedExceptionResponse
|
|
40
42
|
from snaptrade_client.type.account_order_record import AccountOrderRecord
|
|
41
43
|
from snaptrade_client.type.model404_failed_request_response import Model404FailedRequestResponse
|
|
@@ -78,12 +80,10 @@ request_query_user_secret = api_client.QueryParameter(
|
|
|
78
80
|
)
|
|
79
81
|
# Path params
|
|
80
82
|
AccountIdSchema = schemas.UUIDSchema
|
|
81
|
-
BrokerageOrderIdSchema = schemas.StrSchema
|
|
82
83
|
RequestRequiredPathParams = typing_extensions.TypedDict(
|
|
83
84
|
'RequestRequiredPathParams',
|
|
84
85
|
{
|
|
85
86
|
'accountId': typing.Union[AccountIdSchema, str, uuid.UUID, ],
|
|
86
|
-
'brokerageOrderId': typing.Union[BrokerageOrderIdSchema, str, ],
|
|
87
87
|
}
|
|
88
88
|
)
|
|
89
89
|
RequestOptionalPathParams = typing_extensions.TypedDict(
|
|
@@ -104,10 +104,69 @@ request_path_account_id = api_client.PathParameter(
|
|
|
104
104
|
schema=AccountIdSchema,
|
|
105
105
|
required=True,
|
|
106
106
|
)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
# body param
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class SchemaForRequestBodyApplicationJson(
|
|
111
|
+
schemas.DictSchema
|
|
112
|
+
):
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
class MetaOapg:
|
|
116
|
+
required = {
|
|
117
|
+
"external_order_id",
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
class properties:
|
|
121
|
+
external_order_id = schemas.StrSchema
|
|
122
|
+
__annotations__ = {
|
|
123
|
+
"external_order_id": external_order_id,
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
external_order_id: MetaOapg.properties.external_order_id
|
|
127
|
+
|
|
128
|
+
@typing.overload
|
|
129
|
+
def __getitem__(self, name: typing_extensions.Literal["external_order_id"]) -> MetaOapg.properties.external_order_id: ...
|
|
130
|
+
|
|
131
|
+
@typing.overload
|
|
132
|
+
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
|
133
|
+
|
|
134
|
+
def __getitem__(self, name: typing.Union[typing_extensions.Literal["external_order_id", ], str]):
|
|
135
|
+
# dict_instance[name] accessor
|
|
136
|
+
return super().__getitem__(name)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
@typing.overload
|
|
140
|
+
def get_item_oapg(self, name: typing_extensions.Literal["external_order_id"]) -> MetaOapg.properties.external_order_id: ...
|
|
141
|
+
|
|
142
|
+
@typing.overload
|
|
143
|
+
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
|
144
|
+
|
|
145
|
+
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["external_order_id", ], str]):
|
|
146
|
+
return super().get_item_oapg(name)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def __new__(
|
|
150
|
+
cls,
|
|
151
|
+
*args: typing.Union[dict, frozendict.frozendict, ],
|
|
152
|
+
external_order_id: typing.Union[MetaOapg.properties.external_order_id, str, ],
|
|
153
|
+
_configuration: typing.Optional[schemas.Configuration] = None,
|
|
154
|
+
**kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes],
|
|
155
|
+
) -> 'SchemaForRequestBodyApplicationJson':
|
|
156
|
+
return super().__new__(
|
|
157
|
+
cls,
|
|
158
|
+
*args,
|
|
159
|
+
external_order_id=external_order_id,
|
|
160
|
+
_configuration=_configuration,
|
|
161
|
+
**kwargs,
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
request_body_typing_any = api_client.RequestBody(
|
|
166
|
+
content={
|
|
167
|
+
'application/json': api_client.MediaType(
|
|
168
|
+
schema=SchemaForRequestBodyApplicationJson),
|
|
169
|
+
},
|
|
111
170
|
required=True,
|
|
112
171
|
)
|
|
113
172
|
SchemaFor200ResponseBodyApplicationJson = AccountOrderRecordSchema
|
|
@@ -131,6 +190,27 @@ _response_for_200 = api_client.OpenApiResponse(
|
|
|
131
190
|
schema=SchemaFor200ResponseBodyApplicationJson),
|
|
132
191
|
},
|
|
133
192
|
)
|
|
193
|
+
SchemaFor400ResponseBodyApplicationJson = Model400FailedRequestResponseSchema
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
@dataclass
|
|
197
|
+
class ApiResponseFor400(api_client.ApiResponse):
|
|
198
|
+
body: Model400FailedRequestResponse
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
@dataclass
|
|
202
|
+
class ApiResponseFor400Async(api_client.AsyncApiResponse):
|
|
203
|
+
body: Model400FailedRequestResponse
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
_response_for_400 = api_client.OpenApiResponse(
|
|
207
|
+
response_cls=ApiResponseFor400,
|
|
208
|
+
response_cls_async=ApiResponseFor400Async,
|
|
209
|
+
content={
|
|
210
|
+
'application/json': api_client.MediaType(
|
|
211
|
+
schema=SchemaFor400ResponseBodyApplicationJson),
|
|
212
|
+
},
|
|
213
|
+
)
|
|
134
214
|
SchemaFor404ResponseBodyApplicationJson = Model404FailedRequestResponseSchema
|
|
135
215
|
|
|
136
216
|
|
|
@@ -182,35 +262,40 @@ class BaseApi(api_client.Api):
|
|
|
182
262
|
|
|
183
263
|
def _get_user_account_order_detail_mapped_args(
|
|
184
264
|
self,
|
|
265
|
+
body: typing.Optional[typing.Any] = None,
|
|
266
|
+
external_order_id: typing.Optional[str] = None,
|
|
267
|
+
account_id: typing.Optional[str] = None,
|
|
185
268
|
user_id: typing.Optional[str] = None,
|
|
186
269
|
user_secret: typing.Optional[str] = None,
|
|
187
|
-
account_id: typing.Optional[str] = None,
|
|
188
|
-
brokerage_order_id: typing.Optional[str] = None,
|
|
189
270
|
query_params: typing.Optional[dict] = {},
|
|
190
271
|
path_params: typing.Optional[dict] = {},
|
|
191
272
|
) -> api_client.MappedArgs:
|
|
192
273
|
args: api_client.MappedArgs = api_client.MappedArgs()
|
|
193
274
|
_query_params = {}
|
|
194
275
|
_path_params = {}
|
|
276
|
+
_body = {}
|
|
277
|
+
if external_order_id is not None:
|
|
278
|
+
_body["external_order_id"] = external_order_id
|
|
279
|
+
args.body = body if body is not None else _body
|
|
195
280
|
if user_id is not None:
|
|
196
281
|
_query_params["userId"] = user_id
|
|
197
282
|
if user_secret is not None:
|
|
198
283
|
_query_params["userSecret"] = user_secret
|
|
199
284
|
if account_id is not None:
|
|
200
285
|
_path_params["accountId"] = account_id
|
|
201
|
-
if brokerage_order_id is not None:
|
|
202
|
-
_path_params["brokerageOrderId"] = brokerage_order_id
|
|
203
286
|
args.query = query_params if query_params else _query_params
|
|
204
287
|
args.path = path_params if path_params else _path_params
|
|
205
288
|
return args
|
|
206
289
|
|
|
207
290
|
async def _aget_user_account_order_detail_oapg(
|
|
208
291
|
self,
|
|
292
|
+
body: typing.Any = None,
|
|
209
293
|
query_params: typing.Optional[dict] = {},
|
|
210
294
|
path_params: typing.Optional[dict] = {},
|
|
211
295
|
skip_deserialization: bool = True,
|
|
212
296
|
timeout: typing.Optional[typing.Union[float, typing.Tuple]] = None,
|
|
213
297
|
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
|
|
298
|
+
content_type: str = 'application/json',
|
|
214
299
|
stream: bool = False,
|
|
215
300
|
**kwargs,
|
|
216
301
|
) -> typing.Union[
|
|
@@ -231,7 +316,6 @@ class BaseApi(api_client.Api):
|
|
|
231
316
|
_path_params = {}
|
|
232
317
|
for parameter in (
|
|
233
318
|
request_path_account_id,
|
|
234
|
-
request_path_brokerage_order_id,
|
|
235
319
|
):
|
|
236
320
|
parameter_data = path_params.get(parameter.name, schemas.unset)
|
|
237
321
|
if parameter_data is schemas.unset:
|
|
@@ -261,20 +345,36 @@ class BaseApi(api_client.Api):
|
|
|
261
345
|
if accept_content_types:
|
|
262
346
|
for accept_content_type in accept_content_types:
|
|
263
347
|
_headers.add('Accept', accept_content_type)
|
|
264
|
-
method = '
|
|
348
|
+
method = 'post'.upper()
|
|
349
|
+
_headers.add('Content-Type', content_type)
|
|
350
|
+
|
|
351
|
+
if body is schemas.unset:
|
|
352
|
+
raise exceptions.ApiValueError(
|
|
353
|
+
'The required body parameter has an invalid value of: unset. Set a valid value instead')
|
|
354
|
+
_fields = None
|
|
355
|
+
_body = None
|
|
265
356
|
request_before_hook(
|
|
266
357
|
resource_path=used_path,
|
|
267
358
|
method=method,
|
|
268
359
|
configuration=self.api_client.configuration,
|
|
269
|
-
path_template='/accounts/{accountId}/orders/
|
|
360
|
+
path_template='/accounts/{accountId}/orders/details',
|
|
361
|
+
body=body,
|
|
270
362
|
auth_settings=_auth,
|
|
271
363
|
headers=_headers,
|
|
272
364
|
)
|
|
365
|
+
serialized_data = request_body_typing_any.serialize(body, content_type)
|
|
366
|
+
if 'fields' in serialized_data:
|
|
367
|
+
_fields = serialized_data['fields']
|
|
368
|
+
elif 'body' in serialized_data:
|
|
369
|
+
_body = serialized_data['body']
|
|
273
370
|
|
|
274
371
|
response = await self.api_client.async_call_api(
|
|
275
372
|
resource_path=used_path,
|
|
276
373
|
method=method,
|
|
277
374
|
headers=_headers,
|
|
375
|
+
fields=_fields,
|
|
376
|
+
serialized_body=_body,
|
|
377
|
+
body=body,
|
|
278
378
|
auth_settings=_auth,
|
|
279
379
|
prefix_separator_iterator=prefix_separator_iterator,
|
|
280
380
|
timeout=timeout,
|
|
@@ -337,11 +437,13 @@ class BaseApi(api_client.Api):
|
|
|
337
437
|
|
|
338
438
|
def _get_user_account_order_detail_oapg(
|
|
339
439
|
self,
|
|
440
|
+
body: typing.Any = None,
|
|
340
441
|
query_params: typing.Optional[dict] = {},
|
|
341
442
|
path_params: typing.Optional[dict] = {},
|
|
342
443
|
skip_deserialization: bool = True,
|
|
343
444
|
timeout: typing.Optional[typing.Union[float, typing.Tuple]] = None,
|
|
344
445
|
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
|
|
446
|
+
content_type: str = 'application/json',
|
|
345
447
|
stream: bool = False,
|
|
346
448
|
) -> typing.Union[
|
|
347
449
|
ApiResponseFor200,
|
|
@@ -360,7 +462,6 @@ class BaseApi(api_client.Api):
|
|
|
360
462
|
_path_params = {}
|
|
361
463
|
for parameter in (
|
|
362
464
|
request_path_account_id,
|
|
363
|
-
request_path_brokerage_order_id,
|
|
364
465
|
):
|
|
365
466
|
parameter_data = path_params.get(parameter.name, schemas.unset)
|
|
366
467
|
if parameter_data is schemas.unset:
|
|
@@ -390,20 +491,36 @@ class BaseApi(api_client.Api):
|
|
|
390
491
|
if accept_content_types:
|
|
391
492
|
for accept_content_type in accept_content_types:
|
|
392
493
|
_headers.add('Accept', accept_content_type)
|
|
393
|
-
method = '
|
|
494
|
+
method = 'post'.upper()
|
|
495
|
+
_headers.add('Content-Type', content_type)
|
|
496
|
+
|
|
497
|
+
if body is schemas.unset:
|
|
498
|
+
raise exceptions.ApiValueError(
|
|
499
|
+
'The required body parameter has an invalid value of: unset. Set a valid value instead')
|
|
500
|
+
_fields = None
|
|
501
|
+
_body = None
|
|
394
502
|
request_before_hook(
|
|
395
503
|
resource_path=used_path,
|
|
396
504
|
method=method,
|
|
397
505
|
configuration=self.api_client.configuration,
|
|
398
|
-
path_template='/accounts/{accountId}/orders/
|
|
506
|
+
path_template='/accounts/{accountId}/orders/details',
|
|
507
|
+
body=body,
|
|
399
508
|
auth_settings=_auth,
|
|
400
509
|
headers=_headers,
|
|
401
510
|
)
|
|
511
|
+
serialized_data = request_body_typing_any.serialize(body, content_type)
|
|
512
|
+
if 'fields' in serialized_data:
|
|
513
|
+
_fields = serialized_data['fields']
|
|
514
|
+
elif 'body' in serialized_data:
|
|
515
|
+
_body = serialized_data['body']
|
|
402
516
|
|
|
403
517
|
response = self.api_client.call_api(
|
|
404
518
|
resource_path=used_path,
|
|
405
519
|
method=method,
|
|
406
520
|
headers=_headers,
|
|
521
|
+
fields=_fields,
|
|
522
|
+
serialized_body=_body,
|
|
523
|
+
body=body,
|
|
407
524
|
auth_settings=_auth,
|
|
408
525
|
prefix_separator_iterator=prefix_separator_iterator,
|
|
409
526
|
timeout=timeout,
|
|
@@ -438,10 +555,11 @@ class GetUserAccountOrderDetail(BaseApi):
|
|
|
438
555
|
|
|
439
556
|
async def aget_user_account_order_detail(
|
|
440
557
|
self,
|
|
558
|
+
body: typing.Optional[typing.Any] = None,
|
|
559
|
+
external_order_id: typing.Optional[str] = None,
|
|
560
|
+
account_id: typing.Optional[str] = None,
|
|
441
561
|
user_id: typing.Optional[str] = None,
|
|
442
562
|
user_secret: typing.Optional[str] = None,
|
|
443
|
-
account_id: typing.Optional[str] = None,
|
|
444
|
-
brokerage_order_id: typing.Optional[str] = None,
|
|
445
563
|
query_params: typing.Optional[dict] = {},
|
|
446
564
|
path_params: typing.Optional[dict] = {},
|
|
447
565
|
**kwargs,
|
|
@@ -451,14 +569,16 @@ class GetUserAccountOrderDetail(BaseApi):
|
|
|
451
569
|
AsyncGeneratorResponse,
|
|
452
570
|
]:
|
|
453
571
|
args = self._get_user_account_order_detail_mapped_args(
|
|
572
|
+
body=body,
|
|
454
573
|
query_params=query_params,
|
|
455
574
|
path_params=path_params,
|
|
575
|
+
external_order_id=external_order_id,
|
|
576
|
+
account_id=account_id,
|
|
456
577
|
user_id=user_id,
|
|
457
578
|
user_secret=user_secret,
|
|
458
|
-
account_id=account_id,
|
|
459
|
-
brokerage_order_id=brokerage_order_id,
|
|
460
579
|
)
|
|
461
580
|
return await self._aget_user_account_order_detail_oapg(
|
|
581
|
+
body=args.body,
|
|
462
582
|
query_params=args.query,
|
|
463
583
|
path_params=args.path,
|
|
464
584
|
**kwargs,
|
|
@@ -466,39 +586,43 @@ class GetUserAccountOrderDetail(BaseApi):
|
|
|
466
586
|
|
|
467
587
|
def get_user_account_order_detail(
|
|
468
588
|
self,
|
|
589
|
+
body: typing.Optional[typing.Any] = None,
|
|
590
|
+
external_order_id: typing.Optional[str] = None,
|
|
591
|
+
account_id: typing.Optional[str] = None,
|
|
469
592
|
user_id: typing.Optional[str] = None,
|
|
470
593
|
user_secret: typing.Optional[str] = None,
|
|
471
|
-
account_id: typing.Optional[str] = None,
|
|
472
|
-
brokerage_order_id: typing.Optional[str] = None,
|
|
473
594
|
query_params: typing.Optional[dict] = {},
|
|
474
595
|
path_params: typing.Optional[dict] = {},
|
|
475
596
|
) -> typing.Union[
|
|
476
597
|
ApiResponseFor200,
|
|
477
598
|
api_client.ApiResponseWithoutDeserialization,
|
|
478
599
|
]:
|
|
479
|
-
""" Returns the detail of a single order in the
|
|
600
|
+
""" Returns the detail of a single order using the external order ID provided in the request body. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint. """
|
|
480
601
|
args = self._get_user_account_order_detail_mapped_args(
|
|
602
|
+
body=body,
|
|
481
603
|
query_params=query_params,
|
|
482
604
|
path_params=path_params,
|
|
605
|
+
external_order_id=external_order_id,
|
|
606
|
+
account_id=account_id,
|
|
483
607
|
user_id=user_id,
|
|
484
608
|
user_secret=user_secret,
|
|
485
|
-
account_id=account_id,
|
|
486
|
-
brokerage_order_id=brokerage_order_id,
|
|
487
609
|
)
|
|
488
610
|
return self._get_user_account_order_detail_oapg(
|
|
611
|
+
body=args.body,
|
|
489
612
|
query_params=args.query,
|
|
490
613
|
path_params=args.path,
|
|
491
614
|
)
|
|
492
615
|
|
|
493
|
-
class
|
|
616
|
+
class ApiForpost(BaseApi):
|
|
494
617
|
# this class is used by api classes that refer to endpoints by path and http method names
|
|
495
618
|
|
|
496
|
-
async def
|
|
619
|
+
async def apost(
|
|
497
620
|
self,
|
|
621
|
+
body: typing.Optional[typing.Any] = None,
|
|
622
|
+
external_order_id: typing.Optional[str] = None,
|
|
623
|
+
account_id: typing.Optional[str] = None,
|
|
498
624
|
user_id: typing.Optional[str] = None,
|
|
499
625
|
user_secret: typing.Optional[str] = None,
|
|
500
|
-
account_id: typing.Optional[str] = None,
|
|
501
|
-
brokerage_order_id: typing.Optional[str] = None,
|
|
502
626
|
query_params: typing.Optional[dict] = {},
|
|
503
627
|
path_params: typing.Optional[dict] = {},
|
|
504
628
|
**kwargs,
|
|
@@ -508,41 +632,46 @@ class ApiForget(BaseApi):
|
|
|
508
632
|
AsyncGeneratorResponse,
|
|
509
633
|
]:
|
|
510
634
|
args = self._get_user_account_order_detail_mapped_args(
|
|
635
|
+
body=body,
|
|
511
636
|
query_params=query_params,
|
|
512
637
|
path_params=path_params,
|
|
638
|
+
external_order_id=external_order_id,
|
|
639
|
+
account_id=account_id,
|
|
513
640
|
user_id=user_id,
|
|
514
641
|
user_secret=user_secret,
|
|
515
|
-
account_id=account_id,
|
|
516
|
-
brokerage_order_id=brokerage_order_id,
|
|
517
642
|
)
|
|
518
643
|
return await self._aget_user_account_order_detail_oapg(
|
|
644
|
+
body=args.body,
|
|
519
645
|
query_params=args.query,
|
|
520
646
|
path_params=args.path,
|
|
521
647
|
**kwargs,
|
|
522
648
|
)
|
|
523
649
|
|
|
524
|
-
def
|
|
650
|
+
def post(
|
|
525
651
|
self,
|
|
652
|
+
body: typing.Optional[typing.Any] = None,
|
|
653
|
+
external_order_id: typing.Optional[str] = None,
|
|
654
|
+
account_id: typing.Optional[str] = None,
|
|
526
655
|
user_id: typing.Optional[str] = None,
|
|
527
656
|
user_secret: typing.Optional[str] = None,
|
|
528
|
-
account_id: typing.Optional[str] = None,
|
|
529
|
-
brokerage_order_id: typing.Optional[str] = None,
|
|
530
657
|
query_params: typing.Optional[dict] = {},
|
|
531
658
|
path_params: typing.Optional[dict] = {},
|
|
532
659
|
) -> typing.Union[
|
|
533
660
|
ApiResponseFor200,
|
|
534
661
|
api_client.ApiResponseWithoutDeserialization,
|
|
535
662
|
]:
|
|
536
|
-
""" Returns the detail of a single order in the
|
|
663
|
+
""" Returns the detail of a single order using the external order ID provided in the request body. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint. """
|
|
537
664
|
args = self._get_user_account_order_detail_mapped_args(
|
|
665
|
+
body=body,
|
|
538
666
|
query_params=query_params,
|
|
539
667
|
path_params=path_params,
|
|
668
|
+
external_order_id=external_order_id,
|
|
669
|
+
account_id=account_id,
|
|
540
670
|
user_id=user_id,
|
|
541
671
|
user_secret=user_secret,
|
|
542
|
-
account_id=account_id,
|
|
543
|
-
brokerage_order_id=brokerage_order_id,
|
|
544
672
|
)
|
|
545
673
|
return self._get_user_account_order_detail_oapg(
|
|
674
|
+
body=args.body,
|
|
546
675
|
query_params=args.query,
|
|
547
676
|
path_params=args.path,
|
|
548
677
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# do not import all endpoints into this module because that uses a lot of memory and stack frames
|
|
2
2
|
# if you need the ability to import all endpoints from this module, import them with
|
|
3
|
-
# from snaptrade_client.paths.
|
|
3
|
+
# from snaptrade_client.paths.brokerages_slug_instruments import Api
|
|
4
4
|
|
|
5
5
|
from snaptrade_client.paths import PathValues
|
|
6
6
|
|
|
7
|
-
path = PathValues.
|
|
7
|
+
path = PathValues.BROKERAGES_SLUG_INSTRUMENTS
|
snaptrade_client/paths/{brokerages_brokerage_id_instruments → brokerages_slug_instruments}/get.py
RENAMED
|
@@ -39,11 +39,11 @@ from snaptrade_client.type.brokerage_instruments_response import BrokerageInstru
|
|
|
39
39
|
from . import path
|
|
40
40
|
|
|
41
41
|
# Path params
|
|
42
|
-
|
|
42
|
+
SlugSchema = schemas.StrSchema
|
|
43
43
|
RequestRequiredPathParams = typing_extensions.TypedDict(
|
|
44
44
|
'RequestRequiredPathParams',
|
|
45
45
|
{
|
|
46
|
-
'
|
|
46
|
+
'slug': typing.Union[SlugSchema, str, ],
|
|
47
47
|
}
|
|
48
48
|
)
|
|
49
49
|
RequestOptionalPathParams = typing_extensions.TypedDict(
|
|
@@ -58,10 +58,10 @@ class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams):
|
|
|
58
58
|
pass
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
name="
|
|
61
|
+
request_path_slug = api_client.PathParameter(
|
|
62
|
+
name="slug",
|
|
63
63
|
style=api_client.ParameterStyle.SIMPLE,
|
|
64
|
-
schema=
|
|
64
|
+
schema=SlugSchema,
|
|
65
65
|
required=True,
|
|
66
66
|
)
|
|
67
67
|
_auth = [
|
|
@@ -118,13 +118,13 @@ class BaseApi(api_client.Api):
|
|
|
118
118
|
|
|
119
119
|
def _list_all_brokerage_instruments_mapped_args(
|
|
120
120
|
self,
|
|
121
|
-
|
|
121
|
+
slug: typing.Optional[str] = None,
|
|
122
122
|
path_params: typing.Optional[dict] = {},
|
|
123
123
|
) -> api_client.MappedArgs:
|
|
124
124
|
args: api_client.MappedArgs = api_client.MappedArgs()
|
|
125
125
|
_path_params = {}
|
|
126
|
-
if
|
|
127
|
-
_path_params["
|
|
126
|
+
if slug is not None:
|
|
127
|
+
_path_params["slug"] = slug
|
|
128
128
|
args.path = path_params if path_params else _path_params
|
|
129
129
|
return args
|
|
130
130
|
|
|
@@ -153,7 +153,7 @@ class BaseApi(api_client.Api):
|
|
|
153
153
|
|
|
154
154
|
_path_params = {}
|
|
155
155
|
for parameter in (
|
|
156
|
-
|
|
156
|
+
request_path_slug,
|
|
157
157
|
):
|
|
158
158
|
parameter_data = path_params.get(parameter.name, schemas.unset)
|
|
159
159
|
if parameter_data is schemas.unset:
|
|
@@ -174,7 +174,7 @@ class BaseApi(api_client.Api):
|
|
|
174
174
|
resource_path=used_path,
|
|
175
175
|
method=method,
|
|
176
176
|
configuration=self.api_client.configuration,
|
|
177
|
-
path_template='/brokerages/{
|
|
177
|
+
path_template='/brokerages/{slug}/instruments',
|
|
178
178
|
auth_settings=_auth,
|
|
179
179
|
headers=_headers,
|
|
180
180
|
)
|
|
@@ -270,7 +270,7 @@ class BaseApi(api_client.Api):
|
|
|
270
270
|
|
|
271
271
|
_path_params = {}
|
|
272
272
|
for parameter in (
|
|
273
|
-
|
|
273
|
+
request_path_slug,
|
|
274
274
|
):
|
|
275
275
|
parameter_data = path_params.get(parameter.name, schemas.unset)
|
|
276
276
|
if parameter_data is schemas.unset:
|
|
@@ -291,7 +291,7 @@ class BaseApi(api_client.Api):
|
|
|
291
291
|
resource_path=used_path,
|
|
292
292
|
method=method,
|
|
293
293
|
configuration=self.api_client.configuration,
|
|
294
|
-
path_template='/brokerages/{
|
|
294
|
+
path_template='/brokerages/{slug}/instruments',
|
|
295
295
|
auth_settings=_auth,
|
|
296
296
|
headers=_headers,
|
|
297
297
|
)
|
|
@@ -338,7 +338,7 @@ class ListAllBrokerageInstruments(BaseApi):
|
|
|
338
338
|
|
|
339
339
|
async def alist_all_brokerage_instruments(
|
|
340
340
|
self,
|
|
341
|
-
|
|
341
|
+
slug: typing.Optional[str] = None,
|
|
342
342
|
path_params: typing.Optional[dict] = {},
|
|
343
343
|
**kwargs,
|
|
344
344
|
) -> typing.Union[
|
|
@@ -349,7 +349,7 @@ class ListAllBrokerageInstruments(BaseApi):
|
|
|
349
349
|
]:
|
|
350
350
|
args = self._list_all_brokerage_instruments_mapped_args(
|
|
351
351
|
path_params=path_params,
|
|
352
|
-
|
|
352
|
+
slug=slug,
|
|
353
353
|
)
|
|
354
354
|
return await self._alist_all_brokerage_instruments_oapg(
|
|
355
355
|
path_params=args.path,
|
|
@@ -358,7 +358,7 @@ class ListAllBrokerageInstruments(BaseApi):
|
|
|
358
358
|
|
|
359
359
|
def list_all_brokerage_instruments(
|
|
360
360
|
self,
|
|
361
|
-
|
|
361
|
+
slug: typing.Optional[str] = None,
|
|
362
362
|
path_params: typing.Optional[dict] = {},
|
|
363
363
|
) -> typing.Union[
|
|
364
364
|
ApiResponseFor200,
|
|
@@ -368,7 +368,7 @@ class ListAllBrokerageInstruments(BaseApi):
|
|
|
368
368
|
""" Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don't will return an empty list. """
|
|
369
369
|
args = self._list_all_brokerage_instruments_mapped_args(
|
|
370
370
|
path_params=path_params,
|
|
371
|
-
|
|
371
|
+
slug=slug,
|
|
372
372
|
)
|
|
373
373
|
return self._list_all_brokerage_instruments_oapg(
|
|
374
374
|
path_params=args.path,
|
|
@@ -379,7 +379,7 @@ class ApiForget(BaseApi):
|
|
|
379
379
|
|
|
380
380
|
async def aget(
|
|
381
381
|
self,
|
|
382
|
-
|
|
382
|
+
slug: typing.Optional[str] = None,
|
|
383
383
|
path_params: typing.Optional[dict] = {},
|
|
384
384
|
**kwargs,
|
|
385
385
|
) -> typing.Union[
|
|
@@ -390,7 +390,7 @@ class ApiForget(BaseApi):
|
|
|
390
390
|
]:
|
|
391
391
|
args = self._list_all_brokerage_instruments_mapped_args(
|
|
392
392
|
path_params=path_params,
|
|
393
|
-
|
|
393
|
+
slug=slug,
|
|
394
394
|
)
|
|
395
395
|
return await self._alist_all_brokerage_instruments_oapg(
|
|
396
396
|
path_params=args.path,
|
|
@@ -399,7 +399,7 @@ class ApiForget(BaseApi):
|
|
|
399
399
|
|
|
400
400
|
def get(
|
|
401
401
|
self,
|
|
402
|
-
|
|
402
|
+
slug: typing.Optional[str] = None,
|
|
403
403
|
path_params: typing.Optional[dict] = {},
|
|
404
404
|
) -> typing.Union[
|
|
405
405
|
ApiResponseFor200,
|
|
@@ -409,7 +409,7 @@ class ApiForget(BaseApi):
|
|
|
409
409
|
""" Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don't will return an empty list. """
|
|
410
410
|
args = self._list_all_brokerage_instruments_mapped_args(
|
|
411
411
|
path_params=path_params,
|
|
412
|
-
|
|
412
|
+
slug=slug,
|
|
413
413
|
)
|
|
414
414
|
return self._list_all_brokerage_instruments_oapg(
|
|
415
415
|
path_params=args.path,
|