forgejo_api/generated/
methods.rs

1use super::structs::*;
2use crate::generated::endpoints;
3use crate::Endpoint;
4use crate::Request;
5use bytes::Bytes;
6use std::collections::BTreeMap;
7
8impl crate::Forgejo {
9    /// Returns the instance's Actor
10    pub fn activitypub_instance_actor(
11        &self,
12    ) -> Request<'_, endpoints::ActivitypubInstanceActor, ActivityPub> {
13        endpoints::ActivitypubInstanceActor {}
14            .make_request()
15            .wrap::<_, _>(self)
16    }
17
18    /// Send to the inbox
19    pub fn activitypub_instance_actor_inbox(
20        &self,
21    ) -> Request<'_, endpoints::ActivitypubInstanceActorInbox, ()> {
22        endpoints::ActivitypubInstanceActorInbox {}
23            .make_request()
24            .wrap::<_, _>(self)
25    }
26
27    /// Returns the Repository actor for a repo
28    ///
29    /// - `repository-id`: repository ID of the repo
30    pub fn activitypub_repository(
31        &self,
32        repository_id: i64,
33    ) -> Request<'_, endpoints::ActivitypubRepository, ActivityPub> {
34        endpoints::ActivitypubRepository { repository_id }
35            .make_request()
36            .wrap::<_, _>(self)
37    }
38
39    /// Send to the inbox
40    ///
41    /// - `repository-id`: repository ID of the repo
42    /// - `body`: See [`ForgeLike`]
43    pub fn activitypub_repository_inbox(
44        &self,
45        repository_id: i64,
46        body: ForgeLike,
47    ) -> Request<'_, endpoints::ActivitypubRepositoryInbox, ()> {
48        endpoints::ActivitypubRepositoryInbox {
49            repository_id,
50            body: body,
51        }
52        .make_request()
53        .wrap::<_, _>(self)
54    }
55
56    /// Returns the Person actor for a user
57    ///
58    /// - `user-id`: user ID of the user
59    pub fn activitypub_person(
60        &self,
61        user_id: i64,
62    ) -> Request<'_, endpoints::ActivitypubPerson, ActivityPub> {
63        endpoints::ActivitypubPerson { user_id }
64            .make_request()
65            .wrap::<_, _>(self)
66    }
67
68    /// Get a specific activity object of the user
69    ///
70    /// - `user-id`: user ID of the user
71    /// - `activity-id`: activity ID of the sought activity
72    pub fn activitypub_person_activity_note(
73        &self,
74        user_id: u32,
75        activity_id: u32,
76    ) -> Request<'_, endpoints::ActivitypubPersonActivityNote, ActivityPub> {
77        endpoints::ActivitypubPersonActivityNote {
78            user_id,
79            activity_id,
80        }
81        .make_request()
82        .wrap::<_, _>(self)
83    }
84
85    /// Get a specific activity of the user
86    ///
87    /// - `user-id`: user ID of the user
88    /// - `activity-id`: activity ID of the sought activity
89    pub fn activitypub_person_activity(
90        &self,
91        user_id: u32,
92        activity_id: u32,
93    ) -> Request<'_, endpoints::ActivitypubPersonActivity, ActivityPub> {
94        endpoints::ActivitypubPersonActivity {
95            user_id,
96            activity_id,
97        }
98        .make_request()
99        .wrap::<_, _>(self)
100    }
101
102    /// Send to the inbox
103    ///
104    /// - `user-id`: user ID of the user
105    pub fn activitypub_person_inbox(
106        &self,
107        user_id: i64,
108    ) -> Request<'_, endpoints::ActivitypubPersonInbox, ()> {
109        endpoints::ActivitypubPersonInbox { user_id }
110            .make_request()
111            .wrap::<_, _>(self)
112    }
113
114    /// List the user's recorded activity
115    ///
116    /// - `user-id`: user ID of the user
117    pub fn activitypub_person_feed(
118        &self,
119        user_id: u32,
120    ) -> Request<'_, endpoints::ActivitypubPersonFeed, Vec<APPersonFollowItem>> {
121        endpoints::ActivitypubPersonFeed { user_id }
122            .make_request()
123            .wrap::<_, _>(self)
124    }
125
126    /// List cron tasks
127    ///
128    pub fn admin_cron_list(
129        &self,
130    ) -> Request<'_, endpoints::AdminCronList, (CronListHeaders, Vec<Cron>)> {
131        endpoints::AdminCronList {}
132            .make_request()
133            .wrap::<_, _>(self)
134    }
135
136    /// Run cron task
137    ///
138    /// - `task`: task to run
139    pub fn admin_cron_run(&self, task: &str) -> Request<'_, endpoints::AdminCronRun<'_>, ()> {
140        endpoints::AdminCronRun { task }
141            .make_request()
142            .wrap::<_, _>(self)
143    }
144
145    /// List all users' email addresses
146    ///
147    pub fn admin_get_all_emails(&self) -> Request<'_, endpoints::AdminGetAllEmails, Vec<Email>> {
148        endpoints::AdminGetAllEmails {}
149            .make_request()
150            .wrap::<_, _>(self)
151    }
152
153    /// Search users' email addresses
154    ///
155    pub fn admin_search_emails(
156        &self,
157        query: AdminSearchEmailsQuery,
158    ) -> Request<'_, endpoints::AdminSearchEmails, Vec<Email>> {
159        endpoints::AdminSearchEmails { query }
160            .make_request()
161            .wrap::<_, _>(self)
162    }
163
164    /// List global (system) webhooks
165    ///
166    pub fn admin_list_hooks(
167        &self,
168    ) -> Request<'_, endpoints::AdminListHooks, (HookListHeaders, Vec<Hook>)> {
169        endpoints::AdminListHooks {}
170            .make_request()
171            .wrap::<_, _>(self)
172    }
173
174    /// Create a hook
175    ///
176    /// - `body`: See [`CreateHookOption`]
177    pub fn admin_create_hook(
178        &self,
179        body: CreateHookOption,
180    ) -> Request<'_, endpoints::AdminCreateHook, Hook> {
181        endpoints::AdminCreateHook { body: body }
182            .make_request()
183            .wrap::<_, _>(self)
184    }
185
186    /// Get a hook
187    ///
188    /// - `id`: id of the hook to get
189    pub fn admin_get_hook(&self, id: i64) -> Request<'_, endpoints::AdminGetHook, Hook> {
190        endpoints::AdminGetHook { id }
191            .make_request()
192            .wrap::<_, _>(self)
193    }
194
195    /// Delete a hook
196    ///
197    /// - `id`: id of the hook to delete
198    pub fn admin_delete_hook(&self, id: i64) -> Request<'_, endpoints::AdminDeleteHook, ()> {
199        endpoints::AdminDeleteHook { id }
200            .make_request()
201            .wrap::<_, _>(self)
202    }
203
204    /// Update a hook
205    ///
206    /// - `id`: id of the hook to update
207    /// - `body`: See [`EditHookOption`]
208    pub fn admin_edit_hook(
209        &self,
210        id: i64,
211        body: EditHookOption,
212    ) -> Request<'_, endpoints::AdminEditHook, Hook> {
213        endpoints::AdminEditHook { id, body: body }
214            .make_request()
215            .wrap::<_, _>(self)
216    }
217
218    /// List all organizations
219    ///
220    pub fn admin_get_all_orgs(
221        &self,
222    ) -> Request<'_, endpoints::AdminGetAllOrgs, (OrganizationListHeaders, Vec<Organization>)> {
223        endpoints::AdminGetAllOrgs {}
224            .make_request()
225            .wrap::<_, _>(self)
226    }
227
228    /// List the available quota groups
229    pub fn admin_list_quota_groups(
230        &self,
231    ) -> Request<'_, endpoints::AdminListQuotaGroups, (QuotaGroupListHeaders, Vec<QuotaGroup>)>
232    {
233        endpoints::AdminListQuotaGroups {}
234            .make_request()
235            .wrap::<_, _>(self)
236    }
237
238    /// Create a new quota group
239    ///
240    /// - `group`: Definition of the quota group
241
242    ///   See [`CreateQuotaGroupOptions`]
243    pub fn admin_create_quota_group(
244        &self,
245        group: CreateQuotaGroupOptions,
246    ) -> Request<'_, endpoints::AdminCreateQuotaGroup, QuotaGroup> {
247        endpoints::AdminCreateQuotaGroup { body: group }
248            .make_request()
249            .wrap::<_, _>(self)
250    }
251
252    /// Get information about the quota group
253    ///
254    /// - `quotagroup`: quota group to query
255    pub fn admin_get_quota_group(
256        &self,
257        quotagroup: &str,
258    ) -> Request<'_, endpoints::AdminGetQuotaGroup<'_>, QuotaGroup> {
259        endpoints::AdminGetQuotaGroup { quotagroup }
260            .make_request()
261            .wrap::<_, _>(self)
262    }
263
264    /// Delete a quota group
265    ///
266    /// - `quotagroup`: quota group to delete
267    pub fn admin_delete_quota_group(
268        &self,
269        quotagroup: &str,
270    ) -> Request<'_, endpoints::AdminDeleteQuotaGroup<'_>, ()> {
271        endpoints::AdminDeleteQuotaGroup { quotagroup }
272            .make_request()
273            .wrap::<_, _>(self)
274    }
275
276    /// Adds a rule to a quota group
277    ///
278    /// - `quotagroup`: quota group to add a rule to
279    /// - `quotarule`: the name of the quota rule to add to the group
280    pub fn admin_add_rule_to_quota_group(
281        &self,
282        quotagroup: &str,
283        quotarule: &str,
284    ) -> Request<'_, endpoints::AdminAddRuleToQuotaGroup<'_>, ()> {
285        endpoints::AdminAddRuleToQuotaGroup {
286            quotagroup,
287            quotarule,
288        }
289        .make_request()
290        .wrap::<_, _>(self)
291    }
292
293    /// Removes a rule from a quota group
294    ///
295    /// - `quotagroup`: quota group to remove a rule from
296    /// - `quotarule`: the name of the quota rule to remove from the group
297    pub fn admin_remove_rule_from_quota_group(
298        &self,
299        quotagroup: &str,
300        quotarule: &str,
301    ) -> Request<'_, endpoints::AdminRemoveRuleFromQuotaGroup<'_>, ()> {
302        endpoints::AdminRemoveRuleFromQuotaGroup {
303            quotagroup,
304            quotarule,
305        }
306        .make_request()
307        .wrap::<_, _>(self)
308    }
309
310    /// List users in a quota group
311    ///
312    /// - `quotagroup`: quota group to list members of
313    pub fn admin_list_users_in_quota_group(
314        &self,
315        quotagroup: &str,
316    ) -> Request<'_, endpoints::AdminListUsersInQuotaGroup<'_>, (UserListHeaders, Vec<User>)> {
317        endpoints::AdminListUsersInQuotaGroup { quotagroup }
318            .make_request()
319            .wrap::<_, _>(self)
320    }
321
322    /// Add a user to a quota group
323    ///
324    /// - `quotagroup`: quota group to add the user to
325    /// - `username`: username of the user to add to the quota group
326    pub fn admin_add_user_to_quota_group(
327        &self,
328        quotagroup: &str,
329        username: &str,
330    ) -> Request<'_, endpoints::AdminAddUserToQuotaGroup<'_>, ()> {
331        endpoints::AdminAddUserToQuotaGroup {
332            quotagroup,
333            username,
334        }
335        .make_request()
336        .wrap::<_, _>(self)
337    }
338
339    /// Remove a user from a quota group
340    ///
341    /// - `quotagroup`: quota group to remove a user from
342    /// - `username`: username of the user to remove from the quota group
343    pub fn admin_remove_user_from_quota_group(
344        &self,
345        quotagroup: &str,
346        username: &str,
347    ) -> Request<'_, endpoints::AdminRemoveUserFromQuotaGroup<'_>, ()> {
348        endpoints::AdminRemoveUserFromQuotaGroup {
349            quotagroup,
350            username,
351        }
352        .make_request()
353        .wrap::<_, _>(self)
354    }
355
356    /// List the available quota rules
357    pub fn admin_list_quota_rules(
358        &self,
359    ) -> Request<'_, endpoints::AdminListQuotaRules, (QuotaRuleInfoListHeaders, Vec<QuotaRuleInfo>)>
360    {
361        endpoints::AdminListQuotaRules {}
362            .make_request()
363            .wrap::<_, _>(self)
364    }
365
366    /// Create a new quota rule
367    ///
368    /// - `rule`: Definition of the quota rule
369
370    ///   See [`CreateQuotaRuleOptions`]
371    pub fn admin_create_quota_rule(
372        &self,
373        rule: CreateQuotaRuleOptions,
374    ) -> Request<'_, endpoints::AdminCreateQuotaRule, QuotaRuleInfo> {
375        endpoints::AdminCreateQuotaRule { body: rule }
376            .make_request()
377            .wrap::<_, _>(self)
378    }
379
380    /// Get information about a quota rule
381    ///
382    /// - `quotarule`: quota rule to query
383    pub fn admin_get_quota_rule(
384        &self,
385        quotarule: &str,
386    ) -> Request<'_, endpoints::AdminGetQuotaRule<'_>, QuotaRuleInfo> {
387        endpoints::AdminGetQuotaRule { quotarule }
388            .make_request()
389            .wrap::<_, _>(self)
390    }
391
392    /// Deletes a quota rule
393    ///
394    /// - `quotarule`: quota rule to delete
395    pub fn admin_delete_quota_rule(
396        &self,
397        quotarule: &str,
398    ) -> Request<'_, endpoints::AdminDeleteQuotaRule<'_>, ()> {
399        endpoints::AdminDeleteQuotaRule { quotarule }
400            .make_request()
401            .wrap::<_, _>(self)
402    }
403
404    /// Change an existing quota rule
405    ///
406    /// - `quotarule`: Quota rule to change
407    /// - `rule`: See [`EditQuotaRuleOptions`]
408    pub fn admin_edit_quota_rule(
409        &self,
410        quotarule: &str,
411        rule: EditQuotaRuleOptions,
412    ) -> Request<'_, endpoints::AdminEditQuotaRule<'_>, QuotaRuleInfo> {
413        endpoints::AdminEditQuotaRule {
414            quotarule,
415            body: rule,
416        }
417        .make_request()
418        .wrap::<_, _>(self)
419    }
420
421    /// Search action jobs according filter conditions
422    ///
423    pub fn admin_search_run_jobs(
424        &self,
425        query: AdminSearchRunJobsQuery,
426    ) -> Request<'_, endpoints::AdminSearchRunJobs, Vec<ActionRunJob>> {
427        endpoints::AdminSearchRunJobs { query }
428            .make_request()
429            .wrap::<_, _>(self)
430    }
431
432    /// Get an global actions runner registration token
433    pub fn admin_get_runner_registration_token(
434        &self,
435    ) -> Request<'_, endpoints::AdminGetRunnerRegistrationToken, RegistrationToken> {
436        endpoints::AdminGetRunnerRegistrationToken {}
437            .make_request()
438            .wrap::<_, _>(self)
439    }
440
441    /// List unadopted repositories
442    ///
443    pub fn admin_unadopted_list(
444        &self,
445        query: AdminUnadoptedListQuery,
446    ) -> Request<'_, endpoints::AdminUnadoptedList, Vec<String>> {
447        endpoints::AdminUnadoptedList { query }
448            .make_request()
449            .wrap::<_, _>(self)
450    }
451
452    /// Adopt unadopted files as a repository
453    ///
454    /// - `owner`: owner of the repo
455    /// - `repo`: name of the repo
456    pub fn admin_adopt_repository(
457        &self,
458        owner: &str,
459        repo: &str,
460    ) -> Request<'_, endpoints::AdminAdoptRepository<'_>, ()> {
461        endpoints::AdminAdoptRepository { owner, repo }
462            .make_request()
463            .wrap::<_, _>(self)
464    }
465
466    /// Delete unadopted files
467    ///
468    /// - `owner`: owner of the repo
469    /// - `repo`: name of the repo
470    pub fn admin_delete_unadopted_repository(
471        &self,
472        owner: &str,
473        repo: &str,
474    ) -> Request<'_, endpoints::AdminDeleteUnadoptedRepository<'_>, ()> {
475        endpoints::AdminDeleteUnadoptedRepository { owner, repo }
476            .make_request()
477            .wrap::<_, _>(self)
478    }
479
480    /// Search users according filter conditions
481    ///
482    pub fn admin_search_users(
483        &self,
484        query: AdminSearchUsersQuery,
485    ) -> Request<'_, endpoints::AdminSearchUsers, (UserListHeaders, Vec<User>)> {
486        endpoints::AdminSearchUsers { query }
487            .make_request()
488            .wrap::<_, _>(self)
489    }
490
491    /// Create a user account
492    ///
493    /// - `body`: See [`CreateUserOption`]
494    pub fn admin_create_user(
495        &self,
496        body: CreateUserOption,
497    ) -> Request<'_, endpoints::AdminCreateUser, User> {
498        endpoints::AdminCreateUser { body: body }
499            .make_request()
500            .wrap::<_, _>(self)
501    }
502
503    /// Delete user account
504    ///
505    /// - `username`: username of user to delete
506    pub fn admin_delete_user(
507        &self,
508        username: &str,
509        query: AdminDeleteUserQuery,
510    ) -> Request<'_, endpoints::AdminDeleteUser<'_>, ()> {
511        endpoints::AdminDeleteUser { username, query }
512            .make_request()
513            .wrap::<_, _>(self)
514    }
515
516    /// Edit an existing user
517    ///
518    /// - `username`: username of user to edit
519    /// - `body`: See [`EditUserOption`]
520    pub fn admin_edit_user(
521        &self,
522        username: &str,
523        body: EditUserOption,
524    ) -> Request<'_, endpoints::AdminEditUser<'_>, User> {
525        endpoints::AdminEditUser {
526            username,
527            body: body,
528        }
529        .make_request()
530        .wrap::<_, _>(self)
531    }
532
533    /// Add an SSH public key to user's account
534    ///
535    /// - `username`: username of the user
536    /// - `key`: See [`CreateKeyOption`]
537    pub fn admin_create_public_key(
538        &self,
539        username: &str,
540        key: CreateKeyOption,
541    ) -> Request<'_, endpoints::AdminCreatePublicKey<'_>, PublicKey> {
542        endpoints::AdminCreatePublicKey {
543            username,
544            body: key,
545        }
546        .make_request()
547        .wrap::<_, _>(self)
548    }
549
550    /// Remove a public key from user's account
551    ///
552    /// - `username`: username of user
553    /// - `id`: id of the key to delete
554    pub fn admin_delete_user_public_key(
555        &self,
556        username: &str,
557        id: i64,
558    ) -> Request<'_, endpoints::AdminDeleteUserPublicKey<'_>, ()> {
559        endpoints::AdminDeleteUserPublicKey { username, id }
560            .make_request()
561            .wrap::<_, _>(self)
562    }
563
564    /// Create an organization
565    ///
566    /// - `username`: username of the user that will own the created organization
567    /// - `organization`: See [`CreateOrgOption`]
568    pub fn admin_create_org(
569        &self,
570        username: &str,
571        organization: CreateOrgOption,
572    ) -> Request<'_, endpoints::AdminCreateOrg<'_>, Organization> {
573        endpoints::AdminCreateOrg {
574            username,
575            body: organization,
576        }
577        .make_request()
578        .wrap::<_, _>(self)
579    }
580
581    /// Get the user's quota info
582    ///
583    /// - `username`: username of user to query
584    pub fn admin_get_user_quota(
585        &self,
586        username: &str,
587    ) -> Request<'_, endpoints::AdminGetUserQuota<'_>, QuotaInfo> {
588        endpoints::AdminGetUserQuota { username }
589            .make_request()
590            .wrap::<_, _>(self)
591    }
592
593    /// Set the user's quota groups to a given list.
594    ///
595    /// - `username`: username of the user to modify the quota groups from
596    /// - `groups`: list of groups that the user should be a member of
597
598    ///   See [`SetUserQuotaGroupsOptions`]
599    pub fn admin_set_user_quota_groups(
600        &self,
601        username: &str,
602        groups: SetUserQuotaGroupsOptions,
603    ) -> Request<'_, endpoints::AdminSetUserQuotaGroups<'_>, ()> {
604        endpoints::AdminSetUserQuotaGroups {
605            username,
606            body: groups,
607        }
608        .make_request()
609        .wrap::<_, _>(self)
610    }
611
612    /// Rename a user
613    ///
614    /// - `username`: existing username of user
615    /// - `body`: See [`RenameUserOption`]
616    pub fn admin_rename_user(
617        &self,
618        username: &str,
619        body: RenameUserOption,
620    ) -> Request<'_, endpoints::AdminRenameUser<'_>, ()> {
621        endpoints::AdminRenameUser {
622            username,
623            body: body,
624        }
625        .make_request()
626        .wrap::<_, _>(self)
627    }
628
629    /// Create a repository on behalf of a user
630    ///
631    /// - `username`: username of the user. This user will own the created repository
632    /// - `repository`: See [`CreateRepoOption`]
633    pub fn admin_create_repo(
634        &self,
635        username: &str,
636        repository: CreateRepoOption,
637    ) -> Request<'_, endpoints::AdminCreateRepo<'_>, Repository> {
638        endpoints::AdminCreateRepo {
639            username,
640            body: repository,
641        }
642        .make_request()
643        .wrap::<_, _>(self)
644    }
645
646    /// Returns a list of all gitignore templates
647    pub fn list_gitignores_templates(
648        &self,
649    ) -> Request<'_, endpoints::ListGitignoresTemplates, Vec<String>> {
650        endpoints::ListGitignoresTemplates {}
651            .make_request()
652            .wrap::<_, _>(self)
653    }
654
655    /// Returns information about a gitignore template
656    ///
657    /// - `name`: name of the template
658    pub fn get_gitignore_template_info(
659        &self,
660        name: &str,
661    ) -> Request<'_, endpoints::GetGitignoreTemplateInfo<'_>, GitignoreTemplateInfo> {
662        endpoints::GetGitignoreTemplateInfo { name }
663            .make_request()
664            .wrap::<_, _>(self)
665    }
666
667    /// Returns a list of all label templates
668    pub fn list_label_templates(&self) -> Request<'_, endpoints::ListLabelTemplates, Vec<String>> {
669        endpoints::ListLabelTemplates {}
670            .make_request()
671            .wrap::<_, _>(self)
672    }
673
674    /// Returns all labels in a template
675    ///
676    /// - `name`: name of the template
677    pub fn get_label_template_info(
678        &self,
679        name: &str,
680    ) -> Request<'_, endpoints::GetLabelTemplateInfo<'_>, Vec<LabelTemplate>> {
681        endpoints::GetLabelTemplateInfo { name }
682            .make_request()
683            .wrap::<_, _>(self)
684    }
685
686    /// Returns a list of all license templates
687    pub fn list_license_templates(
688        &self,
689    ) -> Request<'_, endpoints::ListLicenseTemplates, Vec<LicensesTemplateListEntry>> {
690        endpoints::ListLicenseTemplates {}
691            .make_request()
692            .wrap::<_, _>(self)
693    }
694
695    /// Returns information about a license template
696    ///
697    /// - `name`: name of the license
698    pub fn get_license_template_info(
699        &self,
700        name: &str,
701    ) -> Request<'_, endpoints::GetLicenseTemplateInfo<'_>, LicenseTemplateInfo> {
702        endpoints::GetLicenseTemplateInfo { name }
703            .make_request()
704            .wrap::<_, _>(self)
705    }
706
707    /// Render a markdown document as HTML
708    ///
709    /// - `body`: See [`MarkdownOption`]
710    pub fn render_markdown(
711        &self,
712        body: MarkdownOption,
713    ) -> Request<'_, endpoints::RenderMarkdown, String> {
714        endpoints::RenderMarkdown { body: body }
715            .make_request()
716            .wrap::<_, _>(self)
717    }
718
719    /// Render raw markdown as HTML
720    ///
721    /// - `body`: Request body to render
722
723    ///   See [`String`]
724    pub fn render_markdown_raw(
725        &self,
726        body: String,
727    ) -> Request<'_, endpoints::RenderMarkdownRaw, String> {
728        endpoints::RenderMarkdownRaw { body: body }
729            .make_request()
730            .wrap::<_, _>(self)
731    }
732
733    /// Render a markup document as HTML
734    ///
735    /// - `body`: See [`MarkupOption`]
736    pub fn render_markup(
737        &self,
738        body: MarkupOption,
739    ) -> Request<'_, endpoints::RenderMarkup, String> {
740        endpoints::RenderMarkup { body: body }
741            .make_request()
742            .wrap::<_, _>(self)
743    }
744
745    /// Returns the nodeinfo of the Forgejo application
746    pub fn get_node_info(&self) -> Request<'_, endpoints::GetNodeInfo, NodeInfo> {
747        endpoints::GetNodeInfo {}.make_request().wrap::<_, _>(self)
748    }
749
750    /// List users's notification threads
751    ///
752    pub fn notify_get_list(
753        &self,
754        query: NotifyGetListQuery,
755    ) -> Request<
756        '_,
757        endpoints::NotifyGetList,
758        (NotificationThreadListHeaders, Vec<NotificationThread>),
759    > {
760        endpoints::NotifyGetList { query }
761            .make_request()
762            .wrap::<_, _>(self)
763    }
764
765    /// Mark notification threads as read, pinned or unread
766    ///
767    pub fn notify_read_list(
768        &self,
769        query: NotifyReadListQuery,
770    ) -> Request<
771        '_,
772        endpoints::NotifyReadList,
773        (NotificationThreadListHeaders, Vec<NotificationThread>),
774    > {
775        endpoints::NotifyReadList { query }
776            .make_request()
777            .wrap::<_, _>(self)
778    }
779
780    /// Check if unread notifications exist
781    pub fn notify_new_available(
782        &self,
783    ) -> Request<'_, endpoints::NotifyNewAvailable, NotificationCount> {
784        endpoints::NotifyNewAvailable {}
785            .make_request()
786            .wrap::<_, _>(self)
787    }
788
789    /// Get notification thread by ID
790    ///
791    /// - `id`: id of notification thread
792    pub fn notify_get_thread(
793        &self,
794        id: i64,
795    ) -> Request<'_, endpoints::NotifyGetThread, NotificationThread> {
796        endpoints::NotifyGetThread { id }
797            .make_request()
798            .wrap::<_, _>(self)
799    }
800
801    /// Mark notification thread as read by ID
802    ///
803    /// - `id`: id of notification thread
804    pub fn notify_read_thread(
805        &self,
806        id: i64,
807        query: NotifyReadThreadQuery,
808    ) -> Request<'_, endpoints::NotifyReadThread, NotificationThread> {
809        endpoints::NotifyReadThread { id, query }
810            .make_request()
811            .wrap::<_, _>(self)
812    }
813
814    /// Create a repository in an organization
815    ///
816    /// - `org`: name of organization
817    /// - `body`: See [`CreateRepoOption`]
818    pub fn create_org_repo_deprecated(
819        &self,
820        org: &str,
821        body: CreateRepoOption,
822    ) -> Request<'_, endpoints::CreateOrgRepoDeprecated<'_>, Repository> {
823        endpoints::CreateOrgRepoDeprecated { org, body: body }
824            .make_request()
825            .wrap::<_, _>(self)
826    }
827
828    /// List all organizations
829    ///
830    pub fn org_get_all(
831        &self,
832    ) -> Request<'_, endpoints::OrgGetAll, (OrganizationListHeaders, Vec<Organization>)> {
833        endpoints::OrgGetAll {}.make_request().wrap::<_, _>(self)
834    }
835
836    /// Create an organization
837    ///
838    /// - `organization`: See [`CreateOrgOption`]
839    pub fn org_create(
840        &self,
841        organization: CreateOrgOption,
842    ) -> Request<'_, endpoints::OrgCreate, Organization> {
843        endpoints::OrgCreate { body: organization }
844            .make_request()
845            .wrap::<_, _>(self)
846    }
847
848    /// Get an organization
849    ///
850    /// - `org`: name of the organization to get
851    pub fn org_get(&self, org: &str) -> Request<'_, endpoints::OrgGet<'_>, Organization> {
852        endpoints::OrgGet { org }.make_request().wrap::<_, _>(self)
853    }
854
855    /// Delete an organization
856    ///
857    /// - `org`: organization that is to be deleted
858    pub fn org_delete(&self, org: &str) -> Request<'_, endpoints::OrgDelete<'_>, ()> {
859        endpoints::OrgDelete { org }
860            .make_request()
861            .wrap::<_, _>(self)
862    }
863
864    /// Edit an organization
865    ///
866    /// - `org`: name of the organization to edit
867    /// - `body`: See [`EditOrgOption`]
868    pub fn org_edit(
869        &self,
870        org: &str,
871        body: EditOrgOption,
872    ) -> Request<'_, endpoints::OrgEdit<'_>, Organization> {
873        endpoints::OrgEdit { org, body: body }
874            .make_request()
875            .wrap::<_, _>(self)
876    }
877
878    /// Search for organization's action jobs according filter conditions
879    ///
880    /// - `org`: name of the organization
881    pub fn org_search_run_jobs(
882        &self,
883        org: &str,
884        query: OrgSearchRunJobsQuery,
885    ) -> Request<'_, endpoints::OrgSearchRunJobs<'_>, Vec<ActionRunJob>> {
886        endpoints::OrgSearchRunJobs { org, query }
887            .make_request()
888            .wrap::<_, _>(self)
889    }
890
891    /// Get an organization's actions runner registration token
892    ///
893    /// - `org`: name of the organization
894    pub fn org_get_runner_registration_token(
895        &self,
896        org: &str,
897    ) -> Request<'_, endpoints::OrgGetRunnerRegistrationToken<'_>, RegistrationToken> {
898        endpoints::OrgGetRunnerRegistrationToken { org }
899            .make_request()
900            .wrap::<_, _>(self)
901    }
902
903    /// List actions secrets of an organization
904    ///
905    /// - `org`: name of the organization
906    pub fn org_list_actions_secrets(
907        &self,
908        org: &str,
909    ) -> Request<'_, endpoints::OrgListActionsSecrets<'_>, (SecretListHeaders, Vec<Secret>)> {
910        endpoints::OrgListActionsSecrets { org }
911            .make_request()
912            .wrap::<_, _>(self)
913    }
914
915    /// Create or Update a secret value in an organization
916    ///
917    /// - `org`: name of organization
918    /// - `secretname`: name of the secret
919    /// - `body`: See [`CreateOrUpdateSecretOption`]
920    pub fn update_org_secret(
921        &self,
922        org: &str,
923        secretname: &str,
924        body: CreateOrUpdateSecretOption,
925    ) -> Request<'_, endpoints::UpdateOrgSecret<'_>, ()> {
926        endpoints::UpdateOrgSecret {
927            org,
928            secretname,
929            body: body,
930        }
931        .make_request()
932        .wrap::<_, _>(self)
933    }
934
935    /// Delete a secret in an organization
936    ///
937    /// - `org`: name of organization
938    /// - `secretname`: name of the secret
939    pub fn delete_org_secret(
940        &self,
941        org: &str,
942        secretname: &str,
943    ) -> Request<'_, endpoints::DeleteOrgSecret<'_>, ()> {
944        endpoints::DeleteOrgSecret { org, secretname }
945            .make_request()
946            .wrap::<_, _>(self)
947    }
948
949    /// List variables of an organization
950    ///
951    /// - `org`: name of the organization
952    pub fn get_org_variables_list(
953        &self,
954        org: &str,
955    ) -> Request<'_, endpoints::GetOrgVariablesList<'_>, (VariableListHeaders, Vec<ActionVariable>)>
956    {
957        endpoints::GetOrgVariablesList { org }
958            .make_request()
959            .wrap::<_, _>(self)
960    }
961
962    /// Get organization's variable by name
963    ///
964    /// - `org`: name of the organization
965    /// - `variablename`: name of the variable
966    pub fn get_org_variable(
967        &self,
968        org: &str,
969        variablename: &str,
970    ) -> Request<'_, endpoints::GetOrgVariable<'_>, ActionVariable> {
971        endpoints::GetOrgVariable { org, variablename }
972            .make_request()
973            .wrap::<_, _>(self)
974    }
975
976    /// Update variable in organization
977    ///
978    /// - `org`: name of the organization
979    /// - `variablename`: name of the variable
980    /// - `body`: See [`UpdateVariableOption`]
981    pub fn update_org_variable(
982        &self,
983        org: &str,
984        variablename: &str,
985        body: UpdateVariableOption,
986    ) -> Request<'_, endpoints::UpdateOrgVariable<'_>, ()> {
987        endpoints::UpdateOrgVariable {
988            org,
989            variablename,
990            body: body,
991        }
992        .make_request()
993        .wrap::<_, _>(self)
994    }
995
996    /// Create a new variable in organization
997    ///
998    /// - `org`: name of the organization
999    /// - `variablename`: name of the variable
1000    /// - `body`: See [`CreateVariableOption`]
1001    pub fn create_org_variable(
1002        &self,
1003        org: &str,
1004        variablename: &str,
1005        body: CreateVariableOption,
1006    ) -> Request<'_, endpoints::CreateOrgVariable<'_>, ()> {
1007        endpoints::CreateOrgVariable {
1008            org,
1009            variablename,
1010            body: body,
1011        }
1012        .make_request()
1013        .wrap::<_, _>(self)
1014    }
1015
1016    /// Delete organization's variable by name
1017    ///
1018    /// - `org`: name of the organization
1019    /// - `variablename`: name of the variable
1020    pub fn delete_org_variable(
1021        &self,
1022        org: &str,
1023        variablename: &str,
1024    ) -> Request<'_, endpoints::DeleteOrgVariable<'_>, ()> {
1025        endpoints::DeleteOrgVariable { org, variablename }
1026            .make_request()
1027            .wrap::<_, _>(self)
1028    }
1029
1030    /// List an organization's activity feeds
1031    ///
1032    /// - `org`: name of the org
1033    pub fn org_list_activity_feeds(
1034        &self,
1035        org: &str,
1036        query: OrgListActivityFeedsQuery,
1037    ) -> Request<'_, endpoints::OrgListActivityFeeds<'_>, (ActivityFeedsListHeaders, Vec<Activity>)>
1038    {
1039        endpoints::OrgListActivityFeeds { org, query }
1040            .make_request()
1041            .wrap::<_, _>(self)
1042    }
1043
1044    /// Update an organization's avatar
1045    ///
1046    /// - `org`: name of the organization
1047    /// - `body`: See [`UpdateUserAvatarOption`]
1048    pub fn org_update_avatar(
1049        &self,
1050        org: &str,
1051        body: UpdateUserAvatarOption,
1052    ) -> Request<'_, endpoints::OrgUpdateAvatar<'_>, ()> {
1053        endpoints::OrgUpdateAvatar { org, body: body }
1054            .make_request()
1055            .wrap::<_, _>(self)
1056    }
1057
1058    /// Delete an organization's avatar. It will be replaced by a default one
1059    ///
1060    /// - `org`: name of the organization
1061    pub fn org_delete_avatar(&self, org: &str) -> Request<'_, endpoints::OrgDeleteAvatar<'_>, ()> {
1062        endpoints::OrgDeleteAvatar { org }
1063            .make_request()
1064            .wrap::<_, _>(self)
1065    }
1066
1067    /// Blocks a user from the organization
1068    ///
1069    /// - `org`: name of the org
1070    /// - `username`: username of the user
1071    pub fn org_block_user(
1072        &self,
1073        org: &str,
1074        username: &str,
1075    ) -> Request<'_, endpoints::OrgBlockUser<'_>, ()> {
1076        endpoints::OrgBlockUser { org, username }
1077            .make_request()
1078            .wrap::<_, _>(self)
1079    }
1080
1081    /// List an organization's webhooks
1082    ///
1083    /// - `org`: name of the organization
1084    pub fn org_list_hooks(
1085        &self,
1086        org: &str,
1087    ) -> Request<'_, endpoints::OrgListHooks<'_>, (HookListHeaders, Vec<Hook>)> {
1088        endpoints::OrgListHooks { org }
1089            .make_request()
1090            .wrap::<_, _>(self)
1091    }
1092
1093    /// Create a hook
1094    ///
1095    /// - `org`: name of the organization
1096    /// - `body`: See [`CreateHookOption`]
1097    pub fn org_create_hook(
1098        &self,
1099        org: &str,
1100        body: CreateHookOption,
1101    ) -> Request<'_, endpoints::OrgCreateHook<'_>, Hook> {
1102        endpoints::OrgCreateHook { org, body: body }
1103            .make_request()
1104            .wrap::<_, _>(self)
1105    }
1106
1107    /// Get a hook
1108    ///
1109    /// - `org`: name of the organization
1110    /// - `id`: id of the hook to get
1111    pub fn org_get_hook(&self, org: &str, id: i64) -> Request<'_, endpoints::OrgGetHook<'_>, Hook> {
1112        endpoints::OrgGetHook { org, id }
1113            .make_request()
1114            .wrap::<_, _>(self)
1115    }
1116
1117    /// Delete a hook
1118    ///
1119    /// - `org`: name of the organization
1120    /// - `id`: id of the hook to delete
1121    pub fn org_delete_hook(
1122        &self,
1123        org: &str,
1124        id: i64,
1125    ) -> Request<'_, endpoints::OrgDeleteHook<'_>, ()> {
1126        endpoints::OrgDeleteHook { org, id }
1127            .make_request()
1128            .wrap::<_, _>(self)
1129    }
1130
1131    /// Update a hook
1132    ///
1133    /// - `org`: name of the organization
1134    /// - `id`: id of the hook to update
1135    /// - `body`: See [`EditHookOption`]
1136    pub fn org_edit_hook(
1137        &self,
1138        org: &str,
1139        id: i64,
1140        body: EditHookOption,
1141    ) -> Request<'_, endpoints::OrgEditHook<'_>, Hook> {
1142        endpoints::OrgEditHook {
1143            org,
1144            id,
1145            body: body,
1146        }
1147        .make_request()
1148        .wrap::<_, _>(self)
1149    }
1150
1151    /// List an organization's labels
1152    ///
1153    /// - `org`: name of the organization
1154    pub fn org_list_labels(
1155        &self,
1156        org: &str,
1157        query: OrgListLabelsQuery,
1158    ) -> Request<'_, endpoints::OrgListLabels<'_>, (LabelListHeaders, Vec<Label>)> {
1159        endpoints::OrgListLabels { org, query }
1160            .make_request()
1161            .wrap::<_, _>(self)
1162    }
1163
1164    /// Create a label for an organization
1165    ///
1166    /// - `org`: name of the organization
1167    /// - `body`: See [`CreateLabelOption`]
1168    pub fn org_create_label(
1169        &self,
1170        org: &str,
1171        body: CreateLabelOption,
1172    ) -> Request<'_, endpoints::OrgCreateLabel<'_>, Label> {
1173        endpoints::OrgCreateLabel { org, body: body }
1174            .make_request()
1175            .wrap::<_, _>(self)
1176    }
1177
1178    /// Get a single label
1179    ///
1180    /// - `org`: name of the organization
1181    /// - `id`: id of the label to get
1182    pub fn org_get_label(
1183        &self,
1184        org: &str,
1185        id: i64,
1186    ) -> Request<'_, endpoints::OrgGetLabel<'_>, Label> {
1187        endpoints::OrgGetLabel { org, id }
1188            .make_request()
1189            .wrap::<_, _>(self)
1190    }
1191
1192    /// Delete a label
1193    ///
1194    /// - `org`: name of the organization
1195    /// - `id`: id of the label to delete
1196    pub fn org_delete_label(
1197        &self,
1198        org: &str,
1199        id: i64,
1200    ) -> Request<'_, endpoints::OrgDeleteLabel<'_>, ()> {
1201        endpoints::OrgDeleteLabel { org, id }
1202            .make_request()
1203            .wrap::<_, _>(self)
1204    }
1205
1206    /// Update a label
1207    ///
1208    /// - `org`: name of the organization
1209    /// - `id`: id of the label to edit
1210    /// - `body`: See [`EditLabelOption`]
1211    pub fn org_edit_label(
1212        &self,
1213        org: &str,
1214        id: i64,
1215        body: EditLabelOption,
1216    ) -> Request<'_, endpoints::OrgEditLabel<'_>, Label> {
1217        endpoints::OrgEditLabel {
1218            org,
1219            id,
1220            body: body,
1221        }
1222        .make_request()
1223        .wrap::<_, _>(self)
1224    }
1225
1226    /// List the organization's blocked users
1227    ///
1228    /// - `org`: name of the org
1229    pub fn org_list_blocked_users(
1230        &self,
1231        org: &str,
1232    ) -> Request<'_, endpoints::OrgListBlockedUsers<'_>, (BlockedUserListHeaders, Vec<BlockedUser>)>
1233    {
1234        endpoints::OrgListBlockedUsers { org }
1235            .make_request()
1236            .wrap::<_, _>(self)
1237    }
1238
1239    /// List an organization's members
1240    ///
1241    /// - `org`: name of the organization
1242    pub fn org_list_members(
1243        &self,
1244        org: &str,
1245    ) -> Request<'_, endpoints::OrgListMembers<'_>, (UserListHeaders, Vec<User>)> {
1246        endpoints::OrgListMembers { org }
1247            .make_request()
1248            .wrap::<_, _>(self)
1249    }
1250
1251    /// Check if a user is a member of an organization
1252    ///
1253    /// - `org`: name of the organization
1254    /// - `username`: username of the user
1255    pub fn org_is_member(
1256        &self,
1257        org: &str,
1258        username: &str,
1259    ) -> Request<'_, endpoints::OrgIsMember<'_>, ()> {
1260        endpoints::OrgIsMember { org, username }
1261            .make_request()
1262            .wrap::<_, _>(self)
1263    }
1264
1265    /// Remove a member from an organization
1266    ///
1267    /// - `org`: name of the organization
1268    /// - `username`: username of the user
1269    pub fn org_delete_member(
1270        &self,
1271        org: &str,
1272        username: &str,
1273    ) -> Request<'_, endpoints::OrgDeleteMember<'_>, ()> {
1274        endpoints::OrgDeleteMember { org, username }
1275            .make_request()
1276            .wrap::<_, _>(self)
1277    }
1278
1279    /// List an organization's public members
1280    ///
1281    /// - `org`: name of the organization
1282    pub fn org_list_public_members(
1283        &self,
1284        org: &str,
1285    ) -> Request<'_, endpoints::OrgListPublicMembers<'_>, (UserListHeaders, Vec<User>)> {
1286        endpoints::OrgListPublicMembers { org }
1287            .make_request()
1288            .wrap::<_, _>(self)
1289    }
1290
1291    /// Check if a user is a public member of an organization
1292    ///
1293    /// - `org`: name of the organization
1294    /// - `username`: username of the user
1295    pub fn org_is_public_member(
1296        &self,
1297        org: &str,
1298        username: &str,
1299    ) -> Request<'_, endpoints::OrgIsPublicMember<'_>, ()> {
1300        endpoints::OrgIsPublicMember { org, username }
1301            .make_request()
1302            .wrap::<_, _>(self)
1303    }
1304
1305    /// Publicize a user's membership
1306    ///
1307    /// - `org`: name of the organization
1308    /// - `username`: username of the user
1309    pub fn org_publicize_member(
1310        &self,
1311        org: &str,
1312        username: &str,
1313    ) -> Request<'_, endpoints::OrgPublicizeMember<'_>, ()> {
1314        endpoints::OrgPublicizeMember { org, username }
1315            .make_request()
1316            .wrap::<_, _>(self)
1317    }
1318
1319    /// Conceal a user's membership
1320    ///
1321    /// - `org`: name of the organization
1322    /// - `username`: username of the user
1323    pub fn org_conceal_member(
1324        &self,
1325        org: &str,
1326        username: &str,
1327    ) -> Request<'_, endpoints::OrgConcealMember<'_>, ()> {
1328        endpoints::OrgConcealMember { org, username }
1329            .make_request()
1330            .wrap::<_, _>(self)
1331    }
1332
1333    /// Get quota information for an organization
1334    ///
1335    /// - `org`: name of the organization
1336    pub fn org_get_quota(&self, org: &str) -> Request<'_, endpoints::OrgGetQuota<'_>, QuotaInfo> {
1337        endpoints::OrgGetQuota { org }
1338            .make_request()
1339            .wrap::<_, _>(self)
1340    }
1341
1342    /// List the artifacts affecting the organization's quota
1343    ///
1344    /// - `org`: name of the organization
1345    pub fn org_list_quota_artifacts(
1346        &self,
1347        org: &str,
1348    ) -> Request<
1349        '_,
1350        endpoints::OrgListQuotaArtifacts<'_>,
1351        (QuotaUsedArtifactListHeaders, Vec<QuotaUsedArtifact>),
1352    > {
1353        endpoints::OrgListQuotaArtifacts { org }
1354            .make_request()
1355            .wrap::<_, _>(self)
1356    }
1357
1358    /// List the attachments affecting the organization's quota
1359    ///
1360    /// - `org`: name of the organization
1361    pub fn org_list_quota_attachments(
1362        &self,
1363        org: &str,
1364    ) -> Request<
1365        '_,
1366        endpoints::OrgListQuotaAttachments<'_>,
1367        (QuotaUsedAttachmentListHeaders, Vec<QuotaUsedAttachment>),
1368    > {
1369        endpoints::OrgListQuotaAttachments { org }
1370            .make_request()
1371            .wrap::<_, _>(self)
1372    }
1373
1374    /// Check if the organization is over quota for a given subject
1375    ///
1376    /// - `org`: name of the organization
1377    pub fn org_check_quota(
1378        &self,
1379        org: &str,
1380        query: OrgCheckQuotaQuery,
1381    ) -> Request<'_, endpoints::OrgCheckQuota<'_>, bool> {
1382        endpoints::OrgCheckQuota { org, query }
1383            .make_request()
1384            .wrap::<_, _>(self)
1385    }
1386
1387    /// List the packages affecting the organization's quota
1388    ///
1389    /// - `org`: name of the organization
1390    pub fn org_list_quota_packages(
1391        &self,
1392        org: &str,
1393    ) -> Request<
1394        '_,
1395        endpoints::OrgListQuotaPackages<'_>,
1396        (QuotaUsedPackageListHeaders, Vec<QuotaUsedPackage>),
1397    > {
1398        endpoints::OrgListQuotaPackages { org }
1399            .make_request()
1400            .wrap::<_, _>(self)
1401    }
1402
1403    /// Rename an organization
1404    ///
1405    /// - `org`: existing org name
1406    /// - `body`: See [`RenameOrgOption`]
1407    pub fn rename_org(
1408        &self,
1409        org: &str,
1410        body: RenameOrgOption,
1411    ) -> Request<'_, endpoints::RenameOrg<'_>, ()> {
1412        endpoints::RenameOrg { org, body: body }
1413            .make_request()
1414            .wrap::<_, _>(self)
1415    }
1416
1417    /// List an organization's repos
1418    ///
1419    /// - `org`: name of the organization
1420    pub fn org_list_repos(
1421        &self,
1422        org: &str,
1423    ) -> Request<'_, endpoints::OrgListRepos<'_>, (RepositoryListHeaders, Vec<Repository>)> {
1424        endpoints::OrgListRepos { org }
1425            .make_request()
1426            .wrap::<_, _>(self)
1427    }
1428
1429    /// Create a repository in an organization
1430    ///
1431    /// - `org`: name of organization
1432    /// - `body`: See [`CreateRepoOption`]
1433    pub fn create_org_repo(
1434        &self,
1435        org: &str,
1436        body: CreateRepoOption,
1437    ) -> Request<'_, endpoints::CreateOrgRepo<'_>, Repository> {
1438        endpoints::CreateOrgRepo { org, body: body }
1439            .make_request()
1440            .wrap::<_, _>(self)
1441    }
1442
1443    /// List an organization's teams
1444    ///
1445    /// - `org`: name of the organization
1446    pub fn org_list_teams(
1447        &self,
1448        org: &str,
1449    ) -> Request<'_, endpoints::OrgListTeams<'_>, (TeamListHeaders, Vec<Team>)> {
1450        endpoints::OrgListTeams { org }
1451            .make_request()
1452            .wrap::<_, _>(self)
1453    }
1454
1455    /// Create a team
1456    ///
1457    /// - `org`: name of the organization
1458    /// - `body`: See [`CreateTeamOption`]
1459    pub fn org_create_team(
1460        &self,
1461        org: &str,
1462        body: CreateTeamOption,
1463    ) -> Request<'_, endpoints::OrgCreateTeam<'_>, Team> {
1464        endpoints::OrgCreateTeam { org, body: body }
1465            .make_request()
1466            .wrap::<_, _>(self)
1467    }
1468
1469    /// Search for teams within an organization
1470    ///
1471    /// - `org`: name of the organization
1472    pub fn team_search(
1473        &self,
1474        org: &str,
1475        query: TeamSearchQuery,
1476    ) -> Request<'_, endpoints::TeamSearch<'_>, TeamSearchResults> {
1477        endpoints::TeamSearch { org, query }
1478            .make_request()
1479            .wrap::<_, _>(self)
1480    }
1481
1482    /// Unblock a user from the organization
1483    ///
1484    /// - `org`: name of the org
1485    /// - `username`: username of the user
1486    pub fn org_unblock_user(
1487        &self,
1488        org: &str,
1489        username: &str,
1490    ) -> Request<'_, endpoints::OrgUnblockUser<'_>, ()> {
1491        endpoints::OrgUnblockUser { org, username }
1492            .make_request()
1493            .wrap::<_, _>(self)
1494    }
1495
1496    /// Gets all packages of an owner
1497    ///
1498    /// - `owner`: owner of the packages
1499    pub fn list_packages(
1500        &self,
1501        owner: &str,
1502        query: ListPackagesQuery,
1503    ) -> Request<'_, endpoints::ListPackages<'_>, (PackageListHeaders, Vec<Package>)> {
1504        endpoints::ListPackages { owner, query }
1505            .make_request()
1506            .wrap::<_, _>(self)
1507    }
1508
1509    /// Link a package to a repository
1510    ///
1511    /// - `owner`: owner of the package
1512    /// - `type`: type of the package
1513    /// - `name`: name of the package
1514    /// - `repo_name`: name of the repository to link.
1515    pub fn link_package(
1516        &self,
1517        owner: &str,
1518        r#type: &str,
1519        name: &str,
1520        repo_name: &str,
1521    ) -> Request<'_, endpoints::LinkPackage<'_>, ()> {
1522        endpoints::LinkPackage {
1523            owner,
1524            r#type,
1525            name,
1526            repo_name,
1527        }
1528        .make_request()
1529        .wrap::<_, _>(self)
1530    }
1531
1532    /// Unlink a package from a repository
1533    ///
1534    /// - `owner`: owner of the package
1535    /// - `type`: type of the package
1536    /// - `name`: name of the package
1537    pub fn unlink_package(
1538        &self,
1539        owner: &str,
1540        r#type: &str,
1541        name: &str,
1542    ) -> Request<'_, endpoints::UnlinkPackage<'_>, ()> {
1543        endpoints::UnlinkPackage {
1544            owner,
1545            r#type,
1546            name,
1547        }
1548        .make_request()
1549        .wrap::<_, _>(self)
1550    }
1551
1552    /// Gets a package
1553    ///
1554    /// - `owner`: owner of the package
1555    /// - `type`: type of the package
1556    /// - `name`: name of the package
1557    /// - `version`: version of the package
1558    pub fn get_package(
1559        &self,
1560        owner: &str,
1561        r#type: &str,
1562        name: &str,
1563        version: &str,
1564    ) -> Request<'_, endpoints::GetPackage<'_>, Package> {
1565        endpoints::GetPackage {
1566            owner,
1567            r#type,
1568            name,
1569            version,
1570        }
1571        .make_request()
1572        .wrap::<_, _>(self)
1573    }
1574
1575    /// Delete a package
1576    ///
1577    /// - `owner`: owner of the package
1578    /// - `type`: type of the package
1579    /// - `name`: name of the package
1580    /// - `version`: version of the package
1581    pub fn delete_package(
1582        &self,
1583        owner: &str,
1584        r#type: &str,
1585        name: &str,
1586        version: &str,
1587    ) -> Request<'_, endpoints::DeletePackage<'_>, ()> {
1588        endpoints::DeletePackage {
1589            owner,
1590            r#type,
1591            name,
1592            version,
1593        }
1594        .make_request()
1595        .wrap::<_, _>(self)
1596    }
1597
1598    /// Gets all files of a package
1599    ///
1600    /// - `owner`: owner of the package
1601    /// - `type`: type of the package
1602    /// - `name`: name of the package
1603    /// - `version`: version of the package
1604    pub fn list_package_files(
1605        &self,
1606        owner: &str,
1607        r#type: &str,
1608        name: &str,
1609        version: &str,
1610    ) -> Request<'_, endpoints::ListPackageFiles<'_>, (PackageFileListHeaders, Vec<PackageFile>)>
1611    {
1612        endpoints::ListPackageFiles {
1613            owner,
1614            r#type,
1615            name,
1616            version,
1617        }
1618        .make_request()
1619        .wrap::<_, _>(self)
1620    }
1621
1622    /// Search for issues across the repositories that the user has access to
1623    ///
1624    pub fn issue_search_issues(
1625        &self,
1626        query: IssueSearchIssuesQuery,
1627    ) -> Request<'_, endpoints::IssueSearchIssues, (IssueListHeaders, Vec<Issue>)> {
1628        endpoints::IssueSearchIssues { query }
1629            .make_request()
1630            .wrap::<_, _>(self)
1631    }
1632
1633    /// Migrate a remote git repository
1634    ///
1635    /// - `body`: See [`MigrateRepoOptions`]
1636    pub fn repo_migrate(
1637        &self,
1638        body: MigrateRepoOptions,
1639    ) -> Request<'_, endpoints::RepoMigrate, Repository> {
1640        endpoints::RepoMigrate { body: body }
1641            .make_request()
1642            .wrap::<_, _>(self)
1643    }
1644
1645    /// Search for repositories
1646    ///
1647    pub fn repo_search(
1648        &self,
1649        query: RepoSearchQuery,
1650    ) -> Request<'_, endpoints::RepoSearch, SearchResults> {
1651        endpoints::RepoSearch { query }
1652            .make_request()
1653            .wrap::<_, _>(self)
1654    }
1655
1656    /// Get a repository
1657    ///
1658    /// - `owner`: owner of the repo
1659    /// - `repo`: name of the repo
1660    pub fn repo_get(
1661        &self,
1662        owner: &str,
1663        repo: &str,
1664    ) -> Request<'_, endpoints::RepoGet<'_>, Repository> {
1665        endpoints::RepoGet { owner, repo }
1666            .make_request()
1667            .wrap::<_, _>(self)
1668    }
1669
1670    /// Delete a repository
1671    ///
1672    /// - `owner`: owner of the repo to delete
1673    /// - `repo`: name of the repo to delete
1674    pub fn repo_delete(
1675        &self,
1676        owner: &str,
1677        repo: &str,
1678    ) -> Request<'_, endpoints::RepoDelete<'_>, ()> {
1679        endpoints::RepoDelete { owner, repo }
1680            .make_request()
1681            .wrap::<_, _>(self)
1682    }
1683
1684    /// Edit a repository's properties. Only fields that are set will be changed.
1685    ///
1686    /// - `owner`: owner of the repo to edit
1687    /// - `repo`: name of the repo to edit
1688    /// - `body`: Properties of a repo that you can edit
1689
1690    ///   See [`EditRepoOption`]
1691    pub fn repo_edit(
1692        &self,
1693        owner: &str,
1694        repo: &str,
1695        body: EditRepoOption,
1696    ) -> Request<'_, endpoints::RepoEdit<'_>, Repository> {
1697        endpoints::RepoEdit {
1698            owner,
1699            repo,
1700            body: body,
1701        }
1702        .make_request()
1703        .wrap::<_, _>(self)
1704    }
1705
1706    /// Search for repository's action jobs according filter conditions
1707    ///
1708    /// - `owner`: owner of the repo
1709    /// - `repo`: name of the repo
1710    pub fn repo_search_run_jobs(
1711        &self,
1712        owner: &str,
1713        repo: &str,
1714        query: RepoSearchRunJobsQuery,
1715    ) -> Request<'_, endpoints::RepoSearchRunJobs<'_>, Vec<ActionRunJob>> {
1716        endpoints::RepoSearchRunJobs { owner, repo, query }
1717            .make_request()
1718            .wrap::<_, _>(self)
1719    }
1720
1721    /// Get a repository's actions runner registration token
1722    ///
1723    /// - `owner`: owner of the repo
1724    /// - `repo`: name of the repo
1725    pub fn repo_get_runner_registration_token(
1726        &self,
1727        owner: &str,
1728        repo: &str,
1729    ) -> Request<'_, endpoints::RepoGetRunnerRegistrationToken<'_>, RegistrationToken> {
1730        endpoints::RepoGetRunnerRegistrationToken { owner, repo }
1731            .make_request()
1732            .wrap::<_, _>(self)
1733    }
1734
1735    /// List a repository's action runs
1736    ///
1737    /// - `owner`: owner of the repo
1738    /// - `repo`: name of the repo
1739    pub fn list_action_runs(
1740        &self,
1741        owner: &str,
1742        repo: &str,
1743        query: ListActionRunsQuery,
1744    ) -> Request<'_, endpoints::ListActionRuns<'_>, ListActionRunResponse> {
1745        endpoints::ListActionRuns { owner, repo, query }
1746            .make_request()
1747            .wrap::<_, _>(self)
1748    }
1749
1750    /// Get an action run
1751    ///
1752    /// - `owner`: owner of the repo
1753    /// - `repo`: name of the repo
1754    /// - `run_id`: id of the action run
1755    pub fn get_action_run(
1756        &self,
1757        owner: &str,
1758        repo: &str,
1759        run_id: i64,
1760    ) -> Request<'_, endpoints::GetActionRun<'_>, ActionRun> {
1761        endpoints::GetActionRun {
1762            owner,
1763            repo,
1764            run_id,
1765        }
1766        .make_request()
1767        .wrap::<_, _>(self)
1768    }
1769
1770    /// List an repo's actions secrets
1771    ///
1772    /// - `owner`: owner of the repository
1773    /// - `repo`: name of the repository
1774    pub fn repo_list_actions_secrets(
1775        &self,
1776        owner: &str,
1777        repo: &str,
1778    ) -> Request<'_, endpoints::RepoListActionsSecrets<'_>, (SecretListHeaders, Vec<Secret>)> {
1779        endpoints::RepoListActionsSecrets { owner, repo }
1780            .make_request()
1781            .wrap::<_, _>(self)
1782    }
1783
1784    /// Create or Update a secret value in a repository
1785    ///
1786    /// - `owner`: owner of the repository
1787    /// - `repo`: name of the repository
1788    /// - `secretname`: name of the secret
1789    /// - `body`: See [`CreateOrUpdateSecretOption`]
1790    pub fn update_repo_secret(
1791        &self,
1792        owner: &str,
1793        repo: &str,
1794        secretname: &str,
1795        body: CreateOrUpdateSecretOption,
1796    ) -> Request<'_, endpoints::UpdateRepoSecret<'_>, ()> {
1797        endpoints::UpdateRepoSecret {
1798            owner,
1799            repo,
1800            secretname,
1801            body: body,
1802        }
1803        .make_request()
1804        .wrap::<_, _>(self)
1805    }
1806
1807    /// Delete a secret in a repository
1808    ///
1809    /// - `owner`: owner of the repository
1810    /// - `repo`: name of the repository
1811    /// - `secretname`: name of the secret
1812    pub fn delete_repo_secret(
1813        &self,
1814        owner: &str,
1815        repo: &str,
1816        secretname: &str,
1817    ) -> Request<'_, endpoints::DeleteRepoSecret<'_>, ()> {
1818        endpoints::DeleteRepoSecret {
1819            owner,
1820            repo,
1821            secretname,
1822        }
1823        .make_request()
1824        .wrap::<_, _>(self)
1825    }
1826
1827    /// List a repository's action tasks
1828    ///
1829    /// - `owner`: owner of the repo
1830    /// - `repo`: name of the repo
1831    pub fn list_action_tasks(
1832        &self,
1833        owner: &str,
1834        repo: &str,
1835    ) -> Request<'_, endpoints::ListActionTasks<'_>, ActionTaskResponse> {
1836        endpoints::ListActionTasks { owner, repo }
1837            .make_request()
1838            .wrap::<_, _>(self)
1839    }
1840
1841    /// Get repo-level variables list
1842    ///
1843    /// - `owner`: name of the owner
1844    /// - `repo`: name of the repository
1845    pub fn get_repo_variables_list(
1846        &self,
1847        owner: &str,
1848        repo: &str,
1849    ) -> Request<'_, endpoints::GetRepoVariablesList<'_>, (VariableListHeaders, Vec<ActionVariable>)>
1850    {
1851        endpoints::GetRepoVariablesList { owner, repo }
1852            .make_request()
1853            .wrap::<_, _>(self)
1854    }
1855
1856    /// Get a repo-level variable
1857    ///
1858    /// - `owner`: name of the owner
1859    /// - `repo`: name of the repository
1860    /// - `variablename`: name of the variable
1861    pub fn get_repo_variable(
1862        &self,
1863        owner: &str,
1864        repo: &str,
1865        variablename: &str,
1866    ) -> Request<'_, endpoints::GetRepoVariable<'_>, ActionVariable> {
1867        endpoints::GetRepoVariable {
1868            owner,
1869            repo,
1870            variablename,
1871        }
1872        .make_request()
1873        .wrap::<_, _>(self)
1874    }
1875
1876    /// Update a repo-level variable
1877    ///
1878    /// - `owner`: name of the owner
1879    /// - `repo`: name of the repository
1880    /// - `variablename`: name of the variable
1881    /// - `body`: See [`UpdateVariableOption`]
1882    pub fn update_repo_variable(
1883        &self,
1884        owner: &str,
1885        repo: &str,
1886        variablename: &str,
1887        body: UpdateVariableOption,
1888    ) -> Request<'_, endpoints::UpdateRepoVariable<'_>, ()> {
1889        endpoints::UpdateRepoVariable {
1890            owner,
1891            repo,
1892            variablename,
1893            body: body,
1894        }
1895        .make_request()
1896        .wrap::<_, _>(self)
1897    }
1898
1899    /// Create a repo-level variable
1900    ///
1901    /// - `owner`: name of the owner
1902    /// - `repo`: name of the repository
1903    /// - `variablename`: name of the variable
1904    /// - `body`: See [`CreateVariableOption`]
1905    pub fn create_repo_variable(
1906        &self,
1907        owner: &str,
1908        repo: &str,
1909        variablename: &str,
1910        body: CreateVariableOption,
1911    ) -> Request<'_, endpoints::CreateRepoVariable<'_>, ()> {
1912        endpoints::CreateRepoVariable {
1913            owner,
1914            repo,
1915            variablename,
1916            body: body,
1917        }
1918        .make_request()
1919        .wrap::<_, _>(self)
1920    }
1921
1922    /// Delete a repo-level variable
1923    ///
1924    /// - `owner`: name of the owner
1925    /// - `repo`: name of the repository
1926    /// - `variablename`: name of the variable
1927    pub fn delete_repo_variable(
1928        &self,
1929        owner: &str,
1930        repo: &str,
1931        variablename: &str,
1932    ) -> Request<'_, endpoints::DeleteRepoVariable<'_>, ()> {
1933        endpoints::DeleteRepoVariable {
1934            owner,
1935            repo,
1936            variablename,
1937        }
1938        .make_request()
1939        .wrap::<_, _>(self)
1940    }
1941
1942    /// Dispatches a workflow
1943    ///
1944    /// - `owner`: owner of the repo
1945    /// - `repo`: name of the repo
1946    /// - `workflowfilename`: name of the workflow
1947    /// - `body`: See [`DispatchWorkflowOption`]
1948    pub fn dispatch_workflow(
1949        &self,
1950        owner: &str,
1951        repo: &str,
1952        workflowfilename: &str,
1953        body: DispatchWorkflowOption,
1954    ) -> Request<'_, endpoints::DispatchWorkflow<'_>, Option<DispatchWorkflowRun>> {
1955        endpoints::DispatchWorkflow {
1956            owner,
1957            repo,
1958            workflowfilename,
1959            body: body,
1960        }
1961        .make_request()
1962        .wrap::<_, _>(self)
1963    }
1964
1965    /// List a repository's activity feeds
1966    ///
1967    /// - `owner`: owner of the repo
1968    /// - `repo`: name of the repo
1969    pub fn repo_list_activity_feeds(
1970        &self,
1971        owner: &str,
1972        repo: &str,
1973        query: RepoListActivityFeedsQuery,
1974    ) -> Request<'_, endpoints::RepoListActivityFeeds<'_>, (ActivityFeedsListHeaders, Vec<Activity>)>
1975    {
1976        endpoints::RepoListActivityFeeds { owner, repo, query }
1977            .make_request()
1978            .wrap::<_, _>(self)
1979    }
1980
1981    /// Get an archive of a repository
1982    ///
1983    /// - `owner`: owner of the repo
1984    /// - `repo`: name of the repo
1985    /// - `archive`: the git reference for download with attached archive format (e.g. master.zip)
1986    pub fn repo_get_archive(
1987        &self,
1988        owner: &str,
1989        repo: &str,
1990        archive: &str,
1991    ) -> Request<'_, endpoints::RepoGetArchive<'_>, Bytes> {
1992        endpoints::RepoGetArchive {
1993            owner,
1994            repo,
1995            archive,
1996        }
1997        .make_request()
1998        .wrap::<_, _>(self)
1999    }
2000
2001    /// Return all users that have write access and can be assigned to issues
2002    ///
2003    /// - `owner`: owner of the repo
2004    /// - `repo`: name of the repo
2005    pub fn repo_get_assignees(
2006        &self,
2007        owner: &str,
2008        repo: &str,
2009    ) -> Request<'_, endpoints::RepoGetAssignees<'_>, (UserListHeaders, Vec<User>)> {
2010        endpoints::RepoGetAssignees { owner, repo }
2011            .make_request()
2012            .wrap::<_, _>(self)
2013    }
2014
2015    /// Update a repository's avatar
2016    ///
2017    /// - `owner`: owner of the repo
2018    /// - `repo`: name of the repo
2019    /// - `body`: See [`UpdateRepoAvatarOption`]
2020    pub fn repo_update_avatar(
2021        &self,
2022        owner: &str,
2023        repo: &str,
2024        body: UpdateRepoAvatarOption,
2025    ) -> Request<'_, endpoints::RepoUpdateAvatar<'_>, ()> {
2026        endpoints::RepoUpdateAvatar {
2027            owner,
2028            repo,
2029            body: body,
2030        }
2031        .make_request()
2032        .wrap::<_, _>(self)
2033    }
2034
2035    /// Delete a repository's avatar
2036    ///
2037    /// - `owner`: owner of the repo
2038    /// - `repo`: name of the repo
2039    pub fn repo_delete_avatar(
2040        &self,
2041        owner: &str,
2042        repo: &str,
2043    ) -> Request<'_, endpoints::RepoDeleteAvatar<'_>, ()> {
2044        endpoints::RepoDeleteAvatar { owner, repo }
2045            .make_request()
2046            .wrap::<_, _>(self)
2047    }
2048
2049    /// List branch protections for a repository
2050    ///
2051    /// - `owner`: owner of the repo
2052    /// - `repo`: name of the repo
2053    pub fn repo_list_branch_protection(
2054        &self,
2055        owner: &str,
2056        repo: &str,
2057    ) -> Request<'_, endpoints::RepoListBranchProtection<'_>, Vec<BranchProtection>> {
2058        endpoints::RepoListBranchProtection { owner, repo }
2059            .make_request()
2060            .wrap::<_, _>(self)
2061    }
2062
2063    /// Create a branch protections for a repository
2064    ///
2065    /// - `owner`: owner of the repo
2066    /// - `repo`: name of the repo
2067    /// - `body`: See [`CreateBranchProtectionOption`]
2068    pub fn repo_create_branch_protection(
2069        &self,
2070        owner: &str,
2071        repo: &str,
2072        body: CreateBranchProtectionOption,
2073    ) -> Request<'_, endpoints::RepoCreateBranchProtection<'_>, BranchProtection> {
2074        endpoints::RepoCreateBranchProtection {
2075            owner,
2076            repo,
2077            body: body,
2078        }
2079        .make_request()
2080        .wrap::<_, _>(self)
2081    }
2082
2083    /// Get a specific branch protection for the repository
2084    ///
2085    /// - `owner`: owner of the repo
2086    /// - `repo`: name of the repo
2087    /// - `name`: name of protected branch
2088    pub fn repo_get_branch_protection(
2089        &self,
2090        owner: &str,
2091        repo: &str,
2092        name: &str,
2093    ) -> Request<'_, endpoints::RepoGetBranchProtection<'_>, BranchProtection> {
2094        endpoints::RepoGetBranchProtection { owner, repo, name }
2095            .make_request()
2096            .wrap::<_, _>(self)
2097    }
2098
2099    /// Delete a specific branch protection for the repository
2100    ///
2101    /// - `owner`: owner of the repo
2102    /// - `repo`: name of the repo
2103    /// - `name`: name of protected branch
2104    pub fn repo_delete_branch_protection(
2105        &self,
2106        owner: &str,
2107        repo: &str,
2108        name: &str,
2109    ) -> Request<'_, endpoints::RepoDeleteBranchProtection<'_>, ()> {
2110        endpoints::RepoDeleteBranchProtection { owner, repo, name }
2111            .make_request()
2112            .wrap::<_, _>(self)
2113    }
2114
2115    /// Edit a branch protections for a repository. Only fields that are set will be changed
2116    ///
2117    /// - `owner`: owner of the repo
2118    /// - `repo`: name of the repo
2119    /// - `name`: name of protected branch
2120    /// - `body`: See [`EditBranchProtectionOption`]
2121    pub fn repo_edit_branch_protection(
2122        &self,
2123        owner: &str,
2124        repo: &str,
2125        name: &str,
2126        body: EditBranchProtectionOption,
2127    ) -> Request<'_, endpoints::RepoEditBranchProtection<'_>, BranchProtection> {
2128        endpoints::RepoEditBranchProtection {
2129            owner,
2130            repo,
2131            name,
2132            body: body,
2133        }
2134        .make_request()
2135        .wrap::<_, _>(self)
2136    }
2137
2138    /// List a repository's branches
2139    ///
2140    /// - `owner`: owner of the repo
2141    /// - `repo`: name of the repo
2142    pub fn repo_list_branches(
2143        &self,
2144        owner: &str,
2145        repo: &str,
2146    ) -> Request<'_, endpoints::RepoListBranches<'_>, (BranchListHeaders, Vec<Branch>)> {
2147        endpoints::RepoListBranches { owner, repo }
2148            .make_request()
2149            .wrap::<_, _>(self)
2150    }
2151
2152    /// Create a branch
2153    ///
2154    /// - `owner`: owner of the repo
2155    /// - `repo`: name of the repo
2156    /// - `body`: See [`CreateBranchRepoOption`]
2157    pub fn repo_create_branch(
2158        &self,
2159        owner: &str,
2160        repo: &str,
2161        body: CreateBranchRepoOption,
2162    ) -> Request<'_, endpoints::RepoCreateBranch<'_>, Branch> {
2163        endpoints::RepoCreateBranch {
2164            owner,
2165            repo,
2166            body: body,
2167        }
2168        .make_request()
2169        .wrap::<_, _>(self)
2170    }
2171
2172    /// Retrieve a specific branch from a repository, including its effective branch protection
2173    ///
2174    /// - `owner`: owner of the repo
2175    /// - `repo`: name of the repo
2176    /// - `branch`: branch to get
2177    pub fn repo_get_branch(
2178        &self,
2179        owner: &str,
2180        repo: &str,
2181        branch: &str,
2182    ) -> Request<'_, endpoints::RepoGetBranch<'_>, Branch> {
2183        endpoints::RepoGetBranch {
2184            owner,
2185            repo,
2186            branch,
2187        }
2188        .make_request()
2189        .wrap::<_, _>(self)
2190    }
2191
2192    /// Delete a specific branch from a repository
2193    ///
2194    /// - `owner`: owner of the repo
2195    /// - `repo`: name of the repo
2196    /// - `branch`: branch to delete
2197    pub fn repo_delete_branch(
2198        &self,
2199        owner: &str,
2200        repo: &str,
2201        branch: &str,
2202    ) -> Request<'_, endpoints::RepoDeleteBranch<'_>, ()> {
2203        endpoints::RepoDeleteBranch {
2204            owner,
2205            repo,
2206            branch,
2207        }
2208        .make_request()
2209        .wrap::<_, _>(self)
2210    }
2211
2212    /// Update a branch
2213    ///
2214    /// - `owner`: owner of the repo
2215    /// - `repo`: name of the repo
2216    /// - `branch`: name of the branch
2217    /// - `body`: See [`UpdateBranchRepoOption`]
2218    pub fn repo_update_branch(
2219        &self,
2220        owner: &str,
2221        repo: &str,
2222        branch: &str,
2223        body: UpdateBranchRepoOption,
2224    ) -> Request<'_, endpoints::RepoUpdateBranch<'_>, ()> {
2225        endpoints::RepoUpdateBranch {
2226            owner,
2227            repo,
2228            branch,
2229            body: body,
2230        }
2231        .make_request()
2232        .wrap::<_, _>(self)
2233    }
2234
2235    /// List a repository's collaborators
2236    ///
2237    /// - `owner`: owner of the repo
2238    /// - `repo`: name of the repo
2239    pub fn repo_list_collaborators(
2240        &self,
2241        owner: &str,
2242        repo: &str,
2243    ) -> Request<'_, endpoints::RepoListCollaborators<'_>, (UserListHeaders, Vec<User>)> {
2244        endpoints::RepoListCollaborators { owner, repo }
2245            .make_request()
2246            .wrap::<_, _>(self)
2247    }
2248
2249    /// Check if a user is a collaborator of a repository
2250    ///
2251    /// - `owner`: owner of the repo
2252    /// - `repo`: name of the repo
2253    /// - `collaborator`: username of the collaborator
2254    pub fn repo_check_collaborator(
2255        &self,
2256        owner: &str,
2257        repo: &str,
2258        collaborator: &str,
2259    ) -> Request<'_, endpoints::RepoCheckCollaborator<'_>, ()> {
2260        endpoints::RepoCheckCollaborator {
2261            owner,
2262            repo,
2263            collaborator,
2264        }
2265        .make_request()
2266        .wrap::<_, _>(self)
2267    }
2268
2269    /// Add a collaborator to a repository
2270    ///
2271    /// - `owner`: owner of the repo
2272    /// - `repo`: name of the repo
2273    /// - `collaborator`: username of the collaborator to add
2274    /// - `body`: See [`AddCollaboratorOption`]
2275    pub fn repo_add_collaborator(
2276        &self,
2277        owner: &str,
2278        repo: &str,
2279        collaborator: &str,
2280        body: AddCollaboratorOption,
2281    ) -> Request<'_, endpoints::RepoAddCollaborator<'_>, ()> {
2282        endpoints::RepoAddCollaborator {
2283            owner,
2284            repo,
2285            collaborator,
2286            body: body,
2287        }
2288        .make_request()
2289        .wrap::<_, _>(self)
2290    }
2291
2292    /// Delete a collaborator from a repository
2293    ///
2294    /// - `owner`: owner of the repo
2295    /// - `repo`: name of the repo
2296    /// - `collaborator`: username of the collaborator to delete
2297    pub fn repo_delete_collaborator(
2298        &self,
2299        owner: &str,
2300        repo: &str,
2301        collaborator: &str,
2302    ) -> Request<'_, endpoints::RepoDeleteCollaborator<'_>, ()> {
2303        endpoints::RepoDeleteCollaborator {
2304            owner,
2305            repo,
2306            collaborator,
2307        }
2308        .make_request()
2309        .wrap::<_, _>(self)
2310    }
2311
2312    /// Get repository permissions for a user
2313    ///
2314    /// - `owner`: owner of the repo
2315    /// - `repo`: name of the repo
2316    /// - `collaborator`: username of the collaborator
2317    pub fn repo_get_repo_permissions(
2318        &self,
2319        owner: &str,
2320        repo: &str,
2321        collaborator: &str,
2322    ) -> Request<'_, endpoints::RepoGetRepoPermissions<'_>, RepoCollaboratorPermission> {
2323        endpoints::RepoGetRepoPermissions {
2324            owner,
2325            repo,
2326            collaborator,
2327        }
2328        .make_request()
2329        .wrap::<_, _>(self)
2330    }
2331
2332    /// Get a list of all commits from a repository
2333    ///
2334    /// - `owner`: owner of the repo
2335    /// - `repo`: name of the repo
2336    pub fn repo_get_all_commits(
2337        &self,
2338        owner: &str,
2339        repo: &str,
2340        query: RepoGetAllCommitsQuery,
2341    ) -> Request<'_, endpoints::RepoGetAllCommits<'_>, (CommitListHeaders, Vec<Commit>)> {
2342        endpoints::RepoGetAllCommits { owner, repo, query }
2343            .make_request()
2344            .wrap::<_, _>(self)
2345    }
2346
2347    /// Get a commit's combined status, by branch/tag/commit reference
2348    ///
2349    /// - `owner`: owner of the repo
2350    /// - `repo`: name of the repo
2351    /// - `ref`: name of branch/tag/commit
2352    pub fn repo_get_combined_status_by_ref(
2353        &self,
2354        owner: &str,
2355        repo: &str,
2356        r#ref: &str,
2357    ) -> Request<
2358        '_,
2359        endpoints::RepoGetCombinedStatusByRef<'_>,
2360        (CombinedStatusHeaders, CombinedStatus),
2361    > {
2362        endpoints::RepoGetCombinedStatusByRef { owner, repo, r#ref }
2363            .make_request()
2364            .wrap::<_, _>(self)
2365    }
2366
2367    /// Get a commit's statuses, by branch/tag/commit reference
2368    ///
2369    /// - `owner`: owner of the repo
2370    /// - `repo`: name of the repo
2371    /// - `ref`: name of branch/tag/commit
2372    pub fn repo_list_statuses_by_ref(
2373        &self,
2374        owner: &str,
2375        repo: &str,
2376        r#ref: &str,
2377        query: RepoListStatusesByRefQuery,
2378    ) -> Request<
2379        '_,
2380        endpoints::RepoListStatusesByRef<'_>,
2381        (CommitStatusListHeaders, Vec<CommitStatus>),
2382    > {
2383        endpoints::RepoListStatusesByRef {
2384            owner,
2385            repo,
2386            r#ref,
2387            query,
2388        }
2389        .make_request()
2390        .wrap::<_, _>(self)
2391    }
2392
2393    /// Get the pull request of the commit
2394    ///
2395    /// - `owner`: owner of the repo
2396    /// - `repo`: name of the repo
2397    /// - `sha`: SHA of the commit to get
2398    pub fn repo_get_commit_pull_request(
2399        &self,
2400        owner: &str,
2401        repo: &str,
2402        sha: &str,
2403    ) -> Request<'_, endpoints::RepoGetCommitPullRequest<'_>, PullRequest> {
2404        endpoints::RepoGetCommitPullRequest { owner, repo, sha }
2405            .make_request()
2406            .wrap::<_, _>(self)
2407    }
2408
2409    /// Get commit comparison information
2410    ///
2411    /// - `owner`: owner of the repo
2412    /// - `repo`: name of the repo
2413    /// - `basehead`: compare two branches or commits
2414    pub fn repo_compare_diff(
2415        &self,
2416        owner: &str,
2417        repo: &str,
2418        basehead: &str,
2419    ) -> Request<'_, endpoints::RepoCompareDiff<'_>, Compare> {
2420        endpoints::RepoCompareDiff {
2421            owner,
2422            repo,
2423            basehead,
2424        }
2425        .make_request()
2426        .wrap::<_, _>(self)
2427    }
2428
2429    /// Gets the metadata of all the entries of the root dir
2430    ///
2431    /// - `owner`: owner of the repo
2432    /// - `repo`: name of the repo
2433    pub fn repo_get_contents_list(
2434        &self,
2435        owner: &str,
2436        repo: &str,
2437        query: RepoGetContentsListQuery,
2438    ) -> Request<'_, endpoints::RepoGetContentsList<'_>, Vec<ContentsResponse>> {
2439        endpoints::RepoGetContentsList { owner, repo, query }
2440            .make_request()
2441            .wrap::<_, _>(self)
2442    }
2443
2444    /// Modify multiple files in a repository
2445    ///
2446    /// - `owner`: owner of the repo
2447    /// - `repo`: name of the repo
2448    /// - `body`: See [`ChangeFilesOptions`]
2449    pub fn repo_change_files(
2450        &self,
2451        owner: &str,
2452        repo: &str,
2453        body: ChangeFilesOptions,
2454    ) -> Request<'_, endpoints::RepoChangeFiles<'_>, FilesResponse> {
2455        endpoints::RepoChangeFiles {
2456            owner,
2457            repo,
2458            body: body,
2459        }
2460        .make_request()
2461        .wrap::<_, _>(self)
2462    }
2463
2464    /// Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir
2465    ///
2466    /// - `owner`: owner of the repo
2467    /// - `repo`: name of the repo
2468    /// - `filepath`: path of the dir, file, symlink or submodule in the repo
2469    pub fn repo_get_contents(
2470        &self,
2471        owner: &str,
2472        repo: &str,
2473        filepath: &str,
2474        query: RepoGetContentsQuery,
2475    ) -> Request<'_, endpoints::RepoGetContents<'_>, ContentsResponse> {
2476        endpoints::RepoGetContents {
2477            owner,
2478            repo,
2479            filepath,
2480            query,
2481        }
2482        .make_request()
2483        .wrap::<_, _>(self)
2484    }
2485
2486    /// Update a file in a repository
2487    ///
2488    /// - `owner`: owner of the repo
2489    /// - `repo`: name of the repo
2490    /// - `filepath`: path of the file to update
2491    /// - `body`: See [`UpdateFileOptions`]
2492    pub fn repo_update_file(
2493        &self,
2494        owner: &str,
2495        repo: &str,
2496        filepath: &str,
2497        body: UpdateFileOptions,
2498    ) -> Request<'_, endpoints::RepoUpdateFile<'_>, FileResponse> {
2499        endpoints::RepoUpdateFile {
2500            owner,
2501            repo,
2502            filepath,
2503            body: body,
2504        }
2505        .make_request()
2506        .wrap::<_, _>(self)
2507    }
2508
2509    /// Create a file in a repository
2510    ///
2511    /// - `owner`: owner of the repo
2512    /// - `repo`: name of the repo
2513    /// - `filepath`: path of the file to create
2514    /// - `body`: See [`CreateFileOptions`]
2515    pub fn repo_create_file(
2516        &self,
2517        owner: &str,
2518        repo: &str,
2519        filepath: &str,
2520        body: CreateFileOptions,
2521    ) -> Request<'_, endpoints::RepoCreateFile<'_>, FileResponse> {
2522        endpoints::RepoCreateFile {
2523            owner,
2524            repo,
2525            filepath,
2526            body: body,
2527        }
2528        .make_request()
2529        .wrap::<_, _>(self)
2530    }
2531
2532    /// Delete a file in a repository
2533    ///
2534    /// - `owner`: owner of the repo
2535    /// - `repo`: name of the repo
2536    /// - `filepath`: path of the file to delete
2537    /// - `body`: See [`DeleteFileOptions`]
2538    pub fn repo_delete_file(
2539        &self,
2540        owner: &str,
2541        repo: &str,
2542        filepath: &str,
2543        body: DeleteFileOptions,
2544    ) -> Request<'_, endpoints::RepoDeleteFile<'_>, FileDeleteResponse> {
2545        endpoints::RepoDeleteFile {
2546            owner,
2547            repo,
2548            filepath,
2549            body: body,
2550        }
2551        .make_request()
2552        .wrap::<_, _>(self)
2553    }
2554
2555    /// Convert a mirror repo to a normal repo.
2556    ///
2557    /// - `owner`: owner of the repo to convert
2558    /// - `repo`: name of the repo to convert
2559    pub fn repo_convert(
2560        &self,
2561        owner: &str,
2562        repo: &str,
2563    ) -> Request<'_, endpoints::RepoConvert<'_>, Repository> {
2564        endpoints::RepoConvert { owner, repo }
2565            .make_request()
2566            .wrap::<_, _>(self)
2567    }
2568
2569    /// Apply diff patch to repository
2570    ///
2571    /// - `owner`: owner of the repo
2572    /// - `repo`: name of the repo
2573    /// - `body`: See [`UpdateFileOptions`]
2574    pub fn repo_apply_diff_patch(
2575        &self,
2576        owner: &str,
2577        repo: &str,
2578        body: UpdateFileOptions,
2579    ) -> Request<'_, endpoints::RepoApplyDiffPatch<'_>, FileResponse> {
2580        endpoints::RepoApplyDiffPatch {
2581            owner,
2582            repo,
2583            body: body,
2584        }
2585        .make_request()
2586        .wrap::<_, _>(self)
2587    }
2588
2589    /// Get the EditorConfig definitions of a file in a repository
2590    ///
2591    /// - `owner`: owner of the repo
2592    /// - `repo`: name of the repo
2593    /// - `filepath`: filepath of file to get
2594    pub fn repo_get_editor_config(
2595        &self,
2596        owner: &str,
2597        repo: &str,
2598        filepath: &str,
2599        query: RepoGetEditorConfigQuery,
2600    ) -> Request<'_, endpoints::RepoGetEditorConfig<'_>, BTreeMap<String, String>> {
2601        endpoints::RepoGetEditorConfig {
2602            owner,
2603            repo,
2604            filepath,
2605            query,
2606        }
2607        .make_request()
2608        .wrap::<_, _>(self)
2609    }
2610
2611    /// List a repository's flags
2612    ///
2613    /// - `owner`: owner of the repo
2614    /// - `repo`: name of the repo
2615    pub fn repo_list_flags(
2616        &self,
2617        owner: &str,
2618        repo: &str,
2619    ) -> Request<'_, endpoints::RepoListFlags<'_>, Vec<String>> {
2620        endpoints::RepoListFlags { owner, repo }
2621            .make_request()
2622            .wrap::<_, _>(self)
2623    }
2624
2625    /// Replace all flags of a repository
2626    ///
2627    /// - `owner`: owner of the repo
2628    /// - `repo`: name of the repo
2629    /// - `body`: See [`ReplaceFlagsOption`]
2630    pub fn repo_replace_all_flags(
2631        &self,
2632        owner: &str,
2633        repo: &str,
2634        body: ReplaceFlagsOption,
2635    ) -> Request<'_, endpoints::RepoReplaceAllFlags<'_>, ()> {
2636        endpoints::RepoReplaceAllFlags {
2637            owner,
2638            repo,
2639            body: body,
2640        }
2641        .make_request()
2642        .wrap::<_, _>(self)
2643    }
2644
2645    /// Remove all flags from a repository
2646    ///
2647    /// - `owner`: owner of the repo
2648    /// - `repo`: name of the repo
2649    pub fn repo_delete_all_flags(
2650        &self,
2651        owner: &str,
2652        repo: &str,
2653    ) -> Request<'_, endpoints::RepoDeleteAllFlags<'_>, ()> {
2654        endpoints::RepoDeleteAllFlags { owner, repo }
2655            .make_request()
2656            .wrap::<_, _>(self)
2657    }
2658
2659    /// Check if a repository has a given flag
2660    ///
2661    /// - `owner`: owner of the repo
2662    /// - `repo`: name of the repo
2663    /// - `flag`: name of the flag
2664    pub fn repo_check_flag(
2665        &self,
2666        owner: &str,
2667        repo: &str,
2668        flag: &str,
2669    ) -> Request<'_, endpoints::RepoCheckFlag<'_>, ()> {
2670        endpoints::RepoCheckFlag { owner, repo, flag }
2671            .make_request()
2672            .wrap::<_, _>(self)
2673    }
2674
2675    /// Add a flag to a repository
2676    ///
2677    /// - `owner`: owner of the repo
2678    /// - `repo`: name of the repo
2679    /// - `flag`: name of the flag
2680    pub fn repo_add_flag(
2681        &self,
2682        owner: &str,
2683        repo: &str,
2684        flag: &str,
2685    ) -> Request<'_, endpoints::RepoAddFlag<'_>, ()> {
2686        endpoints::RepoAddFlag { owner, repo, flag }
2687            .make_request()
2688            .wrap::<_, _>(self)
2689    }
2690
2691    /// Remove a flag from a repository
2692    ///
2693    /// - `owner`: owner of the repo
2694    /// - `repo`: name of the repo
2695    /// - `flag`: name of the flag
2696    pub fn repo_delete_flag(
2697        &self,
2698        owner: &str,
2699        repo: &str,
2700        flag: &str,
2701    ) -> Request<'_, endpoints::RepoDeleteFlag<'_>, ()> {
2702        endpoints::RepoDeleteFlag { owner, repo, flag }
2703            .make_request()
2704            .wrap::<_, _>(self)
2705    }
2706
2707    /// List a repository's forks
2708    ///
2709    /// - `owner`: owner of the repo
2710    /// - `repo`: name of the repo
2711    pub fn list_forks(
2712        &self,
2713        owner: &str,
2714        repo: &str,
2715    ) -> Request<'_, endpoints::ListForks<'_>, (RepositoryListHeaders, Vec<Repository>)> {
2716        endpoints::ListForks { owner, repo }
2717            .make_request()
2718            .wrap::<_, _>(self)
2719    }
2720
2721    /// Fork a repository
2722    ///
2723    /// - `owner`: owner of the repo to fork
2724    /// - `repo`: name of the repo to fork
2725    /// - `body`: See [`CreateForkOption`]
2726    pub fn create_fork(
2727        &self,
2728        owner: &str,
2729        repo: &str,
2730        body: CreateForkOption,
2731    ) -> Request<'_, endpoints::CreateFork<'_>, Repository> {
2732        endpoints::CreateFork {
2733            owner,
2734            repo,
2735            body: body,
2736        }
2737        .make_request()
2738        .wrap::<_, _>(self)
2739    }
2740
2741    /// Gets multiplbe blobs of a repository.
2742    ///
2743    /// - `owner`: owner of the repo
2744    /// - `repo`: name of the repo
2745    pub fn get_blobs(
2746        &self,
2747        owner: &str,
2748        repo: &str,
2749        query: GetBlobsQuery,
2750    ) -> Request<'_, endpoints::GetBlobs<'_>, Vec<GitBlob>> {
2751        endpoints::GetBlobs { owner, repo, query }
2752            .make_request()
2753            .wrap::<_, _>(self)
2754    }
2755
2756    /// Gets the blob of a repository.
2757    ///
2758    /// - `owner`: owner of the repo
2759    /// - `repo`: name of the repo
2760    /// - `sha`: sha of the blob to retrieve
2761    pub fn get_blob(
2762        &self,
2763        owner: &str,
2764        repo: &str,
2765        sha: &str,
2766    ) -> Request<'_, endpoints::GetBlob<'_>, GitBlob> {
2767        endpoints::GetBlob { owner, repo, sha }
2768            .make_request()
2769            .wrap::<_, _>(self)
2770    }
2771
2772    /// Get a single commit from a repository
2773    ///
2774    /// - `owner`: owner of the repo
2775    /// - `repo`: name of the repo
2776    /// - `sha`: a git ref or commit sha
2777    pub fn repo_get_single_commit(
2778        &self,
2779        owner: &str,
2780        repo: &str,
2781        sha: &str,
2782        query: RepoGetSingleCommitQuery,
2783    ) -> Request<'_, endpoints::RepoGetSingleCommit<'_>, Commit> {
2784        endpoints::RepoGetSingleCommit {
2785            owner,
2786            repo,
2787            sha,
2788            query,
2789        }
2790        .make_request()
2791        .wrap::<_, _>(self)
2792    }
2793
2794    /// Get a commit's diff or patch
2795    ///
2796    /// - `owner`: owner of the repo
2797    /// - `repo`: name of the repo
2798    /// - `sha`: SHA of the commit to get
2799    /// - `diffType`: whether the output is diff or patch
2800    pub fn repo_download_commit_diff_or_patch(
2801        &self,
2802        owner: &str,
2803        repo: &str,
2804        sha: &str,
2805        diff_type: &str,
2806    ) -> Request<'_, endpoints::RepoDownloadCommitDiffOrPatch<'_>, String> {
2807        endpoints::RepoDownloadCommitDiffOrPatch {
2808            owner,
2809            repo,
2810            sha,
2811            diff_type,
2812        }
2813        .make_request()
2814        .wrap::<_, _>(self)
2815    }
2816
2817    /// Get a note corresponding to a single commit from a repository
2818    ///
2819    /// - `owner`: owner of the repo
2820    /// - `repo`: name of the repo
2821    /// - `sha`: a git ref or commit sha
2822    pub fn repo_get_note(
2823        &self,
2824        owner: &str,
2825        repo: &str,
2826        sha: &str,
2827        query: RepoGetNoteQuery,
2828    ) -> Request<'_, endpoints::RepoGetNote<'_>, Note> {
2829        endpoints::RepoGetNote {
2830            owner,
2831            repo,
2832            sha,
2833            query,
2834        }
2835        .make_request()
2836        .wrap::<_, _>(self)
2837    }
2838
2839    /// Set a note corresponding to a single commit from a repository
2840    ///
2841    /// - `owner`: owner of the repo
2842    /// - `repo`: name of the repo
2843    /// - `sha`: a git ref or commit sha
2844    /// - `body`: See [`NoteOptions`]
2845    pub fn repo_set_note(
2846        &self,
2847        owner: &str,
2848        repo: &str,
2849        sha: &str,
2850        body: NoteOptions,
2851    ) -> Request<'_, endpoints::RepoSetNote<'_>, Note> {
2852        endpoints::RepoSetNote {
2853            owner,
2854            repo,
2855            sha,
2856            body: body,
2857        }
2858        .make_request()
2859        .wrap::<_, _>(self)
2860    }
2861
2862    /// Removes a note corresponding to a single commit from a repository
2863    ///
2864    /// - `owner`: owner of the repo
2865    /// - `repo`: name of the repo
2866    /// - `sha`: a git ref or commit sha
2867    pub fn repo_remove_note(
2868        &self,
2869        owner: &str,
2870        repo: &str,
2871        sha: &str,
2872    ) -> Request<'_, endpoints::RepoRemoveNote<'_>, ()> {
2873        endpoints::RepoRemoveNote { owner, repo, sha }
2874            .make_request()
2875            .wrap::<_, _>(self)
2876    }
2877
2878    /// Get specified ref or filtered repository's refs
2879    ///
2880    /// - `owner`: owner of the repo
2881    /// - `repo`: name of the repo
2882    pub fn repo_list_all_git_refs(
2883        &self,
2884        owner: &str,
2885        repo: &str,
2886    ) -> Request<'_, endpoints::RepoListAllGitRefs<'_>, Vec<Reference>> {
2887        endpoints::RepoListAllGitRefs { owner, repo }
2888            .make_request()
2889            .wrap::<_, _>(self)
2890    }
2891
2892    /// Get specified ref or filtered repository's refs
2893    ///
2894    /// - `owner`: owner of the repo
2895    /// - `repo`: name of the repo
2896    /// - `ref`: part or full name of the ref
2897    pub fn repo_list_git_refs(
2898        &self,
2899        owner: &str,
2900        repo: &str,
2901        r#ref: &str,
2902    ) -> Request<'_, endpoints::RepoListGitRefs<'_>, Vec<Reference>> {
2903        endpoints::RepoListGitRefs { owner, repo, r#ref }
2904            .make_request()
2905            .wrap::<_, _>(self)
2906    }
2907
2908    /// Gets the tag object of an annotated tag (not lightweight tags)
2909    ///
2910    /// - `owner`: owner of the repo
2911    /// - `repo`: name of the repo
2912    /// - `sha`: sha of the tag. The Git tags API only supports annotated tag objects, not lightweight tags.
2913    pub fn get_annotated_tag(
2914        &self,
2915        owner: &str,
2916        repo: &str,
2917        sha: &str,
2918    ) -> Request<'_, endpoints::GetAnnotatedTag<'_>, AnnotatedTag> {
2919        endpoints::GetAnnotatedTag { owner, repo, sha }
2920            .make_request()
2921            .wrap::<_, _>(self)
2922    }
2923
2924    /// Gets the tree of a repository.
2925    ///
2926    /// - `owner`: owner of the repo
2927    /// - `repo`: name of the repo
2928    /// - `sha`: sha of the commit
2929    pub fn get_tree(
2930        &self,
2931        owner: &str,
2932        repo: &str,
2933        sha: &str,
2934        query: GetTreeQuery,
2935    ) -> Request<'_, endpoints::GetTree<'_>, GitTreeResponse> {
2936        endpoints::GetTree {
2937            owner,
2938            repo,
2939            sha,
2940            query,
2941        }
2942        .make_request()
2943        .wrap::<_, _>(self)
2944    }
2945
2946    /// List the hooks in a repository
2947    ///
2948    /// - `owner`: owner of the repo
2949    /// - `repo`: name of the repo
2950    pub fn repo_list_hooks(
2951        &self,
2952        owner: &str,
2953        repo: &str,
2954    ) -> Request<'_, endpoints::RepoListHooks<'_>, (HookListHeaders, Vec<Hook>)> {
2955        endpoints::RepoListHooks { owner, repo }
2956            .make_request()
2957            .wrap::<_, _>(self)
2958    }
2959
2960    /// Create a hook
2961    ///
2962    /// - `owner`: owner of the repo
2963    /// - `repo`: name of the repo
2964    /// - `body`: See [`CreateHookOption`]
2965    pub fn repo_create_hook(
2966        &self,
2967        owner: &str,
2968        repo: &str,
2969        body: CreateHookOption,
2970    ) -> Request<'_, endpoints::RepoCreateHook<'_>, Hook> {
2971        endpoints::RepoCreateHook {
2972            owner,
2973            repo,
2974            body: body,
2975        }
2976        .make_request()
2977        .wrap::<_, _>(self)
2978    }
2979
2980    /// List the Git hooks in a repository
2981    ///
2982    /// - `owner`: owner of the repo
2983    /// - `repo`: name of the repo
2984    pub fn repo_list_git_hooks(
2985        &self,
2986        owner: &str,
2987        repo: &str,
2988    ) -> Request<'_, endpoints::RepoListGitHooks<'_>, (GitHookListHeaders, Vec<GitHook>)> {
2989        endpoints::RepoListGitHooks { owner, repo }
2990            .make_request()
2991            .wrap::<_, _>(self)
2992    }
2993
2994    /// Get a Git hook
2995    ///
2996    /// - `owner`: owner of the repo
2997    /// - `repo`: name of the repo
2998    /// - `id`: id of the hook to get
2999    pub fn repo_get_git_hook(
3000        &self,
3001        owner: &str,
3002        repo: &str,
3003        id: &str,
3004    ) -> Request<'_, endpoints::RepoGetGitHook<'_>, GitHook> {
3005        endpoints::RepoGetGitHook { owner, repo, id }
3006            .make_request()
3007            .wrap::<_, _>(self)
3008    }
3009
3010    /// Delete a Git hook in a repository
3011    ///
3012    /// - `owner`: owner of the repo
3013    /// - `repo`: name of the repo
3014    /// - `id`: id of the hook to get
3015    pub fn repo_delete_git_hook(
3016        &self,
3017        owner: &str,
3018        repo: &str,
3019        id: &str,
3020    ) -> Request<'_, endpoints::RepoDeleteGitHook<'_>, ()> {
3021        endpoints::RepoDeleteGitHook { owner, repo, id }
3022            .make_request()
3023            .wrap::<_, _>(self)
3024    }
3025
3026    /// Edit a Git hook in a repository
3027    ///
3028    /// - `owner`: owner of the repo
3029    /// - `repo`: name of the repo
3030    /// - `id`: id of the hook to get
3031    /// - `body`: See [`EditGitHookOption`]
3032    pub fn repo_edit_git_hook(
3033        &self,
3034        owner: &str,
3035        repo: &str,
3036        id: &str,
3037        body: EditGitHookOption,
3038    ) -> Request<'_, endpoints::RepoEditGitHook<'_>, GitHook> {
3039        endpoints::RepoEditGitHook {
3040            owner,
3041            repo,
3042            id,
3043            body: body,
3044        }
3045        .make_request()
3046        .wrap::<_, _>(self)
3047    }
3048
3049    /// Get a hook
3050    ///
3051    /// - `owner`: owner of the repo
3052    /// - `repo`: name of the repo
3053    /// - `id`: id of the hook to get
3054    pub fn repo_get_hook(
3055        &self,
3056        owner: &str,
3057        repo: &str,
3058        id: i64,
3059    ) -> Request<'_, endpoints::RepoGetHook<'_>, Hook> {
3060        endpoints::RepoGetHook { owner, repo, id }
3061            .make_request()
3062            .wrap::<_, _>(self)
3063    }
3064
3065    /// Delete a hook in a repository
3066    ///
3067    /// - `owner`: owner of the repo
3068    /// - `repo`: name of the repo
3069    /// - `id`: id of the hook to delete
3070    pub fn repo_delete_hook(
3071        &self,
3072        owner: &str,
3073        repo: &str,
3074        id: i64,
3075    ) -> Request<'_, endpoints::RepoDeleteHook<'_>, ()> {
3076        endpoints::RepoDeleteHook { owner, repo, id }
3077            .make_request()
3078            .wrap::<_, _>(self)
3079    }
3080
3081    /// Edit a hook in a repository
3082    ///
3083    /// - `owner`: owner of the repo
3084    /// - `repo`: name of the repo
3085    /// - `id`: index of the hook
3086    /// - `body`: See [`EditHookOption`]
3087    pub fn repo_edit_hook(
3088        &self,
3089        owner: &str,
3090        repo: &str,
3091        id: i64,
3092        body: EditHookOption,
3093    ) -> Request<'_, endpoints::RepoEditHook<'_>, Hook> {
3094        endpoints::RepoEditHook {
3095            owner,
3096            repo,
3097            id,
3098            body: body,
3099        }
3100        .make_request()
3101        .wrap::<_, _>(self)
3102    }
3103
3104    /// Test a push webhook
3105    ///
3106    /// - `owner`: owner of the repo
3107    /// - `repo`: name of the repo
3108    /// - `id`: id of the hook to test
3109    pub fn repo_test_hook(
3110        &self,
3111        owner: &str,
3112        repo: &str,
3113        id: i64,
3114        query: RepoTestHookQuery,
3115    ) -> Request<'_, endpoints::RepoTestHook<'_>, ()> {
3116        endpoints::RepoTestHook {
3117            owner,
3118            repo,
3119            id,
3120            query,
3121        }
3122        .make_request()
3123        .wrap::<_, _>(self)
3124    }
3125
3126    /// Returns the issue config for a repo
3127    ///
3128    /// - `owner`: owner of the repo
3129    /// - `repo`: name of the repo
3130    pub fn repo_get_issue_config(
3131        &self,
3132        owner: &str,
3133        repo: &str,
3134    ) -> Request<'_, endpoints::RepoGetIssueConfig<'_>, IssueConfig> {
3135        endpoints::RepoGetIssueConfig { owner, repo }
3136            .make_request()
3137            .wrap::<_, _>(self)
3138    }
3139
3140    /// Returns the validation information for a issue config
3141    ///
3142    /// - `owner`: owner of the repo
3143    /// - `repo`: name of the repo
3144    pub fn repo_validate_issue_config(
3145        &self,
3146        owner: &str,
3147        repo: &str,
3148    ) -> Request<'_, endpoints::RepoValidateIssueConfig<'_>, IssueConfigValidation> {
3149        endpoints::RepoValidateIssueConfig { owner, repo }
3150            .make_request()
3151            .wrap::<_, _>(self)
3152    }
3153
3154    /// Get available issue templates for a repository
3155    ///
3156    /// - `owner`: owner of the repo
3157    /// - `repo`: name of the repo
3158    pub fn repo_get_issue_templates(
3159        &self,
3160        owner: &str,
3161        repo: &str,
3162    ) -> Request<'_, endpoints::RepoGetIssueTemplates<'_>, Vec<IssueTemplate>> {
3163        endpoints::RepoGetIssueTemplates { owner, repo }
3164            .make_request()
3165            .wrap::<_, _>(self)
3166    }
3167
3168    /// List a repository's issues
3169    ///
3170    /// - `owner`: owner of the repo
3171    /// - `repo`: name of the repo
3172    pub fn issue_list_issues(
3173        &self,
3174        owner: &str,
3175        repo: &str,
3176        query: IssueListIssuesQuery,
3177    ) -> Request<'_, endpoints::IssueListIssues<'_>, (IssueListHeaders, Vec<Issue>)> {
3178        endpoints::IssueListIssues { owner, repo, query }
3179            .make_request()
3180            .wrap::<_, _>(self)
3181    }
3182
3183    /// Create an issue. If using deadline only the date will be taken into account, and time of day ignored.
3184    ///
3185    /// - `owner`: owner of the repo
3186    /// - `repo`: name of the repo
3187    /// - `body`: See [`CreateIssueOption`]
3188    pub fn issue_create_issue(
3189        &self,
3190        owner: &str,
3191        repo: &str,
3192        body: CreateIssueOption,
3193    ) -> Request<'_, endpoints::IssueCreateIssue<'_>, Issue> {
3194        endpoints::IssueCreateIssue {
3195            owner,
3196            repo,
3197            body: body,
3198        }
3199        .make_request()
3200        .wrap::<_, _>(self)
3201    }
3202
3203    /// List all comments in a repository
3204    ///
3205    /// - `owner`: owner of the repo
3206    /// - `repo`: name of the repo
3207    pub fn issue_get_repo_comments(
3208        &self,
3209        owner: &str,
3210        repo: &str,
3211        query: IssueGetRepoCommentsQuery,
3212    ) -> Request<'_, endpoints::IssueGetRepoComments<'_>, (CommentListHeaders, Vec<Comment>)> {
3213        endpoints::IssueGetRepoComments { owner, repo, query }
3214            .make_request()
3215            .wrap::<_, _>(self)
3216    }
3217
3218    /// Get a comment
3219    ///
3220    /// - `owner`: owner of the repo
3221    /// - `repo`: name of the repo
3222    /// - `id`: id of the comment
3223    pub fn issue_get_comment(
3224        &self,
3225        owner: &str,
3226        repo: &str,
3227        id: i64,
3228    ) -> Request<'_, endpoints::IssueGetComment<'_>, Option<Comment>> {
3229        endpoints::IssueGetComment { owner, repo, id }
3230            .make_request()
3231            .wrap::<_, _>(self)
3232    }
3233
3234    /// Delete a comment
3235    ///
3236    /// - `owner`: owner of the repo
3237    /// - `repo`: name of the repo
3238    /// - `id`: id of comment to delete
3239    pub fn issue_delete_comment(
3240        &self,
3241        owner: &str,
3242        repo: &str,
3243        id: i64,
3244    ) -> Request<'_, endpoints::IssueDeleteComment<'_>, ()> {
3245        endpoints::IssueDeleteComment { owner, repo, id }
3246            .make_request()
3247            .wrap::<_, _>(self)
3248    }
3249
3250    /// Edit a comment
3251    ///
3252    /// - `owner`: owner of the repo
3253    /// - `repo`: name of the repo
3254    /// - `id`: id of the comment to edit
3255    /// - `body`: See [`EditIssueCommentOption`]
3256    pub fn issue_edit_comment(
3257        &self,
3258        owner: &str,
3259        repo: &str,
3260        id: i64,
3261        body: EditIssueCommentOption,
3262    ) -> Request<'_, endpoints::IssueEditComment<'_>, Option<Comment>> {
3263        endpoints::IssueEditComment {
3264            owner,
3265            repo,
3266            id,
3267            body: body,
3268        }
3269        .make_request()
3270        .wrap::<_, _>(self)
3271    }
3272
3273    /// List comment's attachments
3274    ///
3275    /// - `owner`: owner of the repo
3276    /// - `repo`: name of the repo
3277    /// - `id`: id of the comment
3278    pub fn issue_list_issue_comment_attachments(
3279        &self,
3280        owner: &str,
3281        repo: &str,
3282        id: i64,
3283    ) -> Request<'_, endpoints::IssueListIssueCommentAttachments<'_>, Vec<Attachment>> {
3284        endpoints::IssueListIssueCommentAttachments { owner, repo, id }
3285            .make_request()
3286            .wrap::<_, _>(self)
3287    }
3288
3289    /// Create a comment attachment
3290    ///
3291    /// - `owner`: owner of the repo
3292    /// - `repo`: name of the repo
3293    /// - `id`: id of the comment
3294    /// - `attachment`: attachment to upload
3295    pub fn issue_create_issue_comment_attachment(
3296        &self,
3297        owner: &str,
3298        repo: &str,
3299        id: i64,
3300        attachment: &[u8],
3301        query: IssueCreateIssueCommentAttachmentQuery,
3302    ) -> Request<'_, endpoints::IssueCreateIssueCommentAttachment<'_>, Attachment> {
3303        endpoints::IssueCreateIssueCommentAttachment {
3304            owner,
3305            repo,
3306            id,
3307            attachment: &attachment,
3308            query,
3309        }
3310        .make_request()
3311        .wrap::<_, _>(self)
3312    }
3313
3314    /// Get a comment attachment
3315    ///
3316    /// - `owner`: owner of the repo
3317    /// - `repo`: name of the repo
3318    /// - `id`: id of the comment
3319    /// - `attachment_id`: id of the attachment to get
3320    pub fn issue_get_issue_comment_attachment(
3321        &self,
3322        owner: &str,
3323        repo: &str,
3324        id: i64,
3325        attachment_id: i64,
3326    ) -> Request<'_, endpoints::IssueGetIssueCommentAttachment<'_>, Attachment> {
3327        endpoints::IssueGetIssueCommentAttachment {
3328            owner,
3329            repo,
3330            id,
3331            attachment_id,
3332        }
3333        .make_request()
3334        .wrap::<_, _>(self)
3335    }
3336
3337    /// Delete a comment attachment
3338    ///
3339    /// - `owner`: owner of the repo
3340    /// - `repo`: name of the repo
3341    /// - `id`: id of the comment
3342    /// - `attachment_id`: id of the attachment to delete
3343    pub fn issue_delete_issue_comment_attachment(
3344        &self,
3345        owner: &str,
3346        repo: &str,
3347        id: i64,
3348        attachment_id: i64,
3349    ) -> Request<'_, endpoints::IssueDeleteIssueCommentAttachment<'_>, ()> {
3350        endpoints::IssueDeleteIssueCommentAttachment {
3351            owner,
3352            repo,
3353            id,
3354            attachment_id,
3355        }
3356        .make_request()
3357        .wrap::<_, _>(self)
3358    }
3359
3360    /// Edit a comment attachment
3361    ///
3362    /// - `owner`: owner of the repo
3363    /// - `repo`: name of the repo
3364    /// - `id`: id of the comment
3365    /// - `attachment_id`: id of the attachment to edit
3366    /// - `body`: See [`EditAttachmentOptions`]
3367    pub fn issue_edit_issue_comment_attachment(
3368        &self,
3369        owner: &str,
3370        repo: &str,
3371        id: i64,
3372        attachment_id: i64,
3373        body: EditAttachmentOptions,
3374    ) -> Request<'_, endpoints::IssueEditIssueCommentAttachment<'_>, Attachment> {
3375        endpoints::IssueEditIssueCommentAttachment {
3376            owner,
3377            repo,
3378            id,
3379            attachment_id,
3380            body: body,
3381        }
3382        .make_request()
3383        .wrap::<_, _>(self)
3384    }
3385
3386    /// Get a list of reactions from a comment of an issue
3387    ///
3388    /// - `owner`: owner of the repo
3389    /// - `repo`: name of the repo
3390    /// - `id`: id of the comment to edit
3391    pub fn issue_get_comment_reactions(
3392        &self,
3393        owner: &str,
3394        repo: &str,
3395        id: i64,
3396    ) -> Request<'_, endpoints::IssueGetCommentReactions<'_>, (ReactionListHeaders, Vec<Reaction>)>
3397    {
3398        endpoints::IssueGetCommentReactions { owner, repo, id }
3399            .make_request()
3400            .wrap::<_, _>(self)
3401    }
3402
3403    /// Add a reaction to a comment of an issue
3404    ///
3405    /// - `owner`: owner of the repo
3406    /// - `repo`: name of the repo
3407    /// - `id`: id of the comment to edit
3408    /// - `content`: See [`EditReactionOption`]
3409    pub fn issue_post_comment_reaction(
3410        &self,
3411        owner: &str,
3412        repo: &str,
3413        id: i64,
3414        content: EditReactionOption,
3415    ) -> Request<'_, endpoints::IssuePostCommentReaction<'_>, Reaction> {
3416        endpoints::IssuePostCommentReaction {
3417            owner,
3418            repo,
3419            id,
3420            body: content,
3421        }
3422        .make_request()
3423        .wrap::<_, _>(self)
3424    }
3425
3426    /// Remove a reaction from a comment of an issue
3427    ///
3428    /// - `owner`: owner of the repo
3429    /// - `repo`: name of the repo
3430    /// - `id`: id of the comment to edit
3431    /// - `content`: See [`EditReactionOption`]
3432    pub fn issue_delete_comment_reaction(
3433        &self,
3434        owner: &str,
3435        repo: &str,
3436        id: i64,
3437        content: EditReactionOption,
3438    ) -> Request<'_, endpoints::IssueDeleteCommentReaction<'_>, ()> {
3439        endpoints::IssueDeleteCommentReaction {
3440            owner,
3441            repo,
3442            id,
3443            body: content,
3444        }
3445        .make_request()
3446        .wrap::<_, _>(self)
3447    }
3448
3449    /// List a repo's pinned issues
3450    ///
3451    /// - `owner`: owner of the repo
3452    /// - `repo`: name of the repo
3453    pub fn repo_list_pinned_issues(
3454        &self,
3455        owner: &str,
3456        repo: &str,
3457    ) -> Request<'_, endpoints::RepoListPinnedIssues<'_>, (IssueListHeaders, Vec<Issue>)> {
3458        endpoints::RepoListPinnedIssues { owner, repo }
3459            .make_request()
3460            .wrap::<_, _>(self)
3461    }
3462
3463    /// Get an issue
3464    ///
3465    /// - `owner`: owner of the repo
3466    /// - `repo`: name of the repo
3467    /// - `index`: index of the issue to get
3468    pub fn issue_get_issue(
3469        &self,
3470        owner: &str,
3471        repo: &str,
3472        index: i64,
3473    ) -> Request<'_, endpoints::IssueGetIssue<'_>, Issue> {
3474        endpoints::IssueGetIssue { owner, repo, index }
3475            .make_request()
3476            .wrap::<_, _>(self)
3477    }
3478
3479    /// Delete an issue
3480    ///
3481    /// - `owner`: owner of the repo
3482    /// - `repo`: name of the repo
3483    /// - `index`: index of issue to delete
3484    pub fn issue_delete(
3485        &self,
3486        owner: &str,
3487        repo: &str,
3488        index: i64,
3489    ) -> Request<'_, endpoints::IssueDelete<'_>, ()> {
3490        endpoints::IssueDelete { owner, repo, index }
3491            .make_request()
3492            .wrap::<_, _>(self)
3493    }
3494
3495    /// Edit an issue. If using deadline only the date will be taken into account, and time of day ignored.
3496    ///
3497    /// - `owner`: owner of the repo
3498    /// - `repo`: name of the repo
3499    /// - `index`: index of the issue to edit
3500    /// - `body`: See [`EditIssueOption`]
3501    pub fn issue_edit_issue(
3502        &self,
3503        owner: &str,
3504        repo: &str,
3505        index: i64,
3506        body: EditIssueOption,
3507    ) -> Request<'_, endpoints::IssueEditIssue<'_>, Issue> {
3508        endpoints::IssueEditIssue {
3509            owner,
3510            repo,
3511            index,
3512            body: body,
3513        }
3514        .make_request()
3515        .wrap::<_, _>(self)
3516    }
3517
3518    /// List issue's attachments
3519    ///
3520    /// - `owner`: owner of the repo
3521    /// - `repo`: name of the repo
3522    /// - `index`: index of the issue
3523    pub fn issue_list_issue_attachments(
3524        &self,
3525        owner: &str,
3526        repo: &str,
3527        index: i64,
3528    ) -> Request<'_, endpoints::IssueListIssueAttachments<'_>, Vec<Attachment>> {
3529        endpoints::IssueListIssueAttachments { owner, repo, index }
3530            .make_request()
3531            .wrap::<_, _>(self)
3532    }
3533
3534    /// Create an issue attachment
3535    ///
3536    /// - `owner`: owner of the repo
3537    /// - `repo`: name of the repo
3538    /// - `index`: index of the issue
3539    /// - `attachment`: attachment to upload
3540    pub fn issue_create_issue_attachment(
3541        &self,
3542        owner: &str,
3543        repo: &str,
3544        index: i64,
3545        attachment: &[u8],
3546        query: IssueCreateIssueAttachmentQuery,
3547    ) -> Request<'_, endpoints::IssueCreateIssueAttachment<'_>, Attachment> {
3548        endpoints::IssueCreateIssueAttachment {
3549            owner,
3550            repo,
3551            index,
3552            attachment: &attachment,
3553            query,
3554        }
3555        .make_request()
3556        .wrap::<_, _>(self)
3557    }
3558
3559    /// Get an issue attachment
3560    ///
3561    /// - `owner`: owner of the repo
3562    /// - `repo`: name of the repo
3563    /// - `index`: index of the issue
3564    /// - `attachment_id`: id of the attachment to get
3565    pub fn issue_get_issue_attachment(
3566        &self,
3567        owner: &str,
3568        repo: &str,
3569        index: i64,
3570        attachment_id: i64,
3571    ) -> Request<'_, endpoints::IssueGetIssueAttachment<'_>, Attachment> {
3572        endpoints::IssueGetIssueAttachment {
3573            owner,
3574            repo,
3575            index,
3576            attachment_id,
3577        }
3578        .make_request()
3579        .wrap::<_, _>(self)
3580    }
3581
3582    /// Delete an issue attachment
3583    ///
3584    /// - `owner`: owner of the repo
3585    /// - `repo`: name of the repo
3586    /// - `index`: index of the issue
3587    /// - `attachment_id`: id of the attachment to delete
3588    pub fn issue_delete_issue_attachment(
3589        &self,
3590        owner: &str,
3591        repo: &str,
3592        index: i64,
3593        attachment_id: i64,
3594    ) -> Request<'_, endpoints::IssueDeleteIssueAttachment<'_>, ()> {
3595        endpoints::IssueDeleteIssueAttachment {
3596            owner,
3597            repo,
3598            index,
3599            attachment_id,
3600        }
3601        .make_request()
3602        .wrap::<_, _>(self)
3603    }
3604
3605    /// Edit an issue attachment
3606    ///
3607    /// - `owner`: owner of the repo
3608    /// - `repo`: name of the repo
3609    /// - `index`: index of the issue
3610    /// - `attachment_id`: id of the attachment to edit
3611    /// - `body`: See [`EditAttachmentOptions`]
3612    pub fn issue_edit_issue_attachment(
3613        &self,
3614        owner: &str,
3615        repo: &str,
3616        index: i64,
3617        attachment_id: i64,
3618        body: EditAttachmentOptions,
3619    ) -> Request<'_, endpoints::IssueEditIssueAttachment<'_>, Attachment> {
3620        endpoints::IssueEditIssueAttachment {
3621            owner,
3622            repo,
3623            index,
3624            attachment_id,
3625            body: body,
3626        }
3627        .make_request()
3628        .wrap::<_, _>(self)
3629    }
3630
3631    /// List issues that are blocked by this issue
3632    ///
3633    /// - `owner`: owner of the repo
3634    /// - `repo`: name of the repo
3635    /// - `index`: index of the issue
3636    pub fn issue_list_blocks(
3637        &self,
3638        owner: &str,
3639        repo: &str,
3640        index: i64,
3641    ) -> Request<'_, endpoints::IssueListBlocks<'_>, (IssueListHeaders, Vec<Issue>)> {
3642        endpoints::IssueListBlocks { owner, repo, index }
3643            .make_request()
3644            .wrap::<_, _>(self)
3645    }
3646
3647    /// Block the issue given in the body by the issue in path
3648    ///
3649    /// - `owner`: owner of the repo
3650    /// - `repo`: name of the repo
3651    /// - `index`: index of the issue
3652    /// - `body`: See [`IssueMeta`]
3653    pub fn issue_create_issue_blocking(
3654        &self,
3655        owner: &str,
3656        repo: &str,
3657        index: i64,
3658        body: IssueMeta,
3659    ) -> Request<'_, endpoints::IssueCreateIssueBlocking<'_>, Issue> {
3660        endpoints::IssueCreateIssueBlocking {
3661            owner,
3662            repo,
3663            index,
3664            body: body,
3665        }
3666        .make_request()
3667        .wrap::<_, _>(self)
3668    }
3669
3670    /// Unblock the issue given in the body by the issue in path
3671    ///
3672    /// - `owner`: owner of the repo
3673    /// - `repo`: name of the repo
3674    /// - `index`: index of the issue
3675    /// - `body`: See [`IssueMeta`]
3676    pub fn issue_remove_issue_blocking(
3677        &self,
3678        owner: &str,
3679        repo: &str,
3680        index: i64,
3681        body: IssueMeta,
3682    ) -> Request<'_, endpoints::IssueRemoveIssueBlocking<'_>, Issue> {
3683        endpoints::IssueRemoveIssueBlocking {
3684            owner,
3685            repo,
3686            index,
3687            body: body,
3688        }
3689        .make_request()
3690        .wrap::<_, _>(self)
3691    }
3692
3693    /// List all comments on an issue
3694    ///
3695    /// - `owner`: owner of the repo
3696    /// - `repo`: name of the repo
3697    /// - `index`: index of the issue
3698    pub fn issue_get_comments(
3699        &self,
3700        owner: &str,
3701        repo: &str,
3702        index: i64,
3703        query: IssueGetCommentsQuery,
3704    ) -> Request<'_, endpoints::IssueGetComments<'_>, (CommentListHeaders, Vec<Comment>)> {
3705        endpoints::IssueGetComments {
3706            owner,
3707            repo,
3708            index,
3709            query,
3710        }
3711        .make_request()
3712        .wrap::<_, _>(self)
3713    }
3714
3715    /// Add a comment to an issue
3716    ///
3717    /// - `owner`: owner of the repo
3718    /// - `repo`: name of the repo
3719    /// - `index`: index of the issue
3720    /// - `body`: See [`CreateIssueCommentOption`]
3721    pub fn issue_create_comment(
3722        &self,
3723        owner: &str,
3724        repo: &str,
3725        index: i64,
3726        body: CreateIssueCommentOption,
3727    ) -> Request<'_, endpoints::IssueCreateComment<'_>, Comment> {
3728        endpoints::IssueCreateComment {
3729            owner,
3730            repo,
3731            index,
3732            body: body,
3733        }
3734        .make_request()
3735        .wrap::<_, _>(self)
3736    }
3737
3738    /// Delete a comment
3739    ///
3740    /// - `owner`: owner of the repo
3741    /// - `repo`: name of the repo
3742    /// - `index`: this parameter is ignored
3743    /// - `id`: id of comment to delete
3744    pub fn issue_delete_comment_deprecated(
3745        &self,
3746        owner: &str,
3747        repo: &str,
3748        index: u32,
3749        id: i64,
3750    ) -> Request<'_, endpoints::IssueDeleteCommentDeprecated<'_>, ()> {
3751        endpoints::IssueDeleteCommentDeprecated {
3752            owner,
3753            repo,
3754            index,
3755            id,
3756        }
3757        .make_request()
3758        .wrap::<_, _>(self)
3759    }
3760
3761    /// Edit a comment
3762    ///
3763    /// - `owner`: owner of the repo
3764    /// - `repo`: name of the repo
3765    /// - `index`: this parameter is ignored
3766    /// - `id`: id of the comment to edit
3767    /// - `body`: See [`EditIssueCommentOption`]
3768    pub fn issue_edit_comment_deprecated(
3769        &self,
3770        owner: &str,
3771        repo: &str,
3772        index: u32,
3773        id: i64,
3774        body: EditIssueCommentOption,
3775    ) -> Request<'_, endpoints::IssueEditCommentDeprecated<'_>, Option<Comment>> {
3776        endpoints::IssueEditCommentDeprecated {
3777            owner,
3778            repo,
3779            index,
3780            id,
3781            body: body,
3782        }
3783        .make_request()
3784        .wrap::<_, _>(self)
3785    }
3786
3787    /// Set an issue deadline. If set to null, the deadline is deleted. If using deadline only the date will be taken into account, and time of day ignored.
3788    ///
3789    /// - `owner`: owner of the repo
3790    /// - `repo`: name of the repo
3791    /// - `index`: index of the issue to create or update a deadline on
3792    /// - `body`: See [`EditDeadlineOption`]
3793    pub fn issue_edit_issue_deadline(
3794        &self,
3795        owner: &str,
3796        repo: &str,
3797        index: i64,
3798        body: EditDeadlineOption,
3799    ) -> Request<'_, endpoints::IssueEditIssueDeadline<'_>, IssueDeadline> {
3800        endpoints::IssueEditIssueDeadline {
3801            owner,
3802            repo,
3803            index,
3804            body: body,
3805        }
3806        .make_request()
3807        .wrap::<_, _>(self)
3808    }
3809
3810    /// List an issue's dependencies, i.e all issues that block this issue.
3811    ///
3812    /// - `owner`: owner of the repo
3813    /// - `repo`: name of the repo
3814    /// - `index`: index of the issue
3815    pub fn issue_list_issue_dependencies(
3816        &self,
3817        owner: &str,
3818        repo: &str,
3819        index: i64,
3820    ) -> Request<'_, endpoints::IssueListIssueDependencies<'_>, (IssueListHeaders, Vec<Issue>)>
3821    {
3822        endpoints::IssueListIssueDependencies { owner, repo, index }
3823            .make_request()
3824            .wrap::<_, _>(self)
3825    }
3826
3827    /// Make the issue in the url depend on the issue in the form.
3828    ///
3829    /// - `owner`: owner of the repo
3830    /// - `repo`: name of the repo
3831    /// - `index`: index of the issue
3832    /// - `body`: See [`IssueMeta`]
3833    pub fn issue_create_issue_dependencies(
3834        &self,
3835        owner: &str,
3836        repo: &str,
3837        index: i64,
3838        body: IssueMeta,
3839    ) -> Request<'_, endpoints::IssueCreateIssueDependencies<'_>, Issue> {
3840        endpoints::IssueCreateIssueDependencies {
3841            owner,
3842            repo,
3843            index,
3844            body: body,
3845        }
3846        .make_request()
3847        .wrap::<_, _>(self)
3848    }
3849
3850    /// Remove an issue dependency
3851    ///
3852    /// - `owner`: owner of the repo
3853    /// - `repo`: name of the repo
3854    /// - `index`: index of the issue
3855    /// - `body`: See [`IssueMeta`]
3856    pub fn issue_remove_issue_dependencies(
3857        &self,
3858        owner: &str,
3859        repo: &str,
3860        index: i64,
3861        body: IssueMeta,
3862    ) -> Request<'_, endpoints::IssueRemoveIssueDependencies<'_>, Issue> {
3863        endpoints::IssueRemoveIssueDependencies {
3864            owner,
3865            repo,
3866            index,
3867            body: body,
3868        }
3869        .make_request()
3870        .wrap::<_, _>(self)
3871    }
3872
3873    /// Get an issue's labels
3874    ///
3875    /// - `owner`: owner of the repo
3876    /// - `repo`: name of the repo
3877    /// - `index`: index of the issue
3878    pub fn issue_get_labels(
3879        &self,
3880        owner: &str,
3881        repo: &str,
3882        index: i64,
3883    ) -> Request<'_, endpoints::IssueGetLabels<'_>, (LabelListHeaders, Vec<Label>)> {
3884        endpoints::IssueGetLabels { owner, repo, index }
3885            .make_request()
3886            .wrap::<_, _>(self)
3887    }
3888
3889    /// Replace an issue's labels
3890    ///
3891    /// - `owner`: owner of the repo
3892    /// - `repo`: name of the repo
3893    /// - `index`: index of the issue
3894    /// - `body`: See [`IssueLabelsOption`]
3895    pub fn issue_replace_labels(
3896        &self,
3897        owner: &str,
3898        repo: &str,
3899        index: i64,
3900        body: IssueLabelsOption,
3901    ) -> Request<'_, endpoints::IssueReplaceLabels<'_>, (LabelListHeaders, Vec<Label>)> {
3902        endpoints::IssueReplaceLabels {
3903            owner,
3904            repo,
3905            index,
3906            body: body,
3907        }
3908        .make_request()
3909        .wrap::<_, _>(self)
3910    }
3911
3912    /// Add a label to an issue
3913    ///
3914    /// - `owner`: owner of the repo
3915    /// - `repo`: name of the repo
3916    /// - `index`: index of the issue
3917    /// - `body`: See [`IssueLabelsOption`]
3918    pub fn issue_add_label(
3919        &self,
3920        owner: &str,
3921        repo: &str,
3922        index: i64,
3923        body: IssueLabelsOption,
3924    ) -> Request<'_, endpoints::IssueAddLabel<'_>, (LabelListHeaders, Vec<Label>)> {
3925        endpoints::IssueAddLabel {
3926            owner,
3927            repo,
3928            index,
3929            body: body,
3930        }
3931        .make_request()
3932        .wrap::<_, _>(self)
3933    }
3934
3935    /// Remove all labels from an issue
3936    ///
3937    /// - `owner`: owner of the repo
3938    /// - `repo`: name of the repo
3939    /// - `index`: index of the issue
3940    /// - `body`: See [`DeleteLabelsOption`]
3941    pub fn issue_clear_labels(
3942        &self,
3943        owner: &str,
3944        repo: &str,
3945        index: i64,
3946        body: DeleteLabelsOption,
3947    ) -> Request<'_, endpoints::IssueClearLabels<'_>, ()> {
3948        endpoints::IssueClearLabels {
3949            owner,
3950            repo,
3951            index,
3952            body: body,
3953        }
3954        .make_request()
3955        .wrap::<_, _>(self)
3956    }
3957
3958    /// Remove a label from an issue
3959    ///
3960    /// - `owner`: owner of the repo
3961    /// - `repo`: name of the repo
3962    /// - `index`: index of the issue
3963    /// - `identifier`: name or id of the label to remove
3964    /// - `body`: See [`DeleteLabelsOption`]
3965    pub fn issue_remove_label(
3966        &self,
3967        owner: &str,
3968        repo: &str,
3969        index: i64,
3970        identifier: &str,
3971        body: DeleteLabelsOption,
3972    ) -> Request<'_, endpoints::IssueRemoveLabel<'_>, ()> {
3973        endpoints::IssueRemoveLabel {
3974            owner,
3975            repo,
3976            index,
3977            identifier,
3978            body: body,
3979        }
3980        .make_request()
3981        .wrap::<_, _>(self)
3982    }
3983
3984    /// Pin an Issue
3985    ///
3986    /// - `owner`: owner of the repo
3987    /// - `repo`: name of the repo
3988    /// - `index`: index of issue to pin
3989    pub fn pin_issue(
3990        &self,
3991        owner: &str,
3992        repo: &str,
3993        index: i64,
3994    ) -> Request<'_, endpoints::PinIssue<'_>, ()> {
3995        endpoints::PinIssue { owner, repo, index }
3996            .make_request()
3997            .wrap::<_, _>(self)
3998    }
3999
4000    /// Unpin an Issue
4001    ///
4002    /// - `owner`: owner of the repo
4003    /// - `repo`: name of the repo
4004    /// - `index`: index of issue to unpin
4005    pub fn unpin_issue(
4006        &self,
4007        owner: &str,
4008        repo: &str,
4009        index: i64,
4010    ) -> Request<'_, endpoints::UnpinIssue<'_>, ()> {
4011        endpoints::UnpinIssue { owner, repo, index }
4012            .make_request()
4013            .wrap::<_, _>(self)
4014    }
4015
4016    /// Moves the Pin to the given Position
4017    ///
4018    /// - `owner`: owner of the repo
4019    /// - `repo`: name of the repo
4020    /// - `index`: index of issue
4021    /// - `position`: the new position
4022    pub fn move_issue_pin(
4023        &self,
4024        owner: &str,
4025        repo: &str,
4026        index: i64,
4027        position: i64,
4028    ) -> Request<'_, endpoints::MoveIssuePin<'_>, ()> {
4029        endpoints::MoveIssuePin {
4030            owner,
4031            repo,
4032            index,
4033            position,
4034        }
4035        .make_request()
4036        .wrap::<_, _>(self)
4037    }
4038
4039    /// Get a list reactions of an issue
4040    ///
4041    /// - `owner`: owner of the repo
4042    /// - `repo`: name of the repo
4043    /// - `index`: index of the issue
4044    pub fn issue_get_issue_reactions(
4045        &self,
4046        owner: &str,
4047        repo: &str,
4048        index: i64,
4049    ) -> Request<'_, endpoints::IssueGetIssueReactions<'_>, (ReactionListHeaders, Vec<Reaction>)>
4050    {
4051        endpoints::IssueGetIssueReactions { owner, repo, index }
4052            .make_request()
4053            .wrap::<_, _>(self)
4054    }
4055
4056    /// Add a reaction to an issue
4057    ///
4058    /// - `owner`: owner of the repo
4059    /// - `repo`: name of the repo
4060    /// - `index`: index of the issue
4061    /// - `content`: See [`EditReactionOption`]
4062    pub fn issue_post_issue_reaction(
4063        &self,
4064        owner: &str,
4065        repo: &str,
4066        index: i64,
4067        content: EditReactionOption,
4068    ) -> Request<'_, endpoints::IssuePostIssueReaction<'_>, Reaction> {
4069        endpoints::IssuePostIssueReaction {
4070            owner,
4071            repo,
4072            index,
4073            body: content,
4074        }
4075        .make_request()
4076        .wrap::<_, _>(self)
4077    }
4078
4079    /// Remove a reaction from an issue
4080    ///
4081    /// - `owner`: owner of the repo
4082    /// - `repo`: name of the repo
4083    /// - `index`: index of the issue
4084    /// - `content`: See [`EditReactionOption`]
4085    pub fn issue_delete_issue_reaction(
4086        &self,
4087        owner: &str,
4088        repo: &str,
4089        index: i64,
4090        content: EditReactionOption,
4091    ) -> Request<'_, endpoints::IssueDeleteIssueReaction<'_>, ()> {
4092        endpoints::IssueDeleteIssueReaction {
4093            owner,
4094            repo,
4095            index,
4096            body: content,
4097        }
4098        .make_request()
4099        .wrap::<_, _>(self)
4100    }
4101
4102    /// Delete an issue's existing stopwatch.
4103    ///
4104    /// - `owner`: owner of the repo
4105    /// - `repo`: name of the repo
4106    /// - `index`: index of the issue to stop the stopwatch on
4107    pub fn issue_delete_stop_watch(
4108        &self,
4109        owner: &str,
4110        repo: &str,
4111        index: i64,
4112    ) -> Request<'_, endpoints::IssueDeleteStopWatch<'_>, ()> {
4113        endpoints::IssueDeleteStopWatch { owner, repo, index }
4114            .make_request()
4115            .wrap::<_, _>(self)
4116    }
4117
4118    /// Start stopwatch on an issue.
4119    ///
4120    /// - `owner`: owner of the repo
4121    /// - `repo`: name of the repo
4122    /// - `index`: index of the issue to create the stopwatch on
4123    pub fn issue_start_stop_watch(
4124        &self,
4125        owner: &str,
4126        repo: &str,
4127        index: i64,
4128    ) -> Request<'_, endpoints::IssueStartStopWatch<'_>, ()> {
4129        endpoints::IssueStartStopWatch { owner, repo, index }
4130            .make_request()
4131            .wrap::<_, _>(self)
4132    }
4133
4134    /// Stop an issue's existing stopwatch.
4135    ///
4136    /// - `owner`: owner of the repo
4137    /// - `repo`: name of the repo
4138    /// - `index`: index of the issue to stop the stopwatch on
4139    pub fn issue_stop_stop_watch(
4140        &self,
4141        owner: &str,
4142        repo: &str,
4143        index: i64,
4144    ) -> Request<'_, endpoints::IssueStopStopWatch<'_>, ()> {
4145        endpoints::IssueStopStopWatch { owner, repo, index }
4146            .make_request()
4147            .wrap::<_, _>(self)
4148    }
4149
4150    /// Get users who subscribed on an issue.
4151    ///
4152    /// - `owner`: owner of the repo
4153    /// - `repo`: name of the repo
4154    /// - `index`: index of the issue
4155    pub fn issue_subscriptions(
4156        &self,
4157        owner: &str,
4158        repo: &str,
4159        index: i64,
4160    ) -> Request<'_, endpoints::IssueSubscriptions<'_>, (UserListHeaders, Vec<User>)> {
4161        endpoints::IssueSubscriptions { owner, repo, index }
4162            .make_request()
4163            .wrap::<_, _>(self)
4164    }
4165
4166    /// Check if user is subscribed to an issue
4167    ///
4168    /// - `owner`: owner of the repo
4169    /// - `repo`: name of the repo
4170    /// - `index`: index of the issue
4171    pub fn issue_check_subscription(
4172        &self,
4173        owner: &str,
4174        repo: &str,
4175        index: i64,
4176    ) -> Request<'_, endpoints::IssueCheckSubscription<'_>, WatchInfo> {
4177        endpoints::IssueCheckSubscription { owner, repo, index }
4178            .make_request()
4179            .wrap::<_, _>(self)
4180    }
4181
4182    /// Subscribe user to issue
4183    ///
4184    /// - `owner`: owner of the repo
4185    /// - `repo`: name of the repo
4186    /// - `index`: index of the issue
4187    /// - `user`: user to subscribe
4188    pub fn issue_add_subscription(
4189        &self,
4190        owner: &str,
4191        repo: &str,
4192        index: i64,
4193        user: &str,
4194    ) -> Request<'_, endpoints::IssueAddSubscription<'_>, ()> {
4195        endpoints::IssueAddSubscription {
4196            owner,
4197            repo,
4198            index,
4199            user,
4200        }
4201        .make_request()
4202        .wrap::<_, _>(self)
4203    }
4204
4205    /// Unsubscribe user from issue
4206    ///
4207    /// - `owner`: owner of the repo
4208    /// - `repo`: name of the repo
4209    /// - `index`: index of the issue
4210    /// - `user`: user witch unsubscribe
4211    pub fn issue_delete_subscription(
4212        &self,
4213        owner: &str,
4214        repo: &str,
4215        index: i64,
4216        user: &str,
4217    ) -> Request<'_, endpoints::IssueDeleteSubscription<'_>, ()> {
4218        endpoints::IssueDeleteSubscription {
4219            owner,
4220            repo,
4221            index,
4222            user,
4223        }
4224        .make_request()
4225        .wrap::<_, _>(self)
4226    }
4227
4228    /// List all comments and events on an issue
4229    ///
4230    /// - `owner`: owner of the repo
4231    /// - `repo`: name of the repo
4232    /// - `index`: index of the issue
4233    pub fn issue_get_comments_and_timeline(
4234        &self,
4235        owner: &str,
4236        repo: &str,
4237        index: i64,
4238        query: IssueGetCommentsAndTimelineQuery,
4239    ) -> Request<
4240        '_,
4241        endpoints::IssueGetCommentsAndTimeline<'_>,
4242        (TimelineListHeaders, Vec<TimelineComment>),
4243    > {
4244        endpoints::IssueGetCommentsAndTimeline {
4245            owner,
4246            repo,
4247            index,
4248            query,
4249        }
4250        .make_request()
4251        .wrap::<_, _>(self)
4252    }
4253
4254    /// List an issue's tracked times
4255    ///
4256    /// - `owner`: owner of the repo
4257    /// - `repo`: name of the repo
4258    /// - `index`: index of the issue
4259    pub fn issue_tracked_times(
4260        &self,
4261        owner: &str,
4262        repo: &str,
4263        index: i64,
4264        query: IssueTrackedTimesQuery,
4265    ) -> Request<'_, endpoints::IssueTrackedTimes<'_>, (TrackedTimeListHeaders, Vec<TrackedTime>)>
4266    {
4267        endpoints::IssueTrackedTimes {
4268            owner,
4269            repo,
4270            index,
4271            query,
4272        }
4273        .make_request()
4274        .wrap::<_, _>(self)
4275    }
4276
4277    /// Add tracked time to a issue
4278    ///
4279    /// - `owner`: owner of the repo
4280    /// - `repo`: name of the repo
4281    /// - `index`: index of the issue
4282    /// - `body`: See [`AddTimeOption`]
4283    pub fn issue_add_time(
4284        &self,
4285        owner: &str,
4286        repo: &str,
4287        index: i64,
4288        body: AddTimeOption,
4289    ) -> Request<'_, endpoints::IssueAddTime<'_>, TrackedTime> {
4290        endpoints::IssueAddTime {
4291            owner,
4292            repo,
4293            index,
4294            body: body,
4295        }
4296        .make_request()
4297        .wrap::<_, _>(self)
4298    }
4299
4300    /// Reset a tracked time of an issue
4301    ///
4302    /// - `owner`: owner of the repo
4303    /// - `repo`: name of the repo
4304    /// - `index`: index of the issue to add tracked time to
4305    pub fn issue_reset_time(
4306        &self,
4307        owner: &str,
4308        repo: &str,
4309        index: i64,
4310    ) -> Request<'_, endpoints::IssueResetTime<'_>, ()> {
4311        endpoints::IssueResetTime { owner, repo, index }
4312            .make_request()
4313            .wrap::<_, _>(self)
4314    }
4315
4316    /// Delete specific tracked time
4317    ///
4318    /// - `owner`: owner of the repo
4319    /// - `repo`: name of the repo
4320    /// - `index`: index of the issue
4321    /// - `id`: id of time to delete
4322    pub fn issue_delete_time(
4323        &self,
4324        owner: &str,
4325        repo: &str,
4326        index: i64,
4327        id: i64,
4328    ) -> Request<'_, endpoints::IssueDeleteTime<'_>, ()> {
4329        endpoints::IssueDeleteTime {
4330            owner,
4331            repo,
4332            index,
4333            id,
4334        }
4335        .make_request()
4336        .wrap::<_, _>(self)
4337    }
4338
4339    /// List a repository's keys
4340    ///
4341    /// - `owner`: owner of the repo
4342    /// - `repo`: name of the repo
4343    pub fn repo_list_keys(
4344        &self,
4345        owner: &str,
4346        repo: &str,
4347        query: RepoListKeysQuery,
4348    ) -> Request<'_, endpoints::RepoListKeys<'_>, (DeployKeyListHeaders, Vec<DeployKey>)> {
4349        endpoints::RepoListKeys { owner, repo, query }
4350            .make_request()
4351            .wrap::<_, _>(self)
4352    }
4353
4354    /// Add a key to a repository
4355    ///
4356    /// - `owner`: owner of the repo
4357    /// - `repo`: name of the repo
4358    /// - `body`: See [`CreateKeyOption`]
4359    pub fn repo_create_key(
4360        &self,
4361        owner: &str,
4362        repo: &str,
4363        body: CreateKeyOption,
4364    ) -> Request<'_, endpoints::RepoCreateKey<'_>, DeployKey> {
4365        endpoints::RepoCreateKey {
4366            owner,
4367            repo,
4368            body: body,
4369        }
4370        .make_request()
4371        .wrap::<_, _>(self)
4372    }
4373
4374    /// Get a repository's key by id
4375    ///
4376    /// - `owner`: owner of the repo
4377    /// - `repo`: name of the repo
4378    /// - `id`: id of the key to get
4379    pub fn repo_get_key(
4380        &self,
4381        owner: &str,
4382        repo: &str,
4383        id: i64,
4384    ) -> Request<'_, endpoints::RepoGetKey<'_>, DeployKey> {
4385        endpoints::RepoGetKey { owner, repo, id }
4386            .make_request()
4387            .wrap::<_, _>(self)
4388    }
4389
4390    /// Delete a key from a repository
4391    ///
4392    /// - `owner`: owner of the repo
4393    /// - `repo`: name of the repo
4394    /// - `id`: id of the key to delete
4395    pub fn repo_delete_key(
4396        &self,
4397        owner: &str,
4398        repo: &str,
4399        id: i64,
4400    ) -> Request<'_, endpoints::RepoDeleteKey<'_>, ()> {
4401        endpoints::RepoDeleteKey { owner, repo, id }
4402            .make_request()
4403            .wrap::<_, _>(self)
4404    }
4405
4406    /// Get all of a repository's labels
4407    ///
4408    /// - `owner`: owner of the repo
4409    /// - `repo`: name of the repo
4410    pub fn issue_list_labels(
4411        &self,
4412        owner: &str,
4413        repo: &str,
4414        query: IssueListLabelsQuery,
4415    ) -> Request<'_, endpoints::IssueListLabels<'_>, (LabelListHeaders, Vec<Label>)> {
4416        endpoints::IssueListLabels { owner, repo, query }
4417            .make_request()
4418            .wrap::<_, _>(self)
4419    }
4420
4421    /// Create a label
4422    ///
4423    /// - `owner`: owner of the repo
4424    /// - `repo`: name of the repo
4425    /// - `body`: See [`CreateLabelOption`]
4426    pub fn issue_create_label(
4427        &self,
4428        owner: &str,
4429        repo: &str,
4430        body: CreateLabelOption,
4431    ) -> Request<'_, endpoints::IssueCreateLabel<'_>, Label> {
4432        endpoints::IssueCreateLabel {
4433            owner,
4434            repo,
4435            body: body,
4436        }
4437        .make_request()
4438        .wrap::<_, _>(self)
4439    }
4440
4441    /// Get a single label
4442    ///
4443    /// - `owner`: owner of the repo
4444    /// - `repo`: name of the repo
4445    /// - `id`: id of the label to get
4446    pub fn issue_get_label(
4447        &self,
4448        owner: &str,
4449        repo: &str,
4450        id: i64,
4451    ) -> Request<'_, endpoints::IssueGetLabel<'_>, Label> {
4452        endpoints::IssueGetLabel { owner, repo, id }
4453            .make_request()
4454            .wrap::<_, _>(self)
4455    }
4456
4457    /// Delete a label
4458    ///
4459    /// - `owner`: owner of the repo
4460    /// - `repo`: name of the repo
4461    /// - `id`: id of the label to delete
4462    pub fn issue_delete_label(
4463        &self,
4464        owner: &str,
4465        repo: &str,
4466        id: i64,
4467    ) -> Request<'_, endpoints::IssueDeleteLabel<'_>, ()> {
4468        endpoints::IssueDeleteLabel { owner, repo, id }
4469            .make_request()
4470            .wrap::<_, _>(self)
4471    }
4472
4473    /// Update a label
4474    ///
4475    /// - `owner`: owner of the repo
4476    /// - `repo`: name of the repo
4477    /// - `id`: id of the label to edit
4478    /// - `body`: See [`EditLabelOption`]
4479    pub fn issue_edit_label(
4480        &self,
4481        owner: &str,
4482        repo: &str,
4483        id: i64,
4484        body: EditLabelOption,
4485    ) -> Request<'_, endpoints::IssueEditLabel<'_>, Label> {
4486        endpoints::IssueEditLabel {
4487            owner,
4488            repo,
4489            id,
4490            body: body,
4491        }
4492        .make_request()
4493        .wrap::<_, _>(self)
4494    }
4495
4496    /// Get languages and number of bytes of code written
4497    ///
4498    /// - `owner`: owner of the repo
4499    /// - `repo`: name of the repo
4500    pub fn repo_get_languages(
4501        &self,
4502        owner: &str,
4503        repo: &str,
4504    ) -> Request<'_, endpoints::RepoGetLanguages<'_>, BTreeMap<String, i64>> {
4505        endpoints::RepoGetLanguages { owner, repo }
4506            .make_request()
4507            .wrap::<_, _>(self)
4508    }
4509
4510    /// Get a file or it's LFS object from a repository
4511    ///
4512    /// - `owner`: owner of the repo
4513    /// - `repo`: name of the repo
4514    /// - `filepath`: filepath of the file to get
4515    pub fn repo_get_raw_file_or_lfs(
4516        &self,
4517        owner: &str,
4518        repo: &str,
4519        filepath: &str,
4520        query: RepoGetRawFileOrLfsQuery,
4521    ) -> Request<'_, endpoints::RepoGetRawFileOrLfs<'_>, Bytes> {
4522        endpoints::RepoGetRawFileOrLfs {
4523            owner,
4524            repo,
4525            filepath,
4526            query,
4527        }
4528        .make_request()
4529        .wrap::<_, _>(self)
4530    }
4531
4532    /// Get all of a repository's opened milestones
4533    ///
4534    /// - `owner`: owner of the repo
4535    /// - `repo`: name of the repo
4536    pub fn issue_get_milestones_list(
4537        &self,
4538        owner: &str,
4539        repo: &str,
4540        query: IssueGetMilestonesListQuery,
4541    ) -> Request<'_, endpoints::IssueGetMilestonesList<'_>, (MilestoneListHeaders, Vec<Milestone>)>
4542    {
4543        endpoints::IssueGetMilestonesList { owner, repo, query }
4544            .make_request()
4545            .wrap::<_, _>(self)
4546    }
4547
4548    /// Create a milestone
4549    ///
4550    /// - `owner`: owner of the repo
4551    /// - `repo`: name of the repo
4552    /// - `body`: See [`CreateMilestoneOption`]
4553    pub fn issue_create_milestone(
4554        &self,
4555        owner: &str,
4556        repo: &str,
4557        body: CreateMilestoneOption,
4558    ) -> Request<'_, endpoints::IssueCreateMilestone<'_>, Milestone> {
4559        endpoints::IssueCreateMilestone {
4560            owner,
4561            repo,
4562            body: body,
4563        }
4564        .make_request()
4565        .wrap::<_, _>(self)
4566    }
4567
4568    /// Get a milestone
4569    ///
4570    /// - `owner`: owner of the repo
4571    /// - `repo`: name of the repo
4572    /// - `id`: the milestone to get, identified by ID and if not available by name
4573    pub fn issue_get_milestone(
4574        &self,
4575        owner: &str,
4576        repo: &str,
4577        id: i64,
4578    ) -> Request<'_, endpoints::IssueGetMilestone<'_>, Milestone> {
4579        endpoints::IssueGetMilestone { owner, repo, id }
4580            .make_request()
4581            .wrap::<_, _>(self)
4582    }
4583
4584    /// Delete a milestone
4585    ///
4586    /// - `owner`: owner of the repo
4587    /// - `repo`: name of the repo
4588    /// - `id`: the milestone to delete, identified by ID and if not available by name
4589    pub fn issue_delete_milestone(
4590        &self,
4591        owner: &str,
4592        repo: &str,
4593        id: i64,
4594    ) -> Request<'_, endpoints::IssueDeleteMilestone<'_>, ()> {
4595        endpoints::IssueDeleteMilestone { owner, repo, id }
4596            .make_request()
4597            .wrap::<_, _>(self)
4598    }
4599
4600    /// Update a milestone
4601    ///
4602    /// - `owner`: owner of the repo
4603    /// - `repo`: name of the repo
4604    /// - `id`: the milestone to edit, identified by ID and if not available by name
4605    /// - `body`: See [`EditMilestoneOption`]
4606    pub fn issue_edit_milestone(
4607        &self,
4608        owner: &str,
4609        repo: &str,
4610        id: i64,
4611        body: EditMilestoneOption,
4612    ) -> Request<'_, endpoints::IssueEditMilestone<'_>, Milestone> {
4613        endpoints::IssueEditMilestone {
4614            owner,
4615            repo,
4616            id,
4617            body: body,
4618        }
4619        .make_request()
4620        .wrap::<_, _>(self)
4621    }
4622
4623    /// Sync a mirrored repository
4624    ///
4625    /// - `owner`: owner of the repo to sync
4626    /// - `repo`: name of the repo to sync
4627    pub fn repo_mirror_sync(
4628        &self,
4629        owner: &str,
4630        repo: &str,
4631    ) -> Request<'_, endpoints::RepoMirrorSync<'_>, ()> {
4632        endpoints::RepoMirrorSync { owner, repo }
4633            .make_request()
4634            .wrap::<_, _>(self)
4635    }
4636
4637    /// Returns if new Issue Pins are allowed
4638    ///
4639    /// - `owner`: owner of the repo
4640    /// - `repo`: name of the repo
4641    pub fn repo_new_pin_allowed(
4642        &self,
4643        owner: &str,
4644        repo: &str,
4645    ) -> Request<'_, endpoints::RepoNewPinAllowed<'_>, NewIssuePinsAllowed> {
4646        endpoints::RepoNewPinAllowed { owner, repo }
4647            .make_request()
4648            .wrap::<_, _>(self)
4649    }
4650
4651    /// List users's notification threads on a specific repo
4652    ///
4653    /// - `owner`: owner of the repo
4654    /// - `repo`: name of the repo
4655    pub fn notify_get_repo_list(
4656        &self,
4657        owner: &str,
4658        repo: &str,
4659        query: NotifyGetRepoListQuery,
4660    ) -> Request<
4661        '_,
4662        endpoints::NotifyGetRepoList<'_>,
4663        (NotificationThreadListHeaders, Vec<NotificationThread>),
4664    > {
4665        endpoints::NotifyGetRepoList { owner, repo, query }
4666            .make_request()
4667            .wrap::<_, _>(self)
4668    }
4669
4670    /// Mark notification threads as read, pinned or unread on a specific repo
4671    ///
4672    /// - `owner`: owner of the repo
4673    /// - `repo`: name of the repo
4674    pub fn notify_read_repo_list(
4675        &self,
4676        owner: &str,
4677        repo: &str,
4678        query: NotifyReadRepoListQuery,
4679    ) -> Request<
4680        '_,
4681        endpoints::NotifyReadRepoList<'_>,
4682        (NotificationThreadListHeaders, Vec<NotificationThread>),
4683    > {
4684        endpoints::NotifyReadRepoList { owner, repo, query }
4685            .make_request()
4686            .wrap::<_, _>(self)
4687    }
4688
4689    /// List a repo's pull requests. If a pull request is selected but fails to be retrieved for any reason, it will be a null value in the list of results.
4690    ///
4691    /// - `owner`: Owner of the repo
4692    /// - `repo`: Name of the repo
4693    pub fn repo_list_pull_requests(
4694        &self,
4695        owner: &str,
4696        repo: &str,
4697        query: RepoListPullRequestsQuery,
4698    ) -> Request<'_, endpoints::RepoListPullRequests<'_>, (PullRequestListHeaders, Vec<PullRequest>)>
4699    {
4700        endpoints::RepoListPullRequests { owner, repo, query }
4701            .make_request()
4702            .wrap::<_, _>(self)
4703    }
4704
4705    /// Create a pull request
4706    ///
4707    /// - `owner`: owner of the repo
4708    /// - `repo`: name of the repo
4709    /// - `body`: See [`CreatePullRequestOption`]
4710    pub fn repo_create_pull_request(
4711        &self,
4712        owner: &str,
4713        repo: &str,
4714        body: CreatePullRequestOption,
4715    ) -> Request<'_, endpoints::RepoCreatePullRequest<'_>, PullRequest> {
4716        endpoints::RepoCreatePullRequest {
4717            owner,
4718            repo,
4719            body: body,
4720        }
4721        .make_request()
4722        .wrap::<_, _>(self)
4723    }
4724
4725    /// List a repo's pinned pull requests
4726    ///
4727    /// - `owner`: owner of the repo
4728    /// - `repo`: name of the repo
4729    pub fn repo_list_pinned_pull_requests(
4730        &self,
4731        owner: &str,
4732        repo: &str,
4733    ) -> Request<
4734        '_,
4735        endpoints::RepoListPinnedPullRequests<'_>,
4736        (PullRequestListHeaders, Vec<PullRequest>),
4737    > {
4738        endpoints::RepoListPinnedPullRequests { owner, repo }
4739            .make_request()
4740            .wrap::<_, _>(self)
4741    }
4742
4743    /// Get a pull request by base and head
4744    ///
4745    /// - `owner`: owner of the repo
4746    /// - `repo`: name of the repo
4747    /// - `base`: base of the pull request to get
4748    /// - `head`: head of the pull request to get
4749    pub fn repo_get_pull_request_by_base_head(
4750        &self,
4751        owner: &str,
4752        repo: &str,
4753        base: &str,
4754        head: &str,
4755    ) -> Request<'_, endpoints::RepoGetPullRequestByBaseHead<'_>, PullRequest> {
4756        endpoints::RepoGetPullRequestByBaseHead {
4757            owner,
4758            repo,
4759            base,
4760            head,
4761        }
4762        .make_request()
4763        .wrap::<_, _>(self)
4764    }
4765
4766    /// Get a pull request
4767    ///
4768    /// - `owner`: owner of the repo
4769    /// - `repo`: name of the repo
4770    /// - `index`: index of the pull request to get
4771    pub fn repo_get_pull_request(
4772        &self,
4773        owner: &str,
4774        repo: &str,
4775        index: i64,
4776    ) -> Request<'_, endpoints::RepoGetPullRequest<'_>, PullRequest> {
4777        endpoints::RepoGetPullRequest { owner, repo, index }
4778            .make_request()
4779            .wrap::<_, _>(self)
4780    }
4781
4782    /// Update a pull request. If using deadline only the date will be taken into account, and time of day ignored.
4783    ///
4784    /// - `owner`: owner of the repo
4785    /// - `repo`: name of the repo
4786    /// - `index`: index of the pull request to edit
4787    /// - `body`: See [`EditPullRequestOption`]
4788    pub fn repo_edit_pull_request(
4789        &self,
4790        owner: &str,
4791        repo: &str,
4792        index: i64,
4793        body: EditPullRequestOption,
4794    ) -> Request<'_, endpoints::RepoEditPullRequest<'_>, PullRequest> {
4795        endpoints::RepoEditPullRequest {
4796            owner,
4797            repo,
4798            index,
4799            body: body,
4800        }
4801        .make_request()
4802        .wrap::<_, _>(self)
4803    }
4804
4805    /// Get a pull request diff or patch
4806    ///
4807    /// - `owner`: owner of the repo
4808    /// - `repo`: name of the repo
4809    /// - `index`: index of the pull request to get
4810    /// - `diffType`: whether the output is diff or patch
4811    pub fn repo_download_pull_diff_or_patch(
4812        &self,
4813        owner: &str,
4814        repo: &str,
4815        index: i64,
4816        diff_type: &str,
4817        query: RepoDownloadPullDiffOrPatchQuery,
4818    ) -> Request<'_, endpoints::RepoDownloadPullDiffOrPatch<'_>, String> {
4819        endpoints::RepoDownloadPullDiffOrPatch {
4820            owner,
4821            repo,
4822            index,
4823            diff_type,
4824            query,
4825        }
4826        .make_request()
4827        .wrap::<_, _>(self)
4828    }
4829
4830    /// Get commits for a pull request
4831    ///
4832    /// - `owner`: owner of the repo
4833    /// - `repo`: name of the repo
4834    /// - `index`: index of the pull request to get
4835    pub fn repo_get_pull_request_commits(
4836        &self,
4837        owner: &str,
4838        repo: &str,
4839        index: i64,
4840        query: RepoGetPullRequestCommitsQuery,
4841    ) -> Request<'_, endpoints::RepoGetPullRequestCommits<'_>, (CommitListHeaders, Vec<Commit>)>
4842    {
4843        endpoints::RepoGetPullRequestCommits {
4844            owner,
4845            repo,
4846            index,
4847            query,
4848        }
4849        .make_request()
4850        .wrap::<_, _>(self)
4851    }
4852
4853    /// Get changed files for a pull request
4854    ///
4855    /// - `owner`: owner of the repo
4856    /// - `repo`: name of the repo
4857    /// - `index`: index of the pull request to get
4858    pub fn repo_get_pull_request_files(
4859        &self,
4860        owner: &str,
4861        repo: &str,
4862        index: i64,
4863        query: RepoGetPullRequestFilesQuery,
4864    ) -> Request<
4865        '_,
4866        endpoints::RepoGetPullRequestFiles<'_>,
4867        (ChangedFileListHeaders, Vec<ChangedFile>),
4868    > {
4869        endpoints::RepoGetPullRequestFiles {
4870            owner,
4871            repo,
4872            index,
4873            query,
4874        }
4875        .make_request()
4876        .wrap::<_, _>(self)
4877    }
4878
4879    /// Check if a pull request has been merged
4880    ///
4881    /// - `owner`: owner of the repo
4882    /// - `repo`: name of the repo
4883    /// - `index`: index of the pull request
4884    pub fn repo_pull_request_is_merged(
4885        &self,
4886        owner: &str,
4887        repo: &str,
4888        index: i64,
4889    ) -> Request<'_, endpoints::RepoPullRequestIsMerged<'_>, ()> {
4890        endpoints::RepoPullRequestIsMerged { owner, repo, index }
4891            .make_request()
4892            .wrap::<_, _>(self)
4893    }
4894
4895    /// Merge a pull request
4896    ///
4897    /// - `owner`: owner of the repo
4898    /// - `repo`: name of the repo
4899    /// - `index`: index of the pull request to merge
4900    /// - `body`: See [`MergePullRequestOption`]
4901    pub fn repo_merge_pull_request(
4902        &self,
4903        owner: &str,
4904        repo: &str,
4905        index: i64,
4906        body: MergePullRequestOption,
4907    ) -> Request<'_, endpoints::RepoMergePullRequest<'_>, ()> {
4908        endpoints::RepoMergePullRequest {
4909            owner,
4910            repo,
4911            index,
4912            body: body,
4913        }
4914        .make_request()
4915        .wrap::<_, _>(self)
4916    }
4917
4918    /// Cancel the scheduled auto merge for the given pull request
4919    ///
4920    /// - `owner`: owner of the repo
4921    /// - `repo`: name of the repo
4922    /// - `index`: index of the pull request to merge
4923    pub fn repo_cancel_scheduled_auto_merge(
4924        &self,
4925        owner: &str,
4926        repo: &str,
4927        index: i64,
4928    ) -> Request<'_, endpoints::RepoCancelScheduledAutoMerge<'_>, ()> {
4929        endpoints::RepoCancelScheduledAutoMerge { owner, repo, index }
4930            .make_request()
4931            .wrap::<_, _>(self)
4932    }
4933
4934    /// Create review requests for a pull request
4935    ///
4936    /// - `owner`: owner of the repo
4937    /// - `repo`: name of the repo
4938    /// - `index`: index of the pull request
4939    /// - `body`: See [`PullReviewRequestOptions`]
4940    pub fn repo_create_pull_review_requests(
4941        &self,
4942        owner: &str,
4943        repo: &str,
4944        index: i64,
4945        body: PullReviewRequestOptions,
4946    ) -> Request<
4947        '_,
4948        endpoints::RepoCreatePullReviewRequests<'_>,
4949        (PullReviewListHeaders, Vec<PullReview>),
4950    > {
4951        endpoints::RepoCreatePullReviewRequests {
4952            owner,
4953            repo,
4954            index,
4955            body: body,
4956        }
4957        .make_request()
4958        .wrap::<_, _>(self)
4959    }
4960
4961    /// Cancel review requests for a pull request
4962    ///
4963    /// - `owner`: owner of the repo
4964    /// - `repo`: name of the repo
4965    /// - `index`: index of the pull request
4966    /// - `body`: See [`PullReviewRequestOptions`]
4967    pub fn repo_delete_pull_review_requests(
4968        &self,
4969        owner: &str,
4970        repo: &str,
4971        index: i64,
4972        body: PullReviewRequestOptions,
4973    ) -> Request<'_, endpoints::RepoDeletePullReviewRequests<'_>, ()> {
4974        endpoints::RepoDeletePullReviewRequests {
4975            owner,
4976            repo,
4977            index,
4978            body: body,
4979        }
4980        .make_request()
4981        .wrap::<_, _>(self)
4982    }
4983
4984    /// List all reviews for a pull request
4985    ///
4986    /// - `owner`: owner of the repo
4987    /// - `repo`: name of the repo
4988    /// - `index`: index of the pull request
4989    pub fn repo_list_pull_reviews(
4990        &self,
4991        owner: &str,
4992        repo: &str,
4993        index: i64,
4994    ) -> Request<'_, endpoints::RepoListPullReviews<'_>, (PullReviewListHeaders, Vec<PullReview>)>
4995    {
4996        endpoints::RepoListPullReviews { owner, repo, index }
4997            .make_request()
4998            .wrap::<_, _>(self)
4999    }
5000
5001    /// Create a review to an pull request
5002    ///
5003    /// - `owner`: owner of the repo
5004    /// - `repo`: name of the repo
5005    /// - `index`: index of the pull request
5006    /// - `body`: See [`CreatePullReviewOptions`]
5007    pub fn repo_create_pull_review(
5008        &self,
5009        owner: &str,
5010        repo: &str,
5011        index: i64,
5012        body: CreatePullReviewOptions,
5013    ) -> Request<'_, endpoints::RepoCreatePullReview<'_>, PullReview> {
5014        endpoints::RepoCreatePullReview {
5015            owner,
5016            repo,
5017            index,
5018            body: body,
5019        }
5020        .make_request()
5021        .wrap::<_, _>(self)
5022    }
5023
5024    /// Get a specific review for a pull request
5025    ///
5026    /// - `owner`: owner of the repo
5027    /// - `repo`: name of the repo
5028    /// - `index`: index of the pull request
5029    /// - `id`: id of the review
5030    pub fn repo_get_pull_review(
5031        &self,
5032        owner: &str,
5033        repo: &str,
5034        index: i64,
5035        id: i64,
5036    ) -> Request<'_, endpoints::RepoGetPullReview<'_>, PullReview> {
5037        endpoints::RepoGetPullReview {
5038            owner,
5039            repo,
5040            index,
5041            id,
5042        }
5043        .make_request()
5044        .wrap::<_, _>(self)
5045    }
5046
5047    /// Submit a pending review to an pull request
5048    ///
5049    /// - `owner`: owner of the repo
5050    /// - `repo`: name of the repo
5051    /// - `index`: index of the pull request
5052    /// - `id`: id of the review
5053    /// - `body`: See [`SubmitPullReviewOptions`]
5054    pub fn repo_submit_pull_review(
5055        &self,
5056        owner: &str,
5057        repo: &str,
5058        index: i64,
5059        id: i64,
5060        body: SubmitPullReviewOptions,
5061    ) -> Request<'_, endpoints::RepoSubmitPullReview<'_>, PullReview> {
5062        endpoints::RepoSubmitPullReview {
5063            owner,
5064            repo,
5065            index,
5066            id,
5067            body: body,
5068        }
5069        .make_request()
5070        .wrap::<_, _>(self)
5071    }
5072
5073    /// Delete a specific review from a pull request
5074    ///
5075    /// - `owner`: owner of the repo
5076    /// - `repo`: name of the repo
5077    /// - `index`: index of the pull request
5078    /// - `id`: id of the review
5079    pub fn repo_delete_pull_review(
5080        &self,
5081        owner: &str,
5082        repo: &str,
5083        index: i64,
5084        id: i64,
5085    ) -> Request<'_, endpoints::RepoDeletePullReview<'_>, ()> {
5086        endpoints::RepoDeletePullReview {
5087            owner,
5088            repo,
5089            index,
5090            id,
5091        }
5092        .make_request()
5093        .wrap::<_, _>(self)
5094    }
5095
5096    /// Get a specific review for a pull request
5097    ///
5098    /// - `owner`: owner of the repo
5099    /// - `repo`: name of the repo
5100    /// - `index`: index of the pull request
5101    /// - `id`: id of the review
5102    pub fn repo_get_pull_review_comments(
5103        &self,
5104        owner: &str,
5105        repo: &str,
5106        index: i64,
5107        id: i64,
5108    ) -> Request<'_, endpoints::RepoGetPullReviewComments<'_>, Vec<PullReviewComment>> {
5109        endpoints::RepoGetPullReviewComments {
5110            owner,
5111            repo,
5112            index,
5113            id,
5114        }
5115        .make_request()
5116        .wrap::<_, _>(self)
5117    }
5118
5119    /// Add a new comment to a pull request review
5120    ///
5121    /// - `owner`: owner of the repo
5122    /// - `repo`: name of the repo
5123    /// - `index`: index of the pull request
5124    /// - `id`: id of the review
5125    /// - `body`: See [`serde_json::Value`]
5126    pub fn repo_create_pull_review_comment(
5127        &self,
5128        owner: &str,
5129        repo: &str,
5130        index: i64,
5131        id: i64,
5132        body: serde_json::Value,
5133    ) -> Request<'_, endpoints::RepoCreatePullReviewComment<'_>, PullReviewComment> {
5134        endpoints::RepoCreatePullReviewComment {
5135            owner,
5136            repo,
5137            index,
5138            id,
5139            body: body,
5140        }
5141        .make_request()
5142        .wrap::<_, _>(self)
5143    }
5144
5145    /// Get a pull review comment
5146    ///
5147    /// - `owner`: owner of the repo
5148    /// - `repo`: name of the repo
5149    /// - `index`: index of the pull request
5150    /// - `id`: id of the review
5151    /// - `comment`: id of the comment
5152    pub fn repo_get_pull_review_comment(
5153        &self,
5154        owner: &str,
5155        repo: &str,
5156        index: i64,
5157        id: i64,
5158        comment: i64,
5159    ) -> Request<'_, endpoints::RepoGetPullReviewComment<'_>, PullReviewComment> {
5160        endpoints::RepoGetPullReviewComment {
5161            owner,
5162            repo,
5163            index,
5164            id,
5165            comment,
5166        }
5167        .make_request()
5168        .wrap::<_, _>(self)
5169    }
5170
5171    /// Delete a pull review comment
5172    ///
5173    /// - `owner`: owner of the repo
5174    /// - `repo`: name of the repo
5175    /// - `index`: index of the pull request
5176    /// - `id`: id of the review
5177    /// - `comment`: id of the comment
5178    pub fn repo_delete_pull_review_comment(
5179        &self,
5180        owner: &str,
5181        repo: &str,
5182        index: i64,
5183        id: i64,
5184        comment: i64,
5185    ) -> Request<'_, endpoints::RepoDeletePullReviewComment<'_>, ()> {
5186        endpoints::RepoDeletePullReviewComment {
5187            owner,
5188            repo,
5189            index,
5190            id,
5191            comment,
5192        }
5193        .make_request()
5194        .wrap::<_, _>(self)
5195    }
5196
5197    /// Dismiss a review for a pull request
5198    ///
5199    /// - `owner`: owner of the repo
5200    /// - `repo`: name of the repo
5201    /// - `index`: index of the pull request
5202    /// - `id`: id of the review
5203    /// - `body`: See [`DismissPullReviewOptions`]
5204    pub fn repo_dismiss_pull_review(
5205        &self,
5206        owner: &str,
5207        repo: &str,
5208        index: i64,
5209        id: i64,
5210        body: DismissPullReviewOptions,
5211    ) -> Request<'_, endpoints::RepoDismissPullReview<'_>, PullReview> {
5212        endpoints::RepoDismissPullReview {
5213            owner,
5214            repo,
5215            index,
5216            id,
5217            body: body,
5218        }
5219        .make_request()
5220        .wrap::<_, _>(self)
5221    }
5222
5223    /// Cancel to dismiss a review for a pull request
5224    ///
5225    /// - `owner`: owner of the repo
5226    /// - `repo`: name of the repo
5227    /// - `index`: index of the pull request
5228    /// - `id`: id of the review
5229    pub fn repo_un_dismiss_pull_review(
5230        &self,
5231        owner: &str,
5232        repo: &str,
5233        index: i64,
5234        id: i64,
5235    ) -> Request<'_, endpoints::RepoUnDismissPullReview<'_>, PullReview> {
5236        endpoints::RepoUnDismissPullReview {
5237            owner,
5238            repo,
5239            index,
5240            id,
5241        }
5242        .make_request()
5243        .wrap::<_, _>(self)
5244    }
5245
5246    /// Merge PR's baseBranch into headBranch
5247    ///
5248    /// - `owner`: owner of the repo
5249    /// - `repo`: name of the repo
5250    /// - `index`: index of the pull request to get
5251    pub fn repo_update_pull_request(
5252        &self,
5253        owner: &str,
5254        repo: &str,
5255        index: i64,
5256        query: RepoUpdatePullRequestQuery,
5257    ) -> Request<'_, endpoints::RepoUpdatePullRequest<'_>, ()> {
5258        endpoints::RepoUpdatePullRequest {
5259            owner,
5260            repo,
5261            index,
5262            query,
5263        }
5264        .make_request()
5265        .wrap::<_, _>(self)
5266    }
5267
5268    /// Get all push mirrors of the repository
5269    ///
5270    /// - `owner`: owner of the repo
5271    /// - `repo`: name of the repo
5272    pub fn repo_list_push_mirrors(
5273        &self,
5274        owner: &str,
5275        repo: &str,
5276    ) -> Request<'_, endpoints::RepoListPushMirrors<'_>, (PushMirrorListHeaders, Vec<PushMirror>)>
5277    {
5278        endpoints::RepoListPushMirrors { owner, repo }
5279            .make_request()
5280            .wrap::<_, _>(self)
5281    }
5282
5283    /// Set up a new push mirror in a repository
5284    ///
5285    /// - `owner`: owner of the repo
5286    /// - `repo`: name of the repo
5287    /// - `body`: See [`CreatePushMirrorOption`]
5288    pub fn repo_add_push_mirror(
5289        &self,
5290        owner: &str,
5291        repo: &str,
5292        body: CreatePushMirrorOption,
5293    ) -> Request<'_, endpoints::RepoAddPushMirror<'_>, PushMirror> {
5294        endpoints::RepoAddPushMirror {
5295            owner,
5296            repo,
5297            body: body,
5298        }
5299        .make_request()
5300        .wrap::<_, _>(self)
5301    }
5302
5303    /// Sync all push mirrored repository
5304    ///
5305    /// - `owner`: owner of the repo to sync
5306    /// - `repo`: name of the repo to sync
5307    pub fn repo_push_mirror_sync(
5308        &self,
5309        owner: &str,
5310        repo: &str,
5311    ) -> Request<'_, endpoints::RepoPushMirrorSync<'_>, ()> {
5312        endpoints::RepoPushMirrorSync { owner, repo }
5313            .make_request()
5314            .wrap::<_, _>(self)
5315    }
5316
5317    /// Get push mirror of the repository by remoteName
5318    ///
5319    /// - `owner`: owner of the repo
5320    /// - `repo`: name of the repo
5321    /// - `name`: remote name of push mirror
5322    pub fn repo_get_push_mirror_by_remote_name(
5323        &self,
5324        owner: &str,
5325        repo: &str,
5326        name: &str,
5327    ) -> Request<'_, endpoints::RepoGetPushMirrorByRemoteName<'_>, PushMirror> {
5328        endpoints::RepoGetPushMirrorByRemoteName { owner, repo, name }
5329            .make_request()
5330            .wrap::<_, _>(self)
5331    }
5332
5333    /// Remove a push mirror from a repository by remoteName
5334    ///
5335    /// - `owner`: owner of the repo
5336    /// - `repo`: name of the repo
5337    /// - `name`: remote name of the pushMirror
5338    pub fn repo_delete_push_mirror(
5339        &self,
5340        owner: &str,
5341        repo: &str,
5342        name: &str,
5343    ) -> Request<'_, endpoints::RepoDeletePushMirror<'_>, ()> {
5344        endpoints::RepoDeletePushMirror { owner, repo, name }
5345            .make_request()
5346            .wrap::<_, _>(self)
5347    }
5348
5349    /// Get a file from a repository
5350    ///
5351    /// - `owner`: owner of the repo
5352    /// - `repo`: name of the repo
5353    /// - `filepath`: filepath of the file to get
5354    pub fn repo_get_raw_file(
5355        &self,
5356        owner: &str,
5357        repo: &str,
5358        filepath: &str,
5359        query: RepoGetRawFileQuery,
5360    ) -> Request<'_, endpoints::RepoGetRawFile<'_>, Bytes> {
5361        endpoints::RepoGetRawFile {
5362            owner,
5363            repo,
5364            filepath,
5365            query,
5366        }
5367        .make_request()
5368        .wrap::<_, _>(self)
5369    }
5370
5371    /// List a repo's releases
5372    ///
5373    /// - `owner`: owner of the repo
5374    /// - `repo`: name of the repo
5375    pub fn repo_list_releases(
5376        &self,
5377        owner: &str,
5378        repo: &str,
5379        query: RepoListReleasesQuery,
5380    ) -> Request<'_, endpoints::RepoListReleases<'_>, (ReleaseListHeaders, Vec<Release>)> {
5381        endpoints::RepoListReleases { owner, repo, query }
5382            .make_request()
5383            .wrap::<_, _>(self)
5384    }
5385
5386    /// Create a release
5387    ///
5388    /// - `owner`: owner of the repo
5389    /// - `repo`: name of the repo
5390    /// - `body`: See [`CreateReleaseOption`]
5391    pub fn repo_create_release(
5392        &self,
5393        owner: &str,
5394        repo: &str,
5395        body: CreateReleaseOption,
5396    ) -> Request<'_, endpoints::RepoCreateRelease<'_>, Release> {
5397        endpoints::RepoCreateRelease {
5398            owner,
5399            repo,
5400            body: body,
5401        }
5402        .make_request()
5403        .wrap::<_, _>(self)
5404    }
5405
5406    /// Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at
5407    ///
5408    /// - `owner`: owner of the repo
5409    /// - `repo`: name of the repo
5410    pub fn repo_get_latest_release(
5411        &self,
5412        owner: &str,
5413        repo: &str,
5414    ) -> Request<'_, endpoints::RepoGetLatestRelease<'_>, Release> {
5415        endpoints::RepoGetLatestRelease { owner, repo }
5416            .make_request()
5417            .wrap::<_, _>(self)
5418    }
5419
5420    /// Get a release by tag name
5421    ///
5422    /// - `owner`: owner of the repo
5423    /// - `repo`: name of the repo
5424    /// - `tag`: tag name of the release to get
5425    pub fn repo_get_release_by_tag(
5426        &self,
5427        owner: &str,
5428        repo: &str,
5429        tag: &str,
5430    ) -> Request<'_, endpoints::RepoGetReleaseByTag<'_>, Release> {
5431        endpoints::RepoGetReleaseByTag { owner, repo, tag }
5432            .make_request()
5433            .wrap::<_, _>(self)
5434    }
5435
5436    /// Delete a release by tag name
5437    ///
5438    /// - `owner`: owner of the repo
5439    /// - `repo`: name of the repo
5440    /// - `tag`: tag name of the release to delete
5441    pub fn repo_delete_release_by_tag(
5442        &self,
5443        owner: &str,
5444        repo: &str,
5445        tag: &str,
5446    ) -> Request<'_, endpoints::RepoDeleteReleaseByTag<'_>, ()> {
5447        endpoints::RepoDeleteReleaseByTag { owner, repo, tag }
5448            .make_request()
5449            .wrap::<_, _>(self)
5450    }
5451
5452    /// Get a release
5453    ///
5454    /// - `owner`: owner of the repo
5455    /// - `repo`: name of the repo
5456    /// - `id`: id of the release to get
5457    pub fn repo_get_release(
5458        &self,
5459        owner: &str,
5460        repo: &str,
5461        id: i64,
5462    ) -> Request<'_, endpoints::RepoGetRelease<'_>, Release> {
5463        endpoints::RepoGetRelease { owner, repo, id }
5464            .make_request()
5465            .wrap::<_, _>(self)
5466    }
5467
5468    /// Delete a release
5469    ///
5470    /// - `owner`: owner of the repo
5471    /// - `repo`: name of the repo
5472    /// - `id`: id of the release to delete
5473    pub fn repo_delete_release(
5474        &self,
5475        owner: &str,
5476        repo: &str,
5477        id: i64,
5478    ) -> Request<'_, endpoints::RepoDeleteRelease<'_>, ()> {
5479        endpoints::RepoDeleteRelease { owner, repo, id }
5480            .make_request()
5481            .wrap::<_, _>(self)
5482    }
5483
5484    /// Update a release
5485    ///
5486    /// - `owner`: owner of the repo
5487    /// - `repo`: name of the repo
5488    /// - `id`: id of the release to edit
5489    /// - `body`: See [`EditReleaseOption`]
5490    pub fn repo_edit_release(
5491        &self,
5492        owner: &str,
5493        repo: &str,
5494        id: i64,
5495        body: EditReleaseOption,
5496    ) -> Request<'_, endpoints::RepoEditRelease<'_>, Release> {
5497        endpoints::RepoEditRelease {
5498            owner,
5499            repo,
5500            id,
5501            body: body,
5502        }
5503        .make_request()
5504        .wrap::<_, _>(self)
5505    }
5506
5507    /// List release's attachments
5508    ///
5509    /// - `owner`: owner of the repo
5510    /// - `repo`: name of the repo
5511    /// - `id`: id of the release
5512    pub fn repo_list_release_attachments(
5513        &self,
5514        owner: &str,
5515        repo: &str,
5516        id: i64,
5517    ) -> Request<'_, endpoints::RepoListReleaseAttachments<'_>, Vec<Attachment>> {
5518        endpoints::RepoListReleaseAttachments { owner, repo, id }
5519            .make_request()
5520            .wrap::<_, _>(self)
5521    }
5522
5523    /// Create a release attachment
5524    ///
5525    /// - `owner`: owner of the repo
5526    /// - `repo`: name of the repo
5527    /// - `id`: id of the release
5528    /// - `attachment`: attachment to upload (this parameter is incompatible with `external_url`)
5529    /// - `external_url`: url to external asset (this parameter is incompatible with `attachment`)
5530    pub fn repo_create_release_attachment(
5531        &self,
5532        owner: &str,
5533        repo: &str,
5534        id: i64,
5535        attachment: Option<&[u8]>,
5536        external_url: Option<&str>,
5537        query: RepoCreateReleaseAttachmentQuery,
5538    ) -> Request<'_, endpoints::RepoCreateReleaseAttachment<'_>, Attachment> {
5539        endpoints::RepoCreateReleaseAttachment {
5540            owner,
5541            repo,
5542            id,
5543            attachment: attachment.as_deref(),
5544            external_url: external_url.as_deref(),
5545            query,
5546        }
5547        .make_request()
5548        .wrap::<_, _>(self)
5549    }
5550
5551    /// Get a release attachment
5552    ///
5553    /// - `owner`: owner of the repo
5554    /// - `repo`: name of the repo
5555    /// - `id`: id of the release
5556    /// - `attachment_id`: id of the attachment to get
5557    pub fn repo_get_release_attachment(
5558        &self,
5559        owner: &str,
5560        repo: &str,
5561        id: i64,
5562        attachment_id: i64,
5563    ) -> Request<'_, endpoints::RepoGetReleaseAttachment<'_>, Attachment> {
5564        endpoints::RepoGetReleaseAttachment {
5565            owner,
5566            repo,
5567            id,
5568            attachment_id,
5569        }
5570        .make_request()
5571        .wrap::<_, _>(self)
5572    }
5573
5574    /// Delete a release attachment
5575    ///
5576    /// - `owner`: owner of the repo
5577    /// - `repo`: name of the repo
5578    /// - `id`: id of the release
5579    /// - `attachment_id`: id of the attachment to delete
5580    pub fn repo_delete_release_attachment(
5581        &self,
5582        owner: &str,
5583        repo: &str,
5584        id: i64,
5585        attachment_id: i64,
5586    ) -> Request<'_, endpoints::RepoDeleteReleaseAttachment<'_>, ()> {
5587        endpoints::RepoDeleteReleaseAttachment {
5588            owner,
5589            repo,
5590            id,
5591            attachment_id,
5592        }
5593        .make_request()
5594        .wrap::<_, _>(self)
5595    }
5596
5597    /// Edit a release attachment
5598    ///
5599    /// - `owner`: owner of the repo
5600    /// - `repo`: name of the repo
5601    /// - `id`: id of the release
5602    /// - `attachment_id`: id of the attachment to edit
5603    /// - `body`: See [`EditAttachmentOptions`]
5604    pub fn repo_edit_release_attachment(
5605        &self,
5606        owner: &str,
5607        repo: &str,
5608        id: i64,
5609        attachment_id: i64,
5610        body: EditAttachmentOptions,
5611    ) -> Request<'_, endpoints::RepoEditReleaseAttachment<'_>, Attachment> {
5612        endpoints::RepoEditReleaseAttachment {
5613            owner,
5614            repo,
5615            id,
5616            attachment_id,
5617            body: body,
5618        }
5619        .make_request()
5620        .wrap::<_, _>(self)
5621    }
5622
5623    /// Return all users that can be requested to review in this repo
5624    ///
5625    /// - `owner`: owner of the repo
5626    /// - `repo`: name of the repo
5627    pub fn repo_get_reviewers(
5628        &self,
5629        owner: &str,
5630        repo: &str,
5631    ) -> Request<'_, endpoints::RepoGetReviewers<'_>, (UserListHeaders, Vec<User>)> {
5632        endpoints::RepoGetReviewers { owner, repo }
5633            .make_request()
5634            .wrap::<_, _>(self)
5635    }
5636
5637    /// Get signing-key.gpg for given repository
5638    ///
5639    /// - `owner`: owner of the repo
5640    /// - `repo`: name of the repo
5641    pub fn repo_signing_key(
5642        &self,
5643        owner: &str,
5644        repo: &str,
5645    ) -> Request<'_, endpoints::RepoSigningKey<'_>, String> {
5646        endpoints::RepoSigningKey { owner, repo }
5647            .make_request()
5648            .wrap::<_, _>(self)
5649    }
5650
5651    /// List a repo's stargazers
5652    ///
5653    /// - `owner`: owner of the repo
5654    /// - `repo`: name of the repo
5655    pub fn repo_list_stargazers(
5656        &self,
5657        owner: &str,
5658        repo: &str,
5659    ) -> Request<'_, endpoints::RepoListStargazers<'_>, (UserListHeaders, Vec<User>)> {
5660        endpoints::RepoListStargazers { owner, repo }
5661            .make_request()
5662            .wrap::<_, _>(self)
5663    }
5664
5665    /// Get a commit's statuses
5666    ///
5667    /// - `owner`: owner of the repo
5668    /// - `repo`: name of the repo
5669    /// - `sha`: sha of the commit
5670    pub fn repo_list_statuses(
5671        &self,
5672        owner: &str,
5673        repo: &str,
5674        sha: &str,
5675        query: RepoListStatusesQuery,
5676    ) -> Request<'_, endpoints::RepoListStatuses<'_>, (CommitStatusListHeaders, Vec<CommitStatus>)>
5677    {
5678        endpoints::RepoListStatuses {
5679            owner,
5680            repo,
5681            sha,
5682            query,
5683        }
5684        .make_request()
5685        .wrap::<_, _>(self)
5686    }
5687
5688    /// Create a commit status
5689    ///
5690    /// - `owner`: owner of the repo
5691    /// - `repo`: name of the repo
5692    /// - `sha`: sha of the commit
5693    /// - `body`: See [`CreateStatusOption`]
5694    pub fn repo_create_status(
5695        &self,
5696        owner: &str,
5697        repo: &str,
5698        sha: &str,
5699        body: CreateStatusOption,
5700    ) -> Request<'_, endpoints::RepoCreateStatus<'_>, CommitStatus> {
5701        endpoints::RepoCreateStatus {
5702            owner,
5703            repo,
5704            sha,
5705            body: body,
5706        }
5707        .make_request()
5708        .wrap::<_, _>(self)
5709    }
5710
5711    /// List a repo's watchers
5712    ///
5713    /// - `owner`: owner of the repo
5714    /// - `repo`: name of the repo
5715    pub fn repo_list_subscribers(
5716        &self,
5717        owner: &str,
5718        repo: &str,
5719    ) -> Request<'_, endpoints::RepoListSubscribers<'_>, (UserListHeaders, Vec<User>)> {
5720        endpoints::RepoListSubscribers { owner, repo }
5721            .make_request()
5722            .wrap::<_, _>(self)
5723    }
5724
5725    /// Check if the current user is watching a repo
5726    ///
5727    /// - `owner`: owner of the repo
5728    /// - `repo`: name of the repo
5729    pub fn user_current_check_subscription(
5730        &self,
5731        owner: &str,
5732        repo: &str,
5733    ) -> Request<'_, endpoints::UserCurrentCheckSubscription<'_>, WatchInfo> {
5734        endpoints::UserCurrentCheckSubscription { owner, repo }
5735            .make_request()
5736            .wrap::<_, _>(self)
5737    }
5738
5739    /// Watch a repo
5740    ///
5741    /// - `owner`: owner of the repo
5742    /// - `repo`: name of the repo
5743    pub fn user_current_put_subscription(
5744        &self,
5745        owner: &str,
5746        repo: &str,
5747    ) -> Request<'_, endpoints::UserCurrentPutSubscription<'_>, WatchInfo> {
5748        endpoints::UserCurrentPutSubscription { owner, repo }
5749            .make_request()
5750            .wrap::<_, _>(self)
5751    }
5752
5753    /// Unwatch a repo
5754    ///
5755    /// - `owner`: owner of the repo
5756    /// - `repo`: name of the repo
5757    pub fn user_current_delete_subscription(
5758        &self,
5759        owner: &str,
5760        repo: &str,
5761    ) -> Request<'_, endpoints::UserCurrentDeleteSubscription<'_>, ()> {
5762        endpoints::UserCurrentDeleteSubscription { owner, repo }
5763            .make_request()
5764            .wrap::<_, _>(self)
5765    }
5766
5767    /// Gets information about syncing the fork default branch with the base branch
5768    ///
5769    /// - `owner`: owner of the repo
5770    /// - `repo`: name of the repo
5771    pub fn repo_sync_fork_default_info(
5772        &self,
5773        owner: &str,
5774        repo: &str,
5775    ) -> Request<'_, endpoints::RepoSyncForkDefaultInfo<'_>, SyncForkInfo> {
5776        endpoints::RepoSyncForkDefaultInfo { owner, repo }
5777            .make_request()
5778            .wrap::<_, _>(self)
5779    }
5780
5781    /// Syncs the default branch of a fork with the base branch
5782    ///
5783    /// - `owner`: owner of the repo
5784    /// - `repo`: name of the repo
5785    pub fn repo_sync_fork_default(
5786        &self,
5787        owner: &str,
5788        repo: &str,
5789    ) -> Request<'_, endpoints::RepoSyncForkDefault<'_>, ()> {
5790        endpoints::RepoSyncForkDefault { owner, repo }
5791            .make_request()
5792            .wrap::<_, _>(self)
5793    }
5794
5795    /// Gets information about syncing a fork branch with the base branch
5796    ///
5797    /// - `owner`: owner of the repo
5798    /// - `repo`: name of the repo
5799    /// - `branch`: The branch
5800    pub fn repo_sync_fork_branch_info(
5801        &self,
5802        owner: &str,
5803        repo: &str,
5804        branch: &str,
5805    ) -> Request<'_, endpoints::RepoSyncForkBranchInfo<'_>, SyncForkInfo> {
5806        endpoints::RepoSyncForkBranchInfo {
5807            owner,
5808            repo,
5809            branch,
5810        }
5811        .make_request()
5812        .wrap::<_, _>(self)
5813    }
5814
5815    /// Syncs a fork branch with the base branch
5816    ///
5817    /// - `owner`: owner of the repo
5818    /// - `repo`: name of the repo
5819    /// - `branch`: The branch
5820    pub fn repo_sync_fork_branch(
5821        &self,
5822        owner: &str,
5823        repo: &str,
5824        branch: &str,
5825    ) -> Request<'_, endpoints::RepoSyncForkBranch<'_>, ()> {
5826        endpoints::RepoSyncForkBranch {
5827            owner,
5828            repo,
5829            branch,
5830        }
5831        .make_request()
5832        .wrap::<_, _>(self)
5833    }
5834
5835    /// List tag protections for a repository
5836    ///
5837    /// - `owner`: owner of the repo
5838    /// - `repo`: name of the repo
5839    pub fn repo_list_tag_protection(
5840        &self,
5841        owner: &str,
5842        repo: &str,
5843    ) -> Request<'_, endpoints::RepoListTagProtection<'_>, Vec<TagProtection>> {
5844        endpoints::RepoListTagProtection { owner, repo }
5845            .make_request()
5846            .wrap::<_, _>(self)
5847    }
5848
5849    /// Create a tag protections for a repository
5850    ///
5851    /// - `owner`: owner of the repo
5852    /// - `repo`: name of the repo
5853    /// - `body`: See [`CreateTagProtectionOption`]
5854    pub fn repo_create_tag_protection(
5855        &self,
5856        owner: &str,
5857        repo: &str,
5858        body: CreateTagProtectionOption,
5859    ) -> Request<'_, endpoints::RepoCreateTagProtection<'_>, TagProtection> {
5860        endpoints::RepoCreateTagProtection {
5861            owner,
5862            repo,
5863            body: body,
5864        }
5865        .make_request()
5866        .wrap::<_, _>(self)
5867    }
5868
5869    /// Get a specific tag protection for the repository
5870    ///
5871    /// - `owner`: owner of the repo
5872    /// - `repo`: name of the repo
5873    /// - `id`: id of the tag protect to get
5874    pub fn repo_get_tag_protection(
5875        &self,
5876        owner: &str,
5877        repo: &str,
5878        id: i64,
5879    ) -> Request<'_, endpoints::RepoGetTagProtection<'_>, TagProtection> {
5880        endpoints::RepoGetTagProtection { owner, repo, id }
5881            .make_request()
5882            .wrap::<_, _>(self)
5883    }
5884
5885    /// Delete a specific tag protection for the repository
5886    ///
5887    /// - `owner`: owner of the repo
5888    /// - `repo`: name of the repo
5889    /// - `id`: id of protected tag
5890    pub fn repo_delete_tag_protection(
5891        &self,
5892        owner: &str,
5893        repo: &str,
5894        id: i64,
5895    ) -> Request<'_, endpoints::RepoDeleteTagProtection<'_>, ()> {
5896        endpoints::RepoDeleteTagProtection { owner, repo, id }
5897            .make_request()
5898            .wrap::<_, _>(self)
5899    }
5900
5901    /// Edit a tag protections for a repository. Only fields that are set will be changed
5902    ///
5903    /// - `owner`: owner of the repo
5904    /// - `repo`: name of the repo
5905    /// - `id`: id of protected tag
5906    /// - `body`: See [`EditTagProtectionOption`]
5907    pub fn repo_edit_tag_protection(
5908        &self,
5909        owner: &str,
5910        repo: &str,
5911        id: i64,
5912        body: EditTagProtectionOption,
5913    ) -> Request<'_, endpoints::RepoEditTagProtection<'_>, TagProtection> {
5914        endpoints::RepoEditTagProtection {
5915            owner,
5916            repo,
5917            id,
5918            body: body,
5919        }
5920        .make_request()
5921        .wrap::<_, _>(self)
5922    }
5923
5924    /// List a repository's tags
5925    ///
5926    /// - `owner`: owner of the repo
5927    /// - `repo`: name of the repo
5928    pub fn repo_list_tags(
5929        &self,
5930        owner: &str,
5931        repo: &str,
5932    ) -> Request<'_, endpoints::RepoListTags<'_>, (TagListHeaders, Vec<Tag>)> {
5933        endpoints::RepoListTags { owner, repo }
5934            .make_request()
5935            .wrap::<_, _>(self)
5936    }
5937
5938    /// Create a new git tag in a repository
5939    ///
5940    /// - `owner`: owner of the repo
5941    /// - `repo`: name of the repo
5942    /// - `body`: See [`CreateTagOption`]
5943    pub fn repo_create_tag(
5944        &self,
5945        owner: &str,
5946        repo: &str,
5947        body: CreateTagOption,
5948    ) -> Request<'_, endpoints::RepoCreateTag<'_>, Tag> {
5949        endpoints::RepoCreateTag {
5950            owner,
5951            repo,
5952            body: body,
5953        }
5954        .make_request()
5955        .wrap::<_, _>(self)
5956    }
5957
5958    /// Get the tag of a repository by tag name
5959    ///
5960    /// - `owner`: owner of the repo
5961    /// - `repo`: name of the repo
5962    /// - `tag`: name of tag
5963    pub fn repo_get_tag(
5964        &self,
5965        owner: &str,
5966        repo: &str,
5967        tag: &str,
5968    ) -> Request<'_, endpoints::RepoGetTag<'_>, Tag> {
5969        endpoints::RepoGetTag { owner, repo, tag }
5970            .make_request()
5971            .wrap::<_, _>(self)
5972    }
5973
5974    /// Delete a repository's tag by name
5975    ///
5976    /// - `owner`: owner of the repo
5977    /// - `repo`: name of the repo
5978    /// - `tag`: name of tag to delete
5979    pub fn repo_delete_tag(
5980        &self,
5981        owner: &str,
5982        repo: &str,
5983        tag: &str,
5984    ) -> Request<'_, endpoints::RepoDeleteTag<'_>, ()> {
5985        endpoints::RepoDeleteTag { owner, repo, tag }
5986            .make_request()
5987            .wrap::<_, _>(self)
5988    }
5989
5990    /// List a repository's teams
5991    ///
5992    /// - `owner`: owner of the repo
5993    /// - `repo`: name of the repo
5994    pub fn repo_list_teams(
5995        &self,
5996        owner: &str,
5997        repo: &str,
5998    ) -> Request<'_, endpoints::RepoListTeams<'_>, (TeamListHeaders, Vec<Team>)> {
5999        endpoints::RepoListTeams { owner, repo }
6000            .make_request()
6001            .wrap::<_, _>(self)
6002    }
6003
6004    /// Check if a team is assigned to a repository
6005    ///
6006    /// - `owner`: owner of the repo
6007    /// - `repo`: name of the repo
6008    /// - `team`: team name
6009    pub fn repo_check_team(
6010        &self,
6011        owner: &str,
6012        repo: &str,
6013        team: &str,
6014    ) -> Request<'_, endpoints::RepoCheckTeam<'_>, Team> {
6015        endpoints::RepoCheckTeam { owner, repo, team }
6016            .make_request()
6017            .wrap::<_, _>(self)
6018    }
6019
6020    /// Add a team to a repository
6021    ///
6022    /// - `owner`: owner of the repo
6023    /// - `repo`: name of the repo
6024    /// - `team`: team name
6025    pub fn repo_add_team(
6026        &self,
6027        owner: &str,
6028        repo: &str,
6029        team: &str,
6030    ) -> Request<'_, endpoints::RepoAddTeam<'_>, ()> {
6031        endpoints::RepoAddTeam { owner, repo, team }
6032            .make_request()
6033            .wrap::<_, _>(self)
6034    }
6035
6036    /// Delete a team from a repository
6037    ///
6038    /// - `owner`: owner of the repo
6039    /// - `repo`: name of the repo
6040    /// - `team`: team name
6041    pub fn repo_delete_team(
6042        &self,
6043        owner: &str,
6044        repo: &str,
6045        team: &str,
6046    ) -> Request<'_, endpoints::RepoDeleteTeam<'_>, ()> {
6047        endpoints::RepoDeleteTeam { owner, repo, team }
6048            .make_request()
6049            .wrap::<_, _>(self)
6050    }
6051
6052    /// List a repo's tracked times
6053    ///
6054    /// - `owner`: owner of the repo
6055    /// - `repo`: name of the repo
6056    pub fn repo_tracked_times(
6057        &self,
6058        owner: &str,
6059        repo: &str,
6060        query: RepoTrackedTimesQuery,
6061    ) -> Request<'_, endpoints::RepoTrackedTimes<'_>, (TrackedTimeListHeaders, Vec<TrackedTime>)>
6062    {
6063        endpoints::RepoTrackedTimes { owner, repo, query }
6064            .make_request()
6065            .wrap::<_, _>(self)
6066    }
6067
6068    /// List a user's tracked times in a repo
6069    ///
6070    /// - `owner`: owner of the repo
6071    /// - `repo`: name of the repo
6072    /// - `user`: username of user
6073    pub fn user_tracked_times(
6074        &self,
6075        owner: &str,
6076        repo: &str,
6077        user: &str,
6078    ) -> Request<'_, endpoints::UserTrackedTimes<'_>, (TrackedTimeListHeaders, Vec<TrackedTime>)>
6079    {
6080        endpoints::UserTrackedTimes { owner, repo, user }
6081            .make_request()
6082            .wrap::<_, _>(self)
6083    }
6084
6085    /// Get list of topics that a repository has
6086    ///
6087    /// - `owner`: owner of the repo
6088    /// - `repo`: name of the repo
6089    pub fn repo_list_topics(
6090        &self,
6091        owner: &str,
6092        repo: &str,
6093    ) -> Request<'_, endpoints::RepoListTopics<'_>, TopicName> {
6094        endpoints::RepoListTopics { owner, repo }
6095            .make_request()
6096            .wrap::<_, _>(self)
6097    }
6098
6099    /// Replace list of topics for a repository
6100    ///
6101    /// - `owner`: owner of the repo
6102    /// - `repo`: name of the repo
6103    /// - `body`: See [`RepoTopicOptions`]
6104    pub fn repo_update_topics(
6105        &self,
6106        owner: &str,
6107        repo: &str,
6108        body: RepoTopicOptions,
6109    ) -> Request<'_, endpoints::RepoUpdateTopics<'_>, ()> {
6110        endpoints::RepoUpdateTopics {
6111            owner,
6112            repo,
6113            body: body,
6114        }
6115        .make_request()
6116        .wrap::<_, _>(self)
6117    }
6118
6119    /// Add a topic to a repository
6120    ///
6121    /// - `owner`: owner of the repo
6122    /// - `repo`: name of the repo
6123    /// - `topic`: name of the topic to add
6124    pub fn repo_add_topic(
6125        &self,
6126        owner: &str,
6127        repo: &str,
6128        topic: &str,
6129    ) -> Request<'_, endpoints::RepoAddTopic<'_>, ()> {
6130        endpoints::RepoAddTopic { owner, repo, topic }
6131            .make_request()
6132            .wrap::<_, _>(self)
6133    }
6134
6135    /// Delete a topic from a repository
6136    ///
6137    /// - `owner`: owner of the repo
6138    /// - `repo`: name of the repo
6139    /// - `topic`: name of the topic to delete
6140    pub fn repo_delete_topic(
6141        &self,
6142        owner: &str,
6143        repo: &str,
6144        topic: &str,
6145    ) -> Request<'_, endpoints::RepoDeleteTopic<'_>, ()> {
6146        endpoints::RepoDeleteTopic { owner, repo, topic }
6147            .make_request()
6148            .wrap::<_, _>(self)
6149    }
6150
6151    /// Transfer a repo ownership
6152    ///
6153    /// - `owner`: owner of the repo to transfer
6154    /// - `repo`: name of the repo to transfer
6155    /// - `body`: Transfer Options
6156
6157    ///   See [`TransferRepoOption`]
6158    pub fn repo_transfer(
6159        &self,
6160        owner: &str,
6161        repo: &str,
6162        body: TransferRepoOption,
6163    ) -> Request<'_, endpoints::RepoTransfer<'_>, Repository> {
6164        endpoints::RepoTransfer {
6165            owner,
6166            repo,
6167            body: body,
6168        }
6169        .make_request()
6170        .wrap::<_, _>(self)
6171    }
6172
6173    /// Accept a repo transfer
6174    ///
6175    /// - `owner`: owner of the repo to transfer
6176    /// - `repo`: name of the repo to transfer
6177    pub fn accept_repo_transfer(
6178        &self,
6179        owner: &str,
6180        repo: &str,
6181    ) -> Request<'_, endpoints::AcceptRepoTransfer<'_>, Repository> {
6182        endpoints::AcceptRepoTransfer { owner, repo }
6183            .make_request()
6184            .wrap::<_, _>(self)
6185    }
6186
6187    /// Reject a repo transfer
6188    ///
6189    /// - `owner`: owner of the repo to transfer
6190    /// - `repo`: name of the repo to transfer
6191    pub fn reject_repo_transfer(
6192        &self,
6193        owner: &str,
6194        repo: &str,
6195    ) -> Request<'_, endpoints::RejectRepoTransfer<'_>, Repository> {
6196        endpoints::RejectRepoTransfer { owner, repo }
6197            .make_request()
6198            .wrap::<_, _>(self)
6199    }
6200
6201    /// Create a wiki page
6202    ///
6203    /// - `owner`: owner of the repo
6204    /// - `repo`: name of the repo
6205    /// - `body`: See [`CreateWikiPageOptions`]
6206    pub fn repo_create_wiki_page(
6207        &self,
6208        owner: &str,
6209        repo: &str,
6210        body: CreateWikiPageOptions,
6211    ) -> Request<'_, endpoints::RepoCreateWikiPage<'_>, WikiPage> {
6212        endpoints::RepoCreateWikiPage {
6213            owner,
6214            repo,
6215            body: body,
6216        }
6217        .make_request()
6218        .wrap::<_, _>(self)
6219    }
6220
6221    /// Get a wiki page
6222    ///
6223    /// - `owner`: owner of the repo
6224    /// - `repo`: name of the repo
6225    /// - `pageName`: name of the page
6226    pub fn repo_get_wiki_page(
6227        &self,
6228        owner: &str,
6229        repo: &str,
6230        page_name: &str,
6231    ) -> Request<'_, endpoints::RepoGetWikiPage<'_>, WikiPage> {
6232        endpoints::RepoGetWikiPage {
6233            owner,
6234            repo,
6235            page_name,
6236        }
6237        .make_request()
6238        .wrap::<_, _>(self)
6239    }
6240
6241    /// Delete a wiki page
6242    ///
6243    /// - `owner`: owner of the repo
6244    /// - `repo`: name of the repo
6245    /// - `pageName`: name of the page
6246    pub fn repo_delete_wiki_page(
6247        &self,
6248        owner: &str,
6249        repo: &str,
6250        page_name: &str,
6251    ) -> Request<'_, endpoints::RepoDeleteWikiPage<'_>, ()> {
6252        endpoints::RepoDeleteWikiPage {
6253            owner,
6254            repo,
6255            page_name,
6256        }
6257        .make_request()
6258        .wrap::<_, _>(self)
6259    }
6260
6261    /// Edit a wiki page
6262    ///
6263    /// - `owner`: owner of the repo
6264    /// - `repo`: name of the repo
6265    /// - `pageName`: name of the page
6266    /// - `body`: See [`CreateWikiPageOptions`]
6267    pub fn repo_edit_wiki_page(
6268        &self,
6269        owner: &str,
6270        repo: &str,
6271        page_name: &str,
6272        body: CreateWikiPageOptions,
6273    ) -> Request<'_, endpoints::RepoEditWikiPage<'_>, WikiPage> {
6274        endpoints::RepoEditWikiPage {
6275            owner,
6276            repo,
6277            page_name,
6278            body: body,
6279        }
6280        .make_request()
6281        .wrap::<_, _>(self)
6282    }
6283
6284    /// Get all wiki pages
6285    ///
6286    /// - `owner`: owner of the repo
6287    /// - `repo`: name of the repo
6288    pub fn repo_get_wiki_pages(
6289        &self,
6290        owner: &str,
6291        repo: &str,
6292    ) -> Request<'_, endpoints::RepoGetWikiPages<'_>, (WikiPageListHeaders, Vec<WikiPageMetaData>)>
6293    {
6294        endpoints::RepoGetWikiPages { owner, repo }
6295            .make_request()
6296            .wrap::<_, _>(self)
6297    }
6298
6299    /// Get revisions of a wiki page
6300    ///
6301    /// - `owner`: owner of the repo
6302    /// - `repo`: name of the repo
6303    /// - `pageName`: name of the page
6304    pub fn repo_get_wiki_page_revisions(
6305        &self,
6306        owner: &str,
6307        repo: &str,
6308        page_name: &str,
6309    ) -> Request<'_, endpoints::RepoGetWikiPageRevisions<'_>, (WikiCommitListHeaders, WikiCommitList)>
6310    {
6311        endpoints::RepoGetWikiPageRevisions {
6312            owner,
6313            repo,
6314            page_name,
6315        }
6316        .make_request()
6317        .wrap::<_, _>(self)
6318    }
6319
6320    /// Create a repository using a template
6321    ///
6322    /// - `template_owner`: name of the template repository owner
6323    /// - `template_repo`: name of the template repository
6324    /// - `body`: See [`GenerateRepoOption`]
6325    pub fn generate_repo(
6326        &self,
6327        template_owner: &str,
6328        template_repo: &str,
6329        body: GenerateRepoOption,
6330    ) -> Request<'_, endpoints::GenerateRepo<'_>, Repository> {
6331        endpoints::GenerateRepo {
6332            template_owner,
6333            template_repo,
6334            body: body,
6335        }
6336        .make_request()
6337        .wrap::<_, _>(self)
6338    }
6339
6340    /// Get a repository by id
6341    ///
6342    /// - `id`: id of the repo to get
6343    pub fn repo_get_by_id(&self, id: i64) -> Request<'_, endpoints::RepoGetById, Repository> {
6344        endpoints::RepoGetById { id }
6345            .make_request()
6346            .wrap::<_, _>(self)
6347    }
6348
6349    /// Get instance's global settings for api
6350    pub fn get_general_api_settings(
6351        &self,
6352    ) -> Request<'_, endpoints::GetGeneralApiSettings, GeneralAPISettings> {
6353        endpoints::GetGeneralApiSettings {}
6354            .make_request()
6355            .wrap::<_, _>(self)
6356    }
6357
6358    /// Get instance's global settings for Attachment
6359    pub fn get_general_attachment_settings(
6360        &self,
6361    ) -> Request<'_, endpoints::GetGeneralAttachmentSettings, GeneralAttachmentSettings> {
6362        endpoints::GetGeneralAttachmentSettings {}
6363            .make_request()
6364            .wrap::<_, _>(self)
6365    }
6366
6367    /// Get instance's global settings for repositories
6368    pub fn get_general_repository_settings(
6369        &self,
6370    ) -> Request<'_, endpoints::GetGeneralRepositorySettings, GeneralRepoSettings> {
6371        endpoints::GetGeneralRepositorySettings {}
6372            .make_request()
6373            .wrap::<_, _>(self)
6374    }
6375
6376    /// Get instance's global settings for ui
6377    pub fn get_general_ui_settings(
6378        &self,
6379    ) -> Request<'_, endpoints::GetGeneralUiSettings, GeneralUISettings> {
6380        endpoints::GetGeneralUiSettings {}
6381            .make_request()
6382            .wrap::<_, _>(self)
6383    }
6384
6385    /// Get default signing-key.gpg
6386    pub fn get_signing_key(&self) -> Request<'_, endpoints::GetSigningKey, String> {
6387        endpoints::GetSigningKey {}
6388            .make_request()
6389            .wrap::<_, _>(self)
6390    }
6391
6392    /// Get default signing-key.ssh
6393    pub fn get_ssh_signing_key(&self) -> Request<'_, endpoints::GetSshSigningKey, String> {
6394        endpoints::GetSshSigningKey {}
6395            .make_request()
6396            .wrap::<_, _>(self)
6397    }
6398
6399    /// Get a team
6400    ///
6401    /// - `id`: id of the team to get
6402    pub fn org_get_team(&self, id: i64) -> Request<'_, endpoints::OrgGetTeam, Team> {
6403        endpoints::OrgGetTeam { id }
6404            .make_request()
6405            .wrap::<_, _>(self)
6406    }
6407
6408    /// Delete a team
6409    ///
6410    /// - `id`: id of the team to delete
6411    pub fn org_delete_team(&self, id: i64) -> Request<'_, endpoints::OrgDeleteTeam, ()> {
6412        endpoints::OrgDeleteTeam { id }
6413            .make_request()
6414            .wrap::<_, _>(self)
6415    }
6416
6417    /// Edit a team
6418    ///
6419    /// - `id`: id of the team to edit
6420    /// - `body`: See [`EditTeamOption`]
6421    pub fn org_edit_team(
6422        &self,
6423        id: i64,
6424        body: EditTeamOption,
6425    ) -> Request<'_, endpoints::OrgEditTeam, Team> {
6426        endpoints::OrgEditTeam { id, body: body }
6427            .make_request()
6428            .wrap::<_, _>(self)
6429    }
6430
6431    /// List a team's activity feeds
6432    ///
6433    /// - `id`: id of the team
6434    pub fn org_list_team_activity_feeds(
6435        &self,
6436        id: i64,
6437        query: OrgListTeamActivityFeedsQuery,
6438    ) -> Request<'_, endpoints::OrgListTeamActivityFeeds, (ActivityFeedsListHeaders, Vec<Activity>)>
6439    {
6440        endpoints::OrgListTeamActivityFeeds { id, query }
6441            .make_request()
6442            .wrap::<_, _>(self)
6443    }
6444
6445    /// List a team's members
6446    ///
6447    /// - `id`: id of the team
6448    pub fn org_list_team_members(
6449        &self,
6450        id: i64,
6451    ) -> Request<'_, endpoints::OrgListTeamMembers, (UserListHeaders, Vec<User>)> {
6452        endpoints::OrgListTeamMembers { id }
6453            .make_request()
6454            .wrap::<_, _>(self)
6455    }
6456
6457    /// List a particular member of team
6458    ///
6459    /// - `id`: id of the team
6460    /// - `username`: username of the member to list
6461    pub fn org_list_team_member(
6462        &self,
6463        id: i64,
6464        username: &str,
6465    ) -> Request<'_, endpoints::OrgListTeamMember<'_>, User> {
6466        endpoints::OrgListTeamMember { id, username }
6467            .make_request()
6468            .wrap::<_, _>(self)
6469    }
6470
6471    /// Add a team member
6472    ///
6473    /// - `id`: id of the team
6474    /// - `username`: username of the user to add
6475    pub fn org_add_team_member(
6476        &self,
6477        id: i64,
6478        username: &str,
6479    ) -> Request<'_, endpoints::OrgAddTeamMember<'_>, ()> {
6480        endpoints::OrgAddTeamMember { id, username }
6481            .make_request()
6482            .wrap::<_, _>(self)
6483    }
6484
6485    /// Remove a team member
6486    ///
6487    /// - `id`: id of the team
6488    /// - `username`: username of the user to remove
6489    pub fn org_remove_team_member(
6490        &self,
6491        id: i64,
6492        username: &str,
6493    ) -> Request<'_, endpoints::OrgRemoveTeamMember<'_>, ()> {
6494        endpoints::OrgRemoveTeamMember { id, username }
6495            .make_request()
6496            .wrap::<_, _>(self)
6497    }
6498
6499    /// List a team's repos
6500    ///
6501    /// - `id`: id of the team
6502    pub fn org_list_team_repos(
6503        &self,
6504        id: i64,
6505    ) -> Request<'_, endpoints::OrgListTeamRepos, (RepositoryListHeaders, Vec<Repository>)> {
6506        endpoints::OrgListTeamRepos { id }
6507            .make_request()
6508            .wrap::<_, _>(self)
6509    }
6510
6511    /// List a particular repo of team
6512    ///
6513    /// - `id`: id of the team
6514    /// - `org`: organization that owns the repo to list
6515    /// - `repo`: name of the repo to list
6516    pub fn org_list_team_repo(
6517        &self,
6518        id: i64,
6519        org: &str,
6520        repo: &str,
6521    ) -> Request<'_, endpoints::OrgListTeamRepo<'_>, Repository> {
6522        endpoints::OrgListTeamRepo { id, org, repo }
6523            .make_request()
6524            .wrap::<_, _>(self)
6525    }
6526
6527    /// Add a repository to a team
6528    ///
6529    /// - `id`: id of the team
6530    /// - `org`: organization that owns the repo to add
6531    /// - `repo`: name of the repo to add
6532    pub fn org_add_team_repository(
6533        &self,
6534        id: i64,
6535        org: &str,
6536        repo: &str,
6537    ) -> Request<'_, endpoints::OrgAddTeamRepository<'_>, ()> {
6538        endpoints::OrgAddTeamRepository { id, org, repo }
6539            .make_request()
6540            .wrap::<_, _>(self)
6541    }
6542
6543    /// Remove a repository from a team
6544    ///
6545    /// - `id`: id of the team
6546    /// - `org`: organization that owns the repo to remove
6547    /// - `repo`: name of the repo to remove
6548    pub fn org_remove_team_repository(
6549        &self,
6550        id: i64,
6551        org: &str,
6552        repo: &str,
6553    ) -> Request<'_, endpoints::OrgRemoveTeamRepository<'_>, ()> {
6554        endpoints::OrgRemoveTeamRepository { id, org, repo }
6555            .make_request()
6556            .wrap::<_, _>(self)
6557    }
6558
6559    /// Search for topics by keyword
6560    ///
6561    pub fn topic_search(
6562        &self,
6563        query: TopicSearchQuery,
6564    ) -> Request<'_, endpoints::TopicSearch, TopicSearchResults> {
6565        endpoints::TopicSearch { query }
6566            .make_request()
6567            .wrap::<_, _>(self)
6568    }
6569
6570    /// Get the authenticated user
6571    pub fn user_get_current(&self) -> Request<'_, endpoints::UserGetCurrent, User> {
6572        endpoints::UserGetCurrent {}
6573            .make_request()
6574            .wrap::<_, _>(self)
6575    }
6576
6577    /// Search for user's action jobs according filter conditions
6578    ///
6579    pub fn user_search_run_jobs(
6580        &self,
6581        query: UserSearchRunJobsQuery,
6582    ) -> Request<'_, endpoints::UserSearchRunJobs, Vec<ActionRunJob>> {
6583        endpoints::UserSearchRunJobs { query }
6584            .make_request()
6585            .wrap::<_, _>(self)
6586    }
6587
6588    /// Get an user's actions runner registration token
6589    pub fn user_get_runner_registration_token(
6590        &self,
6591    ) -> Request<'_, endpoints::UserGetRunnerRegistrationToken, RegistrationToken> {
6592        endpoints::UserGetRunnerRegistrationToken {}
6593            .make_request()
6594            .wrap::<_, _>(self)
6595    }
6596
6597    /// Create or Update a secret value in a user scope
6598    ///
6599    /// - `secretname`: name of the secret
6600    /// - `body`: See [`CreateOrUpdateSecretOption`]
6601    pub fn update_user_secret(
6602        &self,
6603        secretname: &str,
6604        body: CreateOrUpdateSecretOption,
6605    ) -> Request<'_, endpoints::UpdateUserSecret<'_>, ()> {
6606        endpoints::UpdateUserSecret {
6607            secretname,
6608            body: body,
6609        }
6610        .make_request()
6611        .wrap::<_, _>(self)
6612    }
6613
6614    /// Delete a secret in a user scope
6615    ///
6616    /// - `secretname`: name of the secret
6617    pub fn delete_user_secret(
6618        &self,
6619        secretname: &str,
6620    ) -> Request<'_, endpoints::DeleteUserSecret<'_>, ()> {
6621        endpoints::DeleteUserSecret { secretname }
6622            .make_request()
6623            .wrap::<_, _>(self)
6624    }
6625
6626    /// Get the user-level list of variables which is created by current doer
6627    ///
6628    pub fn get_user_variables_list(
6629        &self,
6630    ) -> Request<'_, endpoints::GetUserVariablesList, (VariableListHeaders, Vec<ActionVariable>)>
6631    {
6632        endpoints::GetUserVariablesList {}
6633            .make_request()
6634            .wrap::<_, _>(self)
6635    }
6636
6637    /// Get a user-level variable which is created by current doer
6638    ///
6639    /// - `variablename`: name of the variable
6640    pub fn get_user_variable(
6641        &self,
6642        variablename: &str,
6643    ) -> Request<'_, endpoints::GetUserVariable<'_>, ActionVariable> {
6644        endpoints::GetUserVariable { variablename }
6645            .make_request()
6646            .wrap::<_, _>(self)
6647    }
6648
6649    /// Update a user-level variable which is created by current doer
6650    ///
6651    /// - `variablename`: name of the variable
6652    /// - `body`: See [`UpdateVariableOption`]
6653    pub fn update_user_variable(
6654        &self,
6655        variablename: &str,
6656        body: UpdateVariableOption,
6657    ) -> Request<'_, endpoints::UpdateUserVariable<'_>, ()> {
6658        endpoints::UpdateUserVariable {
6659            variablename,
6660            body: body,
6661        }
6662        .make_request()
6663        .wrap::<_, _>(self)
6664    }
6665
6666    /// Create a user-level variable
6667    ///
6668    /// - `variablename`: name of the variable
6669    /// - `body`: See [`CreateVariableOption`]
6670    pub fn create_user_variable(
6671        &self,
6672        variablename: &str,
6673        body: CreateVariableOption,
6674    ) -> Request<'_, endpoints::CreateUserVariable<'_>, ()> {
6675        endpoints::CreateUserVariable {
6676            variablename,
6677            body: body,
6678        }
6679        .make_request()
6680        .wrap::<_, _>(self)
6681    }
6682
6683    /// Delete a user-level variable which is created by current doer
6684    ///
6685    /// - `variablename`: name of the variable
6686    pub fn delete_user_variable(
6687        &self,
6688        variablename: &str,
6689    ) -> Request<'_, endpoints::DeleteUserVariable<'_>, ()> {
6690        endpoints::DeleteUserVariable { variablename }
6691            .make_request()
6692            .wrap::<_, _>(self)
6693    }
6694
6695    /// List the authenticated user's oauth2 applications
6696    ///
6697    pub fn user_get_oauth2_applications(
6698        &self,
6699    ) -> Request<
6700        '_,
6701        endpoints::UserGetOAuth2Applications,
6702        (OAuth2ApplicationListHeaders, Vec<OAuth2Application>),
6703    > {
6704        endpoints::UserGetOAuth2Applications {}
6705            .make_request()
6706            .wrap::<_, _>(self)
6707    }
6708
6709    /// Creates a new OAuth2 application
6710    ///
6711    /// - `body`: See [`CreateOAuth2ApplicationOptions`]
6712    pub fn user_create_oauth2_application(
6713        &self,
6714        body: CreateOAuth2ApplicationOptions,
6715    ) -> Request<'_, endpoints::UserCreateOAuth2Application, OAuth2Application> {
6716        endpoints::UserCreateOAuth2Application { body: body }
6717            .make_request()
6718            .wrap::<_, _>(self)
6719    }
6720
6721    /// Get an OAuth2 application
6722    ///
6723    /// - `id`: Application ID to be found
6724    pub fn user_get_oauth2_application(
6725        &self,
6726        id: i64,
6727    ) -> Request<'_, endpoints::UserGetOAuth2Application, OAuth2Application> {
6728        endpoints::UserGetOAuth2Application { id }
6729            .make_request()
6730            .wrap::<_, _>(self)
6731    }
6732
6733    /// Delete an OAuth2 application
6734    ///
6735    /// - `id`: token to be deleted
6736    pub fn user_delete_oauth2_application(
6737        &self,
6738        id: i64,
6739    ) -> Request<'_, endpoints::UserDeleteOAuth2Application, ()> {
6740        endpoints::UserDeleteOAuth2Application { id }
6741            .make_request()
6742            .wrap::<_, _>(self)
6743    }
6744
6745    /// Update an OAuth2 application, this includes regenerating the client secret
6746    ///
6747    /// - `id`: application to be updated
6748    /// - `body`: See [`CreateOAuth2ApplicationOptions`]
6749    pub fn user_update_oauth2_application(
6750        &self,
6751        id: i64,
6752        body: CreateOAuth2ApplicationOptions,
6753    ) -> Request<'_, endpoints::UserUpdateOAuth2Application, OAuth2Application> {
6754        endpoints::UserUpdateOAuth2Application { id, body: body }
6755            .make_request()
6756            .wrap::<_, _>(self)
6757    }
6758
6759    /// Update avatar of the current user
6760    ///
6761    /// - `body`: See [`UpdateUserAvatarOption`]
6762    pub fn user_update_avatar(
6763        &self,
6764        body: UpdateUserAvatarOption,
6765    ) -> Request<'_, endpoints::UserUpdateAvatar, ()> {
6766        endpoints::UserUpdateAvatar { body: body }
6767            .make_request()
6768            .wrap::<_, _>(self)
6769    }
6770
6771    /// Delete avatar of the current user. It will be replaced by a default one
6772    pub fn user_delete_avatar(&self) -> Request<'_, endpoints::UserDeleteAvatar, ()> {
6773        endpoints::UserDeleteAvatar {}
6774            .make_request()
6775            .wrap::<_, _>(self)
6776    }
6777
6778    /// Blocks a user from the doer
6779    ///
6780    /// - `username`: username of the user
6781    pub fn user_block_user(&self, username: &str) -> Request<'_, endpoints::UserBlockUser<'_>, ()> {
6782        endpoints::UserBlockUser { username }
6783            .make_request()
6784            .wrap::<_, _>(self)
6785    }
6786
6787    /// List all email addresses of the current user
6788    pub fn user_list_emails(&self) -> Request<'_, endpoints::UserListEmails, Vec<Email>> {
6789        endpoints::UserListEmails {}
6790            .make_request()
6791            .wrap::<_, _>(self)
6792    }
6793
6794    /// Add an email addresses to the current user's account
6795    ///
6796    /// - `body`: See [`CreateEmailOption`]
6797    pub fn user_add_email(
6798        &self,
6799        body: CreateEmailOption,
6800    ) -> Request<'_, endpoints::UserAddEmail, Vec<Email>> {
6801        endpoints::UserAddEmail { body: body }
6802            .make_request()
6803            .wrap::<_, _>(self)
6804    }
6805
6806    /// Delete email addresses from the current user's account
6807    ///
6808    /// - `body`: See [`DeleteEmailOption`]
6809    pub fn user_delete_email(
6810        &self,
6811        body: DeleteEmailOption,
6812    ) -> Request<'_, endpoints::UserDeleteEmail, ()> {
6813        endpoints::UserDeleteEmail { body: body }
6814            .make_request()
6815            .wrap::<_, _>(self)
6816    }
6817
6818    /// List the authenticated user's followers
6819    ///
6820    pub fn user_current_list_followers(
6821        &self,
6822    ) -> Request<'_, endpoints::UserCurrentListFollowers, (UserListHeaders, Vec<User>)> {
6823        endpoints::UserCurrentListFollowers {}
6824            .make_request()
6825            .wrap::<_, _>(self)
6826    }
6827
6828    /// List the users that the authenticated user is following
6829    ///
6830    pub fn user_current_list_following(
6831        &self,
6832    ) -> Request<'_, endpoints::UserCurrentListFollowing, (UserListHeaders, Vec<User>)> {
6833        endpoints::UserCurrentListFollowing {}
6834            .make_request()
6835            .wrap::<_, _>(self)
6836    }
6837
6838    /// Check whether a user is followed by the authenticated user
6839    ///
6840    /// - `username`: username of followed user
6841    pub fn user_current_check_following(
6842        &self,
6843        username: &str,
6844    ) -> Request<'_, endpoints::UserCurrentCheckFollowing<'_>, ()> {
6845        endpoints::UserCurrentCheckFollowing { username }
6846            .make_request()
6847            .wrap::<_, _>(self)
6848    }
6849
6850    /// Follow a user
6851    ///
6852    /// - `username`: username of user to follow
6853    pub fn user_current_put_follow(
6854        &self,
6855        username: &str,
6856    ) -> Request<'_, endpoints::UserCurrentPutFollow<'_>, ()> {
6857        endpoints::UserCurrentPutFollow { username }
6858            .make_request()
6859            .wrap::<_, _>(self)
6860    }
6861
6862    /// Unfollow a user
6863    ///
6864    /// - `username`: username of user to unfollow
6865    pub fn user_current_delete_follow(
6866        &self,
6867        username: &str,
6868    ) -> Request<'_, endpoints::UserCurrentDeleteFollow<'_>, ()> {
6869        endpoints::UserCurrentDeleteFollow { username }
6870            .make_request()
6871            .wrap::<_, _>(self)
6872    }
6873
6874    /// Get a Token to verify
6875    pub fn get_verification_token(&self) -> Request<'_, endpoints::GetVerificationToken, String> {
6876        endpoints::GetVerificationToken {}
6877            .make_request()
6878            .wrap::<_, _>(self)
6879    }
6880
6881    /// Verify a GPG key
6882    ///
6883    /// - `body`: See [`VerifyGPGKeyOption`]
6884    pub fn user_verify_gpg_key(
6885        &self,
6886        body: VerifyGPGKeyOption,
6887    ) -> Request<'_, endpoints::UserVerifyGpgKey, GPGKey> {
6888        endpoints::UserVerifyGpgKey { body: body }
6889            .make_request()
6890            .wrap::<_, _>(self)
6891    }
6892
6893    /// List the authenticated user's GPG keys
6894    ///
6895    pub fn user_current_list_gpg_keys(
6896        &self,
6897    ) -> Request<'_, endpoints::UserCurrentListGpgKeys, (GpgKeyListHeaders, Vec<GPGKey>)> {
6898        endpoints::UserCurrentListGpgKeys {}
6899            .make_request()
6900            .wrap::<_, _>(self)
6901    }
6902
6903    /// Add a GPG public key to current user's account
6904    ///
6905    /// - `Form`: See [`CreateGPGKeyOption`]
6906    pub fn user_current_post_gpg_key(
6907        &self,
6908        form: CreateGPGKeyOption,
6909    ) -> Request<'_, endpoints::UserCurrentPostGpgKey, GPGKey> {
6910        endpoints::UserCurrentPostGpgKey { body: form }
6911            .make_request()
6912            .wrap::<_, _>(self)
6913    }
6914
6915    /// Get a GPG key
6916    ///
6917    /// - `id`: id of key to get
6918    pub fn user_current_get_gpg_key(
6919        &self,
6920        id: i64,
6921    ) -> Request<'_, endpoints::UserCurrentGetGpgKey, GPGKey> {
6922        endpoints::UserCurrentGetGpgKey { id }
6923            .make_request()
6924            .wrap::<_, _>(self)
6925    }
6926
6927    /// Remove a GPG public key from current user's account
6928    ///
6929    /// - `id`: id of key to delete
6930    pub fn user_current_delete_gpg_key(
6931        &self,
6932        id: i64,
6933    ) -> Request<'_, endpoints::UserCurrentDeleteGpgKey, ()> {
6934        endpoints::UserCurrentDeleteGpgKey { id }
6935            .make_request()
6936            .wrap::<_, _>(self)
6937    }
6938
6939    /// List the authenticated user's webhooks
6940    ///
6941    pub fn user_list_hooks(
6942        &self,
6943    ) -> Request<'_, endpoints::UserListHooks, (HookListHeaders, Vec<Hook>)> {
6944        endpoints::UserListHooks {}
6945            .make_request()
6946            .wrap::<_, _>(self)
6947    }
6948
6949    /// Create a hook
6950    ///
6951    /// - `body`: See [`CreateHookOption`]
6952    pub fn user_create_hook(
6953        &self,
6954        body: CreateHookOption,
6955    ) -> Request<'_, endpoints::UserCreateHook, Hook> {
6956        endpoints::UserCreateHook { body: body }
6957            .make_request()
6958            .wrap::<_, _>(self)
6959    }
6960
6961    /// Get a hook
6962    ///
6963    /// - `id`: id of the hook to get
6964    pub fn user_get_hook(&self, id: i64) -> Request<'_, endpoints::UserGetHook, Hook> {
6965        endpoints::UserGetHook { id }
6966            .make_request()
6967            .wrap::<_, _>(self)
6968    }
6969
6970    /// Delete a hook
6971    ///
6972    /// - `id`: id of the hook to delete
6973    pub fn user_delete_hook(&self, id: i64) -> Request<'_, endpoints::UserDeleteHook, ()> {
6974        endpoints::UserDeleteHook { id }
6975            .make_request()
6976            .wrap::<_, _>(self)
6977    }
6978
6979    /// Update a hook
6980    ///
6981    /// - `id`: id of the hook to update
6982    /// - `body`: See [`EditHookOption`]
6983    pub fn user_edit_hook(
6984        &self,
6985        id: i64,
6986        body: EditHookOption,
6987    ) -> Request<'_, endpoints::UserEditHook, Hook> {
6988        endpoints::UserEditHook { id, body: body }
6989            .make_request()
6990            .wrap::<_, _>(self)
6991    }
6992
6993    /// List the authenticated user's public keys
6994    ///
6995    pub fn user_current_list_keys(
6996        &self,
6997        query: UserCurrentListKeysQuery,
6998    ) -> Request<'_, endpoints::UserCurrentListKeys, (PublicKeyListHeaders, Vec<PublicKey>)> {
6999        endpoints::UserCurrentListKeys { query }
7000            .make_request()
7001            .wrap::<_, _>(self)
7002    }
7003
7004    /// Create a public key
7005    ///
7006    /// - `body`: See [`CreateKeyOption`]
7007    pub fn user_current_post_key(
7008        &self,
7009        body: CreateKeyOption,
7010    ) -> Request<'_, endpoints::UserCurrentPostKey, PublicKey> {
7011        endpoints::UserCurrentPostKey { body: body }
7012            .make_request()
7013            .wrap::<_, _>(self)
7014    }
7015
7016    /// Get a public key
7017    ///
7018    /// - `id`: id of key to get
7019    pub fn user_current_get_key(
7020        &self,
7021        id: i64,
7022    ) -> Request<'_, endpoints::UserCurrentGetKey, PublicKey> {
7023        endpoints::UserCurrentGetKey { id }
7024            .make_request()
7025            .wrap::<_, _>(self)
7026    }
7027
7028    /// Delete a public key
7029    ///
7030    /// - `id`: id of key to delete
7031    pub fn user_current_delete_key(
7032        &self,
7033        id: i64,
7034    ) -> Request<'_, endpoints::UserCurrentDeleteKey, ()> {
7035        endpoints::UserCurrentDeleteKey { id }
7036            .make_request()
7037            .wrap::<_, _>(self)
7038    }
7039
7040    /// List the authenticated user's blocked users
7041    ///
7042    pub fn user_list_blocked_users(
7043        &self,
7044    ) -> Request<'_, endpoints::UserListBlockedUsers, (BlockedUserListHeaders, Vec<BlockedUser>)>
7045    {
7046        endpoints::UserListBlockedUsers {}
7047            .make_request()
7048            .wrap::<_, _>(self)
7049    }
7050
7051    /// List the current user's organizations
7052    ///
7053    pub fn org_list_current_user_orgs(
7054        &self,
7055    ) -> Request<'_, endpoints::OrgListCurrentUserOrgs, (OrganizationListHeaders, Vec<Organization>)>
7056    {
7057        endpoints::OrgListCurrentUserOrgs {}
7058            .make_request()
7059            .wrap::<_, _>(self)
7060    }
7061
7062    /// Get quota information for the authenticated user
7063    pub fn user_get_quota(&self) -> Request<'_, endpoints::UserGetQuota, QuotaInfo> {
7064        endpoints::UserGetQuota {}.make_request().wrap::<_, _>(self)
7065    }
7066
7067    /// List the artifacts affecting the authenticated user's quota
7068    ///
7069    pub fn user_list_quota_artifacts(
7070        &self,
7071    ) -> Request<
7072        '_,
7073        endpoints::UserListQuotaArtifacts,
7074        (QuotaUsedArtifactListHeaders, Vec<QuotaUsedArtifact>),
7075    > {
7076        endpoints::UserListQuotaArtifacts {}
7077            .make_request()
7078            .wrap::<_, _>(self)
7079    }
7080
7081    /// List the attachments affecting the authenticated user's quota
7082    ///
7083    pub fn user_list_quota_attachments(
7084        &self,
7085    ) -> Request<
7086        '_,
7087        endpoints::UserListQuotaAttachments,
7088        (QuotaUsedAttachmentListHeaders, Vec<QuotaUsedAttachment>),
7089    > {
7090        endpoints::UserListQuotaAttachments {}
7091            .make_request()
7092            .wrap::<_, _>(self)
7093    }
7094
7095    /// Check if the authenticated user is over quota for a given subject
7096    ///
7097    pub fn user_check_quota(
7098        &self,
7099        query: UserCheckQuotaQuery,
7100    ) -> Request<'_, endpoints::UserCheckQuota, bool> {
7101        endpoints::UserCheckQuota { query }
7102            .make_request()
7103            .wrap::<_, _>(self)
7104    }
7105
7106    /// List the packages affecting the authenticated user's quota
7107    ///
7108    pub fn user_list_quota_packages(
7109        &self,
7110    ) -> Request<
7111        '_,
7112        endpoints::UserListQuotaPackages,
7113        (QuotaUsedPackageListHeaders, Vec<QuotaUsedPackage>),
7114    > {
7115        endpoints::UserListQuotaPackages {}
7116            .make_request()
7117            .wrap::<_, _>(self)
7118    }
7119
7120    /// List the repos that the authenticated user owns
7121    ///
7122    pub fn user_current_list_repos(
7123        &self,
7124        query: UserCurrentListReposQuery,
7125    ) -> Request<'_, endpoints::UserCurrentListRepos, (RepositoryListHeaders, Vec<Repository>)>
7126    {
7127        endpoints::UserCurrentListRepos { query }
7128            .make_request()
7129            .wrap::<_, _>(self)
7130    }
7131
7132    /// Create a repository
7133    ///
7134    /// - `body`: See [`CreateRepoOption`]
7135    pub fn create_current_user_repo(
7136        &self,
7137        body: CreateRepoOption,
7138    ) -> Request<'_, endpoints::CreateCurrentUserRepo, Repository> {
7139        endpoints::CreateCurrentUserRepo { body: body }
7140            .make_request()
7141            .wrap::<_, _>(self)
7142    }
7143
7144    /// Get current user's account settings
7145    pub fn get_user_settings(&self) -> Request<'_, endpoints::GetUserSettings, UserSettings> {
7146        endpoints::GetUserSettings {}
7147            .make_request()
7148            .wrap::<_, _>(self)
7149    }
7150
7151    /// Update settings in current user's account
7152    ///
7153    /// - `body`: See [`UserSettingsOptions`]
7154    pub fn update_user_settings(
7155        &self,
7156        body: UserSettingsOptions,
7157    ) -> Request<'_, endpoints::UpdateUserSettings, UserSettings> {
7158        endpoints::UpdateUserSettings { body: body }
7159            .make_request()
7160            .wrap::<_, _>(self)
7161    }
7162
7163    /// The repos that the authenticated user has starred
7164    ///
7165    pub fn user_current_list_starred(
7166        &self,
7167    ) -> Request<'_, endpoints::UserCurrentListStarred, (RepositoryListHeaders, Vec<Repository>)>
7168    {
7169        endpoints::UserCurrentListStarred {}
7170            .make_request()
7171            .wrap::<_, _>(self)
7172    }
7173
7174    /// Whether the authenticated is starring the repo
7175    ///
7176    /// - `owner`: owner of the repo
7177    /// - `repo`: name of the repo
7178    pub fn user_current_check_starring(
7179        &self,
7180        owner: &str,
7181        repo: &str,
7182    ) -> Request<'_, endpoints::UserCurrentCheckStarring<'_>, ()> {
7183        endpoints::UserCurrentCheckStarring { owner, repo }
7184            .make_request()
7185            .wrap::<_, _>(self)
7186    }
7187
7188    /// Star the given repo
7189    ///
7190    /// - `owner`: owner of the repo to star
7191    /// - `repo`: name of the repo to star
7192    pub fn user_current_put_star(
7193        &self,
7194        owner: &str,
7195        repo: &str,
7196    ) -> Request<'_, endpoints::UserCurrentPutStar<'_>, ()> {
7197        endpoints::UserCurrentPutStar { owner, repo }
7198            .make_request()
7199            .wrap::<_, _>(self)
7200    }
7201
7202    /// Unstar the given repo
7203    ///
7204    /// - `owner`: owner of the repo to unstar
7205    /// - `repo`: name of the repo to unstar
7206    pub fn user_current_delete_star(
7207        &self,
7208        owner: &str,
7209        repo: &str,
7210    ) -> Request<'_, endpoints::UserCurrentDeleteStar<'_>, ()> {
7211        endpoints::UserCurrentDeleteStar { owner, repo }
7212            .make_request()
7213            .wrap::<_, _>(self)
7214    }
7215
7216    /// Get list of all existing stopwatches
7217    ///
7218    pub fn user_get_stop_watches(
7219        &self,
7220    ) -> Request<'_, endpoints::UserGetStopWatches, (StopWatchListHeaders, Vec<StopWatch>)> {
7221        endpoints::UserGetStopWatches {}
7222            .make_request()
7223            .wrap::<_, _>(self)
7224    }
7225
7226    /// List repositories watched by the authenticated user
7227    ///
7228    pub fn user_current_list_subscriptions(
7229        &self,
7230    ) -> Request<
7231        '_,
7232        endpoints::UserCurrentListSubscriptions,
7233        (RepositoryListHeaders, Vec<Repository>),
7234    > {
7235        endpoints::UserCurrentListSubscriptions {}
7236            .make_request()
7237            .wrap::<_, _>(self)
7238    }
7239
7240    /// List all the teams a user belongs to
7241    ///
7242    pub fn user_list_teams(
7243        &self,
7244    ) -> Request<'_, endpoints::UserListTeams, (TeamListHeaders, Vec<Team>)> {
7245        endpoints::UserListTeams {}
7246            .make_request()
7247            .wrap::<_, _>(self)
7248    }
7249
7250    /// List the current user's tracked times
7251    ///
7252    pub fn user_current_tracked_times(
7253        &self,
7254        query: UserCurrentTrackedTimesQuery,
7255    ) -> Request<'_, endpoints::UserCurrentTrackedTimes, (TrackedTimeListHeaders, Vec<TrackedTime>)>
7256    {
7257        endpoints::UserCurrentTrackedTimes { query }
7258            .make_request()
7259            .wrap::<_, _>(self)
7260    }
7261
7262    /// Unblocks a user from the doer
7263    ///
7264    /// - `username`: username of the user
7265    pub fn user_unblock_user(
7266        &self,
7267        username: &str,
7268    ) -> Request<'_, endpoints::UserUnblockUser<'_>, ()> {
7269        endpoints::UserUnblockUser { username }
7270            .make_request()
7271            .wrap::<_, _>(self)
7272    }
7273
7274    /// Search for users
7275    ///
7276    pub fn user_search(
7277        &self,
7278        query: UserSearchQuery,
7279    ) -> Request<'_, endpoints::UserSearch, UserSearchResults> {
7280        endpoints::UserSearch { query }
7281            .make_request()
7282            .wrap::<_, _>(self)
7283    }
7284
7285    /// Get a user
7286    ///
7287    /// - `username`: username of user to get
7288    pub fn user_get(&self, username: &str) -> Request<'_, endpoints::UserGet<'_>, User> {
7289        endpoints::UserGet { username }
7290            .make_request()
7291            .wrap::<_, _>(self)
7292    }
7293
7294    /// List a user's activity feeds
7295    ///
7296    /// - `username`: username of user
7297    pub fn user_list_activity_feeds(
7298        &self,
7299        username: &str,
7300        query: UserListActivityFeedsQuery,
7301    ) -> Request<'_, endpoints::UserListActivityFeeds<'_>, (ActivityFeedsListHeaders, Vec<Activity>)>
7302    {
7303        endpoints::UserListActivityFeeds { username, query }
7304            .make_request()
7305            .wrap::<_, _>(self)
7306    }
7307
7308    /// List the given user's followers
7309    ///
7310    /// - `username`: username of user
7311    pub fn user_list_followers(
7312        &self,
7313        username: &str,
7314    ) -> Request<'_, endpoints::UserListFollowers<'_>, (UserListHeaders, Vec<User>)> {
7315        endpoints::UserListFollowers { username }
7316            .make_request()
7317            .wrap::<_, _>(self)
7318    }
7319
7320    /// List the users that the given user is following
7321    ///
7322    /// - `username`: username of user
7323    pub fn user_list_following(
7324        &self,
7325        username: &str,
7326    ) -> Request<'_, endpoints::UserListFollowing<'_>, (UserListHeaders, Vec<User>)> {
7327        endpoints::UserListFollowing { username }
7328            .make_request()
7329            .wrap::<_, _>(self)
7330    }
7331
7332    /// Check if one user is following another user
7333    ///
7334    /// - `username`: username of following user
7335    /// - `target`: username of followed user
7336    pub fn user_check_following(
7337        &self,
7338        username: &str,
7339        target: &str,
7340    ) -> Request<'_, endpoints::UserCheckFollowing<'_>, ()> {
7341        endpoints::UserCheckFollowing { username, target }
7342            .make_request()
7343            .wrap::<_, _>(self)
7344    }
7345
7346    /// List the given user's GPG keys
7347    ///
7348    /// - `username`: username of user
7349    pub fn user_list_gpg_keys(
7350        &self,
7351        username: &str,
7352    ) -> Request<'_, endpoints::UserListGpgKeys<'_>, (GpgKeyListHeaders, Vec<GPGKey>)> {
7353        endpoints::UserListGpgKeys { username }
7354            .make_request()
7355            .wrap::<_, _>(self)
7356    }
7357
7358    /// Get a user's heatmap
7359    ///
7360    /// - `username`: username of user to get
7361    pub fn user_get_heatmap_data(
7362        &self,
7363        username: &str,
7364    ) -> Request<'_, endpoints::UserGetHeatmapData<'_>, Vec<UserHeatmapData>> {
7365        endpoints::UserGetHeatmapData { username }
7366            .make_request()
7367            .wrap::<_, _>(self)
7368    }
7369
7370    /// List the given user's public keys
7371    ///
7372    /// - `username`: username of user
7373    pub fn user_list_keys(
7374        &self,
7375        username: &str,
7376        query: UserListKeysQuery,
7377    ) -> Request<'_, endpoints::UserListKeys<'_>, (PublicKeyListHeaders, Vec<PublicKey>)> {
7378        endpoints::UserListKeys { username, query }
7379            .make_request()
7380            .wrap::<_, _>(self)
7381    }
7382
7383    /// List a user's organizations
7384    ///
7385    /// - `username`: username of user
7386    pub fn org_list_user_orgs(
7387        &self,
7388        username: &str,
7389    ) -> Request<'_, endpoints::OrgListUserOrgs<'_>, (OrganizationListHeaders, Vec<Organization>)>
7390    {
7391        endpoints::OrgListUserOrgs { username }
7392            .make_request()
7393            .wrap::<_, _>(self)
7394    }
7395
7396    /// Get user permissions in organization
7397    ///
7398    /// - `username`: username of user
7399    /// - `org`: name of the organization
7400    pub fn org_get_user_permissions(
7401        &self,
7402        username: &str,
7403        org: &str,
7404    ) -> Request<'_, endpoints::OrgGetUserPermissions<'_>, OrganizationPermissions> {
7405        endpoints::OrgGetUserPermissions { username, org }
7406            .make_request()
7407            .wrap::<_, _>(self)
7408    }
7409
7410    /// List the repos owned by the given user
7411    ///
7412    /// - `username`: username of user
7413    pub fn user_list_repos(
7414        &self,
7415        username: &str,
7416    ) -> Request<'_, endpoints::UserListRepos<'_>, (RepositoryListHeaders, Vec<Repository>)> {
7417        endpoints::UserListRepos { username }
7418            .make_request()
7419            .wrap::<_, _>(self)
7420    }
7421
7422    /// The repos that the given user has starred
7423    ///
7424    /// - `username`: username of user
7425    pub fn user_list_starred(
7426        &self,
7427        username: &str,
7428    ) -> Request<'_, endpoints::UserListStarred<'_>, (RepositoryListHeaders, Vec<Repository>)> {
7429        endpoints::UserListStarred { username }
7430            .make_request()
7431            .wrap::<_, _>(self)
7432    }
7433
7434    /// List the repositories watched by a user
7435    ///
7436    /// - `username`: username of the user
7437    pub fn user_list_subscriptions(
7438        &self,
7439        username: &str,
7440    ) -> Request<'_, endpoints::UserListSubscriptions<'_>, (RepositoryListHeaders, Vec<Repository>)>
7441    {
7442        endpoints::UserListSubscriptions { username }
7443            .make_request()
7444            .wrap::<_, _>(self)
7445    }
7446
7447    /// List the authenticated user's access tokens
7448    ///
7449    /// - `username`: username of user
7450    pub fn user_get_tokens(
7451        &self,
7452        username: &str,
7453    ) -> Request<'_, endpoints::UserGetTokens<'_>, (AccessTokenListHeaders, Vec<AccessToken>)> {
7454        endpoints::UserGetTokens { username }
7455            .make_request()
7456            .wrap::<_, _>(self)
7457    }
7458
7459    /// Generate an access token for the current user
7460    ///
7461    /// - `username`: username of user
7462    /// - `body`: See [`CreateAccessTokenOption`]
7463    pub fn user_create_token(
7464        &self,
7465        username: &str,
7466        body: CreateAccessTokenOption,
7467    ) -> Request<'_, endpoints::UserCreateToken<'_>, AccessToken> {
7468        endpoints::UserCreateToken {
7469            username,
7470            body: body,
7471        }
7472        .make_request()
7473        .wrap::<_, _>(self)
7474    }
7475
7476    /// Delete an access token from current user's account
7477    ///
7478    /// - `username`: username of user
7479    /// - `token`: token to be deleted, identified by ID and if not available by name
7480    pub fn user_delete_access_token(
7481        &self,
7482        username: &str,
7483        token: &str,
7484    ) -> Request<'_, endpoints::UserDeleteAccessToken<'_>, ()> {
7485        endpoints::UserDeleteAccessToken { username, token }
7486            .make_request()
7487            .wrap::<_, _>(self)
7488    }
7489
7490    /// Returns the version of the running application
7491    pub fn get_version(&self) -> Request<'_, endpoints::GetVersion, ServerVersion> {
7492        endpoints::GetVersion {}.make_request().wrap::<_, _>(self)
7493    }
7494}