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.
- publicdotcom_cli/__init__.py +3 -0
- publicdotcom_cli/__main__.py +5 -0
- publicdotcom_cli/_generated/__init__.py +8 -0
- publicdotcom_cli/_generated/api/__init__.py +1 -0
- publicdotcom_cli/_generated/api/account_details/__init__.py +1 -0
- publicdotcom_cli/_generated/api/account_details/get_account_portfolio_v2.py +182 -0
- publicdotcom_cli/_generated/api/account_details/get_history.py +250 -0
- publicdotcom_cli/_generated/api/authorization/__init__.py +1 -0
- publicdotcom_cli/_generated/api/authorization/create_personal_access_token.py +230 -0
- publicdotcom_cli/_generated/api/instrument_details/__init__.py +1 -0
- publicdotcom_cli/_generated/api/instrument_details/get_all_instruments.py +303 -0
- publicdotcom_cli/_generated/api/instrument_details/get_instrument.py +170 -0
- publicdotcom_cli/_generated/api/list_accounts/__init__.py +1 -0
- publicdotcom_cli/_generated/api/list_accounts/get_accounts.py +172 -0
- publicdotcom_cli/_generated/api/market_data/__init__.py +1 -0
- publicdotcom_cli/_generated/api/market_data/get_option_chain.py +200 -0
- publicdotcom_cli/_generated/api/market_data/get_option_expirations.py +210 -0
- publicdotcom_cli/_generated/api/market_data/get_quotes.py +200 -0
- publicdotcom_cli/_generated/api/option_details/__init__.py +1 -0
- publicdotcom_cli/_generated/api/option_details/get_option_greeks.py +194 -0
- publicdotcom_cli/_generated/api/order_placement/__init__.py +1 -0
- publicdotcom_cli/_generated/api/order_placement/cancel_order.py +123 -0
- publicdotcom_cli/_generated/api/order_placement/get_order.py +206 -0
- publicdotcom_cli/_generated/api/order_placement/place_multileg_order.py +214 -0
- publicdotcom_cli/_generated/api/order_placement/place_order.py +222 -0
- publicdotcom_cli/_generated/api/order_placement/preflight_multi_leg.py +276 -0
- publicdotcom_cli/_generated/api/order_placement/preflight_single_leg.py +220 -0
- publicdotcom_cli/_generated/api/order_placement/replace_order.py +222 -0
- publicdotcom_cli/_generated/client.py +272 -0
- publicdotcom_cli/_generated/errors.py +16 -0
- publicdotcom_cli/_generated/models/__init__.py +417 -0
- publicdotcom_cli/_generated/models/com_hellopublic_holdingsystem_core_types_option_price_increment.py +71 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapiauthservice_api_personal_create_access_token_request.py +84 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapiauthservice_api_personal_create_access_token_response.py +61 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapiauthservice_domain_error_error_body.py +70 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings.py +161 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_account_type.py +14 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_brokerage_account_type.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_options_level.py +12 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_response.py +85 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_trade_permissions.py +11 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_response_page.py +195 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction.py +263 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_direction.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_security_type.py +13 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_side.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_sub_type.py +19 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_type.py +10 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_option_chain_request.py +85 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_option_chain_response.py +115 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_option_expirations_request.py +75 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_option_expirations_response.py +81 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_quote.py +272 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_quote_outcome.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_quote_request.py +84 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_quote_response.py +87 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_one_day_change.py +74 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_option_details.py +135 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_options_greek_response.py +113 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_options_greeks_response.py +86 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_options_option_greeks_type_0.py +117 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_cancel_replace_order_request.py +139 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_cancel_replace_order_request_order_type.py +11 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto.py +265 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_fractional_trading.py +10 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_option_spread_trading.py +10 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_option_trading.py +10 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_shorting_availability.py +10 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_trading.py +10 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_response.py +87 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_multileg_order_request.py +141 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_multileg_order_request_type.py +11 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request.py +231 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request_equity_market_session.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request_open_close_indicator.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request_order_side.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request_order_type.py +11 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_result.py +69 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_leg_instrument.py +73 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_leg_instrument_type.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order.py +334 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_instrument.py +73 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_instrument_type.py +15 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_leg.py +125 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_leg_open_close_indicator.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_leg_side.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_open_close_indicator.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_side.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_status.py +17 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_type.py +11 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_short_selling.py +127 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_short_selling_availability.py +10 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_short_selling_uptick_rule.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_instrumentdetails_api_instrument_details.py +67 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_instrumentdetails_api_instrument_details_bond.py +74 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_instrumentdetails_api_instrument_details_crypto.py +92 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_order_expiration.py +87 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_order_expiration_time_in_force.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gain_type_0.py +88 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_buying_power.py +77 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_cost_basis_type_0.py +167 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_account_v2.py +233 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_account_v2_account_type.py +14 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_equity_v2.py +100 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_equity_v2_type.py +14 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_instrument.py +93 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_instrument_type.py +14 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_position.py +352 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_strategy.py +276 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_strategy_leg.py +78 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_price_type_0.py +79 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_margin_impact.py +70 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_margin_requirement.py +70 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_option_details.py +91 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_option_details_type.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_option_rebate.py +79 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_price_increment.py +80 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_regulatory_fees.py +118 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response.py +167 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response_open_close_indicator.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response_side.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_request.py +148 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_request_order_type.py +11 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_response.py +313 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request.py +225 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request_equity_market_session.py +11 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request_open_close_indicator.py +11 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request_order_side.py +9 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request_order_type.py +11 -0
- publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_response.py +410 -0
- publicdotcom_cli/_generated/models/get_all_instruments_fractional_trading_filter_item.py +10 -0
- publicdotcom_cli/_generated/models/get_all_instruments_option_spread_trading_filter_item.py +10 -0
- publicdotcom_cli/_generated/models/get_all_instruments_option_trading_filter_item.py +10 -0
- publicdotcom_cli/_generated/models/get_all_instruments_trading_filter_item.py +10 -0
- publicdotcom_cli/_generated/models/get_all_instruments_type_filter_item.py +15 -0
- publicdotcom_cli/_generated/models/get_instrument_type.py +15 -0
- publicdotcom_cli/_generated/types.py +54 -0
- publicdotcom_cli/cli.py +761 -0
- publicdotcom_cli/client.py +83 -0
- publicdotcom_cli/config.py +222 -0
- publicdotcom_cli/output.py +77 -0
- publicdotcom_cli/payloads.py +36 -0
- publicdotcom_cli-1.0.0.dist-info/METADATA +256 -0
- publicdotcom_cli-1.0.0.dist-info/RECORD +146 -0
- publicdotcom_cli-1.0.0.dist-info/WHEEL +4 -0
- publicdotcom_cli-1.0.0.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,194 @@
|
|
|
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_options_greeks_response import (
|
|
10
|
+
ComHellopublicUserapigatewayApiRestOptionsGreeksResponse,
|
|
11
|
+
)
|
|
12
|
+
from ...types import UNSET, Response
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
account_id: str,
|
|
17
|
+
*,
|
|
18
|
+
osi_symbols: list[str],
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
|
|
21
|
+
params: dict[str, Any] = {}
|
|
22
|
+
|
|
23
|
+
json_osi_symbols = osi_symbols
|
|
24
|
+
|
|
25
|
+
params["osiSymbols"] = json_osi_symbols
|
|
26
|
+
|
|
27
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
28
|
+
|
|
29
|
+
_kwargs: dict[str, Any] = {
|
|
30
|
+
"method": "get",
|
|
31
|
+
"url": "/userapigateway/option-details/{account_id}/greeks".format(
|
|
32
|
+
account_id=quote(str(account_id), safe=""),
|
|
33
|
+
),
|
|
34
|
+
"params": params,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return _kwargs
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _parse_response(
|
|
41
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
42
|
+
) -> ComHellopublicUserapigatewayApiRestOptionsGreeksResponse | None:
|
|
43
|
+
if response.status_code == 200:
|
|
44
|
+
response_200 = ComHellopublicUserapigatewayApiRestOptionsGreeksResponse.from_dict(
|
|
45
|
+
response.json()
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
return response_200
|
|
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[ComHellopublicUserapigatewayApiRestOptionsGreeksResponse]:
|
|
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
|
+
osi_symbols: list[str],
|
|
72
|
+
) -> Response[ComHellopublicUserapigatewayApiRestOptionsGreeksResponse]:
|
|
73
|
+
"""Get option greeks
|
|
74
|
+
|
|
75
|
+
Get the greeks for a list of option symbol in the OSI-normalized format. Max 250 contracts per
|
|
76
|
+
request.
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
account_id (str):
|
|
80
|
+
osi_symbols (list[str]):
|
|
81
|
+
|
|
82
|
+
Raises:
|
|
83
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
84
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
Response[ComHellopublicUserapigatewayApiRestOptionsGreeksResponse]
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
kwargs = _get_kwargs(
|
|
91
|
+
account_id=account_id,
|
|
92
|
+
osi_symbols=osi_symbols,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
response = client.get_httpx_client().request(
|
|
96
|
+
**kwargs,
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
return _build_response(client=client, response=response)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def sync(
|
|
103
|
+
account_id: str,
|
|
104
|
+
*,
|
|
105
|
+
client: AuthenticatedClient | Client,
|
|
106
|
+
osi_symbols: list[str],
|
|
107
|
+
) -> ComHellopublicUserapigatewayApiRestOptionsGreeksResponse | None:
|
|
108
|
+
"""Get option greeks
|
|
109
|
+
|
|
110
|
+
Get the greeks for a list of option symbol in the OSI-normalized format. Max 250 contracts per
|
|
111
|
+
request.
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
account_id (str):
|
|
115
|
+
osi_symbols (list[str]):
|
|
116
|
+
|
|
117
|
+
Raises:
|
|
118
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
119
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
ComHellopublicUserapigatewayApiRestOptionsGreeksResponse
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
return sync_detailed(
|
|
126
|
+
account_id=account_id,
|
|
127
|
+
client=client,
|
|
128
|
+
osi_symbols=osi_symbols,
|
|
129
|
+
).parsed
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
async def asyncio_detailed(
|
|
133
|
+
account_id: str,
|
|
134
|
+
*,
|
|
135
|
+
client: AuthenticatedClient | Client,
|
|
136
|
+
osi_symbols: list[str],
|
|
137
|
+
) -> Response[ComHellopublicUserapigatewayApiRestOptionsGreeksResponse]:
|
|
138
|
+
"""Get option greeks
|
|
139
|
+
|
|
140
|
+
Get the greeks for a list of option symbol in the OSI-normalized format. Max 250 contracts per
|
|
141
|
+
request.
|
|
142
|
+
|
|
143
|
+
Args:
|
|
144
|
+
account_id (str):
|
|
145
|
+
osi_symbols (list[str]):
|
|
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
|
+
Response[ComHellopublicUserapigatewayApiRestOptionsGreeksResponse]
|
|
153
|
+
"""
|
|
154
|
+
|
|
155
|
+
kwargs = _get_kwargs(
|
|
156
|
+
account_id=account_id,
|
|
157
|
+
osi_symbols=osi_symbols,
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
161
|
+
|
|
162
|
+
return _build_response(client=client, response=response)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
async def asyncio(
|
|
166
|
+
account_id: str,
|
|
167
|
+
*,
|
|
168
|
+
client: AuthenticatedClient | Client,
|
|
169
|
+
osi_symbols: list[str],
|
|
170
|
+
) -> ComHellopublicUserapigatewayApiRestOptionsGreeksResponse | None:
|
|
171
|
+
"""Get option greeks
|
|
172
|
+
|
|
173
|
+
Get the greeks for a list of option symbol in the OSI-normalized format. Max 250 contracts per
|
|
174
|
+
request.
|
|
175
|
+
|
|
176
|
+
Args:
|
|
177
|
+
account_id (str):
|
|
178
|
+
osi_symbols (list[str]):
|
|
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
|
+
ComHellopublicUserapigatewayApiRestOptionsGreeksResponse
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
await asyncio_detailed(
|
|
190
|
+
account_id=account_id,
|
|
191
|
+
client=client,
|
|
192
|
+
osi_symbols=osi_symbols,
|
|
193
|
+
)
|
|
194
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
from uuid import UUID
|
|
5
|
+
|
|
6
|
+
import httpx
|
|
7
|
+
|
|
8
|
+
from ... import errors
|
|
9
|
+
from ...client import AuthenticatedClient, Client
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
account_id: str,
|
|
15
|
+
order_id: UUID,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
|
|
18
|
+
_kwargs: dict[str, Any] = {
|
|
19
|
+
"method": "delete",
|
|
20
|
+
"url": "/userapigateway/trading/{account_id}/order/{order_id}".format(
|
|
21
|
+
account_id=quote(str(account_id), safe=""),
|
|
22
|
+
order_id=quote(str(order_id), safe=""),
|
|
23
|
+
),
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return _kwargs
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _parse_response(
|
|
30
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
31
|
+
) -> Any | None:
|
|
32
|
+
if response.status_code == 200:
|
|
33
|
+
return None
|
|
34
|
+
|
|
35
|
+
if client.raise_on_unexpected_status:
|
|
36
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
37
|
+
else:
|
|
38
|
+
return None
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _build_response(
|
|
42
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
43
|
+
) -> Response[Any]:
|
|
44
|
+
return Response(
|
|
45
|
+
status_code=HTTPStatus(response.status_code),
|
|
46
|
+
content=response.content,
|
|
47
|
+
headers=response.headers,
|
|
48
|
+
parsed=_parse_response(client=client, response=response),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def sync_detailed(
|
|
53
|
+
account_id: str,
|
|
54
|
+
order_id: UUID,
|
|
55
|
+
*,
|
|
56
|
+
client: AuthenticatedClient | Client,
|
|
57
|
+
) -> Response[Any]:
|
|
58
|
+
"""Request order cancellation
|
|
59
|
+
|
|
60
|
+
Submits an asynchronous request to cancel the specified order.
|
|
61
|
+
|
|
62
|
+
Note: While most cancellations are processed immediately during market hours, this is not
|
|
63
|
+
guaranteed.
|
|
64
|
+
Always use the GET /{orderId} endpoint to confirm whether the order has been cancelled.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
account_id (str):
|
|
68
|
+
order_id (UUID):
|
|
69
|
+
|
|
70
|
+
Raises:
|
|
71
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
72
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
Response[Any]
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
kwargs = _get_kwargs(
|
|
79
|
+
account_id=account_id,
|
|
80
|
+
order_id=order_id,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
response = client.get_httpx_client().request(
|
|
84
|
+
**kwargs,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
return _build_response(client=client, response=response)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
async def asyncio_detailed(
|
|
91
|
+
account_id: str,
|
|
92
|
+
order_id: UUID,
|
|
93
|
+
*,
|
|
94
|
+
client: AuthenticatedClient | Client,
|
|
95
|
+
) -> Response[Any]:
|
|
96
|
+
"""Request order cancellation
|
|
97
|
+
|
|
98
|
+
Submits an asynchronous request to cancel the specified order.
|
|
99
|
+
|
|
100
|
+
Note: While most cancellations are processed immediately during market hours, this is not
|
|
101
|
+
guaranteed.
|
|
102
|
+
Always use the GET /{orderId} endpoint to confirm whether the order has been cancelled.
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
account_id (str):
|
|
106
|
+
order_id (UUID):
|
|
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]
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
kwargs = _get_kwargs(
|
|
117
|
+
account_id=account_id,
|
|
118
|
+
order_id=order_id,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
122
|
+
|
|
123
|
+
return _build_response(client=client, response=response)
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
from uuid import UUID
|
|
5
|
+
|
|
6
|
+
import httpx
|
|
7
|
+
|
|
8
|
+
from ... import errors
|
|
9
|
+
from ...client import AuthenticatedClient, Client
|
|
10
|
+
from ...models.com_hellopublic_userapigateway_api_rest_order_gateway_order import (
|
|
11
|
+
ComHellopublicUserapigatewayApiRestOrderGatewayOrder,
|
|
12
|
+
)
|
|
13
|
+
from ...types import Response
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_kwargs(
|
|
17
|
+
account_id: str,
|
|
18
|
+
order_id: UUID,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
|
|
21
|
+
_kwargs: dict[str, Any] = {
|
|
22
|
+
"method": "get",
|
|
23
|
+
"url": "/userapigateway/trading/{account_id}/order/{order_id}".format(
|
|
24
|
+
account_id=quote(str(account_id), safe=""),
|
|
25
|
+
order_id=quote(str(order_id), safe=""),
|
|
26
|
+
),
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return _kwargs
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _parse_response(
|
|
33
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
34
|
+
) -> Any | ComHellopublicUserapigatewayApiRestOrderGatewayOrder | None:
|
|
35
|
+
if response.status_code == 200:
|
|
36
|
+
response_200 = ComHellopublicUserapigatewayApiRestOrderGatewayOrder.from_dict(
|
|
37
|
+
response.json()
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
return response_200
|
|
41
|
+
|
|
42
|
+
if response.status_code == 404:
|
|
43
|
+
response_404 = cast(Any, None)
|
|
44
|
+
return response_404
|
|
45
|
+
|
|
46
|
+
if client.raise_on_unexpected_status:
|
|
47
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
48
|
+
else:
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _build_response(
|
|
53
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
54
|
+
) -> Response[Any | ComHellopublicUserapigatewayApiRestOrderGatewayOrder]:
|
|
55
|
+
return Response(
|
|
56
|
+
status_code=HTTPStatus(response.status_code),
|
|
57
|
+
content=response.content,
|
|
58
|
+
headers=response.headers,
|
|
59
|
+
parsed=_parse_response(client=client, response=response),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def sync_detailed(
|
|
64
|
+
account_id: str,
|
|
65
|
+
order_id: UUID,
|
|
66
|
+
*,
|
|
67
|
+
client: AuthenticatedClient | Client,
|
|
68
|
+
) -> Response[Any | ComHellopublicUserapigatewayApiRestOrderGatewayOrder]:
|
|
69
|
+
"""Retrieve order details
|
|
70
|
+
|
|
71
|
+
Fetches the status and details of a specific order for the given account.
|
|
72
|
+
|
|
73
|
+
Note: Order placement is asynchronous. This endpoint may return HTTP 404 if the order has not yet
|
|
74
|
+
been indexed for retrieval.
|
|
75
|
+
In some cases, the order may already be active in the market but momentarily not yet visible through
|
|
76
|
+
this API due to eventual consistency.
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
account_id (str):
|
|
80
|
+
order_id (UUID):
|
|
81
|
+
|
|
82
|
+
Raises:
|
|
83
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
84
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
Response[Any | ComHellopublicUserapigatewayApiRestOrderGatewayOrder]
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
kwargs = _get_kwargs(
|
|
91
|
+
account_id=account_id,
|
|
92
|
+
order_id=order_id,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
response = client.get_httpx_client().request(
|
|
96
|
+
**kwargs,
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
return _build_response(client=client, response=response)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def sync(
|
|
103
|
+
account_id: str,
|
|
104
|
+
order_id: UUID,
|
|
105
|
+
*,
|
|
106
|
+
client: AuthenticatedClient | Client,
|
|
107
|
+
) -> Any | ComHellopublicUserapigatewayApiRestOrderGatewayOrder | None:
|
|
108
|
+
"""Retrieve order details
|
|
109
|
+
|
|
110
|
+
Fetches the status and details of a specific order for the given account.
|
|
111
|
+
|
|
112
|
+
Note: Order placement is asynchronous. This endpoint may return HTTP 404 if the order has not yet
|
|
113
|
+
been indexed for retrieval.
|
|
114
|
+
In some cases, the order may already be active in the market but momentarily not yet visible through
|
|
115
|
+
this API due to eventual consistency.
|
|
116
|
+
|
|
117
|
+
Args:
|
|
118
|
+
account_id (str):
|
|
119
|
+
order_id (UUID):
|
|
120
|
+
|
|
121
|
+
Raises:
|
|
122
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
123
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
124
|
+
|
|
125
|
+
Returns:
|
|
126
|
+
Any | ComHellopublicUserapigatewayApiRestOrderGatewayOrder
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
return sync_detailed(
|
|
130
|
+
account_id=account_id,
|
|
131
|
+
order_id=order_id,
|
|
132
|
+
client=client,
|
|
133
|
+
).parsed
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
async def asyncio_detailed(
|
|
137
|
+
account_id: str,
|
|
138
|
+
order_id: UUID,
|
|
139
|
+
*,
|
|
140
|
+
client: AuthenticatedClient | Client,
|
|
141
|
+
) -> Response[Any | ComHellopublicUserapigatewayApiRestOrderGatewayOrder]:
|
|
142
|
+
"""Retrieve order details
|
|
143
|
+
|
|
144
|
+
Fetches the status and details of a specific order for the given account.
|
|
145
|
+
|
|
146
|
+
Note: Order placement is asynchronous. This endpoint may return HTTP 404 if the order has not yet
|
|
147
|
+
been indexed for retrieval.
|
|
148
|
+
In some cases, the order may already be active in the market but momentarily not yet visible through
|
|
149
|
+
this API due to eventual consistency.
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
account_id (str):
|
|
153
|
+
order_id (UUID):
|
|
154
|
+
|
|
155
|
+
Raises:
|
|
156
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
157
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
158
|
+
|
|
159
|
+
Returns:
|
|
160
|
+
Response[Any | ComHellopublicUserapigatewayApiRestOrderGatewayOrder]
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
kwargs = _get_kwargs(
|
|
164
|
+
account_id=account_id,
|
|
165
|
+
order_id=order_id,
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
169
|
+
|
|
170
|
+
return _build_response(client=client, response=response)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
async def asyncio(
|
|
174
|
+
account_id: str,
|
|
175
|
+
order_id: UUID,
|
|
176
|
+
*,
|
|
177
|
+
client: AuthenticatedClient | Client,
|
|
178
|
+
) -> Any | ComHellopublicUserapigatewayApiRestOrderGatewayOrder | None:
|
|
179
|
+
"""Retrieve order details
|
|
180
|
+
|
|
181
|
+
Fetches the status and details of a specific order for the given account.
|
|
182
|
+
|
|
183
|
+
Note: Order placement is asynchronous. This endpoint may return HTTP 404 if the order has not yet
|
|
184
|
+
been indexed for retrieval.
|
|
185
|
+
In some cases, the order may already be active in the market but momentarily not yet visible through
|
|
186
|
+
this API due to eventual consistency.
|
|
187
|
+
|
|
188
|
+
Args:
|
|
189
|
+
account_id (str):
|
|
190
|
+
order_id (UUID):
|
|
191
|
+
|
|
192
|
+
Raises:
|
|
193
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
194
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
195
|
+
|
|
196
|
+
Returns:
|
|
197
|
+
Any | ComHellopublicUserapigatewayApiRestOrderGatewayOrder
|
|
198
|
+
"""
|
|
199
|
+
|
|
200
|
+
return (
|
|
201
|
+
await asyncio_detailed(
|
|
202
|
+
account_id=account_id,
|
|
203
|
+
order_id=order_id,
|
|
204
|
+
client=client,
|
|
205
|
+
)
|
|
206
|
+
).parsed
|