1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use super::DeleteChannelPermissionConfigured;
use crate::client::Client;
use twilight_model::id::{ChannelId, RoleId, UserId};
#[must_use = "requests must be configured and executed"]
pub struct DeleteChannelPermission<'a> {
channel_id: ChannelId,
http: &'a Client,
}
impl<'a> DeleteChannelPermission<'a> {
pub(crate) const fn new(http: &'a Client, channel_id: ChannelId) -> Self {
Self { channel_id, http }
}
pub const fn member(self, user_id: UserId) -> DeleteChannelPermissionConfigured<'a> {
self.configure(user_id.get())
}
pub const fn role(self, role_id: RoleId) -> DeleteChannelPermissionConfigured<'a> {
self.configure(role_id.get())
}
const fn configure(self, target_id: u64) -> DeleteChannelPermissionConfigured<'a> {
DeleteChannelPermissionConfigured::new(self.http, self.channel_id, target_id)
}
}