Skip to content

Commit

Permalink
update current application object struct
Browse files Browse the repository at this point in the history
  • Loading branch information
ivinjabraham committed Nov 17, 2024
1 parent f2c1085 commit 11f558e
Showing 1 changed file with 50 additions and 16 deletions.
66 changes: 50 additions & 16 deletions src/model/application/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<FixedString>,
pub bot: User,
#[serde(default)]
pub privacy_policy_url: Option<FixedString>,
pub owner: Option<User>,
// omitted `summary` because it deprecated
pub verify_key: FixedString,
pub terms_of_service_url: Option<String>,
#[serde(default)]
pub privacy_policy_url: Option<String>,
#[serde(default)]
pub owner: User,
pub verify_key: String,
pub team: Option<Team>,
#[serde(default)]
pub guild_id: Option<GuildId>,
#[serde(default)]
pub guild: Option<PartialGuild>,
#[serde(default)]
pub primary_sku_id: Option<SkuId>,
#[serde(default)]
pub slug: Option<FixedString>,
pub slug: String,
#[serde(default)]
pub cover_image: Option<FixedString>,
pub cover_image: String,
#[serde(default)]
pub flags: Option<ApplicationFlags>,
#[serde(default)]
pub tags: Option<Vec<String>>,
pub approximate_guild_count: Option<u32>,
#[serde(default)]
pub install_params: Option<InstallParams>,
pub approximate_user_install_count: Option<u32>,
#[serde(default)]
pub custom_install_url: Option<FixedString>,
pub redirect_uris: Vec<String>,
#[serde(default)]
pub interactions_endpoint_url: Option<String>,
/// 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<FixedString>,
#[serde(default)]
pub role_connections_verification_url: Option<String>,
#[serde(default)]
pub event_webhooks_url: Option<String>,
pub event_webhook_status: EventWebhookStatus,
#[serde(default)]
pub event_webhook_type: Vec<EventWebhookType>,
#[serde(default)]
pub tags: Option<Vec<String>>,
#[serde(default)]
pub install_params: Option<InstallParams>,
#[serde(default)]
pub integration_types_config: HashMap<InstallationContext, InstallationContextConfig>,
pub approximate_guild_count: Option<u32>,
pub approximate_user_install_count: Option<u32>,
pub guild: Option<PartialGuild>,
pub redirect_uris: Option<Vec<String>>,
pub interactions_endpoint_url: Option<String>,
#[serde(default)]
pub custom_install_url: String,
}

impl ApplicationId {
Expand All @@ -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].
///
Expand Down

0 comments on commit 11f558e

Please sign in to comment.