publicdotcom-cli 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 (146) hide show
  1. publicdotcom_cli/__init__.py +3 -0
  2. publicdotcom_cli/__main__.py +5 -0
  3. publicdotcom_cli/_generated/__init__.py +8 -0
  4. publicdotcom_cli/_generated/api/__init__.py +1 -0
  5. publicdotcom_cli/_generated/api/account_details/__init__.py +1 -0
  6. publicdotcom_cli/_generated/api/account_details/get_account_portfolio_v2.py +182 -0
  7. publicdotcom_cli/_generated/api/account_details/get_history.py +250 -0
  8. publicdotcom_cli/_generated/api/authorization/__init__.py +1 -0
  9. publicdotcom_cli/_generated/api/authorization/create_personal_access_token.py +230 -0
  10. publicdotcom_cli/_generated/api/instrument_details/__init__.py +1 -0
  11. publicdotcom_cli/_generated/api/instrument_details/get_all_instruments.py +303 -0
  12. publicdotcom_cli/_generated/api/instrument_details/get_instrument.py +170 -0
  13. publicdotcom_cli/_generated/api/list_accounts/__init__.py +1 -0
  14. publicdotcom_cli/_generated/api/list_accounts/get_accounts.py +172 -0
  15. publicdotcom_cli/_generated/api/market_data/__init__.py +1 -0
  16. publicdotcom_cli/_generated/api/market_data/get_option_chain.py +200 -0
  17. publicdotcom_cli/_generated/api/market_data/get_option_expirations.py +210 -0
  18. publicdotcom_cli/_generated/api/market_data/get_quotes.py +200 -0
  19. publicdotcom_cli/_generated/api/option_details/__init__.py +1 -0
  20. publicdotcom_cli/_generated/api/option_details/get_option_greeks.py +194 -0
  21. publicdotcom_cli/_generated/api/order_placement/__init__.py +1 -0
  22. publicdotcom_cli/_generated/api/order_placement/cancel_order.py +123 -0
  23. publicdotcom_cli/_generated/api/order_placement/get_order.py +206 -0
  24. publicdotcom_cli/_generated/api/order_placement/place_multileg_order.py +214 -0
  25. publicdotcom_cli/_generated/api/order_placement/place_order.py +222 -0
  26. publicdotcom_cli/_generated/api/order_placement/preflight_multi_leg.py +276 -0
  27. publicdotcom_cli/_generated/api/order_placement/preflight_single_leg.py +220 -0
  28. publicdotcom_cli/_generated/api/order_placement/replace_order.py +222 -0
  29. publicdotcom_cli/_generated/client.py +272 -0
  30. publicdotcom_cli/_generated/errors.py +16 -0
  31. publicdotcom_cli/_generated/models/__init__.py +417 -0
  32. publicdotcom_cli/_generated/models/com_hellopublic_holdingsystem_core_types_option_price_increment.py +71 -0
  33. publicdotcom_cli/_generated/models/com_hellopublic_userapiauthservice_api_personal_create_access_token_request.py +84 -0
  34. publicdotcom_cli/_generated/models/com_hellopublic_userapiauthservice_api_personal_create_access_token_response.py +61 -0
  35. publicdotcom_cli/_generated/models/com_hellopublic_userapiauthservice_domain_error_error_body.py +70 -0
  36. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings.py +161 -0
  37. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_account_type.py +14 -0
  38. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_brokerage_account_type.py +9 -0
  39. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_options_level.py +12 -0
  40. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_response.py +85 -0
  41. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_trade_permissions.py +11 -0
  42. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_response_page.py +195 -0
  43. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction.py +263 -0
  44. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_direction.py +9 -0
  45. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_security_type.py +13 -0
  46. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_side.py +9 -0
  47. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_sub_type.py +19 -0
  48. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_type.py +10 -0
  49. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_option_chain_request.py +85 -0
  50. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_option_chain_response.py +115 -0
  51. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_option_expirations_request.py +75 -0
  52. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_option_expirations_response.py +81 -0
  53. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_quote.py +272 -0
  54. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_quote_outcome.py +9 -0
  55. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_quote_request.py +84 -0
  56. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_quote_response.py +87 -0
  57. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_one_day_change.py +74 -0
  58. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_option_details.py +135 -0
  59. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_options_greek_response.py +113 -0
  60. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_options_greeks_response.py +86 -0
  61. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_options_option_greeks_type_0.py +117 -0
  62. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_cancel_replace_order_request.py +139 -0
  63. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_cancel_replace_order_request_order_type.py +11 -0
  64. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto.py +265 -0
  65. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_fractional_trading.py +10 -0
  66. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_option_spread_trading.py +10 -0
  67. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_option_trading.py +10 -0
  68. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_shorting_availability.py +10 -0
  69. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_trading.py +10 -0
  70. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_response.py +87 -0
  71. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_multileg_order_request.py +141 -0
  72. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_multileg_order_request_type.py +11 -0
  73. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request.py +231 -0
  74. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request_equity_market_session.py +9 -0
  75. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request_open_close_indicator.py +9 -0
  76. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request_order_side.py +9 -0
  77. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request_order_type.py +11 -0
  78. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_result.py +69 -0
  79. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_leg_instrument.py +73 -0
  80. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_leg_instrument_type.py +9 -0
  81. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order.py +334 -0
  82. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_instrument.py +73 -0
  83. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_instrument_type.py +15 -0
  84. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_leg.py +125 -0
  85. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_leg_open_close_indicator.py +9 -0
  86. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_leg_side.py +9 -0
  87. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_open_close_indicator.py +9 -0
  88. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_side.py +9 -0
  89. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_status.py +17 -0
  90. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_type.py +11 -0
  91. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_short_selling.py +127 -0
  92. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_short_selling_availability.py +10 -0
  93. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_short_selling_uptick_rule.py +9 -0
  94. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_instrumentdetails_api_instrument_details.py +67 -0
  95. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_instrumentdetails_api_instrument_details_bond.py +74 -0
  96. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_instrumentdetails_api_instrument_details_crypto.py +92 -0
  97. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_order_expiration.py +87 -0
  98. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_order_expiration_time_in_force.py +9 -0
  99. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gain_type_0.py +88 -0
  100. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_buying_power.py +77 -0
  101. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_cost_basis_type_0.py +167 -0
  102. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_account_v2.py +233 -0
  103. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_account_v2_account_type.py +14 -0
  104. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_equity_v2.py +100 -0
  105. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_equity_v2_type.py +14 -0
  106. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_instrument.py +93 -0
  107. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_instrument_type.py +14 -0
  108. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_position.py +352 -0
  109. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_strategy.py +276 -0
  110. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_strategy_leg.py +78 -0
  111. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_price_type_0.py +79 -0
  112. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_margin_impact.py +70 -0
  113. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_margin_requirement.py +70 -0
  114. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_option_details.py +91 -0
  115. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_option_details_type.py +9 -0
  116. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_option_rebate.py +79 -0
  117. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_price_increment.py +80 -0
  118. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_regulatory_fees.py +118 -0
  119. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response.py +167 -0
  120. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response_open_close_indicator.py +9 -0
  121. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response_side.py +9 -0
  122. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_request.py +148 -0
  123. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_request_order_type.py +11 -0
  124. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_response.py +313 -0
  125. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request.py +225 -0
  126. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request_equity_market_session.py +11 -0
  127. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request_open_close_indicator.py +11 -0
  128. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request_order_side.py +9 -0
  129. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request_order_type.py +11 -0
  130. publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_response.py +410 -0
  131. publicdotcom_cli/_generated/models/get_all_instruments_fractional_trading_filter_item.py +10 -0
  132. publicdotcom_cli/_generated/models/get_all_instruments_option_spread_trading_filter_item.py +10 -0
  133. publicdotcom_cli/_generated/models/get_all_instruments_option_trading_filter_item.py +10 -0
  134. publicdotcom_cli/_generated/models/get_all_instruments_trading_filter_item.py +10 -0
  135. publicdotcom_cli/_generated/models/get_all_instruments_type_filter_item.py +15 -0
  136. publicdotcom_cli/_generated/models/get_instrument_type.py +15 -0
  137. publicdotcom_cli/_generated/types.py +54 -0
  138. publicdotcom_cli/cli.py +761 -0
  139. publicdotcom_cli/client.py +83 -0
  140. publicdotcom_cli/config.py +222 -0
  141. publicdotcom_cli/output.py +77 -0
  142. publicdotcom_cli/payloads.py +36 -0
  143. publicdotcom_cli-1.0.0.dist-info/METADATA +256 -0
  144. publicdotcom_cli-1.0.0.dist-info/RECORD +146 -0
  145. publicdotcom_cli-1.0.0.dist-info/WHEEL +4 -0
  146. publicdotcom_cli-1.0.0.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,167 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response_open_close_indicator import (
10
+ ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponseOpenCloseIndicator,
11
+ )
12
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response_side import (
13
+ ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponseSide,
14
+ )
15
+ from ..types import UNSET, Unset
16
+
17
+ if TYPE_CHECKING:
18
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order_instrument import (
19
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrument,
20
+ )
21
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_gateway_option_details import (
22
+ ComHellopublicUserapigatewayApiRestPreflightGatewayOptionDetails,
23
+ )
24
+
25
+
26
+ T = TypeVar("T", bound="ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponse")
27
+
28
+
29
+ @_attrs_define
30
+ class ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponse:
31
+ """# PreflightLegResponse
32
+ Response containing information about an individual leg in a multi-leg order preflight calculation.
33
+
34
+ ## Fields
35
+
36
+ ### Instrument Information
37
+ - **instrument** - The trading instrument for this leg
38
+ - **side** - The order side (BUY/SELL) for this leg
39
+ - **openCloseIndicator** - Position effect for option legs (BUY_TO_OPEN, BUY_TO_CLOSE, etc.)
40
+ - **ratioQuantity** - The ratio quantity for this leg in the strategy
41
+
42
+ ### Cost and Fee Information
43
+ - **estimatedCommission** - The estimated commission for this specific leg
44
+ - **estimatedCost** - The estimated cost for this leg including fees
45
+ - **estimatedProceeds** - The estimated proceeds for this leg (for sell legs)
46
+
47
+ ### Option-Specific Information
48
+ - **optionDetails** - Option-specific details like strike price, expiration, fees, and rebates
49
+
50
+ Attributes:
51
+ instrument (ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrument):
52
+ side (ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponseSide):
53
+ ratio_quantity (int):
54
+ open_close_indicator (ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponseOpenCloseIndicator |
55
+ Unset):
56
+ option_details (ComHellopublicUserapigatewayApiRestPreflightGatewayOptionDetails | Unset):
57
+ """
58
+
59
+ instrument: ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrument
60
+ side: ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponseSide
61
+ ratio_quantity: int
62
+ open_close_indicator: (
63
+ ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponseOpenCloseIndicator | Unset
64
+ ) = UNSET
65
+ option_details: ComHellopublicUserapigatewayApiRestPreflightGatewayOptionDetails | Unset = UNSET
66
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
67
+
68
+ def to_dict(self) -> dict[str, Any]:
69
+ instrument = self.instrument.to_dict()
70
+
71
+ side = self.side.value
72
+
73
+ ratio_quantity = self.ratio_quantity
74
+
75
+ open_close_indicator: str | Unset = UNSET
76
+ if not isinstance(self.open_close_indicator, Unset):
77
+ open_close_indicator = self.open_close_indicator.value
78
+
79
+ option_details: dict[str, Any] | Unset = UNSET
80
+ if not isinstance(self.option_details, Unset):
81
+ option_details = self.option_details.to_dict()
82
+
83
+ field_dict: dict[str, Any] = {}
84
+ field_dict.update(self.additional_properties)
85
+ field_dict.update(
86
+ {
87
+ "instrument": instrument,
88
+ "side": side,
89
+ "ratioQuantity": ratio_quantity,
90
+ }
91
+ )
92
+ if open_close_indicator is not UNSET:
93
+ field_dict["openCloseIndicator"] = open_close_indicator
94
+ if option_details is not UNSET:
95
+ field_dict["optionDetails"] = option_details
96
+
97
+ return field_dict
98
+
99
+ @classmethod
100
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
101
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order_instrument import (
102
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrument,
103
+ )
104
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_gateway_option_details import (
105
+ ComHellopublicUserapigatewayApiRestPreflightGatewayOptionDetails,
106
+ )
107
+
108
+ d = dict(src_dict)
109
+ instrument = ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrument.from_dict(
110
+ d.pop("instrument")
111
+ )
112
+
113
+ side = ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponseSide(d.pop("side"))
114
+
115
+ ratio_quantity = d.pop("ratioQuantity")
116
+
117
+ _open_close_indicator = d.pop("openCloseIndicator", UNSET)
118
+ open_close_indicator: (
119
+ ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponseOpenCloseIndicator
120
+ | Unset
121
+ )
122
+ if isinstance(_open_close_indicator, Unset):
123
+ open_close_indicator = UNSET
124
+ else:
125
+ open_close_indicator = (
126
+ ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponseOpenCloseIndicator(
127
+ _open_close_indicator
128
+ )
129
+ )
130
+
131
+ _option_details = d.pop("optionDetails", UNSET)
132
+ option_details: ComHellopublicUserapigatewayApiRestPreflightGatewayOptionDetails | Unset
133
+ if isinstance(_option_details, Unset):
134
+ option_details = UNSET
135
+ else:
136
+ option_details = (
137
+ ComHellopublicUserapigatewayApiRestPreflightGatewayOptionDetails.from_dict(
138
+ _option_details
139
+ )
140
+ )
141
+
142
+ com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response = cls(
143
+ instrument=instrument,
144
+ side=side,
145
+ ratio_quantity=ratio_quantity,
146
+ open_close_indicator=open_close_indicator,
147
+ option_details=option_details,
148
+ )
149
+
150
+ com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response.additional_properties = d
151
+ return com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response
152
+
153
+ @property
154
+ def additional_keys(self) -> list[str]:
155
+ return list(self.additional_properties.keys())
156
+
157
+ def __getitem__(self, key: str) -> Any:
158
+ return self.additional_properties[key]
159
+
160
+ def __setitem__(self, key: str, value: Any) -> None:
161
+ self.additional_properties[key] = value
162
+
163
+ def __delitem__(self, key: str) -> None:
164
+ del self.additional_properties[key]
165
+
166
+ def __contains__(self, key: str) -> bool:
167
+ return key in self.additional_properties
@@ -0,0 +1,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponseOpenCloseIndicator(str, Enum):
5
+ CLOSE = "CLOSE"
6
+ OPEN = "OPEN"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
@@ -0,0 +1,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponseSide(str, Enum):
5
+ BUY = "BUY"
6
+ SELL = "SELL"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
@@ -0,0 +1,148 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_request_order_type import (
10
+ ComHellopublicUserapigatewayApiRestPreflightPreflightMultiLegRequestOrderType,
11
+ )
12
+ from ..types import UNSET, Unset
13
+
14
+ if TYPE_CHECKING:
15
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order_leg import (
16
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderLeg,
17
+ )
18
+ from ..models.com_hellopublic_userapigateway_api_rest_order_order_expiration import (
19
+ ComHellopublicUserapigatewayApiRestOrderOrderExpiration,
20
+ )
21
+
22
+
23
+ T = TypeVar("T", bound="ComHellopublicUserapigatewayApiRestPreflightPreflightMultiLegRequest")
24
+
25
+
26
+ @_attrs_define
27
+ class ComHellopublicUserapigatewayApiRestPreflightPreflightMultiLegRequest:
28
+ """# PreflightMultiLegRequest
29
+ Request for preflight calculations on multi-leg orders.
30
+
31
+ ## Fields
32
+ - **orderType** - The type of order (only LIMIT orders are allowed for multi-leg)
33
+ - **expiration** - The order expiration configuration
34
+ - **quantity** - The order quantity (number of strategies)
35
+ - **limitPrice** - The limit price for the order (required for LIMIT orders)
36
+ - **legs** - List of order legs (2-6 legs allowed, at most 1 equity leg)
37
+ - **equityMarketSession** - The market session for equity legs
38
+ - **validateOrder** - If true, the order will be validated against current account state. Defaults to true.
39
+
40
+ Attributes:
41
+ order_type (ComHellopublicUserapigatewayApiRestPreflightPreflightMultiLegRequestOrderType):
42
+ expiration (ComHellopublicUserapigatewayApiRestOrderOrderExpiration):
43
+ quantity (str):
44
+ limit_price (str):
45
+ legs (list[ComHellopublicUserapigatewayApiRestOrderGatewayOrderLeg]):
46
+ validate_order (bool | Unset):
47
+ """
48
+
49
+ order_type: ComHellopublicUserapigatewayApiRestPreflightPreflightMultiLegRequestOrderType
50
+ expiration: ComHellopublicUserapigatewayApiRestOrderOrderExpiration
51
+ quantity: str
52
+ limit_price: str
53
+ legs: list[ComHellopublicUserapigatewayApiRestOrderGatewayOrderLeg]
54
+ validate_order: bool | Unset = UNSET
55
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
56
+
57
+ def to_dict(self) -> dict[str, Any]:
58
+ order_type = self.order_type.value
59
+
60
+ expiration = self.expiration.to_dict()
61
+
62
+ quantity = self.quantity
63
+
64
+ limit_price = self.limit_price
65
+
66
+ legs = []
67
+ for legs_item_data in self.legs:
68
+ legs_item = legs_item_data.to_dict()
69
+ legs.append(legs_item)
70
+
71
+ validate_order = self.validate_order
72
+
73
+ field_dict: dict[str, Any] = {}
74
+ field_dict.update(self.additional_properties)
75
+ field_dict.update(
76
+ {
77
+ "orderType": order_type,
78
+ "expiration": expiration,
79
+ "quantity": quantity,
80
+ "limitPrice": limit_price,
81
+ "legs": legs,
82
+ }
83
+ )
84
+ if validate_order is not UNSET:
85
+ field_dict["validateOrder"] = validate_order
86
+
87
+ return field_dict
88
+
89
+ @classmethod
90
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
91
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order_leg import (
92
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderLeg,
93
+ )
94
+ from ..models.com_hellopublic_userapigateway_api_rest_order_order_expiration import (
95
+ ComHellopublicUserapigatewayApiRestOrderOrderExpiration,
96
+ )
97
+
98
+ d = dict(src_dict)
99
+ order_type = ComHellopublicUserapigatewayApiRestPreflightPreflightMultiLegRequestOrderType(
100
+ d.pop("orderType")
101
+ )
102
+
103
+ expiration = ComHellopublicUserapigatewayApiRestOrderOrderExpiration.from_dict(
104
+ d.pop("expiration")
105
+ )
106
+
107
+ quantity = d.pop("quantity")
108
+
109
+ limit_price = d.pop("limitPrice")
110
+
111
+ legs = []
112
+ _legs = d.pop("legs")
113
+ for legs_item_data in _legs:
114
+ legs_item = ComHellopublicUserapigatewayApiRestOrderGatewayOrderLeg.from_dict(
115
+ legs_item_data
116
+ )
117
+
118
+ legs.append(legs_item)
119
+
120
+ validate_order = d.pop("validateOrder", UNSET)
121
+
122
+ com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_request = cls(
123
+ order_type=order_type,
124
+ expiration=expiration,
125
+ quantity=quantity,
126
+ limit_price=limit_price,
127
+ legs=legs,
128
+ validate_order=validate_order,
129
+ )
130
+
131
+ com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_request.additional_properties = d
132
+ return com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_request
133
+
134
+ @property
135
+ def additional_keys(self) -> list[str]:
136
+ return list(self.additional_properties.keys())
137
+
138
+ def __getitem__(self, key: str) -> Any:
139
+ return self.additional_properties[key]
140
+
141
+ def __setitem__(self, key: str, value: Any) -> None:
142
+ self.additional_properties[key] = value
143
+
144
+ def __delitem__(self, key: str) -> None:
145
+ del self.additional_properties[key]
146
+
147
+ def __contains__(self, key: str) -> bool:
148
+ return key in self.additional_properties
@@ -0,0 +1,11 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ComHellopublicUserapigatewayApiRestPreflightPreflightMultiLegRequestOrderType(str, Enum):
5
+ LIMIT = "LIMIT"
6
+ MARKET = "MARKET"
7
+ STOP = "STOP"
8
+ STOP_LIMIT = "STOP_LIMIT"
9
+
10
+ def __str__(self) -> str:
11
+ return str(self.value)
@@ -0,0 +1,313 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ from ..types import UNSET, Unset
10
+
11
+ if TYPE_CHECKING:
12
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_gateway_margin_impact import (
13
+ ComHellopublicUserapigatewayApiRestPreflightGatewayMarginImpact,
14
+ )
15
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_gateway_margin_requirement import (
16
+ ComHellopublicUserapigatewayApiRestPreflightGatewayMarginRequirement,
17
+ )
18
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_gateway_price_increment import (
19
+ ComHellopublicUserapigatewayApiRestPreflightGatewayPriceIncrement,
20
+ )
21
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_gateway_regulatory_fees import (
22
+ ComHellopublicUserapigatewayApiRestPreflightGatewayRegulatoryFees,
23
+ )
24
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response import (
25
+ ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponse,
26
+ )
27
+
28
+
29
+ T = TypeVar("T", bound="ComHellopublicUserapigatewayApiRestPreflightPreflightMultiLegResponse")
30
+
31
+
32
+ @_attrs_define
33
+ class ComHellopublicUserapigatewayApiRestPreflightPreflightMultiLegResponse:
34
+ """# PreflightMultiLegResponse
35
+ Response containing estimated costs, fees, and other information needed before placing a multi-leg order.
36
+
37
+ ## Fields
38
+
39
+ ### Strategy Information
40
+ - **baseSymbol** - The base symbol for the multi-leg strategy (e.g., "TSLA" for Tesla options)
41
+ - **strategyName** - The name of the strategy (e.g., "Call Spread", "Iron Condor")
42
+ - **legs** - List of individual leg details for the strategy
43
+
44
+ ### Cost and Fee Information
45
+ - **estimatedCommission** - The estimated commission amount that will be charged if the order executes
46
+ - **regulatoryFees** - Gateway regulatory fees breakdown including SEC, TAF, ORF, OCC, CAT fees
47
+ - **estimatedIndexOptionFee** - Estimated index option fees (if applicable)
48
+ - **estimatedCost** - The total estimated cost including all fees and commissions
49
+ - **buyingPowerRequirement** - The buying power required for this multi-leg order
50
+
51
+ ### Order Details
52
+ - **orderValue** - The estimated order value, excluding fees and commission
53
+ - **estimatedQuantity** - The number of strategies that will be executed
54
+ - **estimatedProceeds** - The estimated proceeds from the order (for credit spreads)
55
+
56
+ ### Option-Specific Information
57
+ - **marginRequirement** - Margin requirements for the multi-leg strategy
58
+ - **marginImpact** - Impact on account margin usage
59
+ - **priceIncrement** - Price increment information for option orders
60
+
61
+ Attributes:
62
+ base_symbol (str):
63
+ legs (list[ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponse]):
64
+ order_value (str):
65
+ strategy_name (str | Unset):
66
+ estimated_commission (str | Unset):
67
+ regulatory_fees (ComHellopublicUserapigatewayApiRestPreflightGatewayRegulatoryFees | Unset): #
68
+ GatewayRegulatoryFees
69
+ Represents various regulatory fees associated with trading orders.
70
+ <br/>
71
+ ## Fields
72
+ - **secFee** - The SEC charges a regulatory fee for sell orders that execute. The fee is based on the dollar
73
+ amount of the order.
74
+ - **tafFee** - The Trading Activity Fee is a FINRA fee. The fee is based on the order quantity.
75
+ - **orfFee** - The Options Regulatory Fee (ORF). This is the combined exchange fee rate for all exchanges.
76
+ Changes monthly.
77
+ - **exchangeFee** - The exchange charges a fee for executing orders for index options.
78
+ - **occFee** - The Options Clearing Corporation Fee (OCC)
79
+ - **catFee** - The Consolidated Audit Trail Fee (CAT)
80
+ estimated_index_option_fee (str | Unset):
81
+ estimated_quantity (str | Unset):
82
+ estimated_cost (str | Unset):
83
+ buying_power_requirement (str | Unset):
84
+ estimated_proceeds (str | Unset):
85
+ margin_requirement (ComHellopublicUserapigatewayApiRestPreflightGatewayMarginRequirement | Unset):
86
+ margin_impact (ComHellopublicUserapigatewayApiRestPreflightGatewayMarginImpact | Unset):
87
+ price_increment (ComHellopublicUserapigatewayApiRestPreflightGatewayPriceIncrement | Unset): Price increment
88
+ information for option orders.
89
+ """
90
+
91
+ base_symbol: str
92
+ legs: list[ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponse]
93
+ order_value: str
94
+ strategy_name: str | Unset = UNSET
95
+ estimated_commission: str | Unset = UNSET
96
+ regulatory_fees: ComHellopublicUserapigatewayApiRestPreflightGatewayRegulatoryFees | Unset = (
97
+ UNSET
98
+ )
99
+ estimated_index_option_fee: str | Unset = UNSET
100
+ estimated_quantity: str | Unset = UNSET
101
+ estimated_cost: str | Unset = UNSET
102
+ buying_power_requirement: str | Unset = UNSET
103
+ estimated_proceeds: str | Unset = UNSET
104
+ margin_requirement: (
105
+ ComHellopublicUserapigatewayApiRestPreflightGatewayMarginRequirement | Unset
106
+ ) = UNSET
107
+ margin_impact: ComHellopublicUserapigatewayApiRestPreflightGatewayMarginImpact | Unset = UNSET
108
+ price_increment: ComHellopublicUserapigatewayApiRestPreflightGatewayPriceIncrement | Unset = (
109
+ UNSET
110
+ )
111
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
112
+
113
+ def to_dict(self) -> dict[str, Any]:
114
+ base_symbol = self.base_symbol
115
+
116
+ legs = []
117
+ for legs_item_data in self.legs:
118
+ legs_item = legs_item_data.to_dict()
119
+ legs.append(legs_item)
120
+
121
+ order_value = self.order_value
122
+
123
+ strategy_name = self.strategy_name
124
+
125
+ estimated_commission = self.estimated_commission
126
+
127
+ regulatory_fees: dict[str, Any] | Unset = UNSET
128
+ if not isinstance(self.regulatory_fees, Unset):
129
+ regulatory_fees = self.regulatory_fees.to_dict()
130
+
131
+ estimated_index_option_fee = self.estimated_index_option_fee
132
+
133
+ estimated_quantity = self.estimated_quantity
134
+
135
+ estimated_cost = self.estimated_cost
136
+
137
+ buying_power_requirement = self.buying_power_requirement
138
+
139
+ estimated_proceeds = self.estimated_proceeds
140
+
141
+ margin_requirement: dict[str, Any] | Unset = UNSET
142
+ if not isinstance(self.margin_requirement, Unset):
143
+ margin_requirement = self.margin_requirement.to_dict()
144
+
145
+ margin_impact: dict[str, Any] | Unset = UNSET
146
+ if not isinstance(self.margin_impact, Unset):
147
+ margin_impact = self.margin_impact.to_dict()
148
+
149
+ price_increment: dict[str, Any] | Unset = UNSET
150
+ if not isinstance(self.price_increment, Unset):
151
+ price_increment = self.price_increment.to_dict()
152
+
153
+ field_dict: dict[str, Any] = {}
154
+ field_dict.update(self.additional_properties)
155
+ field_dict.update(
156
+ {
157
+ "baseSymbol": base_symbol,
158
+ "legs": legs,
159
+ "orderValue": order_value,
160
+ }
161
+ )
162
+ if strategy_name is not UNSET:
163
+ field_dict["strategyName"] = strategy_name
164
+ if estimated_commission is not UNSET:
165
+ field_dict["estimatedCommission"] = estimated_commission
166
+ if regulatory_fees is not UNSET:
167
+ field_dict["regulatoryFees"] = regulatory_fees
168
+ if estimated_index_option_fee is not UNSET:
169
+ field_dict["estimatedIndexOptionFee"] = estimated_index_option_fee
170
+ if estimated_quantity is not UNSET:
171
+ field_dict["estimatedQuantity"] = estimated_quantity
172
+ if estimated_cost is not UNSET:
173
+ field_dict["estimatedCost"] = estimated_cost
174
+ if buying_power_requirement is not UNSET:
175
+ field_dict["buyingPowerRequirement"] = buying_power_requirement
176
+ if estimated_proceeds is not UNSET:
177
+ field_dict["estimatedProceeds"] = estimated_proceeds
178
+ if margin_requirement is not UNSET:
179
+ field_dict["marginRequirement"] = margin_requirement
180
+ if margin_impact is not UNSET:
181
+ field_dict["marginImpact"] = margin_impact
182
+ if price_increment is not UNSET:
183
+ field_dict["priceIncrement"] = price_increment
184
+
185
+ return field_dict
186
+
187
+ @classmethod
188
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
189
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_gateway_margin_impact import (
190
+ ComHellopublicUserapigatewayApiRestPreflightGatewayMarginImpact,
191
+ )
192
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_gateway_margin_requirement import (
193
+ ComHellopublicUserapigatewayApiRestPreflightGatewayMarginRequirement,
194
+ )
195
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_gateway_price_increment import (
196
+ ComHellopublicUserapigatewayApiRestPreflightGatewayPriceIncrement,
197
+ )
198
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_gateway_regulatory_fees import (
199
+ ComHellopublicUserapigatewayApiRestPreflightGatewayRegulatoryFees,
200
+ )
201
+ from ..models.com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response import (
202
+ ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponse,
203
+ )
204
+
205
+ d = dict(src_dict)
206
+ base_symbol = d.pop("baseSymbol")
207
+
208
+ legs = []
209
+ _legs = d.pop("legs")
210
+ for legs_item_data in _legs:
211
+ legs_item = ComHellopublicUserapigatewayApiRestPreflightPreflightLegResponse.from_dict(
212
+ legs_item_data
213
+ )
214
+
215
+ legs.append(legs_item)
216
+
217
+ order_value = d.pop("orderValue")
218
+
219
+ strategy_name = d.pop("strategyName", UNSET)
220
+
221
+ estimated_commission = d.pop("estimatedCommission", UNSET)
222
+
223
+ _regulatory_fees = d.pop("regulatoryFees", UNSET)
224
+ regulatory_fees: ComHellopublicUserapigatewayApiRestPreflightGatewayRegulatoryFees | Unset
225
+ if isinstance(_regulatory_fees, Unset):
226
+ regulatory_fees = UNSET
227
+ else:
228
+ regulatory_fees = (
229
+ ComHellopublicUserapigatewayApiRestPreflightGatewayRegulatoryFees.from_dict(
230
+ _regulatory_fees
231
+ )
232
+ )
233
+
234
+ estimated_index_option_fee = d.pop("estimatedIndexOptionFee", UNSET)
235
+
236
+ estimated_quantity = d.pop("estimatedQuantity", UNSET)
237
+
238
+ estimated_cost = d.pop("estimatedCost", UNSET)
239
+
240
+ buying_power_requirement = d.pop("buyingPowerRequirement", UNSET)
241
+
242
+ estimated_proceeds = d.pop("estimatedProceeds", UNSET)
243
+
244
+ _margin_requirement = d.pop("marginRequirement", UNSET)
245
+ margin_requirement: (
246
+ ComHellopublicUserapigatewayApiRestPreflightGatewayMarginRequirement | Unset
247
+ )
248
+ if isinstance(_margin_requirement, Unset):
249
+ margin_requirement = UNSET
250
+ else:
251
+ margin_requirement = (
252
+ ComHellopublicUserapigatewayApiRestPreflightGatewayMarginRequirement.from_dict(
253
+ _margin_requirement
254
+ )
255
+ )
256
+
257
+ _margin_impact = d.pop("marginImpact", UNSET)
258
+ margin_impact: ComHellopublicUserapigatewayApiRestPreflightGatewayMarginImpact | Unset
259
+ if isinstance(_margin_impact, Unset):
260
+ margin_impact = UNSET
261
+ else:
262
+ margin_impact = (
263
+ ComHellopublicUserapigatewayApiRestPreflightGatewayMarginImpact.from_dict(
264
+ _margin_impact
265
+ )
266
+ )
267
+
268
+ _price_increment = d.pop("priceIncrement", UNSET)
269
+ price_increment: ComHellopublicUserapigatewayApiRestPreflightGatewayPriceIncrement | Unset
270
+ if isinstance(_price_increment, Unset):
271
+ price_increment = UNSET
272
+ else:
273
+ price_increment = (
274
+ ComHellopublicUserapigatewayApiRestPreflightGatewayPriceIncrement.from_dict(
275
+ _price_increment
276
+ )
277
+ )
278
+
279
+ com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_response = cls(
280
+ base_symbol=base_symbol,
281
+ legs=legs,
282
+ order_value=order_value,
283
+ strategy_name=strategy_name,
284
+ estimated_commission=estimated_commission,
285
+ regulatory_fees=regulatory_fees,
286
+ estimated_index_option_fee=estimated_index_option_fee,
287
+ estimated_quantity=estimated_quantity,
288
+ estimated_cost=estimated_cost,
289
+ buying_power_requirement=buying_power_requirement,
290
+ estimated_proceeds=estimated_proceeds,
291
+ margin_requirement=margin_requirement,
292
+ margin_impact=margin_impact,
293
+ price_increment=price_increment,
294
+ )
295
+
296
+ com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_response.additional_properties = d
297
+ return com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_response
298
+
299
+ @property
300
+ def additional_keys(self) -> list[str]:
301
+ return list(self.additional_properties.keys())
302
+
303
+ def __getitem__(self, key: str) -> Any:
304
+ return self.additional_properties[key]
305
+
306
+ def __setitem__(self, key: str, value: Any) -> None:
307
+ self.additional_properties[key] = value
308
+
309
+ def __delitem__(self, key: str) -> None:
310
+ del self.additional_properties[key]
311
+
312
+ def __contains__(self, key: str) -> bool:
313
+ return key in self.additional_properties