djs_rest/endpoints/
mod.rs1mod application;
4mod application_command;
5mod application_identity_profile;
6mod application_role_connection_metadata;
7mod audit_log;
8mod auto_moderation;
9mod channel;
10mod emoji;
11mod entitlement;
12mod guild;
13mod guild_scheduled_event;
14mod guild_template;
15mod interaction;
16mod invite;
17mod lobby;
18mod message;
19mod oauth2;
20mod poll;
21mod sku;
22mod soundboard;
23mod stage_instance;
24mod sticker;
25mod subscription;
26mod user;
27mod voice;
28mod webhook;
29
30use djs_model::{
31 permissions::Permissions,
32 rest::{Gateway, GatewayBot},
33};
34use serde::Deserialize;
35
36use crate::client::boxed;
37use crate::{Error, Request, Rest, Route};
38
39#[derive(Deserialize)]
42struct PermissionsResponse {
43 permissions: Permissions,
44}
45
46#[derive(Deserialize)]
48struct Items<T> {
49 items: Vec<T>,
50}
51
52impl Rest {
53 pub fn get_gateway(&self) -> impl Future<Output = Result<Gateway, Error>> + Send + '_ {
64 boxed(async move { self.call(Request::new(Route::GetGateway)).await })
65 }
66
67 pub fn get_gateway_bot(&self) -> impl Future<Output = Result<GatewayBot, Error>> + Send + '_ {
76 boxed(async move { self.call(Request::new(Route::GetGatewayBot)).await })
77 }
78
79 pub(crate) async fn request_ignoring_body(&self, request: Request<'_>) -> Result<(), Error> {
82 let _: serde::de::IgnoredAny = self.call(request).await?;
83 Ok(())
84 }
85}