mirror-chatterino2/src/providers/twitch/pubsubmessages/ChatModeratorAction.hpp
pajlada e327ed4166
Update magic_enum from v0.9.3 to v0.9.5 (#4992)
* Fix include path for magic enum
* Update .clang-format to ensure magic enum is caught as a third party library
2023-12-01 15:03:04 +01:00

45 lines
1,018 B
C++

#pragma once
#include <magic_enum/magic_enum.hpp>
#include <QJsonObject>
#include <QString>
namespace chatterino {
struct PubSubChatModeratorActionMessage {
enum class Type {
ModerationAction,
ChannelTermsAction,
INVALID,
};
QString typeString;
Type type = Type::INVALID;
QJsonObject data;
PubSubChatModeratorActionMessage(const QJsonObject &root);
};
} // namespace chatterino
template <>
constexpr magic_enum::customize::customize_t magic_enum::customize::enum_name<
chatterino::PubSubChatModeratorActionMessage::Type>(
chatterino::PubSubChatModeratorActionMessage::Type value) noexcept
{
switch (value)
{
case chatterino::PubSubChatModeratorActionMessage::Type::
ModerationAction:
return "moderation_action";
case chatterino::PubSubChatModeratorActionMessage::Type::
ChannelTermsAction:
return "channel_terms_action";
default:
return default_tag;
}
}