summaryrefslogtreecommitdiff
path: root/bot/src/api/twitch/schemas
diff options
context:
space:
mode:
Diffstat (limited to 'bot/src/api/twitch/schemas')
-rw-r--r--bot/src/api/twitch/schemas/stream.hpp35
-rw-r--r--bot/src/api/twitch/schemas/user.hpp10
2 files changed, 45 insertions, 0 deletions
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 <chrono>
+#include <string>
+
+#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;
+ };
+}
diff --git a/bot/src/api/twitch/schemas/user.hpp b/bot/src/api/twitch/schemas/user.hpp
new file mode 100644
index 0000000..288ec72
--- /dev/null
+++ b/bot/src/api/twitch/schemas/user.hpp
@@ -0,0 +1,10 @@
+#pragma once
+
+#include <string>
+
+namespace bot::api::twitch::schemas {
+ struct User {
+ int id;
+ std::string login;
+ };
+}