wxc_sdk.tokens module¶
Simple implementation of Webex tokens
- class wxc_sdk.tokens.Tokens(*, access_token: str | None = None, expires_in: int | None = None, expires_at: datetime | None = None, refresh_token: str | None = None, refresh_token_expires_in: int | None = None, refresh_token_expires_at: datetime | None = None, token_type: Literal['Bearer'] | None = 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: str | None¶
access token
- expires_in: int | None¶
remaining lifetime at time of token creation
- expires_at: datetime | None¶
expiration, calculated at time of token creation
- refresh_token: str | None¶
refresh token
- refresh_token_expires_in: int | None¶
- refresh_token_expires_at: datetime | None¶
expiration, calculated at time of token creation
- token_type: Literal['Bearer'] | None¶
- 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