wxc_sdk.tokens module
Simple implementation of Webex tokens
- class wxc_sdk.tokens.Tokens(*, access_token: str = None, expires_in: int = None, expires_at: datetime = None, refresh_token: str = None, refresh_token_expires_in: int = None, refresh_token_expires_at: datetime = None, token_type: Literal['Bearer'] = None)[source]
Bases:
BaseModel
Webex tokens
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- access_token: Optional[str]
access token
- expires_in: Optional[int]
remaining lifetime at time of token creation
- expires_at: Optional[datetime]
expiration, calculated at time of token creation
- refresh_token: Optional[str]
refresh token
- refresh_token_expires_in: Optional[int]
- refresh_token_expires_at: Optional[datetime]
expiration, calculated at time of token creation
- token_type: Optional[Literal['Bearer']]
- update(new_tokes: Tokens)[source]
Update with values from new tokens
- Parameters
new_tokes (Tokens) – tokens instance to be used as source
- property remaining: int
remaining lifetime in seconds