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,200 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
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_marketdata_quote_gateway_option_chain_request import (
10
+ ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainRequest,
11
+ )
12
+ from ...models.com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_option_chain_response import (
13
+ ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainResponse,
14
+ )
15
+ from ...types import Response
16
+
17
+
18
+ def _get_kwargs(
19
+ account_id: str,
20
+ *,
21
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainRequest,
22
+ ) -> dict[str, Any]:
23
+ headers: dict[str, Any] = {}
24
+
25
+ _kwargs: dict[str, Any] = {
26
+ "method": "post",
27
+ "url": "/userapigateway/marketdata/{account_id}/option-chain".format(
28
+ account_id=quote(str(account_id), safe=""),
29
+ ),
30
+ }
31
+
32
+ _kwargs["json"] = body.to_dict()
33
+
34
+ headers["Content-Type"] = "application/json"
35
+
36
+ _kwargs["headers"] = headers
37
+ return _kwargs
38
+
39
+
40
+ def _parse_response(
41
+ *, client: AuthenticatedClient | Client, response: httpx.Response
42
+ ) -> Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainResponse | None:
43
+ if response.status_code == 200:
44
+ response_200 = (
45
+ ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainResponse.from_dict(
46
+ response.json()
47
+ )
48
+ )
49
+
50
+ return response_200
51
+
52
+ if response.status_code == 400:
53
+ response_400 = cast(Any, None)
54
+ return response_400
55
+
56
+ if client.raise_on_unexpected_status:
57
+ raise errors.UnexpectedStatus(response.status_code, response.content)
58
+ else:
59
+ return None
60
+
61
+
62
+ def _build_response(
63
+ *, client: AuthenticatedClient | Client, response: httpx.Response
64
+ ) -> Response[Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainResponse]:
65
+ return Response(
66
+ status_code=HTTPStatus(response.status_code),
67
+ content=response.content,
68
+ headers=response.headers,
69
+ parsed=_parse_response(client=client, response=response),
70
+ )
71
+
72
+
73
+ def sync_detailed(
74
+ account_id: str,
75
+ *,
76
+ client: AuthenticatedClient | Client,
77
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainRequest,
78
+ ) -> Response[Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainResponse]:
79
+ """Retrieve option chain
80
+
81
+ Returns the option chain for a given instrument. Requires the `marketdata` scope. Available to
82
+ individual investors. Supported types: EQUITY, UNDERLYING_SECURITY_FOR_INDEX_OPTION.
83
+
84
+ Args:
85
+ account_id (str):
86
+ body (ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainRequest):
87
+
88
+ Raises:
89
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
90
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
91
+
92
+ Returns:
93
+ Response[Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainResponse]
94
+ """
95
+
96
+ kwargs = _get_kwargs(
97
+ account_id=account_id,
98
+ body=body,
99
+ )
100
+
101
+ response = client.get_httpx_client().request(
102
+ **kwargs,
103
+ )
104
+
105
+ return _build_response(client=client, response=response)
106
+
107
+
108
+ def sync(
109
+ account_id: str,
110
+ *,
111
+ client: AuthenticatedClient | Client,
112
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainRequest,
113
+ ) -> Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainResponse | None:
114
+ """Retrieve option chain
115
+
116
+ Returns the option chain for a given instrument. Requires the `marketdata` scope. Available to
117
+ individual investors. Supported types: EQUITY, UNDERLYING_SECURITY_FOR_INDEX_OPTION.
118
+
119
+ Args:
120
+ account_id (str):
121
+ body (ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainRequest):
122
+
123
+ Raises:
124
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
125
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
126
+
127
+ Returns:
128
+ Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainResponse
129
+ """
130
+
131
+ return sync_detailed(
132
+ account_id=account_id,
133
+ client=client,
134
+ body=body,
135
+ ).parsed
136
+
137
+
138
+ async def asyncio_detailed(
139
+ account_id: str,
140
+ *,
141
+ client: AuthenticatedClient | Client,
142
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainRequest,
143
+ ) -> Response[Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainResponse]:
144
+ """Retrieve option chain
145
+
146
+ Returns the option chain for a given instrument. Requires the `marketdata` scope. Available to
147
+ individual investors. Supported types: EQUITY, UNDERLYING_SECURITY_FOR_INDEX_OPTION.
148
+
149
+ Args:
150
+ account_id (str):
151
+ body (ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainRequest):
152
+
153
+ Raises:
154
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
155
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
156
+
157
+ Returns:
158
+ Response[Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainResponse]
159
+ """
160
+
161
+ kwargs = _get_kwargs(
162
+ account_id=account_id,
163
+ body=body,
164
+ )
165
+
166
+ response = await client.get_async_httpx_client().request(**kwargs)
167
+
168
+ return _build_response(client=client, response=response)
169
+
170
+
171
+ async def asyncio(
172
+ account_id: str,
173
+ *,
174
+ client: AuthenticatedClient | Client,
175
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainRequest,
176
+ ) -> Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainResponse | None:
177
+ """Retrieve option chain
178
+
179
+ Returns the option chain for a given instrument. Requires the `marketdata` scope. Available to
180
+ individual investors. Supported types: EQUITY, UNDERLYING_SECURITY_FOR_INDEX_OPTION.
181
+
182
+ Args:
183
+ account_id (str):
184
+ body (ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainRequest):
185
+
186
+ Raises:
187
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
188
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
189
+
190
+ Returns:
191
+ Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionChainResponse
192
+ """
193
+
194
+ return (
195
+ await asyncio_detailed(
196
+ account_id=account_id,
197
+ client=client,
198
+ body=body,
199
+ )
200
+ ).parsed
@@ -0,0 +1,210 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
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_marketdata_quote_gateway_option_expirations_request import (
10
+ ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsRequest,
11
+ )
12
+ from ...models.com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_option_expirations_response import (
13
+ ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsResponse,
14
+ )
15
+ from ...types import Response
16
+
17
+
18
+ def _get_kwargs(
19
+ account_id: str,
20
+ *,
21
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsRequest,
22
+ ) -> dict[str, Any]:
23
+ headers: dict[str, Any] = {}
24
+
25
+ _kwargs: dict[str, Any] = {
26
+ "method": "post",
27
+ "url": "/userapigateway/marketdata/{account_id}/option-expirations".format(
28
+ account_id=quote(str(account_id), safe=""),
29
+ ),
30
+ }
31
+
32
+ _kwargs["json"] = body.to_dict()
33
+
34
+ headers["Content-Type"] = "application/json"
35
+
36
+ _kwargs["headers"] = headers
37
+ return _kwargs
38
+
39
+
40
+ def _parse_response(
41
+ *, client: AuthenticatedClient | Client, response: httpx.Response
42
+ ) -> (
43
+ Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsResponse | None
44
+ ):
45
+ if response.status_code == 200:
46
+ response_200 = ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsResponse.from_dict(
47
+ response.json()
48
+ )
49
+
50
+ return response_200
51
+
52
+ if response.status_code == 400:
53
+ response_400 = cast(Any, None)
54
+ return response_400
55
+
56
+ if client.raise_on_unexpected_status:
57
+ raise errors.UnexpectedStatus(response.status_code, response.content)
58
+ else:
59
+ return None
60
+
61
+
62
+ def _build_response(
63
+ *, client: AuthenticatedClient | Client, response: httpx.Response
64
+ ) -> Response[
65
+ Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsResponse
66
+ ]:
67
+ return Response(
68
+ status_code=HTTPStatus(response.status_code),
69
+ content=response.content,
70
+ headers=response.headers,
71
+ parsed=_parse_response(client=client, response=response),
72
+ )
73
+
74
+
75
+ def sync_detailed(
76
+ account_id: str,
77
+ *,
78
+ client: AuthenticatedClient | Client,
79
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsRequest,
80
+ ) -> Response[
81
+ Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsResponse
82
+ ]:
83
+ """Retrieve option expiration dates
84
+
85
+ Returns available option expiration dates for a given instrument. Requires the `marketdata` scope.
86
+ Available to individual investors. Supported types: EQUITY, UNDERLYING_SECURITY_FOR_INDEX_OPTION.
87
+
88
+ Args:
89
+ account_id (str):
90
+ body (ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsRequest):
91
+
92
+ Raises:
93
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
94
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
95
+
96
+ Returns:
97
+ Response[Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsResponse]
98
+ """
99
+
100
+ kwargs = _get_kwargs(
101
+ account_id=account_id,
102
+ body=body,
103
+ )
104
+
105
+ response = client.get_httpx_client().request(
106
+ **kwargs,
107
+ )
108
+
109
+ return _build_response(client=client, response=response)
110
+
111
+
112
+ def sync(
113
+ account_id: str,
114
+ *,
115
+ client: AuthenticatedClient | Client,
116
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsRequest,
117
+ ) -> (
118
+ Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsResponse | None
119
+ ):
120
+ """Retrieve option expiration dates
121
+
122
+ Returns available option expiration dates for a given instrument. Requires the `marketdata` scope.
123
+ Available to individual investors. Supported types: EQUITY, UNDERLYING_SECURITY_FOR_INDEX_OPTION.
124
+
125
+ Args:
126
+ account_id (str):
127
+ body (ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsRequest):
128
+
129
+ Raises:
130
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
131
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
132
+
133
+ Returns:
134
+ Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsResponse
135
+ """
136
+
137
+ return sync_detailed(
138
+ account_id=account_id,
139
+ client=client,
140
+ body=body,
141
+ ).parsed
142
+
143
+
144
+ async def asyncio_detailed(
145
+ account_id: str,
146
+ *,
147
+ client: AuthenticatedClient | Client,
148
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsRequest,
149
+ ) -> Response[
150
+ Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsResponse
151
+ ]:
152
+ """Retrieve option expiration dates
153
+
154
+ Returns available option expiration dates for a given instrument. Requires the `marketdata` scope.
155
+ Available to individual investors. Supported types: EQUITY, UNDERLYING_SECURITY_FOR_INDEX_OPTION.
156
+
157
+ Args:
158
+ account_id (str):
159
+ body (ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsRequest):
160
+
161
+ Raises:
162
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
163
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
164
+
165
+ Returns:
166
+ Response[Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsResponse]
167
+ """
168
+
169
+ kwargs = _get_kwargs(
170
+ account_id=account_id,
171
+ body=body,
172
+ )
173
+
174
+ response = await client.get_async_httpx_client().request(**kwargs)
175
+
176
+ return _build_response(client=client, response=response)
177
+
178
+
179
+ async def asyncio(
180
+ account_id: str,
181
+ *,
182
+ client: AuthenticatedClient | Client,
183
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsRequest,
184
+ ) -> (
185
+ Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsResponse | None
186
+ ):
187
+ """Retrieve option expiration dates
188
+
189
+ Returns available option expiration dates for a given instrument. Requires the `marketdata` scope.
190
+ Available to individual investors. Supported types: EQUITY, UNDERLYING_SECURITY_FOR_INDEX_OPTION.
191
+
192
+ Args:
193
+ account_id (str):
194
+ body (ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsRequest):
195
+
196
+ Raises:
197
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
198
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
199
+
200
+ Returns:
201
+ Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayOptionExpirationsResponse
202
+ """
203
+
204
+ return (
205
+ await asyncio_detailed(
206
+ account_id=account_id,
207
+ client=client,
208
+ body=body,
209
+ )
210
+ ).parsed
@@ -0,0 +1,200 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
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_marketdata_quote_gateway_quote_request import (
10
+ ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteRequest,
11
+ )
12
+ from ...models.com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_quote_response import (
13
+ ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteResponse,
14
+ )
15
+ from ...types import Response
16
+
17
+
18
+ def _get_kwargs(
19
+ account_id: str,
20
+ *,
21
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteRequest,
22
+ ) -> dict[str, Any]:
23
+ headers: dict[str, Any] = {}
24
+
25
+ _kwargs: dict[str, Any] = {
26
+ "method": "post",
27
+ "url": "/userapigateway/marketdata/{account_id}/quotes".format(
28
+ account_id=quote(str(account_id), safe=""),
29
+ ),
30
+ }
31
+
32
+ _kwargs["json"] = body.to_dict()
33
+
34
+ headers["Content-Type"] = "application/json"
35
+
36
+ _kwargs["headers"] = headers
37
+ return _kwargs
38
+
39
+
40
+ def _parse_response(
41
+ *, client: AuthenticatedClient | Client, response: httpx.Response
42
+ ) -> Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteResponse | None:
43
+ if response.status_code == 200:
44
+ response_200 = (
45
+ ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteResponse.from_dict(
46
+ response.json()
47
+ )
48
+ )
49
+
50
+ return response_200
51
+
52
+ if response.status_code == 400:
53
+ response_400 = cast(Any, None)
54
+ return response_400
55
+
56
+ if client.raise_on_unexpected_status:
57
+ raise errors.UnexpectedStatus(response.status_code, response.content)
58
+ else:
59
+ return None
60
+
61
+
62
+ def _build_response(
63
+ *, client: AuthenticatedClient | Client, response: httpx.Response
64
+ ) -> Response[Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteResponse]:
65
+ return Response(
66
+ status_code=HTTPStatus(response.status_code),
67
+ content=response.content,
68
+ headers=response.headers,
69
+ parsed=_parse_response(client=client, response=response),
70
+ )
71
+
72
+
73
+ def sync_detailed(
74
+ account_id: str,
75
+ *,
76
+ client: AuthenticatedClient | Client,
77
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteRequest,
78
+ ) -> Response[Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteResponse]:
79
+ """Retrieve real-time quotes
80
+
81
+ Returns market quotes for a set of instruments. Requires the `marketdata` scope. Available to
82
+ individual investors. Supports EQUITY, OPTION, CRYPTO and INDEX instruments.
83
+
84
+ Args:
85
+ account_id (str):
86
+ body (ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteRequest):
87
+
88
+ Raises:
89
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
90
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
91
+
92
+ Returns:
93
+ Response[Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteResponse]
94
+ """
95
+
96
+ kwargs = _get_kwargs(
97
+ account_id=account_id,
98
+ body=body,
99
+ )
100
+
101
+ response = client.get_httpx_client().request(
102
+ **kwargs,
103
+ )
104
+
105
+ return _build_response(client=client, response=response)
106
+
107
+
108
+ def sync(
109
+ account_id: str,
110
+ *,
111
+ client: AuthenticatedClient | Client,
112
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteRequest,
113
+ ) -> Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteResponse | None:
114
+ """Retrieve real-time quotes
115
+
116
+ Returns market quotes for a set of instruments. Requires the `marketdata` scope. Available to
117
+ individual investors. Supports EQUITY, OPTION, CRYPTO and INDEX instruments.
118
+
119
+ Args:
120
+ account_id (str):
121
+ body (ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteRequest):
122
+
123
+ Raises:
124
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
125
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
126
+
127
+ Returns:
128
+ Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteResponse
129
+ """
130
+
131
+ return sync_detailed(
132
+ account_id=account_id,
133
+ client=client,
134
+ body=body,
135
+ ).parsed
136
+
137
+
138
+ async def asyncio_detailed(
139
+ account_id: str,
140
+ *,
141
+ client: AuthenticatedClient | Client,
142
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteRequest,
143
+ ) -> Response[Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteResponse]:
144
+ """Retrieve real-time quotes
145
+
146
+ Returns market quotes for a set of instruments. Requires the `marketdata` scope. Available to
147
+ individual investors. Supports EQUITY, OPTION, CRYPTO and INDEX instruments.
148
+
149
+ Args:
150
+ account_id (str):
151
+ body (ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteRequest):
152
+
153
+ Raises:
154
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
155
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
156
+
157
+ Returns:
158
+ Response[Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteResponse]
159
+ """
160
+
161
+ kwargs = _get_kwargs(
162
+ account_id=account_id,
163
+ body=body,
164
+ )
165
+
166
+ response = await client.get_async_httpx_client().request(**kwargs)
167
+
168
+ return _build_response(client=client, response=response)
169
+
170
+
171
+ async def asyncio(
172
+ account_id: str,
173
+ *,
174
+ client: AuthenticatedClient | Client,
175
+ body: ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteRequest,
176
+ ) -> Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteResponse | None:
177
+ """Retrieve real-time quotes
178
+
179
+ Returns market quotes for a set of instruments. Requires the `marketdata` scope. Available to
180
+ individual investors. Supports EQUITY, OPTION, CRYPTO and INDEX instruments.
181
+
182
+ Args:
183
+ account_id (str):
184
+ body (ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteRequest):
185
+
186
+ Raises:
187
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
188
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
189
+
190
+ Returns:
191
+ Any | ComHellopublicUserapigatewayApiRestMarketdataQuoteGatewayQuoteResponse
192
+ """
193
+
194
+ return (
195
+ await asyncio_detailed(
196
+ account_id=account_id,
197
+ client=client,
198
+ body=body,
199
+ )
200
+ ).parsed
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""