37 template<>
struct core<discord_core_api::create_stage_instance_data> {
38 using value_type = discord_core_api::create_stage_instance_data;
39 static constexpr auto parseValue =
40 createValue(
"privacyLevel", &value_type::privacyLevel,
"channelId", &value_type::channelId,
"topic", &value_type::topic);
43 template<>
struct core<discord_core_api::modify_stage_instance_data> {
44 using value_type = discord_core_api::modify_stage_instance_data;
45 static constexpr auto parseValue =
46 createValue(
"privacyLevel", &value_type::privacyLevel,
"channelId", &value_type::channelId,
"topic", &value_type::topic);
54 stage_instances::httpsClient = client;
58 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Post_Stage_Instance };
60 workload.workloadClass = discord_core_internal::https_workload_class::Post;
61 workload.relativePath =
"/stage-instances";
62 workload.callStack =
"stage_instances::createStageInstanceAsync()";
63 parser.serializeJson(dataPackage, workload.content);
64 if (dataPackage.
reason !=
"") {
65 workload.headersToInsert[
"x-audit-log-reason"] = dataPackage.
reason;
67 stage_instance_data returnData{};
68 stage_instances::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
73 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Stage_Instance };
75 workload.workloadClass = discord_core_internal::https_workload_class::Get;
76 workload.relativePath =
"/stage-instances/" + dataPackage.
channelId;
77 workload.callStack =
"stage_instances::getStageInstanceAsync()";
78 stage_instance_data returnData{};
79 stage_instances::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
84 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Patch_Stage_Instance };
86 workload.workloadClass = discord_core_internal::https_workload_class::Patch;
87 workload.relativePath =
"/stage-instances/" + dataPackage.
channelId;
88 parser.serializeJson(dataPackage, workload.content);
89 workload.callStack =
"stage_instances::modifyStageInstanceAsync()";
90 if (dataPackage.
reason !=
"") {
91 workload.headersToInsert[
"x-audit-log-reason"] = dataPackage.
reason;
93 stage_instance_data returnData{};
94 stage_instances::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
99 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Delete_Stage_Instance };
101 workload.workloadClass = discord_core_internal::https_workload_class::Delete;
102 workload.relativePath =
"/stage-instances/" + dataPackage.
channelId;
103 workload.callStack =
"stage_instances::deleteStageInstanceAsync()";
104 if (dataPackage.
reason !=
"") {
105 workload.headersToInsert[
"x-audit-log-reason"] = dataPackage.
reason;
107 stage_instances::httpsClient->submitWorkloadAndGetResult(std::move(workload));
A co_routine - representing a potentially asynchronous operation/function.
For sending Https requests.
static co_routine< stage_instance_data > modifyStageInstanceAsync(modify_stage_instance_data dataPackage)
Modifies a stage_instance_data.
static co_routine< stage_instance_data > getStageInstanceAsync(get_stage_instance_data dataPackage)
Collects a stage_instance_data.
static co_routine< stage_instance_data > createStageInstanceAsync(create_stage_instance_data dataPackage)
Creates a stage_instance_data.
static co_routine< void > deleteStageInstanceAsync(delete_stage_instance_data dataPackage)
Deletes a stage_instance_data.
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 stage_instance_data.
jsonifier::string reason
The reason for starting it.
For deleting a single stage_instance_data.
jsonifier::string reason
Reason for deleting the stage_instance_data.
snowflake channelId
The channel_data snowflake of the stage_instance_data.
For collecting a single stage_instance_data.
snowflake channelId
The channel_data id from which you would like to collect the stage_instance_data.
For modifying a single stage_instance_data.
snowflake channelId
The channel_data snowflake of the stage_instance_data.
jsonifier::string reason
Reason for modifying the stage_instance_data.