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
+ import datetime
4
+ from collections.abc import Mapping
5
+ from typing import Any, TypeVar, cast
6
+
7
+ from attrs import define as _attrs_define
8
+ from attrs import field as _attrs_field
9
+ from dateutil.parser import isoparse
10
+
11
+ from ..types import UNSET, Unset
12
+
13
+ T = TypeVar("T", bound="ComHellopublicUserapigatewayApiRestPortfolioGatewayCostBasisType0")
14
+
15
+
16
+ @_attrs_define
17
+ class ComHellopublicUserapigatewayApiRestPortfolioGatewayCostBasisType0:
18
+ """Cost basis of a position. What the member paid for entering the position. The cost basis is
19
+ based on tax lots and will factor in wash sales.
20
+
21
+ Attributes:
22
+ total_cost (None | str | Unset): What is the dollars paid for entering this position
23
+ unit_cost (None | str | Unset): Totalcost divided by the quantity.
24
+ gain_value (None | str | Unset): Amount of dollars this position gained or lost. Current value - total cost
25
+ gain_percentage (None | str | Unset): 100*gainValue/totalcost
26
+ last_update (datetime.datetime | None | Unset): When was the cost cases last updated.
27
+ """
28
+
29
+ total_cost: None | str | Unset = UNSET
30
+ unit_cost: None | str | Unset = UNSET
31
+ gain_value: None | str | Unset = UNSET
32
+ gain_percentage: None | str | Unset = UNSET
33
+ last_update: datetime.datetime | None | Unset = UNSET
34
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
35
+
36
+ def to_dict(self) -> dict[str, Any]:
37
+ total_cost: None | str | Unset
38
+ if isinstance(self.total_cost, Unset):
39
+ total_cost = UNSET
40
+ else:
41
+ total_cost = self.total_cost
42
+
43
+ unit_cost: None | str | Unset
44
+ if isinstance(self.unit_cost, Unset):
45
+ unit_cost = UNSET
46
+ else:
47
+ unit_cost = self.unit_cost
48
+
49
+ gain_value: None | str | Unset
50
+ if isinstance(self.gain_value, Unset):
51
+ gain_value = UNSET
52
+ else:
53
+ gain_value = self.gain_value
54
+
55
+ gain_percentage: None | str | Unset
56
+ if isinstance(self.gain_percentage, Unset):
57
+ gain_percentage = UNSET
58
+ else:
59
+ gain_percentage = self.gain_percentage
60
+
61
+ last_update: None | str | Unset
62
+ if isinstance(self.last_update, Unset):
63
+ last_update = UNSET
64
+ elif isinstance(self.last_update, datetime.datetime):
65
+ last_update = self.last_update.isoformat()
66
+ else:
67
+ last_update = self.last_update
68
+
69
+ field_dict: dict[str, Any] = {}
70
+ field_dict.update(self.additional_properties)
71
+ field_dict.update({})
72
+ if total_cost is not UNSET:
73
+ field_dict["totalCost"] = total_cost
74
+ if unit_cost is not UNSET:
75
+ field_dict["unitCost"] = unit_cost
76
+ if gain_value is not UNSET:
77
+ field_dict["gainValue"] = gain_value
78
+ if gain_percentage is not UNSET:
79
+ field_dict["gainPercentage"] = gain_percentage
80
+ if last_update is not UNSET:
81
+ field_dict["lastUpdate"] = last_update
82
+
83
+ return field_dict
84
+
85
+ @classmethod
86
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
87
+ d = dict(src_dict)
88
+
89
+ def _parse_total_cost(data: object) -> None | str | Unset:
90
+ if data is None:
91
+ return data
92
+ if isinstance(data, Unset):
93
+ return data
94
+ return cast(None | str | Unset, data)
95
+
96
+ total_cost = _parse_total_cost(d.pop("totalCost", UNSET))
97
+
98
+ def _parse_unit_cost(data: object) -> None | str | Unset:
99
+ if data is None:
100
+ return data
101
+ if isinstance(data, Unset):
102
+ return data
103
+ return cast(None | str | Unset, data)
104
+
105
+ unit_cost = _parse_unit_cost(d.pop("unitCost", UNSET))
106
+
107
+ def _parse_gain_value(data: object) -> None | str | Unset:
108
+ if data is None:
109
+ return data
110
+ if isinstance(data, Unset):
111
+ return data
112
+ return cast(None | str | Unset, data)
113
+
114
+ gain_value = _parse_gain_value(d.pop("gainValue", UNSET))
115
+
116
+ def _parse_gain_percentage(data: object) -> None | str | Unset:
117
+ if data is None:
118
+ return data
119
+ if isinstance(data, Unset):
120
+ return data
121
+ return cast(None | str | Unset, data)
122
+
123
+ gain_percentage = _parse_gain_percentage(d.pop("gainPercentage", UNSET))
124
+
125
+ def _parse_last_update(data: object) -> datetime.datetime | None | Unset:
126
+ if data is None:
127
+ return data
128
+ if isinstance(data, Unset):
129
+ return data
130
+ try:
131
+ if not isinstance(data, str):
132
+ raise TypeError()
133
+ last_update_type_0 = isoparse(data)
134
+
135
+ return last_update_type_0
136
+ except (TypeError, ValueError, AttributeError, KeyError):
137
+ pass
138
+ return cast(datetime.datetime | None | Unset, data)
139
+
140
+ last_update = _parse_last_update(d.pop("lastUpdate", UNSET))
141
+
142
+ com_hellopublic_userapigateway_api_rest_portfolio_gateway_cost_basis_type_0 = cls(
143
+ total_cost=total_cost,
144
+ unit_cost=unit_cost,
145
+ gain_value=gain_value,
146
+ gain_percentage=gain_percentage,
147
+ last_update=last_update,
148
+ )
149
+
150
+ com_hellopublic_userapigateway_api_rest_portfolio_gateway_cost_basis_type_0.additional_properties = d
151
+ return com_hellopublic_userapigateway_api_rest_portfolio_gateway_cost_basis_type_0
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,233 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar, cast
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_portfolio_gateway_portfolio_account_v2_account_type import (
10
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2AccountType,
11
+ )
12
+ from ..types import UNSET, Unset
13
+
14
+ if TYPE_CHECKING:
15
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order import (
16
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrder,
17
+ )
18
+ from ..models.com_hellopublic_userapigateway_api_rest_portfolio_gateway_buying_power import (
19
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayBuyingPower,
20
+ )
21
+ from ..models.com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_equity_v2 import (
22
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioEquityV2,
23
+ )
24
+ from ..models.com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_position import (
25
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioPosition,
26
+ )
27
+ from ..models.com_hellopublic_userapigateway_api_rest_portfolio_gateway_strategy import (
28
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayStrategy,
29
+ )
30
+
31
+
32
+ T = TypeVar("T", bound="ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2")
33
+
34
+
35
+ @_attrs_define
36
+ class ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2:
37
+ """Portfolio for the account
38
+
39
+ Attributes:
40
+ account_id (str): Id of the account
41
+ account_type (ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2AccountType): Type of the
42
+ account
43
+ buying_power (ComHellopublicUserapigatewayApiRestPortfolioGatewayBuyingPower):
44
+ equity (list[ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioEquityV2]): List of equity summaries
45
+ positions (list[ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioPosition]): List of positions
46
+ orders (list[ComHellopublicUserapigatewayApiRestOrderGatewayOrder]):
47
+ strategies (list[ComHellopublicUserapigatewayApiRestPortfolioGatewayStrategy] | None | Unset): List of multi-leg
48
+ option strategies. Null if backend doesn't support strategies.
49
+ """
50
+
51
+ account_id: str
52
+ account_type: ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2AccountType
53
+ buying_power: ComHellopublicUserapigatewayApiRestPortfolioGatewayBuyingPower
54
+ equity: list[ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioEquityV2]
55
+ positions: list[ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioPosition]
56
+ orders: list[ComHellopublicUserapigatewayApiRestOrderGatewayOrder]
57
+ strategies: list[ComHellopublicUserapigatewayApiRestPortfolioGatewayStrategy] | None | Unset = (
58
+ UNSET
59
+ )
60
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
61
+
62
+ def to_dict(self) -> dict[str, Any]:
63
+ account_id = self.account_id
64
+
65
+ account_type = self.account_type.value
66
+
67
+ buying_power = self.buying_power.to_dict()
68
+
69
+ equity = []
70
+ for equity_item_data in self.equity:
71
+ equity_item = equity_item_data.to_dict()
72
+ equity.append(equity_item)
73
+
74
+ positions = []
75
+ for positions_item_data in self.positions:
76
+ positions_item = positions_item_data.to_dict()
77
+ positions.append(positions_item)
78
+
79
+ orders = []
80
+ for orders_item_data in self.orders:
81
+ orders_item = orders_item_data.to_dict()
82
+ orders.append(orders_item)
83
+
84
+ strategies: list[dict[str, Any]] | None | Unset
85
+ if isinstance(self.strategies, Unset):
86
+ strategies = UNSET
87
+ elif isinstance(self.strategies, list):
88
+ strategies = []
89
+ for strategies_type_0_item_data in self.strategies:
90
+ strategies_type_0_item = strategies_type_0_item_data.to_dict()
91
+ strategies.append(strategies_type_0_item)
92
+
93
+ else:
94
+ strategies = self.strategies
95
+
96
+ field_dict: dict[str, Any] = {}
97
+ field_dict.update(self.additional_properties)
98
+ field_dict.update(
99
+ {
100
+ "accountId": account_id,
101
+ "accountType": account_type,
102
+ "buyingPower": buying_power,
103
+ "equity": equity,
104
+ "positions": positions,
105
+ "orders": orders,
106
+ }
107
+ )
108
+ if strategies is not UNSET:
109
+ field_dict["strategies"] = strategies
110
+
111
+ return field_dict
112
+
113
+ @classmethod
114
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
115
+ from ..models.com_hellopublic_userapigateway_api_rest_order_gateway_order import (
116
+ ComHellopublicUserapigatewayApiRestOrderGatewayOrder,
117
+ )
118
+ from ..models.com_hellopublic_userapigateway_api_rest_portfolio_gateway_buying_power import (
119
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayBuyingPower,
120
+ )
121
+ from ..models.com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_equity_v2 import (
122
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioEquityV2,
123
+ )
124
+ from ..models.com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_position import (
125
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioPosition,
126
+ )
127
+ from ..models.com_hellopublic_userapigateway_api_rest_portfolio_gateway_strategy import (
128
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayStrategy,
129
+ )
130
+
131
+ d = dict(src_dict)
132
+ account_id = d.pop("accountId")
133
+
134
+ account_type = (
135
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2AccountType(
136
+ d.pop("accountType")
137
+ )
138
+ )
139
+
140
+ buying_power = ComHellopublicUserapigatewayApiRestPortfolioGatewayBuyingPower.from_dict(
141
+ d.pop("buyingPower")
142
+ )
143
+
144
+ equity = []
145
+ _equity = d.pop("equity")
146
+ for equity_item_data in _equity:
147
+ equity_item = (
148
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioEquityV2.from_dict(
149
+ equity_item_data
150
+ )
151
+ )
152
+
153
+ equity.append(equity_item)
154
+
155
+ positions = []
156
+ _positions = d.pop("positions")
157
+ for positions_item_data in _positions:
158
+ positions_item = (
159
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioPosition.from_dict(
160
+ positions_item_data
161
+ )
162
+ )
163
+
164
+ positions.append(positions_item)
165
+
166
+ orders = []
167
+ _orders = d.pop("orders")
168
+ for orders_item_data in _orders:
169
+ orders_item = ComHellopublicUserapigatewayApiRestOrderGatewayOrder.from_dict(
170
+ orders_item_data
171
+ )
172
+
173
+ orders.append(orders_item)
174
+
175
+ def _parse_strategies(
176
+ data: object,
177
+ ) -> list[ComHellopublicUserapigatewayApiRestPortfolioGatewayStrategy] | None | Unset:
178
+ if data is None:
179
+ return data
180
+ if isinstance(data, Unset):
181
+ return data
182
+ try:
183
+ if not isinstance(data, list):
184
+ raise TypeError()
185
+ strategies_type_0 = []
186
+ _strategies_type_0 = data
187
+ for strategies_type_0_item_data in _strategies_type_0:
188
+ strategies_type_0_item = (
189
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayStrategy.from_dict(
190
+ strategies_type_0_item_data
191
+ )
192
+ )
193
+
194
+ strategies_type_0.append(strategies_type_0_item)
195
+
196
+ return strategies_type_0
197
+ except (TypeError, ValueError, AttributeError, KeyError):
198
+ pass
199
+ return cast(
200
+ list[ComHellopublicUserapigatewayApiRestPortfolioGatewayStrategy] | None | Unset,
201
+ data,
202
+ )
203
+
204
+ strategies = _parse_strategies(d.pop("strategies", UNSET))
205
+
206
+ com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_account_v2 = cls(
207
+ account_id=account_id,
208
+ account_type=account_type,
209
+ buying_power=buying_power,
210
+ equity=equity,
211
+ positions=positions,
212
+ orders=orders,
213
+ strategies=strategies,
214
+ )
215
+
216
+ com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_account_v2.additional_properties = d
217
+ return com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_account_v2
218
+
219
+ @property
220
+ def additional_keys(self) -> list[str]:
221
+ return list(self.additional_properties.keys())
222
+
223
+ def __getitem__(self, key: str) -> Any:
224
+ return self.additional_properties[key]
225
+
226
+ def __setitem__(self, key: str, value: Any) -> None:
227
+ self.additional_properties[key] = value
228
+
229
+ def __delitem__(self, key: str) -> None:
230
+ del self.additional_properties[key]
231
+
232
+ def __contains__(self, key: str) -> bool:
233
+ return key in self.additional_properties
@@ -0,0 +1,14 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2AccountType(str, Enum):
5
+ BOND_ACCOUNT = "BOND_ACCOUNT"
6
+ BROKERAGE = "BROKERAGE"
7
+ HIGH_YIELD = "HIGH_YIELD"
8
+ RIA_ASSET = "RIA_ASSET"
9
+ ROTH_IRA = "ROTH_IRA"
10
+ TRADITIONAL_IRA = "TRADITIONAL_IRA"
11
+ TREASURY = "TREASURY"
12
+
13
+ def __str__(self) -> str:
14
+ return str(self.value)
@@ -0,0 +1,100 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Any, TypeVar, cast
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_portfolio_gateway_portfolio_equity_v2_type import (
10
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioEquityV2Type,
11
+ )
12
+ from ..types import UNSET, Unset
13
+
14
+ T = TypeVar("T", bound="ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioEquityV2")
15
+
16
+
17
+ @_attrs_define
18
+ class ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioEquityV2:
19
+ """Portfolio equity summary
20
+
21
+ Attributes:
22
+ type_ (ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioEquityV2Type): Type of asset.
23
+ value (str): Total value for the given asset type.
24
+ percentage_of_portfolio (None | str | Unset): The percentage of the portfolio this asset type constitutes.
25
+ The percentage number is given with 2 decimals.
26
+ """
27
+
28
+ type_: ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioEquityV2Type
29
+ value: str
30
+ percentage_of_portfolio: None | str | Unset = UNSET
31
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
32
+
33
+ def to_dict(self) -> dict[str, Any]:
34
+ type_ = self.type_.value
35
+
36
+ value = self.value
37
+
38
+ percentage_of_portfolio: None | str | Unset
39
+ if isinstance(self.percentage_of_portfolio, Unset):
40
+ percentage_of_portfolio = UNSET
41
+ else:
42
+ percentage_of_portfolio = self.percentage_of_portfolio
43
+
44
+ field_dict: dict[str, Any] = {}
45
+ field_dict.update(self.additional_properties)
46
+ field_dict.update(
47
+ {
48
+ "type": type_,
49
+ "value": value,
50
+ }
51
+ )
52
+ if percentage_of_portfolio is not UNSET:
53
+ field_dict["percentageOfPortfolio"] = percentage_of_portfolio
54
+
55
+ return field_dict
56
+
57
+ @classmethod
58
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
59
+ d = dict(src_dict)
60
+ type_ = ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioEquityV2Type(
61
+ d.pop("type")
62
+ )
63
+
64
+ value = d.pop("value")
65
+
66
+ def _parse_percentage_of_portfolio(data: object) -> None | str | Unset:
67
+ if data is None:
68
+ return data
69
+ if isinstance(data, Unset):
70
+ return data
71
+ return cast(None | str | Unset, data)
72
+
73
+ percentage_of_portfolio = _parse_percentage_of_portfolio(
74
+ d.pop("percentageOfPortfolio", UNSET)
75
+ )
76
+
77
+ com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_equity_v2 = cls(
78
+ type_=type_,
79
+ value=value,
80
+ percentage_of_portfolio=percentage_of_portfolio,
81
+ )
82
+
83
+ com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_equity_v2.additional_properties = d
84
+ return com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_equity_v2
85
+
86
+ @property
87
+ def additional_keys(self) -> list[str]:
88
+ return list(self.additional_properties.keys())
89
+
90
+ def __getitem__(self, key: str) -> Any:
91
+ return self.additional_properties[key]
92
+
93
+ def __setitem__(self, key: str, value: Any) -> None:
94
+ self.additional_properties[key] = value
95
+
96
+ def __delitem__(self, key: str) -> None:
97
+ del self.additional_properties[key]
98
+
99
+ def __contains__(self, key: str) -> bool:
100
+ return key in self.additional_properties
@@ -0,0 +1,14 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioEquityV2Type(str, Enum):
5
+ BONDS = "BONDS"
6
+ CASH = "CASH"
7
+ CRYPTO = "CRYPTO"
8
+ JIKO_ACCOUNT = "JIKO_ACCOUNT"
9
+ OPTIONS_LONG = "OPTIONS_LONG"
10
+ OPTIONS_SHORT = "OPTIONS_SHORT"
11
+ STOCK = "STOCK"
12
+
13
+ def __str__(self) -> str:
14
+ return str(self.value)
@@ -0,0 +1,93 @@
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_portfolio_gateway_portfolio_instrument_type import (
10
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioInstrumentType,
11
+ )
12
+ from ..types import UNSET, Unset
13
+
14
+ T = TypeVar("T", bound="ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioInstrument")
15
+
16
+
17
+ @_attrs_define
18
+ class ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioInstrument:
19
+ """
20
+ Attributes:
21
+ symbol (str | Unset):
22
+ name (str | Unset):
23
+ type_ (ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioInstrumentType | Unset):
24
+ """
25
+
26
+ symbol: str | Unset = UNSET
27
+ name: str | Unset = UNSET
28
+ type_: ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioInstrumentType | Unset = (
29
+ UNSET
30
+ )
31
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
32
+
33
+ def to_dict(self) -> dict[str, Any]:
34
+ symbol = self.symbol
35
+
36
+ name = self.name
37
+
38
+ type_: str | Unset = UNSET
39
+ if not isinstance(self.type_, Unset):
40
+ type_ = self.type_.value
41
+
42
+ field_dict: dict[str, Any] = {}
43
+ field_dict.update(self.additional_properties)
44
+ field_dict.update({})
45
+ if symbol is not UNSET:
46
+ field_dict["symbol"] = symbol
47
+ if name is not UNSET:
48
+ field_dict["name"] = name
49
+ if type_ is not UNSET:
50
+ field_dict["type"] = type_
51
+
52
+ return field_dict
53
+
54
+ @classmethod
55
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
56
+ d = dict(src_dict)
57
+ symbol = d.pop("symbol", UNSET)
58
+
59
+ name = d.pop("name", UNSET)
60
+
61
+ _type_ = d.pop("type", UNSET)
62
+ type_: ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioInstrumentType | Unset
63
+ if isinstance(_type_, Unset):
64
+ type_ = UNSET
65
+ else:
66
+ type_ = ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioInstrumentType(
67
+ _type_
68
+ )
69
+
70
+ com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_instrument = cls(
71
+ symbol=symbol,
72
+ name=name,
73
+ type_=type_,
74
+ )
75
+
76
+ com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_instrument.additional_properties = d
77
+ return com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_instrument
78
+
79
+ @property
80
+ def additional_keys(self) -> list[str]:
81
+ return list(self.additional_properties.keys())
82
+
83
+ def __getitem__(self, key: str) -> Any:
84
+ return self.additional_properties[key]
85
+
86
+ def __setitem__(self, key: str, value: Any) -> None:
87
+ self.additional_properties[key] = value
88
+
89
+ def __delitem__(self, key: str) -> None:
90
+ del self.additional_properties[key]
91
+
92
+ def __contains__(self, key: str) -> bool:
93
+ return key in self.additional_properties
@@ -0,0 +1,14 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioInstrumentType(str, Enum):
5
+ ALT = "ALT"
6
+ BOND = "BOND"
7
+ CRYPTO = "CRYPTO"
8
+ EQUITY = "EQUITY"
9
+ INDEX = "INDEX"
10
+ OPTION = "OPTION"
11
+ TREASURY = "TREASURY"
12
+
13
+ def __str__(self) -> str:
14
+ return str(self.value)