libkazv
Kazv::Api::LoginJob::JobResponse Class Reference

#include <login.hpp>

Inheritance diagram for Kazv::Api::LoginJob::JobResponse:
Collaboration diagram for Kazv::Api::LoginJob::JobResponse:

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< DiscoveryInformationwellKnown () 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
 

Constructor & Destructor Documentation

◆ JobResponse()

Kazv::Api::LoginJob::JobResponse::JobResponse ( Response  r)

Member Function Documentation

◆ accessToken()

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.

◆ deviceId()

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.

◆ expiresInMs()

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.

◆ homeServer()

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.

◆ refreshToken()

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.

◆ success()

bool Kazv::Api::LoginResponse::success ( ) const

◆ userId()

std::optional< std::string > Kazv::Api::LoginResponse::userId ( ) const

The fully-qualified Matrix ID for the account.

◆ wellKnown()

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.


The documentation for this class was generated from the following files: