37 template<>
struct core<discord_core_api::modify_guild_scheduled_event_data> {
38 using value_type = discord_core_api::modify_guild_scheduled_event_data;
39 static constexpr auto parseValue = createValue(
"privacy_level", &value_type::privacyLevel,
"status", &value_type::status,
"entity_metadata", &value_type::entityMetadata,
40 "entity_type", &value_type::entityType,
"guild_scheduled_event_id", &value_type::guildScheduledEventId,
"scheduled_start_time", &value_type::scheduledStartTime,
41 "scheduled_end_time", &value_type::scheduledEndTime,
"description", &value_type::description,
"channel_id", &value_type::channelId,
"guild_id", &value_type::guildId,
42 "name", &value_type::name);
45 template<>
struct core<discord_core_api::create_guild_scheduled_event_data> {
46 using value_type = discord_core_api::create_guild_scheduled_event_data;
47 static constexpr auto parseValue = createValue(
"privacy_level", &value_type::privacyLevel,
"entity_metadata", &value_type::entityMetadata,
"entity_type",
48 &value_type::entityType,
"scheduled_start_time", &value_type::scheduledStartTime,
"scheduled_end_time", &value_type::scheduledEndTime,
"description",
49 &value_type::description,
"channel_id", &value_type::channelId,
"guild_id", &value_type::guildId,
"name", &value_type::name);
57 guild_scheduled_events::httpsClient = client;
61 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Scheduled_Events };
63 workload.workloadClass = discord_core_internal::https_workload_class::Get;
64 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/scheduled-events";
65 workload.callStack =
"guild_scheduled_events::getGuildScheduledEventAsync()";
66 jsonifier::vector<guild_scheduled_event_data> returnData{};
67 guild_scheduled_events::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
72 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Post_Guild_Scheduled_Event };
74 workload.workloadClass = discord_core_internal::https_workload_class::Post;
75 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/scheduled-events";
76 parser.serializeJson(dataPackage, workload.content);
77 workload.callStack =
"guild_scheduled_events::createGuildScheduledEventAsync()";
78 guild_scheduled_event_data returnData{};
79 guild_scheduled_events::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
84 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Scheduled_Event };
86 workload.workloadClass = discord_core_internal::https_workload_class::Get;
88 workload.relativePath +=
"?with_user_count=";
89 std::stringstream
stream{};
91 workload.relativePath +=
stream.str();
92 workload.callStack =
"guild_scheduled_events::getGuildScheduledEventAsync()";
93 guild_scheduled_event_data returnData{};
94 guild_scheduled_events::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
99 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Patch_Guild_Scheduled_Event };
101 workload.workloadClass = discord_core_internal::https_workload_class::Patch;
103 parser.serializeJson(dataPackage, workload.content);
104 workload.callStack =
"guild_scheduled_events::modifyGuildScheduledEventAsync()";
105 guild_scheduled_event_data returnData{};
106 guild_scheduled_events::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
107 co_return returnData;
111 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Delete_Guild_Scheduled_Event };
113 workload.workloadClass = discord_core_internal::https_workload_class::Delete;
115 workload.callStack =
"guild_scheduled_events::deleteGuildScheduledEventAsync()";
116 guild_scheduled_events::httpsClient->submitWorkloadAndGetResult(std::move(workload));
121 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Scheduled_Event_Users };
123 workload.workloadClass = discord_core_internal::https_workload_class::Get;
125 if (dataPackage.
limit != 0) {
126 workload.relativePath +=
"?limit=" + jsonifier::toString(dataPackage.
limit);
127 if (dataPackage.
after != 0) {
128 workload.relativePath +=
"&after=" + dataPackage.
after;
130 if (dataPackage.
before != 0) {
131 workload.relativePath +=
"&before=" + dataPackage.
before;
134 workload.relativePath +=
"&with_member=true";
137 if (dataPackage.
after != 0) {
138 workload.relativePath +=
"?after=" + dataPackage.
after;
139 if (dataPackage.
before != 0) {
140 workload.relativePath +=
"&before=" + dataPackage.
before;
143 workload.relativePath +=
"&with_member=true";
146 if (dataPackage.
before != 0) {
147 workload.relativePath +=
"?before=" + dataPackage.
before;
149 workload.relativePath +=
"&with_member=true";
153 workload.relativePath +=
"?with_member=true";
155 workload.callStack =
"guild_scheduled_events::getGuildScheduledEventUsersAsync()";
156 jsonifier::vector<guild_scheduled_event_user_data> returnData{};
157 guild_scheduled_events::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
158 co_return returnData;
A co_routine - representing a potentially asynchronous operation/function.
For sending Https requests.
static co_routine< jsonifier::vector< guild_scheduled_event_data > > getGuildScheduledEventsAsync(get_guild_scheduled_events_data dataPackage)
Gets a list of a given guild's scheduled events.
static co_routine< jsonifier::vector< guild_scheduled_event_user_data > > getGuildScheduledEventUsersAsync(get_guild_scheduled_event_users_data dataPackage)
Collects a list of users for a given guild_scheduled_event_data.
static co_routine< void > deleteGuildScheduledEventAsync(delete_guild_scheduled_event_data dataPackage)
Deletes a single guild_scheduled_event_data.
static co_routine< guild_scheduled_event_data > getGuildScheduledEventAsync(get_guild_scheduled_event_data dataPackage)
Collects a single guild_scheduled_event_data.
static co_routine< guild_scheduled_event_data > modifyGuildScheduledEventAsync(modify_guild_scheduled_event_data dataPackage)
Modifies a single guild_scheduled_event_data.
static co_routine< guild_scheduled_event_data > createGuildScheduledEventAsync(create_guild_scheduled_event_data dataPackage)
Creates a new guild_scheduled_event_data within a chosen guild.
@ stream
Allows the user to go live.
DCA_INLINE auto newThreadAwaitable()
An awaitable that can be used to launch the co_routine onto a new thread - as well as return the hand...
The main namespace for the forward-facing interfaces.
For creating a guild_scheduled_event_data.
snowflake guildId
The guild within which to create the event.
For deleting a single guild scheduled event.
snowflake guildId
The guild within which to modify the event.
snowflake guildScheduledEventId
The id of the event to modify.
For collecting a single guild scheduled event.
bool withUserCount
Do we collect the user counts?
snowflake guildScheduledEventId
The id of the desired scheduled event.
snowflake guildId
Guild from which we would like to collect the events.
For collecting a list of guild scheduled event users.
snowflake before
consider only users before given user id.
snowflake guildScheduledEventId
The id of the event to modify.
bool withMember
Include guild member responseData if it exists.
uint32_t limit
How many users to receive from the event.
snowflake guildId
The guild within which to modify the event.
snowflake after
consider only users after given user id.
For collecting a list of a guild's scheduled events.
snowflake guildId
Guild from which we would like to collect the events.
For modifying a single guild scheduled event.
snowflake guildScheduledEventId
The id of the event to modify.
snowflake guildId
The guild within which to modify the event.