38 static constexpr auto parseValue = createObject(
"exemptChannels", &value_type::exemptChannels,
"exemptRoles", &value_type::exemptRoles,
"triggerMetadata",
39 &value_type::triggerMetadata,
"actions", &value_type::actions,
"triggerType", &value_type::triggerType,
"eventType", &value_type::eventType,
"guildId",
40 &value_type::guildId,
"name", &value_type::name,
"enabled", &value_type::enabled);
45 static constexpr auto parseValue = createObject(
"exemptChannels", &value_type::exemptChannels,
"exemptRoles", &value_type::exemptRoles,
"triggerMetadata",
46 &value_type::triggerMetadata,
"actions", &value_type::actions,
"autoModerationRuleId", &value_type::autoModerationRuleId,
"eventType", &value_type::eventType,
47 "guildId", &value_type::guildId,
"name", &value_type::name,
"enabled", &value_type::enabled);
54 void auto_moderation_rules::initialize(discord_core_internal::https_client* https_client_new) {
55 auto_moderation_rules::httpsClient = https_client_new;
59 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Auto_Moderation_Rules };
60 co_await newThreadAwaitable<jsonifier::vector<auto_moderation_rule_data>>();
61 workload.workloadClass = discord_core_internal::https_workload_class::Get;
62 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/auto-moderation/rules";
63 workload.callStack =
"auto_moderation_rules::listAutoModerationRulesForGuildAsync()";
64 jsonifier::vector<auto_moderation_rule_data> returnVector{};
65 auto_moderation_rules::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnVector);
66 co_return std::move(returnVector);
70 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Auto_Moderation_Rule };
71 co_await newThreadAwaitable<auto_moderation_rule_data>();
72 workload.workloadClass = discord_core_internal::https_workload_class::Get;
73 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/auto-moderation/rules/" + dataPackage.
autoModerationRuleId.operator jsonifier::string();
74 workload.callStack =
"auto_moderation_rules::getAutoModerationRuleAsync()";
76 auto_moderation_rules::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
81 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Post_Auto_Moderation_Rule };
82 co_await newThreadAwaitable<auto_moderation_rule_data>();
83 workload.workloadClass = discord_core_internal::https_workload_class::Post;
84 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/auto-moderation/rules";
85 parser.serializeJson<
true>(dataPackage, workload.content);
86 workload.callStack =
"auto_moderation_rules::createAutoModerationRuleAsync()";
88 auto_moderation_rules::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
93 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Patch_Auto_Moderation_Rule };
94 co_await newThreadAwaitable<auto_moderation_rule_data>();
95 workload.workloadClass = discord_core_internal::https_workload_class::Patch;
97 parser.serializeJson<
true>(dataPackage, workload.content);
98 workload.callStack =
"auto_moderation_rules::modifyAutoModerationRuleAsync()";
100 auto_moderation_rules::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
101 co_return returnData;
105 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Delete_Auto_Moderation_Rule };
106 co_await newThreadAwaitable<void>();
107 workload.workloadClass = discord_core_internal::https_workload_class::Delete;
109 workload.callStack =
"auto_moderation_rules::deleteAutoModerationRuleAsync()";
110 auto_moderation_rules::httpsClient->submitWorkloadAndGetResult(std::move(workload));
Represents an auto-moderation-rule.
co_routine< jsonifier::vector< auto_moderation_rule_data > > listAutoModerationRulesForGuildAsync(const list_auto_moderation_rules_for_guild_data dataPackage)
Get all of the guild's auto-moderation-rules.
co_routine< auto_moderation_rule_data > modifyAutoModerationRuleAsync(const modify_auto_moderation_rule_data dataPackage)
Modify a particular auto-moderation-rule.
co_routine< auto_moderation_rule_data > createAutoModerationRuleAsync(const create_auto_moderation_rule_data dataPackage)
Create a particular auto-moderation-rule.
co_routine< auto_moderation_rule_data > getAutoModerationRuleAsync(const get_auto_moderation_rule_data dataPackage)
Get a particular auto-moderation-rule.
co_routine< void > deleteAutoModerationRuleAsync(const delete_auto_moderation_rule_data dataPackage)
Delete a particular auto-moderation-rule.
A co_routine - representing a potentially asynchronous operation/function.
For sending Https requests.
The main namespace for the forward-facing interfaces.
For creating an auto-moderation-rule.
snowflake guildId
The guild within which to create the auto_moderation_rule_data.
For deleting an auto-moderation-rule.
snowflake guildId
Guild within which to delete the auto-moderation-rule.
snowflake autoModerationRuleId
The id of the auto-moderation-rule you would like to delete.
For collecting an auto-moderation-rule for a particular auto_moderation_rule_data.
snowflake autoModerationRuleId
The id of the auto-moderation-rule you would like to collect.
snowflake guildId
The id of the guild from which you would like to collect the auto-moderation-rule from.
For listing all of the auto-moderation-rules for a particular guild .
snowflake guildId
The id of the guild for which you would like to list the auto-moderation rules.
For modifying an auto-moderation-rule.
snowflake guildId
The auto_moderation_rule_data within which to modify the auto-moderation-rule.
snowflake autoModerationRuleId
The id of the auto-moderation-rule you would like to modify.