snaptrade-python-sdk 13.1.0__py3-none-any.whl → 13.1.2__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 (36) hide show
  1. snaptrade_client/__init__.py +1 -1
  2. snaptrade_client/api_client.py +1 -1
  3. snaptrade_client/configuration.py +1 -1
  4. snaptrade_client/model/account_order.py +12 -27
  5. snaptrade_client/model/account_order.pyi +12 -27
  6. snaptrade_client/model/cash_instrument.py +1 -3
  7. snaptrade_client/model/cash_instrument.pyi +1 -3
  8. snaptrade_client/model/instrument.py +4 -0
  9. snaptrade_client/model/instrument.pyi +4 -0
  10. snaptrade_client/model/preferred_stock_instrument.py +236 -0
  11. snaptrade_client/model/preferred_stock_instrument.pyi +230 -0
  12. snaptrade_client/model/priced_in_instrument.py +80 -0
  13. snaptrade_client/model/priced_in_instrument.pyi +80 -0
  14. snaptrade_client/model/priced_in_instrument_nullable.py +80 -0
  15. snaptrade_client/model/priced_in_instrument_nullable.pyi +80 -0
  16. snaptrade_client/model/underlying_cfd_instrument.py +4 -0
  17. snaptrade_client/model/underlying_cfd_instrument.pyi +4 -0
  18. snaptrade_client/model/underlying_option_instrument.py +4 -0
  19. snaptrade_client/model/underlying_option_instrument.pyi +4 -0
  20. snaptrade_client/models/__init__.py +3 -0
  21. snaptrade_client/paths/accounts_account_id_positions_all/get.py +2 -2
  22. snaptrade_client/paths/accounts_account_id_trading_simple/post.py +92 -2
  23. snaptrade_client/type/account_order.py +2 -2
  24. snaptrade_client/type/account_position.py +1 -1
  25. snaptrade_client/type/instrument.py +2 -1
  26. snaptrade_client/type/preferred_stock_instrument.py +47 -0
  27. snaptrade_client/type/priced_in_instrument.py +21 -0
  28. snaptrade_client/type/priced_in_instrument_nullable.py +21 -0
  29. snaptrade_client/type/simple_trade_form.py +2 -2
  30. snaptrade_client/type/simple_trade_instrument.py +1 -1
  31. snaptrade_client/type/underlying_cfd_instrument.py +2 -1
  32. snaptrade_client/type/underlying_option_instrument.py +2 -1
  33. {snaptrade_python_sdk-13.1.0.dist-info → snaptrade_python_sdk-13.1.2.dist-info}/METADATA +11 -9
  34. {snaptrade_python_sdk-13.1.0.dist-info → snaptrade_python_sdk-13.1.2.dist-info}/RECORD +36 -27
  35. {snaptrade_python_sdk-13.1.0.dist-info → snaptrade_python_sdk-13.1.2.dist-info}/LICENSE +0 -0
  36. {snaptrade_python_sdk-13.1.0.dist-info → snaptrade_python_sdk-13.1.2.dist-info}/WHEEL +0 -0
@@ -12,7 +12,7 @@
12
12
  Created by: https://snaptrade.com/
