diff --git a/src/model/application/mod.rs b/src/model/application/mod.rs index 3f3394a642d..84fc135fe1f 100644 --- a/src/model/application/mod.rs +++ b/src/model/application/mod.rs @@ -49,39 +49,52 @@ pub struct CurrentApplicationInfo { pub bot_public: bool, pub bot_require_code_grant: bool, #[serde(default)] - pub terms_of_service_url: Option, + pub bot: User, #[serde(default)] - pub privacy_policy_url: Option, - pub owner: Option, - // omitted `summary` because it deprecated - pub verify_key: FixedString, + pub terms_of_service_url: Option, + #[serde(default)] + pub privacy_policy_url: Option, + #[serde(default)] + pub owner: User, + pub verify_key: String, pub team: Option, #[serde(default)] pub guild_id: Option, #[serde(default)] + pub guild: Option, + #[serde(default)] pub primary_sku_id: Option, #[serde(default)] - pub slug: Option, + pub slug: String, #[serde(default)] - pub cover_image: Option, + pub cover_image: String, #[serde(default)] pub flags: Option, #[serde(default)] - pub tags: Option>, + pub approximate_guild_count: Option, #[serde(default)] - pub install_params: Option, + pub approximate_user_install_count: Option, #[serde(default)] - pub custom_install_url: Option, + pub redirect_uris: Vec, + #[serde(default)] + pub interactions_endpoint_url: Option, /// The application's role connection verification entry point, which when configured will /// render the app as a verification method in the guild role verification configuration. - pub role_connections_verification_url: Option, + #[serde(default)] + pub role_connections_verification_url: Option, + #[serde(default)] + pub event_webhooks_url: Option, + pub event_webhook_status: EventWebhookStatus, + #[serde(default)] + pub event_webhook_type: Vec, + #[serde(default)] + pub tags: Option>, + #[serde(default)] + pub install_params: Option, #[serde(default)] pub integration_types_config: HashMap, - pub approximate_guild_count: Option, - pub approximate_user_install_count: Option, - pub guild: Option, - pub redirect_uris: Option>, - pub interactions_endpoint_url: Option, + #[serde(default)] + pub custom_install_url: String, } impl ApplicationId { @@ -96,6 +109,27 @@ impl ApplicationId { } } +#[derive(Clone, Debug, Deserialize, Serialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +#[non_exhaustive] +pub enum EventWebhookType { + ApplicationAuthorized, + EntitlementCreate, + QuestUserEnrollment, +} + +enum_number! { + #[derive(Clone, Debug, Deserialize, Serialize)] + #[serde(rename_all = "SCREAMING_SNAKE_CASE")] + #[non_exhaustive] + pub enum EventWebhookStatus { + Enabled = 1, + Disabled = 2, + DisabledByDiscord = 3, + _ => Unknown(u8), + } +} + enum_number! { /// An enum representing the [installation contexts]. ///