Skip to content

Commit

Permalink
docs(api.py, auth.py): simplify and clarify the description of refres…
Browse files Browse the repository at this point in the history
…h_callback parameter in docstrings
  • Loading branch information
NodeJSmith committed Jul 13, 2024
1 parent 15a4dd4 commit afe8959
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/otf_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ def __init__(
access_token (str, optional): The access token. Default is None.
id_token (str, optional): The id token. Default is None.
user (OtfUser, optional): A user object. Default is None.
refresh_callback (Callable[["OtfUser"], None], optional): A callback function to run when the token is
refreshed. Callable should accept the user object as an argument. Default is None.
refresh_callback (Callable[[OtfUser], None], optional): The callback to call when the tokens are refreshed.
"""
self.member: MemberDetail
self.home_studio: StudioDetail
Expand Down Expand Up @@ -161,8 +160,7 @@ async def create(
password (str, None): The password of the user. Default is None.
access_token (str, None): The access token. Default is None.
id_token (str, None): The id token. Default is None.
refresh_callback (Callable[["OtfUser"], None], optional): A callback function to run when the token is
refreshed. Callable should accept the user object as an argument. Default is None.
refresh_callback (Callable[[OtfUser], None], optional): The callback to call when the tokens are refreshed.
Returns:
Api: The API instance.
Expand Down
3 changes: 0 additions & 3 deletions src/otf_api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def __init__(self, cognito: Cognito, refresh_callback: Callable[["OtfUser"], Non
Args:
cognito (Cognito): The Cognito instance to use.
refresh_callback (Callable[[OtfUser], None], optional): The callback to call when the tokens are refreshed.
Callable should accept the user instance as an argument. Defaults to None.
"""
self.cognito = cognito

Expand Down Expand Up @@ -106,7 +105,6 @@ def load_from_disk(
username (str): The username to reauthenticate with.
password (str): The password to reauthenticate with.
refresh_callback (Callable[[OtfUser], None], optional): The callback to call when the tokens are refreshed.
Callable should accept the user instance as an argument. Defaults to None.
Returns:
OtfUser: The loaded user.
Expand All @@ -132,7 +130,6 @@ def login(
username (str): The username to login with.
password (str): The password to login with.
refresh_callback (Callable[[OtfUser], None], optional): The callback to call when the tokens are refreshed.
Callable should accept the user instance as an argument. Defaults to None.
Returns:
OtfUser: The logged in user.
Expand Down

0 comments on commit afe8959

Please sign in to comment.