#pragma once
#include "discord_object_interface.h"
#include "snowflake.h"
#include "channel.h"
namespace SleepyDiscord {
struct Server;
struct Channel;
struct User;
struct VoiceState : public DiscordObject {
VoiceState() = default;
VoiceState(const nonstd::string_view& json) :
VoiceState(json::fromJSON<VoiceState>(json)) {}
VoiceState(const json::Value& json);
Snowflake<Server> serverID;
Snowflake<Channel> channelID;
Snowflake<User> userID;
std::string sessionID;
bool deaf = false;
bool mute = false;
bool selfDeaf = false;
bool selfMute = false;
bool suppress = false;
JSONStructStart
std::make_tuple(
json::pair(&VoiceState::serverID , "guild_id" , json::OPTIONAL_FIELD ),
json::pair(&VoiceState::channelID, "channel_id", json::NULLABLE_FIELD ),
json::pair(&VoiceState::userID , "user_id" , json::REQUIRIED_FIELD),
json::pair(&VoiceState::sessionID, "session_id", json::REQUIRIED_FIELD),
json::pair(&VoiceState::deaf , "deaf" , json::REQUIRIED_FIELD),
json::pair(&VoiceState::mute , "mute" , json::REQUIRIED_FIELD),
json::pair(&VoiceState::selfDeaf , "self_deaf" , json::REQUIRIED_FIELD),
json::pair(&VoiceState::selfMute , "self_mute" , json::REQUIRIED_FIELD),
json::pair(&VoiceState::suppress , "suppress" , json::REQUIRIED_FIELD)
);
JSONStructEnd
};
struct VoiceRegion : IdentifiableDiscordObject<VoiceRegion> {
VoiceRegion() = default;
VoiceRegion(const nonstd::string_view& json) :
VoiceRegion(json::fromJSON<VoiceRegion>(json)) {}
VoiceRegion(const json::Value& json);
std::string name;
bool vip = false;
bool optimal = false;
bool deprecated = false;
bool custom = false;
JSONStructStart
std::make_tuple(
json::pair(&VoiceRegion::ID , "id" , json::REQUIRIED_FIELD),
json::pair(&VoiceRegion::name , "name" , json::REQUIRIED_FIELD),
json::pair(&VoiceRegion::vip , "vip" , json::REQUIRIED_FIELD),
json::pair(&VoiceRegion::optimal , "optimal" , json::REQUIRIED_FIELD),
json::pair(&VoiceRegion::deprecated , "deprecated", json::REQUIRIED_FIELD),
json::pair(&VoiceRegion::custom , "custom" , json::REQUIRIED_FIELD)
);
JSONStructEnd
};
struct VoiceServerUpdate : DiscordObject {
VoiceServerUpdate() = default;
VoiceServerUpdate(const nonstd::string_view& json) :
VoiceServerUpdate(json::fromJSON<VoiceServerUpdate>(json)) {}
VoiceServerUpdate(const json::Value& json);
std::string token;
Snowflake<Server> serverID;
std::string endpoint;
JSONStructStart
std::make_tuple(
json::pair(&VoiceServerUpdate::token , "token" , json::REQUIRIED_FIELD),
json::pair(&VoiceServerUpdate::serverID, "guild_id", json::REQUIRIED_FIELD),
json::pair(&VoiceServerUpdate::endpoint, "endpoint", json::REQUIRIED_FIELD)
);
JSONStructEnd
};
}