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