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,3 @@
1
+ """Command-line tools for the Public API."""
2
+
3
+ __version__ = "1.0.0"
@@ -0,0 +1,5 @@
1
+ from publicdotcom_cli.cli import main
2
+
3
+
4
+ if __name__ == "__main__":
5
+ main()
@@ -0,0 +1,8 @@
1
+ """A client library for accessing User Api Gateway REST API"""
2
+
3
+ from .client import AuthenticatedClient, Client
4
+
5
+ __all__ = (
6
+ "AuthenticatedClient",
7
+ "Client",
8
+ )
@@ -0,0 +1 @@
1
+ """Contains methods for accessing the API"""
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,182 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_account_v2 import (
10
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2,
11
+ )
12
+ from ...types import Response
13
+
14
+
15
+ def _get_kwargs(
16
+ account_id: str,
17
+ ) -> dict[str, Any]:
18
+
19
+ _kwargs: dict[str, Any] = {
20
+ "method": "get",
21
+ "url": "/userapigateway/trading/{account_id}/portfolio/v2".format(
22
+ account_id=quote(str(account_id), safe=""),
23
+ ),
24
+ }
25
+
26
+ return _kwargs
27
+
28
+
29
+ def _parse_response(
30
+ *, client: AuthenticatedClient | Client, response: httpx.Response
31
+ ) -> ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2 | None:
32
+ if response.status_code == 200:
33
+ response_200 = (
34
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2.from_dict(
35
+ response.json()
36
+ )
37
+ )
38
+
39
+ return response_200
40
+
41
+ if response.status_code == 404:
42
+ response_404 = (
43
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2.from_dict(
44
+ response.json()
45
+ )
46
+ )
47
+
48
+ return response_404
49
+
50
+ if client.raise_on_unexpected_status:
51
+ raise errors.UnexpectedStatus(response.status_code, response.content)
52
+ else:
53
+ return None
54
+
55
+
56
+ def _build_response(
57
+ *, client: AuthenticatedClient | Client, response: httpx.Response
58
+ ) -> Response[ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2]:
59
+ return Response(
60
+ status_code=HTTPStatus(response.status_code),
61
+ content=response.content,
62
+ headers=response.headers,
63
+ parsed=_parse_response(client=client, response=response),
64
+ )
65
+
66
+
67
+ def sync_detailed(
68
+ account_id: str,
69
+ *,
70
+ client: AuthenticatedClient | Client,
71
+ ) -> Response[ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2]:
72
+ """Retrieve an account portfolio details snapshot
73
+
74
+ Retrieves a snapshot of a specified account’s portfolio, including positions, equity breakdown,
75
+ buying power, and open orders. The account must exist and belong to the authenticated client.
76
+
77
+ Args:
78
+ account_id (str):
79
+
80
+ Raises:
81
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
82
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
83
+
84
+ Returns:
85
+ Response[ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2]
86
+ """
87
+
88
+ kwargs = _get_kwargs(
89
+ account_id=account_id,
90
+ )
91
+
92
+ response = client.get_httpx_client().request(
93
+ **kwargs,
94
+ )
95
+
96
+ return _build_response(client=client, response=response)
97
+
98
+
99
+ def sync(
100
+ account_id: str,
101
+ *,
102
+ client: AuthenticatedClient | Client,
103
+ ) -> ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2 | None:
104
+ """Retrieve an account portfolio details snapshot
105
+
106
+ Retrieves a snapshot of a specified account’s portfolio, including positions, equity breakdown,
107
+ buying power, and open orders. The account must exist and belong to the authenticated client.
108
+
109
+ Args:
110
+ account_id (str):
111
+
112
+ Raises:
113
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
114
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
115
+
116
+ Returns:
117
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2
118
+ """
119
+
120
+ return sync_detailed(
121
+ account_id=account_id,
122
+ client=client,
123
+ ).parsed
124
+
125
+
126
+ async def asyncio_detailed(
127
+ account_id: str,
128
+ *,
129
+ client: AuthenticatedClient | Client,
130
+ ) -> Response[ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2]:
131
+ """Retrieve an account portfolio details snapshot
132
+
133
+ Retrieves a snapshot of a specified account’s portfolio, including positions, equity breakdown,
134
+ buying power, and open orders. The account must exist and belong to the authenticated client.
135
+
136
+ Args:
137
+ account_id (str):
138
+
139
+ Raises:
140
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
141
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
142
+
143
+ Returns:
144
+ Response[ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2]
145
+ """
146
+
147
+ kwargs = _get_kwargs(
148
+ account_id=account_id,
149
+ )
150
+
151
+ response = await client.get_async_httpx_client().request(**kwargs)
152
+
153
+ return _build_response(client=client, response=response)
154
+
155
+
156
+ async def asyncio(
157
+ account_id: str,
158
+ *,
159
+ client: AuthenticatedClient | Client,
160
+ ) -> ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2 | None:
161
+ """Retrieve an account portfolio details snapshot
162
+
163
+ Retrieves a snapshot of a specified account’s portfolio, including positions, equity breakdown,
164
+ buying power, and open orders. The account must exist and belong to the authenticated client.
165
+
166
+ Args:
167
+ account_id (str):
168
+
169
+ Raises:
170
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
171
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
172
+
173
+ Returns:
174
+ ComHellopublicUserapigatewayApiRestPortfolioGatewayPortfolioAccountV2
175
+ """
176
+
177
+ return (
178
+ await asyncio_detailed(
179
+ account_id=account_id,
180
+ client=client,
181
+ )
182
+ ).parsed
@@ -0,0 +1,250 @@
1
+ import datetime
2
+ from http import HTTPStatus
3
+ from typing import Any, cast
4
+ from urllib.parse import quote
5
+
6
+ import httpx
7
+
8
+ from ... import errors
9
+ from ...client import AuthenticatedClient, Client
10
+ from ...models.com_hellopublic_userapigateway_api_rest_history_gateway_history_response_page import (
11
+ ComHellopublicUserapigatewayApiRestHistoryGatewayHistoryResponsePage,
12
+ )
13
+ from ...types import UNSET, Response, Unset
14
+
15
+
16
+ def _get_kwargs(
17
+ account_id: str,
18
+ *,
19
+ start: datetime.datetime | Unset = UNSET,
20
+ end: datetime.datetime | Unset = UNSET,
21
+ page_size: int | Unset = UNSET,
22
+ next_token: str | Unset = UNSET,
23
+ ) -> dict[str, Any]:
24
+
25
+ params: dict[str, Any] = {}
26
+
27
+ json_start: str | Unset = UNSET
28
+ if not isinstance(start, Unset):
29
+ json_start = start.isoformat()
30
+ params["start"] = json_start
31
+
32
+ json_end: str | Unset = UNSET
33
+ if not isinstance(end, Unset):
34
+ json_end = end.isoformat()
35
+ params["end"] = json_end
36
+
37
+ params["pageSize"] = page_size
38
+
39
+ params["nextToken"] = next_token
40
+
41
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
42
+
43
+ _kwargs: dict[str, Any] = {
44
+ "method": "get",
45
+ "url": "/userapigateway/trading/{account_id}/history".format(
46
+ account_id=quote(str(account_id), safe=""),
47
+ ),
48
+ "params": params,
49
+ }
50
+
51
+ return _kwargs
52
+
53
+
54
+ def _parse_response(
55
+ *, client: AuthenticatedClient | Client, response: httpx.Response
56
+ ) -> Any | ComHellopublicUserapigatewayApiRestHistoryGatewayHistoryResponsePage | None:
57
+ if response.status_code == 200:
58
+ response_200 = (
59
+ ComHellopublicUserapigatewayApiRestHistoryGatewayHistoryResponsePage.from_dict(
60
+ response.json()
61
+ )
62
+ )
63
+
64
+ return response_200
65
+
66
+ if response.status_code == 400:
67
+ response_400 = cast(Any, None)
68
+ return response_400
69
+
70
+ if client.raise_on_unexpected_status:
71
+ raise errors.UnexpectedStatus(response.status_code, response.content)
72
+ else:
73
+ return None
74
+
75
+
76
+ def _build_response(
77
+ *, client: AuthenticatedClient | Client, response: httpx.Response
78
+ ) -> Response[Any | ComHellopublicUserapigatewayApiRestHistoryGatewayHistoryResponsePage]:
79
+ return Response(
80
+ status_code=HTTPStatus(response.status_code),
81
+ content=response.content,
82
+ headers=response.headers,
83
+ parsed=_parse_response(client=client, response=response),
84
+ )
85
+
86
+
87
+ def sync_detailed(
88
+ account_id: str,
89
+ *,
90
+ client: AuthenticatedClient | Client,
91
+ start: datetime.datetime | Unset = UNSET,
92
+ end: datetime.datetime | Unset = UNSET,
93
+ page_size: int | Unset = UNSET,
94
+ next_token: str | Unset = UNSET,
95
+ ) -> Response[Any | ComHellopublicUserapigatewayApiRestHistoryGatewayHistoryResponsePage]:
96
+ """Retrieve account history
97
+
98
+ Fetches a paginated list of historical events for the specified account. Supports optional time
99
+ range filtering and pagination via a continuation token.
100
+
101
+ Args:
102
+ account_id (str):
103
+ start (datetime.datetime | Unset):
104
+ end (datetime.datetime | Unset):
105
+ page_size (int | Unset):
106
+ next_token (str | Unset):
107
+
108
+ Raises:
109
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
110
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
111
+
112
+ Returns:
113
+ Response[Any | ComHellopublicUserapigatewayApiRestHistoryGatewayHistoryResponsePage]
114
+ """
115
+
116
+ kwargs = _get_kwargs(
117
+ account_id=account_id,
118
+ start=start,
119
+ end=end,
120
+ page_size=page_size,
121
+ next_token=next_token,
122
+ )
123
+
124
+ response = client.get_httpx_client().request(
125
+ **kwargs,
126
+ )
127
+
128
+ return _build_response(client=client, response=response)
129
+
130
+
131
+ def sync(
132
+ account_id: str,
133
+ *,
134
+ client: AuthenticatedClient | Client,
135
+ start: datetime.datetime | Unset = UNSET,
136
+ end: datetime.datetime | Unset = UNSET,
137
+ page_size: int | Unset = UNSET,
138
+ next_token: str | Unset = UNSET,
139
+ ) -> Any | ComHellopublicUserapigatewayApiRestHistoryGatewayHistoryResponsePage | None:
140
+ """Retrieve account history
141
+
142
+ Fetches a paginated list of historical events for the specified account. Supports optional time
143
+ range filtering and pagination via a continuation token.
144
+
145
+ Args:
146
+ account_id (str):
147
+ start (datetime.datetime | Unset):
148
+ end (datetime.datetime | Unset):
149
+ page_size (int | Unset):
150
+ next_token (str | Unset):
151
+
152
+ Raises:
153
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
154
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
155
+
156
+ Returns:
157
+ Any | ComHellopublicUserapigatewayApiRestHistoryGatewayHistoryResponsePage
158
+ """
159
+
160
+ return sync_detailed(
161
+ account_id=account_id,
162
+ client=client,
163
+ start=start,
164
+ end=end,
165
+ page_size=page_size,
166
+ next_token=next_token,
167
+ ).parsed
168
+
169
+
170
+ async def asyncio_detailed(
171
+ account_id: str,
172
+ *,
173
+ client: AuthenticatedClient | Client,
174
+ start: datetime.datetime | Unset = UNSET,
175
+ end: datetime.datetime | Unset = UNSET,
176
+ page_size: int | Unset = UNSET,
177
+ next_token: str | Unset = UNSET,
178
+ ) -> Response[Any | ComHellopublicUserapigatewayApiRestHistoryGatewayHistoryResponsePage]:
179
+ """Retrieve account history
180
+
181
+ Fetches a paginated list of historical events for the specified account. Supports optional time
182
+ range filtering and pagination via a continuation token.
183
+
184
+ Args:
185
+ account_id (str):
186
+ start (datetime.datetime | Unset):
187
+ end (datetime.datetime | Unset):
188
+ page_size (int | Unset):
189
+ next_token (str | Unset):
190
+
191
+ Raises:
192
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
193
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
194
+
195
+ Returns:
196
+ Response[Any | ComHellopublicUserapigatewayApiRestHistoryGatewayHistoryResponsePage]
197
+ """
198
+
199
+ kwargs = _get_kwargs(
200
+ account_id=account_id,
201
+ start=start,
202
+ end=end,
203
+ page_size=page_size,
204
+ next_token=next_token,
205
+ )
206
+
207
+ response = await client.get_async_httpx_client().request(**kwargs)
208
+
209
+ return _build_response(client=client, response=response)
210
+
211
+
212
+ async def asyncio(
213
+ account_id: str,
214
+ *,
215
+ client: AuthenticatedClient | Client,
216
+ start: datetime.datetime | Unset = UNSET,
217
+ end: datetime.datetime | Unset = UNSET,
218
+ page_size: int | Unset = UNSET,
219
+ next_token: str | Unset = UNSET,
220
+ ) -> Any | ComHellopublicUserapigatewayApiRestHistoryGatewayHistoryResponsePage | None:
221
+ """Retrieve account history
222
+
223
+ Fetches a paginated list of historical events for the specified account. Supports optional time
224
+ range filtering and pagination via a continuation token.
225
+
226
+ Args:
227
+ account_id (str):
228
+ start (datetime.datetime | Unset):
229
+ end (datetime.datetime | Unset):
230
+ page_size (int | Unset):
231
+ next_token (str | Unset):
232
+
233
+ Raises:
234
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
235
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
236
+
237
+ Returns:
238
+ Any | ComHellopublicUserapigatewayApiRestHistoryGatewayHistoryResponsePage
239
+ """
240
+
241
+ return (
242
+ await asyncio_detailed(
243
+ account_id=account_id,
244
+ client=client,
245
+ start=start,
246
+ end=end,
247
+ page_size=page_size,
248
+ next_token=next_token,
249
+ )
250
+ ).parsed
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,230 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.com_hellopublic_userapiauthservice_api_personal_create_access_token_request import (
9
+ ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenRequest,
10
+ )
11
+ from ...models.com_hellopublic_userapiauthservice_api_personal_create_access_token_response import (
12
+ ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenResponse,
13
+ )
14
+ from ...models.com_hellopublic_userapiauthservice_domain_error_error_body import (
15
+ ComHellopublicUserapiauthserviceDomainErrorErrorBody,
16
+ )
17
+ from ...types import Response
18
+
19
+
20
+ def _get_kwargs(
21
+ *,
22
+ body: ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenRequest,
23
+ ) -> dict[str, Any]:
24
+ headers: dict[str, Any] = {}
25
+
26
+ _kwargs: dict[str, Any] = {
27
+ "method": "post",
28
+ "url": "/userapiauthservice/personal/access-tokens",
29
+ }
30
+
31
+ _kwargs["json"] = body.to_dict()
32
+
33
+ headers["Content-Type"] = "application/json"
34
+
35
+ _kwargs["headers"] = headers
36
+ return _kwargs
37
+
38
+
39
+ def _parse_response(
40
+ *, client: AuthenticatedClient | Client, response: httpx.Response
41
+ ) -> (
42
+ ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenResponse
43
+ | ComHellopublicUserapiauthserviceDomainErrorErrorBody
44
+ | None
45
+ ):
46
+ if response.status_code == 200:
47
+ response_200 = (
48
+ ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenResponse.from_dict(
49
+ response.json()
50
+ )
51
+ )
52
+
53
+ return response_200
54
+
55
+ if response.status_code == 401:
56
+ response_401 = ComHellopublicUserapiauthserviceDomainErrorErrorBody.from_dict(
57
+ response.json()
58
+ )
59
+
60
+ return response_401
61
+
62
+ if response.status_code == 429:
63
+ response_429 = ComHellopublicUserapiauthserviceDomainErrorErrorBody.from_dict(
64
+ response.json()
65
+ )
66
+
67
+ return response_429
68
+
69
+ if client.raise_on_unexpected_status:
70
+ raise errors.UnexpectedStatus(response.status_code, response.content)
71
+ else:
72
+ return None
73
+
74
+
75
+ def _build_response(
76
+ *, client: AuthenticatedClient | Client, response: httpx.Response
77
+ ) -> Response[
78
+ ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenResponse
79
+ | ComHellopublicUserapiauthserviceDomainErrorErrorBody
80
+ ]:
81
+ return Response(
82
+ status_code=HTTPStatus(response.status_code),
83
+ content=response.content,
84
+ headers=response.headers,
85
+ parsed=_parse_response(client=client, response=response),
86
+ )
87
+
88
+
89
+ def sync_detailed(
90
+ *,
91
+ client: AuthenticatedClient | Client,
92
+ body: ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenRequest,
93
+ ) -> Response[
94
+ ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenResponse
95
+ | ComHellopublicUserapiauthserviceDomainErrorErrorBody
96
+ ]:
97
+ """Create API Access Token
98
+
99
+ Generates a new personal Access Token (JWT) with a specified validity in minutes, using an existing
100
+ personal Secret Token. The personal Secret Token must be generated from the user's settings page.
101
+ Secret Tokens are long-lived but revocable, while Access Tokens are short-lived and expire after the
102
+ specified validity period. The Access Token returned from this operation is required for
103
+ authorization in all other subsequent API requests.
104
+
105
+ Args:
106
+ body (ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenRequest):
107
+
108
+ Raises:
109
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
110
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
111
+
112
+ Returns:
113
+ Response[ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenResponse | ComHellopublicUserapiauthserviceDomainErrorErrorBody]
114
+ """
115
+
116
+ kwargs = _get_kwargs(
117
+ body=body,
118
+ )
119
+
120
+ response = client.get_httpx_client().request(
121
+ **kwargs,
122
+ )
123
+
124
+ return _build_response(client=client, response=response)
125
+
126
+
127
+ def sync(
128
+ *,
129
+ client: AuthenticatedClient | Client,
130
+ body: ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenRequest,
131
+ ) -> (
132
+ ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenResponse
133
+ | ComHellopublicUserapiauthserviceDomainErrorErrorBody
134
+ | None
135
+ ):
136
+ """Create API Access Token
137
+
138
+ Generates a new personal Access Token (JWT) with a specified validity in minutes, using an existing
139
+ personal Secret Token. The personal Secret Token must be generated from the user's settings page.
140
+ Secret Tokens are long-lived but revocable, while Access Tokens are short-lived and expire after the
141
+ specified validity period. The Access Token returned from this operation is required for
142
+ authorization in all other subsequent API requests.
143
+
144
+ Args:
145
+ body (ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenRequest):
146
+
147
+ Raises:
148
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
149
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
150
+
151
+ Returns:
152
+ ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenResponse | ComHellopublicUserapiauthserviceDomainErrorErrorBody
153
+ """
154
+
155
+ return sync_detailed(
156
+ client=client,
157
+ body=body,
158
+ ).parsed
159
+
160
+
161
+ async def asyncio_detailed(
162
+ *,
163
+ client: AuthenticatedClient | Client,
164
+ body: ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenRequest,
165
+ ) -> Response[
166
+ ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenResponse
167
+ | ComHellopublicUserapiauthserviceDomainErrorErrorBody
168
+ ]:
169
+ """Create API Access Token
170
+
171
+ Generates a new personal Access Token (JWT) with a specified validity in minutes, using an existing
172
+ personal Secret Token. The personal Secret Token must be generated from the user's settings page.
173
+ Secret Tokens are long-lived but revocable, while Access Tokens are short-lived and expire after the
174
+ specified validity period. The Access Token returned from this operation is required for
175
+ authorization in all other subsequent API requests.
176
+
177
+ Args:
178
+ body (ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenRequest):
179
+
180
+ Raises:
181
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
182
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
183
+
184
+ Returns:
185
+ Response[ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenResponse | ComHellopublicUserapiauthserviceDomainErrorErrorBody]
186
+ """
187
+
188
+ kwargs = _get_kwargs(
189
+ body=body,
190
+ )
191
+
192
+ response = await client.get_async_httpx_client().request(**kwargs)
193
+
194
+ return _build_response(client=client, response=response)
195
+
196
+
197
+ async def asyncio(
198
+ *,
199
+ client: AuthenticatedClient | Client,
200
+ body: ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenRequest,
201
+ ) -> (
202
+ ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenResponse
203
+ | ComHellopublicUserapiauthserviceDomainErrorErrorBody
204
+ | None
205
+ ):
206
+ """Create API Access Token
207
+
208
+ Generates a new personal Access Token (JWT) with a specified validity in minutes, using an existing
209
+ personal Secret Token. The personal Secret Token must be generated from the user's settings page.
210
+ Secret Tokens are long-lived but revocable, while Access Tokens are short-lived and expire after the
211
+ specified validity period. The Access Token returned from this operation is required for
212
+ authorization in all other subsequent API requests.
213
+
214
+ Args:
215
+ body (ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenRequest):
216
+
217
+ Raises:
218
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
219
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
220
+
221
+ Returns:
222
+ ComHellopublicUserapiauthserviceApiPersonalCreateAccessTokenResponse | ComHellopublicUserapiauthserviceDomainErrorErrorBody
223
+ """
224
+
225
+ return (
226
+ await asyncio_detailed(
227
+ client=client,
228
+ body=body,
229
+ )
230
+ ).parsed
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""