From d1793df1eda463b10107d41785ad1d7f055ed476 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 18 May 2024 14:48:12 +0500 Subject: upd: moved the bot part to a relative subfolder --- bot/src/api/twitch/schemas/stream.hpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 bot/src/api/twitch/schemas/stream.hpp (limited to 'bot/src/api/twitch/schemas/stream.hpp') diff --git a/bot/src/api/twitch/schemas/stream.hpp b/bot/src/api/twitch/schemas/stream.hpp new file mode 100644 index 0000000..e3d485e --- /dev/null +++ b/bot/src/api/twitch/schemas/stream.hpp @@ -0,0 +1,35 @@ +#pragma once + +#include +#include + +#include "../../../utils/chrono.hpp" + +namespace bot::api::twitch::schemas { + class Stream { + public: + Stream(int user_id, std::string user_login, std::string game_name, + std::string title, std::string started_at) + : user_id(user_id), + user_login(user_login), + game_name(game_name), + title(title), + started_at(utils::chrono::string_to_time_point( + started_at, "%Y-%m-%dT%H:%M:%SZ")) {} + + Stream(int user_id) : user_id(user_id) {} + + const int &get_user_id() const { return this->user_id; } + const std::string &get_user_login() const { return this->user_login; } + const std::string &get_game_name() const { return this->game_name; } + const std::string &get_title() const { return this->title; } + const std::chrono::system_clock::time_point &get_started_at() const { + return this->started_at; + } + + private: + int user_id; + std::string user_login, game_name, title; + std::chrono::system_clock::time_point started_at; + }; +} -- cgit v1.2.3