libkazv
|
#include <login.hpp>
Public Member Functions | |
JobResponse (Response r) | |
bool | success () const |
std::optional< std::string > | userId () const |
The fully-qualified Matrix ID for the account. More... | |
std::optional< std::string > | accessToken () const |
An access token for the account. More... | |
std::optional< std::string > | refreshToken () const |
A refresh token for the account. More... | |
std::optional< int > | expiresInMs () const |
The lifetime of the access token, in milliseconds. More... | |
std::optional< std::string > | homeServer () const |
The server_name of the homeserver on which the account has been registered. More... | |
std::optional< std::string > | deviceId () const |
ID of the logged-in device. More... | |
std::optional< DiscoveryInformation > | wellKnown () const |
Optional client configuration provided by the server. More... | |
Public Member Functions inherited from Kazv::Response | |
std::string | errorCode () const |
std::string | errorMessage () const |
JsonWrap | jsonBody () const |
constexpr bool | success () const |
json | dataJson (const std::string &key) const |
std::string | dataStr (const std::string &key) const |
std::string | jobId () const |
Additional Inherited Members | |
Public Types inherited from Kazv::Response | |
using | StatusCode = int |
Public Attributes inherited from Kazv::Response | |
StatusCode | statusCode |
Body | body |
Header | header |
JsonWrap | extraData |
Kazv::Api::LoginJob::JobResponse::JobResponse | ( | Response | r | ) |
std::optional< std::string > Kazv::Api::LoginResponse::accessToken | ( | ) | const |
An access token for the account.
This access token can then be used to authorize other requests.
std::optional< std::string > Kazv::Api::LoginResponse::deviceId | ( | ) | const |
ID of the logged-in device.
Will be the same as the corresponding parameter in the request, if one was specified.
std::optional< int > Kazv::Api::LoginResponse::expiresInMs | ( | ) | const |
The lifetime of the access token, in milliseconds.
Once the access token has expired a new access token can be obtained by using the provided refresh token. If no refresh token is provided, the client will need to re-log in to obtain a new access token. If not given, the client can assume that the access token will not expire.
std::optional< std::string > Kazv::Api::LoginResponse::homeServer | ( | ) | const |
The server_name of the homeserver on which the account has been registered.
Deprecated. Clients should extract the server_name from user_id
(by splitting at the first colon) if they require it. Note also that homeserver
is not spelt this way.
std::optional< std::string > Kazv::Api::LoginResponse::refreshToken | ( | ) | const |
A refresh token for the account.
This token can be used to obtain a new access token when it expires by calling the /refresh
endpoint.
bool Kazv::Api::LoginResponse::success | ( | ) | const |
std::optional< std::string > Kazv::Api::LoginResponse::userId | ( | ) | const |
The fully-qualified Matrix ID for the account.
std::optional< DiscoveryInformation > Kazv::Api::LoginResponse::wellKnown | ( | ) | const |
Optional client configuration provided by the server.
If present, clients SHOULD use the provided object to reconfigure themselves, optionally validating the URLs within. This object takes the same form as the one returned from .well-known autodiscovery.