22import uuid
33from datetime import datetime , timedelta
44from inspect import signature
5- from typing import Any , Callable , Optional
5+ from typing import Any , Callable , Optional , Union
66
77import requests
88
@@ -178,7 +178,7 @@ def check_oauth_token(self, persist_session_fct: Optional[Callable] = None, user
178178 def login_internal (self ,
179179 username : str ,
180180 password : str ,
181- otp_answer : str | None = None ,
181+ otp_answer : Optional [ str ] = None ,
182182 persist_session_fct : Optional [Callable ] = None ,
183183 scope : str = SCOPE_READ_ONLY
184184 ) -> WSAPISession :
@@ -304,7 +304,7 @@ def get_token_info(self):
304304 def login (
305305 username : str ,
306306 password : str ,
307- otp_answer : str | None = None ,
307+ otp_answer : Optional [ str ] = None ,
308308 persist_session_fct : Optional [Callable ] = None ,
309309 scope : str = SCOPE_READ_ONLY
310310 ) -> WSAPISession :
@@ -456,12 +456,12 @@ def get_identity_historical_financials(self, account_ids = None, currency: str =
456456
457457 def get_activities (
458458 self ,
459- account_id : str | list [str ],
459+ account_id : Union [ str , list [str ] ],
460460 how_many : int = 50 ,
461461 order_by : str = 'OCCURRED_AT_DESC' ,
462462 ignore_rejected : bool = True ,
463- start_date : datetime | None = None ,
464- end_date : datetime | None = None ,
463+ start_date : Optional [ datetime ] = None ,
464+ end_date : Optional [ datetime ] = None ,
465465 load_all : bool = False
466466 ) -> list [Any ]:
467467 """Retrieve activities for a specific account or list of accounts.
@@ -471,8 +471,8 @@ def get_activities(
471471 how_many (int): The maximum number of activities to retrieve.
472472 order_by (str): The order in which to sort the activities.
473473 ignore_rejected (bool): Whether to ignore rejected or cancelled activities.
474- start_date (datetime | None ): The start date for filtering activities.
475- end_date (datetime | None ): The end date for filtering activities.
474+ start_date (datetime, optional ): The start date for filtering activities.
475+ end_date (datetime, optional ): The end date for filtering activities.
476476 load_all (bool): Whether to load all pages of activities.
477477
478478 Returns:
0 commit comments