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