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,334 @@
1
+ from __future__ import annotations
2
+
3
+ import datetime
4
+ from collections.abc import Mapping
5
+ from typing import TYPE_CHECKING, Any, TypeVar
6
+ from uuid import UUID
7
+
8
+ from attrs import define as _attrs_define
9
+ from attrs import field as _attrs_field
10
+ from dateutil.parser import isoparse
11
+
12
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order_open_close_indicator import (
13
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderOpenCloseIndicator,
14
+ )
15
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order_side import (
16
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderSide,
17
+ )
18
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order_status import (
19
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderStatus,
20
+ )
21
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order_type import (
22
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderType,
23
+ )
24
+ from ..types import UNSET, Unset
25
+
26
+ if TYPE_CHECKING:
27
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order_instrument import (
28
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrument,
29
+ )
30
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order_leg import (
31
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderLeg,
32
+ )
33
+ from ..models.com_hellopublic_userapigateway_api_rest_order_order_expiration import (
34
+ ComHellopublicUserapigatewayApiRestOrderOrderExpiration,
35
+ )
36
+
37
+
38
+ T = TypeVar("T", bound="ComHellopublicUserapigatewayApiRestOrderGatewayOrder")
39
+
40
+
41
+ @_attrs_define
42
+ class ComHellopublicUserapigatewayApiRestOrderGatewayOrder:
43
+ """
44
+ Attributes:
45
+ order_id (UUID | Unset):
46
+ instrument (ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrument | Unset):
47
+ created_at (datetime.datetime | Unset): Creation time of the order
48
+ type_ (ComHellopublicUserapigatewayApiRestOrderGatewayOrderType | Unset):
49
+ side (ComHellopublicUserapigatewayApiRestOrderGatewayOrderSide | Unset):
50
+ status (ComHellopublicUserapigatewayApiRestOrderGatewayOrderStatus | Unset):
51
+ quantity (str | Unset): Quantity of the order, mutually exclusive with notional value
52
+ notional_value (str | Unset): Notional value (dollar amount) of the order, mutually exclusive with quantity
53
+ expiration (ComHellopublicUserapigatewayApiRestOrderOrderExpiration | Unset):
54
+ limit_price (str | Unset): Present if type = LIMIT
55
+ stop_price (str | Unset): Present if type = STOP
56
+ closed_at (datetime.datetime | Unset): The time the order reached a terminal state, like CANCELLED, FILLED,
57
+ REJECTED, REPLACED
58
+ open_close_indicator (ComHellopublicUserapigatewayApiRestOrderGatewayOrderOpenCloseIndicator | Unset): Present
59
+ if the order is a single-leg option order, or if the order is a shorting order (sell-to-open or buy-to-close)
60
+ filled_quantity (str | Unset): The filled quantity of the order, present if the order had at least one trade
61
+ average_price (str | Unset): The average price per unit, present if the order had at least one trade
62
+ legs (list[ComHellopublicUserapigatewayApiRestOrderGatewayOrderLeg] | Unset): If instrument.type =
63
+ MULTI_LEG_INSTRUMENT, this contains the list of legs
64
+ reject_reason (str | Unset):
65
+ """
66
+
67
+ order_id: UUID | Unset = UNSET
68
+ instrument: ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrument | Unset = UNSET
69
+ created_at: datetime.datetime | Unset = UNSET
70
+ type_: ComHellopublicUserapigatewayApiRestOrderGatewayOrderType | Unset = UNSET
71
+ side: ComHellopublicUserapigatewayApiRestOrderGatewayOrderSide | Unset = UNSET
72
+ status: ComHellopublicUserapigatewayApiRestOrderGatewayOrderStatus | Unset = UNSET
73
+ quantity: str | Unset = UNSET
74
+ notional_value: str | Unset = UNSET
75
+ expiration: ComHellopublicUserapigatewayApiRestOrderOrderExpiration | Unset = UNSET
76
+ limit_price: str | Unset = UNSET
77
+ stop_price: str | Unset = UNSET
78
+ closed_at: datetime.datetime | Unset = UNSET
79
+ open_close_indicator: (
80
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderOpenCloseIndicator | Unset
81
+ ) = UNSET
82
+ filled_quantity: str | Unset = UNSET
83
+ average_price: str | Unset = UNSET
84
+ legs: list[ComHellopublicUserapigatewayApiRestOrderGatewayOrderLeg] | Unset = UNSET
85
+ reject_reason: str | Unset = UNSET
86
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
87
+
88
+ def to_dict(self) -> dict[str, Any]:
89
+ order_id: str | Unset = UNSET
90
+ if not isinstance(self.order_id, Unset):
91
+ order_id = str(self.order_id)
92
+
93
+ instrument: dict[str, Any] | Unset = UNSET
94
+ if not isinstance(self.instrument, Unset):
95
+ instrument = self.instrument.to_dict()
96
+
97
+ created_at: str | Unset = UNSET
98
+ if not isinstance(self.created_at, Unset):
99
+ created_at = self.created_at.isoformat()
100
+
101
+ type_: str | Unset = UNSET
102
+ if not isinstance(self.type_, Unset):
103
+ type_ = self.type_.value
104
+
105
+ side: str | Unset = UNSET
106
+ if not isinstance(self.side, Unset):
107
+ side = self.side.value
108
+
109
+ status: str | Unset = UNSET
110
+ if not isinstance(self.status, Unset):
111
+ status = self.status.value
112
+
113
+ quantity = self.quantity
114
+
115
+ notional_value = self.notional_value
116
+
117
+ expiration: dict[str, Any] | Unset = UNSET
118
+ if not isinstance(self.expiration, Unset):
119
+ expiration = self.expiration.to_dict()
120
+
121
+ limit_price = self.limit_price
122
+
123
+ stop_price = self.stop_price
124
+
125
+ closed_at: str | Unset = UNSET
126
+ if not isinstance(self.closed_at, Unset):
127
+ closed_at = self.closed_at.isoformat()
128
+
129
+ open_close_indicator: str | Unset = UNSET
130
+ if not isinstance(self.open_close_indicator, Unset):
131
+ open_close_indicator = self.open_close_indicator.value
132
+
133
+ filled_quantity = self.filled_quantity
134
+
135
+ average_price = self.average_price
136
+
137
+ legs: list[dict[str, Any]] | Unset = UNSET
138
+ if not isinstance(self.legs, Unset):
139
+ legs = []
140
+ for legs_item_data in self.legs:
141
+ legs_item = legs_item_data.to_dict()
142
+ legs.append(legs_item)
143
+
144
+ reject_reason = self.reject_reason
145
+
146
+ field_dict: dict[str, Any] = {}
147
+ field_dict.update(self.additional_properties)
148
+ field_dict.update({})
149
+ if order_id is not UNSET:
150
+ field_dict["orderId"] = order_id
151
+ if instrument is not UNSET:
152
+ field_dict["instrument"] = instrument
153
+ if created_at is not UNSET:
154
+ field_dict["createdAt"] = created_at
155
+ if type_ is not UNSET:
156
+ field_dict["type"] = type_
157
+ if side is not UNSET:
158
+ field_dict["side"] = side
159
+ if status is not UNSET:
160
+ field_dict["status"] = status
161
+ if quantity is not UNSET:
162
+ field_dict["quantity"] = quantity
163
+ if notional_value is not UNSET:
164
+ field_dict["notionalValue"] = notional_value
165
+ if expiration is not UNSET:
166
+ field_dict["expiration"] = expiration
167
+ if limit_price is not UNSET:
168
+ field_dict["limitPrice"] = limit_price
169
+ if stop_price is not UNSET:
170
+ field_dict["stopPrice"] = stop_price
171
+ if closed_at is not UNSET:
172
+ field_dict["closedAt"] = closed_at
173
+ if open_close_indicator is not UNSET:
174
+ field_dict["openCloseIndicator"] = open_close_indicator
175
+ if filled_quantity is not UNSET:
176
+ field_dict["filledQuantity"] = filled_quantity
177
+ if average_price is not UNSET:
178
+ field_dict["averagePrice"] = average_price
179
+ if legs is not UNSET:
180
+ field_dict["legs"] = legs
181
+ if reject_reason is not UNSET:
182
+ field_dict["rejectReason"] = reject_reason
183
+
184
+ return field_dict
185
+
186
+ @classmethod
187
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
188
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order_instrument import (
189
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrument,
190
+ )
191
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order_leg import (
192
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderLeg,
193
+ )
194
+ from ..models.com_hellopublic_userapigateway_api_rest_order_order_expiration import (
195
+ ComHellopublicUserapigatewayApiRestOrderOrderExpiration,
196
+ )
197
+
198
+ d = dict(src_dict)
199
+ _order_id = d.pop("orderId", UNSET)
200
+ order_id: UUID | Unset
201
+ if isinstance(_order_id, Unset):
202
+ order_id = UNSET
203
+ else:
204
+ order_id = UUID(_order_id)
205
+
206
+ _instrument = d.pop("instrument", UNSET)
207
+ instrument: ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrument | Unset
208
+ if isinstance(_instrument, Unset):
209
+ instrument = UNSET
210
+ else:
211
+ instrument = ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrument.from_dict(
212
+ _instrument
213
+ )
214
+
215
+ _created_at = d.pop("createdAt", UNSET)
216
+ created_at: datetime.datetime | Unset
217
+ if isinstance(_created_at, Unset):
218
+ created_at = UNSET
219
+ else:
220
+ created_at = isoparse(_created_at)
221
+
222
+ _type_ = d.pop("type", UNSET)
223
+ type_: ComHellopublicUserapigatewayApiRestOrderGatewayOrderType | Unset
224
+ if isinstance(_type_, Unset):
225
+ type_ = UNSET
226
+ else:
227
+ type_ = ComHellopublicUserapigatewayApiRestOrderGatewayOrderType(_type_)
228
+
229
+ _side = d.pop("side", UNSET)
230
+ side: ComHellopublicUserapigatewayApiRestOrderGatewayOrderSide | Unset
231
+ if isinstance(_side, Unset):
232
+ side = UNSET
233
+ else:
234
+ side = ComHellopublicUserapigatewayApiRestOrderGatewayOrderSide(_side)
235
+
236
+ _status = d.pop("status", UNSET)
237
+ status: ComHellopublicUserapigatewayApiRestOrderGatewayOrderStatus | Unset
238
+ if isinstance(_status, Unset):
239
+ status = UNSET
240
+ else:
241
+ status = ComHellopublicUserapigatewayApiRestOrderGatewayOrderStatus(_status)
242
+
243
+ quantity = d.pop("quantity", UNSET)
244
+
245
+ notional_value = d.pop("notionalValue", UNSET)
246
+
247
+ _expiration = d.pop("expiration", UNSET)
248
+ expiration: ComHellopublicUserapigatewayApiRestOrderOrderExpiration | Unset
249
+ if isinstance(_expiration, Unset):
250
+ expiration = UNSET
251
+ else:
252
+ expiration = ComHellopublicUserapigatewayApiRestOrderOrderExpiration.from_dict(
253
+ _expiration
254
+ )
255
+
256
+ limit_price = d.pop("limitPrice", UNSET)
257
+
258
+ stop_price = d.pop("stopPrice", UNSET)
259
+
260
+ _closed_at = d.pop("closedAt", UNSET)
261
+ closed_at: datetime.datetime | Unset
262
+ if isinstance(_closed_at, Unset):
263
+ closed_at = UNSET
264
+ else:
265
+ closed_at = isoparse(_closed_at)
266
+
267
+ _open_close_indicator = d.pop("openCloseIndicator", UNSET)
268
+ open_close_indicator: (
269
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderOpenCloseIndicator | Unset
270
+ )
271
+ if isinstance(_open_close_indicator, Unset):
272
+ open_close_indicator = UNSET
273
+ else:
274
+ open_close_indicator = (
275
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderOpenCloseIndicator(
276
+ _open_close_indicator
277
+ )
278
+ )
279
+
280
+ filled_quantity = d.pop("filledQuantity", UNSET)
281
+
282
+ average_price = d.pop("averagePrice", UNSET)
283
+
284
+ _legs = d.pop("legs", UNSET)
285
+ legs: list[ComHellopublicUserapigatewayApiRestOrderGatewayOrderLeg] | Unset = UNSET
286
+ if _legs is not UNSET:
287
+ legs = []
288
+ for legs_item_data in _legs:
289
+ legs_item = ComHellopublicUserapigatewayApiRestOrderGatewayOrderLeg.from_dict(
290
+ legs_item_data
291
+ )
292
+
293
+ legs.append(legs_item)
294
+
295
+ reject_reason = d.pop("rejectReason", UNSET)
296
+
297
+ com_hellopublic_userapigateway_api_rest_order_gateway_order = cls(
298
+ order_id=order_id,
299
+ instrument=instrument,
300
+ created_at=created_at,
301
+ type_=type_,
302
+ side=side,
303
+ status=status,
304
+ quantity=quantity,
305
+ notional_value=notional_value,
306
+ expiration=expiration,
307
+ limit_price=limit_price,
308
+ stop_price=stop_price,
309
+ closed_at=closed_at,
310
+ open_close_indicator=open_close_indicator,
311
+ filled_quantity=filled_quantity,
312
+ average_price=average_price,
313
+ legs=legs,
314
+ reject_reason=reject_reason,
315
+ )
316
+
317
+ com_hellopublic_userapigateway_api_rest_order_gateway_order.additional_properties = d
318
+ return com_hellopublic_userapigateway_api_rest_order_gateway_order
319
+
320
+ @property
321
+ def additional_keys(self) -> list[str]:
322
+ return list(self.additional_properties.keys())
323
+
324
+ def __getitem__(self, key: str) -> Any:
325
+ return self.additional_properties[key]
326
+
327
+ def __setitem__(self, key: str, value: Any) -> None:
328
+ self.additional_properties[key] = value
329
+
330
+ def __delitem__(self, key: str) -> None:
331
+ del self.additional_properties[key]
332
+
333
+ def __contains__(self, key: str) -> bool:
334
+ return key in self.additional_properties
@@ -0,0 +1,73 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import 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_order_gateway_order_instrument_type import (
10
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrumentType,
11
+ )
12
+
13
+ T = TypeVar("T", bound="ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrument")
14
+
15
+
16
+ @_attrs_define
17
+ class ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrument:
18
+ """
19
+ Attributes:
20
+ symbol (str):
21
+ type_ (ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrumentType):
22
+ """
23
+
24
+ symbol: str
25
+ type_: ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrumentType
26
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
27
+
28
+ def to_dict(self) -> dict[str, Any]:
29
+ symbol = self.symbol
30
+
31
+ type_ = self.type_.value
32
+
33
+ field_dict: dict[str, Any] = {}
34
+ field_dict.update(self.additional_properties)
35
+ field_dict.update(
36
+ {
37
+ "symbol": symbol,
38
+ "type": type_,
39
+ }
40
+ )
41
+
42
+ return field_dict
43
+
44
+ @classmethod
45
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
46
+ d = dict(src_dict)
47
+ symbol = d.pop("symbol")
48
+
49
+ type_ = ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrumentType(d.pop("type"))
50
+
51
+ com_hellopublic_userapigateway_api_rest_order_gateway_order_instrument = cls(
52
+ symbol=symbol,
53
+ type_=type_,
54
+ )
55
+
56
+ com_hellopublic_userapigateway_api_rest_order_gateway_order_instrument.additional_properties = d
57
+ return com_hellopublic_userapigateway_api_rest_order_gateway_order_instrument
58
+
59
+ @property
60
+ def additional_keys(self) -> list[str]:
61
+ return list(self.additional_properties.keys())
62
+
63
+ def __getitem__(self, key: str) -> Any:
64
+ return self.additional_properties[key]
65
+
66
+ def __setitem__(self, key: str, value: Any) -> None:
67
+ self.additional_properties[key] = value
68
+
69
+ def __delitem__(self, key: str) -> None:
70
+ del self.additional_properties[key]
71
+
72
+ def __contains__(self, key: str) -> bool:
73
+ return key in self.additional_properties
@@ -0,0 +1,15 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ComHellopublicUserapigatewayApiRestOrderGatewayOrderInstrumentType(str, Enum):
5
+ ALT = "ALT"
6
+ BOND = "BOND"
7
+ CRYPTO = "CRYPTO"
8
+ EQUITY = "EQUITY"
9
+ INDEX = "INDEX"
10
+ MULTI_LEG_INSTRUMENT = "MULTI_LEG_INSTRUMENT"
11
+ OPTION = "OPTION"
12
+ TREASURY = "TREASURY"
13
+
14
+ def __str__(self) -> str:
15
+ return str(self.value)
@@ -0,0 +1,125 @@
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_order_gateway_order_leg_open_close_indicator import (
10
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderLegOpenCloseIndicator,
11
+ )
12
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order_leg_side import (
13
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderLegSide,
14
+ )
15
+ from ..types import UNSET, Unset
16
+
17
+ if TYPE_CHECKING:
18
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_leg_instrument import (
19
+ ComHellopublicUserapigatewayApiRestOrderGatewayLegInstrument,
20
+ )
21
+
22
+
23
+ T = TypeVar("T", bound="ComHellopublicUserapigatewayApiRestOrderGatewayOrderLeg")
24
+
25
+
26
+ @_attrs_define
27
+ class ComHellopublicUserapigatewayApiRestOrderGatewayOrderLeg:
28
+ """Option or equity leg. There can never be more than 1 equity leg.
29
+
30
+ Attributes:
31
+ instrument (ComHellopublicUserapigatewayApiRestOrderGatewayLegInstrument):
32
+ side (ComHellopublicUserapigatewayApiRestOrderGatewayOrderLegSide):
33
+ open_close_indicator (ComHellopublicUserapigatewayApiRestOrderGatewayOrderLegOpenCloseIndicator | Unset):
34
+ required when instrument.type = OPTION, used to determine if the leg is buy-to-open or buy-to-close
35
+ ratio_quantity (int | Unset): The ratio between legs. Equity legs will typically be 100 shares, and option legs
36
+ 1 contract
37
+ """
38
+
39
+ instrument: ComHellopublicUserapigatewayApiRestOrderGatewayLegInstrument
40
+ side: ComHellopublicUserapigatewayApiRestOrderGatewayOrderLegSide
41
+ open_close_indicator: (
42
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderLegOpenCloseIndicator | Unset
43
+ ) = UNSET
44
+ ratio_quantity: int | Unset = UNSET
45
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
46
+
47
+ def to_dict(self) -> dict[str, Any]:
48
+ instrument = self.instrument.to_dict()
49
+
50
+ side = self.side.value
51
+
52
+ open_close_indicator: str | Unset = UNSET
53
+ if not isinstance(self.open_close_indicator, Unset):
54
+ open_close_indicator = self.open_close_indicator.value
55
+
56
+ ratio_quantity = self.ratio_quantity
57
+
58
+ field_dict: dict[str, Any] = {}
59
+ field_dict.update(self.additional_properties)
60
+ field_dict.update(
61
+ {
62
+ "instrument": instrument,
63
+ "side": side,
64
+ }
65
+ )
66
+ if open_close_indicator is not UNSET:
67
+ field_dict["openCloseIndicator"] = open_close_indicator
68
+ if ratio_quantity is not UNSET:
69
+ field_dict["ratioQuantity"] = ratio_quantity
70
+
71
+ return field_dict
72
+
73
+ @classmethod
74
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
75
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_leg_instrument import (
76
+ ComHellopublicUserapigatewayApiRestOrderGatewayLegInstrument,
77
+ )
78
+
79
+ d = dict(src_dict)
80
+ instrument = ComHellopublicUserapigatewayApiRestOrderGatewayLegInstrument.from_dict(
81
+ d.pop("instrument")
82
+ )
83
+
84
+ side = ComHellopublicUserapigatewayApiRestOrderGatewayOrderLegSide(d.pop("side"))
85
+
86
+ _open_close_indicator = d.pop("openCloseIndicator", UNSET)
87
+ open_close_indicator: (
88
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderLegOpenCloseIndicator | Unset
89
+ )
90
+ if isinstance(_open_close_indicator, Unset):
91
+ open_close_indicator = UNSET
92
+ else:
93
+ open_close_indicator = (
94
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrderLegOpenCloseIndicator(
95
+ _open_close_indicator
96
+ )
97
+ )
98
+
99
+ ratio_quantity = d.pop("ratioQuantity", UNSET)
100
+
101
+ com_hellopublic_userapigateway_api_rest_order_gateway_order_leg = cls(
102
+ instrument=instrument,
103
+ side=side,
104
+ open_close_indicator=open_close_indicator,
105
+ ratio_quantity=ratio_quantity,
106
+ )
107
+
108
+ com_hellopublic_userapigateway_api_rest_order_gateway_order_leg.additional_properties = d
109
+ return com_hellopublic_userapigateway_api_rest_order_gateway_order_leg
110
+
111
+ @property
112
+ def additional_keys(self) -> list[str]:
113
+ return list(self.additional_properties.keys())
114
+
115
+ def __getitem__(self, key: str) -> Any:
116
+ return self.additional_properties[key]
117
+
118
+ def __setitem__(self, key: str, value: Any) -> None:
119
+ self.additional_properties[key] = value
120
+
121
+ def __delitem__(self, key: str) -> None:
122
+ del self.additional_properties[key]
123
+
124
+ def __contains__(self, key: str) -> bool:
125
+ return key in self.additional_properties
@@ -0,0 +1,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ComHellopublicUserapigatewayApiRestOrderGatewayOrderLegOpenCloseIndicator(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 ComHellopublicUserapigatewayApiRestOrderGatewayOrderLegSide(str, Enum):
5
+ BUY = "BUY"
6
+ SELL = "SELL"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
@@ -0,0 +1,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ComHellopublicUserapigatewayApiRestOrderGatewayOrderOpenCloseIndicator(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 ComHellopublicUserapigatewayApiRestOrderGatewayOrderSide(str, Enum):
5
+ BUY = "BUY"
6
+ SELL = "SELL"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
@@ -0,0 +1,17 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ComHellopublicUserapigatewayApiRestOrderGatewayOrderStatus(str, Enum):
5
+ CANCELLED = "CANCELLED"
6
+ EXPIRED = "EXPIRED"
7
+ FILLED = "FILLED"
8
+ NEW = "NEW"
9
+ PARTIALLY_FILLED = "PARTIALLY_FILLED"
10
+ PENDING_CANCEL = "PENDING_CANCEL"
11
+ PENDING_REPLACE = "PENDING_REPLACE"
12
+ QUEUED_CANCELLED = "QUEUED_CANCELLED"
13
+ REJECTED = "REJECTED"
14
+ REPLACED = "REPLACED"
15
+
16
+ def __str__(self) -> str:
17
+ return str(self.value)
@@ -0,0 +1,11 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ComHellopublicUserapigatewayApiRestOrderGatewayOrderType(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)