13
13
  """
14
14
 
15
- __version__ = "13.1.0"
15
+ __version__ = "13.1.2"
16
16
 
17
17
  # import ApiClient
18
18
  from snaptrade_client.api_client import ApiClient
@@ -1175,7 +1175,7 @@ class ApiClient(typing.Generic[TAuth]):
1175
1175
  self.default_headers[header_name] = header_value
1176
1176
  self.cookie = cookie
1177
1177
  # Set default User-Agent.
1178
- self.user_agent = 'Konfig/13.1.0/python'
1178
+ self.user_agent = 'Konfig/13.1.2/python'
1179
1179
 
1180
1180
  def __enter__(self):
1181
1181
  return self
@@ -519,7 +519,7 @@ conf = snaptrade_client.Configuration(
519
519
  "OS: {env}\n"\
520
520
  "Python Version: {pyversion}\n"\
521
521
  "Version of the API: 1.0.0\n"\
522
- "SDK Package Version: 13.1.0".\
522
+ "SDK Package Version: 13.1.2".\
523
523
  format(env=sys.platform, pyversion=sys.version)
524
524
 
525
525
  def get_host_settings(self):
@@ -193,26 +193,10 @@ class AccountOrder(
193
193
  *args,
194
194
  _configuration=_configuration,
195
195
  )
196
-
197
-
198
- class price_currency(
199
- schemas.StrBase,
200
- schemas.NoneBase,
201
- schemas.Schema,
202
- schemas.NoneStrMixin
203
- ):
204
-
205
-
206
- def __new__(
207
- cls,
208
- *args: typing.Union[None, str, ],
209
- _configuration: typing.Optional[schemas.Configuration] = None,
210
- ) -> 'price_currency':
211
- return super().__new__(
212
- cls,
213
- *args,
214
- _configuration=_configuration,
215
- )
196
+
197
+ @staticmethod
198
+ def priced_in() -> typing.Type['PricedInInstrumentNullable']:
199
+ return PricedInInstrumentNullable
216
200
 
217
201
 
218
202
  class total_quantity(
@@ -420,7 +404,7 @@ class AccountOrder(
420
404
  "price_effect": price_effect,
421
405
  "legs": legs,
422
406
  "expiry_date": expiry_date,
423
- "price_currency": price_currency,
407
+ "priced_in": priced_in,
424
408
  "total_quantity": total_quantity,
425
409
  "filled_quantity": filled_quantity,
426
410
  "canceled_quantity": canceled_quantity,
@@ -462,7 +446,7 @@ class AccountOrder(
462
446
  def __getitem__(self, name: typing_extensions.Literal["expiry_date"]) -> MetaOapg.properties.expiry_date: ...
463
447
 
464
448
  @typing.overload
465
- def __getitem__(self, name: typing_extensions.Literal["price_currency"]) -> MetaOapg.properties.price_currency: ...
449
+ def __getitem__(self, name: typing_extensions.Literal["priced_in"]) -> 'PricedInInstrumentNullable': ...
466
450
 
467
451
  @typing.overload
468
452
  def __getitem__(self, name: typing_extensions.Literal["total_quantity"]) -> MetaOapg.properties.total_quantity: ...
@@ -494,7 +478,7 @@ class AccountOrder(
494
478
  @typing.overload
495
479
  def __getitem__(self, name: str) -> MetaOapg.additional_properties: ...
496
480
 
497
- def __getitem__(self, name: typing.Union[typing_extensions.Literal["time_in_force"], typing_extensions.Literal["price_effect"], typing_extensions.Literal["legs"], typing_extensions.Literal["brokerage_order_id"], typing_extensions.Literal["order_type"], typing_extensions.Literal["status"], typing_extensions.Literal["expiry_date"], typing_extensions.Literal["price_currency"], typing_extensions.Literal["total_quantity"], typing_extensions.Literal["filled_quantity"], typing_extensions.Literal["canceled_quantity"], typing_extensions.Literal["open_quantity"], typing_extensions.Literal["execution_price"], typing_extensions.Literal["time_placed"], typing_extensions.Literal["time_updated"], typing_extensions.Literal["time_executed"], typing_extensions.Literal["group"], str, ]):
481
+ def __getitem__(self, name: typing.Union[typing_extensions.Literal["time_in_force"], typing_extensions.Literal["price_effect"], typing_extensions.Literal["legs"], typing_extensions.Literal["brokerage_order_id"], typing_extensions.Literal["order_type"], typing_extensions.Literal["status"], typing_extensions.Literal["expiry_date"], typing_extensions.Literal["priced_in"], typing_extensions.Literal["total_quantity"], typing_extensions.Literal["filled_quantity"], typing_extensions.Literal["canceled_quantity"], typing_extensions.Literal["open_quantity"], typing_extensions.Literal["execution_price"], typing_extensions.Literal["time_placed"], typing_extensions.Literal["time_updated"], typing_extensions.Literal["time_executed"], typing_extensions.Literal["group"], str, ]):
498
482
  # dict_instance[name] accessor
499
483
  return super().__getitem__(name)
500
484
 
@@ -520,7 +504,7 @@ class AccountOrder(
520
504
  def get_item_oapg(self, name: typing_extensions.Literal["expiry_date"]) -> typing.Union[MetaOapg.properties.expiry_date, schemas.Unset]: ...
521
505
 
522
506
  @typing.overload
523
- def get_item_oapg(self, name: typing_extensions.Literal["price_currency"]) -> typing.Union[MetaOapg.properties.price_currency, schemas.Unset]: ...
507
+ def get_item_oapg(self, name: typing_extensions.Literal["priced_in"]) -> typing.Union['PricedInInstrumentNullable', schemas.Unset]: ...
524
508
 
525
509
  @typing.overload
526
510
  def get_item_oapg(self, name: typing_extensions.Literal["total_quantity"]) -> typing.Union[MetaOapg.properties.total_quantity, schemas.Unset]: ...
@@ -552,7 +536,7 @@ class AccountOrder(
552
536
  @typing.overload
553
537
  def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ...
554
538
 
555
- def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["time_in_force"], typing_extensions.Literal["price_effect"], typing_extensions.Literal["legs"], typing_extensions.Literal["brokerage_order_id"], typing_extensions.Literal["order_type"], typing_extensions.Literal["status"], typing_extensions.Literal["expiry_date"], typing_extensions.Literal["price_currency"], typing_extensions.Literal["total_quantity"], typing_extensions.Literal["filled_quantity"], typing_extensions.Literal["canceled_quantity"], typing_extensions.Literal["open_quantity"], typing_extensions.Literal["execution_price"], typing_extensions.Literal["time_placed"], typing_extensions.Literal["time_updated"], typing_extensions.Literal["time_executed"], typing_extensions.Literal["group"], str, ]):
539
+ def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["time_in_force"], typing_extensions.Literal["price_effect"], typing_extensions.Literal["legs"], typing_extensions.Literal["brokerage_order_id"], typing_extensions.Literal["order_type"], typing_extensions.Literal["status"], typing_extensions.Literal["expiry_date"], typing_extensions.Literal["priced_in"], typing_extensions.Literal["total_quantity"], typing_extensions.Literal["filled_quantity"], typing_extensions.Literal["canceled_quantity"], typing_extensions.Literal["open_quantity"], typing_extensions.Literal["execution_price"], typing_extensions.Literal["time_placed"], typing_extensions.Literal["time_updated"], typing_extensions.Literal["time_executed"], typing_extensions.Literal["group"], str, ]):
556
540
  return super().get_item_oapg(name)
557
541
 
558
542
  def __new__(
@@ -565,7 +549,7 @@ class AccountOrder(
565
549
  order_type: 'OrderTypeConfiguration',
566
550
  status: 'AccountOrderRecordStatusV2',
567
551
  expiry_date: typing.Union[MetaOapg.properties.expiry_date, None, str, datetime, schemas.Unset] = schemas.unset,
568
- price_currency: typing.Union[MetaOapg.properties.price_currency, None, str, schemas.Unset] = schemas.unset,
552
+ priced_in: typing.Union['PricedInInstrumentNullable', schemas.Unset] = schemas.unset,
569
553
  total_quantity: typing.Union[MetaOapg.properties.total_quantity, None, str, schemas.Unset] = schemas.unset,
570
554
  filled_quantity: typing.Union[MetaOapg.properties.filled_quantity, None, str, schemas.Unset] = schemas.unset,
571
555
  canceled_quantity: typing.Union[MetaOapg.properties.canceled_quantity, None, str, schemas.Unset] = schemas.unset,
@@ -588,7 +572,7 @@ class AccountOrder(
588
572
  order_type=order_type,
589
573
  status=status,
590
574
  expiry_date=expiry_date,
591
- price_currency=price_currency,
575
+ priced_in=priced_in,
592
576
  total_quantity=total_quantity,
593
577
  filled_quantity=filled_quantity,
594
578
  canceled_quantity=canceled_quantity,
@@ -606,3 +590,4 @@ from snaptrade_client.model.account_order_group_nullable import AccountOrderGrou
606
590
  from snaptrade_client.model.account_order_leg import AccountOrderLeg
607
591
  from snaptrade_client.model.account_order_record_status_v2 import AccountOrderRecordStatusV2
608
592
  from snaptrade_client.model.order_type_configuration import OrderTypeConfiguration
593
+ from snaptrade_client.model.priced_in_instrument_nullable import PricedInInstrumentNullable
@@ -169,26 +169,10 @@ class AccountOrder(
169
169
  *args,
170
170
  _configuration=_configuration,
171
171
  )
172
-
173
-
174
- class price_currency(
175
- schemas.StrBase,
176
- schemas.NoneBase,
177
- schemas.Schema,
178
- schemas.NoneStrMixin
179
- ):
180
-
181
-
182
- def __new__(
183
- cls,
184
- *args: typing.Union[None, str, ],
185
- _configuration: typing.Optional[schemas.Configuration] = None,
186
- ) -> 'price_currency':
187
- return super().__new__(
188
- cls,
189
- *args,
190
- _configuration=_configuration,
191
- )
172
+
173
+ @staticmethod
174
+ def priced_in() -> typing.Type['PricedInInstrumentNullable']:
175
+ return PricedInInstrumentNullable
192
176
 
193
177
 
194
178
  class total_quantity(
@@ -396,7 +380,7 @@ class AccountOrder(
396
380
  "price_effect": price_effect,
397
381
  "legs": legs,
398
382
  "expiry_date": expiry_date,
399
- "price_currency": price_currency,
383
+ "priced_in": priced_in,
400
384
  "total_quantity": total_quantity,
401
385
  "filled_quantity": filled_quantity,
402
386
  "canceled_quantity": canceled_quantity,
@@ -438,7 +422,7 @@ class AccountOrder(
438
422
  def __getitem__(self, name: typing_extensions.Literal["expiry_date"]) -> MetaOapg.properties.expiry_date: ...
439
423
 
440
424
  @typing.overload
441
- def __getitem__(self, name: typing_extensions.Literal["price_currency"]) -> MetaOapg.properties.price_currency: ...
425
+ def __getitem__(self, name: typing_extensions.Literal["priced_in"]) -> 'PricedInInstrumentNullable': ...
442
426
 
443
427
  @typing.overload
444
428
  def __getitem__(self, name: typing_extensions.Literal["total_quantity"]) -> MetaOapg.properties.total_quantity: ...
@@ -470,7 +454,7 @@ class AccountOrder(
470
454
  @typing.overload
471
455
  def __getitem__(self, name: str) -> MetaOapg.additional_properties: ...
472
456
 
473
- def __getitem__(self, name: typing.Union[typing_extensions.Literal["time_in_force"], typing_extensions.Literal["price_effect"], typing_extensions.Literal["legs"], typing_extensions.Literal["brokerage_order_id"], typing_extensions.Literal["order_type"], typing_extensions.Literal["status"], typing_extensions.Literal["expiry_date"], typing_extensions.Literal["price_currency"], typing_extensions.Literal["total_quantity"], typing_extensions.Literal["filled_quantity"], typing_extensions.Literal["canceled_quantity"], typing_extensions.Literal["open_quantity"], typing_extensions.Literal["execution_price"], typing_extensions.Literal["time_placed"], typing_extensions.Literal["time_updated"], typing_extensions.Literal["time_executed"], typing_extensions.Literal["group"], str, ]):
457
+ def __getitem__(self, name: typing.Union[typing_extensions.Literal["time_in_force"], typing_extensions.Literal["price_effect"], typing_extensions.Literal["legs"], typing_extensions.Literal["brokerage_order_id"], typing_extensions.Literal["order_type"], typing_extensions.Literal["status"], typing_extensions.Literal["expiry_date"], typing_extensions.Literal["priced_in"], typing_extensions.Literal["total_quantity"], typing_extensions.Literal["filled_quantity"], typing_extensions.Literal["canceled_quantity"], typing_extensions.Literal["open_quantity"], typing_extensions.Literal["execution_price"], typing_extensions.Literal["time_placed"], typing_extensions.Literal["time_updated"], typing_extensions.Literal["time_executed"], typing_extensions.Literal["group"], str, ]):
474
458
  # dict_instance[name] accessor
475
459
  return super().__getitem__(name)
476
460
 
@@ -496,7 +480,7 @@ class AccountOrder(
496
480
  def get_item_oapg(self, name: typing_extensions.Literal["expiry_date"]) -> typing.Union[MetaOapg.properties.expiry_date, schemas.Unset]: ...
497
481
 
498
482
  @typing.overload
499
- def get_item_oapg(self, name: typing_extensions.Literal["price_currency"]) -> typing.Union[MetaOapg.properties.price_currency, schemas.Unset]: ...
483
+ def get_item_oapg(self, name: typing_extensions.Literal["priced_in"]) -> typing.Union['PricedInInstrumentNullable', schemas.Unset]: ...
500
484
 
501
485
  @typing.overload
502
486
  def get_item_oapg(self, name: typing_extensions.Literal["total_quantity"]) -> typing.Union[MetaOapg.properties.total_quantity, schemas.Unset]: ...
@@ -528,7 +512,7 @@ class AccountOrder(
528
512
  @typing.overload
529
513
  def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ...
530
514
 
531
- def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["time_in_force"], typing_extensions.Literal["price_effect"], typing_extensions.Literal["legs"], typing_extensions.Literal["brokerage_order_id"], typing_extensions.Literal["order_type"], typing_extensions.Literal["status"], typing_extensions.Literal["expiry_date"], typing_extensions.Literal["price_currency"], typing_extensions.Literal["total_quantity"], typing_extensions.Literal["filled_quantity"], typing_extensions.Literal["canceled_quantity"], typing_extensions.Literal["open_quantity"], typing_extensions.Literal["execution_price"], typing_extensions.Literal["time_placed"], typing_extensions.Literal["time_updated"], typing_extensions.Literal["time_executed"], typing_extensions.Literal["group"], str, ]):
515
+ def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["time_in_force"], typing_extensions.Literal["price_effect"], typing_extensions.Literal["legs"], typing_extensions.Literal["brokerage_order_id"], typing_extensions.Literal["order_type"], typing_extensions.Literal["status"], typing_extensions.Literal["expiry_date"], typing_extensions.Literal["priced_in"], typing_extensions.Literal["total_quantity"], typing_extensions.Literal["filled_quantity"], typing_extensions.Literal["canceled_quantity"], typing_extensions.Literal["open_quantity"], typing_extensions.Literal["execution_price"], typing_extensions.Literal["time_placed"], typing_extensions.Literal["time_updated"], typing_extensions.Literal["time_executed"], typing_extensions.Literal["group"], str, ]):
532
516
  return super().get_item_oapg(name)
533
517
 
534
518
  def __new__(
@@ -541,7 +525,7 @@ class AccountOrder(
541
525
  order_type: 'OrderTypeConfiguration',
542
526
  status: 'AccountOrderRecordStatusV2',
543
527
  expiry_date: typing.Union[MetaOapg.properties.expiry_date, None, str, datetime, schemas.Unset] = schemas.unset,
544
- price_currency: typing.Union[MetaOapg.properties.price_currency, None, str, schemas.Unset] = schemas.unset,
528
+ priced_in: typing.Union['PricedInInstrumentNullable', schemas.Unset] = schemas.unset,
545
529
  total_quantity: typing.Union[MetaOapg.properties.total_quantity, None, str, schemas.Unset] = schemas.unset,
546
530
  filled_quantity: typing.Union[MetaOapg.properties.filled_quantity, None, str, schemas.Unset] = schemas.unset,
547
531
  canceled_quantity: typing.Union[MetaOapg.properties.canceled_quantity, None, str, schemas.Unset] = schemas.unset,
@@ -564,7 +548,7 @@ class AccountOrder(
564
548
  order_type=order_type,
565
549
  status=status,
566
550
  expiry_date=expiry_date,
567
- price_currency=price_currency,
551
+ priced_in=priced_in,
568
552
  total_quantity=total_quantity,
569
553
  filled_quantity=filled_quantity,
570
554
  canceled_quantity=canceled_quantity,
@@ -582,3 +566,4 @@ from snaptrade_client.model.account_order_group_nullable import AccountOrderGrou
582
566
  from snaptrade_client.model.account_order_leg import AccountOrderLeg
583
567
  from snaptrade_client.model.account_order_record_status_v2 import AccountOrderRecordStatusV2
584
568
  from snaptrade_client.model.order_type_configuration import OrderTypeConfiguration
569
+ from snaptrade_client.model.priced_in_instrument_nullable import PricedInInstrumentNullable
@@ -30,9 +30,7 @@ class CashInstrument(
30
30
  """
