twilight_http/
routing.rs

1use percent_encoding::{NON_ALPHANUMERIC, utf8_percent_encode};
2
3use crate::{
4    query_formatter::{QueryArray, QueryStringFormatter},
5    request::{Method, channel::reaction::RequestReactionType},
6};
7use std::fmt::{Display, Formatter, Result as FmtResult};
8use twilight_model::id::{
9    Id,
10    marker::{RoleMarker, SkuMarker},
11};
12
13#[derive(Clone, Debug, Eq, Hash, PartialEq)]
14#[non_exhaustive]
15pub enum Route<'a> {
16    /// Route information to add an emoji to an application.
17    AddApplicationEmoji {
18        /// The ID of the application.
19        application_id: u64,
20    },
21    /// Route information to add a user to a guild.
22    AddGuildMember {
23        guild_id: u64,
24        user_id: u64,
25    },
26    /// Route information to add a role to guild member.
27    AddMemberRole {
28        /// The ID of the guild.
29        guild_id: u64,
30        /// The ID of the role.
31        role_id: u64,
32        /// The ID of the user.
33        user_id: u64,
34    },
35    /// Route information to add a member to a thread.
36    AddThreadMember {
37        /// ID of the thread.
38        channel_id: u64,
39        /// ID of the member.
40        user_id: u64,
41    },
42    /// Route information to create an auto moderation rule.
43    CreateAutoModerationRule {
44        /// ID of the guild.
45        guild_id: u64,
46    },
47    /// Route information to create a ban on a user in a guild.
48    CreateBan {
49        /// The ID of the guild.
50        guild_id: u64,
51        /// The ID of the user.
52        user_id: u64,
53    },
54    /// Route information to create a channel in a guild.
55    CreateChannel {
56        /// The ID of the guild.
57        guild_id: u64,
58    },
59    /// Route information to create an emoji in a guild.
60    CreateEmoji {
61        /// The ID of the guild.
62        guild_id: u64,
63    },
64    /// Route information to create a thread in a forum channel.
65    CreateForumThread {
66        /// The ID of the channel.
67        channel_id: u64,
68    },
69    /// Route information to create a global command.
70    CreateGlobalCommand {
71        /// The ID of the owner application.
72        application_id: u64,
73    },
74    /// Route information to create a guild.
75    CreateGuild,
76    /// Route information to create a guild command.
77    CreateGuildCommand {
78        /// The ID of the owner application.
79        application_id: u64,
80        /// The ID of the guild.
81        guild_id: u64,
82    },
83    /// Route information to create a guild from a template.
84    CreateGuildFromTemplate {
85        /// Code of the template.
86        template_code: &'a str,
87    },
88    /// Route information to create a guild's integration.
89    CreateGuildIntegration {
90        /// The ID of the guild.
91        guild_id: u64,
92    },
93    /// Route information to create a prune in a guild.
94    CreateGuildPrune {
95        /// Whether to compute the number of pruned users.
96        compute_prune_count: Option<bool>,
97        /// The number of days that a user must be offline before being able to
98        /// be pruned.
99        days: Option<u16>,
100        /// The ID of the guild.
101        guild_id: u64,
102        /// The roles to filter the prune by.
103        ///
104        /// A user must have at least one of these roles to be able to be
105        /// pruned.
106        include_roles: &'a [Id<RoleMarker>],
107    },
108    /// Route information to create a scheduled event in a guild.
109    CreateGuildScheduledEvent {
110        /// ID of the guild.
111        guild_id: u64,
112    },
113    /// Route information to create a sticker in a guild.
114    CreateGuildSticker {
115        /// ID of the guild.
116        guild_id: u64,
117    },
118    /// Route information to create an invite to a channel.
119    CreateInvite {
120        /// The ID of the channel.
121        channel_id: u64,
122    },
123    /// Route information to create a message in a channel.
124    CreateMessage {
125        /// The ID of the channel.
126        channel_id: u64,
127    },
128    /// Route information to create a private channel.
129    CreatePrivateChannel,
130    /// Route information to create a reaction on a message.
131    CreateReaction {
132        /// The ID of the channel.
133        channel_id: u64,
134        /// The URI encoded custom or unicode emoji.
135        emoji: &'a RequestReactionType<'a>,
136        /// The ID of the message.
137        message_id: u64,
138    },
139    /// Route information to create a role in a guild.
140    CreateRole {
141        /// The ID of the guild.
142        guild_id: u64,
143    },
144    /// Route information to create a stage instance.
145    CreateStageInstance,
146    /// Route information to create a guild template.
147    CreateTemplate {
148        /// The ID of the guild.
149        guild_id: u64,
150    },
151    CreateTestEntitlement {
152        /// The ID of the application.
153        application_id: u64,
154    },
155    /// Route information to create a thread in a channel.
156    CreateThread {
157        /// ID of the channel.
158        channel_id: u64,
159    },
160    /// Route information to create a thread from a message.
161    CreateThreadFromMessage {
162        /// ID of the channel.
163        channel_id: u64,
164        /// ID of the message.
165        message_id: u64,
166    },
167    /// Route information to create a typing trigger in a channel.
168    CreateTypingTrigger {
169        /// The ID of the channel.
170        channel_id: u64,
171    },
172    /// Route information to create a webhook in a channel.
173    CreateWebhook {
174        /// The ID of the channel.
175        channel_id: u64,
176    },
177    /// Route information to crosspost a message to following guilds.
178    CrosspostMessage {
179        /// The ID of the channel.
180        channel_id: u64,
181        /// The ID of the message.
182        message_id: u64,
183    },
184    /// Route information to delete an application emoji.
185    DeleteApplicationEmoji {
186        /// The ID of the application.
187        application_id: u64,
188        /// The ID of the emoji.
189        emoji_id: u64,
190    },
191    /// Route information to delete an auto moderation rule for a guild.
192    DeleteAutoModerationRule {
193        /// ID of the guild.
194        guild_id: u64,
195        /// ID of the auto moderation rule.
196        auto_moderation_rule_id: u64,
197    },
198    /// Route information to delete a ban on a user in a guild.
199    DeleteBan {
200        /// The ID of the guild.
201        guild_id: u64,
202        /// The ID of the user.
203        user_id: u64,
204    },
205    /// Route information to delete a channel.
206    DeleteChannel {
207        /// The ID of the channel.
208        channel_id: u64,
209    },
210    /// Route information to delete a guild's custom emoji.
211    DeleteEmoji {
212        /// The ID of the emoji.
213        emoji_id: u64,
214        /// The ID of the guild.
215        guild_id: u64,
216    },
217    /// Route information to delete a global command.
218    DeleteGlobalCommand {
219        /// The ID of the owner application.
220        application_id: u64,
221        /// The ID of the command.
222        command_id: u64,
223    },
224    /// Route information to delete a guild.
225    DeleteGuild {
226        /// The ID of the guild.
227        guild_id: u64,
228    },
229    /// Route information to delete a guild command.
230    DeleteGuildCommand {
231        /// The ID of the owner application.
232        application_id: u64,
233        /// The ID of the command.
234        command_id: u64,
235        /// The ID of the guild.
236        guild_id: u64,
237    },
238    /// Route information to delete a guild integration.
239    DeleteGuildIntegration {
240        /// The ID of the guild.
241        guild_id: u64,
242        /// The ID of the integration.
243        integration_id: u64,
244    },
245    /// Route information to delete a scheduled event in a guild.
246    DeleteGuildScheduledEvent {
247        /// ID of the guild.
248        guild_id: u64,
249        /// ID of the scheduled event.
250        scheduled_event_id: u64,
251    },
252    /// Route information to delete a guild sticker.
253    DeleteGuildSticker {
254        /// ID of the guild.
255        guild_id: u64,
256        /// ID of the sticker.
257        sticker_id: u64,
258    },
259    /// Route information to delete the original interaction response.
260    DeleteInteractionOriginal {
261        /// The ID of the owner application
262        application_id: u64,
263        /// The token of the interaction.
264        interaction_token: &'a str,
265    },
266    /// Route information to delete an invite.
267    DeleteInvite {
268        /// The unique invite code.
269        code: &'a str,
270    },
271    /// Route information to delete a channel's message.
272    DeleteMessage {
273        /// The ID of the channel.
274        channel_id: u64,
275        /// The ID of the message.
276        message_id: u64,
277    },
278    /// Route information to delete all of the reactions on a message.
279    DeleteMessageReactions {
280        /// The ID of the channel.
281        channel_id: u64,
282        /// The ID of the message.
283        message_id: u64,
284    },
285    /// Route information to delete all of the reactions on a message with a
286    /// specific emoji.
287    DeleteMessageSpecificReaction {
288        /// The ID of the channel.
289        channel_id: u64,
290        /// The URI encoded custom or unicode emoji.
291        emoji: &'a RequestReactionType<'a>,
292        /// The ID of the message.
293        message_id: u64,
294    },
295    /// Route information to bulk delete messages in a channel.
296    DeleteMessages {
297        /// The ID of the channel.
298        channel_id: u64,
299    },
300    /// Route information to delete a permission overwrite for a role or user in
301    /// a channel.
302    DeletePermissionOverwrite {
303        /// The ID of the channel.
304        channel_id: u64,
305        /// The ID of the target role or user.
306        target_id: u64,
307    },
308    /// Route information to delete a user's reaction on a message.
309    DeleteReaction {
310        /// The ID of the channel.
311        channel_id: u64,
312        /// The URI encoded custom or unicode emoji.
313        emoji: &'a RequestReactionType<'a>,
314        /// The ID of the message.
315        message_id: u64,
316        /// The ID of the user.
317        user_id: u64,
318    },
319    /// Route information to delete the current user's reaction on a message.
320    DeleteReactionCurrentUser {
321        /// ID of the channel.
322        channel_id: u64,
323        /// URI encoded custom or unicode emoji.
324        emoji: &'a RequestReactionType<'a>,
325        /// ID of the message.
326        message_id: u64,
327    },
328    /// Route information to delete a guild's role.
329    DeleteRole {
330        /// The ID of the guild.
331        guild_id: u64,
332        /// The ID of the role.
333        role_id: u64,
334    },
335    /// Route information to delete a stage instance.
336    DeleteStageInstance {
337        /// ID of the stage channel.
338        channel_id: u64,
339    },
340    /// Route information to delete a guild template.
341    DeleteTemplate {
342        /// The ID of the guild.
343        guild_id: u64,
344        /// The target template code.
345        template_code: &'a str,
346    },
347    /// Route information to delete a webhook.
348    DeleteWebhook {
349        /// The token of the webhook.
350        token: Option<&'a str>,
351        /// The ID of the webhook.
352        webhook_id: u64,
353    },
354    /// Route information to delete a message created by a webhook.
355    DeleteWebhookMessage {
356        message_id: u64,
357        /// ID of the thread channel, if there is one.
358        thread_id: Option<u64>,
359        token: &'a str,
360        webhook_id: u64,
361    },
362    /// Route information to delete a test entitlement.
363    DeleteTestEntitlement {
364        /// The ID of the application.
365        application_id: u64,
366        /// The ID of the entitlement.
367        entitlement_id: u64,
368    },
369    /// Route information to edit an application emoji.
370    UpdateApplicationEmoji {
371        /// The ID of the application.
372        application_id: u64,
373        /// The ID of the emoji.
374        emoji_id: u64,
375    },
376    /// Route information to end a poll.
377    EndPoll {
378        channel_id: u64,
379        message_id: u64,
380    },
381    /// Route information to execute a webhook by ID and token.
382    ExecuteWebhook {
383        /// ID of the thread channel, if there is one.
384        thread_id: Option<u64>,
385        /// The token of the webhook.
386        token: &'a str,
387        /// Whether to wait for a message response.
388        wait: Option<bool>,
389        /// Whether the message includes Components V2.
390        with_components: Option<bool>,
391        /// The ID of the webhook.
392        webhook_id: u64,
393    },
394    /// Route information to follow a news channel.
395    FollowNewsChannel {
396        /// The ID of the channel to follow.
397        channel_id: u64,
398    },
399    /// Route information to get active threads in a channel.
400    GetActiveThreads {
401        /// ID of the guild.
402        guild_id: u64,
403    },
404    GetApplicationEmojis {
405        /// The ID of the application.
406        application_id: u64,
407    },
408    /// Route information for fetching poll vote information.
409    GetAnswerVoters {
410        /// Get users after this user ID.
411        after: Option<u64>,
412        /// The id of the poll answer.
413        answer_id: u8,
414        /// The ID of the channel the poll is in.
415        channel_id: u64,
416        /// The maximum number of users to return (1-100).
417        limit: Option<u8>,
418        /// The message ID of the poll.
419        message_id: u64,
420    },
421    /// Route information to get a paginated list of audit logs in a guild.
422    GetAuditLogs {
423        /// The type of action to get audit logs for.
424        action_type: Option<u64>,
425        /// The minimum ID of audit logs to get.
426        after: Option<u64>,
427        /// The maximum ID of audit logs to get.
428        before: Option<u64>,
429        /// The ID of the guild.
430        guild_id: u64,
431        /// The maximum number of audit logs to get.
432        limit: Option<u16>,
433        /// The ID of the user, if specified.
434        user_id: Option<u64>,
435    },
436    /// Route information to get an auto moderation rule for a guild.
437    GetAutoModerationRule {
438        /// ID of the guild.
439        guild_id: u64,
440        /// ID of the auto moderation rule.
441        auto_moderation_rule_id: u64,
442    },
443    /// Route information to get information about a single ban in a guild.
444    GetBan {
445        /// The ID of the guild.
446        guild_id: u64,
447        /// The ID of the user.
448        user_id: u64,
449    },
450    /// Route information to get a guild's bans.
451    GetBans {
452        /// The ID of the guild.
453        guild_id: u64,
454    },
455    /// Route information to get a guild's bans with parameters.
456    GetBansWithParameters {
457        /// User ID after which to retrieve bans.
458        after: Option<u64>,
459        /// User ID before which to retrieve bans.
460        before: Option<u64>,
461        /// Maximum number of bans to retrieve.
462        limit: Option<u16>,
463        /// ID of the guild.
464        guild_id: u64,
465    },
466    /// Route information to get a channel.
467    GetChannel {
468        /// The ID of the channel.
469        channel_id: u64,
470    },
471    /// Route information to get a channel's invites.
472    GetChannelInvites {
473        /// The ID of the channel.
474        channel_id: u64,
475    },
476    /// Route information to get a channel's webhooks.
477    GetChannelWebhooks {
478        /// The ID of the channel.
479        channel_id: u64,
480    },
481    /// Route information to get a guild's channels.
482    GetChannels {
483        /// The ID of the guild.
484        guild_id: u64,
485    },
486    /// Route information to get permissions of a specific guild command.
487    GetCommandPermissions {
488        /// The ID of the application.
489        application_id: u64,
490        /// The ID of the command.
491        command_id: u64,
492        /// The ID of the guild.
493        guild_id: u64,
494    },
495    /// Route information to get the current OAuth2 authorization information.
496    GetCurrentAuthorizationInformation,
497    /// Route information to get the current user.
498    GetCurrentUser,
499    /// Route information to get info about application the current bot user belongs to
500    GetCurrentUserApplicationInfo,
501    /// Route information to get the current user as a member object within a guild.
502    GetCurrentUserGuildMember {
503        /// ID of the guild.
504        guild_id: u64,
505    },
506    /// Route information to get the current user's voice state.
507    GetCurrentUserVoiceState {
508        /// ID of the guild.
509        guild_id: u64,
510    },
511    /// Route information to get an emoji by ID within a guild.
512    GetEmoji {
513        /// The ID of the emoji.
514        emoji_id: u64,
515        /// The ID of the guild.
516        guild_id: u64,
517    },
518    /// Route information to get a guild's emojis.
519    GetEmojis {
520        /// The ID of the guild.
521        guild_id: u64,
522    },
523    GetEntitlements {
524        /// Retrieve entitlements after this time.
525        after: Option<u64>,
526        /// The ID of the application.
527        application_id: u64,
528        /// Retrieve entitlements before this time.
529        before: Option<u64>,
530        /// Whether to exclude ended entitlements.
531        exclude_ended: Option<bool>,
532        /// Guild ID to look up entitlements for.
533        guild_id: Option<u64>,
534        /// Number of entitlements to return. Set to 100 if unspecified.
535        limit: Option<u8>,
536        /// List of SKU IDs to check entitlements for.
537        sku_ids: &'a [Id<SkuMarker>],
538        /// User ID to look up entitlements for.
539        user_id: Option<u64>,
540    },
541    /// Route to get a followup message for an interaction.
542    GetFollowupMessage {
543        /// ID of the application.
544        application_id: u64,
545        /// Token of the interaction.
546        interaction_token: &'a str,
547        /// ID of the thread channel, if there is one.
548        thread_id: Option<u64>,
549        /// ID of the followup message.
550        message_id: u64,
551    },
552    /// Route information to get basic gateway information.
553    GetGateway,
554    /// Route information to get gateway information tailored to the current
555    /// user.
556    GetGatewayBot,
557    /// Route information to get a global command for an application.
558    GetGlobalCommand {
559        /// ID of the owner application.
560        application_id: u64,
561        /// ID of the command.
562        command_id: u64,
563    },
564    GetGlobalCommands {
565        /// The ID of the owner application.
566        application_id: u64,
567        /// Whether to include full localization dictionaries.
568        with_localizations: Option<bool>,
569    },
570    /// Route information to get a guild.
571    GetGuild {
572        /// The ID of the guild.
573        guild_id: u64,
574        /// Whether to include approximate member and presence counts for the
575        /// guild.
576        with_counts: bool,
577    },
578    /// Route information to get a list of automation rules for a guild.
579    GetGuildAutoModerationRules {
580        /// ID of the guild.
581        guild_id: u64,
582    },
583    /// Route information to get a guild command.
584    GetGuildCommand {
585        /// ID of the owner application.
586        application_id: u64,
587        /// ID of the command.
588        command_id: u64,
589        /// ID of the guild.
590        guild_id: u64,
591    },
592    /// Route information to get permissions of all guild commands.
593    GetGuildCommandPermissions {
594        /// The ID of the application.
595        application_id: u64,
596        /// The ID of the guild.
597        guild_id: u64,
598    },
599    /// Route information to get guild commands.
600    GetGuildCommands {
601        /// The ID of the owner application.
602        application_id: u64,
603        /// The ID of the guild.
604        guild_id: u64,
605        /// Whether to include full localization dictionaries.
606        with_localizations: Option<bool>,
607    },
608    /// Route information to get a guild's integrations.
609    GetGuildIntegrations {
610        /// The ID of the guild.
611        guild_id: u64,
612    },
613    /// Route information to get a guild's invites.
614    GetGuildInvites {
615        /// The ID of the guild.
616        guild_id: u64,
617    },
618    /// Route information to get a guild's members.
619    GetGuildMembers {
620        /// The minimum ID of members to get.
621        after: Option<u64>,
622        /// The ID of the guild.
623        guild_id: u64,
624        /// The maximum number of members to get.
625        limit: Option<u16>,
626    },
627    /// Route information to get a guild's onboarding information.
628    GetGuildOnboarding {
629        /// The ID of the guild to get onboarding information for.
630        guild_id: u64,
631    },
632    /// Route information to get a guild's preview.
633    GetGuildPreview {
634        /// The ID of the guild.
635        guild_id: u64,
636    },
637    /// Route information to get the number of members that would be pruned,
638    /// filtering by inactivity and users with one of the provided roles.
639    GetGuildPruneCount {
640        /// The number of days that a user must be offline before being able to
641        /// be pruned.
642        days: Option<u16>,
643        /// The ID of the guild.
644        guild_id: u64,
645        /// The roles to filter the prune by.
646        ///
647        /// A user must have at least one of these roles to be able to be
648        /// pruned.
649        include_roles: &'a [Id<RoleMarker>],
650    },
651    /// Route information to get guild's roles.
652    GetGuildRoles {
653        /// The ID of the guild.
654        guild_id: u64,
655    },
656    /// Route information to get a guild scheduled event.
657    GetGuildScheduledEvent {
658        /// ID of the guild.
659        guild_id: u64,
660        // ID of the scheduled event.
661        scheduled_event_id: u64,
662        /// Whether to include user counts.
663        with_user_count: bool,
664    },
665    /// Route information to get a guild scheduled event's members.
666    GetGuildScheduledEventUsers {
667        /// Get members after this ID.
668        after: Option<u64>,
669        /// Get members before this ID.
670        before: Option<u64>,
671        /// ID of the guild.
672        guild_id: u64,
673        /// Maximum amount of members to get.
674        limit: Option<u16>,
675        /// ID of the scheduled event.
676        scheduled_event_id: u64,
677        /// Whether to return a member object.
678        with_member: bool,
679    },
680    /// Route information to get a guild's scheduled events.
681    GetGuildScheduledEvents {
682        /// ID of the guild.
683        guild_id: u64,
684        /// Whether to include user counts.
685        with_user_count: bool,
686    },
687    /// Route information to get a guild's sticker.
688    GetGuildSticker {
689        /// ID of the guild.
690        guild_id: u64,
691        /// ID of the stickers.
692        sticker_id: u64,
693    },
694    /// Route information to get a guild's stickers.
695    GetGuildStickers {
696        /// ID of the guild.
697        guild_id: u64,
698    },
699    /// Route information to get a guild's vanity URL.
700    GetGuildVanityUrl {
701        /// The ID of the guild.
702        guild_id: u64,
703    },
704    /// Route information to get a guild's available voice regions.
705    GetGuildVoiceRegions {
706        /// The ID of the guild.
707        guild_id: u64,
708    },
709    /// Route information to get a guild's webhooks.
710    GetGuildWebhooks {
711        /// The ID of the guild.
712        guild_id: u64,
713    },
714    /// Route information to get a guild's welcome screen.
715    GetGuildWelcomeScreen {
716        /// ID of the guild.
717        guild_id: u64,
718    },
719    /// Route information to get a guild's widget.
720    GetGuildWidget {
721        /// ID of the guild.
722        guild_id: u64,
723    },
724    /// Route information to get a guild's widget settings.
725    GetGuildWidgetSettings {
726        /// ID of the guild.
727        guild_id: u64,
728    },
729    /// Route information to get a paginated list of guilds.
730    GetGuilds {
731        /// The minimum ID of guilds to get.
732        after: Option<u64>,
733        /// The maximum ID of guilds to get.
734        before: Option<u64>,
735        /// The maximum number of guilds to get.
736        limit: Option<u16>,
737    },
738    /// Route information to get an original interaction response message.
739    GetInteractionOriginal {
740        /// ID of the owner application.
741        application_id: u64,
742        /// Token of the interaction.
743        interaction_token: &'a str,
744    },
745    /// Route information to get an invite.
746    GetInvite {
747        /// The unique invite code.
748        code: &'a str,
749        /// Whether to retrieve statistics about the invite.
750        with_counts: bool,
751    },
752    /// Route information to get an invite with an expiration.
753    GetInviteWithExpiration {
754        /// The unique invite code.
755        code: &'a str,
756        /// Whether to retrieve statistics about the invite.
757        with_counts: bool,
758        /// Whether to retrieve the expiration date of the invite.
759        with_expiration: bool,
760    },
761    /// Route information to get joined private archived threads in a channel.
762    GetJoinedPrivateArchivedThreads {
763        /// Optional timestamp to return threads before.
764        before: Option<u64>,
765        /// ID of the channel.
766        channel_id: u64,
767        /// Optional maximum number of threads to return.
768        limit: Option<u64>,
769    },
770    /// Route information to get a member.
771    GetMember {
772        /// The ID of the guild.
773        guild_id: u64,
774        /// The ID of the user.
775        user_id: u64,
776    },
777    /// Route information to get a single message in a channel.
778    GetMessage {
779        /// The ID of the channel.
780        channel_id: u64,
781        /// The ID of the message.
782        message_id: u64,
783    },
784    /// Route information to get a paginated list of messages in a channel.
785    GetMessages {
786        /// The minimum ID of messages to get.
787        after: Option<u64>,
788        /// The message ID to get the messages around.
789        around: Option<u64>,
790        /// The maximum ID of messages to get.
791        before: Option<u64>,
792        /// The ID of the channel.
793        channel_id: u64,
794        /// The maximum number of messages to get.
795        limit: Option<u16>,
796    },
797    /// Route information to get a list of sticker packs available to Nitro
798    /// subscribers.
799    GetNitroStickerPacks,
800    /// Route information to get a channel's pins.
801    GetPins {
802        /// The ID of the channel.
803        channel_id: u64,
804        /// Optionally the limit of pins to show in the response. (1-50) (default: 50)
805        limit: Option<u16>,
806        /// Optionally the timestamp as a filter to only show pins before the provided timestamp.
807        before: Option<String>,
808    },
809    /// Route information to get private archived threads in a channel.
810    GetPrivateArchivedThreads {
811        /// Optional timestamp to return threads before.
812        before: Option<&'a str>,
813        /// ID of the channel.
814        channel_id: u64,
815        /// Optional maximum number of threads to return.
816        limit: Option<u64>,
817    },
818    /// Route information to get public archived threads in a channel.
819    GetPublicArchivedThreads {
820        /// Optional timestamp to return threads before.
821        before: Option<&'a str>,
822        /// ID of the channel.
823        channel_id: u64,
824        /// Optional maximum number of threads to return.
825        limit: Option<u64>,
826    },
827    /// Route information to get the users who reacted to a message with a
828    /// specified emoji.
829    GetReactionUsers {
830        /// The minimum ID of users to get.
831        after: Option<u64>,
832        /// The ID of the channel.
833        channel_id: u64,
834        /// The URI encoded custom or unicode emoji.
835        emoji: &'a RequestReactionType<'a>,
836        /// The maximum number of users to retrieve.
837        limit: Option<u16>,
838        /// The ID of the message.
839        message_id: u64,
840        /// The type of reactions to fetch.
841        kind: Option<u8>,
842    },
843    /// Route information to get a guild's role.
844    GetRole {
845        /// The ID of the guild.
846        guild_id: u64,
847        /// The ID of the role.
848        role_id: u64,
849    },
850    GetSKUs {
851        /// The ID of the application.
852        application_id: u64,
853    },
854    /// Route information to get a stage instance.
855    GetStageInstance {
856        /// ID of the stage channel.
857        channel_id: u64,
858    },
859    /// Route information to get a sticker.
860    GetSticker {
861        /// ID of the sticker.
862        sticker_id: u64,
863    },
864    /// Route information to get a template.
865    GetTemplate {
866        /// The template code.
867        template_code: &'a str,
868    },
869    /// Route information to get a list of templates from a guild.
870    GetTemplates {
871        /// The ID of the guild.
872        guild_id: u64,
873    },
874    /// Route information to get a member of a thread.
875    GetThreadMember {
876        /// ID of the thread.
877        channel_id: u64,
878        /// ID of the member.
879        user_id: u64,
880    },
881    /// Route information to get members of a thread.
882    GetThreadMembers {
883        /// Fetch thread members after this user ID.
884        after: Option<u64>,
885        /// ID of the thread.
886        channel_id: u64,
887        /// Maximum number of thread members to return.
888        ///
889        /// Must be between 1 and 100. Defaults to 100.
890        limit: Option<u32>,
891        /// Whether to include associated member objects.
892        with_member: Option<bool>,
893    },
894    /// Route information to get a user.
895    GetUser {
896        /// ID of the target user.
897        user_id: u64,
898    },
899    /// Route information to get the current user's connections.
900    GetUserConnections,
901    /// Route information to get the current user's private channels and groups.
902    GetUserPrivateChannels,
903    /// Route information to get a user's voice state.
904    GetUserVoiceState {
905        /// The ID of the guild.
906        guild_id: u64,
907        /// ID of the target user.
908        user_id: u64,
909    },
910    /// Route information to get a list of the voice regions.
911    GetVoiceRegions,
912    /// Route information to get a webhook by ID, optionally with a token if the
913    /// current user doesn't have access to it.
914    GetWebhook {
915        /// The token of the webhook.
916        token: Option<&'a str>,
917        /// The ID of the webhook.
918        webhook_id: u64,
919    },
920    /// Route information to get a previously-sent webhook message.
921    GetWebhookMessage {
922        /// ID of the message.
923        message_id: u64,
924        /// ID of the thread channel, if there is one.
925        thread_id: Option<u64>,
926        /// Token of the webhook.
927        token: &'a str,
928        /// ID of the webhook.
929        webhook_id: u64,
930    },
931    /// Route information to respond to an interaction.
932    InteractionCallback {
933        /// The ID of the interaction.
934        interaction_id: u64,
935        /// The token for the interaction.
936        interaction_token: &'a str,
937        /// If response should be retrieved.
938        with_response: bool,
939    },
940    /// Route information to join a thread as the current user.
941    JoinThread {
942        /// ID of the thread.
943        channel_id: u64,
944    },
945    /// Route information to leave the guild.
946    LeaveGuild {
947        /// The ID of the guild.
948        guild_id: u64,
949    },
950    /// Route information to leave a thread as the current user.
951    LeaveThread {
952        /// ID of the thread.
953        channel_id: u64,
954    },
955    /// Route information to pin a message to a channel.
956    PinMessage {
957        /// The ID of the channel.
958        channel_id: u64,
959        /// The ID of the message.
960        message_id: u64,
961    },
962    /// Route information to remove a member from a guild.
963    RemoveMember {
964        /// The ID of the guild.
965        guild_id: u64,
966        /// The ID of the user.
967        user_id: u64,
968    },
969    /// Route information to remove a role from a member.
970    RemoveMemberRole {
971        /// The ID of the guild.
972        guild_id: u64,
973        /// The ID of the role.
974        role_id: u64,
975        /// The ID of the user.
976        user_id: u64,
977    },
978    /// Route information to remove a member from a thread.
979    RemoveThreadMember {
980        /// ID of the thread.
981        channel_id: u64,
982        /// ID of the member.
983        user_id: u64,
984    },
985    /// Route information to search for members in a guild.
986    SearchGuildMembers {
987        /// ID of the guild to search in.
988        guild_id: u64,
989        /// Upper limit of members to query for.
990        limit: Option<u16>,
991        /// Query to search by.
992        query: &'a str,
993    },
994    /// Route information to set global commands.
995    SetGlobalCommands {
996        /// The ID of the owner application.
997        application_id: u64,
998    },
999    /// Route information to set guild commands.
1000    SetGuildCommands {
1001        /// The ID of the owner application.
1002        application_id: u64,
1003        /// The ID of the guild.
1004        guild_id: u64,
1005    },
1006    /// Route information to sync a guild's integration.
1007    SyncGuildIntegration {
1008        /// The ID of the guild.
1009        guild_id: u64,
1010        /// The ID of the integration.
1011        integration_id: u64,
1012    },
1013    /// Route information to sync a template.
1014    SyncTemplate {
1015        /// The ID of the guild.
1016        guild_id: u64,
1017        /// The template code.
1018        template_code: &'a str,
1019    },
1020    /// Route information to unpin a message from a channel.
1021    UnpinMessage {
1022        /// The ID of the channel.
1023        channel_id: u64,
1024        /// The ID of the message.
1025        message_id: u64,
1026    },
1027    /// Route information to update an auto moderation rule for a guild.
1028    UpdateAutoModerationRule {
1029        /// ID of the auto moderation rule.
1030        auto_moderation_rule_id: u64,
1031        /// ID of the guild.
1032        guild_id: u64,
1033    },
1034    /// Route information to update a channel, such as a guild channel or group.
1035    UpdateChannel {
1036        /// The ID of the channel.
1037        channel_id: u64,
1038    },
1039    /// Route information to edit permissions of a command in a guild.
1040    UpdateCommandPermissions {
1041        /// The ID of the application.
1042        application_id: u64,
1043        /// The ID of the command.
1044        command_id: u64,
1045        /// The ID of the guild.
1046        guild_id: u64,
1047    },
1048    /// Route information to update the current member.
1049    UpdateCurrentMember {
1050        /// ID of the guild.
1051        guild_id: u64,
1052    },
1053    /// Route information to update the current user.
1054    UpdateCurrentUser,
1055    /// Route information to update the current user's voice state.
1056    UpdateCurrentUserVoiceState {
1057        /// ID of the guild.
1058        guild_id: u64,
1059    },
1060    /// Route information to update an emoji.
1061    UpdateEmoji {
1062        /// The ID of the emoji.
1063        emoji_id: u64,
1064        /// The ID of the guild.
1065        guild_id: u64,
1066    },
1067    /// Route information to update a global command.
1068    UpdateGlobalCommand {
1069        /// The ID of the owner application.
1070        application_id: u64,
1071        /// The ID of the command.
1072        command_id: u64,
1073    },
1074    /// Route information to update a guild.
1075    UpdateGuild {
1076        /// The ID of the guild.
1077        guild_id: u64,
1078    },
1079    /// Route information to update a guild channel.
1080    UpdateGuildChannels {
1081        /// The ID of the guild.
1082        guild_id: u64,
1083    },
1084    /// Route information to update a guild command.
1085    UpdateGuildCommand {
1086        /// The ID of the owner application.
1087        application_id: u64,
1088        /// The ID of the command.
1089        command_id: u64,
1090        /// The ID of the guild.
1091        guild_id: u64,
1092    },
1093    /// Route information to update a guild's integration.
1094    UpdateGuildIntegration {
1095        /// The ID of the guild.
1096        guild_id: u64,
1097        /// The ID of the integration.
1098        integration_id: u64,
1099    },
1100    /// Route information to update a guild's MFA level.
1101    UpdateGuildMfa {
1102        /// ID of the guild.
1103        guild_id: u64,
1104    },
1105    UpdateGuildOnboarding {
1106        /// The ID of the guild to update onboarding information for.
1107        guild_id: u64,
1108    },
1109    /// Route information to update a scheduled event in a guild.
1110    UpdateGuildScheduledEvent {
1111        /// ID of the guild.
1112        guild_id: u64,
1113        /// ID of the scheduled event.
1114        scheduled_event_id: u64,
1115    },
1116    /// Route information to update a guild sticker.
1117    UpdateGuildSticker {
1118        /// ID of the guild.
1119        guild_id: u64,
1120        /// ID of the sticker.
1121        sticker_id: u64,
1122    },
1123    /// Route information to update a guild's welcome screen.
1124    UpdateGuildWelcomeScreen {
1125        /// ID of the guild.
1126        guild_id: u64,
1127    },
1128    /// Route information to update a guild's widget settings.
1129    UpdateGuildWidgetSettings {
1130        /// ID of the guild.
1131        guild_id: u64,
1132    },
1133    /// Update the original interaction response.
1134    UpdateInteractionOriginal {
1135        /// The ID of the owner application.
1136        application_id: u64,
1137        /// The token for the interaction.
1138        interaction_token: &'a str,
1139    },
1140    /// Route information to update a member.
1141    UpdateMember {
1142        /// The ID of the guild.
1143        guild_id: u64,
1144        /// The ID of the user.
1145        user_id: u64,
1146    },
1147    /// Route information to update a message.
1148    UpdateMessage {
1149        /// The ID of the channel.
1150        channel_id: u64,
1151        /// The ID of the message.
1152        message_id: u64,
1153    },
1154    /// Route information to update the current member's nickname.
1155    UpdateNickname {
1156        /// The ID of the guild.
1157        guild_id: u64,
1158    },
1159    /// Route information to update the permission overwrite of a role or user
1160    /// in a channel.
1161    UpdatePermissionOverwrite {
1162        /// The ID of the channel.
1163        channel_id: u64,
1164        /// The ID of the role or user.
1165        target_id: u64,
1166    },
1167    /// Route information to update a role.
1168    UpdateRole {
1169        /// The ID of the guild.
1170        guild_id: u64,
1171        /// The ID of the role.
1172        role_id: u64,
1173    },
1174    /// Route information to update the positions of roles.
1175    UpdateRolePositions {
1176        /// The ID of the guild.
1177        guild_id: u64,
1178    },
1179    /// Route information to update an existing stage instance.
1180    UpdateStageInstance {
1181        /// ID of the stage channel.
1182        channel_id: u64,
1183    },
1184    /// Route information to update a template.
1185    UpdateTemplate {
1186        /// The ID of the guild.
1187        guild_id: u64,
1188        /// The template code.
1189        template_code: &'a str,
1190    },
1191    /// Route information to update a user's voice state.
1192    UpdateUserVoiceState {
1193        /// ID of the guild.
1194        guild_id: u64,
1195        /// ID of the user.
1196        user_id: u64,
1197    },
1198    /// Route information to update a webhook.
1199    UpdateWebhook {
1200        /// The token of the webhook.
1201        token: Option<&'a str>,
1202        /// The ID of the webhook.
1203        webhook_id: u64,
1204    },
1205    /// Route information to update a message created by a webhook.
1206    UpdateWebhookMessage {
1207        message_id: u64,
1208        /// ID of the thread channel, if there is one.
1209        thread_id: Option<u64>,
1210        token: &'a str,
1211        webhook_id: u64,
1212    },
1213    UpdateCurrentUserApplication,
1214}
1215
1216impl Route<'_> {
1217    /// HTTP method of the route.
1218    ///
1219    /// # Examples
1220    ///
1221    /// Assert that the [`GetGuild`] route returns [`Method::Get`]:
1222    ///
1223    /// ```
1224    /// use twilight_http::{request::Method, routing::Route};
1225    ///
1226    /// let route = Route::GetGuild {
1227    ///     guild_id: 123,
1228    ///     with_counts: false,
1229    /// };
1230    ///
1231    /// assert_eq!(Method::Get, route.method());
1232    /// ```
1233    ///
1234    /// [`GetGuild`]: Self::GetGuild
1235    #[allow(clippy::too_many_lines)]
1236    pub const fn method(&self) -> Method {
1237        match self {
1238            Self::DeleteAutoModerationRule { .. }
1239            | Self::DeleteApplicationEmoji { .. }
1240            | Self::DeleteBan { .. }
1241            | Self::DeleteChannel { .. }
1242            | Self::DeleteEmoji { .. }
1243            | Self::DeleteGlobalCommand { .. }
1244            | Self::DeleteGuild { .. }
1245            | Self::DeleteGuildCommand { .. }
1246            | Self::DeleteGuildIntegration { .. }
1247            | Self::DeleteGuildScheduledEvent { .. }
1248            | Self::DeleteGuildSticker { .. }
1249            | Self::DeleteTestEntitlement { .. }
1250            | Self::DeleteInteractionOriginal { .. }
1251            | Self::DeleteInvite { .. }
1252            | Self::DeleteMessageReactions { .. }
1253            | Self::DeleteMessageSpecificReaction { .. }
1254            | Self::DeleteMessage { .. }
1255            | Self::DeletePermissionOverwrite { .. }
1256            | Self::DeleteReactionCurrentUser { .. }
1257            | Self::DeleteReaction { .. }
1258            | Self::DeleteRole { .. }
1259            | Self::DeleteStageInstance { .. }
1260            | Self::DeleteTemplate { .. }
1261            | Self::DeleteWebhookMessage { .. }
1262            | Self::DeleteWebhook { .. }
1263            | Self::LeaveGuild { .. }
1264            | Self::LeaveThread { .. }
1265            | Self::RemoveMember { .. }
1266            | Self::RemoveMemberRole { .. }
1267            | Self::RemoveThreadMember { .. }
1268            | Self::UnpinMessage { .. } => Method::Delete,
1269            Self::GetActiveThreads { .. }
1270            | Self::GetApplicationEmojis { .. }
1271            | Self::GetAnswerVoters { .. }
1272            | Self::GetAuditLogs { .. }
1273            | Self::GetAutoModerationRule { .. }
1274            | Self::GetBan { .. }
1275            | Self::GetBans { .. }
1276            | Self::GetBansWithParameters { .. }
1277            | Self::GetGatewayBot
1278            | Self::GetChannel { .. }
1279            | Self::GetChannelInvites { .. }
1280            | Self::GetChannelWebhooks { .. }
1281            | Self::GetChannels { .. }
1282            | Self::GetCommandPermissions { .. }
1283            | Self::GetCurrentAuthorizationInformation
1284            | Self::GetCurrentUserApplicationInfo
1285            | Self::GetCurrentUser
1286            | Self::GetCurrentUserGuildMember { .. }
1287            | Self::GetCurrentUserVoiceState { .. }
1288            | Self::GetEmoji { .. }
1289            | Self::GetEmojis { .. }
1290            | Self::GetEntitlements { .. }
1291            | Self::GetGateway
1292            | Self::GetFollowupMessage { .. }
1293            | Self::GetGlobalCommand { .. }
1294            | Self::GetGlobalCommands { .. }
1295            | Self::GetGuild { .. }
1296            | Self::GetGuildAutoModerationRules { .. }
1297            | Self::GetGuildCommand { .. }
1298            | Self::GetGuildCommandPermissions { .. }
1299            | Self::GetGuildCommands { .. }
1300            | Self::GetGuildIntegrations { .. }
1301            | Self::GetGuildInvites { .. }
1302            | Self::GetGuildMembers { .. }
1303            | Self::GetGuildOnboarding { .. }
1304            | Self::GetGuildPreview { .. }
1305            | Self::GetGuildPruneCount { .. }
1306            | Self::GetGuildRoles { .. }
1307            | Self::GetGuildScheduledEvent { .. }
1308            | Self::GetGuildScheduledEventUsers { .. }
1309            | Self::GetGuildScheduledEvents { .. }
1310            | Self::GetGuildSticker { .. }
1311            | Self::GetGuildStickers { .. }
1312            | Self::GetGuildVanityUrl { .. }
1313            | Self::GetGuildVoiceRegions { .. }
1314            | Self::GetGuildWelcomeScreen { .. }
1315            | Self::GetGuildWebhooks { .. }
1316            | Self::GetGuildWidget { .. }
1317            | Self::GetGuildWidgetSettings { .. }
1318            | Self::GetGuilds { .. }
1319            | Self::GetInteractionOriginal { .. }
1320            | Self::GetInvite { .. }
1321            | Self::GetInviteWithExpiration { .. }
1322            | Self::GetMember { .. }
1323            | Self::GetMessage { .. }
1324            | Self::GetMessages { .. }
1325            | Self::GetNitroStickerPacks { .. }
1326            | Self::GetPins { .. }
1327            | Self::GetJoinedPrivateArchivedThreads { .. }
1328            | Self::GetPrivateArchivedThreads { .. }
1329            | Self::GetPublicArchivedThreads { .. }
1330            | Self::GetReactionUsers { .. }
1331            | Self::GetRole { .. }
1332            | Self::GetSKUs { .. }
1333            | Self::GetStageInstance { .. }
1334            | Self::GetSticker { .. }
1335            | Self::GetTemplate { .. }
1336            | Self::GetTemplates { .. }
1337            | Self::GetThreadMember { .. }
1338            | Self::GetThreadMembers { .. }
1339            | Self::GetUser { .. }
1340            | Self::GetUserConnections
1341            | Self::GetUserPrivateChannels
1342            | Self::GetUserVoiceState { .. }
1343            | Self::GetVoiceRegions
1344            | Self::GetWebhook { .. }
1345            | Self::GetWebhookMessage { .. }
1346            | Self::SearchGuildMembers { .. } => Method::Get,
1347            Self::UpdateAutoModerationRule { .. }
1348            | Self::UpdateChannel { .. }
1349            | Self::UpdateCurrentMember { .. }
1350            | Self::UpdateCurrentUser
1351            | Self::UpdateCurrentUserVoiceState { .. }
1352            | Self::UpdateEmoji { .. }
1353            | Self::UpdateGlobalCommand { .. }
1354            | Self::UpdateGuild { .. }
1355            | Self::UpdateGuildChannels { .. }
1356            | Self::UpdateGuildCommand { .. }
1357            | Self::UpdateGuildMfa { .. }
1358            | Self::UpdateGuildWidgetSettings { .. }
1359            | Self::UpdateGuildIntegration { .. }
1360            | Self::UpdateGuildScheduledEvent { .. }
1361            | Self::UpdateGuildSticker { .. }
1362            | Self::UpdateGuildWelcomeScreen { .. }
1363            | Self::UpdateInteractionOriginal { .. }
1364            | Self::UpdateMember { .. }
1365            | Self::UpdateMessage { .. }
1366            | Self::UpdateNickname { .. }
1367            | Self::UpdateRole { .. }
1368            | Self::UpdateRolePositions { .. }
1369            | Self::UpdateStageInstance { .. }
1370            | Self::UpdateTemplate { .. }
1371            | Self::UpdateUserVoiceState { .. }
1372            | Self::UpdateWebhookMessage { .. }
1373            | Self::UpdateCurrentUserApplication
1374            | Self::UpdateApplicationEmoji { .. }
1375            | Self::UpdateWebhook { .. } => Method::Patch,
1376            Self::CreateChannel { .. }
1377            | Self::AddApplicationEmoji { .. }
1378            | Self::CreateGlobalCommand { .. }
1379            | Self::CreateGuildCommand { .. }
1380            | Self::CreateEmoji { .. }
1381            | Self::CreateForumThread { .. }
1382            | Self::CreateGuild
1383            | Self::CreateAutoModerationRule { .. }
1384            | Self::CreateGuildFromTemplate { .. }
1385            | Self::CreateGuildIntegration { .. }
1386            | Self::CreateGuildPrune { .. }
1387            | Self::CreateGuildScheduledEvent { .. }
1388            | Self::CreateGuildSticker { .. }
1389            | Self::CreateInvite { .. }
1390            | Self::CreateMessage { .. }
1391            | Self::CreatePrivateChannel
1392            | Self::CreateThread { .. }
1393            | Self::CreateThreadFromMessage { .. }
1394            | Self::CreateRole { .. }
1395            | Self::CreateStageInstance { .. }
1396            | Self::CreateTemplate { .. }
1397            | Self::CreateTestEntitlement { .. }
1398            | Self::CreateTypingTrigger { .. }
1399            | Self::CreateWebhook { .. }
1400            | Self::CrosspostMessage { .. }
1401            | Self::DeleteMessages { .. }
1402            | Self::EndPoll { .. }
1403            | Self::ExecuteWebhook { .. }
1404            | Self::FollowNewsChannel { .. }
1405            | Self::InteractionCallback { .. }
1406            | Self::SyncGuildIntegration { .. } => Method::Post,
1407            Self::AddGuildMember { .. }
1408            | Self::AddMemberRole { .. }
1409            | Self::AddThreadMember { .. }
1410            | Self::CreateBan { .. }
1411            | Self::CreateReaction { .. }
1412            | Self::JoinThread { .. }
1413            | Self::PinMessage { .. }
1414            | Self::SetGlobalCommands { .. }
1415            | Self::SetGuildCommands { .. }
1416            | Self::SyncTemplate { .. }
1417            | Self::UpdateCommandPermissions { .. }
1418            | Self::UpdateGuildOnboarding { .. }
1419            | Self::UpdatePermissionOverwrite { .. } => Method::Put,
1420        }
1421    }
1422}
1423
1424/// Display formatter of the route portion of a URL.
1425///
1426/// # Examples
1427///
1428/// Create a formatted representation of the [`GetPins`] route:
1429///
1430/// ```
1431/// use twilight_http::routing::Route;
1432///
1433/// let route = Route::GetPins {
1434///     channel_id: 123,
1435///     limit: None,
1436///     before: None,
1437/// };
1438/// assert_eq!("channels/123/messages/pins", route.to_string());
1439/// ```
1440///
1441/// Create a formatted representation of the [`GetInvite`] route, which
1442/// includes a query parameter:
1443///
1444/// ```
1445/// use twilight_http::routing::Route;
1446///
1447/// let route = Route::GetInvite {
1448///     code: "twilight-rs",
1449///     with_counts: true,
1450/// };
1451///
1452/// assert_eq!("invites/twilight-rs?with_counts=true", route.to_string());
1453/// ```
1454///
1455/// [`GetInvite`]: Self::GetInvite
1456/// [`GetPins`]: Self::GetPins
1457impl Display for Route<'_> {
1458    // Notably, we don't use macros like `write!` or `format_args!` due to them
1459    // both compiling slowly and performing slowly during runtime.
1460    //
1461    // See:
1462    // <https://github.com/rust-lang/rust/issues/76490>
1463    // <https://github.com/rust-lang/rust/issues/10761>
1464    #[allow(clippy::too_many_lines)]
1465    fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
1466        match self {
1467            Route::AddGuildMember { guild_id, user_id }
1468            | Route::GetMember { guild_id, user_id }
1469            | Route::RemoveMember { guild_id, user_id }
1470            | Route::UpdateMember { guild_id, user_id } => {
1471                f.write_str("guilds/")?;
1472                Display::fmt(guild_id, f)?;
1473                f.write_str("/members/")?;
1474
1475                Display::fmt(user_id, f)
1476            }
1477            Route::AddMemberRole {
1478                guild_id,
1479                role_id,
1480                user_id,
1481            }
1482            | Route::RemoveMemberRole {
1483                guild_id,
1484                role_id,
1485                user_id,
1486            } => {
1487                f.write_str("guilds/")?;
1488                Display::fmt(guild_id, f)?;
1489                f.write_str("/members/")?;
1490                Display::fmt(user_id, f)?;
1491                f.write_str("/roles/")?;
1492
1493                Display::fmt(role_id, f)
1494            }
1495            Route::AddThreadMember {
1496                channel_id,
1497                user_id,
1498            }
1499            | Route::GetThreadMember {
1500                channel_id,
1501                user_id,
1502            }
1503            | Route::RemoveThreadMember {
1504                channel_id,
1505                user_id,
1506            } => {
1507                f.write_str("channels/")?;
1508                Display::fmt(channel_id, f)?;
1509                f.write_str("/thread-members/")?;
1510
1511                Display::fmt(user_id, f)
1512            }
1513            Route::CreateAutoModerationRule { guild_id, .. }
1514            | Route::GetGuildAutoModerationRules { guild_id, .. } => {
1515                f.write_str("guilds/")?;
1516                Display::fmt(guild_id, f)?;
1517
1518                f.write_str("/auto-moderation/rules")
1519            }
1520            Route::CreateChannel { guild_id }
1521            | Route::GetChannels { guild_id }
1522            | Route::UpdateGuildChannels { guild_id } => {
1523                f.write_str("guilds/")?;
1524                Display::fmt(guild_id, f)?;
1525
1526                f.write_str("/channels")
1527            }
1528            Route::CreateEmoji { guild_id } | Route::GetEmojis { guild_id } => {
1529                f.write_str("guilds/")?;
1530                Display::fmt(guild_id, f)?;
1531
1532                f.write_str("/emojis")
1533            }
1534            Route::CreateGlobalCommand { application_id }
1535            | Route::SetGlobalCommands { application_id } => {
1536                f.write_str("applications/")?;
1537                Display::fmt(application_id, f)?;
1538
1539                f.write_str("/commands")
1540            }
1541            Route::DeleteAutoModerationRule {
1542                auto_moderation_rule_id,
1543                guild_id,
1544                ..
1545            }
1546            | Route::GetAutoModerationRule {
1547                auto_moderation_rule_id,
1548                guild_id,
1549                ..
1550            }
1551            | Route::UpdateAutoModerationRule {
1552                auto_moderation_rule_id,
1553                guild_id,
1554                ..
1555            } => {
1556                f.write_str("guilds/")?;
1557                Display::fmt(guild_id, f)?;
1558                f.write_str("/auto-moderation/rules/")?;
1559
1560                Display::fmt(auto_moderation_rule_id, f)
1561            }
1562            Route::GetAnswerVoters {
1563                after,
1564                answer_id,
1565                channel_id,
1566                limit,
1567                message_id,
1568            } => {
1569                f.write_str("channels/")?;
1570                Display::fmt(channel_id, f)?;
1571                f.write_str("/polls/")?;
1572                Display::fmt(message_id, f)?;
1573                f.write_str("/answers/")?;
1574                Display::fmt(answer_id, f)?;
1575                f.write_str("?")?;
1576
1577                let mut writer = QueryStringFormatter::new(f);
1578                writer.write_opt_param("after", after.as_ref())?;
1579                writer.write_opt_param("limit", limit.as_ref())
1580            }
1581            Route::GetGlobalCommands {
1582                application_id,
1583                with_localizations,
1584            } => {
1585                f.write_str("applications/")?;
1586                Display::fmt(application_id, f)?;
1587                f.write_str("/commands")?;
1588
1589                let mut writer = QueryStringFormatter::new(f);
1590
1591                writer.write_opt_param("with_localizations", with_localizations.as_ref())
1592            }
1593            Route::CreateGuild => f.write_str("guilds"),
1594            Route::CreateGuildCommand {
1595                application_id,
1596                guild_id,
1597            }
1598            | Route::SetGuildCommands {
1599                application_id,
1600                guild_id,
1601            } => {
1602                f.write_str("applications/")?;
1603                Display::fmt(application_id, f)?;
1604                f.write_str("/guilds/")?;
1605                Display::fmt(guild_id, f)?;
1606
1607                f.write_str("/commands")
1608            }
1609            Route::GetGuildCommands {
1610                application_id,
1611                guild_id,
1612                with_localizations,
1613            } => {
1614                f.write_str("applications/")?;
1615                Display::fmt(application_id, f)?;
1616                f.write_str("/guilds/")?;
1617                Display::fmt(guild_id, f)?;
1618                f.write_str("/commands")?;
1619
1620                let mut writer = QueryStringFormatter::new(f);
1621                writer.write_opt_param("with_localizations", with_localizations.as_ref())
1622            }
1623            Route::CreateGuildFromTemplate { template_code }
1624            | Route::GetTemplate { template_code } => {
1625                f.write_str("guilds/templates/")?;
1626
1627                f.write_str(template_code)
1628            }
1629            Route::CreateTestEntitlement { application_id } => {
1630                f.write_str("applications/")?;
1631                Display::fmt(application_id, f)?;
1632
1633                f.write_str("/entitlements")
1634            }
1635            Route::CreateGuildIntegration { guild_id }
1636            | Route::GetGuildIntegrations { guild_id } => {
1637                f.write_str("guilds/")?;
1638                Display::fmt(guild_id, f)?;
1639
1640                f.write_str("/integrations")
1641            }
1642            Route::CreateGuildPrune {
1643                compute_prune_count,
1644                days,
1645                guild_id,
1646                include_roles,
1647            } => {
1648                f.write_str("guilds/")?;
1649                Display::fmt(guild_id, f)?;
1650                f.write_str("/prune")?;
1651
1652                let mut writer = QueryStringFormatter::new(f);
1653
1654                writer.write_opt_param("compute_prune_count", compute_prune_count.as_ref())?;
1655                writer.write_opt_param("days", days.as_ref())?;
1656
1657                if !include_roles.is_empty() {
1658                    writer.write_param("include_roles", &QueryArray(*include_roles))?;
1659                }
1660
1661                Ok(())
1662            }
1663            Route::CreateGuildScheduledEvent { guild_id } => {
1664                f.write_str("guilds/")?;
1665                Display::fmt(guild_id, f)?;
1666
1667                f.write_str("/scheduled-events")
1668            }
1669            Route::CreateGuildSticker { guild_id, .. }
1670            | Route::GetGuildStickers { guild_id, .. } => {
1671                f.write_str("guilds/")?;
1672                Display::fmt(guild_id, f)?;
1673
1674                f.write_str("/stickers")
1675            }
1676            Route::CreateInvite { channel_id } | Route::GetChannelInvites { channel_id } => {
1677                f.write_str("channels/")?;
1678                Display::fmt(channel_id, f)?;
1679
1680                f.write_str("/invites")
1681            }
1682            Route::CreateMessage { channel_id } => {
1683                f.write_str("channels/")?;
1684                Display::fmt(channel_id, f)?;
1685
1686                f.write_str("/messages")
1687            }
1688            Route::CreatePrivateChannel | Route::GetUserPrivateChannels => {
1689                f.write_str("users/@me/channels")
1690            }
1691            Route::CreateReaction {
1692                channel_id,
1693                emoji,
1694                message_id,
1695            }
1696            | Route::DeleteReactionCurrentUser {
1697                channel_id,
1698                emoji,
1699                message_id,
1700            } => {
1701                f.write_str("channels/")?;
1702                Display::fmt(channel_id, f)?;
1703                f.write_str("/messages/")?;
1704                Display::fmt(message_id, f)?;
1705                f.write_str("/reactions/")?;
1706                Display::fmt(&emoji, f)?;
1707
1708                f.write_str("/@me")
1709            }
1710            Route::CreateRole { guild_id }
1711            | Route::GetGuildRoles { guild_id }
1712            | Route::UpdateRolePositions { guild_id } => {
1713                f.write_str("guilds/")?;
1714                Display::fmt(guild_id, f)?;
1715
1716                f.write_str("/roles")
1717            }
1718            Route::CreateStageInstance { .. } => f.write_str("stage-instances"),
1719            Route::CreateTemplate { guild_id } | Route::GetTemplates { guild_id } => {
1720                f.write_str("guilds/")?;
1721                Display::fmt(guild_id, f)?;
1722
1723                f.write_str("/templates")
1724            }
1725            Route::CreateForumThread { channel_id } | Route::CreateThread { channel_id } => {
1726                f.write_str("channels/")?;
1727                Display::fmt(channel_id, f)?;
1728
1729                f.write_str("/threads")
1730            }
1731            Route::CreateThreadFromMessage {
1732                channel_id,
1733                message_id,
1734            } => {
1735                f.write_str("channels/")?;
1736                Display::fmt(channel_id, f)?;
1737                f.write_str("/messages/")?;
1738                Display::fmt(message_id, f)?;
1739
1740                f.write_str("/threads")
1741            }
1742            Route::CreateTypingTrigger { channel_id } => {
1743                f.write_str("channels/")?;
1744                Display::fmt(channel_id, f)?;
1745
1746                f.write_str("/typing")
1747            }
1748            Route::CreateWebhook { channel_id } | Route::GetChannelWebhooks { channel_id } => {
1749                f.write_str("channels/")?;
1750                Display::fmt(channel_id, f)?;
1751
1752                f.write_str("/webhooks")
1753            }
1754            Route::CrosspostMessage {
1755                channel_id,
1756                message_id,
1757            } => {
1758                f.write_str("channels/")?;
1759                Display::fmt(channel_id, f)?;
1760                f.write_str("/messages/")?;
1761                Display::fmt(message_id, f)?;
1762
1763                f.write_str("/crosspost")
1764            }
1765            Route::DeleteBan { guild_id, user_id }
1766            | Route::GetBan { guild_id, user_id }
1767            | Route::CreateBan { guild_id, user_id } => {
1768                f.write_str("guilds/")?;
1769                Display::fmt(guild_id, f)?;
1770                f.write_str("/bans/")?;
1771
1772                Display::fmt(user_id, f)
1773            }
1774            Route::DeleteChannel { channel_id }
1775            | Route::GetChannel { channel_id }
1776            | Route::UpdateChannel { channel_id } => {
1777                f.write_str("channels/")?;
1778
1779                Display::fmt(channel_id, f)
1780            }
1781            Route::DeleteEmoji { emoji_id, guild_id }
1782            | Route::GetEmoji { emoji_id, guild_id }
1783            | Route::UpdateEmoji { emoji_id, guild_id } => {
1784                f.write_str("guilds/")?;
1785                Display::fmt(guild_id, f)?;
1786                f.write_str("/emojis/")?;
1787
1788                Display::fmt(emoji_id, f)
1789            }
1790            Route::GetEntitlements {
1791                after,
1792                application_id,
1793                before,
1794                exclude_ended,
1795                guild_id,
1796                limit,
1797                sku_ids,
1798                user_id,
1799            } => {
1800                f.write_str("applications/")?;
1801                Display::fmt(application_id, f)?;
1802                f.write_str("/entitlements")?;
1803
1804                f.write_str("?")?;
1805
1806                if let Some(after) = after {
1807                    f.write_str("after=")?;
1808                    Display::fmt(after, f)?;
1809                }
1810
1811                if let Some(before) = before {
1812                    f.write_str("&before=")?;
1813                    Display::fmt(before, f)?;
1814                }
1815
1816                if let Some(exclude_ended) = exclude_ended {
1817                    f.write_str("&exclude_ended=")?;
1818                    Display::fmt(exclude_ended, f)?;
1819                }
1820
1821                if let Some(guild_id) = guild_id {
1822                    f.write_str("&guild_id=")?;
1823                    Display::fmt(guild_id, f)?;
1824                }
1825
1826                if let Some(limit) = limit {
1827                    f.write_str("&limit=")?;
1828                    Display::fmt(limit, f)?;
1829                }
1830
1831                if !sku_ids.is_empty() {
1832                    let sku_id_count = sku_ids.len() - 1;
1833
1834                    f.write_str("&sku_ids=")?;
1835
1836                    for (idx, sku_id) in sku_ids.iter().enumerate() {
1837                        Display::fmt(sku_id, f)?;
1838
1839                        if idx < sku_id_count {
1840                            f.write_str(",")?;
1841                        }
1842                    }
1843                }
1844
1845                if let Some(user_id) = user_id {
1846                    f.write_str("&user_id=")?;
1847                    Display::fmt(user_id, f)?;
1848                }
1849
1850                Ok(())
1851            }
1852            Route::DeleteGlobalCommand {
1853                application_id,
1854                command_id,
1855            }
1856            | Route::GetGlobalCommand {
1857                application_id,
1858                command_id,
1859            }
1860            | Route::UpdateGlobalCommand {
1861                application_id,
1862                command_id,
1863            } => {
1864                f.write_str("applications/")?;
1865                Display::fmt(application_id, f)?;
1866                f.write_str("/commands/")?;
1867
1868                Display::fmt(command_id, f)
1869            }
1870            Route::DeleteGuild { guild_id } | Route::UpdateGuild { guild_id } => {
1871                f.write_str("guilds/")?;
1872
1873                Display::fmt(guild_id, f)
1874            }
1875            Route::DeleteGuildCommand {
1876                application_id,
1877                command_id,
1878                guild_id,
1879            }
1880            | Route::GetGuildCommand {
1881                application_id,
1882                command_id,
1883                guild_id,
1884            }
1885            | Route::UpdateGuildCommand {
1886                application_id,
1887                command_id,
1888                guild_id,
1889            } => {
1890                f.write_str("applications/")?;
1891                Display::fmt(application_id, f)?;
1892                f.write_str("/guilds/")?;
1893                Display::fmt(guild_id, f)?;
1894                f.write_str("/commands/")?;
1895
1896                Display::fmt(command_id, f)
1897            }
1898            Route::DeleteGuildIntegration {
1899                guild_id,
1900                integration_id,
1901            }
1902            | Route::UpdateGuildIntegration {
1903                guild_id,
1904                integration_id,
1905            } => {
1906                f.write_str("guilds/")?;
1907                Display::fmt(guild_id, f)?;
1908                f.write_str("/integrations/")?;
1909
1910                Display::fmt(integration_id, f)
1911            }
1912            Route::DeleteInteractionOriginal {
1913                application_id,
1914                interaction_token,
1915            }
1916            | Route::GetInteractionOriginal {
1917                application_id,
1918                interaction_token,
1919            }
1920            | Route::UpdateInteractionOriginal {
1921                application_id,
1922                interaction_token,
1923            } => {
1924                f.write_str("webhooks/")?;
1925                Display::fmt(application_id, f)?;
1926                f.write_str("/")?;
1927                f.write_str(interaction_token)?;
1928
1929                f.write_str("/messages/@original")
1930            }
1931            Route::DeleteInvite { code } => {
1932                f.write_str("invites/")?;
1933
1934                f.write_str(code)
1935            }
1936            Route::DeleteMessageReactions {
1937                channel_id,
1938                message_id,
1939            } => {
1940                f.write_str("channels/")?;
1941                Display::fmt(channel_id, f)?;
1942                f.write_str("/messages/")?;
1943                Display::fmt(message_id, f)?;
1944
1945                f.write_str("/reactions")
1946            }
1947            Route::DeleteMessageSpecificReaction {
1948                channel_id,
1949                message_id,
1950                emoji,
1951            } => {
1952                f.write_str("channels/")?;
1953                Display::fmt(channel_id, f)?;
1954                f.write_str("/messages/")?;
1955                Display::fmt(message_id, f)?;
1956                f.write_str("/reactions/")?;
1957
1958                Display::fmt(&emoji, f)
1959            }
1960            Route::DeleteMessage {
1961                channel_id,
1962                message_id,
1963            }
1964            | Route::GetMessage {
1965                channel_id,
1966                message_id,
1967            }
1968            | Route::UpdateMessage {
1969                channel_id,
1970                message_id,
1971            } => {
1972                f.write_str("channels/")?;
1973                Display::fmt(channel_id, f)?;
1974                f.write_str("/messages/")?;
1975
1976                Display::fmt(message_id, f)
1977            }
1978            Route::DeleteMessages { channel_id } => {
1979                f.write_str("channels/")?;
1980                Display::fmt(channel_id, f)?;
1981
1982                f.write_str("/messages/bulk-delete")
1983            }
1984            Route::DeletePermissionOverwrite {
1985                channel_id,
1986                target_id,
1987            }
1988            | Route::UpdatePermissionOverwrite {
1989                channel_id,
1990                target_id,
1991            } => {
1992                f.write_str("channels/")?;
1993                Display::fmt(channel_id, f)?;
1994                f.write_str("/permissions/")?;
1995
1996                Display::fmt(target_id, f)
1997            }
1998            Route::DeleteReaction {
1999                channel_id,
2000                emoji,
2001                message_id,
2002                user_id,
2003            } => {
2004                f.write_str("channels/")?;
2005                Display::fmt(channel_id, f)?;
2006                f.write_str("/messages/")?;
2007                Display::fmt(message_id, f)?;
2008                f.write_str("/reactions/")?;
2009                Display::fmt(&emoji, f)?;
2010                f.write_str("/")?;
2011
2012                Display::fmt(user_id, f)
2013            }
2014            Route::DeleteRole { guild_id, role_id }
2015            | Route::GetRole { guild_id, role_id }
2016            | Route::UpdateRole { guild_id, role_id } => {
2017                f.write_str("guilds/")?;
2018                Display::fmt(guild_id, f)?;
2019                f.write_str("/roles/")?;
2020
2021                Display::fmt(role_id, f)
2022            }
2023            Route::DeleteStageInstance { channel_id }
2024            | Route::GetStageInstance { channel_id }
2025            | Route::UpdateStageInstance { channel_id } => {
2026                f.write_str("stage-instances/")?;
2027
2028                Display::fmt(channel_id, f)
2029            }
2030            Route::DeleteTemplate {
2031                guild_id,
2032                template_code,
2033            }
2034            | Route::SyncTemplate {
2035                guild_id,
2036                template_code,
2037            }
2038            | Route::UpdateTemplate {
2039                guild_id,
2040                template_code,
2041            } => {
2042                f.write_str("guilds/")?;
2043                Display::fmt(guild_id, f)?;
2044                f.write_str("/templates/")?;
2045
2046                f.write_str(template_code)
2047            }
2048            Route::DeleteWebhookMessage {
2049                message_id,
2050                thread_id,
2051                token,
2052                webhook_id,
2053            }
2054            | Route::GetFollowupMessage {
2055                application_id: webhook_id,
2056                interaction_token: token,
2057                thread_id,
2058                message_id,
2059            }
2060            | Route::GetWebhookMessage {
2061                message_id,
2062                token,
2063                thread_id,
2064                webhook_id,
2065            }
2066            | Route::UpdateWebhookMessage {
2067                message_id,
2068                thread_id,
2069                token,
2070                webhook_id,
2071            } => {
2072                f.write_str("webhooks/")?;
2073                Display::fmt(webhook_id, f)?;
2074                f.write_str("/")?;
2075                f.write_str(token)?;
2076                f.write_str("/messages/")?;
2077                Display::fmt(message_id, f)?;
2078
2079                let mut query_formatter = QueryStringFormatter::new(f);
2080
2081                query_formatter.write_opt_param("thread_id", thread_id.as_ref())
2082            }
2083            Route::DeleteWebhook { token, webhook_id }
2084            | Route::GetWebhook { token, webhook_id }
2085            | Route::UpdateWebhook { token, webhook_id } => {
2086                f.write_str("webhooks/")?;
2087                Display::fmt(webhook_id, f)?;
2088
2089                if let Some(token) = token {
2090                    f.write_str("/")?;
2091                    f.write_str(token)?;
2092                }
2093
2094                Ok(())
2095            }
2096            Route::EndPoll {
2097                channel_id,
2098                message_id,
2099            } => {
2100                f.write_str("channels/")?;
2101                Display::fmt(channel_id, f)?;
2102                f.write_str("/polls/")?;
2103                Display::fmt(message_id, f)?;
2104
2105                f.write_str("/expire")
2106            }
2107            Route::ExecuteWebhook {
2108                thread_id,
2109                token,
2110                wait,
2111                with_components,
2112                webhook_id,
2113            } => {
2114                f.write_str("webhooks/")?;
2115                Display::fmt(webhook_id, f)?;
2116                f.write_str("/")?;
2117                f.write_str(token)?;
2118
2119                let mut query_formatter = QueryStringFormatter::new(f);
2120
2121                query_formatter.write_opt_param("thread_id", thread_id.as_ref())?;
2122                query_formatter.write_opt_param("wait", wait.as_ref())?;
2123                query_formatter.write_opt_param("with_components", with_components.as_ref())
2124            }
2125            Route::DeleteTestEntitlement {
2126                application_id,
2127                entitlement_id,
2128            } => {
2129                f.write_str("applications/")?;
2130                Display::fmt(application_id, f)?;
2131                f.write_str("/entitlements/")?;
2132
2133                Display::fmt(entitlement_id, f)
2134            }
2135            Route::FollowNewsChannel { channel_id } => {
2136                f.write_str("channels/")?;
2137                Display::fmt(channel_id, f)?;
2138
2139                f.write_str("/followers")
2140            }
2141            Route::GetActiveThreads { guild_id } => {
2142                f.write_str("guilds/")?;
2143                Display::fmt(guild_id, f)?;
2144
2145                f.write_str("/threads/active")
2146            }
2147            Route::DeleteApplicationEmoji {
2148                application_id,
2149                emoji_id,
2150            }
2151            | Route::UpdateApplicationEmoji {
2152                application_id,
2153                emoji_id,
2154            } => {
2155                f.write_str("applications/")?;
2156                Display::fmt(application_id, f)?;
2157                f.write_str("/emojis/")?;
2158
2159                Display::fmt(emoji_id, f)
2160            }
2161            Route::GetApplicationEmojis { application_id }
2162            | Route::AddApplicationEmoji { application_id } => {
2163                f.write_str("applications/")?;
2164                Display::fmt(application_id, f)?;
2165
2166                f.write_str("/emojis")
2167            }
2168            Route::GetAuditLogs {
2169                action_type,
2170                after,
2171                before,
2172                guild_id,
2173                limit,
2174                user_id,
2175            } => {
2176                f.write_str("guilds/")?;
2177                Display::fmt(guild_id, f)?;
2178                f.write_str("/audit-logs")?;
2179
2180                let mut query_formatter = QueryStringFormatter::new(f);
2181
2182                query_formatter.write_opt_param("action_type", action_type.as_ref())?;
2183                query_formatter.write_opt_param("after", after.as_ref())?;
2184                query_formatter.write_opt_param("before", before.as_ref())?;
2185                query_formatter.write_opt_param("limit", limit.as_ref())?;
2186                query_formatter.write_opt_param("user_id", user_id.as_ref())
2187            }
2188            Route::GetBans { guild_id } => {
2189                f.write_str("guilds/")?;
2190                Display::fmt(guild_id, f)?;
2191
2192                f.write_str("/bans")
2193            }
2194            Route::GetBansWithParameters {
2195                after,
2196                before,
2197                guild_id,
2198                limit,
2199            } => {
2200                f.write_str("guilds/")?;
2201                Display::fmt(guild_id, f)?;
2202                f.write_str("/bans")?;
2203
2204                let mut query_formatter = QueryStringFormatter::new(f);
2205
2206                query_formatter.write_opt_param("after", after.as_ref())?;
2207                query_formatter.write_opt_param("before", before.as_ref())?;
2208                query_formatter.write_opt_param("limit", limit.as_ref())
2209            }
2210            Route::GetGatewayBot => f.write_str("gateway/bot"),
2211            Route::GetCommandPermissions {
2212                application_id,
2213                command_id,
2214                guild_id,
2215            }
2216            | Route::UpdateCommandPermissions {
2217                application_id,
2218                command_id,
2219                guild_id,
2220            } => {
2221                f.write_str("applications/")?;
2222                Display::fmt(application_id, f)?;
2223                f.write_str("/guilds/")?;
2224                Display::fmt(guild_id, f)?;
2225                f.write_str("/commands/")?;
2226                Display::fmt(command_id, f)?;
2227
2228                f.write_str("/permissions")
2229            }
2230            Route::GetCurrentAuthorizationInformation => f.write_str("oauth2/@me"),
2231            Route::GetCurrentUserApplicationInfo | Route::UpdateCurrentUserApplication => {
2232                f.write_str("applications/@me")
2233            }
2234            Route::GetCurrentUser | Route::UpdateCurrentUser => f.write_str("users/@me"),
2235            Route::GetCurrentUserGuildMember { guild_id } => {
2236                f.write_str("users/@me/guilds/")?;
2237                Display::fmt(guild_id, f)?;
2238
2239                f.write_str("/member")
2240            }
2241            Route::GetGateway => f.write_str("gateway"),
2242            Route::GetGuild {
2243                guild_id,
2244                with_counts,
2245            } => {
2246                f.write_str("guilds/")?;
2247                Display::fmt(guild_id, f)?;
2248
2249                let mut query_formatter = QueryStringFormatter::new(f);
2250
2251                if *with_counts {
2252                    query_formatter.write_param("with_counts", &true)?;
2253                }
2254
2255                Ok(())
2256            }
2257            Route::GetGuildCommandPermissions {
2258                application_id,
2259                guild_id,
2260            } => {
2261                f.write_str("applications/")?;
2262                Display::fmt(application_id, f)?;
2263                f.write_str("/guilds/")?;
2264                Display::fmt(guild_id, f)?;
2265
2266                f.write_str("/commands/permissions")
2267            }
2268            Route::GetGuildInvites { guild_id } => {
2269                f.write_str("guilds/")?;
2270                Display::fmt(guild_id, f)?;
2271
2272                f.write_str("/invites")
2273            }
2274            Route::GetGuildMembers {
2275                after,
2276                guild_id,
2277                limit,
2278            } => {
2279                f.write_str("guilds/")?;
2280                Display::fmt(guild_id, f)?;
2281                f.write_str("/members")?;
2282
2283                let mut query_formatter = QueryStringFormatter::new(f);
2284
2285                query_formatter.write_opt_param("after", after.as_ref())?;
2286                query_formatter.write_opt_param("limit", limit.as_ref())
2287            }
2288            Route::GetGuildOnboarding { guild_id } | Route::UpdateGuildOnboarding { guild_id } => {
2289                f.write_str("guilds/")?;
2290                Display::fmt(guild_id, f)?;
2291
2292                f.write_str("/onboarding")
2293            }
2294            Route::GetGuildPreview { guild_id } => {
2295                f.write_str("guilds/")?;
2296                Display::fmt(guild_id, f)?;
2297
2298                f.write_str("/preview")
2299            }
2300            Route::GetGuildPruneCount {
2301                days,
2302                guild_id,
2303                include_roles,
2304            } => {
2305                f.write_str("guilds/")?;
2306                Display::fmt(guild_id, f)?;
2307                f.write_str("/prune")?;
2308
2309                let mut query_formatter = QueryStringFormatter::new(f);
2310
2311                query_formatter.write_opt_param("days", days.as_ref())?;
2312
2313                if !include_roles.is_empty() {
2314                    query_formatter.write_param("include_roles", &QueryArray(*include_roles))?;
2315                }
2316
2317                Ok(())
2318            }
2319            Route::GetGuildScheduledEvent {
2320                guild_id,
2321                scheduled_event_id,
2322                with_user_count,
2323            } => {
2324                f.write_str("guilds/")?;
2325                Display::fmt(guild_id, f)?;
2326                f.write_str("/scheduled-events/")?;
2327                Display::fmt(scheduled_event_id, f)?;
2328
2329                let mut query_formatter = QueryStringFormatter::new(f);
2330
2331                if *with_user_count {
2332                    query_formatter.write_param("with_user_count", &true)?;
2333                }
2334
2335                Ok(())
2336            }
2337            Route::GetGuildScheduledEventUsers {
2338                after,
2339                before,
2340                guild_id,
2341                limit,
2342                scheduled_event_id,
2343                with_member,
2344            } => {
2345                f.write_str("guilds/")?;
2346                Display::fmt(guild_id, f)?;
2347                f.write_str("/scheduled-events/")?;
2348                Display::fmt(scheduled_event_id, f)?;
2349                f.write_str("/users")?;
2350
2351                let mut query_formatter = QueryStringFormatter::new(f);
2352
2353                query_formatter.write_opt_param("after", after.as_ref())?;
2354                query_formatter.write_opt_param("before", before.as_ref())?;
2355                query_formatter.write_opt_param("limit", limit.as_ref())?;
2356
2357                if *with_member {
2358                    query_formatter.write_param("with_member", &true)?;
2359                }
2360
2361                Ok(())
2362            }
2363            Route::GetGuildScheduledEvents {
2364                guild_id,
2365                with_user_count,
2366            } => {
2367                f.write_str("guilds/")?;
2368                Display::fmt(guild_id, f)?;
2369                f.write_str("/scheduled-events")?;
2370
2371                let mut query_formatter = QueryStringFormatter::new(f);
2372
2373                if *with_user_count {
2374                    query_formatter.write_param("with_user_count", &true)?;
2375                }
2376
2377                Ok(())
2378            }
2379            Route::GetGuildSticker {
2380                guild_id,
2381                sticker_id,
2382                ..
2383            }
2384            | Route::DeleteGuildSticker {
2385                guild_id,
2386                sticker_id,
2387                ..
2388            }
2389            | Route::UpdateGuildSticker {
2390                guild_id,
2391                sticker_id,
2392                ..
2393            } => {
2394                f.write_str("guilds/")?;
2395                Display::fmt(guild_id, f)?;
2396                f.write_str("/stickers/")?;
2397
2398                Display::fmt(sticker_id, f)
2399            }
2400            Route::GetGuildVanityUrl { guild_id } => {
2401                f.write_str("guilds/")?;
2402                Display::fmt(guild_id, f)?;
2403
2404                f.write_str("/vanity-url")
2405            }
2406            Route::GetGuildVoiceRegions { guild_id } => {
2407                f.write_str("guilds/")?;
2408                Display::fmt(guild_id, f)?;
2409
2410                f.write_str("/regions")
2411            }
2412            Route::GetGuildWelcomeScreen { guild_id }
2413            | Route::UpdateGuildWelcomeScreen { guild_id } => {
2414                f.write_str("guilds/")?;
2415                Display::fmt(guild_id, f)?;
2416
2417                f.write_str("/welcome-screen")
2418            }
2419            Route::GetGuildWebhooks { guild_id } => {
2420                f.write_str("guilds/")?;
2421                Display::fmt(guild_id, f)?;
2422
2423                f.write_str("/webhooks")
2424            }
2425            Route::GetGuildWidget { guild_id } => {
2426                f.write_str("guilds/")?;
2427                Display::fmt(guild_id, f)?;
2428
2429                f.write_str("/widget.json")
2430            }
2431            Route::GetGuildWidgetSettings { guild_id }
2432            | Route::UpdateGuildWidgetSettings { guild_id } => {
2433                f.write_str("guilds/")?;
2434                Display::fmt(guild_id, f)?;
2435
2436                f.write_str("/widget")
2437            }
2438            Route::GetGuilds {
2439                after,
2440                before,
2441                limit,
2442            } => {
2443                f.write_str("users/@me/guilds")?;
2444
2445                let mut query_formatter = QueryStringFormatter::new(f);
2446
2447                query_formatter.write_opt_param("after", after.as_ref())?;
2448                query_formatter.write_opt_param("before", before.as_ref())?;
2449                query_formatter.write_opt_param("limit", limit.as_ref())
2450            }
2451            Route::GetInvite { code, with_counts } => {
2452                f.write_str("invites/")?;
2453                f.write_str(code)?;
2454
2455                let mut query_formatter = QueryStringFormatter::new(f);
2456
2457                if *with_counts {
2458                    query_formatter.write_param("with_counts", &true)?;
2459                }
2460
2461                Ok(())
2462            }
2463            Route::GetInviteWithExpiration {
2464                code,
2465                with_counts,
2466                with_expiration,
2467            } => {
2468                f.write_str("invites/")?;
2469                f.write_str(code)?;
2470
2471                let mut query_formatter = QueryStringFormatter::new(f);
2472
2473                if *with_counts {
2474                    query_formatter.write_param("with_counts", &true)?;
2475                }
2476
2477                if *with_expiration {
2478                    query_formatter.write_param("with_expiration", &true)?;
2479                }
2480
2481                Ok(())
2482            }
2483            Route::GetMessages {
2484                channel_id,
2485                after,
2486                around,
2487                before,
2488                limit,
2489            } => {
2490                f.write_str("channels/")?;
2491                Display::fmt(channel_id, f)?;
2492                f.write_str("/messages")?;
2493
2494                let mut query_formatter = QueryStringFormatter::new(f);
2495
2496                query_formatter.write_opt_param("after", after.as_ref())?;
2497                query_formatter.write_opt_param("around", around.as_ref())?;
2498                query_formatter.write_opt_param("before", before.as_ref())?;
2499                query_formatter.write_opt_param("limit", limit.as_ref())
2500            }
2501            Route::GetNitroStickerPacks { .. } => f.write_str("sticker-packs"),
2502            Route::GetPins {
2503                channel_id,
2504                limit,
2505                before,
2506            } => {
2507                f.write_str("channels/")?;
2508                Display::fmt(channel_id, f)?;
2509
2510                f.write_str("/messages/pins")?;
2511
2512                let mut query_formatter = QueryStringFormatter::new(f);
2513
2514                query_formatter.write_opt_param("before", before.as_ref())?;
2515                query_formatter.write_opt_param("limit", limit.as_ref())
2516            }
2517            Route::GetJoinedPrivateArchivedThreads {
2518                before,
2519                channel_id,
2520                limit,
2521            } => {
2522                f.write_str("channels/")?;
2523                Display::fmt(channel_id, f)?;
2524                f.write_str("/users/@me/threads/archived/private")?;
2525
2526                let mut query_formatter = QueryStringFormatter::new(f);
2527
2528                query_formatter.write_opt_param("before", before.as_ref())?;
2529                query_formatter.write_opt_param("limit", limit.as_ref())
2530            }
2531            Route::GetPrivateArchivedThreads {
2532                before,
2533                channel_id,
2534                limit,
2535            } => {
2536                f.write_str("channels/")?;
2537                Display::fmt(channel_id, f)?;
2538                f.write_str("/threads/archived/private")?;
2539
2540                let mut query_formatter = QueryStringFormatter::new(f);
2541
2542                query_formatter.write_opt_param("before", before.as_ref())?;
2543                query_formatter.write_opt_param("limit", limit.as_ref())
2544            }
2545            Route::GetPublicArchivedThreads {
2546                before,
2547                channel_id,
2548                limit,
2549            } => {
2550                f.write_str("channels/")?;
2551                Display::fmt(channel_id, f)?;
2552                f.write_str("/threads/archived/public")?;
2553
2554                let mut query_formatter = QueryStringFormatter::new(f);
2555
2556                query_formatter.write_opt_param("before", before.as_ref())?;
2557                query_formatter.write_opt_param("limit", limit.as_ref())
2558            }
2559            Route::GetReactionUsers {
2560                after,
2561                channel_id,
2562                emoji,
2563                limit,
2564                message_id,
2565                kind,
2566            } => {
2567                f.write_str("channels/")?;
2568                Display::fmt(channel_id, f)?;
2569                f.write_str("/messages/")?;
2570                Display::fmt(message_id, f)?;
2571                f.write_str("/reactions/")?;
2572                Display::fmt(&emoji, f)?;
2573
2574                let mut query_formatter = QueryStringFormatter::new(f);
2575
2576                query_formatter.write_opt_param("after", after.as_ref())?;
2577                query_formatter.write_opt_param("limit", limit.as_ref())?;
2578                query_formatter.write_opt_param("type", kind.as_ref())
2579            }
2580            Route::GetSticker { sticker_id } => {
2581                f.write_str("stickers/")?;
2582
2583                Display::fmt(sticker_id, f)
2584            }
2585            Route::GetThreadMembers {
2586                after,
2587                channel_id,
2588                limit,
2589                with_member,
2590            } => {
2591                f.write_str("channels/")?;
2592                Display::fmt(channel_id, f)?;
2593                f.write_str("/thread-members")?;
2594
2595                let mut query_formatter = QueryStringFormatter::new(f);
2596
2597                query_formatter.write_opt_param("after", after.as_ref())?;
2598                query_formatter.write_opt_param("limit", limit.as_ref())?;
2599                query_formatter.write_opt_param("with_member", with_member.as_ref())
2600            }
2601            Route::GetUserConnections => f.write_str("users/@me/connections"),
2602            Route::GetUser { user_id } => {
2603                f.write_str("users/")?;
2604
2605                Display::fmt(user_id, f)
2606            }
2607            Route::GetVoiceRegions => f.write_str("voice/regions"),
2608            Route::InteractionCallback {
2609                interaction_id,
2610                interaction_token,
2611                with_response,
2612            } => {
2613                f.write_str("interactions/")?;
2614                Display::fmt(interaction_id, f)?;
2615                f.write_str("/")?;
2616                f.write_str(interaction_token)?;
2617
2618                f.write_str("/callback")?;
2619
2620                if *with_response {
2621                    f.write_str("?with_response=true")?;
2622                }
2623
2624                Ok(())
2625            }
2626            Route::JoinThread { channel_id } | Route::LeaveThread { channel_id } => {
2627                f.write_str("channels/")?;
2628                Display::fmt(channel_id, f)?;
2629
2630                f.write_str("/thread-members/@me")
2631            }
2632            Route::LeaveGuild { guild_id } => {
2633                f.write_str("users/@me/guilds/")?;
2634
2635                Display::fmt(guild_id, f)
2636            }
2637            Route::PinMessage {
2638                channel_id,
2639                message_id,
2640            }
2641            | Route::UnpinMessage {
2642                channel_id,
2643                message_id,
2644            } => {
2645                f.write_str("channels/")?;
2646                Display::fmt(channel_id, f)?;
2647                f.write_str("/messages/pins/")?;
2648
2649                Display::fmt(message_id, f)
2650            }
2651            Route::SearchGuildMembers {
2652                guild_id,
2653                limit,
2654                query,
2655            } => {
2656                f.write_str("guilds/")?;
2657                Display::fmt(guild_id, f)?;
2658                f.write_str("/members/search")?;
2659
2660                let mut query_formatter = QueryStringFormatter::new(f);
2661
2662                query_formatter
2663                    .write_param("query", &utf8_percent_encode(query, NON_ALPHANUMERIC))?;
2664                query_formatter.write_opt_param("limit", limit.as_ref())
2665            }
2666            Route::SyncGuildIntegration {
2667                guild_id,
2668                integration_id,
2669            } => {
2670                f.write_str("guilds/")?;
2671                Display::fmt(guild_id, f)?;
2672                f.write_str("/integrations/")?;
2673                Display::fmt(integration_id, f)?;
2674
2675                f.write_str("/sync")
2676            }
2677            Route::UpdateCurrentMember { guild_id } => {
2678                f.write_str("guilds/")?;
2679                Display::fmt(guild_id, f)?;
2680
2681                f.write_str("/members/@me")
2682            }
2683            Route::GetCurrentUserVoiceState { guild_id }
2684            | Route::UpdateCurrentUserVoiceState { guild_id } => {
2685                f.write_str("guilds/")?;
2686                Display::fmt(guild_id, f)?;
2687
2688                f.write_str("/voice-states/@me")
2689            }
2690            Route::DeleteGuildScheduledEvent {
2691                guild_id,
2692                scheduled_event_id,
2693            }
2694            | Route::UpdateGuildScheduledEvent {
2695                guild_id,
2696                scheduled_event_id,
2697            } => {
2698                f.write_str("guilds/")?;
2699                Display::fmt(guild_id, f)?;
2700                f.write_str("/scheduled-events/")?;
2701
2702                Display::fmt(scheduled_event_id, f)
2703            }
2704            Route::UpdateNickname { guild_id } => {
2705                f.write_str("guilds/")?;
2706                Display::fmt(guild_id, f)?;
2707
2708                f.write_str("/members/@me/nick")
2709            }
2710            Route::GetUserVoiceState { guild_id, user_id }
2711            | Route::UpdateUserVoiceState { guild_id, user_id } => {
2712                f.write_str("guilds/")?;
2713                Display::fmt(guild_id, f)?;
2714                f.write_str("/voice-states/")?;
2715
2716                Display::fmt(user_id, f)
2717            }
2718            Route::UpdateGuildMfa { guild_id, .. } => {
2719                f.write_str("guilds/")?;
2720                Display::fmt(guild_id, f)?;
2721
2722                f.write_str("/mfa")
2723            }
2724            Route::GetSKUs { application_id } => {
2725                f.write_str("applications/")?;
2726                Display::fmt(application_id, f)?;
2727
2728                f.write_str("/skus")
2729            }
2730        }
2731    }
2732}
2733
2734#[cfg(test)]
2735mod tests {
2736    use super::Route;
2737    use crate::request::{Method, channel::reaction::RequestReactionType};
2738    use twilight_model::id::Id;
2739
2740    /// Test a route for each method.
2741    #[test]
2742    fn methods() {
2743        assert_eq!(
2744            Method::Delete,
2745            Route::DeleteInvite {
2746                code: "twilight-rs",
2747            }
2748            .method()
2749        );
2750        assert_eq!(
2751            Method::Get,
2752            Route::GetInvite {
2753                code: "twilight-rs",
2754                with_counts: false,
2755            }
2756            .method()
2757        );
2758        assert_eq!(
2759            Method::Patch,
2760            Route::UpdateMessage {
2761                channel_id: 123,
2762                message_id: 456,
2763            }
2764            .method()
2765        );
2766        assert_eq!(Method::Post, Route::CreateGuild.method());
2767        assert_eq!(
2768            Method::Put,
2769            Route::SyncTemplate {
2770                guild_id: 123,
2771                template_code: "abc",
2772            }
2773            .method()
2774        );
2775    }
2776
2777    // Test display implementation
2778
2779    const APPLICATION_ID: u64 = 1;
2780    const CHANNEL_ID: u64 = 2;
2781    const CODE: &str = "invitecode";
2782    const COMMAND_ID: u64 = 3;
2783    const EMOJI_ID: u64 = 4;
2784    const GUILD_ID: u64 = 5;
2785    const INTERACTION_ID: u64 = 6;
2786    const INTERACTION_TOKEN: &str = "interactiontoken";
2787    const INTEGRATION_ID: u64 = 7;
2788    const MESSAGE_ID: u64 = 8;
2789    const ROLE_ID: u64 = 9;
2790    const STICKER_ID: u64 = 10;
2791    const TEMPLATE_CODE: &str = "templatecode";
2792    const USER_ID: u64 = 11;
2793    const SCHEDULED_EVENT_ID: u64 = 12;
2794    const AUTO_MODERATION_RULE_ID: u64 = 13;
2795
2796    const fn emoji() -> RequestReactionType<'static> {
2797        RequestReactionType::Custom {
2798            id: Id::new(EMOJI_ID),
2799            name: None,
2800        }
2801    }
2802
2803    #[test]
2804    fn get_public_archived_threads() {
2805        let route = Route::GetPublicArchivedThreads {
2806            channel_id: 1,
2807            before: Some("2021-01-01T00:00:00Z"),
2808            limit: None,
2809        };
2810
2811        assert_eq!(
2812            "channels/1/threads/archived/public?before=2021-01-01T00:00:00Z",
2813            route.to_string()
2814        );
2815    }
2816
2817    #[test]
2818    fn update_webhook_message_thread_id() {
2819        let route = Route::UpdateWebhookMessage {
2820            message_id: 1,
2821            thread_id: Some(2),
2822            token: "token",
2823            webhook_id: 3,
2824        };
2825
2826        assert_eq!("webhooks/3/token/messages/1?thread_id=2", route.to_string());
2827    }
2828
2829    #[test]
2830    fn add_guild_member() {
2831        let route = Route::AddGuildMember {
2832            guild_id: GUILD_ID,
2833            user_id: USER_ID,
2834        };
2835        assert_eq!(
2836            route.to_string(),
2837            format!("guilds/{GUILD_ID}/members/{USER_ID}")
2838        );
2839    }
2840
2841    #[test]
2842    fn get_member() {
2843        let route = Route::GetMember {
2844            guild_id: GUILD_ID,
2845            user_id: USER_ID,
2846        };
2847        assert_eq!(
2848            route.to_string(),
2849            format!("guilds/{GUILD_ID}/members/{USER_ID}")
2850        );
2851    }
2852
2853    #[test]
2854    fn remove_member() {
2855        let route = Route::RemoveMember {
2856            guild_id: GUILD_ID,
2857            user_id: USER_ID,
2858        };
2859        assert_eq!(
2860            route.to_string(),
2861            format!("guilds/{GUILD_ID}/members/{USER_ID}")
2862        );
2863    }
2864
2865    #[test]
2866    fn update_member() {
2867        let route = Route::UpdateMember {
2868            guild_id: GUILD_ID,
2869            user_id: USER_ID,
2870        };
2871        assert_eq!(
2872            route.to_string(),
2873            format!("guilds/{GUILD_ID}/members/{USER_ID}")
2874        );
2875    }
2876
2877    #[test]
2878    fn add_member_role() {
2879        let route = Route::AddMemberRole {
2880            guild_id: GUILD_ID,
2881            role_id: ROLE_ID,
2882            user_id: USER_ID,
2883        };
2884        assert_eq!(
2885            route.to_string(),
2886            format!("guilds/{GUILD_ID}/members/{USER_ID}/roles/{ROLE_ID}")
2887        );
2888    }
2889
2890    #[test]
2891    fn remove_member_role() {
2892        let route = Route::RemoveMemberRole {
2893            guild_id: GUILD_ID,
2894            role_id: ROLE_ID,
2895            user_id: USER_ID,
2896        };
2897        assert_eq!(
2898            route.to_string(),
2899            format!("guilds/{GUILD_ID}/members/{USER_ID}/roles/{ROLE_ID}")
2900        );
2901    }
2902
2903    #[test]
2904    fn add_thread_member() {
2905        let route = Route::AddThreadMember {
2906            channel_id: CHANNEL_ID,
2907            user_id: USER_ID,
2908        };
2909        assert_eq!(
2910            route.to_string(),
2911            format!("channels/{CHANNEL_ID}/thread-members/{USER_ID}")
2912        );
2913    }
2914
2915    #[test]
2916    fn get_thread_member() {
2917        let route = Route::GetThreadMember {
2918            channel_id: CHANNEL_ID,
2919            user_id: USER_ID,
2920        };
2921        assert_eq!(
2922            route.to_string(),
2923            format!("channels/{CHANNEL_ID}/thread-members/{USER_ID}")
2924        );
2925    }
2926
2927    #[test]
2928    fn remove_thread_member() {
2929        let route = Route::RemoveThreadMember {
2930            channel_id: CHANNEL_ID,
2931            user_id: USER_ID,
2932        };
2933        assert_eq!(
2934            route.to_string(),
2935            format!("channels/{CHANNEL_ID}/thread-members/{USER_ID}")
2936        );
2937    }
2938
2939    #[test]
2940    fn create_channel() {
2941        let route = Route::CreateChannel { guild_id: GUILD_ID };
2942        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/channels"));
2943    }
2944
2945    #[test]
2946    fn get_channels() {
2947        let route = Route::GetChannels { guild_id: GUILD_ID };
2948        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/channels"));
2949    }
2950
2951    #[test]
2952    fn update_guild_channels() {
2953        let route = Route::UpdateGuildChannels { guild_id: GUILD_ID };
2954        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/channels"));
2955    }
2956
2957    #[test]
2958    fn create_emoji() {
2959        let route = Route::CreateEmoji { guild_id: GUILD_ID };
2960        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/emojis"));
2961    }
2962
2963    #[test]
2964    fn get_emojis() {
2965        let route = Route::GetEmojis { guild_id: GUILD_ID };
2966        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/emojis"));
2967    }
2968
2969    #[test]
2970    fn create_global_command() {
2971        let route = Route::CreateGlobalCommand {
2972            application_id: APPLICATION_ID,
2973        };
2974        assert_eq!(
2975            route.to_string(),
2976            format!("applications/{APPLICATION_ID}/commands")
2977        );
2978    }
2979
2980    #[test]
2981    fn get_global_commands() {
2982        let route = Route::GetGlobalCommands {
2983            application_id: APPLICATION_ID,
2984            with_localizations: Some(true),
2985        };
2986        assert_eq!(
2987            route.to_string(),
2988            format!("applications/{APPLICATION_ID}/commands?with_localizations=true")
2989        );
2990
2991        let route = Route::GetGlobalCommands {
2992            application_id: APPLICATION_ID,
2993            with_localizations: None,
2994        };
2995        assert_eq!(
2996            route.to_string(),
2997            format!("applications/{APPLICATION_ID}/commands")
2998        );
2999    }
3000
3001    #[test]
3002    fn set_global_commands() {
3003        let route = Route::SetGlobalCommands {
3004            application_id: APPLICATION_ID,
3005        };
3006        assert_eq!(
3007            route.to_string(),
3008            format!("applications/{APPLICATION_ID}/commands")
3009        );
3010    }
3011
3012    #[test]
3013    fn create_guild() {
3014        let route = Route::CreateGuild;
3015        assert_eq!(route.to_string(), "guilds");
3016    }
3017
3018    #[test]
3019    fn create_guild_command() {
3020        let route = Route::CreateGuildCommand {
3021            application_id: APPLICATION_ID,
3022            guild_id: GUILD_ID,
3023        };
3024        assert_eq!(
3025            route.to_string(),
3026            format!("applications/{APPLICATION_ID}/guilds/{GUILD_ID}/commands")
3027        );
3028    }
3029
3030    #[test]
3031    fn get_guild_commands() {
3032        let route = Route::GetGuildCommands {
3033            application_id: APPLICATION_ID,
3034            guild_id: GUILD_ID,
3035            with_localizations: Some(true),
3036        };
3037        assert_eq!(
3038            route.to_string(),
3039            format!(
3040                "applications/{APPLICATION_ID}/guilds/{GUILD_ID}/commands?with_localizations=true"
3041            )
3042        );
3043
3044        let route = Route::GetGuildCommands {
3045            application_id: APPLICATION_ID,
3046            guild_id: GUILD_ID,
3047            with_localizations: None,
3048        };
3049        assert_eq!(
3050            route.to_string(),
3051            format!("applications/{APPLICATION_ID}/guilds/{GUILD_ID}/commands")
3052        );
3053    }
3054
3055    #[test]
3056    fn set_guild_commands() {
3057        let route = Route::SetGuildCommands {
3058            application_id: APPLICATION_ID,
3059            guild_id: GUILD_ID,
3060        };
3061        assert_eq!(
3062            route.to_string(),
3063            format!("applications/{APPLICATION_ID}/guilds/{GUILD_ID}/commands")
3064        );
3065    }
3066
3067    #[test]
3068    fn create_guild_from_template() {
3069        let route = Route::CreateGuildFromTemplate {
3070            template_code: TEMPLATE_CODE,
3071        };
3072        assert_eq!(
3073            route.to_string(),
3074            format!("guilds/templates/{TEMPLATE_CODE}")
3075        );
3076    }
3077
3078    #[test]
3079    fn get_template() {
3080        let route = Route::GetTemplate {
3081            template_code: TEMPLATE_CODE,
3082        };
3083        assert_eq!(
3084            route.to_string(),
3085            format!("guilds/templates/{TEMPLATE_CODE}")
3086        );
3087    }
3088
3089    #[test]
3090    fn create_guild_integration() {
3091        let route = Route::CreateGuildIntegration { guild_id: GUILD_ID };
3092        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/integrations"));
3093    }
3094
3095    #[test]
3096    fn get_guild_integrations() {
3097        let route = Route::GetGuildIntegrations { guild_id: GUILD_ID };
3098        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/integrations"));
3099    }
3100
3101    #[test]
3102    fn create_guild_sticker() {
3103        let route = Route::CreateGuildSticker { guild_id: GUILD_ID };
3104        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/stickers"));
3105    }
3106
3107    #[test]
3108    fn get_guild_stickers() {
3109        let route = Route::GetGuildStickers { guild_id: GUILD_ID };
3110        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/stickers"));
3111    }
3112
3113    #[test]
3114    fn create_invite() {
3115        let route = Route::CreateInvite {
3116            channel_id: CHANNEL_ID,
3117        };
3118        assert_eq!(route.to_string(), format!("channels/{CHANNEL_ID}/invites"));
3119    }
3120
3121    #[test]
3122    fn get_channel_invites() {
3123        let route = Route::GetChannelInvites {
3124            channel_id: CHANNEL_ID,
3125        };
3126        assert_eq!(route.to_string(), format!("channels/{CHANNEL_ID}/invites"));
3127    }
3128
3129    #[test]
3130    fn create_message() {
3131        let route = Route::CreateMessage {
3132            channel_id: CHANNEL_ID,
3133        };
3134        assert_eq!(route.to_string(), format!("channels/{CHANNEL_ID}/messages"));
3135    }
3136
3137    #[test]
3138    fn create_private_channel() {
3139        let route = Route::CreatePrivateChannel;
3140        assert_eq!(route.to_string(), "users/@me/channels");
3141    }
3142
3143    #[test]
3144    fn get_user_private_channels() {
3145        let route = Route::GetUserPrivateChannels;
3146        assert_eq!(route.to_string(), "users/@me/channels");
3147    }
3148
3149    #[test]
3150    fn create_reaction() {
3151        let emoji = emoji();
3152
3153        let route = Route::CreateReaction {
3154            channel_id: CHANNEL_ID,
3155            emoji: &emoji,
3156            message_id: MESSAGE_ID,
3157        };
3158        assert_eq!(
3159            route.to_string(),
3160            format!("channels/{CHANNEL_ID}/messages/{MESSAGE_ID}/reactions/{emoji}/@me")
3161        );
3162    }
3163
3164    #[test]
3165    fn delete_reaction_current_user() {
3166        let emoji = emoji();
3167
3168        let route = Route::DeleteReactionCurrentUser {
3169            channel_id: CHANNEL_ID,
3170            emoji: &emoji,
3171            message_id: MESSAGE_ID,
3172        };
3173        assert_eq!(
3174            route.to_string(),
3175            format!("channels/{CHANNEL_ID}/messages/{MESSAGE_ID}/reactions/{emoji}/@me")
3176        );
3177    }
3178
3179    #[test]
3180    fn create_role() {
3181        let route = Route::CreateRole { guild_id: GUILD_ID };
3182        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/roles"));
3183    }
3184
3185    #[test]
3186    fn get_guild_roles() {
3187        let route = Route::GetGuildRoles { guild_id: GUILD_ID };
3188        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/roles"));
3189    }
3190
3191    #[test]
3192    fn update_role_positions() {
3193        let route = Route::UpdateRolePositions { guild_id: GUILD_ID };
3194        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/roles"));
3195    }
3196
3197    #[test]
3198    fn create_stage_instance() {
3199        let route = Route::CreateStageInstance;
3200        assert_eq!(route.to_string(), "stage-instances");
3201    }
3202
3203    #[test]
3204    fn create_template() {
3205        let route = Route::CreateTemplate { guild_id: GUILD_ID };
3206        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/templates"));
3207    }
3208
3209    #[test]
3210    fn get_templates() {
3211        let route = Route::GetTemplates { guild_id: GUILD_ID };
3212        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/templates"));
3213    }
3214
3215    #[test]
3216    fn create_thread() {
3217        let route = Route::CreateThread {
3218            channel_id: CHANNEL_ID,
3219        };
3220        assert_eq!(route.to_string(), format!("channels/{CHANNEL_ID}/threads"));
3221    }
3222
3223    #[test]
3224    fn create_thread_from_message() {
3225        let route = Route::CreateThreadFromMessage {
3226            channel_id: CHANNEL_ID,
3227            message_id: MESSAGE_ID,
3228        };
3229        assert_eq!(
3230            route.to_string(),
3231            format!("channels/{CHANNEL_ID}/messages/{MESSAGE_ID}/threads")
3232        );
3233    }
3234
3235    #[test]
3236    fn create_typing_trigger() {
3237        let route = Route::CreateTypingTrigger {
3238            channel_id: CHANNEL_ID,
3239        };
3240        assert_eq!(route.to_string(), format!("channels/{CHANNEL_ID}/typing"));
3241    }
3242
3243    #[test]
3244    fn create_webhook() {
3245        let route = Route::CreateWebhook {
3246            channel_id: CHANNEL_ID,
3247        };
3248        assert_eq!(route.to_string(), format!("channels/{CHANNEL_ID}/webhooks"));
3249    }
3250
3251    #[test]
3252    fn get_channel_webhooks() {
3253        let route = Route::GetChannelWebhooks {
3254            channel_id: CHANNEL_ID,
3255        };
3256        assert_eq!(route.to_string(), format!("channels/{CHANNEL_ID}/webhooks"));
3257    }
3258
3259    #[test]
3260    fn crosspost_message() {
3261        let route = Route::CrosspostMessage {
3262            channel_id: CHANNEL_ID,
3263            message_id: MESSAGE_ID,
3264        };
3265        assert_eq!(
3266            route.to_string(),
3267            format!("channels/{CHANNEL_ID}/messages/{MESSAGE_ID}/crosspost")
3268        );
3269    }
3270
3271    #[test]
3272    fn delete_ban() {
3273        let route = Route::DeleteBan {
3274            guild_id: GUILD_ID,
3275            user_id: USER_ID,
3276        };
3277        assert_eq!(
3278            route.to_string(),
3279            format!("guilds/{GUILD_ID}/bans/{USER_ID}")
3280        );
3281    }
3282
3283    #[test]
3284    fn get_ban() {
3285        let route = Route::GetBan {
3286            guild_id: GUILD_ID,
3287            user_id: USER_ID,
3288        };
3289        assert_eq!(
3290            route.to_string(),
3291            format!("guilds/{GUILD_ID}/bans/{USER_ID}")
3292        );
3293    }
3294
3295    #[test]
3296    fn delete_channel() {
3297        let route = Route::DeleteChannel {
3298            channel_id: CHANNEL_ID,
3299        };
3300        assert_eq!(route.to_string(), format!("channels/{CHANNEL_ID}"));
3301    }
3302
3303    #[test]
3304    fn get_channel() {
3305        let route = Route::GetChannel {
3306            channel_id: CHANNEL_ID,
3307        };
3308        assert_eq!(route.to_string(), format!("channels/{CHANNEL_ID}"));
3309    }
3310
3311    #[test]
3312    fn update_channel() {
3313        let route = Route::UpdateChannel {
3314            channel_id: CHANNEL_ID,
3315        };
3316        assert_eq!(route.to_string(), format!("channels/{CHANNEL_ID}"));
3317    }
3318
3319    #[test]
3320    fn delete_emoji() {
3321        let route = Route::DeleteEmoji {
3322            emoji_id: EMOJI_ID,
3323            guild_id: GUILD_ID,
3324        };
3325        assert_eq!(
3326            route.to_string(),
3327            format!("guilds/{GUILD_ID}/emojis/{EMOJI_ID}")
3328        );
3329    }
3330
3331    #[test]
3332    fn get_emoji() {
3333        let route = Route::GetEmoji {
3334            emoji_id: EMOJI_ID,
3335            guild_id: GUILD_ID,
3336        };
3337        assert_eq!(
3338            route.to_string(),
3339            format!("guilds/{GUILD_ID}/emojis/{EMOJI_ID}")
3340        );
3341    }
3342
3343    #[test]
3344    fn update_emoji() {
3345        let route = Route::UpdateEmoji {
3346            emoji_id: EMOJI_ID,
3347            guild_id: GUILD_ID,
3348        };
3349        assert_eq!(
3350            route.to_string(),
3351            format!("guilds/{GUILD_ID}/emojis/{EMOJI_ID}")
3352        );
3353    }
3354
3355    #[test]
3356    fn delete_global_command() {
3357        let route = Route::DeleteGlobalCommand {
3358            application_id: APPLICATION_ID,
3359            command_id: COMMAND_ID,
3360        };
3361        assert_eq!(
3362            route.to_string(),
3363            format!("applications/{APPLICATION_ID}/commands/{COMMAND_ID}")
3364        );
3365    }
3366
3367    #[test]
3368    fn get_global_command() {
3369        let route = Route::GetGlobalCommand {
3370            application_id: APPLICATION_ID,
3371            command_id: COMMAND_ID,
3372        };
3373        assert_eq!(
3374            route.to_string(),
3375            format!("applications/{APPLICATION_ID}/commands/{COMMAND_ID}")
3376        );
3377    }
3378
3379    #[test]
3380    fn update_global_command() {
3381        let route = Route::UpdateGlobalCommand {
3382            application_id: APPLICATION_ID,
3383            command_id: COMMAND_ID,
3384        };
3385        assert_eq!(
3386            route.to_string(),
3387            format!("applications/{APPLICATION_ID}/commands/{COMMAND_ID}")
3388        );
3389    }
3390
3391    #[test]
3392    fn delete_guild() {
3393        let route = Route::DeleteGuild { guild_id: GUILD_ID };
3394        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}"));
3395    }
3396
3397    #[test]
3398    fn update_guild() {
3399        let route = Route::UpdateGuild { guild_id: GUILD_ID };
3400        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}"));
3401    }
3402
3403    #[test]
3404    fn delete_guild_command() {
3405        let route = Route::DeleteGuildCommand {
3406            application_id: APPLICATION_ID,
3407            command_id: COMMAND_ID,
3408            guild_id: GUILD_ID,
3409        };
3410        assert_eq!(
3411            route.to_string(),
3412            format!("applications/{APPLICATION_ID}/guilds/{GUILD_ID}/commands/{COMMAND_ID}")
3413        );
3414    }
3415
3416    #[test]
3417    fn get_guild_command() {
3418        let route = Route::GetGuildCommand {
3419            application_id: APPLICATION_ID,
3420            command_id: COMMAND_ID,
3421            guild_id: GUILD_ID,
3422        };
3423        assert_eq!(
3424            route.to_string(),
3425            format!("applications/{APPLICATION_ID}/guilds/{GUILD_ID}/commands/{COMMAND_ID}")
3426        );
3427    }
3428
3429    #[test]
3430    fn update_guild_command() {
3431        let route = Route::UpdateGuildCommand {
3432            application_id: APPLICATION_ID,
3433            command_id: COMMAND_ID,
3434            guild_id: GUILD_ID,
3435        };
3436        assert_eq!(
3437            route.to_string(),
3438            format!("applications/{APPLICATION_ID}/guilds/{GUILD_ID}/commands/{COMMAND_ID}")
3439        );
3440    }
3441
3442    #[test]
3443    fn delete_guild_integration() {
3444        let route = Route::DeleteGuildIntegration {
3445            guild_id: GUILD_ID,
3446            integration_id: INTEGRATION_ID,
3447        };
3448        assert_eq!(
3449            route.to_string(),
3450            format!("guilds/{GUILD_ID}/integrations/{INTEGRATION_ID}")
3451        );
3452    }
3453
3454    #[test]
3455    fn update_guild_integration() {
3456        let route = Route::UpdateGuildIntegration {
3457            guild_id: GUILD_ID,
3458            integration_id: INTEGRATION_ID,
3459        };
3460        assert_eq!(
3461            route.to_string(),
3462            format!("guilds/{GUILD_ID}/integrations/{INTEGRATION_ID}")
3463        );
3464    }
3465
3466    #[test]
3467    fn delete_interaction_original() {
3468        let route = Route::DeleteInteractionOriginal {
3469            application_id: APPLICATION_ID,
3470            interaction_token: INTERACTION_TOKEN,
3471        };
3472        assert_eq!(
3473            route.to_string(),
3474            format!("webhooks/{APPLICATION_ID}/{INTERACTION_TOKEN}/messages/@original")
3475        );
3476    }
3477
3478    #[test]
3479    fn get_interaction_original() {
3480        let route = Route::GetInteractionOriginal {
3481            application_id: APPLICATION_ID,
3482            interaction_token: INTERACTION_TOKEN,
3483        };
3484        assert_eq!(
3485            route.to_string(),
3486            format!("webhooks/{APPLICATION_ID}/{INTERACTION_TOKEN}/messages/@original")
3487        );
3488    }
3489
3490    #[test]
3491    fn update_interaction_original() {
3492        let route = Route::UpdateInteractionOriginal {
3493            application_id: APPLICATION_ID,
3494            interaction_token: INTERACTION_TOKEN,
3495        };
3496        assert_eq!(
3497            route.to_string(),
3498            format!("webhooks/{APPLICATION_ID}/{INTERACTION_TOKEN}/messages/@original")
3499        );
3500    }
3501
3502    #[test]
3503    fn delete_invite() {
3504        let route = Route::DeleteInvite { code: CODE };
3505        assert_eq!(route.to_string(), format!("invites/{CODE}"));
3506    }
3507
3508    #[test]
3509    fn delete_message_reactions() {
3510        let route = Route::DeleteMessageReactions {
3511            channel_id: CHANNEL_ID,
3512            message_id: MESSAGE_ID,
3513        };
3514        assert_eq!(
3515            route.to_string(),
3516            format!("channels/{CHANNEL_ID}/messages/{MESSAGE_ID}/reactions")
3517        );
3518    }
3519
3520    #[test]
3521    fn delete_message_specific_reaction() {
3522        let emoji = emoji();
3523
3524        let route = Route::DeleteMessageSpecificReaction {
3525            channel_id: CHANNEL_ID,
3526            message_id: MESSAGE_ID,
3527            emoji: &emoji,
3528        };
3529        assert_eq!(
3530            route.to_string(),
3531            format!("channels/{CHANNEL_ID}/messages/{MESSAGE_ID}/reactions/{emoji}")
3532        );
3533    }
3534
3535    #[test]
3536    fn delete_message() {
3537        let route = Route::DeleteMessage {
3538            channel_id: CHANNEL_ID,
3539            message_id: MESSAGE_ID,
3540        };
3541        assert_eq!(
3542            route.to_string(),
3543            format!("channels/{CHANNEL_ID}/messages/{MESSAGE_ID}")
3544        );
3545    }
3546
3547    #[test]
3548    fn get_message() {
3549        let route = Route::GetMessage {
3550            channel_id: CHANNEL_ID,
3551            message_id: MESSAGE_ID,
3552        };
3553        assert_eq!(
3554            route.to_string(),
3555            format!("channels/{CHANNEL_ID}/messages/{MESSAGE_ID}")
3556        );
3557    }
3558
3559    #[test]
3560    fn update_message() {
3561        let route = Route::UpdateMessage {
3562            channel_id: CHANNEL_ID,
3563            message_id: MESSAGE_ID,
3564        };
3565        assert_eq!(
3566            route.to_string(),
3567            format!("channels/{CHANNEL_ID}/messages/{MESSAGE_ID}")
3568        );
3569    }
3570
3571    #[test]
3572    fn delete_messages() {
3573        let route = Route::DeleteMessages {
3574            channel_id: CHANNEL_ID,
3575        };
3576        assert_eq!(
3577            route.to_string(),
3578            format!("channels/{CHANNEL_ID}/messages/bulk-delete")
3579        );
3580    }
3581
3582    #[test]
3583    fn delete_permission_overwrite() {
3584        let route = Route::DeletePermissionOverwrite {
3585            channel_id: CHANNEL_ID,
3586            target_id: ROLE_ID,
3587        };
3588        assert_eq!(
3589            route.to_string(),
3590            format!("channels/{CHANNEL_ID}/permissions/{ROLE_ID}")
3591        );
3592    }
3593
3594    #[test]
3595    fn update_permission_overwrite() {
3596        let route = Route::UpdatePermissionOverwrite {
3597            channel_id: CHANNEL_ID,
3598            target_id: USER_ID,
3599        };
3600        assert_eq!(
3601            route.to_string(),
3602            format!("channels/{CHANNEL_ID}/permissions/{USER_ID}")
3603        );
3604    }
3605
3606    #[test]
3607    fn delete_reaction() {
3608        let emoji = emoji();
3609
3610        let route = Route::DeleteReaction {
3611            channel_id: CHANNEL_ID,
3612            emoji: &emoji,
3613            message_id: MESSAGE_ID,
3614            user_id: USER_ID,
3615        };
3616        assert_eq!(
3617            route.to_string(),
3618            format!("channels/{CHANNEL_ID}/messages/{MESSAGE_ID}/reactions/{emoji}/{USER_ID}")
3619        );
3620    }
3621
3622    #[test]
3623    fn delete_role() {
3624        let route = Route::DeleteRole {
3625            guild_id: GUILD_ID,
3626            role_id: ROLE_ID,
3627        };
3628        assert_eq!(
3629            route.to_string(),
3630            format!("guilds/{GUILD_ID}/roles/{ROLE_ID}")
3631        );
3632    }
3633
3634    #[test]
3635    fn update_role() {
3636        let route = Route::UpdateRole {
3637            guild_id: GUILD_ID,
3638            role_id: ROLE_ID,
3639        };
3640        assert_eq!(
3641            route.to_string(),
3642            format!("guilds/{GUILD_ID}/roles/{ROLE_ID}")
3643        );
3644    }
3645
3646    #[test]
3647    fn delete_stage_instance() {
3648        let route = Route::DeleteStageInstance {
3649            channel_id: CHANNEL_ID,
3650        };
3651        assert_eq!(route.to_string(), format!("stage-instances/{CHANNEL_ID}"));
3652    }
3653
3654    #[test]
3655    fn get_stage_instance() {
3656        let route = Route::GetStageInstance {
3657            channel_id: CHANNEL_ID,
3658        };
3659        assert_eq!(route.to_string(), format!("stage-instances/{CHANNEL_ID}"));
3660    }
3661
3662    #[test]
3663    fn update_stage_instance() {
3664        let route = Route::UpdateStageInstance {
3665            channel_id: CHANNEL_ID,
3666        };
3667        assert_eq!(route.to_string(), format!("stage-instances/{CHANNEL_ID}"));
3668    }
3669
3670    #[test]
3671    fn delete_template() {
3672        let route = Route::DeleteTemplate {
3673            guild_id: GUILD_ID,
3674            template_code: TEMPLATE_CODE,
3675        };
3676        assert_eq!(
3677            route.to_string(),
3678            format!("guilds/{GUILD_ID}/templates/{TEMPLATE_CODE}")
3679        );
3680    }
3681
3682    #[test]
3683    fn sync_template() {
3684        let route = Route::SyncTemplate {
3685            guild_id: GUILD_ID,
3686            template_code: TEMPLATE_CODE,
3687        };
3688        assert_eq!(
3689            route.to_string(),
3690            format!("guilds/{GUILD_ID}/templates/{TEMPLATE_CODE}")
3691        );
3692    }
3693
3694    #[test]
3695    fn update_template() {
3696        let route = Route::UpdateTemplate {
3697            guild_id: GUILD_ID,
3698            template_code: TEMPLATE_CODE,
3699        };
3700        assert_eq!(
3701            route.to_string(),
3702            format!("guilds/{GUILD_ID}/templates/{TEMPLATE_CODE}")
3703        );
3704    }
3705
3706    #[test]
3707    fn follow_news_channel() {
3708        let route = Route::FollowNewsChannel {
3709            channel_id: CHANNEL_ID,
3710        };
3711        assert_eq!(
3712            route.to_string(),
3713            format!("channels/{CHANNEL_ID}/followers")
3714        );
3715    }
3716
3717    #[test]
3718    fn get_active_threads() {
3719        let route = Route::GetActiveThreads { guild_id: GUILD_ID };
3720        assert_eq!(
3721            route.to_string(),
3722            format!("guilds/{GUILD_ID}/threads/active")
3723        );
3724    }
3725
3726    #[test]
3727    fn get_bans() {
3728        let route = Route::GetBans { guild_id: GUILD_ID };
3729        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/bans"));
3730    }
3731
3732    #[test]
3733    fn get_bans_with_parameters() {
3734        let route = Route::GetBansWithParameters {
3735            after: None,
3736            before: None,
3737            guild_id: GUILD_ID,
3738            limit: None,
3739        };
3740        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/bans"));
3741
3742        let route = Route::GetBansWithParameters {
3743            after: Some(USER_ID),
3744            before: None,
3745            guild_id: GUILD_ID,
3746            limit: None,
3747        };
3748        assert_eq!(
3749            route.to_string(),
3750            format!("guilds/{GUILD_ID}/bans?after={USER_ID}")
3751        );
3752
3753        let route = Route::GetBansWithParameters {
3754            after: None,
3755            before: Some(USER_ID),
3756            guild_id: GUILD_ID,
3757            limit: None,
3758        };
3759        assert_eq!(
3760            route.to_string(),
3761            format!("guilds/{GUILD_ID}/bans?before={USER_ID}")
3762        );
3763
3764        let route = Route::GetBansWithParameters {
3765            after: None,
3766            before: None,
3767            guild_id: GUILD_ID,
3768            limit: Some(100),
3769        };
3770        assert_eq!(
3771            route.to_string(),
3772            format!("guilds/{GUILD_ID}/bans?limit={limit}", limit = 100)
3773        );
3774
3775        let route = Route::GetBansWithParameters {
3776            after: Some(USER_ID),
3777            before: Some(USER_ID + 100),
3778            guild_id: GUILD_ID,
3779            limit: Some(25),
3780        };
3781        assert_eq!(
3782            route.to_string(),
3783            format!(
3784                "guilds/{GUILD_ID}/bans?after={USER_ID}&before={before}&limit={limit}",
3785                before = USER_ID + 100,
3786                limit = 25,
3787            )
3788        );
3789    }
3790
3791    #[test]
3792    fn get_gateway_bot() {
3793        let route = Route::GetGatewayBot;
3794        assert_eq!(route.to_string(), "gateway/bot");
3795    }
3796
3797    #[test]
3798    fn get_entitlements() {
3799        let route = Route::GetEntitlements {
3800            after: Some(32),
3801            application_id: 1,
3802            before: Some(2),
3803            exclude_ended: Some(true),
3804            guild_id: Some(42),
3805            limit: Some(99),
3806            sku_ids: &[Id::new(7)],
3807            user_id: Some(11),
3808        };
3809
3810        assert_eq!(
3811            route.to_string(),
3812            "applications/1/entitlements?after=32&before=2&exclude_ended=true&guild_id=42&limit=99&sku_ids=7&user_id=11"
3813        );
3814    }
3815
3816    #[test]
3817    fn create_test_entitlement() {
3818        let route = Route::CreateTestEntitlement { application_id: 1 };
3819
3820        assert_eq!(route.to_string(), "applications/1/entitlements");
3821    }
3822
3823    #[test]
3824    fn get_command_permissions() {
3825        let route = Route::GetCommandPermissions {
3826            application_id: APPLICATION_ID,
3827            command_id: COMMAND_ID,
3828            guild_id: GUILD_ID,
3829        };
3830        assert_eq!(
3831            route.to_string(),
3832            format!(
3833                "applications/{APPLICATION_ID}/guilds/{GUILD_ID}/commands/{COMMAND_ID}/permissions"
3834            )
3835        );
3836    }
3837
3838    #[test]
3839    fn update_command_permissions() {
3840        let route = Route::UpdateCommandPermissions {
3841            application_id: APPLICATION_ID,
3842            command_id: COMMAND_ID,
3843            guild_id: GUILD_ID,
3844        };
3845        assert_eq!(
3846            route.to_string(),
3847            format!(
3848                "applications/{APPLICATION_ID}/guilds/{GUILD_ID}/commands/{COMMAND_ID}/permissions"
3849            )
3850        );
3851    }
3852
3853    #[test]
3854    fn get_current_authorization_info() {
3855        let route = Route::GetCurrentAuthorizationInformation;
3856        assert_eq!(route.to_string(), "oauth2/@me");
3857    }
3858
3859    #[test]
3860    fn get_current_user_application_info() {
3861        let route = Route::GetCurrentUserApplicationInfo;
3862        assert_eq!(route.to_string(), "applications/@me");
3863    }
3864
3865    #[test]
3866    fn update_current_user_application() {
3867        let route = Route::UpdateCurrentUserApplication;
3868        assert_eq!(route.to_string(), "applications/@me");
3869    }
3870
3871    #[test]
3872    fn get_current_user() {
3873        let route = Route::GetCurrentUser;
3874        assert_eq!(route.to_string(), "users/@me");
3875    }
3876
3877    #[test]
3878    fn get_current_user_guild_member() {
3879        let route = Route::GetCurrentUserGuildMember { guild_id: GUILD_ID };
3880        assert_eq!(
3881            route.to_string(),
3882            format!("users/@me/guilds/{GUILD_ID}/member")
3883        );
3884    }
3885
3886    #[test]
3887    fn update_current_user() {
3888        let route = Route::UpdateCurrentUser;
3889        assert_eq!(route.to_string(), "users/@me");
3890    }
3891
3892    #[test]
3893    fn get_gateway() {
3894        let route = Route::GetGateway;
3895        assert_eq!(route.to_string(), "gateway");
3896    }
3897
3898    #[test]
3899    fn get_guild_command_permissions() {
3900        let route = Route::GetGuildCommandPermissions {
3901            application_id: APPLICATION_ID,
3902            guild_id: GUILD_ID,
3903        };
3904        assert_eq!(
3905            route.to_string(),
3906            format!("applications/{APPLICATION_ID}/guilds/{GUILD_ID}/commands/permissions")
3907        );
3908    }
3909
3910    #[test]
3911    fn get_guild_invites() {
3912        let route = Route::GetGuildInvites { guild_id: GUILD_ID };
3913        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/invites"));
3914    }
3915
3916    #[test]
3917    fn get_guild_preview() {
3918        let route = Route::GetGuildPreview { guild_id: GUILD_ID };
3919        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/preview"));
3920    }
3921
3922    #[test]
3923    fn get_guild_sticker() {
3924        let route = Route::GetGuildSticker {
3925            guild_id: GUILD_ID,
3926            sticker_id: STICKER_ID,
3927        };
3928        assert_eq!(
3929            route.to_string(),
3930            format!("guilds/{GUILD_ID}/stickers/{STICKER_ID}")
3931        );
3932    }
3933
3934    #[test]
3935    fn delete_guild_sticker() {
3936        let route = Route::DeleteGuildSticker {
3937            guild_id: GUILD_ID,
3938            sticker_id: STICKER_ID,
3939        };
3940        assert_eq!(
3941            route.to_string(),
3942            format!("guilds/{GUILD_ID}/stickers/{STICKER_ID}")
3943        );
3944    }
3945
3946    #[test]
3947    fn update_guild_sticker() {
3948        let route = Route::UpdateGuildSticker {
3949            guild_id: GUILD_ID,
3950            sticker_id: STICKER_ID,
3951        };
3952        assert_eq!(
3953            route.to_string(),
3954            format!("guilds/{GUILD_ID}/stickers/{STICKER_ID}")
3955        );
3956    }
3957
3958    #[test]
3959    fn get_guild_vanity_url() {
3960        let route = Route::GetGuildVanityUrl { guild_id: GUILD_ID };
3961        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/vanity-url"));
3962    }
3963
3964    #[test]
3965    fn get_guild_voice_regions() {
3966        let route = Route::GetGuildVoiceRegions { guild_id: GUILD_ID };
3967        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/regions"));
3968    }
3969
3970    #[test]
3971    fn get_guild_welcome_screen() {
3972        let route = Route::GetGuildWelcomeScreen { guild_id: GUILD_ID };
3973        assert_eq!(
3974            route.to_string(),
3975            format!("guilds/{GUILD_ID}/welcome-screen")
3976        );
3977    }
3978
3979    #[test]
3980    fn update_guild_welcome_screen() {
3981        let route = Route::UpdateGuildWelcomeScreen { guild_id: GUILD_ID };
3982        assert_eq!(
3983            route.to_string(),
3984            format!("guilds/{GUILD_ID}/welcome-screen")
3985        );
3986    }
3987
3988    #[test]
3989    fn get_guild_webhooks() {
3990        let route = Route::GetGuildWebhooks { guild_id: GUILD_ID };
3991        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/webhooks"));
3992    }
3993
3994    #[test]
3995    fn get_guild_widget() {
3996        let route = Route::GetGuildWidget { guild_id: GUILD_ID };
3997        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/widget.json"));
3998    }
3999
4000    #[test]
4001    fn get_guild_widget_settings() {
4002        let route = Route::GetGuildWidgetSettings { guild_id: GUILD_ID };
4003        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/widget"));
4004    }
4005
4006    #[test]
4007    fn update_guild_widget_settings() {
4008        let route = Route::UpdateGuildWidgetSettings { guild_id: GUILD_ID };
4009        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/widget"));
4010    }
4011
4012    #[test]
4013    fn get_nitro_sticker_packs() {
4014        let route = Route::GetNitroStickerPacks;
4015
4016        assert_eq!(route.to_string(), "sticker-packs");
4017    }
4018
4019    #[test]
4020    fn get_pins() {
4021        let route = Route::GetPins {
4022            channel_id: CHANNEL_ID,
4023            limit: None,
4024            before: None,
4025        };
4026        assert_eq!(
4027            route.to_string(),
4028            format!("channels/{CHANNEL_ID}/messages/pins")
4029        );
4030    }
4031
4032    #[test]
4033    fn get_sticker() {
4034        let route = Route::GetSticker {
4035            sticker_id: STICKER_ID,
4036        };
4037        assert_eq!(route.to_string(), format!("stickers/{STICKER_ID}"));
4038    }
4039
4040    #[test]
4041    fn get_thread_members() {
4042        let route = Route::GetThreadMembers {
4043            after: None,
4044            channel_id: CHANNEL_ID,
4045            limit: None,
4046            with_member: None,
4047        };
4048        assert_eq!(
4049            route.to_string(),
4050            format!("channels/{CHANNEL_ID}/thread-members")
4051        );
4052
4053        let route = Route::GetThreadMembers {
4054            after: Some(USER_ID),
4055            channel_id: CHANNEL_ID,
4056            limit: Some(1),
4057            with_member: Some(true),
4058        };
4059
4060        assert_eq!(
4061            route.to_string(),
4062            format!(
4063                "channels/{CHANNEL_ID}/thread-members?after={USER_ID}&limit=1&with_member=true"
4064            )
4065        );
4066    }
4067
4068    #[test]
4069    fn get_user_connections() {
4070        let route = Route::GetUserConnections;
4071        assert_eq!(route.to_string(), "users/@me/connections");
4072    }
4073
4074    #[test]
4075    fn get_user() {
4076        let route = Route::GetUser { user_id: USER_ID };
4077        assert_eq!(route.to_string(), format!("users/{USER_ID}"));
4078    }
4079
4080    #[test]
4081    fn get_voice_regions() {
4082        let route = Route::GetVoiceRegions;
4083        assert_eq!(route.to_string(), "voice/regions");
4084    }
4085
4086    #[test]
4087    fn interaction_callback() {
4088        let route = Route::InteractionCallback {
4089            interaction_id: INTERACTION_ID,
4090            interaction_token: INTERACTION_TOKEN,
4091            with_response: true,
4092        };
4093        assert_eq!(
4094            route.to_string(),
4095            format!(
4096                "interactions/{INTERACTION_ID}/{INTERACTION_TOKEN}/callback?with_response=true"
4097            )
4098        );
4099    }
4100
4101    #[test]
4102    fn join_thread() {
4103        let route = Route::JoinThread {
4104            channel_id: CHANNEL_ID,
4105        };
4106        assert_eq!(
4107            route.to_string(),
4108            format!("channels/{CHANNEL_ID}/thread-members/@me")
4109        );
4110    }
4111
4112    #[test]
4113    fn leave_thread() {
4114        let route = Route::LeaveThread {
4115            channel_id: CHANNEL_ID,
4116        };
4117        assert_eq!(
4118            route.to_string(),
4119            format!("channels/{CHANNEL_ID}/thread-members/@me")
4120        );
4121    }
4122
4123    #[test]
4124    fn leave_guild() {
4125        let route = Route::LeaveGuild { guild_id: GUILD_ID };
4126        assert_eq!(route.to_string(), format!("users/@me/guilds/{GUILD_ID}"));
4127    }
4128
4129    #[test]
4130    fn pin_message() {
4131        let route = Route::PinMessage {
4132            channel_id: CHANNEL_ID,
4133            message_id: MESSAGE_ID,
4134        };
4135        assert_eq!(
4136            route.to_string(),
4137            format!("channels/{CHANNEL_ID}/messages/pins/{MESSAGE_ID}")
4138        );
4139    }
4140
4141    #[test]
4142    fn unpin_message() {
4143        let route = Route::UnpinMessage {
4144            channel_id: CHANNEL_ID,
4145            message_id: MESSAGE_ID,
4146        };
4147        assert_eq!(
4148            route.to_string(),
4149            format!("channels/{CHANNEL_ID}/messages/pins/{MESSAGE_ID}")
4150        );
4151    }
4152
4153    #[test]
4154    fn sync_guild_integration() {
4155        let route = Route::SyncGuildIntegration {
4156            guild_id: GUILD_ID,
4157            integration_id: INTEGRATION_ID,
4158        };
4159        assert_eq!(
4160            route.to_string(),
4161            format!("guilds/{GUILD_ID}/integrations/{INTEGRATION_ID}/sync")
4162        );
4163    }
4164
4165    #[test]
4166    fn update_current_member() {
4167        let route = Route::UpdateCurrentMember { guild_id: GUILD_ID };
4168        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/members/@me"));
4169    }
4170
4171    #[test]
4172    fn get_current_user_voice_state() {
4173        let route = Route::GetCurrentUserVoiceState { guild_id: GUILD_ID };
4174        assert_eq!(
4175            route.to_string(),
4176            format!("guilds/{GUILD_ID}/voice-states/@me")
4177        );
4178    }
4179
4180    #[test]
4181    fn update_current_user_voice_state() {
4182        let route = Route::UpdateCurrentUserVoiceState { guild_id: GUILD_ID };
4183        assert_eq!(
4184            route.to_string(),
4185            format!("guilds/{GUILD_ID}/voice-states/@me")
4186        );
4187    }
4188
4189    #[test]
4190    fn update_nickname() {
4191        let route = Route::UpdateNickname { guild_id: GUILD_ID };
4192        assert_eq!(
4193            route.to_string(),
4194            format!("guilds/{GUILD_ID}/members/@me/nick")
4195        );
4196    }
4197
4198    #[test]
4199    fn get_user_voice_state() {
4200        let route = Route::GetUserVoiceState {
4201            guild_id: GUILD_ID,
4202            user_id: USER_ID,
4203        };
4204        assert_eq!(
4205            route.to_string(),
4206            format!("guilds/{GUILD_ID}/voice-states/{USER_ID}")
4207        );
4208    }
4209
4210    #[test]
4211    fn update_user_voice_state() {
4212        let route = Route::UpdateUserVoiceState {
4213            guild_id: GUILD_ID,
4214            user_id: USER_ID,
4215        };
4216        assert_eq!(
4217            route.to_string(),
4218            format!("guilds/{GUILD_ID}/voice-states/{USER_ID}")
4219        );
4220    }
4221
4222    #[test]
4223    fn create_ban() {
4224        let mut route = Route::CreateBan {
4225            guild_id: GUILD_ID,
4226            user_id: USER_ID,
4227        };
4228        assert_eq!(
4229            route.to_string(),
4230            format!("guilds/{GUILD_ID}/bans/{USER_ID}")
4231        );
4232
4233        route = Route::CreateBan {
4234            guild_id: GUILD_ID,
4235            user_id: USER_ID,
4236        };
4237        assert_eq!(
4238            route.to_string(),
4239            format!("guilds/{GUILD_ID}/bans/{USER_ID}")
4240        );
4241    }
4242
4243    #[test]
4244    fn create_guild_prune_none() {
4245        let route = Route::CreateGuildPrune {
4246            compute_prune_count: None,
4247            days: None,
4248            guild_id: GUILD_ID,
4249            include_roles: &[],
4250        };
4251        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/prune"));
4252    }
4253
4254    #[test]
4255    fn create_guild_prune_compute_prune_count_true() {
4256        let route = Route::CreateGuildPrune {
4257            compute_prune_count: Some(true),
4258            days: None,
4259            guild_id: GUILD_ID,
4260            include_roles: &[],
4261        };
4262        assert_eq!(
4263            route.to_string(),
4264            format!("guilds/{GUILD_ID}/prune?compute_prune_count=true")
4265        );
4266    }
4267
4268    #[test]
4269    fn create_guild_prune_compute_prune_count_false() {
4270        let route = Route::CreateGuildPrune {
4271            compute_prune_count: Some(false),
4272            days: None,
4273            guild_id: GUILD_ID,
4274            include_roles: &[],
4275        };
4276        assert_eq!(
4277            route.to_string(),
4278            format!("guilds/{GUILD_ID}/prune?compute_prune_count=false")
4279        );
4280    }
4281
4282    #[test]
4283    fn create_guild_prune_days() {
4284        let route = Route::CreateGuildPrune {
4285            compute_prune_count: None,
4286            days: Some(4),
4287            guild_id: GUILD_ID,
4288            include_roles: &[],
4289        };
4290        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/prune?days=4"));
4291    }
4292
4293    #[test]
4294    fn create_guild_prune_include_one_role() {
4295        let include_roles = [Id::new(1)];
4296
4297        let route = Route::CreateGuildPrune {
4298            compute_prune_count: None,
4299            days: None,
4300            guild_id: GUILD_ID,
4301            include_roles: &include_roles,
4302        };
4303        assert_eq!(
4304            route.to_string(),
4305            format!("guilds/{GUILD_ID}/prune?include_roles=1")
4306        );
4307    }
4308
4309    #[test]
4310    fn create_guild_prune_include_two_roles() {
4311        let include_roles = [Id::new(1), Id::new(2)];
4312
4313        let route = Route::CreateGuildPrune {
4314            compute_prune_count: None,
4315            days: None,
4316            guild_id: GUILD_ID,
4317            include_roles: &include_roles,
4318        };
4319        assert_eq!(
4320            route.to_string(),
4321            format!("guilds/{GUILD_ID}/prune?include_roles=1,2")
4322        );
4323    }
4324
4325    #[test]
4326    fn create_guild_prune_all() {
4327        let include_roles = [Id::new(1), Id::new(2)];
4328
4329        let route = Route::CreateGuildPrune {
4330            compute_prune_count: Some(true),
4331            days: Some(4),
4332            guild_id: GUILD_ID,
4333            include_roles: &include_roles,
4334        };
4335        assert_eq!(
4336            route.to_string(),
4337            format!("guilds/{GUILD_ID}/prune?compute_prune_count=true&days=4&include_roles=1,2")
4338        );
4339    }
4340
4341    #[test]
4342    fn get_guild_scheduled_events() {
4343        let route = Route::GetGuildScheduledEvents {
4344            guild_id: GUILD_ID,
4345            with_user_count: false,
4346        };
4347
4348        assert_eq!(
4349            route.to_string(),
4350            format!("guilds/{GUILD_ID}/scheduled-events")
4351        );
4352
4353        let route = Route::GetGuildScheduledEvents {
4354            guild_id: GUILD_ID,
4355            with_user_count: true,
4356        };
4357
4358        assert_eq!(
4359            route.to_string(),
4360            format!("guilds/{GUILD_ID}/scheduled-events?with_user_count=true")
4361        );
4362    }
4363
4364    #[test]
4365    fn create_guild_scheduled_event() {
4366        let route = Route::CreateGuildScheduledEvent { guild_id: GUILD_ID };
4367
4368        assert_eq!(
4369            route.to_string(),
4370            format!("guilds/{GUILD_ID}/scheduled-events")
4371        );
4372    }
4373
4374    #[test]
4375    fn get_guild_scheduled_event() {
4376        let route = Route::GetGuildScheduledEvent {
4377            guild_id: GUILD_ID,
4378            scheduled_event_id: SCHEDULED_EVENT_ID,
4379            with_user_count: false,
4380        };
4381
4382        assert_eq!(
4383            route.to_string(),
4384            format!("guilds/{GUILD_ID}/scheduled-events/{SCHEDULED_EVENT_ID}")
4385        );
4386
4387        let route = Route::GetGuildScheduledEvent {
4388            guild_id: GUILD_ID,
4389            scheduled_event_id: SCHEDULED_EVENT_ID,
4390            with_user_count: true,
4391        };
4392
4393        assert_eq!(
4394            route.to_string(),
4395            format!("guilds/{GUILD_ID}/scheduled-events/{SCHEDULED_EVENT_ID}?with_user_count=true")
4396        );
4397    }
4398
4399    #[test]
4400    fn update_guild_scheduled_event() {
4401        let route = Route::UpdateGuildScheduledEvent {
4402            guild_id: GUILD_ID,
4403            scheduled_event_id: SCHEDULED_EVENT_ID,
4404        };
4405
4406        assert_eq!(
4407            route.to_string(),
4408            format!("guilds/{GUILD_ID}/scheduled-events/{SCHEDULED_EVENT_ID}")
4409        );
4410    }
4411
4412    #[test]
4413    fn delete_guild_scheduled_event() {
4414        let route = Route::DeleteGuildScheduledEvent {
4415            guild_id: GUILD_ID,
4416            scheduled_event_id: SCHEDULED_EVENT_ID,
4417        };
4418
4419        assert_eq!(
4420            route.to_string(),
4421            format!("guilds/{GUILD_ID}/scheduled-events/{SCHEDULED_EVENT_ID}")
4422        );
4423    }
4424
4425    #[test]
4426    fn get_guild_scheduled_event_users() {
4427        let route = Route::GetGuildScheduledEventUsers {
4428            after: None,
4429            before: Some(USER_ID),
4430            guild_id: GUILD_ID,
4431            limit: None,
4432            scheduled_event_id: SCHEDULED_EVENT_ID,
4433            with_member: true,
4434        };
4435
4436        assert_eq!(
4437            route.to_string(),
4438            format!(
4439                "guilds/{GUILD_ID}/scheduled-events/{SCHEDULED_EVENT_ID}/users?before={USER_ID}&with_member=true"
4440            )
4441        );
4442
4443        let route = Route::GetGuildScheduledEventUsers {
4444            after: Some(USER_ID),
4445            before: None,
4446            guild_id: GUILD_ID,
4447            limit: Some(101),
4448            scheduled_event_id: SCHEDULED_EVENT_ID,
4449            with_member: false,
4450        };
4451
4452        assert_eq!(
4453            route.to_string(),
4454            format!(
4455                "guilds/{GUILD_ID}/scheduled-events/{SCHEDULED_EVENT_ID}/users?after={USER_ID}&limit=101"
4456            )
4457        );
4458
4459        let route = Route::GetGuildScheduledEventUsers {
4460            after: Some(USER_ID),
4461            before: Some(USER_ID),
4462            guild_id: GUILD_ID,
4463            limit: Some(99),
4464            scheduled_event_id: SCHEDULED_EVENT_ID,
4465            with_member: false,
4466        };
4467
4468        assert_eq!(
4469            route.to_string(),
4470            format!(
4471                "guilds/{GUILD_ID}/scheduled-events/{SCHEDULED_EVENT_ID}/users?after={USER_ID}&before={USER_ID}&limit=99"
4472            )
4473        );
4474    }
4475
4476    #[test]
4477    fn search_guild_members() {
4478        let route = Route::SearchGuildMembers {
4479            guild_id: GUILD_ID,
4480            limit: Some(99),
4481            query: "foo bar",
4482        };
4483
4484        assert_eq!(
4485            route.to_string(),
4486            format!("guilds/{GUILD_ID}/members/search?query=foo%20bar&limit=99")
4487        );
4488
4489        let route = Route::SearchGuildMembers {
4490            guild_id: GUILD_ID,
4491            limit: Some(99),
4492            query: "foo/bar",
4493        };
4494
4495        assert_eq!(
4496            route.to_string(),
4497            format!("guilds/{GUILD_ID}/members/search?query=foo%2Fbar&limit=99")
4498        );
4499    }
4500
4501    #[test]
4502    fn update_guild_mfa() {
4503        let route = Route::UpdateGuildMfa { guild_id: GUILD_ID };
4504        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/mfa"));
4505    }
4506
4507    #[test]
4508    fn create_auto_moderation_rule() {
4509        let route = Route::CreateAutoModerationRule { guild_id: GUILD_ID };
4510        assert_eq!(
4511            route.to_string(),
4512            format!("guilds/{GUILD_ID}/auto-moderation/rules")
4513        );
4514    }
4515
4516    #[test]
4517    fn delete_auto_moderation_rule() {
4518        let route = Route::DeleteAutoModerationRule {
4519            guild_id: GUILD_ID,
4520            auto_moderation_rule_id: AUTO_MODERATION_RULE_ID,
4521        };
4522        assert_eq!(
4523            route.to_string(),
4524            format!("guilds/{GUILD_ID}/auto-moderation/rules/{AUTO_MODERATION_RULE_ID}")
4525        );
4526    }
4527
4528    #[test]
4529    fn get_auto_moderation_rule() {
4530        let route = Route::GetAutoModerationRule {
4531            guild_id: GUILD_ID,
4532            auto_moderation_rule_id: AUTO_MODERATION_RULE_ID,
4533        };
4534        assert_eq!(
4535            route.to_string(),
4536            format!("guilds/{GUILD_ID}/auto-moderation/rules/{AUTO_MODERATION_RULE_ID}")
4537        );
4538    }
4539
4540    #[test]
4541    fn get_guild_auto_moderation_rules() {
4542        let route = Route::GetGuildAutoModerationRules { guild_id: GUILD_ID };
4543        assert_eq!(
4544            route.to_string(),
4545            format!("guilds/{GUILD_ID}/auto-moderation/rules")
4546        );
4547    }
4548
4549    #[test]
4550    fn update_auto_moderation_rule() {
4551        let route = Route::UpdateAutoModerationRule {
4552            guild_id: GUILD_ID,
4553            auto_moderation_rule_id: AUTO_MODERATION_RULE_ID,
4554        };
4555        assert_eq!(
4556            route.to_string(),
4557            format!("guilds/{GUILD_ID}/auto-moderation/rules/{AUTO_MODERATION_RULE_ID}")
4558        );
4559    }
4560
4561    #[test]
4562    fn get_guild_onboarding() {
4563        let route = Route::GetGuildOnboarding { guild_id: GUILD_ID };
4564        assert_eq!(route.to_string(), format!("guilds/{GUILD_ID}/onboarding"));
4565    }
4566
4567    #[test]
4568    fn get_skus() {
4569        let route = Route::GetSKUs { application_id: 1 };
4570        assert_eq!(route.to_string(), format!("applications/1/skus"));
4571    }
4572}