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

A Kiwoom REST access token (au10001's token) and its expiry (expires_dt). More...

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

Inheritance diagram for algotradelib::kiwoom::KiwoomRest:
Collaboration diagram for algotradelib::kiwoom::KiwoomRest:

Public Member Functions

void from_json_impl (const json::object &doc)
 Reads the expiry (expires_dt, the only one Kiwoom states) and token_type; called by from_json. A response with no readable expiry makes from_json throw.
Public Member Functions inherited from algotradelib::network::AuthBody< KiwoomRest >
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
 The field Kiwoom returns the bearer token under.

Public Attributes

std::string token_type_
 Kiwoom's token_type (bearer in its example).
Public Attributes inherited from algotradelib::network::AuthBody< KiwoomRest >
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 Kiwoom REST access token (au10001's token) and its expiry (expires_dt).

Definition at line 354 of file config.hpp.

Member Function Documentation

◆ from_json_impl()

void algotradelib::kiwoom::KiwoomRest::from_json_impl ( const json::object & doc)
inline

Reads the expiry (expires_dt, the only one Kiwoom states) and token_type; called by from_json. A response with no readable expiry makes from_json throw.

Parameters
docThe response.

Definition at line 369 of file config.hpp.

◆ token_field()

constexpr std::string_view algotradelib::kiwoom::KiwoomRest::token_field ( )
inlinestaticconstexprnoexcept

The field Kiwoom returns the bearer token under.

Returns
"token".

Definition at line 362 of file config.hpp.

Member Data Documentation

◆ token_type_

std::string algotradelib::kiwoom::KiwoomRest::token_type_

Kiwoom's token_type (bearer in its example).

Definition at line 356 of file config.hpp.

Referenced by from_json_impl().


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