twilight_model/channel/webhook/
guild.rs

1use crate::{
2    id::{marker::GuildMarker, Id},
3    util::image_hash::ImageHash,
4};
5use serde::{Deserialize, Serialize};
6
7/// Partial guild object that a webhook is following.
8#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
9pub struct WebhookGuild {
10    pub icon: Option<ImageHash>,
11    pub id: Id<GuildMarker>,
12    pub name: String,
13}
14
15#[cfg(test)]
16mod tests {
17    use super::WebhookGuild;
18    use serde::{Deserialize, Serialize};
19    use static_assertions::{assert_fields, assert_impl_all};
20    use std::{fmt::Debug, hash::Hash};
21
22    assert_fields!(WebhookGuild: icon, id, name);
23
24    assert_impl_all!(
25        WebhookGuild: Clone,
26        Debug,
27        Deserialize<'static>,
28        Eq,
29        Hash,
30        PartialEq,
31        Serialize
32    );
33}