@@ -439,14 +439,55 @@ using trading_event::TradingEvent;
439439
440440// An enum for representing unknown, true, or false values. Equivalent to a
441441// std::optional<bool>.
442- enum class TriState : char {
442+ namespace tri_state {
443+ enum TriState : char {
443444 // The value is not applicable or not known.
444445 NotAvailable = ' ~' ,
445446 // False
446447 No = ' N' ,
447448 // True
448449 Yes = ' Y' ,
449450};
451+ } // namespace tri_state
452+ using tri_state::TriState;
453+
454+ namespace error_code {
455+ enum ErrorCode : std::uint8_t {
456+ // The authentication step failed.
457+ AuthFailed = 1 ,
458+ // The user account or API key were deactivated.
459+ ApiKeyDeactivated = 2 ,
460+ // The user has exceeded their open connection limit
461+ ConnectionLimitExceeded = 3 ,
462+ // One or more symbols failed to resolve.
463+ SymbolResolutionFailed = 4 ,
464+ // There was an issue with a subscription request (other than symbol
465+ // resolution).
466+ InvalidSubscription = 5 ,
467+ // An error occurred in the gateway.
468+ InternalError = 6 ,
469+
470+ Unset = 255 ,
471+ };
472+ } // namespace error_code
473+ using error_code::ErrorCode;
474+
475+ namespace system_code {
476+ enum SystemCode : std::uint8_t {
477+ // A message sent in the absence of other records to indicate the connection
478+ // remains open.
479+ Heartbeat = 0 ,
480+ // An acknowledgement of a subscription request.
481+ SubscriptionAck = 1 ,
482+ // The gateway has detected this session is falling behind real-time.
483+ SlowReaderWarning = 2 ,
484+ // Indicates a replay subscription has caught up with real-time data.
485+ ReplayCompleted = 3 ,
486+
487+ Unset = 255 ,
488+ };
489+ } // namespace system_code
490+ using system_code::SystemCode;
450491
451492// Convert a HistoricalGateway to a URL.
452493const char * UrlFromGateway (HistoricalGateway gateway);
@@ -474,6 +515,8 @@ const char* ToString(StatusReason status_reason);
474515const char * ToString (TradingEvent trading_event);
475516const char * ToString (TriState tri_state);
476517const char * ToString (VersionUpgradePolicy upgrade_policy);
518+ const char * ToString (ErrorCode error_code);
519+ const char * ToString (SystemCode system_code);
477520
478521std::ostream& operator <<(std::ostream& out, Schema schema);
479522std::ostream& operator <<(std::ostream& out, Encoding encoding);
@@ -501,6 +544,8 @@ std::ostream& operator<<(std::ostream& out, TradingEvent trading_event);
501544std::ostream& operator <<(std::ostream& out, TriState tri_state);
502545std::ostream& operator <<(std::ostream& out,
503546 VersionUpgradePolicy upgrade_policy);
547+ std::ostream& operator <<(std::ostream& out, ErrorCode error_code);
548+ std::ostream& operator <<(std::ostream& out, SystemCode system_code);
504549
505550template <>
506551Schema FromString (const std::string& str);
0 commit comments