![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
A KIS REST access token and its expiry. More...
#include <algotradelib/src/brokers/kis/config.hpp>
Public Member Functions | |
| KisRest () | |
| Constructs an empty token. | |
| void | from_json_impl (const json::object &doc) |
| Reads KIS's stated expiry from a token response; called by from_json. | |
| bool | valid () const noexcept |
| Tests whether the token is set and stays valid for at least five more minutes. | |
| Public Member Functions inherited from algotradelib::network::AuthBody< KisRest > | |
| void | from_json (const json::object &document) |
| Reads a token response. | |
| bool | valid (std::chrono::seconds margin=std::chrono::minutes(5)) const noexcept |
| Tests whether the token is set and stays valid for at least a margin. | |
Static Public Member Functions | |
| static constexpr std::string_view | token_field () noexcept |
| Returns the token response's field for the token. | |
Public Attributes | |
| std::chrono::system_clock::time_point | access_token_expired_ |
| KIS's stated expiry (access_token_token_expired), which takes precedence over expires_in. | |
| Public Attributes inherited from algotradelib::network::AuthBody< KisRest > | |
| std::string | access_token_ |
| The bearer token; do not log it. | |
| std::chrono::system_clock::time_point | expires_at_ |
| When the token expires. | |
A KIS REST access token and its expiry.
Definition at line 263 of file config.hpp.
|
inline |
Constructs an empty token.
Definition at line 271 of file config.hpp.
|
inline |
Reads KIS's stated expiry from a token response; called by from_json.
| doc | The response. |
Definition at line 283 of file config.hpp.
|
inlinestaticconstexprnoexcept |
Returns the token response's field for the token.
Definition at line 277 of file config.hpp.
|
inlinenoexcept |
Tests whether the token is set and stays valid for at least five more minutes.
Definition at line 305 of file config.hpp.
Referenced by algotradelib::kis::KisClient::adopt_token().
| std::chrono::system_clock::time_point algotradelib::kis::KisRest::access_token_expired_ |
KIS's stated expiry (access_token_token_expired), which takes precedence over expires_in.
Definition at line 268 of file config.hpp.
Referenced by from_json_impl().