39 static constexpr auto parseValue =
40 createObject(
"privacyLevel", &value_type::privacyLevel,
"channelId", &value_type::channelId,
"reason", &value_type::reason,
"topic", &value_type::topic);
45 static constexpr auto parseValue =
46 createObject(
"privacyLevel", &value_type::privacyLevel,
"channelId", &value_type::channelId,
"reason", &value_type::reason,
"topic", &value_type::topic);
53 void stage_instances::initialize(discord_core_internal::https_client* client) {
54 stage_instances::httpsClient = client;
58 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Post_Stage_Instance };
59 co_await newThreadAwaitable<stage_instance_data>();
60 workload.workloadClass = discord_core_internal::https_workload_class::Post;
61 workload.relativePath =
"/stage-instances";
62 workload.callStack =
"stage_instances::createStageInstanceAsync()";
63 parser.serializeJson<
true>(dataPackage, workload.content);
64 if (dataPackage.
reason !=
"") {
65 workload.headersToInsert[
"x-audit-log-reason"] = dataPackage.
reason;
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 };
74 co_await newThreadAwaitable<stage_instance_data>();
75 workload.workloadClass = discord_core_internal::https_workload_class::Get;
76 workload.relativePath =
"/stage-instances/" + dataPackage.
channelId;
77 workload.callStack =
"stage_instances::getStageInstanceAsync()";
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 };
85 co_await newThreadAwaitable<stage_instance_data>();
86 workload.workloadClass = discord_core_internal::https_workload_class::Patch;
87 workload.relativePath =
"/stage-instances/" + dataPackage.
channelId;
88 parser.serializeJson<
true>(dataPackage, workload.content);
89 workload.callStack =
"stage_instances::modifyStageInstanceAsync()";
90 if (dataPackage.
reason !=
"") {
91 workload.headersToInsert[
"x-audit-log-reason"] = dataPackage.
reason;
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 };
100 co_await newThreadAwaitable<void>();
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(const modify_stage_instance_data dataPackage)
Modifies a stage_instance_data.
static co_routine< stage_instance_data > createStageInstanceAsync(const create_stage_instance_data dataPackage)
Creates a stage_instance_data.
static co_routine< void > deleteStageInstanceAsync(const delete_stage_instance_data dataPackage)
Deletes a stage_instance_data.
static co_routine< stage_instance_data > getStageInstanceAsync(const get_stage_instance_data dataPackage)
Collects a stage_instance_data.
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.