Skip to content

Commit 11f558e

Browse files
committed
update current application object struct
1 parent f2c1085 commit 11f558e

File tree

1 file changed

+50
-16
lines changed

1 file changed

+50
-16
lines changed

src/model/application/mod.rs

Lines changed: 50 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,39 +49,52 @@ pub struct CurrentApplicationInfo {
4949
pub bot_public: bool,
5050
pub bot_require_code_grant: bool,
5151
#[serde(default)]
52-
pub terms_of_service_url: Option<FixedString>,
52+
pub bot: User,
5353
#[serde(default)]
54-
pub privacy_policy_url: Option<FixedString>,
55-
pub owner: Option<User>,
56-
// omitted `summary` because it deprecated
57-
pub verify_key: FixedString,
54+
pub terms_of_service_url: Option<String>,
55+
#[serde(default)]
56+
pub privacy_policy_url: Option<String>,
57+
#[serde(default)]
58+
pub owner: User,
59+
pub verify_key: String,
5860
pub team: Option<Team>,
5961
#[serde(default)]
6062
pub guild_id: Option<GuildId>,
6163
#[serde(default)]
64+
pub guild: Option<PartialGuild>,
65+
#[serde(default)]
6266
pub primary_sku_id: Option<SkuId>,
6367
#[serde(default)]
64-
pub slug: Option<FixedString>,
68+
pub slug: String,
6569
#[serde(default)]
66-
pub cover_image: Option<FixedString>,
70+
pub cover_image: String,
6771
#[serde(default)]
6872
pub flags: Option<ApplicationFlags>,
6973
#[serde(default)]
70-
pub tags: Option<Vec<String>>,
74+
pub approximate_guild_count: Option<u32>,
7175
#[serde(default)]
72-
pub install_params: Option<InstallParams>,
76+
pub approximate_user_install_count: Option<u32>,
7377
#[serde(default)]
74-
pub custom_install_url: Option<FixedString>,
78+
pub redirect_uris: Vec<String>,
79+
#[serde(default)]
80+
pub interactions_endpoint_url: Option<String>,
7581
/// The application's role connection verification entry point, which when configured will
7682
/// render the app as a verification method in the guild role verification configuration.
77-
pub role_connections_verification_url: Option<FixedString>,
83+
#[serde(default)]
84+
pub role_connections_verification_url: Option<String>,
85+
#[serde(default)]
86+
pub event_webhooks_url: Option<String>,
87+
pub event_webhook_status: EventWebhookStatus,
88+
#[serde(default)]
89+
pub event_webhook_type: Vec<EventWebhookType>,
90+
#[serde(default)]
91+
pub tags: Option<Vec<String>>,
92+
#[serde(default)]
93+
pub install_params: Option<InstallParams>,
7894
#[serde(default)]
7995
pub integration_types_config: HashMap<InstallationContext, InstallationContextConfig>,
80-
pub approximate_guild_count: Option<u32>,
81-
pub approximate_user_install_count: Option<u32>,
82-
pub guild: Option<PartialGuild>,
83-
pub redirect_uris: Option<Vec<String>>,
84-
pub interactions_endpoint_url: Option<String>,
96+
#[serde(default)]
97+
pub custom_install_url: String,
8598
}
8699

87100
impl ApplicationId {
@@ -96,6 +109,27 @@ impl ApplicationId {
96109
}
97110
}
98111

112+
#[derive(Clone, Debug, Deserialize, Serialize)]
113+
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
114+
#[non_exhaustive]
115+
pub enum EventWebhookType {
116+
ApplicationAuthorized,
117+
EntitlementCreate,
118+
QuestUserEnrollment,
119+
}
120+
121+
enum_number! {
122+
#[derive(Clone, Debug, Deserialize, Serialize)]
123+
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
124+
#[non_exhaustive]
125+
pub enum EventWebhookStatus {
126+
Enabled = 1,
127+
Disabled = 2,
128+
DisabledByDiscord = 3,
129+
_ => Unknown(u8),
130+
}
131+
}
132+
99133
enum_number! {
100134
/// An enum representing the [installation contexts].
101135
///

0 commit comments

Comments
 (0)