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