31
31
  This class is auto generated by Konfig (https://konfigthis.com)
32
32
 
33
- A currency traded as the instrument itself, such as the currency bought or sold by a forex order.
34
- Quantities on the leg are amounts of this currency; the order's `price_currency` is the currency it was priced in.
35
-
33
+ A fiat currency, identified by its ISO-4217 code.
36
34
  """
37
35
 
38
36
 
@@ -30,9 +30,7 @@ class CashInstrument(
30
30
  """
31
31
  This class is auto generated by Konfig (https://konfigthis.com)
32
32
 
33
- A currency traded as the instrument itself, such as the currency bought or sold by a forex order.
34
- Quantities on the leg are amounts of this currency; the order's `price_currency` is the currency it was priced in.
35
-
33
+ A fiat currency, identified by its ISO-4217 code.
36
34
  """
37
35
 
38
36
 
@@ -51,6 +51,7 @@ class Instrument(
51
51
  'MutualFundInstrument': MutualFundInstrument,
52
52
  'OptionInstrument': OptionInstrument,
53
53
  'OtherInstrument': OtherInstrument,
54
+ 'PreferredStockInstrument': PreferredStockInstrument,
54
55
  'StockInstrument': StockInstrument,
55
56
  'TokenizedAssetInstrument': TokenizedAssetInstrument,
56
57
  'adr': AdrInstrument,
@@ -65,6 +66,7 @@ class Instrument(
65
66
  'mutualfund': MutualFundInstrument,
66
67
  'option': OptionInstrument,
67
68
  'other': OtherInstrument,
69
+ 'preferred_stock': PreferredStockInstrument,
68
70
  'stock': StockInstrument,
69
71
  'tokenized_asset': TokenizedAssetInstrument,
70
72
  }
@@ -94,6 +96,7 @@ class Instrument(
94
96
  TokenizedAssetInstrument,
95
97
  OtherInstrument,
96
98
  CashInstrument,
99
+ PreferredStockInstrument,
97
100
  ]
98
101
 
99
102
 
@@ -121,5 +124,6 @@ from snaptrade_client.model.future_option_instrument import FutureOptionInstrume
121
124
  from snaptrade_client.model.mutual_fund_instrument import MutualFundInstrument
122
125
  from snaptrade_client.model.option_instrument import OptionInstrument
123
126
  from snaptrade_client.model.other_instrument import OtherInstrument
127
+ from snaptrade_client.model.preferred_stock_instrument import PreferredStockInstrument
124
128
  from snaptrade_client.model.stock_instrument import StockInstrument
125
129
  from snaptrade_client.model.tokenized_asset_instrument import TokenizedAssetInstrument
@@ -51,6 +51,7 @@ class Instrument(
51
51
  'MutualFundInstrument': MutualFundInstrument,
52
52
  'OptionInstrument': OptionInstrument,
53
53
  'OtherInstrument': OtherInstrument,
54
+ 'PreferredStockInstrument': PreferredStockInstrument,
54
55
  'StockInstrument': StockInstrument,
55
56
  'TokenizedAssetInstrument': TokenizedAssetInstrument,
56
57
  'adr': AdrInstrument,
@@ -65,6 +66,7 @@ class Instrument(
65
66
  'mutualfund': MutualFundInstrument,
66
67
  'option': OptionInstrument,
67
68
  'other': OtherInstrument,
69
+ 'preferred_stock': PreferredStockInstrument,
68
70
  'stock': StockInstrument,
69
71
  'tokenized_asset': TokenizedAssetInstrument,
70
72
  }
@@ -94,6 +96,7 @@ class Instrument(
94
96
  TokenizedAssetInstrument,
95
97
  OtherInstrument,
96
98
  CashInstrument,
99
+ PreferredStockInstrument,
97
100
  ]
98
101
 
99
102
 
@@ -121,5 +124,6 @@ from snaptrade_client.model.future_option_instrument import FutureOptionInstrume
121
124
  from snaptrade_client.model.mutual_fund_instrument import MutualFundInstrument
122
125
  from snaptrade_client.model.option_instrument import OptionInstrument
123
126
  from snaptrade_client.model.other_instrument import OtherInstrument
127
+ from snaptrade_client.model.preferred_stock_instrument import PreferredStockInstrument
124
128
  from snaptrade_client.model.stock_instrument import StockInstrument
125
129
  from snaptrade_client.model.tokenized_asset_instrument import TokenizedAssetInstrument
@@ -0,0 +1,236 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ SnapTrade
5
+
6
+ Connect brokerage accounts to your app for live positions and trading. ## Rate limiting Two limits apply to requests signed with your `clientId`. The stricter one wins, and exceeding either returns `429 Too Many Requests`. - **Customer-level** — 250 requests/minute by default, scoped to your `clientId` and applied across all endpoints. Reported in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. - **Account-level** — 10 requests/minute per account, scoped to (`clientId`, `accountId`). All covered operations for one account draw on the same bucket — reading balances and reading positions share it — and enforcement does not depend on the HTTP method, so updating an account consumes the same bucket as reading it. Only enforced for Personal users, and only for integrations it has been rolled out to — it is not yet in force for every Personal integration. It also does not apply on every operation that documents a 429 below. Where it applies it is reported in `X-RateLimit-Account-Limit`, `X-RateLimit-Account-Remaining` and `X-RateLimit-Account-Reset`. Do not read the absence of those headers as proof the limit is off — some configurations omit the rate limit headers while still enforcing the limit, so header absence tells you nothing about your allowance. On a 429, `X-RateLimit-Remaining: 0` means you hit the customer-level limit and `X-RateLimit-Account-Remaining: 0` means the account-level one. Wait for the corresponding `*-Reset` value (seconds) before retrying, or fall back to exponential backoff with jitter. Not every 429 is explained by those headers. A separate per-authenticated-user limit, reported in no `X-RateLimit-*` header, covers OAuth-authenticated requests and signed requests in configurations where the customer-level limit is not in effect — on the operations that use the default throttles. A few operations override those and are governed by the customer-level limit alone. The two do not stack: a signed request governed by the customer-level limit above is not additionally subject to the per-user one. If a 429 arrives with no header at zero — or with no `X-RateLimit-*` headers at all — honour `Retry-After` and back off. Treat the remaining counts as a hint, not a guarantee that the next request will succeed. Because the customer-level limit applies everywhere, any signed request can return 429. **OAuth-authenticated requests are an exception.** They are not subject to the customer-level limit and do not receive `X-RateLimit-Limit`, `X-RateLimit-Remaining` or `X-RateLimit-Reset` — do not wait on those headers or design around a customer-level allowance on this path. The account-level limit still applies to them on the account-data endpoints above, reported in the `X-RateLimit-Account-*` headers. On operations using the default throttles the per-user limit above applies to them as well, so an OAuth request can be rejected while the account headers still show capacity; on the few operations that override those throttles, OAuth callers have no per-user ceiling at all. Drive retries from `Retry-After` and exponential backoff with jitter rather than from the headers. See https://docs.snaptrade.com/docs/ratelimiting.
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 datetime import date, datetime # noqa: F401
14
+ import decimal # noqa: F401
15
+ import functools # noqa: F401
16
+ import io # noqa: F401
17
+ import re # noqa: F401
18
+ import typing # noqa: F401
19
+ import typing_extensions # noqa: F401
20
+ import uuid # noqa: F401
21
+
22
+ import frozendict # noqa: F401
23
+
24
+ from snaptrade_client import schemas # noqa: F401
25
+
26
+
27
+ class PreferredStockInstrument(
28
+ schemas.DictSchema
29
+ ):
30
+ """
31
+ This class is auto generated by Konfig (https://konfigthis.com)
32
+
33
+ Security instrument metadata for preferred stock positions. Preferred shares were previously returned with kind `other`.
34
+ """
35
+
36
+
37
+ class MetaOapg:
38
+ required = {
39
+ "symbol",
40
+ "kind",
41
+ "raw_symbol",
42
+ "id",
43
+ }
44
+
45
+ class properties:
46
+
47
+
48
+ class kind(
49
+ schemas.EnumBase,
50
+ schemas.StrSchema
51
+ ):
52
+
53
+
54
+ class MetaOapg:
55
+ enum_value_to_name = {
56
+ "preferred_stock": "PREFERRED_STOCK",
57
+ }
58
+
59
+ @schemas.classproperty
60
+ def PREFERRED_STOCK(cls):
61
+ return cls("preferred_stock")
62
+ id = schemas.UUIDSchema
63
+ symbol = schemas.StrSchema
64
+ raw_symbol = schemas.StrSchema
65
+
66
+
67
+ class description(
68
+ schemas.StrBase,
69
+ schemas.NoneBase,
70
+ schemas.Schema,
71
+ schemas.NoneStrMixin
72
+ ):
73
+
74
+
75
+ def __new__(
76
+ cls,
77
+ *args: typing.Union[None, str, ],
78
+ _configuration: typing.Optional[schemas.Configuration] = None,
79
+ ) -> 'description':
80
+ return super().__new__(
81
+ cls,
82
+ *args,
83
+ _configuration=_configuration,
84
+ )
85
+
86
+
87
+ class currency(
88
+ schemas.StrBase,
89
+ schemas.NoneBase,
90
+ schemas.Schema,
91
+ schemas.NoneStrMixin
92
+ ):
93
+
94
+
95
+ def __new__(
96
+ cls,
97
+ *args: typing.Union[None, str, ],
98
+ _configuration: typing.Optional[schemas.Configuration] = None,
99
+ ) -> 'currency':
100
+ return super().__new__(
101
+ cls,
102
+ *args,
103
+ _configuration=_configuration,
104
+ )
105
+
106
+
107
+ class exchange(
108
+ schemas.StrBase,
109
+ schemas.NoneBase,
110
+ schemas.Schema,
111
+ schemas.NoneStrMixin
112
+ ):
113
+
114
+
115
+ def __new__(
116
+ cls,
117
+ *args: typing.Union[None, str, ],
118
+ _configuration: typing.Optional[schemas.Configuration] = None,
119
+ ) -> 'exchange':
120
+ return super().__new__(
121
+ cls,
122
+ *args,
123
+ _configuration=_configuration,
124
+ )
125
+
126
+ @staticmethod
127
+ def figi_instrument() -> typing.Type['FigiInstrumentNullable']:
128
+ return FigiInstrumentNullable
129
+ __annotations__ = {
130
+ "kind": kind,
131
+ "id": id,
132
+ "symbol": symbol,
133
+ "raw_symbol": raw_symbol,
134
+ "description": description,
135
+ "currency": currency,
136
+ "exchange": exchange,
137
+ "figi_instrument": figi_instrument,
138
+ }
139
+ additional_properties = schemas.AnyTypeSchema
140
+
141
+ symbol: MetaOapg.properties.symbol
142
+ kind: MetaOapg.properties.kind
143
+ raw_symbol: MetaOapg.properties.raw_symbol
144
+ id: MetaOapg.properties.id
145
+
146
+ @typing.overload
147
+ def __getitem__(self, name: typing_extensions.Literal["symbol"]) -> MetaOapg.properties.symbol: ...
148
+
149
+ @typing.overload
150
+ def __getitem__(self, name: typing_extensions.Literal["kind"]) -> MetaOapg.properties.kind: ...
151
+
152
+ @typing.overload
153
+ def __getitem__(self, name: typing_extensions.Literal["raw_symbol"]) -> MetaOapg.properties.raw_symbol: ...
154
+
155
+ @typing.overload
156
+ def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ...
157
+
158
+ @typing.overload
159
+ def __getitem__(self, name: typing_extensions.Literal["description"]) -> MetaOapg.properties.description: ...
160
+
161
+ @typing.overload
162
+ def __getitem__(self, name: typing_extensions.Literal["currency"]) -> MetaOapg.properties.currency: ...
163
+
164
+ @typing.overload
165
+ def __getitem__(self, name: typing_extensions.Literal["exchange"]) -> MetaOapg.properties.exchange: ...
166
+
167
+ @typing.overload
168
+ def __getitem__(self, name: typing_extensions.Literal["figi_instrument"]) -> 'FigiInstrumentNullable': ...
169
+
170
+ @typing.overload
171
+ def __getitem__(self, name: str) -> MetaOapg.additional_properties: ...
172
+
173
+ def __getitem__(self, name: typing.Union[typing_extensions.Literal["symbol"], typing_extensions.Literal["kind"], typing_extensions.Literal["raw_symbol"], typing_extensions.Literal["id"], typing_extensions.Literal["description"], typing_extensions.Literal["currency"], typing_extensions.Literal["exchange"], typing_extensions.Literal["figi_instrument"], str, ]):
174
+ # dict_instance[name] accessor
175
+ return super().__getitem__(name)
176
+
177
+ @typing.overload
178
+ def get_item_oapg(self, name: typing_extensions.Literal["symbol"]) -> MetaOapg.properties.symbol: ...
179
+
180
+ @typing.overload
181
+ def get_item_oapg(self, name: typing_extensions.Literal["kind"]) -> MetaOapg.properties.kind: ...
182
+
183
+ @typing.overload
184
+ def get_item_oapg(self, name: typing_extensions.Literal["raw_symbol"]) -> MetaOapg.properties.raw_symbol: ...
185
+
186
+ @typing.overload
187
+ def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ...
188
+
189
+ @typing.overload
190
+ def get_item_oapg(self, name: typing_extensions.Literal["description"]) -> typing.Union[MetaOapg.properties.description, schemas.Unset]: ...
191
+
192
+ @typing.overload
193
+ def get_item_oapg(self, name: typing_extensions.Literal["currency"]) -> typing.Union[MetaOapg.properties.currency, schemas.Unset]: ...
194
+
195
+ @typing.overload
196
+ def get_item_oapg(self, name: typing_extensions.Literal["exchange"]) -> typing.Union[MetaOapg.properties.exchange, schemas.Unset]: ...
197
+
198
+ @typing.overload
199
+ def get_item_oapg(self, name: typing_extensions.Literal["figi_instrument"]) -> typing.Union['FigiInstrumentNullable', schemas.Unset]: ...
200
+
201
+ @typing.overload
202
+ def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ...
203
+
204
+ def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["symbol"], typing_extensions.Literal["kind"], typing_extensions.Literal["raw_symbol"], typing_extensions.Literal["id"], typing_extensions.Literal["description"], typing_extensions.Literal["currency"], typing_extensions.Literal["exchange"], typing_extensions.Literal["figi_instrument"], str, ]):
205
+ return super().get_item_oapg(name)
206
+
207
+ def __new__(
208
+ cls,
209
+ *args: typing.Union[dict, frozendict.frozendict, ],
210
+ symbol: typing.Union[MetaOapg.properties.symbol, str, ],
211
+ kind: typing.Union[MetaOapg.properties.kind, str, ],
212
+ raw_symbol: typing.Union[MetaOapg.properties.raw_symbol, str, ],
213
+ id: typing.Union[MetaOapg.properties.id, str, uuid.UUID, ],
214
+ description: typing.Union[MetaOapg.properties.description, None, str, schemas.Unset] = schemas.unset,
215
+ currency: typing.Union[MetaOapg.properties.currency, None, str, schemas.Unset] = schemas.unset,
216
+ exchange: typing.Union[MetaOapg.properties.exchange, None, str, schemas.Unset] = schemas.unset,
217
+ figi_instrument: typing.Union['FigiInstrumentNullable', schemas.Unset] = schemas.unset,
218
+ _configuration: typing.Optional[schemas.Configuration] = None,
219
+ **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ],
220
+ ) -> 'PreferredStockInstrument':
221
+ return super().__new__(
222
+ cls,
223
+ *args,
224
+ symbol=symbol,
225
+ kind=kind,
226
+ raw_symbol=raw_symbol,
227
+ id=id,
228
+ description=description,
229
+ currency=currency,
230
+ exchange=exchange,
231
+ figi_instrument=figi_instrument,
232
+ _configuration=_configuration,
233
+ **kwargs,
234
+ )
235
+
236
+ from snaptrade_client.model.figi_instrument_nullable import FigiInstrumentNullable