Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update current application object struct #3041

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading