Skip to content

Commit

Permalink
fix(doc): update return types
Browse files Browse the repository at this point in the history
  • Loading branch information
parkererickson-tg committed Feb 14, 2024
1 parent e8780f9 commit 855713c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pyTigerGraph/pyTigerGraphAuth.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def dropSecret(self, alias: Union[str, list], ignoreErrors: bool = True) -> str:

return res

def getToken(self, secret: str = None, setToken: bool = True, lifetime: int = None) -> tuple:
def getToken(self, secret: str = None, setToken: bool = True, lifetime: int = None) -> Union[tuple, str]:
"""Requests an authorization token.
This function returns a token only if REST++ authentication is enabled. If not, an exception
Expand All @@ -194,9 +194,12 @@ def getToken(self, secret: str = None, setToken: bool = True, lifetime: int = No
Duration of token validity (in seconds, default 30 days = 2,592,000 seconds).
Returns:
A tuple of `(<token>, <expiration_timestamp_unixtime>, <expiration_timestamp_ISO8601>)`.
If your TigerGraph instance is running version 3.5 or before, the return value is
a tuple of `(<token>, <expiration_timestamp_unixtime>, <expiration_timestamp_ISO8601>)`.
The return value can be ignored, as the token is automatically set for the connection after this call.
If your TigerGraph instance is running version 3.6 or later, the return value is just the token.
[NOTE]
The expiration timestamp's time zone might be different from your computer's local time
zone.
Expand Down

0 comments on commit 855713c

Please sign in to comment.