algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::tossinvest::TossRest Struct Reference

A Toss REST access token and its expiry. More...

#include <algotradelib/src/brokers/tossinvest/config.hpp>

Inheritance diagram for algotradelib::tossinvest::TossRest:
Collaboration diagram for algotradelib::tossinvest::TossRest:

Public Member Functions

void from_json_impl (const json::object &)
 Reads nothing more from a token response (the argument is unused; Toss states expires_in); called by from_json.
Public Member Functions inherited from algotradelib::network::AuthBody< TossRest >
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.

Additional Inherited Members

Public Attributes inherited from algotradelib::network::AuthBody< TossRest >
std::string access_token_
 The bearer token; do not log it.
std::chrono::system_clock::time_point expires_at_
 When the token expires.

Detailed Description

A Toss REST access token and its expiry.

Definition at line 88 of file config.hpp.

Member Function Documentation

◆ from_json_impl()

void algotradelib::tossinvest::TossRest::from_json_impl ( const json::object & )
inline

Reads nothing more from a token response (the argument is unused; Toss states expires_in); called by from_json.

Definition at line 96 of file config.hpp.

◆ token_field()

constexpr std::string_view algotradelib::tossinvest::TossRest::token_field ( )
inlinestaticconstexprnoexcept

Returns the token response's field for the token.

Returns
"access_token".

Definition at line 93 of file config.hpp.


The documentation for this struct was generated from the following file: