summaryrefslogtreecommitdiff
path: root/common/rust/src/discord_models/application.rs
diff options
context:
space:
mode:
Diffstat (limited to 'common/rust/src/discord_models/application.rs')
-rw-r--r--common/rust/src/discord_models/application.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/common/rust/src/discord_models/application.rs b/common/rust/src/discord_models/application.rs
new file mode 100644
index 0000000..65707d2
--- /dev/null
+++ b/common/rust/src/discord_models/application.rs
@@ -0,0 +1,38 @@
+use enumflags2::{bitflags, BitFlags};
+use serde::{Deserialize, Serialize};
+
+use super::{teams::Team, user::User};
+
+#[bitflags]
+#[repr(u64)]
+#[derive(Debug, Clone, Copy)]
+pub enum ApplicationFlags {
+ GatewayPresence = 1 << 12,
+ GatewayPresenceLimit = 1 << 13,
+ GatewayGuildMembers = 1 << 14,
+ GatewayGuildMembersLimited = 1 << 15,
+ VerificationPendingGuildLimit = 1 << 16,
+ Embedded = 1 << 17,
+}
+
+#[derive(Debug, Clone, Deserialize, Serialize)]
+pub struct Application {
+ pub id: String,
+ pub name: String,
+ pub icon: Option<String>,
+ pub description: String,
+ pub rpc_origins: Option<Vec<String>>,
+ pub bot_public: bool,
+ pub bot_require_code_grant: bool,
+ pub terms_of_service_url: Option<String>,
+ pub privacy_policy_url: Option<String>,
+ pub owner: Option<User>,
+ pub summary: String,
+ pub verify_key: String,
+ pub team: Option<Team>,
+ pub guild_id: Option<String>,
+ pub primary_sku_id: Option<String>,
+ pub slug: Option<String>,
+ pub cover_image: Option<String>,
+ pub flags: Option<BitFlags<ApplicationFlags>>,
+}