Skip to main content

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