Skip to content

Commit 760f38d

Browse files
committed
future annotations
1 parent 9fc8498 commit 760f38d

File tree

207 files changed

+855
-451
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+855
-451
lines changed

openapi/templates/model.py.jinja

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from collections.abc import Mapping
24
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
35

@@ -27,7 +29,7 @@ if TYPE_CHECKING:
2729

2830

2931
{% if model.additional_properties %}
30-
{% set additional_property_type = 'Any' if model.additional_properties == True else model.additional_properties.get_type_string(quoted=not model.additional_properties.is_base_type) %}
32+
{% set additional_property_type = 'Any' if model.additional_properties == True else model.additional_properties.get_type_string() %}
3133
{% endif %}
3234

3335
{% set class_name = model.class_info.name %}

openapi_project/openapi_package/errors.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Contains shared errors types that can be raised from API functions"""
22

3+
from __future__ import annotations
4+
35

46
class UnexpectedStatus(Exception):
57
"""Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True"""

openapi_project/openapi_package/models/account.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from collections.abc import Mapping
24
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
35

@@ -15,8 +17,8 @@
1517
from typing import cast
1618

1719
if TYPE_CHECKING:
18-
from ..models.account_script import AccountScript
1920
from ..models.routing_session_group import RoutingSessionGroup
21+
from ..models.account_script import AccountScript
2022

2123

2224
T = TypeVar("T", bound="Account")
@@ -44,7 +46,7 @@ class Account:
4446
options_cmta (Unset | str):
4547
options_efid (Unset | str):
4648
options_give_up (Unset | str):
47-
routing_session_groups (Unset | list['RoutingSessionGroup']):
49+
routing_session_groups (Unset | list[RoutingSessionGroup]):
4850
status (Unset | AccountStatus):
4951
tag1 (Unset | str):
5052
trading_firm_id (Unset | int):
@@ -74,16 +76,16 @@ class Account:
7476
options_cmta: Unset | str = UNSET
7577
options_efid: Unset | str = UNSET
7678
options_give_up: Unset | str = UNSET
77-
routing_session_groups: Unset | list["RoutingSessionGroup"] = UNSET
79+
routing_session_groups: Unset | list[RoutingSessionGroup] = UNSET
7880
status: Unset | AccountStatus = UNSET
7981
tag1: Unset | str = UNSET
8082
trading_firm_id: Unset | int = UNSET
8183
type_: Unset | AccountType = UNSET
8284
created_ts: Unset | str = UNSET
8385
optional_data: Unset | str = UNSET
84-
position_script: Unset | "AccountScript" = UNSET
85-
buying_power_script: Unset | "AccountScript" = UNSET
86-
clearing_script: Unset | "AccountScript" = UNSET
86+
position_script: Unset | AccountScript = UNSET
87+
buying_power_script: Unset | AccountScript = UNSET
88+
clearing_script: Unset | AccountScript = UNSET
8789

8890
def to_dict(self) -> dict[str, Any]:
8991
id = self.id

openapi_project/openapi_package/models/account_script.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from collections.abc import Mapping
24
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
35

openapi_project/openapi_package/models/analyze_position_item.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from collections.abc import Mapping
24
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
35

openapi_project/openapi_package/models/analyze_positions_request.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from collections.abc import Mapping
24
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
35

@@ -24,7 +26,7 @@ class AnalyzePositionsRequest:
2426
evaluate_at_expiry (Unset | bool):
2527
evaluate_at_strike (Unset | bool):
2628
evaluation_as_of (Unset | list[str]):
27-
positions (Unset | list['AnalyzePositionItem']):
29+
positions (Unset | list[AnalyzePositionItem]):
2830
price (Unset | float):
2931
underlying_volatility (Unset | list[float]):
3032
historical_volatility_days (Unset | list[int]):
@@ -35,7 +37,7 @@ class AnalyzePositionsRequest:
3537
evaluate_at_expiry: Unset | bool = UNSET
3638
evaluate_at_strike: Unset | bool = UNSET
3739
evaluation_as_of: Unset | list[str] = UNSET
38-
positions: Unset | list["AnalyzePositionItem"] = UNSET
40+
positions: Unset | list[AnalyzePositionItem] = UNSET
3941
price: Unset | float = UNSET
4042
underlying_volatility: Unset | list[float] = UNSET
4143
historical_volatility_days: Unset | list[int] = UNSET

openapi_project/openapi_package/models/analyze_positions_response.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from collections.abc import Mapping
24
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
35

@@ -26,7 +28,7 @@ class AnalyzePositionsResponse:
2628
status_code (Unset | StatusCode):
2729
"""
2830

29-
analysis: Unset | "PositionAnalysis" = UNSET
31+
analysis: Unset | PositionAnalysis = UNSET
3032
error_message: Unset | str = UNSET
3133
status_code: Unset | StatusCode = UNSET
3234

openapi_project/openapi_package/models/any_model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from collections.abc import Mapping
24
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
35

openapi_project/openapi_package/models/calculate_margin_request.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from collections.abc import Mapping
24
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
35

@@ -27,14 +29,14 @@ class CalculateMarginRequest:
2729
Attributes:
2830
account_ids (Unset | list[int]):
2931
margin_data_type (Unset | MarginDataType):
30-
positions_by_account_id (Unset | list['CalculateMarginRequestPositionList']):
32+
positions_by_account_id (Unset | list[CalculateMarginRequestPositionList]):
3133
eval_mode (Unset | RiskEvalMode):
3234
source (Unset | PositionSource):
3335
"""
3436

3537
account_ids: Unset | list[int] = UNSET
3638
margin_data_type: Unset | MarginDataType = UNSET
37-
positions_by_account_id: Unset | list["CalculateMarginRequestPositionList"] = UNSET
39+
positions_by_account_id: Unset | list[CalculateMarginRequestPositionList] = UNSET
3840
eval_mode: Unset | RiskEvalMode = UNSET
3941
source: Unset | PositionSource = UNSET
4042

openapi_project/openapi_package/models/calculate_margin_request_position.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from collections.abc import Mapping
24
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
35

0 commit comments

Comments
 (0)