openapi_github/apis/
repos_api.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`repos_slash_accept_invitation_for_authenticated_user`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum ReposSlashAcceptInvitationForAuthenticatedUserError {
22    Status403(models::BasicError),
23    Status404(models::BasicError),
24    Status409(models::BasicError),
25    UnknownValue(serde_json::Value),
26}
27
28/// struct for typed errors of method [`repos_slash_add_app_access_restrictions`]
29#[derive(Debug, Clone, Serialize, Deserialize)]
30#[serde(untagged)]
31pub enum ReposSlashAddAppAccessRestrictionsError {
32    Status422(models::ValidationError),
33    UnknownValue(serde_json::Value),
34}
35
36/// struct for typed errors of method [`repos_slash_add_collaborator`]
37#[derive(Debug, Clone, Serialize, Deserialize)]
38#[serde(untagged)]
39pub enum ReposSlashAddCollaboratorError {
40    Status403(models::BasicError),
41    Status422(models::ValidationError),
42    UnknownValue(serde_json::Value),
43}
44
45/// struct for typed errors of method [`repos_slash_add_status_check_contexts`]
46#[derive(Debug, Clone, Serialize, Deserialize)]
47#[serde(untagged)]
48pub enum ReposSlashAddStatusCheckContextsError {
49    Status403(models::BasicError),
50    Status404(models::BasicError),
51    Status422(models::ValidationError),
52    UnknownValue(serde_json::Value),
53}
54
55/// struct for typed errors of method [`repos_slash_add_team_access_restrictions`]
56#[derive(Debug, Clone, Serialize, Deserialize)]
57#[serde(untagged)]
58pub enum ReposSlashAddTeamAccessRestrictionsError {
59    Status422(models::ValidationError),
60    UnknownValue(serde_json::Value),
61}
62
63/// struct for typed errors of method [`repos_slash_add_user_access_restrictions`]
64#[derive(Debug, Clone, Serialize, Deserialize)]
65#[serde(untagged)]
66pub enum ReposSlashAddUserAccessRestrictionsError {
67    Status422(models::ValidationError),
68    UnknownValue(serde_json::Value),
69}
70
71/// struct for typed errors of method [`repos_slash_cancel_pages_deployment`]
72#[derive(Debug, Clone, Serialize, Deserialize)]
73#[serde(untagged)]
74pub enum ReposSlashCancelPagesDeploymentError {
75    Status404(models::BasicError),
76    UnknownValue(serde_json::Value),
77}
78
79/// struct for typed errors of method [`repos_slash_check_automated_security_fixes`]
80#[derive(Debug, Clone, Serialize, Deserialize)]
81#[serde(untagged)]
82pub enum ReposSlashCheckAutomatedSecurityFixesError {
83    Status404(),
84    UnknownValue(serde_json::Value),
85}
86
87/// struct for typed errors of method [`repos_slash_check_collaborator`]
88#[derive(Debug, Clone, Serialize, Deserialize)]
89#[serde(untagged)]
90pub enum ReposSlashCheckCollaboratorError {
91    Status404(),
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`repos_slash_check_private_vulnerability_reporting`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum ReposSlashCheckPrivateVulnerabilityReportingError {
99    Status422(models::BasicError),
100    UnknownValue(serde_json::Value),
101}
102
103/// struct for typed errors of method [`repos_slash_check_vulnerability_alerts`]
104#[derive(Debug, Clone, Serialize, Deserialize)]
105#[serde(untagged)]
106pub enum ReposSlashCheckVulnerabilityAlertsError {
107    Status404(),
108    UnknownValue(serde_json::Value),
109}
110
111/// struct for typed errors of method [`repos_slash_codeowners_errors`]
112#[derive(Debug, Clone, Serialize, Deserialize)]
113#[serde(untagged)]
114pub enum ReposSlashCodeownersErrorsError {
115    Status404(),
116    UnknownValue(serde_json::Value),
117}
118
119/// struct for typed errors of method [`repos_slash_compare_commits`]
120#[derive(Debug, Clone, Serialize, Deserialize)]
121#[serde(untagged)]
122pub enum ReposSlashCompareCommitsError {
123    Status404(models::BasicError),
124    Status500(models::BasicError),
125    UnknownValue(serde_json::Value),
126}
127
128/// struct for typed errors of method [`repos_slash_compare_commits_with_basehead`]
129#[derive(Debug, Clone, Serialize, Deserialize)]
130#[serde(untagged)]
131pub enum ReposSlashCompareCommitsWithBaseheadError {
132    Status404(models::BasicError),
133    Status500(models::BasicError),
134    Status503(models::SecretScanningListAlertsForEnterprise503Response),
135    UnknownValue(serde_json::Value),
136}
137
138/// struct for typed errors of method [`repos_slash_create_autolink`]
139#[derive(Debug, Clone, Serialize, Deserialize)]
140#[serde(untagged)]
141pub enum ReposSlashCreateAutolinkError {
142    Status422(models::ValidationError),
143    UnknownValue(serde_json::Value),
144}
145
146/// struct for typed errors of method [`repos_slash_create_commit_comment`]
147#[derive(Debug, Clone, Serialize, Deserialize)]
148#[serde(untagged)]
149pub enum ReposSlashCreateCommitCommentError {
150    Status403(models::BasicError),
151    Status422(models::ValidationError),
152    UnknownValue(serde_json::Value),
153}
154
155/// struct for typed errors of method [`repos_slash_create_commit_signature_protection`]
156#[derive(Debug, Clone, Serialize, Deserialize)]
157#[serde(untagged)]
158pub enum ReposSlashCreateCommitSignatureProtectionError {
159    Status404(models::BasicError),
160    UnknownValue(serde_json::Value),
161}
162
163/// struct for typed errors of method [`repos_slash_create_commit_status`]
164#[derive(Debug, Clone, Serialize, Deserialize)]
165#[serde(untagged)]
166pub enum ReposSlashCreateCommitStatusError {
167    UnknownValue(serde_json::Value),
168}
169
170/// struct for typed errors of method [`repos_slash_create_deploy_key`]
171#[derive(Debug, Clone, Serialize, Deserialize)]
172#[serde(untagged)]
173pub enum ReposSlashCreateDeployKeyError {
174    Status422(models::ValidationError),
175    UnknownValue(serde_json::Value),
176}
177
178/// struct for typed errors of method [`repos_slash_create_deployment`]
179#[derive(Debug, Clone, Serialize, Deserialize)]
180#[serde(untagged)]
181pub enum ReposSlashCreateDeploymentError {
182    Status409(),
183    Status422(models::ValidationError),
184    UnknownValue(serde_json::Value),
185}
186
187/// struct for typed errors of method [`repos_slash_create_deployment_branch_policy`]
188#[derive(Debug, Clone, Serialize, Deserialize)]
189#[serde(untagged)]
190pub enum ReposSlashCreateDeploymentBranchPolicyError {
191    Status404(),
192    UnknownValue(serde_json::Value),
193}
194
195/// struct for typed errors of method [`repos_slash_create_deployment_protection_rule`]
196#[derive(Debug, Clone, Serialize, Deserialize)]
197#[serde(untagged)]
198pub enum ReposSlashCreateDeploymentProtectionRuleError {
199    UnknownValue(serde_json::Value),
200}
201
202/// struct for typed errors of method [`repos_slash_create_deployment_status`]
203#[derive(Debug, Clone, Serialize, Deserialize)]
204#[serde(untagged)]
205pub enum ReposSlashCreateDeploymentStatusError {
206    Status422(models::ValidationError),
207    UnknownValue(serde_json::Value),
208}
209
210/// struct for typed errors of method [`repos_slash_create_dispatch_event`]
211#[derive(Debug, Clone, Serialize, Deserialize)]
212#[serde(untagged)]
213pub enum ReposSlashCreateDispatchEventError {
214    Status404(models::BasicError),
215    Status422(models::ValidationError),
216    UnknownValue(serde_json::Value),
217}
218
219/// struct for typed errors of method [`repos_slash_create_for_authenticated_user`]
220#[derive(Debug, Clone, Serialize, Deserialize)]
221#[serde(untagged)]
222pub enum ReposSlashCreateForAuthenticatedUserError {
223    Status400(models::BasicError),
224    Status401(models::BasicError),
225    Status403(models::BasicError),
226    Status404(models::BasicError),
227    Status422(models::ValidationError),
228    UnknownValue(serde_json::Value),
229}
230
231/// struct for typed errors of method [`repos_slash_create_fork`]
232#[derive(Debug, Clone, Serialize, Deserialize)]
233#[serde(untagged)]
234pub enum ReposSlashCreateForkError {
235    Status400(models::BasicError),
236    Status403(models::BasicError),
237    Status404(models::BasicError),
238    Status422(models::ValidationError),
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`repos_slash_create_in_org`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum ReposSlashCreateInOrgError {
246    Status403(models::BasicError),
247    Status422(models::ValidationError),
248    UnknownValue(serde_json::Value),
249}
250
251/// struct for typed errors of method [`repos_slash_create_or_update_custom_properties_values`]
252#[derive(Debug, Clone, Serialize, Deserialize)]
253#[serde(untagged)]
254pub enum ReposSlashCreateOrUpdateCustomPropertiesValuesError {
255    Status403(models::BasicError),
256    Status404(models::BasicError),
257    Status422(models::ValidationError),
258    UnknownValue(serde_json::Value),
259}
260
261/// struct for typed errors of method [`repos_slash_create_or_update_environment`]
262#[derive(Debug, Clone, Serialize, Deserialize)]
263#[serde(untagged)]
264pub enum ReposSlashCreateOrUpdateEnvironmentError {
265    Status422(models::BasicError),
266    UnknownValue(serde_json::Value),
267}
268
269/// struct for typed errors of method [`repos_slash_create_or_update_file_contents`]
270#[derive(Debug, Clone, Serialize, Deserialize)]
271#[serde(untagged)]
272pub enum ReposSlashCreateOrUpdateFileContentsError {
273    Status404(models::BasicError),
274    Status409(models::BasicError),
275    Status422(models::ValidationError),
276    UnknownValue(serde_json::Value),
277}
278
279/// struct for typed errors of method [`repos_slash_create_org_ruleset`]
280#[derive(Debug, Clone, Serialize, Deserialize)]
281#[serde(untagged)]
282pub enum ReposSlashCreateOrgRulesetError {
283    Status404(models::BasicError),
284    Status500(models::BasicError),
285    UnknownValue(serde_json::Value),
286}
287
288/// struct for typed errors of method [`repos_slash_create_pages_deployment`]
289#[derive(Debug, Clone, Serialize, Deserialize)]
290#[serde(untagged)]
291pub enum ReposSlashCreatePagesDeploymentError {
292    Status400(models::BasicError),
293    Status404(models::BasicError),
294    Status422(models::ValidationError),
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`repos_slash_create_pages_site`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum ReposSlashCreatePagesSiteError {
302    Status409(models::BasicError),
303    Status422(models::ValidationError),
304    UnknownValue(serde_json::Value),
305}
306
307/// struct for typed errors of method [`repos_slash_create_release`]
308#[derive(Debug, Clone, Serialize, Deserialize)]
309#[serde(untagged)]
310pub enum ReposSlashCreateReleaseError {
311    Status404(models::BasicError),
312    Status422(models::ValidationError),
313    UnknownValue(serde_json::Value),
314}
315
316/// struct for typed errors of method [`repos_slash_create_repo_ruleset`]
317#[derive(Debug, Clone, Serialize, Deserialize)]
318#[serde(untagged)]
319pub enum ReposSlashCreateRepoRulesetError {
320    Status404(models::BasicError),
321    Status500(models::BasicError),
322    UnknownValue(serde_json::Value),
323}
324
325/// struct for typed errors of method [`repos_slash_create_tag_protection`]
326#[derive(Debug, Clone, Serialize, Deserialize)]
327#[serde(untagged)]
328pub enum ReposSlashCreateTagProtectionError {
329    Status403(models::BasicError),
330    Status404(models::BasicError),
331    UnknownValue(serde_json::Value),
332}
333
334/// struct for typed errors of method [`repos_slash_create_using_template`]
335#[derive(Debug, Clone, Serialize, Deserialize)]
336#[serde(untagged)]
337pub enum ReposSlashCreateUsingTemplateError {
338    UnknownValue(serde_json::Value),
339}
340
341/// struct for typed errors of method [`repos_slash_create_webhook`]
342#[derive(Debug, Clone, Serialize, Deserialize)]
343#[serde(untagged)]
344pub enum ReposSlashCreateWebhookError {
345    Status403(models::BasicError),
346    Status404(models::BasicError),
347    Status422(models::ValidationError),
348    UnknownValue(serde_json::Value),
349}
350
351/// struct for typed errors of method [`repos_slash_decline_invitation_for_authenticated_user`]
352#[derive(Debug, Clone, Serialize, Deserialize)]
353#[serde(untagged)]
354pub enum ReposSlashDeclineInvitationForAuthenticatedUserError {
355    Status403(models::BasicError),
356    Status404(models::BasicError),
357    Status409(models::BasicError),
358    UnknownValue(serde_json::Value),
359}
360
361/// struct for typed errors of method [`repos_slash_delete`]
362#[derive(Debug, Clone, Serialize, Deserialize)]
363#[serde(untagged)]
364pub enum ReposSlashDeleteError {
365    Status403(models::OrgsRemoveOutsideCollaborator422Response),
366    Status404(models::BasicError),
367    UnknownValue(serde_json::Value),
368}
369
370/// struct for typed errors of method [`repos_slash_delete_access_restrictions`]
371#[derive(Debug, Clone, Serialize, Deserialize)]
372#[serde(untagged)]
373pub enum ReposSlashDeleteAccessRestrictionsError {
374    UnknownValue(serde_json::Value),
375}
376
377/// struct for typed errors of method [`repos_slash_delete_admin_branch_protection`]
378#[derive(Debug, Clone, Serialize, Deserialize)]
379#[serde(untagged)]
380pub enum ReposSlashDeleteAdminBranchProtectionError {
381    Status404(models::BasicError),
382    UnknownValue(serde_json::Value),
383}
384
385/// struct for typed errors of method [`repos_slash_delete_an_environment`]
386#[derive(Debug, Clone, Serialize, Deserialize)]
387#[serde(untagged)]
388pub enum ReposSlashDeleteAnEnvironmentError {
389    UnknownValue(serde_json::Value),
390}
391
392/// struct for typed errors of method [`repos_slash_delete_autolink`]
393#[derive(Debug, Clone, Serialize, Deserialize)]
394#[serde(untagged)]
395pub enum ReposSlashDeleteAutolinkError {
396    Status404(models::BasicError),
397    UnknownValue(serde_json::Value),
398}
399
400/// struct for typed errors of method [`repos_slash_delete_branch_protection`]
401#[derive(Debug, Clone, Serialize, Deserialize)]
402#[serde(untagged)]
403pub enum ReposSlashDeleteBranchProtectionError {
404    Status403(models::BasicError),
405    UnknownValue(serde_json::Value),
406}
407
408/// struct for typed errors of method [`repos_slash_delete_commit_comment`]
409#[derive(Debug, Clone, Serialize, Deserialize)]
410#[serde(untagged)]
411pub enum ReposSlashDeleteCommitCommentError {
412    Status404(models::BasicError),
413    UnknownValue(serde_json::Value),
414}
415
416/// struct for typed errors of method [`repos_slash_delete_commit_signature_protection`]
417#[derive(Debug, Clone, Serialize, Deserialize)]
418#[serde(untagged)]
419pub enum ReposSlashDeleteCommitSignatureProtectionError {
420    Status404(models::BasicError),
421    UnknownValue(serde_json::Value),
422}
423
424/// struct for typed errors of method [`repos_slash_delete_deploy_key`]
425#[derive(Debug, Clone, Serialize, Deserialize)]
426#[serde(untagged)]
427pub enum ReposSlashDeleteDeployKeyError {
428    UnknownValue(serde_json::Value),
429}
430
431/// struct for typed errors of method [`repos_slash_delete_deployment`]
432#[derive(Debug, Clone, Serialize, Deserialize)]
433#[serde(untagged)]
434pub enum ReposSlashDeleteDeploymentError {
435    Status404(models::BasicError),
436    Status422(models::ValidationErrorSimple),
437    UnknownValue(serde_json::Value),
438}
439
440/// struct for typed errors of method [`repos_slash_delete_deployment_branch_policy`]
441#[derive(Debug, Clone, Serialize, Deserialize)]
442#[serde(untagged)]
443pub enum ReposSlashDeleteDeploymentBranchPolicyError {
444    UnknownValue(serde_json::Value),
445}
446
447/// struct for typed errors of method [`repos_slash_delete_file`]
448#[derive(Debug, Clone, Serialize, Deserialize)]
449#[serde(untagged)]
450pub enum ReposSlashDeleteFileError {
451    Status404(models::BasicError),
452    Status409(models::BasicError),
453    Status422(models::ValidationError),
454    Status503(models::SecretScanningListAlertsForEnterprise503Response),
455    UnknownValue(serde_json::Value),
456}
457
458/// struct for typed errors of method [`repos_slash_delete_invitation`]
459#[derive(Debug, Clone, Serialize, Deserialize)]
460#[serde(untagged)]
461pub enum ReposSlashDeleteInvitationError {
462    UnknownValue(serde_json::Value),
463}
464
465/// struct for typed errors of method [`repos_slash_delete_org_ruleset`]
466#[derive(Debug, Clone, Serialize, Deserialize)]
467#[serde(untagged)]
468pub enum ReposSlashDeleteOrgRulesetError {
469    Status404(models::BasicError),
470    Status500(models::BasicError),
471    UnknownValue(serde_json::Value),
472}
473
474/// struct for typed errors of method [`repos_slash_delete_pages_site`]
475#[derive(Debug, Clone, Serialize, Deserialize)]
476#[serde(untagged)]
477pub enum ReposSlashDeletePagesSiteError {
478    Status404(models::BasicError),
479    Status409(models::BasicError),
480    Status422(models::ValidationError),
481    UnknownValue(serde_json::Value),
482}
483
484/// struct for typed errors of method [`repos_slash_delete_pull_request_review_protection`]
485#[derive(Debug, Clone, Serialize, Deserialize)]
486#[serde(untagged)]
487pub enum ReposSlashDeletePullRequestReviewProtectionError {
488    Status404(models::BasicError),
489    UnknownValue(serde_json::Value),
490}
491
492/// struct for typed errors of method [`repos_slash_delete_release`]
493#[derive(Debug, Clone, Serialize, Deserialize)]
494#[serde(untagged)]
495pub enum ReposSlashDeleteReleaseError {
496    UnknownValue(serde_json::Value),
497}
498
499/// struct for typed errors of method [`repos_slash_delete_release_asset`]
500#[derive(Debug, Clone, Serialize, Deserialize)]
501#[serde(untagged)]
502pub enum ReposSlashDeleteReleaseAssetError {
503    UnknownValue(serde_json::Value),
504}
505
506/// struct for typed errors of method [`repos_slash_delete_repo_ruleset`]
507#[derive(Debug, Clone, Serialize, Deserialize)]
508#[serde(untagged)]
509pub enum ReposSlashDeleteRepoRulesetError {
510    Status404(models::BasicError),
511    Status500(models::BasicError),
512    UnknownValue(serde_json::Value),
513}
514
515/// struct for typed errors of method [`repos_slash_delete_tag_protection`]
516#[derive(Debug, Clone, Serialize, Deserialize)]
517#[serde(untagged)]
518pub enum ReposSlashDeleteTagProtectionError {
519    Status403(models::BasicError),
520    Status404(models::BasicError),
521    UnknownValue(serde_json::Value),
522}
523
524/// struct for typed errors of method [`repos_slash_delete_webhook`]
525#[derive(Debug, Clone, Serialize, Deserialize)]
526#[serde(untagged)]
527pub enum ReposSlashDeleteWebhookError {
528    Status404(models::BasicError),
529    UnknownValue(serde_json::Value),
530}
531
532/// struct for typed errors of method [`repos_slash_disable_automated_security_fixes`]
533#[derive(Debug, Clone, Serialize, Deserialize)]
534#[serde(untagged)]
535pub enum ReposSlashDisableAutomatedSecurityFixesError {
536    UnknownValue(serde_json::Value),
537}
538
539/// struct for typed errors of method [`repos_slash_disable_deployment_protection_rule`]
540#[derive(Debug, Clone, Serialize, Deserialize)]
541#[serde(untagged)]
542pub enum ReposSlashDisableDeploymentProtectionRuleError {
543    UnknownValue(serde_json::Value),
544}
545
546/// struct for typed errors of method [`repos_slash_disable_private_vulnerability_reporting`]
547#[derive(Debug, Clone, Serialize, Deserialize)]
548#[serde(untagged)]
549pub enum ReposSlashDisablePrivateVulnerabilityReportingError {
550    Status422(models::BasicError),
551    UnknownValue(serde_json::Value),
552}
553
554/// struct for typed errors of method [`repos_slash_disable_vulnerability_alerts`]
555#[derive(Debug, Clone, Serialize, Deserialize)]
556#[serde(untagged)]
557pub enum ReposSlashDisableVulnerabilityAlertsError {
558    UnknownValue(serde_json::Value),
559}
560
561/// struct for typed errors of method [`repos_slash_download_tarball_archive`]
562#[derive(Debug, Clone, Serialize, Deserialize)]
563#[serde(untagged)]
564pub enum ReposSlashDownloadTarballArchiveError {
565    UnknownValue(serde_json::Value),
566}
567
568/// struct for typed errors of method [`repos_slash_download_zipball_archive`]
569#[derive(Debug, Clone, Serialize, Deserialize)]
570#[serde(untagged)]
571pub enum ReposSlashDownloadZipballArchiveError {
572    UnknownValue(serde_json::Value),
573}
574
575/// struct for typed errors of method [`repos_slash_enable_automated_security_fixes`]
576#[derive(Debug, Clone, Serialize, Deserialize)]
577#[serde(untagged)]
578pub enum ReposSlashEnableAutomatedSecurityFixesError {
579    UnknownValue(serde_json::Value),
580}
581
582/// struct for typed errors of method [`repos_slash_enable_private_vulnerability_reporting`]
583#[derive(Debug, Clone, Serialize, Deserialize)]
584#[serde(untagged)]
585pub enum ReposSlashEnablePrivateVulnerabilityReportingError {
586    Status422(models::BasicError),
587    UnknownValue(serde_json::Value),
588}
589
590/// struct for typed errors of method [`repos_slash_enable_vulnerability_alerts`]
591#[derive(Debug, Clone, Serialize, Deserialize)]
592#[serde(untagged)]
593pub enum ReposSlashEnableVulnerabilityAlertsError {
594    UnknownValue(serde_json::Value),
595}
596
597/// struct for typed errors of method [`repos_slash_generate_release_notes`]
598#[derive(Debug, Clone, Serialize, Deserialize)]
599#[serde(untagged)]
600pub enum ReposSlashGenerateReleaseNotesError {
601    Status404(models::BasicError),
602    UnknownValue(serde_json::Value),
603}
604
605/// struct for typed errors of method [`repos_slash_get`]
606#[derive(Debug, Clone, Serialize, Deserialize)]
607#[serde(untagged)]
608pub enum ReposSlashGetError {
609    Status403(models::BasicError),
610    Status404(models::BasicError),
611    UnknownValue(serde_json::Value),
612}
613
614/// struct for typed errors of method [`repos_slash_get_access_restrictions`]
615#[derive(Debug, Clone, Serialize, Deserialize)]
616#[serde(untagged)]
617pub enum ReposSlashGetAccessRestrictionsError {
618    Status404(models::BasicError),
619    UnknownValue(serde_json::Value),
620}
621
622/// struct for typed errors of method [`repos_slash_get_admin_branch_protection`]
623#[derive(Debug, Clone, Serialize, Deserialize)]
624#[serde(untagged)]
625pub enum ReposSlashGetAdminBranchProtectionError {
626    UnknownValue(serde_json::Value),
627}
628
629/// struct for typed errors of method [`repos_slash_get_all_deployment_protection_rules`]
630#[derive(Debug, Clone, Serialize, Deserialize)]
631#[serde(untagged)]
632pub enum ReposSlashGetAllDeploymentProtectionRulesError {
633    UnknownValue(serde_json::Value),
634}
635
636/// struct for typed errors of method [`repos_slash_get_all_environments`]
637#[derive(Debug, Clone, Serialize, Deserialize)]
638#[serde(untagged)]
639pub enum ReposSlashGetAllEnvironmentsError {
640    UnknownValue(serde_json::Value),
641}
642
643/// struct for typed errors of method [`repos_slash_get_all_status_check_contexts`]
644#[derive(Debug, Clone, Serialize, Deserialize)]
645#[serde(untagged)]
646pub enum ReposSlashGetAllStatusCheckContextsError {
647    Status404(models::BasicError),
648    UnknownValue(serde_json::Value),
649}
650
651/// struct for typed errors of method [`repos_slash_get_all_topics`]
652#[derive(Debug, Clone, Serialize, Deserialize)]
653#[serde(untagged)]
654pub enum ReposSlashGetAllTopicsError {
655    Status404(models::BasicError),
656    UnknownValue(serde_json::Value),
657}
658
659/// struct for typed errors of method [`repos_slash_get_apps_with_access_to_protected_branch`]
660#[derive(Debug, Clone, Serialize, Deserialize)]
661#[serde(untagged)]
662pub enum ReposSlashGetAppsWithAccessToProtectedBranchError {
663    Status404(models::BasicError),
664    UnknownValue(serde_json::Value),
665}
666
667/// struct for typed errors of method [`repos_slash_get_autolink`]
668#[derive(Debug, Clone, Serialize, Deserialize)]
669#[serde(untagged)]
670pub enum ReposSlashGetAutolinkError {
671    Status404(models::BasicError),
672    UnknownValue(serde_json::Value),
673}
674
675/// struct for typed errors of method [`repos_slash_get_branch`]
676#[derive(Debug, Clone, Serialize, Deserialize)]
677#[serde(untagged)]
678pub enum ReposSlashGetBranchError {
679    Status404(models::BasicError),
680    UnknownValue(serde_json::Value),
681}
682
683/// struct for typed errors of method [`repos_slash_get_branch_protection`]
684#[derive(Debug, Clone, Serialize, Deserialize)]
685#[serde(untagged)]
686pub enum ReposSlashGetBranchProtectionError {
687    Status404(models::BasicError),
688    UnknownValue(serde_json::Value),
689}
690
691/// struct for typed errors of method [`repos_slash_get_branch_rules`]
692#[derive(Debug, Clone, Serialize, Deserialize)]
693#[serde(untagged)]
694pub enum ReposSlashGetBranchRulesError {
695    UnknownValue(serde_json::Value),
696}
697
698/// struct for typed errors of method [`repos_slash_get_clones`]
699#[derive(Debug, Clone, Serialize, Deserialize)]
700#[serde(untagged)]
701pub enum ReposSlashGetClonesError {
702    Status403(models::BasicError),
703    UnknownValue(serde_json::Value),
704}
705
706/// struct for typed errors of method [`repos_slash_get_code_frequency_stats`]
707#[derive(Debug, Clone, Serialize, Deserialize)]
708#[serde(untagged)]
709pub enum ReposSlashGetCodeFrequencyStatsError {
710    Status422(),
711    UnknownValue(serde_json::Value),
712}
713
714/// struct for typed errors of method [`repos_slash_get_collaborator_permission_level`]
715#[derive(Debug, Clone, Serialize, Deserialize)]
716#[serde(untagged)]
717pub enum ReposSlashGetCollaboratorPermissionLevelError {
718    Status404(models::BasicError),
719    UnknownValue(serde_json::Value),
720}
721
722/// struct for typed errors of method [`repos_slash_get_combined_status_for_ref`]
723#[derive(Debug, Clone, Serialize, Deserialize)]
724#[serde(untagged)]
725pub enum ReposSlashGetCombinedStatusForRefError {
726    Status404(models::BasicError),
727    UnknownValue(serde_json::Value),
728}
729
730/// struct for typed errors of method [`repos_slash_get_commit`]
731#[derive(Debug, Clone, Serialize, Deserialize)]
732#[serde(untagged)]
733pub enum ReposSlashGetCommitError {
734    Status404(models::BasicError),
735    Status409(models::BasicError),
736    Status422(models::ValidationError),
737    Status500(models::BasicError),
738    Status503(models::SecretScanningListAlertsForEnterprise503Response),
739    UnknownValue(serde_json::Value),
740}
741
742/// struct for typed errors of method [`repos_slash_get_commit_activity_stats`]
743#[derive(Debug, Clone, Serialize, Deserialize)]
744#[serde(untagged)]
745pub enum ReposSlashGetCommitActivityStatsError {
746    UnknownValue(serde_json::Value),
747}
748
749/// struct for typed errors of method [`repos_slash_get_commit_comment`]
750#[derive(Debug, Clone, Serialize, Deserialize)]
751#[serde(untagged)]
752pub enum ReposSlashGetCommitCommentError {
753    Status404(models::BasicError),
754    UnknownValue(serde_json::Value),
755}
756
757/// struct for typed errors of method [`repos_slash_get_commit_signature_protection`]
758#[derive(Debug, Clone, Serialize, Deserialize)]
759#[serde(untagged)]
760pub enum ReposSlashGetCommitSignatureProtectionError {
761    Status404(models::BasicError),
762    UnknownValue(serde_json::Value),
763}
764
765/// struct for typed errors of method [`repos_slash_get_community_profile_metrics`]
766#[derive(Debug, Clone, Serialize, Deserialize)]
767#[serde(untagged)]
768pub enum ReposSlashGetCommunityProfileMetricsError {
769    UnknownValue(serde_json::Value),
770}
771
772/// struct for typed errors of method [`repos_slash_get_content`]
773#[derive(Debug, Clone, Serialize, Deserialize)]
774#[serde(untagged)]
775pub enum ReposSlashGetContentError {
776    Status403(models::BasicError),
777    Status404(models::BasicError),
778    UnknownValue(serde_json::Value),
779}
780
781/// struct for typed errors of method [`repos_slash_get_contributors_stats`]
782#[derive(Debug, Clone, Serialize, Deserialize)]
783#[serde(untagged)]
784pub enum ReposSlashGetContributorsStatsError {
785    UnknownValue(serde_json::Value),
786}
787
788/// struct for typed errors of method [`repos_slash_get_custom_deployment_protection_rule`]
789#[derive(Debug, Clone, Serialize, Deserialize)]
790#[serde(untagged)]
791pub enum ReposSlashGetCustomDeploymentProtectionRuleError {
792    UnknownValue(serde_json::Value),
793}
794
795/// struct for typed errors of method [`repos_slash_get_custom_properties_values`]
796#[derive(Debug, Clone, Serialize, Deserialize)]
797#[serde(untagged)]
798pub enum ReposSlashGetCustomPropertiesValuesError {
799    Status403(models::BasicError),
800    Status404(models::BasicError),
801    UnknownValue(serde_json::Value),
802}
803
804/// struct for typed errors of method [`repos_slash_get_deploy_key`]
805#[derive(Debug, Clone, Serialize, Deserialize)]
806#[serde(untagged)]
807pub enum ReposSlashGetDeployKeyError {
808    Status404(models::BasicError),
809    UnknownValue(serde_json::Value),
810}
811
812/// struct for typed errors of method [`repos_slash_get_deployment`]
813#[derive(Debug, Clone, Serialize, Deserialize)]
814#[serde(untagged)]
815pub enum ReposSlashGetDeploymentError {
816    Status404(models::BasicError),
817    UnknownValue(serde_json::Value),
818}
819
820/// struct for typed errors of method [`repos_slash_get_deployment_branch_policy`]
821#[derive(Debug, Clone, Serialize, Deserialize)]
822#[serde(untagged)]
823pub enum ReposSlashGetDeploymentBranchPolicyError {
824    UnknownValue(serde_json::Value),
825}
826
827/// struct for typed errors of method [`repos_slash_get_deployment_status`]
828#[derive(Debug, Clone, Serialize, Deserialize)]
829#[serde(untagged)]
830pub enum ReposSlashGetDeploymentStatusError {
831    Status404(models::BasicError),
832    UnknownValue(serde_json::Value),
833}
834
835/// struct for typed errors of method [`repos_slash_get_environment`]
836#[derive(Debug, Clone, Serialize, Deserialize)]
837#[serde(untagged)]
838pub enum ReposSlashGetEnvironmentError {
839    UnknownValue(serde_json::Value),
840}
841
842/// struct for typed errors of method [`repos_slash_get_latest_pages_build`]
843#[derive(Debug, Clone, Serialize, Deserialize)]
844#[serde(untagged)]
845pub enum ReposSlashGetLatestPagesBuildError {
846    UnknownValue(serde_json::Value),
847}
848
849/// struct for typed errors of method [`repos_slash_get_latest_release`]
850#[derive(Debug, Clone, Serialize, Deserialize)]
851#[serde(untagged)]
852pub enum ReposSlashGetLatestReleaseError {
853    UnknownValue(serde_json::Value),
854}
855
856/// struct for typed errors of method [`repos_slash_get_org_rule_suite`]
857#[derive(Debug, Clone, Serialize, Deserialize)]
858#[serde(untagged)]
859pub enum ReposSlashGetOrgRuleSuiteError {
860    Status404(models::BasicError),
861    Status500(models::BasicError),
862    UnknownValue(serde_json::Value),
863}
864
865/// struct for typed errors of method [`repos_slash_get_org_rule_suites`]
866#[derive(Debug, Clone, Serialize, Deserialize)]
867#[serde(untagged)]
868pub enum ReposSlashGetOrgRuleSuitesError {
869    Status404(models::BasicError),
870    Status500(models::BasicError),
871    UnknownValue(serde_json::Value),
872}
873
874/// struct for typed errors of method [`repos_slash_get_org_ruleset`]
875#[derive(Debug, Clone, Serialize, Deserialize)]
876#[serde(untagged)]
877pub enum ReposSlashGetOrgRulesetError {
878    Status404(models::BasicError),
879    Status500(models::BasicError),
880    UnknownValue(serde_json::Value),
881}
882
883/// struct for typed errors of method [`repos_slash_get_org_rulesets`]
884#[derive(Debug, Clone, Serialize, Deserialize)]
885#[serde(untagged)]
886pub enum ReposSlashGetOrgRulesetsError {
887    Status404(models::BasicError),
888    Status500(models::BasicError),
889    UnknownValue(serde_json::Value),
890}
891
892/// struct for typed errors of method [`repos_slash_get_pages`]
893#[derive(Debug, Clone, Serialize, Deserialize)]
894#[serde(untagged)]
895pub enum ReposSlashGetPagesError {
896    Status404(models::BasicError),
897    UnknownValue(serde_json::Value),
898}
899
900/// struct for typed errors of method [`repos_slash_get_pages_build`]
901#[derive(Debug, Clone, Serialize, Deserialize)]
902#[serde(untagged)]
903pub enum ReposSlashGetPagesBuildError {
904    UnknownValue(serde_json::Value),
905}
906
907/// struct for typed errors of method [`repos_slash_get_pages_deployment`]
908#[derive(Debug, Clone, Serialize, Deserialize)]
909#[serde(untagged)]
910pub enum ReposSlashGetPagesDeploymentError {
911    Status404(models::BasicError),
912    UnknownValue(serde_json::Value),
913}
914
915/// struct for typed errors of method [`repos_slash_get_pages_health_check`]
916#[derive(Debug, Clone, Serialize, Deserialize)]
917#[serde(untagged)]
918pub enum ReposSlashGetPagesHealthCheckError {
919    Status400(),
920    Status404(models::BasicError),
921    Status422(),
922    UnknownValue(serde_json::Value),
923}
924
925/// struct for typed errors of method [`repos_slash_get_participation_stats`]
926#[derive(Debug, Clone, Serialize, Deserialize)]
927#[serde(untagged)]
928pub enum ReposSlashGetParticipationStatsError {
929    Status404(models::BasicError),
930    UnknownValue(serde_json::Value),
931}
932
933/// struct for typed errors of method [`repos_slash_get_pull_request_review_protection`]
934#[derive(Debug, Clone, Serialize, Deserialize)]
935#[serde(untagged)]
936pub enum ReposSlashGetPullRequestReviewProtectionError {
937    UnknownValue(serde_json::Value),
938}
939
940/// struct for typed errors of method [`repos_slash_get_punch_card_stats`]
941#[derive(Debug, Clone, Serialize, Deserialize)]
942#[serde(untagged)]
943pub enum ReposSlashGetPunchCardStatsError {
944    UnknownValue(serde_json::Value),
945}
946
947/// struct for typed errors of method [`repos_slash_get_readme`]
948#[derive(Debug, Clone, Serialize, Deserialize)]
949#[serde(untagged)]
950pub enum ReposSlashGetReadmeError {
951    Status404(models::BasicError),
952    Status422(models::ValidationError),
953    UnknownValue(serde_json::Value),
954}
955
956/// struct for typed errors of method [`repos_slash_get_readme_in_directory`]
957#[derive(Debug, Clone, Serialize, Deserialize)]
958#[serde(untagged)]
959pub enum ReposSlashGetReadmeInDirectoryError {
960    Status404(models::BasicError),
961    Status422(models::ValidationError),
962    UnknownValue(serde_json::Value),
963}
964
965/// struct for typed errors of method [`repos_slash_get_release`]
966#[derive(Debug, Clone, Serialize, Deserialize)]
967#[serde(untagged)]
968pub enum ReposSlashGetReleaseError {
969    Status401(),
970    UnknownValue(serde_json::Value),
971}
972
973/// struct for typed errors of method [`repos_slash_get_release_asset`]
974#[derive(Debug, Clone, Serialize, Deserialize)]
975#[serde(untagged)]
976pub enum ReposSlashGetReleaseAssetError {
977    Status404(models::BasicError),
978    UnknownValue(serde_json::Value),
979}
980
981/// struct for typed errors of method [`repos_slash_get_release_by_tag`]
982#[derive(Debug, Clone, Serialize, Deserialize)]
983#[serde(untagged)]
984pub enum ReposSlashGetReleaseByTagError {
985    Status404(models::BasicError),
986    UnknownValue(serde_json::Value),
987}
988
989/// struct for typed errors of method [`repos_slash_get_repo_rule_suite`]
990#[derive(Debug, Clone, Serialize, Deserialize)]
991#[serde(untagged)]
992pub enum ReposSlashGetRepoRuleSuiteError {
993    Status404(models::BasicError),
994    Status500(models::BasicError),
995    UnknownValue(serde_json::Value),
996}
997
998/// struct for typed errors of method [`repos_slash_get_repo_rule_suites`]
999#[derive(Debug, Clone, Serialize, Deserialize)]
1000#[serde(untagged)]
1001pub enum ReposSlashGetRepoRuleSuitesError {
1002    Status404(models::BasicError),
1003    Status500(models::BasicError),
1004    UnknownValue(serde_json::Value),
1005}
1006
1007/// struct for typed errors of method [`repos_slash_get_repo_ruleset`]
1008#[derive(Debug, Clone, Serialize, Deserialize)]
1009#[serde(untagged)]
1010pub enum ReposSlashGetRepoRulesetError {
1011    Status404(models::BasicError),
1012    Status500(models::BasicError),
1013    UnknownValue(serde_json::Value),
1014}
1015
1016/// struct for typed errors of method [`repos_slash_get_repo_rulesets`]
1017#[derive(Debug, Clone, Serialize, Deserialize)]
1018#[serde(untagged)]
1019pub enum ReposSlashGetRepoRulesetsError {
1020    Status404(models::BasicError),
1021    Status500(models::BasicError),
1022    UnknownValue(serde_json::Value),
1023}
1024
1025/// struct for typed errors of method [`repos_slash_get_status_checks_protection`]
1026#[derive(Debug, Clone, Serialize, Deserialize)]
1027#[serde(untagged)]
1028pub enum ReposSlashGetStatusChecksProtectionError {
1029    Status404(models::BasicError),
1030    UnknownValue(serde_json::Value),
1031}
1032
1033/// struct for typed errors of method [`repos_slash_get_teams_with_access_to_protected_branch`]
1034#[derive(Debug, Clone, Serialize, Deserialize)]
1035#[serde(untagged)]
1036pub enum ReposSlashGetTeamsWithAccessToProtectedBranchError {
1037    Status404(models::BasicError),
1038    UnknownValue(serde_json::Value),
1039}
1040
1041/// struct for typed errors of method [`repos_slash_get_top_paths`]
1042#[derive(Debug, Clone, Serialize, Deserialize)]
1043#[serde(untagged)]
1044pub enum ReposSlashGetTopPathsError {
1045    Status403(models::BasicError),
1046    UnknownValue(serde_json::Value),
1047}
1048
1049/// struct for typed errors of method [`repos_slash_get_top_referrers`]
1050#[derive(Debug, Clone, Serialize, Deserialize)]
1051#[serde(untagged)]
1052pub enum ReposSlashGetTopReferrersError {
1053    Status403(models::BasicError),
1054    UnknownValue(serde_json::Value),
1055}
1056
1057/// struct for typed errors of method [`repos_slash_get_users_with_access_to_protected_branch`]
1058#[derive(Debug, Clone, Serialize, Deserialize)]
1059#[serde(untagged)]
1060pub enum ReposSlashGetUsersWithAccessToProtectedBranchError {
1061    Status404(models::BasicError),
1062    UnknownValue(serde_json::Value),
1063}
1064
1065/// struct for typed errors of method [`repos_slash_get_views`]
1066#[derive(Debug, Clone, Serialize, Deserialize)]
1067#[serde(untagged)]
1068pub enum ReposSlashGetViewsError {
1069    Status403(models::BasicError),
1070    UnknownValue(serde_json::Value),
1071}
1072
1073/// struct for typed errors of method [`repos_slash_get_webhook`]
1074#[derive(Debug, Clone, Serialize, Deserialize)]
1075#[serde(untagged)]
1076pub enum ReposSlashGetWebhookError {
1077    Status404(models::BasicError),
1078    UnknownValue(serde_json::Value),
1079}
1080
1081/// struct for typed errors of method [`repos_slash_get_webhook_config_for_repo`]
1082#[derive(Debug, Clone, Serialize, Deserialize)]
1083#[serde(untagged)]
1084pub enum ReposSlashGetWebhookConfigForRepoError {
1085    UnknownValue(serde_json::Value),
1086}
1087
1088/// struct for typed errors of method [`repos_slash_get_webhook_delivery`]
1089#[derive(Debug, Clone, Serialize, Deserialize)]
1090#[serde(untagged)]
1091pub enum ReposSlashGetWebhookDeliveryError {
1092    Status400(models::BasicError),
1093    Status422(models::ValidationError),
1094    UnknownValue(serde_json::Value),
1095}
1096
1097/// struct for typed errors of method [`repos_slash_list_activities`]
1098#[derive(Debug, Clone, Serialize, Deserialize)]
1099#[serde(untagged)]
1100pub enum ReposSlashListActivitiesError {
1101    Status422(models::ValidationErrorSimple),
1102    UnknownValue(serde_json::Value),
1103}
1104
1105/// struct for typed errors of method [`repos_slash_list_autolinks`]
1106#[derive(Debug, Clone, Serialize, Deserialize)]
1107#[serde(untagged)]
1108pub enum ReposSlashListAutolinksError {
1109    UnknownValue(serde_json::Value),
1110}
1111
1112/// struct for typed errors of method [`repos_slash_list_branches`]
1113#[derive(Debug, Clone, Serialize, Deserialize)]
1114#[serde(untagged)]
1115pub enum ReposSlashListBranchesError {
1116    Status404(models::BasicError),
1117    UnknownValue(serde_json::Value),
1118}
1119
1120/// struct for typed errors of method [`repos_slash_list_branches_for_head_commit`]
1121#[derive(Debug, Clone, Serialize, Deserialize)]
1122#[serde(untagged)]
1123pub enum ReposSlashListBranchesForHeadCommitError {
1124    Status409(models::BasicError),
1125    Status422(models::ValidationError),
1126    UnknownValue(serde_json::Value),
1127}
1128
1129/// struct for typed errors of method [`repos_slash_list_collaborators`]
1130#[derive(Debug, Clone, Serialize, Deserialize)]
1131#[serde(untagged)]
1132pub enum ReposSlashListCollaboratorsError {
1133    Status404(models::BasicError),
1134    UnknownValue(serde_json::Value),
1135}
1136
1137/// struct for typed errors of method [`repos_slash_list_comments_for_commit`]
1138#[derive(Debug, Clone, Serialize, Deserialize)]
1139#[serde(untagged)]
1140pub enum ReposSlashListCommentsForCommitError {
1141    UnknownValue(serde_json::Value),
1142}
1143
1144/// struct for typed errors of method [`repos_slash_list_commit_comments_for_repo`]
1145#[derive(Debug, Clone, Serialize, Deserialize)]
1146#[serde(untagged)]
1147pub enum ReposSlashListCommitCommentsForRepoError {
1148    UnknownValue(serde_json::Value),
1149}
1150
1151/// struct for typed errors of method [`repos_slash_list_commit_statuses_for_ref`]
1152#[derive(Debug, Clone, Serialize, Deserialize)]
1153#[serde(untagged)]
1154pub enum ReposSlashListCommitStatusesForRefError {
1155    UnknownValue(serde_json::Value),
1156}
1157
1158/// struct for typed errors of method [`repos_slash_list_commits`]
1159#[derive(Debug, Clone, Serialize, Deserialize)]
1160#[serde(untagged)]
1161pub enum ReposSlashListCommitsError {
1162    Status400(models::BasicError),
1163    Status404(models::BasicError),
1164    Status409(models::BasicError),
1165    Status500(models::BasicError),
1166    UnknownValue(serde_json::Value),
1167}
1168
1169/// struct for typed errors of method [`repos_slash_list_contributors`]
1170#[derive(Debug, Clone, Serialize, Deserialize)]
1171#[serde(untagged)]
1172pub enum ReposSlashListContributorsError {
1173    Status403(models::BasicError),
1174    Status404(models::BasicError),
1175    UnknownValue(serde_json::Value),
1176}
1177
1178/// struct for typed errors of method [`repos_slash_list_custom_deployment_rule_integrations`]
1179#[derive(Debug, Clone, Serialize, Deserialize)]
1180#[serde(untagged)]
1181pub enum ReposSlashListCustomDeploymentRuleIntegrationsError {
1182    UnknownValue(serde_json::Value),
1183}
1184
1185/// struct for typed errors of method [`repos_slash_list_deploy_keys`]
1186#[derive(Debug, Clone, Serialize, Deserialize)]
1187#[serde(untagged)]
1188pub enum ReposSlashListDeployKeysError {
1189    UnknownValue(serde_json::Value),
1190}
1191
1192/// struct for typed errors of method [`repos_slash_list_deployment_branch_policies`]
1193#[derive(Debug, Clone, Serialize, Deserialize)]
1194#[serde(untagged)]
1195pub enum ReposSlashListDeploymentBranchPoliciesError {
1196    UnknownValue(serde_json::Value),
1197}
1198
1199/// struct for typed errors of method [`repos_slash_list_deployment_statuses`]
1200#[derive(Debug, Clone, Serialize, Deserialize)]
1201#[serde(untagged)]
1202pub enum ReposSlashListDeploymentStatusesError {
1203    Status404(models::BasicError),
1204    UnknownValue(serde_json::Value),
1205}
1206
1207/// struct for typed errors of method [`repos_slash_list_deployments`]
1208#[derive(Debug, Clone, Serialize, Deserialize)]
1209#[serde(untagged)]
1210pub enum ReposSlashListDeploymentsError {
1211    UnknownValue(serde_json::Value),
1212}
1213
1214/// struct for typed errors of method [`repos_slash_list_for_authenticated_user`]
1215#[derive(Debug, Clone, Serialize, Deserialize)]
1216#[serde(untagged)]
1217pub enum ReposSlashListForAuthenticatedUserError {
1218    Status401(models::BasicError),
1219    Status403(models::BasicError),
1220    Status422(models::ValidationError),
1221    UnknownValue(serde_json::Value),
1222}
1223
1224/// struct for typed errors of method [`repos_slash_list_for_org`]
1225#[derive(Debug, Clone, Serialize, Deserialize)]
1226#[serde(untagged)]
1227pub enum ReposSlashListForOrgError {
1228    UnknownValue(serde_json::Value),
1229}
1230
1231/// struct for typed errors of method [`repos_slash_list_for_user`]
1232#[derive(Debug, Clone, Serialize, Deserialize)]
1233#[serde(untagged)]
1234pub enum ReposSlashListForUserError {
1235    UnknownValue(serde_json::Value),
1236}
1237
1238/// struct for typed errors of method [`repos_slash_list_forks`]
1239#[derive(Debug, Clone, Serialize, Deserialize)]
1240#[serde(untagged)]
1241pub enum ReposSlashListForksError {
1242    Status400(models::BasicError),
1243    UnknownValue(serde_json::Value),
1244}
1245
1246/// struct for typed errors of method [`repos_slash_list_invitations`]
1247#[derive(Debug, Clone, Serialize, Deserialize)]
1248#[serde(untagged)]
1249pub enum ReposSlashListInvitationsError {
1250    UnknownValue(serde_json::Value),
1251}
1252
1253/// struct for typed errors of method [`repos_slash_list_invitations_for_authenticated_user`]
1254#[derive(Debug, Clone, Serialize, Deserialize)]
1255#[serde(untagged)]
1256pub enum ReposSlashListInvitationsForAuthenticatedUserError {
1257    Status401(models::BasicError),
1258    Status403(models::BasicError),
1259    Status404(models::BasicError),
1260    UnknownValue(serde_json::Value),
1261}
1262
1263/// struct for typed errors of method [`repos_slash_list_languages`]
1264#[derive(Debug, Clone, Serialize, Deserialize)]
1265#[serde(untagged)]
1266pub enum ReposSlashListLanguagesError {
1267    UnknownValue(serde_json::Value),
1268}
1269
1270/// struct for typed errors of method [`repos_slash_list_pages_builds`]
1271#[derive(Debug, Clone, Serialize, Deserialize)]
1272#[serde(untagged)]
1273pub enum ReposSlashListPagesBuildsError {
1274    UnknownValue(serde_json::Value),
1275}
1276
1277/// struct for typed errors of method [`repos_slash_list_public`]
1278#[derive(Debug, Clone, Serialize, Deserialize)]
1279#[serde(untagged)]
1280pub enum ReposSlashListPublicError {
1281    Status422(models::ValidationError),
1282    UnknownValue(serde_json::Value),
1283}
1284
1285/// struct for typed errors of method [`repos_slash_list_pull_requests_associated_with_commit`]
1286#[derive(Debug, Clone, Serialize, Deserialize)]
1287#[serde(untagged)]
1288pub enum ReposSlashListPullRequestsAssociatedWithCommitError {
1289    Status409(models::BasicError),
1290    UnknownValue(serde_json::Value),
1291}
1292
1293/// struct for typed errors of method [`repos_slash_list_release_assets`]
1294#[derive(Debug, Clone, Serialize, Deserialize)]
1295#[serde(untagged)]
1296pub enum ReposSlashListReleaseAssetsError {
1297    UnknownValue(serde_json::Value),
1298}
1299
1300/// struct for typed errors of method [`repos_slash_list_releases`]
1301#[derive(Debug, Clone, Serialize, Deserialize)]
1302#[serde(untagged)]
1303pub enum ReposSlashListReleasesError {
1304    Status404(models::BasicError),
1305    UnknownValue(serde_json::Value),
1306}
1307
1308/// struct for typed errors of method [`repos_slash_list_tag_protection`]
1309#[derive(Debug, Clone, Serialize, Deserialize)]
1310#[serde(untagged)]
1311pub enum ReposSlashListTagProtectionError {
1312    Status403(models::BasicError),
1313    Status404(models::BasicError),
1314    UnknownValue(serde_json::Value),
1315}
1316
1317/// struct for typed errors of method [`repos_slash_list_tags`]
1318#[derive(Debug, Clone, Serialize, Deserialize)]
1319#[serde(untagged)]
1320pub enum ReposSlashListTagsError {
1321    UnknownValue(serde_json::Value),
1322}
1323
1324/// struct for typed errors of method [`repos_slash_list_teams`]
1325#[derive(Debug, Clone, Serialize, Deserialize)]
1326#[serde(untagged)]
1327pub enum ReposSlashListTeamsError {
1328    Status404(models::BasicError),
1329    UnknownValue(serde_json::Value),
1330}
1331
1332/// struct for typed errors of method [`repos_slash_list_webhook_deliveries`]
1333#[derive(Debug, Clone, Serialize, Deserialize)]
1334#[serde(untagged)]
1335pub enum ReposSlashListWebhookDeliveriesError {
1336    Status400(models::BasicError),
1337    Status422(models::ValidationError),
1338    UnknownValue(serde_json::Value),
1339}
1340
1341/// struct for typed errors of method [`repos_slash_list_webhooks`]
1342#[derive(Debug, Clone, Serialize, Deserialize)]
1343#[serde(untagged)]
1344pub enum ReposSlashListWebhooksError {
1345    Status404(models::BasicError),
1346    UnknownValue(serde_json::Value),
1347}
1348
1349/// struct for typed errors of method [`repos_slash_merge`]
1350#[derive(Debug, Clone, Serialize, Deserialize)]
1351#[serde(untagged)]
1352pub enum ReposSlashMergeError {
1353    Status403(models::BasicError),
1354    Status404(),
1355    Status409(),
1356    Status422(models::ValidationError),
1357    UnknownValue(serde_json::Value),
1358}
1359
1360/// struct for typed errors of method [`repos_slash_merge_upstream`]
1361#[derive(Debug, Clone, Serialize, Deserialize)]
1362#[serde(untagged)]
1363pub enum ReposSlashMergeUpstreamError {
1364    Status409(),
1365    Status422(),
1366    UnknownValue(serde_json::Value),
1367}
1368
1369/// struct for typed errors of method [`repos_slash_ping_webhook`]
1370#[derive(Debug, Clone, Serialize, Deserialize)]
1371#[serde(untagged)]
1372pub enum ReposSlashPingWebhookError {
1373    Status404(models::BasicError),
1374    UnknownValue(serde_json::Value),
1375}
1376
1377/// struct for typed errors of method [`repos_slash_redeliver_webhook_delivery`]
1378#[derive(Debug, Clone, Serialize, Deserialize)]
1379#[serde(untagged)]
1380pub enum ReposSlashRedeliverWebhookDeliveryError {
1381    Status400(models::BasicError),
1382    Status422(models::ValidationError),
1383    UnknownValue(serde_json::Value),
1384}
1385
1386/// struct for typed errors of method [`repos_slash_remove_app_access_restrictions`]
1387#[derive(Debug, Clone, Serialize, Deserialize)]
1388#[serde(untagged)]
1389pub enum ReposSlashRemoveAppAccessRestrictionsError {
1390    Status422(models::ValidationError),
1391    UnknownValue(serde_json::Value),
1392}
1393
1394/// struct for typed errors of method [`repos_slash_remove_collaborator`]
1395#[derive(Debug, Clone, Serialize, Deserialize)]
1396#[serde(untagged)]
1397pub enum ReposSlashRemoveCollaboratorError {
1398    Status403(models::BasicError),
1399    Status422(models::ValidationError),
1400    UnknownValue(serde_json::Value),
1401}
1402
1403/// struct for typed errors of method [`repos_slash_remove_status_check_contexts`]
1404#[derive(Debug, Clone, Serialize, Deserialize)]
1405#[serde(untagged)]
1406pub enum ReposSlashRemoveStatusCheckContextsError {
1407    Status404(models::BasicError),
1408    Status422(models::ValidationError),
1409    UnknownValue(serde_json::Value),
1410}
1411
1412/// struct for typed errors of method [`repos_slash_remove_status_check_protection`]
1413#[derive(Debug, Clone, Serialize, Deserialize)]
1414#[serde(untagged)]
1415pub enum ReposSlashRemoveStatusCheckProtectionError {
1416    UnknownValue(serde_json::Value),
1417}
1418
1419/// struct for typed errors of method [`repos_slash_remove_team_access_restrictions`]
1420#[derive(Debug, Clone, Serialize, Deserialize)]
1421#[serde(untagged)]
1422pub enum ReposSlashRemoveTeamAccessRestrictionsError {
1423    Status422(models::ValidationError),
1424    UnknownValue(serde_json::Value),
1425}
1426
1427/// struct for typed errors of method [`repos_slash_remove_user_access_restrictions`]
1428#[derive(Debug, Clone, Serialize, Deserialize)]
1429#[serde(untagged)]
1430pub enum ReposSlashRemoveUserAccessRestrictionsError {
1431    Status422(models::ValidationError),
1432    UnknownValue(serde_json::Value),
1433}
1434
1435/// struct for typed errors of method [`repos_slash_rename_branch`]
1436#[derive(Debug, Clone, Serialize, Deserialize)]
1437#[serde(untagged)]
1438pub enum ReposSlashRenameBranchError {
1439    Status403(models::BasicError),
1440    Status404(models::BasicError),
1441    Status422(models::ValidationError),
1442    UnknownValue(serde_json::Value),
1443}
1444
1445/// struct for typed errors of method [`repos_slash_replace_all_topics`]
1446#[derive(Debug, Clone, Serialize, Deserialize)]
1447#[serde(untagged)]
1448pub enum ReposSlashReplaceAllTopicsError {
1449    Status404(models::BasicError),
1450    Status422(models::ValidationErrorSimple),
1451    UnknownValue(serde_json::Value),
1452}
1453
1454/// struct for typed errors of method [`repos_slash_request_pages_build`]
1455#[derive(Debug, Clone, Serialize, Deserialize)]
1456#[serde(untagged)]
1457pub enum ReposSlashRequestPagesBuildError {
1458    UnknownValue(serde_json::Value),
1459}
1460
1461/// struct for typed errors of method [`repos_slash_set_admin_branch_protection`]
1462#[derive(Debug, Clone, Serialize, Deserialize)]
1463#[serde(untagged)]
1464pub enum ReposSlashSetAdminBranchProtectionError {
1465    UnknownValue(serde_json::Value),
1466}
1467
1468/// struct for typed errors of method [`repos_slash_set_app_access_restrictions`]
1469#[derive(Debug, Clone, Serialize, Deserialize)]
1470#[serde(untagged)]
1471pub enum ReposSlashSetAppAccessRestrictionsError {
1472    Status422(models::ValidationError),
1473    UnknownValue(serde_json::Value),
1474}
1475
1476/// struct for typed errors of method [`repos_slash_set_status_check_contexts`]
1477#[derive(Debug, Clone, Serialize, Deserialize)]
1478#[serde(untagged)]
1479pub enum ReposSlashSetStatusCheckContextsError {
1480    Status404(models::BasicError),
1481    Status422(models::ValidationError),
1482    UnknownValue(serde_json::Value),
1483}
1484
1485/// struct for typed errors of method [`repos_slash_set_team_access_restrictions`]
1486#[derive(Debug, Clone, Serialize, Deserialize)]
1487#[serde(untagged)]
1488pub enum ReposSlashSetTeamAccessRestrictionsError {
1489    Status422(models::ValidationError),
1490    UnknownValue(serde_json::Value),
1491}
1492
1493/// struct for typed errors of method [`repos_slash_set_user_access_restrictions`]
1494#[derive(Debug, Clone, Serialize, Deserialize)]
1495#[serde(untagged)]
1496pub enum ReposSlashSetUserAccessRestrictionsError {
1497    Status422(models::ValidationError),
1498    UnknownValue(serde_json::Value),
1499}
1500
1501/// struct for typed errors of method [`repos_slash_test_push_webhook`]
1502#[derive(Debug, Clone, Serialize, Deserialize)]
1503#[serde(untagged)]
1504pub enum ReposSlashTestPushWebhookError {
1505    Status404(models::BasicError),
1506    UnknownValue(serde_json::Value),
1507}
1508
1509/// struct for typed errors of method [`repos_slash_transfer`]
1510#[derive(Debug, Clone, Serialize, Deserialize)]
1511#[serde(untagged)]
1512pub enum ReposSlashTransferError {
1513    UnknownValue(serde_json::Value),
1514}
1515
1516/// struct for typed errors of method [`repos_slash_update`]
1517#[derive(Debug, Clone, Serialize, Deserialize)]
1518#[serde(untagged)]
1519pub enum ReposSlashUpdateError {
1520    Status403(models::BasicError),
1521    Status404(models::BasicError),
1522    Status422(models::ValidationError),
1523    UnknownValue(serde_json::Value),
1524}
1525
1526/// struct for typed errors of method [`repos_slash_update_branch_protection`]
1527#[derive(Debug, Clone, Serialize, Deserialize)]
1528#[serde(untagged)]
1529pub enum ReposSlashUpdateBranchProtectionError {
1530    Status403(models::BasicError),
1531    Status404(models::BasicError),
1532    Status422(models::ValidationErrorSimple),
1533    UnknownValue(serde_json::Value),
1534}
1535
1536/// struct for typed errors of method [`repos_slash_update_commit_comment`]
1537#[derive(Debug, Clone, Serialize, Deserialize)]
1538#[serde(untagged)]
1539pub enum ReposSlashUpdateCommitCommentError {
1540    Status404(models::BasicError),
1541    UnknownValue(serde_json::Value),
1542}
1543
1544/// struct for typed errors of method [`repos_slash_update_deployment_branch_policy`]
1545#[derive(Debug, Clone, Serialize, Deserialize)]
1546#[serde(untagged)]
1547pub enum ReposSlashUpdateDeploymentBranchPolicyError {
1548    UnknownValue(serde_json::Value),
1549}
1550
1551/// struct for typed errors of method [`repos_slash_update_information_about_pages_site`]
1552#[derive(Debug, Clone, Serialize, Deserialize)]
1553#[serde(untagged)]
1554pub enum ReposSlashUpdateInformationAboutPagesSiteError {
1555    Status400(models::BasicError),
1556    Status409(models::BasicError),
1557    Status422(models::ValidationError),
1558    UnknownValue(serde_json::Value),
1559}
1560
1561/// struct for typed errors of method [`repos_slash_update_invitation`]
1562#[derive(Debug, Clone, Serialize, Deserialize)]
1563#[serde(untagged)]
1564pub enum ReposSlashUpdateInvitationError {
1565    UnknownValue(serde_json::Value),
1566}
1567
1568/// struct for typed errors of method [`repos_slash_update_org_ruleset`]
1569#[derive(Debug, Clone, Serialize, Deserialize)]
1570#[serde(untagged)]
1571pub enum ReposSlashUpdateOrgRulesetError {
1572    Status404(models::BasicError),
1573    Status500(models::BasicError),
1574    UnknownValue(serde_json::Value),
1575}
1576
1577/// struct for typed errors of method [`repos_slash_update_pull_request_review_protection`]
1578#[derive(Debug, Clone, Serialize, Deserialize)]
1579#[serde(untagged)]
1580pub enum ReposSlashUpdatePullRequestReviewProtectionError {
1581    Status422(models::ValidationError),
1582    UnknownValue(serde_json::Value),
1583}
1584
1585/// struct for typed errors of method [`repos_slash_update_release`]
1586#[derive(Debug, Clone, Serialize, Deserialize)]
1587#[serde(untagged)]
1588pub enum ReposSlashUpdateReleaseError {
1589    Status404(models::BasicError),
1590    UnknownValue(serde_json::Value),
1591}
1592
1593/// struct for typed errors of method [`repos_slash_update_release_asset`]
1594#[derive(Debug, Clone, Serialize, Deserialize)]
1595#[serde(untagged)]
1596pub enum ReposSlashUpdateReleaseAssetError {
1597    UnknownValue(serde_json::Value),
1598}
1599
1600/// struct for typed errors of method [`repos_slash_update_repo_ruleset`]
1601#[derive(Debug, Clone, Serialize, Deserialize)]
1602#[serde(untagged)]
1603pub enum ReposSlashUpdateRepoRulesetError {
1604    Status404(models::BasicError),
1605    Status500(models::BasicError),
1606    UnknownValue(serde_json::Value),
1607}
1608
1609/// struct for typed errors of method [`repos_slash_update_status_check_protection`]
1610#[derive(Debug, Clone, Serialize, Deserialize)]
1611#[serde(untagged)]
1612pub enum ReposSlashUpdateStatusCheckProtectionError {
1613    Status404(models::BasicError),
1614    Status422(models::ValidationError),
1615    UnknownValue(serde_json::Value),
1616}
1617
1618/// struct for typed errors of method [`repos_slash_update_webhook`]
1619#[derive(Debug, Clone, Serialize, Deserialize)]
1620#[serde(untagged)]
1621pub enum ReposSlashUpdateWebhookError {
1622    Status404(models::BasicError),
1623    Status422(models::ValidationError),
1624    UnknownValue(serde_json::Value),
1625}
1626
1627/// struct for typed errors of method [`repos_slash_update_webhook_config_for_repo`]
1628#[derive(Debug, Clone, Serialize, Deserialize)]
1629#[serde(untagged)]
1630pub enum ReposSlashUpdateWebhookConfigForRepoError {
1631    UnknownValue(serde_json::Value),
1632}
1633
1634/// struct for typed errors of method [`repos_slash_upload_release_asset`]
1635#[derive(Debug, Clone, Serialize, Deserialize)]
1636#[serde(untagged)]
1637pub enum ReposSlashUploadReleaseAssetError {
1638    Status422(),
1639    UnknownValue(serde_json::Value),
1640}
1641
1642
1643/// 
1644pub async fn repos_slash_accept_invitation_for_authenticated_user(configuration: &configuration::Configuration, invitation_id: i32) -> Result<(), Error<ReposSlashAcceptInvitationForAuthenticatedUserError>> {
1645    let local_var_configuration = configuration;
1646
1647    let local_var_client = &local_var_configuration.client;
1648
1649    let local_var_uri_str = format!("{}/user/repository_invitations/{invitation_id}", local_var_configuration.base_path, invitation_id=invitation_id);
1650    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1651
1652    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1653        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1654    }
1655
1656    let local_var_req = local_var_req_builder.build()?;
1657    let local_var_resp = local_var_client.execute(local_var_req).await?;
1658
1659    let local_var_status = local_var_resp.status();
1660    let local_var_content = local_var_resp.text().await?;
1661
1662    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1663        Ok(())
1664    } else {
1665        let local_var_entity: Option<ReposSlashAcceptInvitationForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
1666        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1667        Err(Error::ResponseError(local_var_error))
1668    }
1669}
1670
1671/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Grants the specified apps push access for this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch.
1672pub async fn repos_slash_add_app_access_restrictions(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_set_app_access_restrictions_request: Option<models::ReposSetAppAccessRestrictionsRequest>) -> Result<Vec<models::Integration>, Error<ReposSlashAddAppAccessRestrictionsError>> {
1673    let local_var_configuration = configuration;
1674
1675    let local_var_client = &local_var_configuration.client;
1676
1677    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
1678    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1679
1680    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1681        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1682    }
1683    local_var_req_builder = local_var_req_builder.json(&repos_set_app_access_restrictions_request);
1684
1685    let local_var_req = local_var_req_builder.build()?;
1686    let local_var_resp = local_var_client.execute(local_var_req).await?;
1687
1688    let local_var_status = local_var_resp.status();
1689    let local_var_content = local_var_resp.text().await?;
1690
1691    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1692        serde_json::from_str(&local_var_content).map_err(Error::from)
1693    } else {
1694        let local_var_entity: Option<ReposSlashAddAppAccessRestrictionsError> = serde_json::from_str(&local_var_content).ok();
1695        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1696        Err(Error::ResponseError(local_var_error))
1697    }
1698}
1699
1700/// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see \"[Rate limits for the API](https://docs.github.com/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits)\" and \"[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api).\"  Adding an outside collaborator may be restricted by enterprise administrators. For more information, see \"[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories).\"  For more information on permission levels, see \"[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)\". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with:  ``` Cannot assign {member} permission of {role name} ```  Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).\"  The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [API](https://docs.github.com/rest/collaborators/invitations).  **Updating an existing collaborator's permission level**  The endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different `permission` parameter. The response will be a `204`, with no other indication that the permission level changed.  **Rate limits**  You are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository.
1701pub async fn repos_slash_add_collaborator(configuration: &configuration::Configuration, owner: &str, repo: &str, username: &str, repos_add_collaborator_request: Option<models::ReposAddCollaboratorRequest>) -> Result<models::RepositoryInvitation, Error<ReposSlashAddCollaboratorError>> {
1702    let local_var_configuration = configuration;
1703
1704    let local_var_client = &local_var_configuration.client;
1705
1706    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/collaborators/{username}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), username=crate::apis::urlencode(username));
1707    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1708
1709    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1710        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1711    }
1712    local_var_req_builder = local_var_req_builder.json(&repos_add_collaborator_request);
1713
1714    let local_var_req = local_var_req_builder.build()?;
1715    let local_var_resp = local_var_client.execute(local_var_req).await?;
1716
1717    let local_var_status = local_var_resp.status();
1718    let local_var_content = local_var_resp.text().await?;
1719
1720    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1721        serde_json::from_str(&local_var_content).map_err(Error::from)
1722    } else {
1723        let local_var_entity: Option<ReposSlashAddCollaboratorError> = serde_json::from_str(&local_var_content).ok();
1724        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1725        Err(Error::ResponseError(local_var_error))
1726    }
1727}
1728
1729/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
1730pub async fn repos_slash_add_status_check_contexts(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_set_status_check_contexts_request: Option<models::ReposSetStatusCheckContextsRequest>) -> Result<Vec<String>, Error<ReposSlashAddStatusCheckContextsError>> {
1731    let local_var_configuration = configuration;
1732
1733    let local_var_client = &local_var_configuration.client;
1734
1735    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
1736    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1737
1738    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1739        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1740    }
1741    local_var_req_builder = local_var_req_builder.json(&repos_set_status_check_contexts_request);
1742
1743    let local_var_req = local_var_req_builder.build()?;
1744    let local_var_resp = local_var_client.execute(local_var_req).await?;
1745
1746    let local_var_status = local_var_resp.status();
1747    let local_var_content = local_var_resp.text().await?;
1748
1749    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1750        serde_json::from_str(&local_var_content).map_err(Error::from)
1751    } else {
1752        let local_var_entity: Option<ReposSlashAddStatusCheckContextsError> = serde_json::from_str(&local_var_content).ok();
1753        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1754        Err(Error::ResponseError(local_var_error))
1755    }
1756}
1757
1758/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Grants the specified teams push access for this branch. You can also give push access to child teams.
1759pub async fn repos_slash_add_team_access_restrictions(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_add_team_access_restrictions_request: Option<models::ReposAddTeamAccessRestrictionsRequest>) -> Result<Vec<models::Team>, Error<ReposSlashAddTeamAccessRestrictionsError>> {
1760    let local_var_configuration = configuration;
1761
1762    let local_var_client = &local_var_configuration.client;
1763
1764    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
1765    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1766
1767    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1768        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1769    }
1770    local_var_req_builder = local_var_req_builder.json(&repos_add_team_access_restrictions_request);
1771
1772    let local_var_req = local_var_req_builder.build()?;
1773    let local_var_resp = local_var_client.execute(local_var_req).await?;
1774
1775    let local_var_status = local_var_resp.status();
1776    let local_var_content = local_var_resp.text().await?;
1777
1778    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1779        serde_json::from_str(&local_var_content).map_err(Error::from)
1780    } else {
1781        let local_var_entity: Option<ReposSlashAddTeamAccessRestrictionsError> = serde_json::from_str(&local_var_content).ok();
1782        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1783        Err(Error::ResponseError(local_var_error))
1784    }
1785}
1786
1787/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Grants the specified people push access for this branch.  | Type    | Description                                                                                                                   | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |
1788pub async fn repos_slash_add_user_access_restrictions(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_set_user_access_restrictions_request: Option<models::ReposSetUserAccessRestrictionsRequest>) -> Result<Vec<models::SimpleUser>, Error<ReposSlashAddUserAccessRestrictionsError>> {
1789    let local_var_configuration = configuration;
1790
1791    let local_var_client = &local_var_configuration.client;
1792
1793    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
1794    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1795
1796    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1797        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1798    }
1799    local_var_req_builder = local_var_req_builder.json(&repos_set_user_access_restrictions_request);
1800
1801    let local_var_req = local_var_req_builder.build()?;
1802    let local_var_resp = local_var_client.execute(local_var_req).await?;
1803
1804    let local_var_status = local_var_resp.status();
1805    let local_var_content = local_var_resp.text().await?;
1806
1807    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1808        serde_json::from_str(&local_var_content).map_err(Error::from)
1809    } else {
1810        let local_var_entity: Option<ReposSlashAddUserAccessRestrictionsError> = serde_json::from_str(&local_var_content).ok();
1811        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1812        Err(Error::ResponseError(local_var_error))
1813    }
1814}
1815
1816/// Cancels a GitHub Pages deployment.  The authenticated user must have write permissions for the GitHub Pages site.
1817pub async fn repos_slash_cancel_pages_deployment(configuration: &configuration::Configuration, owner: &str, repo: &str, pages_deployment_id: models::ActionsGetWorkflowWorkflowIdParameter) -> Result<(), Error<ReposSlashCancelPagesDeploymentError>> {
1818    let local_var_configuration = configuration;
1819
1820    let local_var_client = &local_var_configuration.client;
1821
1822    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pages_deployment_id=pages_deployment_id);
1823    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1824
1825    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1826        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1827    }
1828
1829    let local_var_req = local_var_req_builder.build()?;
1830    let local_var_resp = local_var_client.execute(local_var_req).await?;
1831
1832    let local_var_status = local_var_resp.status();
1833    let local_var_content = local_var_resp.text().await?;
1834
1835    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1836        Ok(())
1837    } else {
1838        let local_var_entity: Option<ReposSlashCancelPagesDeploymentError> = serde_json::from_str(&local_var_content).ok();
1839        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1840        Err(Error::ResponseError(local_var_error))
1841    }
1842}
1843
1844/// Shows whether automated security fixes are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see \"[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)\".
1845pub async fn repos_slash_check_automated_security_fixes(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::CheckAutomatedSecurityFixes, Error<ReposSlashCheckAutomatedSecurityFixesError>> {
1846    let local_var_configuration = configuration;
1847
1848    let local_var_client = &local_var_configuration.client;
1849
1850    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/automated-security-fixes", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1851    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1852
1853    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1854        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1855    }
1856
1857    let local_var_req = local_var_req_builder.build()?;
1858    let local_var_resp = local_var_client.execute(local_var_req).await?;
1859
1860    let local_var_status = local_var_resp.status();
1861    let local_var_content = local_var_resp.text().await?;
1862
1863    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1864        serde_json::from_str(&local_var_content).map_err(Error::from)
1865    } else {
1866        let local_var_entity: Option<ReposSlashCheckAutomatedSecurityFixesError> = serde_json::from_str(&local_var_content).ok();
1867        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1868        Err(Error::ResponseError(local_var_error))
1869    }
1870}
1871
1872/// For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.  Team members will include the members of child teams.  The authenticated user must have push access to the repository to use this endpoint.  OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint.
1873pub async fn repos_slash_check_collaborator(configuration: &configuration::Configuration, owner: &str, repo: &str, username: &str) -> Result<(), Error<ReposSlashCheckCollaboratorError>> {
1874    let local_var_configuration = configuration;
1875
1876    let local_var_client = &local_var_configuration.client;
1877
1878    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/collaborators/{username}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), username=crate::apis::urlencode(username));
1879    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1880
1881    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1882        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1883    }
1884
1885    let local_var_req = local_var_req_builder.build()?;
1886    let local_var_resp = local_var_client.execute(local_var_req).await?;
1887
1888    let local_var_status = local_var_resp.status();
1889    let local_var_content = local_var_resp.text().await?;
1890
1891    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1892        Ok(())
1893    } else {
1894        let local_var_entity: Option<ReposSlashCheckCollaboratorError> = serde_json::from_str(&local_var_content).ok();
1895        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1896        Err(Error::ResponseError(local_var_error))
1897    }
1898}
1899
1900/// Returns a boolean indicating whether or not private vulnerability reporting is enabled for the repository. For more information, see \"[Evaluating the security settings of a repository](https://docs.github.com/code-security/security-advisories/working-with-repository-security-advisories/evaluating-the-security-settings-of-a-repository)\".
1901pub async fn repos_slash_check_private_vulnerability_reporting(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::ReposCheckPrivateVulnerabilityReporting200Response, Error<ReposSlashCheckPrivateVulnerabilityReportingError>> {
1902    let local_var_configuration = configuration;
1903
1904    let local_var_client = &local_var_configuration.client;
1905
1906    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/private-vulnerability-reporting", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1907    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1908
1909    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1910        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1911    }
1912
1913    let local_var_req = local_var_req_builder.build()?;
1914    let local_var_resp = local_var_client.execute(local_var_req).await?;
1915
1916    let local_var_status = local_var_resp.status();
1917    let local_var_content = local_var_resp.text().await?;
1918
1919    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1920        serde_json::from_str(&local_var_content).map_err(Error::from)
1921    } else {
1922        let local_var_entity: Option<ReposSlashCheckPrivateVulnerabilityReportingError> = serde_json::from_str(&local_var_content).ok();
1923        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1924        Err(Error::ResponseError(local_var_error))
1925    }
1926}
1927
1928/// Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin read access to the repository. For more information, see \"[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)\".
1929pub async fn repos_slash_check_vulnerability_alerts(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error<ReposSlashCheckVulnerabilityAlertsError>> {
1930    let local_var_configuration = configuration;
1931
1932    let local_var_client = &local_var_configuration.client;
1933
1934    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/vulnerability-alerts", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1935    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1936
1937    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1938        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1939    }
1940
1941    let local_var_req = local_var_req_builder.build()?;
1942    let local_var_resp = local_var_client.execute(local_var_req).await?;
1943
1944    let local_var_status = local_var_resp.status();
1945    let local_var_content = local_var_resp.text().await?;
1946
1947    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1948        Ok(())
1949    } else {
1950        let local_var_entity: Option<ReposSlashCheckVulnerabilityAlertsError> = serde_json::from_str(&local_var_content).ok();
1951        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1952        Err(Error::ResponseError(local_var_error))
1953    }
1954}
1955
1956/// List any syntax errors that are detected in the CODEOWNERS file.  For more information about the correct CODEOWNERS syntax, see \"[About code owners](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners).\"
1957pub async fn repos_slash_codeowners_errors(configuration: &configuration::Configuration, owner: &str, repo: &str, r#ref: Option<&str>) -> Result<models::CodeownersErrors, Error<ReposSlashCodeownersErrorsError>> {
1958    let local_var_configuration = configuration;
1959
1960    let local_var_client = &local_var_configuration.client;
1961
1962    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/codeowners/errors", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1963    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1964
1965    if let Some(ref local_var_str) = r#ref {
1966        local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]);
1967    }
1968    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1969        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1970    }
1971
1972    let local_var_req = local_var_req_builder.build()?;
1973    let local_var_resp = local_var_client.execute(local_var_req).await?;
1974
1975    let local_var_status = local_var_resp.status();
1976    let local_var_content = local_var_resp.text().await?;
1977
1978    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1979        serde_json::from_str(&local_var_content).map_err(Error::from)
1980    } else {
1981        let local_var_entity: Option<ReposSlashCodeownersErrorsError> = serde_json::from_str(&local_var_content).ok();
1982        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1983        Err(Error::ResponseError(local_var_error))
1984    }
1985}
1986
1987/// **Deprecated**: Use `repos.compareCommitsWithBasehead()` (`GET /repos/{owner}/{repo}/compare/{basehead}`) instead. Both `:base` and `:head` must be branch names in `:repo`. To compare branches across other repositories in the same network as `:repo`, use the format `<USERNAME>:branch`.  The response from the API is equivalent to running the `git log base..head` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats.  The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file.  **Working with large comparisons**  To process a response with a large number of commits, you can use (`per_page` or `page`) to paginate the results. When using paging, the list of changed files is only returned with page 1, but includes all changed files for the entire comparison. For more information on working with pagination, see \"[Traversing with pagination](/rest/guides/traversing-with-pagination).\"  When calling this API without any paging parameters (`per_page` or `page`), the returned list is limited to 250 commits and the last commit in the list is the most recent of the entire comparison. When a paging parameter is specified, the first commit in the returned list of each page is the earliest.  **Signature verification object**  The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:  | Name | Type | Description | | ---- | ---- | ----------- | | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | `signature` | `string` | The signature that was extracted from the commit. | | `payload` | `string` | The value that was signed. |  These are the possible values for `reason` in the `verification` object:  | Value | Description | | ----- | ----------- | | `expired_key` | The key that made the signature is expired. | | `not_signing_key` | The \"signing\" flag is not among the usage flags in the GPG key that made the signature. | | `gpgverify_error` | There was an error communicating with the signature verification service. | | `gpgverify_unavailable` | The signature verification service is currently unavailable. | | `unsigned` | The object does not include a signature. | | `unknown_signature_type` | A non-PGP signature was found in the commit. | | `no_user` | No user was associated with the `committer` email address in the commit. | | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | | `unknown_key` | The key that made the signature has not been registered with any user's account. | | `malformed_signature` | There was an error parsing the signature. | | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | `valid` | None of the above errors applied, so the signature is considered to be verified. |
1988pub async fn repos_slash_compare_commits(configuration: &configuration::Configuration, owner: &str, repo: &str, base: &str, head: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::CommitComparison, Error<ReposSlashCompareCommitsError>> {
1989    let local_var_configuration = configuration;
1990
1991    let local_var_client = &local_var_configuration.client;
1992
1993    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/compare/{base}...{head}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), base=crate::apis::urlencode(base), head=crate::apis::urlencode(head));
1994    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1995
1996    if let Some(ref local_var_str) = per_page {
1997        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1998    }
1999    if let Some(ref local_var_str) = page {
2000        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2001    }
2002    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2003        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2004    }
2005
2006    let local_var_req = local_var_req_builder.build()?;
2007    let local_var_resp = local_var_client.execute(local_var_req).await?;
2008
2009    let local_var_status = local_var_resp.status();
2010    let local_var_content = local_var_resp.text().await?;
2011
2012    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2013        serde_json::from_str(&local_var_content).map_err(Error::from)
2014    } else {
2015        let local_var_entity: Option<ReposSlashCompareCommitsError> = serde_json::from_str(&local_var_content).ok();
2016        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2017        Err(Error::ResponseError(local_var_error))
2018    }
2019}
2020
2021/// Compares two commits against one another. You can compare refs (branches or tags) and commit SHAs in the same repository, or you can compare refs and commit SHAs that exist in different repositories within the same repository network, including fork branches. For more information about how to view a repository's network, see \"[Understanding connections between repositories](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository/understanding-connections-between-repositories).\"  This endpoint is equivalent to running the `git log BASE..HEAD` command, but it returns commits in a different order. The `git log BASE..HEAD` command returns commits in reverse chronological order, whereas the API returns commits in chronological order.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.diff`**: Returns the diff of the commit. - **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property.  The API response includes details about the files that were changed between the two commits. This includes the status of the change (if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file.  When calling this endpoint without any paging parameter (`per_page` or `page`), the returned list is limited to 250 commits, and the last commit in the list is the most recent of the entire comparison.  **Working with large comparisons**  To process a response with a large number of commits, use a query parameter (`per_page` or `page`) to paginate the results. When using pagination:  - The list of changed files is only shown on the first page of results, but it includes all changed files for the entire comparison. - The results are returned in chronological order, but the last commit in the returned list may not be the most recent one in the entire set if there are more pages of results.  For more information on working with pagination, see \"[Using pagination in the REST API](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).\"  **Signature verification object**  The response will include a `verification` object that describes the result of verifying the commit's signature. The `verification` object includes the following fields:  | Name | Type | Description | | ---- | ---- | ----------- | | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | `signature` | `string` | The signature that was extracted from the commit. | | `payload` | `string` | The value that was signed. |  These are the possible values for `reason` in the `verification` object:  | Value | Description | | ----- | ----------- | | `expired_key` | The key that made the signature is expired. | | `not_signing_key` | The \"signing\" flag is not among the usage flags in the GPG key that made the signature. | | `gpgverify_error` | There was an error communicating with the signature verification service. | | `gpgverify_unavailable` | The signature verification service is currently unavailable. | | `unsigned` | The object does not include a signature. | | `unknown_signature_type` | A non-PGP signature was found in the commit. | | `no_user` | No user was associated with the `committer` email address in the commit. | | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. | | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | | `unknown_key` | The key that made the signature has not been registered with any user's account. | | `malformed_signature` | There was an error parsing the signature. | | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | `valid` | None of the above errors applied, so the signature is considered to be verified. |
2022pub async fn repos_slash_compare_commits_with_basehead(configuration: &configuration::Configuration, owner: &str, repo: &str, basehead: &str, page: Option<i32>, per_page: Option<i32>) -> Result<models::CommitComparison, Error<ReposSlashCompareCommitsWithBaseheadError>> {
2023    let local_var_configuration = configuration;
2024
2025    let local_var_client = &local_var_configuration.client;
2026
2027    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/compare/{basehead}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), basehead=crate::apis::urlencode(basehead));
2028    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2029
2030    if let Some(ref local_var_str) = page {
2031        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2032    }
2033    if let Some(ref local_var_str) = per_page {
2034        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2035    }
2036    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2037        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2038    }
2039
2040    let local_var_req = local_var_req_builder.build()?;
2041    let local_var_resp = local_var_client.execute(local_var_req).await?;
2042
2043    let local_var_status = local_var_resp.status();
2044    let local_var_content = local_var_resp.text().await?;
2045
2046    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2047        serde_json::from_str(&local_var_content).map_err(Error::from)
2048    } else {
2049        let local_var_entity: Option<ReposSlashCompareCommitsWithBaseheadError> = serde_json::from_str(&local_var_content).ok();
2050        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2051        Err(Error::ResponseError(local_var_error))
2052    }
2053}
2054
2055/// Users with admin access to the repository can create an autolink.
2056pub async fn repos_slash_create_autolink(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_create_autolink_request: models::ReposCreateAutolinkRequest) -> Result<models::Autolink, Error<ReposSlashCreateAutolinkError>> {
2057    let local_var_configuration = configuration;
2058
2059    let local_var_client = &local_var_configuration.client;
2060
2061    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/autolinks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
2062    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2063
2064    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2065        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2066    }
2067    local_var_req_builder = local_var_req_builder.json(&repos_create_autolink_request);
2068
2069    let local_var_req = local_var_req_builder.build()?;
2070    let local_var_resp = local_var_client.execute(local_var_req).await?;
2071
2072    let local_var_status = local_var_resp.status();
2073    let local_var_content = local_var_resp.text().await?;
2074
2075    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2076        serde_json::from_str(&local_var_content).map_err(Error::from)
2077    } else {
2078        let local_var_entity: Option<ReposSlashCreateAutolinkError> = serde_json::from_str(&local_var_content).ok();
2079        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2080        Err(Error::ResponseError(local_var_error))
2081    }
2082}
2083
2084/// Create a comment for a commit using its `:commit_sha`.  This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see \"[Rate limits for the API](https://docs.github.com/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits)\" and \"[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api).\"  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
2085pub async fn repos_slash_create_commit_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, commit_sha: &str, repos_create_commit_comment_request: models::ReposCreateCommitCommentRequest) -> Result<models::CommitComment, Error<ReposSlashCreateCommitCommentError>> {
2086    let local_var_configuration = configuration;
2087
2088    let local_var_client = &local_var_configuration.client;
2089
2090    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/commits/{commit_sha}/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), commit_sha=crate::apis::urlencode(commit_sha));
2091    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2092
2093    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2094        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2095    }
2096    local_var_req_builder = local_var_req_builder.json(&repos_create_commit_comment_request);
2097
2098    let local_var_req = local_var_req_builder.build()?;
2099    let local_var_resp = local_var_client.execute(local_var_req).await?;
2100
2101    let local_var_status = local_var_resp.status();
2102    let local_var_content = local_var_resp.text().await?;
2103
2104    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2105        serde_json::from_str(&local_var_content).map_err(Error::from)
2106    } else {
2107        let local_var_entity: Option<ReposSlashCreateCommitCommentError> = serde_json::from_str(&local_var_content).ok();
2108        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2109        Err(Error::ResponseError(local_var_error))
2110    }
2111}
2112
2113/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits.
2114pub async fn repos_slash_create_commit_signature_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<models::ProtectedBranchAdminEnforced, Error<ReposSlashCreateCommitSignatureProtectionError>> {
2115    let local_var_configuration = configuration;
2116
2117    let local_var_client = &local_var_configuration.client;
2118
2119    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
2120    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2121
2122    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2123        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2124    }
2125
2126    let local_var_req = local_var_req_builder.build()?;
2127    let local_var_resp = local_var_client.execute(local_var_req).await?;
2128
2129    let local_var_status = local_var_resp.status();
2130    let local_var_content = local_var_resp.text().await?;
2131
2132    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2133        serde_json::from_str(&local_var_content).map_err(Error::from)
2134    } else {
2135        let local_var_entity: Option<ReposSlashCreateCommitSignatureProtectionError> = serde_json::from_str(&local_var_content).ok();
2136        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2137        Err(Error::ResponseError(local_var_error))
2138    }
2139}
2140
2141/// Users with push access in a repository can create commit statuses for a given SHA.  Note: there is a limit of 1000 statuses per `sha` and `context` within a repository. Attempts to create more than 1000 statuses will result in a validation error.
2142pub async fn repos_slash_create_commit_status(configuration: &configuration::Configuration, owner: &str, repo: &str, sha: &str, repos_create_commit_status_request: models::ReposCreateCommitStatusRequest) -> Result<models::Status, Error<ReposSlashCreateCommitStatusError>> {
2143    let local_var_configuration = configuration;
2144
2145    let local_var_client = &local_var_configuration.client;
2146
2147    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/statuses/{sha}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), sha=crate::apis::urlencode(sha));
2148    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2149
2150    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2151        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2152    }
2153    local_var_req_builder = local_var_req_builder.json(&repos_create_commit_status_request);
2154
2155    let local_var_req = local_var_req_builder.build()?;
2156    let local_var_resp = local_var_client.execute(local_var_req).await?;
2157
2158    let local_var_status = local_var_resp.status();
2159    let local_var_content = local_var_resp.text().await?;
2160
2161    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2162        serde_json::from_str(&local_var_content).map_err(Error::from)
2163    } else {
2164        let local_var_entity: Option<ReposSlashCreateCommitStatusError> = serde_json::from_str(&local_var_content).ok();
2165        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2166        Err(Error::ResponseError(local_var_error))
2167    }
2168}
2169
2170/// You can create a read-only deploy key.
2171pub async fn repos_slash_create_deploy_key(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_create_deploy_key_request: models::ReposCreateDeployKeyRequest) -> Result<models::DeployKey, Error<ReposSlashCreateDeployKeyError>> {
2172    let local_var_configuration = configuration;
2173
2174    let local_var_client = &local_var_configuration.client;
2175
2176    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/keys", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
2177    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2178
2179    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2180        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2181    }
2182    local_var_req_builder = local_var_req_builder.json(&repos_create_deploy_key_request);
2183
2184    let local_var_req = local_var_req_builder.build()?;
2185    let local_var_resp = local_var_client.execute(local_var_req).await?;
2186
2187    let local_var_status = local_var_resp.status();
2188    let local_var_content = local_var_resp.text().await?;
2189
2190    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2191        serde_json::from_str(&local_var_content).map_err(Error::from)
2192    } else {
2193        let local_var_entity: Option<ReposSlashCreateDeployKeyError> = serde_json::from_str(&local_var_content).ok();
2194        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2195        Err(Error::ResponseError(local_var_error))
2196    }
2197}
2198
2199/// Deployments offer a few configurable parameters with certain defaults.  The `ref` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them before we merge a pull request.  The `environment` parameter allows deployments to be issued to different runtime environments. Teams often have multiple environments for verifying their applications, such as `production`, `staging`, and `qa`. This parameter makes it easier to track which environments have requested deployments. The default environment is `production`.  The `auto_merge` parameter is used to ensure that the requested ref is not behind the repository's default branch. If the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds, the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will return a failure response.  By default, [commit statuses](https://docs.github.com/rest/commits/statuses) for every submitted context must be in a `success` state. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or to specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do not require any contexts or create any commit statuses, the deployment will always succeed.  The `payload` parameter is available for any extra information that a deployment system might need. It is a JSON text field that will be passed on when a deployment event is dispatched.  The `task` parameter is used by the deployment system to allow different execution paths. In the web world this might be `deploy:migrations` to run schema changes on the system. In the compiled world this could be a flag to compile an application with debugging enabled.  Merged branch response:  You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating a deployment. This auto-merge happens when: *   Auto-merge option is enabled in the repository *   Topic branch does not include the latest changes on the base branch, which is `master` in the response example *   There are no merge conflicts  If there are no new commits in the base branch, a new request to create a deployment should give a successful response.  Merge conflict response:  This error happens when the `auto_merge` option is enabled and when the default branch (in this case `master`), can't be merged into the branch that's being deployed (in this case `topic-branch`), due to merge conflicts.  Failed commit status checks:  This error happens when the `required_contexts` parameter indicates that one or more contexts need to have a `success` status for the commit to be deployed, but one or more of the required contexts do not have a state of `success`.  OAuth app tokens and personal access tokens (classic) need the `repo` or `repo_deployment` scope to use this endpoint.
2200pub async fn repos_slash_create_deployment(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_create_deployment_request: models::ReposCreateDeploymentRequest) -> Result<models::Deployment, Error<ReposSlashCreateDeploymentError>> {
2201    let local_var_configuration = configuration;
2202
2203    let local_var_client = &local_var_configuration.client;
2204
2205    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/deployments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
2206    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2207
2208    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2209        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2210    }
2211    local_var_req_builder = local_var_req_builder.json(&repos_create_deployment_request);
2212
2213    let local_var_req = local_var_req_builder.build()?;
2214    let local_var_resp = local_var_client.execute(local_var_req).await?;
2215
2216    let local_var_status = local_var_resp.status();
2217    let local_var_content = local_var_resp.text().await?;
2218
2219    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2220        serde_json::from_str(&local_var_content).map_err(Error::from)
2221    } else {
2222        let local_var_entity: Option<ReposSlashCreateDeploymentError> = serde_json::from_str(&local_var_content).ok();
2223        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2224        Err(Error::ResponseError(local_var_error))
2225    }
2226}
2227
2228/// Creates a deployment branch or tag policy for an environment.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
2229pub async fn repos_slash_create_deployment_branch_policy(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str, deployment_branch_policy_name_pattern_with_type: models::DeploymentBranchPolicyNamePatternWithType) -> Result<models::DeploymentBranchPolicy, Error<ReposSlashCreateDeploymentBranchPolicyError>> {
2230    let local_var_configuration = configuration;
2231
2232    let local_var_client = &local_var_configuration.client;
2233
2234    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name));
2235    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2236
2237    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2238        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2239    }
2240    local_var_req_builder = local_var_req_builder.json(&deployment_branch_policy_name_pattern_with_type);
2241
2242    let local_var_req = local_var_req_builder.build()?;
2243    let local_var_resp = local_var_client.execute(local_var_req).await?;
2244
2245    let local_var_status = local_var_resp.status();
2246    let local_var_content = local_var_resp.text().await?;
2247
2248    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2249        serde_json::from_str(&local_var_content).map_err(Error::from)
2250    } else {
2251        let local_var_entity: Option<ReposSlashCreateDeploymentBranchPolicyError> = serde_json::from_str(&local_var_content).ok();
2252        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2253        Err(Error::ResponseError(local_var_error))
2254    }
2255}
2256
2257/// Enable a custom deployment protection rule for an environment.  The authenticated user must have admin or owner permissions to the repository to use this endpoint.  For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app).  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
2258pub async fn repos_slash_create_deployment_protection_rule(configuration: &configuration::Configuration, environment_name: &str, repo: &str, owner: &str, repos_create_deployment_protection_rule_request: models::ReposCreateDeploymentProtectionRuleRequest) -> Result<models::DeploymentProtectionRule, Error<ReposSlashCreateDeploymentProtectionRuleError>> {
2259    let local_var_configuration = configuration;
2260
2261    let local_var_client = &local_var_configuration.client;
2262
2263    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules", local_var_configuration.base_path, environment_name=crate::apis::urlencode(environment_name), repo=crate::apis::urlencode(repo), owner=crate::apis::urlencode(owner));
2264    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2265
2266    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2267        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2268    }
2269    local_var_req_builder = local_var_req_builder.json(&repos_create_deployment_protection_rule_request);
2270
2271    let local_var_req = local_var_req_builder.build()?;
2272    let local_var_resp = local_var_client.execute(local_var_req).await?;
2273
2274    let local_var_status = local_var_resp.status();
2275    let local_var_content = local_var_resp.text().await?;
2276
2277    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2278        serde_json::from_str(&local_var_content).map_err(Error::from)
2279    } else {
2280        let local_var_entity: Option<ReposSlashCreateDeploymentProtectionRuleError> = serde_json::from_str(&local_var_content).ok();
2281        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2282        Err(Error::ResponseError(local_var_error))
2283    }
2284}
2285
2286/// Users with `push` access can create deployment statuses for a given deployment.  OAuth app tokens and personal access tokens (classic) need the `repo_deployment` scope to use this endpoint.
2287pub async fn repos_slash_create_deployment_status(configuration: &configuration::Configuration, owner: &str, repo: &str, deployment_id: i32, repos_create_deployment_status_request: models::ReposCreateDeploymentStatusRequest) -> Result<models::DeploymentStatus, Error<ReposSlashCreateDeploymentStatusError>> {
2288    let local_var_configuration = configuration;
2289
2290    let local_var_client = &local_var_configuration.client;
2291
2292    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/deployments/{deployment_id}/statuses", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), deployment_id=deployment_id);
2293    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2294
2295    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2296        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2297    }
2298    local_var_req_builder = local_var_req_builder.json(&repos_create_deployment_status_request);
2299
2300    let local_var_req = local_var_req_builder.build()?;
2301    let local_var_resp = local_var_client.execute(local_var_req).await?;
2302
2303    let local_var_status = local_var_resp.status();
2304    let local_var_content = local_var_resp.text().await?;
2305
2306    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2307        serde_json::from_str(&local_var_content).map_err(Error::from)
2308    } else {
2309        let local_var_entity: Option<ReposSlashCreateDeploymentStatusError> = serde_json::from_str(&local_var_content).ok();
2310        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2311        Err(Error::ResponseError(local_var_error))
2312    }
2313}
2314
2315/// You can use this endpoint to trigger a webhook event called `repository_dispatch` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the `repository_dispatch` event occurs. For an example `repository_dispatch` webhook payload, see \"[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch).\"  The `client_payload` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the `client_payload` can include a message that a user would like to send using a GitHub Actions workflow. Or the `client_payload` can be used as a test to debug your workflow.  This input example shows how you can use the `client_payload` as a test to debug your workflow.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
2316pub async fn repos_slash_create_dispatch_event(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_create_dispatch_event_request: models::ReposCreateDispatchEventRequest) -> Result<(), Error<ReposSlashCreateDispatchEventError>> {
2317    let local_var_configuration = configuration;
2318
2319    let local_var_client = &local_var_configuration.client;
2320
2321    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/dispatches", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
2322    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2323
2324    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2325        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2326    }
2327    local_var_req_builder = local_var_req_builder.json(&repos_create_dispatch_event_request);
2328
2329    let local_var_req = local_var_req_builder.build()?;
2330    let local_var_resp = local_var_client.execute(local_var_req).await?;
2331
2332    let local_var_status = local_var_resp.status();
2333    let local_var_content = local_var_resp.text().await?;
2334
2335    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2336        Ok(())
2337    } else {
2338        let local_var_entity: Option<ReposSlashCreateDispatchEventError> = serde_json::from_str(&local_var_content).ok();
2339        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2340        Err(Error::ResponseError(local_var_error))
2341    }
2342}
2343
2344/// Creates a new repository for the authenticated user.  OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository.
2345pub async fn repos_slash_create_for_authenticated_user(configuration: &configuration::Configuration, repos_create_for_authenticated_user_request: models::ReposCreateForAuthenticatedUserRequest) -> Result<models::FullRepository, Error<ReposSlashCreateForAuthenticatedUserError>> {
2346    let local_var_configuration = configuration;
2347
2348    let local_var_client = &local_var_configuration.client;
2349
2350    let local_var_uri_str = format!("{}/user/repos", local_var_configuration.base_path);
2351    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2352
2353    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2354        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2355    }
2356    local_var_req_builder = local_var_req_builder.json(&repos_create_for_authenticated_user_request);
2357
2358    let local_var_req = local_var_req_builder.build()?;
2359    let local_var_resp = local_var_client.execute(local_var_req).await?;
2360
2361    let local_var_status = local_var_resp.status();
2362    let local_var_content = local_var_resp.text().await?;
2363
2364    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2365        serde_json::from_str(&local_var_content).map_err(Error::from)
2366    } else {
2367        let local_var_entity: Option<ReposSlashCreateForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
2368        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2369        Err(Error::ResponseError(local_var_error))
2370    }
2371}
2372
2373/// Create a fork for the authenticated user.  **Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api).  **Note**: Although this endpoint works with GitHub Apps, the GitHub App must be installed on the destination account with access to all repositories and on the source account with access to the source repository.
2374pub async fn repos_slash_create_fork(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_create_fork_request: Option<models::ReposCreateForkRequest>) -> Result<models::FullRepository, Error<ReposSlashCreateForkError>> {
2375    let local_var_configuration = configuration;
2376
2377    let local_var_client = &local_var_configuration.client;
2378
2379    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/forks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
2380    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2381
2382    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2383        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2384    }
2385    local_var_req_builder = local_var_req_builder.json(&repos_create_fork_request);
2386
2387    let local_var_req = local_var_req_builder.build()?;
2388    let local_var_resp = local_var_client.execute(local_var_req).await?;
2389
2390    let local_var_status = local_var_resp.status();
2391    let local_var_content = local_var_resp.text().await?;
2392
2393    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2394        serde_json::from_str(&local_var_content).map_err(Error::from)
2395    } else {
2396        let local_var_entity: Option<ReposSlashCreateForkError> = serde_json::from_str(&local_var_content).ok();
2397        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2398        Err(Error::ResponseError(local_var_error))
2399    }
2400}
2401
2402/// Creates a new repository in the specified organization. The authenticated user must be a member of the organization.  OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository.
2403pub async fn repos_slash_create_in_org(configuration: &configuration::Configuration, org: &str, repos_create_in_org_request: models::ReposCreateInOrgRequest) -> Result<models::FullRepository, Error<ReposSlashCreateInOrgError>> {
2404    let local_var_configuration = configuration;
2405
2406    let local_var_client = &local_var_configuration.client;
2407
2408    let local_var_uri_str = format!("{}/orgs/{org}/repos", local_var_configuration.base_path, org=crate::apis::urlencode(org));
2409    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2410
2411    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2412        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2413    }
2414    local_var_req_builder = local_var_req_builder.json(&repos_create_in_org_request);
2415
2416    let local_var_req = local_var_req_builder.build()?;
2417    let local_var_resp = local_var_client.execute(local_var_req).await?;
2418
2419    let local_var_status = local_var_resp.status();
2420    let local_var_content = local_var_resp.text().await?;
2421
2422    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2423        serde_json::from_str(&local_var_content).map_err(Error::from)
2424    } else {
2425        let local_var_entity: Option<ReposSlashCreateInOrgError> = serde_json::from_str(&local_var_content).ok();
2426        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2427        Err(Error::ResponseError(local_var_error))
2428    }
2429}
2430
2431/// Create new or update existing custom property values for a repository. Using a value of `null` for a custom property will remove or 'unset' the property value from the repository.  Repository admins and other users with the repository-level \"edit custom property values\" fine-grained permission can use this endpoint.
2432pub async fn repos_slash_create_or_update_custom_properties_values(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_create_or_update_custom_properties_values_request: models::ReposCreateOrUpdateCustomPropertiesValuesRequest) -> Result<(), Error<ReposSlashCreateOrUpdateCustomPropertiesValuesError>> {
2433    let local_var_configuration = configuration;
2434
2435    let local_var_client = &local_var_configuration.client;
2436
2437    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/properties/values", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
2438    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
2439
2440    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2441        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2442    }
2443    local_var_req_builder = local_var_req_builder.json(&repos_create_or_update_custom_properties_values_request);
2444
2445    let local_var_req = local_var_req_builder.build()?;
2446    let local_var_resp = local_var_client.execute(local_var_req).await?;
2447
2448    let local_var_status = local_var_resp.status();
2449    let local_var_content = local_var_resp.text().await?;
2450
2451    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2452        Ok(())
2453    } else {
2454        let local_var_entity: Option<ReposSlashCreateOrUpdateCustomPropertiesValuesError> = serde_json::from_str(&local_var_content).ok();
2455        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2456        Err(Error::ResponseError(local_var_error))
2457    }
2458}
2459
2460/// Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see \"[Environments](/actions/reference/environments#environment-protection-rules).\"  **Note:** To create or update name patterns that branches must match in order to deploy to this environment, see \"[Deployment branch policies](/rest/deployments/branch-policies).\"  **Note:** To create or update secrets for an environment, see \"[GitHub Actions secrets](/rest/actions/secrets).\"  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
2461pub async fn repos_slash_create_or_update_environment(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str, repos_create_or_update_environment_request: Option<models::ReposCreateOrUpdateEnvironmentRequest>) -> Result<models::Environment, Error<ReposSlashCreateOrUpdateEnvironmentError>> {
2462    let local_var_configuration = configuration;
2463
2464    let local_var_client = &local_var_configuration.client;
2465
2466    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name));
2467    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2468
2469    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2470        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2471    }
2472    local_var_req_builder = local_var_req_builder.json(&repos_create_or_update_environment_request);
2473
2474    let local_var_req = local_var_req_builder.build()?;
2475    let local_var_resp = local_var_client.execute(local_var_req).await?;
2476
2477    let local_var_status = local_var_resp.status();
2478    let local_var_content = local_var_resp.text().await?;
2479
2480    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2481        serde_json::from_str(&local_var_content).map_err(Error::from)
2482    } else {
2483        let local_var_entity: Option<ReposSlashCreateOrUpdateEnvironmentError> = serde_json::from_str(&local_var_content).ok();
2484        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2485        Err(Error::ResponseError(local_var_error))
2486    }
2487}
2488
2489/// Creates a new file or replaces an existing file in a repository.  **Note:** If you use this endpoint and the \"[Delete a file](https://docs.github.com/rest/repos/contents/#delete-a-file)\" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The `workflow` scope is also required in order to modify files in the `.github/workflows` directory.
2490pub async fn repos_slash_create_or_update_file_contents(configuration: &configuration::Configuration, owner: &str, repo: &str, path: &str, repos_create_or_update_file_contents_request: models::ReposCreateOrUpdateFileContentsRequest) -> Result<models::FileCommit, Error<ReposSlashCreateOrUpdateFileContentsError>> {
2491    let local_var_configuration = configuration;
2492
2493    let local_var_client = &local_var_configuration.client;
2494
2495    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/contents/{path}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), path=crate::apis::urlencode(path));
2496    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2497
2498    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2499        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2500    }
2501    local_var_req_builder = local_var_req_builder.json(&repos_create_or_update_file_contents_request);
2502
2503    let local_var_req = local_var_req_builder.build()?;
2504    let local_var_resp = local_var_client.execute(local_var_req).await?;
2505
2506    let local_var_status = local_var_resp.status();
2507    let local_var_content = local_var_resp.text().await?;
2508
2509    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2510        serde_json::from_str(&local_var_content).map_err(Error::from)
2511    } else {
2512        let local_var_entity: Option<ReposSlashCreateOrUpdateFileContentsError> = serde_json::from_str(&local_var_content).ok();
2513        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2514        Err(Error::ResponseError(local_var_error))
2515    }
2516}
2517
2518/// Create a repository ruleset for an organization.
2519pub async fn repos_slash_create_org_ruleset(configuration: &configuration::Configuration, org: &str, repos_create_org_ruleset_request: models::ReposCreateOrgRulesetRequest) -> Result<models::RepositoryRuleset, Error<ReposSlashCreateOrgRulesetError>> {
2520    let local_var_configuration = configuration;
2521
2522    let local_var_client = &local_var_configuration.client;
2523
2524    let local_var_uri_str = format!("{}/orgs/{org}/rulesets", local_var_configuration.base_path, org=crate::apis::urlencode(org));
2525    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2526
2527    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2528        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2529    }
2530    local_var_req_builder = local_var_req_builder.json(&repos_create_org_ruleset_request);
2531
2532    let local_var_req = local_var_req_builder.build()?;
2533    let local_var_resp = local_var_client.execute(local_var_req).await?;
2534
2535    let local_var_status = local_var_resp.status();
2536    let local_var_content = local_var_resp.text().await?;
2537
2538    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2539        serde_json::from_str(&local_var_content).map_err(Error::from)
2540    } else {
2541        let local_var_entity: Option<ReposSlashCreateOrgRulesetError> = serde_json::from_str(&local_var_content).ok();
2542        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2543        Err(Error::ResponseError(local_var_error))
2544    }
2545}
2546
2547/// Create a GitHub Pages deployment for a repository.  The authenticated user must have write permission to the repository.
2548pub async fn repos_slash_create_pages_deployment(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_create_pages_deployment_request: models::ReposCreatePagesDeploymentRequest) -> Result<models::PageDeployment, Error<ReposSlashCreatePagesDeploymentError>> {
2549    let local_var_configuration = configuration;
2550
2551    let local_var_client = &local_var_configuration.client;
2552
2553    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pages/deployments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
2554    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2555
2556    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2557        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2558    }
2559    local_var_req_builder = local_var_req_builder.json(&repos_create_pages_deployment_request);
2560
2561    let local_var_req = local_var_req_builder.build()?;
2562    let local_var_resp = local_var_client.execute(local_var_req).await?;
2563
2564    let local_var_status = local_var_resp.status();
2565    let local_var_content = local_var_resp.text().await?;
2566
2567    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2568        serde_json::from_str(&local_var_content).map_err(Error::from)
2569    } else {
2570        let local_var_entity: Option<ReposSlashCreatePagesDeploymentError> = serde_json::from_str(&local_var_content).ok();
2571        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2572        Err(Error::ResponseError(local_var_error))
2573    }
2574}
2575
2576/// Configures a GitHub Pages site. For more information, see \"[About GitHub Pages](/github/working-with-github-pages/about-github-pages).\"  The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
2577pub async fn repos_slash_create_pages_site(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_create_pages_site_request: Option<models::ReposCreatePagesSiteRequest>) -> Result<models::Page, Error<ReposSlashCreatePagesSiteError>> {
2578    let local_var_configuration = configuration;
2579
2580    let local_var_client = &local_var_configuration.client;
2581
2582    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pages", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
2583    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2584
2585    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2586        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2587    }
2588    local_var_req_builder = local_var_req_builder.json(&repos_create_pages_site_request);
2589
2590    let local_var_req = local_var_req_builder.build()?;
2591    let local_var_resp = local_var_client.execute(local_var_req).await?;
2592
2593    let local_var_status = local_var_resp.status();
2594    let local_var_content = local_var_resp.text().await?;
2595
2596    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2597        serde_json::from_str(&local_var_content).map_err(Error::from)
2598    } else {
2599        let local_var_entity: Option<ReposSlashCreatePagesSiteError> = serde_json::from_str(&local_var_content).ok();
2600        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2601        Err(Error::ResponseError(local_var_error))
2602    }
2603}
2604
2605/// Users with push access to the repository can create a release.  This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see \"[Rate limits for the API](https://docs.github.com/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits)\" and \"[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api).\"
2606pub async fn repos_slash_create_release(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_create_release_request: models::ReposCreateReleaseRequest) -> Result<models::Release, Error<ReposSlashCreateReleaseError>> {
2607    let local_var_configuration = configuration;
2608
2609    let local_var_client = &local_var_configuration.client;
2610
2611    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
2612    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2613
2614    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2615        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2616    }
2617    local_var_req_builder = local_var_req_builder.json(&repos_create_release_request);
2618
2619    let local_var_req = local_var_req_builder.build()?;
2620    let local_var_resp = local_var_client.execute(local_var_req).await?;
2621
2622    let local_var_status = local_var_resp.status();
2623    let local_var_content = local_var_resp.text().await?;
2624
2625    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2626        serde_json::from_str(&local_var_content).map_err(Error::from)
2627    } else {
2628        let local_var_entity: Option<ReposSlashCreateReleaseError> = serde_json::from_str(&local_var_content).ok();
2629        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2630        Err(Error::ResponseError(local_var_error))
2631    }
2632}
2633
2634/// Create a ruleset for a repository.
2635pub async fn repos_slash_create_repo_ruleset(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_create_repo_ruleset_request: models::ReposCreateRepoRulesetRequest) -> Result<models::RepositoryRuleset, Error<ReposSlashCreateRepoRulesetError>> {
2636    let local_var_configuration = configuration;
2637
2638    let local_var_client = &local_var_configuration.client;
2639
2640    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/rulesets", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
2641    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2642
2643    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2644        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2645    }
2646    local_var_req_builder = local_var_req_builder.json(&repos_create_repo_ruleset_request);
2647
2648    let local_var_req = local_var_req_builder.build()?;
2649    let local_var_resp = local_var_client.execute(local_var_req).await?;
2650
2651    let local_var_status = local_var_resp.status();
2652    let local_var_content = local_var_resp.text().await?;
2653
2654    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2655        serde_json::from_str(&local_var_content).map_err(Error::from)
2656    } else {
2657        let local_var_entity: Option<ReposSlashCreateRepoRulesetError> = serde_json::from_str(&local_var_content).ok();
2658        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2659        Err(Error::ResponseError(local_var_error))
2660    }
2661}
2662
2663/// This creates a tag protection state for a repository. This endpoint is only available to repository administrators.
2664pub async fn repos_slash_create_tag_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_create_tag_protection_request: models::ReposCreateTagProtectionRequest) -> Result<models::TagProtection, Error<ReposSlashCreateTagProtectionError>> {
2665    let local_var_configuration = configuration;
2666
2667    let local_var_client = &local_var_configuration.client;
2668
2669    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/tags/protection", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
2670    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2671
2672    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2673        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2674    }
2675    local_var_req_builder = local_var_req_builder.json(&repos_create_tag_protection_request);
2676
2677    let local_var_req = local_var_req_builder.build()?;
2678    let local_var_resp = local_var_client.execute(local_var_req).await?;
2679
2680    let local_var_status = local_var_resp.status();
2681    let local_var_content = local_var_resp.text().await?;
2682
2683    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2684        serde_json::from_str(&local_var_content).map_err(Error::from)
2685    } else {
2686        let local_var_entity: Option<ReposSlashCreateTagProtectionError> = serde_json::from_str(&local_var_content).ok();
2687        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2688        Err(Error::ResponseError(local_var_error))
2689    }
2690}
2691
2692/// Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. If the repository is not public, the authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/repos/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.  OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository.
2693pub async fn repos_slash_create_using_template(configuration: &configuration::Configuration, template_owner: &str, template_repo: &str, repos_create_using_template_request: models::ReposCreateUsingTemplateRequest) -> Result<models::FullRepository, Error<ReposSlashCreateUsingTemplateError>> {
2694    let local_var_configuration = configuration;
2695
2696    let local_var_client = &local_var_configuration.client;
2697
2698    let local_var_uri_str = format!("{}/repos/{template_owner}/{template_repo}/generate", local_var_configuration.base_path, template_owner=crate::apis::urlencode(template_owner), template_repo=crate::apis::urlencode(template_repo));
2699    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2700
2701    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2702        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2703    }
2704    local_var_req_builder = local_var_req_builder.json(&repos_create_using_template_request);
2705
2706    let local_var_req = local_var_req_builder.build()?;
2707    let local_var_resp = local_var_client.execute(local_var_req).await?;
2708
2709    let local_var_status = local_var_resp.status();
2710    let local_var_content = local_var_resp.text().await?;
2711
2712    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2713        serde_json::from_str(&local_var_content).map_err(Error::from)
2714    } else {
2715        let local_var_entity: Option<ReposSlashCreateUsingTemplateError> = serde_json::from_str(&local_var_content).ok();
2716        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2717        Err(Error::ResponseError(local_var_error))
2718    }
2719}
2720
2721/// Repositories can have multiple webhooks installed. Each webhook should have a unique `config`. Multiple webhooks can share the same `config` as long as those webhooks do not have any `events` that overlap.
2722pub async fn repos_slash_create_webhook(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_create_webhook_request: Option<models::ReposCreateWebhookRequest>) -> Result<models::Hook, Error<ReposSlashCreateWebhookError>> {
2723    let local_var_configuration = configuration;
2724
2725    let local_var_client = &local_var_configuration.client;
2726
2727    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
2728    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2729
2730    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2731        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2732    }
2733    local_var_req_builder = local_var_req_builder.json(&repos_create_webhook_request);
2734
2735    let local_var_req = local_var_req_builder.build()?;
2736    let local_var_resp = local_var_client.execute(local_var_req).await?;
2737
2738    let local_var_status = local_var_resp.status();
2739    let local_var_content = local_var_resp.text().await?;
2740
2741    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2742        serde_json::from_str(&local_var_content).map_err(Error::from)
2743    } else {
2744        let local_var_entity: Option<ReposSlashCreateWebhookError> = serde_json::from_str(&local_var_content).ok();
2745        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2746        Err(Error::ResponseError(local_var_error))
2747    }
2748}
2749
2750/// 
2751pub async fn repos_slash_decline_invitation_for_authenticated_user(configuration: &configuration::Configuration, invitation_id: i32) -> Result<(), Error<ReposSlashDeclineInvitationForAuthenticatedUserError>> {
2752    let local_var_configuration = configuration;
2753
2754    let local_var_client = &local_var_configuration.client;
2755
2756    let local_var_uri_str = format!("{}/user/repository_invitations/{invitation_id}", local_var_configuration.base_path, invitation_id=invitation_id);
2757    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2758
2759    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2760        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2761    }
2762
2763    let local_var_req = local_var_req_builder.build()?;
2764    let local_var_resp = local_var_client.execute(local_var_req).await?;
2765
2766    let local_var_status = local_var_resp.status();
2767    let local_var_content = local_var_resp.text().await?;
2768
2769    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2770        Ok(())
2771    } else {
2772        let local_var_entity: Option<ReposSlashDeclineInvitationForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
2773        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2774        Err(Error::ResponseError(local_var_error))
2775    }
2776}
2777
2778/// Deleting a repository requires admin access.  If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, you will get a `403 Forbidden` response.  OAuth app tokens and personal access tokens (classic) need the `delete_repo` scope to use this endpoint.
2779pub async fn repos_slash_delete(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error<ReposSlashDeleteError>> {
2780    let local_var_configuration = configuration;
2781
2782    let local_var_client = &local_var_configuration.client;
2783
2784    let local_var_uri_str = format!("{}/repos/{owner}/{repo}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
2785    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2786
2787    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2788        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2789    }
2790
2791    let local_var_req = local_var_req_builder.build()?;
2792    let local_var_resp = local_var_client.execute(local_var_req).await?;
2793
2794    let local_var_status = local_var_resp.status();
2795    let local_var_content = local_var_resp.text().await?;
2796
2797    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2798        Ok(())
2799    } else {
2800        let local_var_entity: Option<ReposSlashDeleteError> = serde_json::from_str(&local_var_content).ok();
2801        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2802        Err(Error::ResponseError(local_var_error))
2803    }
2804}
2805
2806/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Disables the ability to restrict who can push to this branch.
2807pub async fn repos_slash_delete_access_restrictions(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<(), Error<ReposSlashDeleteAccessRestrictionsError>> {
2808    let local_var_configuration = configuration;
2809
2810    let local_var_client = &local_var_configuration.client;
2811
2812    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/restrictions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
2813    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2814
2815    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2816        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2817    }
2818
2819    let local_var_req = local_var_req_builder.build()?;
2820    let local_var_resp = local_var_client.execute(local_var_req).await?;
2821
2822    let local_var_status = local_var_resp.status();
2823    let local_var_content = local_var_resp.text().await?;
2824
2825    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2826        Ok(())
2827    } else {
2828        let local_var_entity: Option<ReposSlashDeleteAccessRestrictionsError> = serde_json::from_str(&local_var_content).ok();
2829        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2830        Err(Error::ResponseError(local_var_error))
2831    }
2832}
2833
2834/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.
2835pub async fn repos_slash_delete_admin_branch_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<(), Error<ReposSlashDeleteAdminBranchProtectionError>> {
2836    let local_var_configuration = configuration;
2837
2838    let local_var_client = &local_var_configuration.client;
2839
2840    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
2841    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2842
2843    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2844        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2845    }
2846
2847    let local_var_req = local_var_req_builder.build()?;
2848    let local_var_resp = local_var_client.execute(local_var_req).await?;
2849
2850    let local_var_status = local_var_resp.status();
2851    let local_var_content = local_var_resp.text().await?;
2852
2853    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2854        Ok(())
2855    } else {
2856        let local_var_entity: Option<ReposSlashDeleteAdminBranchProtectionError> = serde_json::from_str(&local_var_content).ok();
2857        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2858        Err(Error::ResponseError(local_var_error))
2859    }
2860}
2861
2862/// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
2863pub async fn repos_slash_delete_an_environment(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str) -> Result<(), Error<ReposSlashDeleteAnEnvironmentError>> {
2864    let local_var_configuration = configuration;
2865
2866    let local_var_client = &local_var_configuration.client;
2867
2868    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name));
2869    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2870
2871    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2872        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2873    }
2874
2875    let local_var_req = local_var_req_builder.build()?;
2876    let local_var_resp = local_var_client.execute(local_var_req).await?;
2877
2878    let local_var_status = local_var_resp.status();
2879    let local_var_content = local_var_resp.text().await?;
2880
2881    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2882        Ok(())
2883    } else {
2884        let local_var_entity: Option<ReposSlashDeleteAnEnvironmentError> = serde_json::from_str(&local_var_content).ok();
2885        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2886        Err(Error::ResponseError(local_var_error))
2887    }
2888}
2889
2890/// This deletes a single autolink reference by ID that was configured for the given repository.  Information about autolinks are only available to repository administrators.
2891pub async fn repos_slash_delete_autolink(configuration: &configuration::Configuration, owner: &str, repo: &str, autolink_id: i32) -> Result<(), Error<ReposSlashDeleteAutolinkError>> {
2892    let local_var_configuration = configuration;
2893
2894    let local_var_client = &local_var_configuration.client;
2895
2896    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/autolinks/{autolink_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), autolink_id=autolink_id);
2897    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2898
2899    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2900        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2901    }
2902
2903    let local_var_req = local_var_req_builder.build()?;
2904    let local_var_resp = local_var_client.execute(local_var_req).await?;
2905
2906    let local_var_status = local_var_resp.status();
2907    let local_var_content = local_var_resp.text().await?;
2908
2909    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2910        Ok(())
2911    } else {
2912        let local_var_entity: Option<ReposSlashDeleteAutolinkError> = serde_json::from_str(&local_var_content).ok();
2913        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2914        Err(Error::ResponseError(local_var_error))
2915    }
2916}
2917
2918/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
2919pub async fn repos_slash_delete_branch_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<(), Error<ReposSlashDeleteBranchProtectionError>> {
2920    let local_var_configuration = configuration;
2921
2922    let local_var_client = &local_var_configuration.client;
2923
2924    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
2925    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2926
2927    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2928        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2929    }
2930
2931    let local_var_req = local_var_req_builder.build()?;
2932    let local_var_resp = local_var_client.execute(local_var_req).await?;
2933
2934    let local_var_status = local_var_resp.status();
2935    let local_var_content = local_var_resp.text().await?;
2936
2937    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2938        Ok(())
2939    } else {
2940        let local_var_entity: Option<ReposSlashDeleteBranchProtectionError> = serde_json::from_str(&local_var_content).ok();
2941        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2942        Err(Error::ResponseError(local_var_error))
2943    }
2944}
2945
2946/// 
2947pub async fn repos_slash_delete_commit_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32) -> Result<(), Error<ReposSlashDeleteCommitCommentError>> {
2948    let local_var_configuration = configuration;
2949
2950    let local_var_client = &local_var_configuration.client;
2951
2952    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/comments/{comment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
2953    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2954
2955    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2956        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2957    }
2958
2959    let local_var_req = local_var_req_builder.build()?;
2960    let local_var_resp = local_var_client.execute(local_var_req).await?;
2961
2962    let local_var_status = local_var_resp.status();
2963    let local_var_content = local_var_resp.text().await?;
2964
2965    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2966        Ok(())
2967    } else {
2968        let local_var_entity: Option<ReposSlashDeleteCommitCommentError> = serde_json::from_str(&local_var_content).ok();
2969        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2970        Err(Error::ResponseError(local_var_error))
2971    }
2972}
2973
2974/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits.
2975pub async fn repos_slash_delete_commit_signature_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<(), Error<ReposSlashDeleteCommitSignatureProtectionError>> {
2976    let local_var_configuration = configuration;
2977
2978    let local_var_client = &local_var_configuration.client;
2979
2980    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
2981    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2982
2983    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2984        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2985    }
2986
2987    let local_var_req = local_var_req_builder.build()?;
2988    let local_var_resp = local_var_client.execute(local_var_req).await?;
2989
2990    let local_var_status = local_var_resp.status();
2991    let local_var_content = local_var_resp.text().await?;
2992
2993    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2994        Ok(())
2995    } else {
2996        let local_var_entity: Option<ReposSlashDeleteCommitSignatureProtectionError> = serde_json::from_str(&local_var_content).ok();
2997        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2998        Err(Error::ResponseError(local_var_error))
2999    }
3000}
3001
3002/// Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.
3003pub async fn repos_slash_delete_deploy_key(configuration: &configuration::Configuration, owner: &str, repo: &str, key_id: i32) -> Result<(), Error<ReposSlashDeleteDeployKeyError>> {
3004    let local_var_configuration = configuration;
3005
3006    let local_var_client = &local_var_configuration.client;
3007
3008    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/keys/{key_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), key_id=key_id);
3009    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3010
3011    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3012        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3013    }
3014
3015    let local_var_req = local_var_req_builder.build()?;
3016    let local_var_resp = local_var_client.execute(local_var_req).await?;
3017
3018    let local_var_status = local_var_resp.status();
3019    let local_var_content = local_var_resp.text().await?;
3020
3021    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3022        Ok(())
3023    } else {
3024        let local_var_entity: Option<ReposSlashDeleteDeployKeyError> = serde_json::from_str(&local_var_content).ok();
3025        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3026        Err(Error::ResponseError(local_var_error))
3027    }
3028}
3029
3030/// If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment.  To set a deployment as inactive, you must:  *   Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment. *   Mark the active deployment as inactive by adding any non-successful deployment status.  For more information, see \"[Create a deployment](https://docs.github.com/rest/deployments/deployments/#create-a-deployment)\" and \"[Create a deployment status](https://docs.github.com/rest/deployments/statuses#create-a-deployment-status).\"  OAuth app tokens and personal access tokens (classic) need the `repo` or `repo_deployment` scope to use this endpoint.
3031pub async fn repos_slash_delete_deployment(configuration: &configuration::Configuration, owner: &str, repo: &str, deployment_id: i32) -> Result<(), Error<ReposSlashDeleteDeploymentError>> {
3032    let local_var_configuration = configuration;
3033
3034    let local_var_client = &local_var_configuration.client;
3035
3036    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/deployments/{deployment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), deployment_id=deployment_id);
3037    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3038
3039    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3040        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3041    }
3042
3043    let local_var_req = local_var_req_builder.build()?;
3044    let local_var_resp = local_var_client.execute(local_var_req).await?;
3045
3046    let local_var_status = local_var_resp.status();
3047    let local_var_content = local_var_resp.text().await?;
3048
3049    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3050        Ok(())
3051    } else {
3052        let local_var_entity: Option<ReposSlashDeleteDeploymentError> = serde_json::from_str(&local_var_content).ok();
3053        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3054        Err(Error::ResponseError(local_var_error))
3055    }
3056}
3057
3058/// Deletes a deployment branch or tag policy for an environment.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
3059pub async fn repos_slash_delete_deployment_branch_policy(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str, branch_policy_id: i32) -> Result<(), Error<ReposSlashDeleteDeploymentBranchPolicyError>> {
3060    let local_var_configuration = configuration;
3061
3062    let local_var_client = &local_var_configuration.client;
3063
3064    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name), branch_policy_id=branch_policy_id);
3065    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3066
3067    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3068        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3069    }
3070
3071    let local_var_req = local_var_req_builder.build()?;
3072    let local_var_resp = local_var_client.execute(local_var_req).await?;
3073
3074    let local_var_status = local_var_resp.status();
3075    let local_var_content = local_var_resp.text().await?;
3076
3077    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3078        Ok(())
3079    } else {
3080        let local_var_entity: Option<ReposSlashDeleteDeploymentBranchPolicyError> = serde_json::from_str(&local_var_content).ok();
3081        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3082        Err(Error::ResponseError(local_var_error))
3083    }
3084}
3085
3086/// Deletes a file in a repository.  You can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author.  The `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user's information is used.  You must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code.  **Note:** If you use this endpoint and the \"[Create or update file contents](https://docs.github.com/rest/repos/contents/#create-or-update-file-contents)\" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.
3087pub async fn repos_slash_delete_file(configuration: &configuration::Configuration, owner: &str, repo: &str, path: &str, repos_delete_file_request: models::ReposDeleteFileRequest) -> Result<models::FileCommit, Error<ReposSlashDeleteFileError>> {
3088    let local_var_configuration = configuration;
3089
3090    let local_var_client = &local_var_configuration.client;
3091
3092    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/contents/{path}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), path=crate::apis::urlencode(path));
3093    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3094
3095    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3096        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3097    }
3098    local_var_req_builder = local_var_req_builder.json(&repos_delete_file_request);
3099
3100    let local_var_req = local_var_req_builder.build()?;
3101    let local_var_resp = local_var_client.execute(local_var_req).await?;
3102
3103    let local_var_status = local_var_resp.status();
3104    let local_var_content = local_var_resp.text().await?;
3105
3106    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3107        serde_json::from_str(&local_var_content).map_err(Error::from)
3108    } else {
3109        let local_var_entity: Option<ReposSlashDeleteFileError> = serde_json::from_str(&local_var_content).ok();
3110        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3111        Err(Error::ResponseError(local_var_error))
3112    }
3113}
3114
3115/// 
3116pub async fn repos_slash_delete_invitation(configuration: &configuration::Configuration, owner: &str, repo: &str, invitation_id: i32) -> Result<(), Error<ReposSlashDeleteInvitationError>> {
3117    let local_var_configuration = configuration;
3118
3119    let local_var_client = &local_var_configuration.client;
3120
3121    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/invitations/{invitation_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), invitation_id=invitation_id);
3122    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3123
3124    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3125        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3126    }
3127
3128    let local_var_req = local_var_req_builder.build()?;
3129    let local_var_resp = local_var_client.execute(local_var_req).await?;
3130
3131    let local_var_status = local_var_resp.status();
3132    let local_var_content = local_var_resp.text().await?;
3133
3134    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3135        Ok(())
3136    } else {
3137        let local_var_entity: Option<ReposSlashDeleteInvitationError> = serde_json::from_str(&local_var_content).ok();
3138        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3139        Err(Error::ResponseError(local_var_error))
3140    }
3141}
3142
3143/// Delete a ruleset for an organization.
3144pub async fn repos_slash_delete_org_ruleset(configuration: &configuration::Configuration, org: &str, ruleset_id: i32) -> Result<(), Error<ReposSlashDeleteOrgRulesetError>> {
3145    let local_var_configuration = configuration;
3146
3147    let local_var_client = &local_var_configuration.client;
3148
3149    let local_var_uri_str = format!("{}/orgs/{org}/rulesets/{ruleset_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), ruleset_id=ruleset_id);
3150    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3151
3152    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3153        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3154    }
3155
3156    let local_var_req = local_var_req_builder.build()?;
3157    let local_var_resp = local_var_client.execute(local_var_req).await?;
3158
3159    let local_var_status = local_var_resp.status();
3160    let local_var_content = local_var_resp.text().await?;
3161
3162    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3163        Ok(())
3164    } else {
3165        let local_var_entity: Option<ReposSlashDeleteOrgRulesetError> = serde_json::from_str(&local_var_content).ok();
3166        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3167        Err(Error::ResponseError(local_var_error))
3168    }
3169}
3170
3171/// Deletes a GitHub Pages site. For more information, see \"[About GitHub Pages](/github/working-with-github-pages/about-github-pages).  The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
3172pub async fn repos_slash_delete_pages_site(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error<ReposSlashDeletePagesSiteError>> {
3173    let local_var_configuration = configuration;
3174
3175    let local_var_client = &local_var_configuration.client;
3176
3177    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pages", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
3178    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3179
3180    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3181        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3182    }
3183
3184    let local_var_req = local_var_req_builder.build()?;
3185    let local_var_resp = local_var_client.execute(local_var_req).await?;
3186
3187    let local_var_status = local_var_resp.status();
3188    let local_var_content = local_var_resp.text().await?;
3189
3190    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3191        Ok(())
3192    } else {
3193        let local_var_entity: Option<ReposSlashDeletePagesSiteError> = serde_json::from_str(&local_var_content).ok();
3194        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3195        Err(Error::ResponseError(local_var_error))
3196    }
3197}
3198
3199/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
3200pub async fn repos_slash_delete_pull_request_review_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<(), Error<ReposSlashDeletePullRequestReviewProtectionError>> {
3201    let local_var_configuration = configuration;
3202
3203    let local_var_client = &local_var_configuration.client;
3204
3205    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
3206    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3207
3208    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3209        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3210    }
3211
3212    let local_var_req = local_var_req_builder.build()?;
3213    let local_var_resp = local_var_client.execute(local_var_req).await?;
3214
3215    let local_var_status = local_var_resp.status();
3216    let local_var_content = local_var_resp.text().await?;
3217
3218    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3219        Ok(())
3220    } else {
3221        let local_var_entity: Option<ReposSlashDeletePullRequestReviewProtectionError> = serde_json::from_str(&local_var_content).ok();
3222        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3223        Err(Error::ResponseError(local_var_error))
3224    }
3225}
3226
3227/// Users with push access to the repository can delete a release.
3228pub async fn repos_slash_delete_release(configuration: &configuration::Configuration, owner: &str, repo: &str, release_id: i32) -> Result<(), Error<ReposSlashDeleteReleaseError>> {
3229    let local_var_configuration = configuration;
3230
3231    let local_var_client = &local_var_configuration.client;
3232
3233    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{release_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), release_id=release_id);
3234    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3235
3236    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3237        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3238    }
3239
3240    let local_var_req = local_var_req_builder.build()?;
3241    let local_var_resp = local_var_client.execute(local_var_req).await?;
3242
3243    let local_var_status = local_var_resp.status();
3244    let local_var_content = local_var_resp.text().await?;
3245
3246    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3247        Ok(())
3248    } else {
3249        let local_var_entity: Option<ReposSlashDeleteReleaseError> = serde_json::from_str(&local_var_content).ok();
3250        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3251        Err(Error::ResponseError(local_var_error))
3252    }
3253}
3254
3255/// 
3256pub async fn repos_slash_delete_release_asset(configuration: &configuration::Configuration, owner: &str, repo: &str, asset_id: i32) -> Result<(), Error<ReposSlashDeleteReleaseAssetError>> {
3257    let local_var_configuration = configuration;
3258
3259    let local_var_client = &local_var_configuration.client;
3260
3261    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/assets/{asset_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), asset_id=asset_id);
3262    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3263
3264    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3265        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3266    }
3267
3268    let local_var_req = local_var_req_builder.build()?;
3269    let local_var_resp = local_var_client.execute(local_var_req).await?;
3270
3271    let local_var_status = local_var_resp.status();
3272    let local_var_content = local_var_resp.text().await?;
3273
3274    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3275        Ok(())
3276    } else {
3277        let local_var_entity: Option<ReposSlashDeleteReleaseAssetError> = serde_json::from_str(&local_var_content).ok();
3278        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3279        Err(Error::ResponseError(local_var_error))
3280    }
3281}
3282
3283/// Delete a ruleset for a repository.
3284pub async fn repos_slash_delete_repo_ruleset(configuration: &configuration::Configuration, owner: &str, repo: &str, ruleset_id: i32) -> Result<(), Error<ReposSlashDeleteRepoRulesetError>> {
3285    let local_var_configuration = configuration;
3286
3287    let local_var_client = &local_var_configuration.client;
3288
3289    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/rulesets/{ruleset_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), ruleset_id=ruleset_id);
3290    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3291
3292    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3293        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3294    }
3295
3296    let local_var_req = local_var_req_builder.build()?;
3297    let local_var_resp = local_var_client.execute(local_var_req).await?;
3298
3299    let local_var_status = local_var_resp.status();
3300    let local_var_content = local_var_resp.text().await?;
3301
3302    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3303        Ok(())
3304    } else {
3305        let local_var_entity: Option<ReposSlashDeleteRepoRulesetError> = serde_json::from_str(&local_var_content).ok();
3306        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3307        Err(Error::ResponseError(local_var_error))
3308    }
3309}
3310
3311/// This deletes a tag protection state for a repository. This endpoint is only available to repository administrators.
3312pub async fn repos_slash_delete_tag_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, tag_protection_id: i32) -> Result<(), Error<ReposSlashDeleteTagProtectionError>> {
3313    let local_var_configuration = configuration;
3314
3315    let local_var_client = &local_var_configuration.client;
3316
3317    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/tags/protection/{tag_protection_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), tag_protection_id=tag_protection_id);
3318    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3319
3320    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3321        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3322    }
3323
3324    let local_var_req = local_var_req_builder.build()?;
3325    let local_var_resp = local_var_client.execute(local_var_req).await?;
3326
3327    let local_var_status = local_var_resp.status();
3328    let local_var_content = local_var_resp.text().await?;
3329
3330    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3331        Ok(())
3332    } else {
3333        let local_var_entity: Option<ReposSlashDeleteTagProtectionError> = serde_json::from_str(&local_var_content).ok();
3334        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3335        Err(Error::ResponseError(local_var_error))
3336    }
3337}
3338
3339/// 
3340pub async fn repos_slash_delete_webhook(configuration: &configuration::Configuration, owner: &str, repo: &str, hook_id: i32) -> Result<(), Error<ReposSlashDeleteWebhookError>> {
3341    let local_var_configuration = configuration;
3342
3343    let local_var_client = &local_var_configuration.client;
3344
3345    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/{hook_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), hook_id=hook_id);
3346    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3347
3348    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3349        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3350    }
3351
3352    let local_var_req = local_var_req_builder.build()?;
3353    let local_var_resp = local_var_client.execute(local_var_req).await?;
3354
3355    let local_var_status = local_var_resp.status();
3356    let local_var_content = local_var_resp.text().await?;
3357
3358    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3359        Ok(())
3360    } else {
3361        let local_var_entity: Option<ReposSlashDeleteWebhookError> = serde_json::from_str(&local_var_content).ok();
3362        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3363        Err(Error::ResponseError(local_var_error))
3364    }
3365}
3366
3367/// Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see \"[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)\".
3368pub async fn repos_slash_disable_automated_security_fixes(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error<ReposSlashDisableAutomatedSecurityFixesError>> {
3369    let local_var_configuration = configuration;
3370
3371    let local_var_client = &local_var_configuration.client;
3372
3373    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/automated-security-fixes", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
3374    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3375
3376    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3377        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3378    }
3379
3380    let local_var_req = local_var_req_builder.build()?;
3381    let local_var_resp = local_var_client.execute(local_var_req).await?;
3382
3383    let local_var_status = local_var_resp.status();
3384    let local_var_content = local_var_resp.text().await?;
3385
3386    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3387        Ok(())
3388    } else {
3389        let local_var_entity: Option<ReposSlashDisableAutomatedSecurityFixesError> = serde_json::from_str(&local_var_content).ok();
3390        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3391        Err(Error::ResponseError(local_var_error))
3392    }
3393}
3394
3395/// Disables a custom deployment protection rule for an environment.  The authenticated user must have admin or owner permissions to the repository to use this endpoint.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
3396pub async fn repos_slash_disable_deployment_protection_rule(configuration: &configuration::Configuration, environment_name: &str, repo: &str, owner: &str, protection_rule_id: i32) -> Result<(), Error<ReposSlashDisableDeploymentProtectionRuleError>> {
3397    let local_var_configuration = configuration;
3398
3399    let local_var_client = &local_var_configuration.client;
3400
3401    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}", local_var_configuration.base_path, environment_name=crate::apis::urlencode(environment_name), repo=crate::apis::urlencode(repo), owner=crate::apis::urlencode(owner), protection_rule_id=protection_rule_id);
3402    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3403
3404    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3405        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3406    }
3407
3408    let local_var_req = local_var_req_builder.build()?;
3409    let local_var_resp = local_var_client.execute(local_var_req).await?;
3410
3411    let local_var_status = local_var_resp.status();
3412    let local_var_content = local_var_resp.text().await?;
3413
3414    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3415        Ok(())
3416    } else {
3417        let local_var_entity: Option<ReposSlashDisableDeploymentProtectionRuleError> = serde_json::from_str(&local_var_content).ok();
3418        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3419        Err(Error::ResponseError(local_var_error))
3420    }
3421}
3422
3423/// Disables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see \"[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)\".
3424pub async fn repos_slash_disable_private_vulnerability_reporting(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error<ReposSlashDisablePrivateVulnerabilityReportingError>> {
3425    let local_var_configuration = configuration;
3426
3427    let local_var_client = &local_var_configuration.client;
3428
3429    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/private-vulnerability-reporting", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
3430    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3431
3432    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3433        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3434    }
3435
3436    let local_var_req = local_var_req_builder.build()?;
3437    let local_var_resp = local_var_client.execute(local_var_req).await?;
3438
3439    let local_var_status = local_var_resp.status();
3440    let local_var_content = local_var_resp.text().await?;
3441
3442    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3443        Ok(())
3444    } else {
3445        let local_var_entity: Option<ReposSlashDisablePrivateVulnerabilityReportingError> = serde_json::from_str(&local_var_content).ok();
3446        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3447        Err(Error::ResponseError(local_var_error))
3448    }
3449}
3450
3451/// Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see \"[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)\".
3452pub async fn repos_slash_disable_vulnerability_alerts(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error<ReposSlashDisableVulnerabilityAlertsError>> {
3453    let local_var_configuration = configuration;
3454
3455    let local_var_client = &local_var_configuration.client;
3456
3457    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/vulnerability-alerts", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
3458    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
3459
3460    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3461        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3462    }
3463
3464    let local_var_req = local_var_req_builder.build()?;
3465    let local_var_resp = local_var_client.execute(local_var_req).await?;
3466
3467    let local_var_status = local_var_resp.status();
3468    let local_var_content = local_var_resp.text().await?;
3469
3470    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3471        Ok(())
3472    } else {
3473        let local_var_entity: Option<ReposSlashDisableVulnerabilityAlertsError> = serde_json::from_str(&local_var_content).ok();
3474        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3475        Err(Error::ResponseError(local_var_error))
3476    }
3477}
3478
3479/// Gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually `main`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use the `Location` header to make a second `GET` request. **Note**: For private repositories, these links are temporary and expire after five minutes.
3480pub async fn repos_slash_download_tarball_archive(configuration: &configuration::Configuration, owner: &str, repo: &str, r#ref: &str) -> Result<(), Error<ReposSlashDownloadTarballArchiveError>> {
3481    let local_var_configuration = configuration;
3482
3483    let local_var_client = &local_var_configuration.client;
3484
3485    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/tarball/{ref}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), ref=crate::apis::urlencode(r#ref));
3486    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3487
3488    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3489        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3490    }
3491
3492    let local_var_req = local_var_req_builder.build()?;
3493    let local_var_resp = local_var_client.execute(local_var_req).await?;
3494
3495    let local_var_status = local_var_resp.status();
3496    let local_var_content = local_var_resp.text().await?;
3497
3498    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3499        Ok(())
3500    } else {
3501        let local_var_entity: Option<ReposSlashDownloadTarballArchiveError> = serde_json::from_str(&local_var_content).ok();
3502        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3503        Err(Error::ResponseError(local_var_error))
3504    }
3505}
3506
3507/// Gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually `main`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use the `Location` header to make a second `GET` request.  **Note**: For private repositories, these links are temporary and expire after five minutes. If the repository is empty, you will receive a 404 when you follow the redirect.
3508pub async fn repos_slash_download_zipball_archive(configuration: &configuration::Configuration, owner: &str, repo: &str, r#ref: &str) -> Result<(), Error<ReposSlashDownloadZipballArchiveError>> {
3509    let local_var_configuration = configuration;
3510
3511    let local_var_client = &local_var_configuration.client;
3512
3513    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/zipball/{ref}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), ref=crate::apis::urlencode(r#ref));
3514    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3515
3516    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3517        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3518    }
3519
3520    let local_var_req = local_var_req_builder.build()?;
3521    let local_var_resp = local_var_client.execute(local_var_req).await?;
3522
3523    let local_var_status = local_var_resp.status();
3524    let local_var_content = local_var_resp.text().await?;
3525
3526    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3527        Ok(())
3528    } else {
3529        let local_var_entity: Option<ReposSlashDownloadZipballArchiveError> = serde_json::from_str(&local_var_content).ok();
3530        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3531        Err(Error::ResponseError(local_var_error))
3532    }
3533}
3534
3535/// Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see \"[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)\".
3536pub async fn repos_slash_enable_automated_security_fixes(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error<ReposSlashEnableAutomatedSecurityFixesError>> {
3537    let local_var_configuration = configuration;
3538
3539    let local_var_client = &local_var_configuration.client;
3540
3541    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/automated-security-fixes", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
3542    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
3543
3544    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3545        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3546    }
3547
3548    let local_var_req = local_var_req_builder.build()?;
3549    let local_var_resp = local_var_client.execute(local_var_req).await?;
3550
3551    let local_var_status = local_var_resp.status();
3552    let local_var_content = local_var_resp.text().await?;
3553
3554    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3555        Ok(())
3556    } else {
3557        let local_var_entity: Option<ReposSlashEnableAutomatedSecurityFixesError> = serde_json::from_str(&local_var_content).ok();
3558        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3559        Err(Error::ResponseError(local_var_error))
3560    }
3561}
3562
3563/// Enables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see \"[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability).\"
3564pub async fn repos_slash_enable_private_vulnerability_reporting(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error<ReposSlashEnablePrivateVulnerabilityReportingError>> {
3565    let local_var_configuration = configuration;
3566
3567    let local_var_client = &local_var_configuration.client;
3568
3569    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/private-vulnerability-reporting", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
3570    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
3571
3572    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3573        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3574    }
3575
3576    let local_var_req = local_var_req_builder.build()?;
3577    let local_var_resp = local_var_client.execute(local_var_req).await?;
3578
3579    let local_var_status = local_var_resp.status();
3580    let local_var_content = local_var_resp.text().await?;
3581
3582    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3583        Ok(())
3584    } else {
3585        let local_var_entity: Option<ReposSlashEnablePrivateVulnerabilityReportingError> = serde_json::from_str(&local_var_content).ok();
3586        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3587        Err(Error::ResponseError(local_var_error))
3588    }
3589}
3590
3591/// Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see \"[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)\".
3592pub async fn repos_slash_enable_vulnerability_alerts(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error<ReposSlashEnableVulnerabilityAlertsError>> {
3593    let local_var_configuration = configuration;
3594
3595    let local_var_client = &local_var_configuration.client;
3596
3597    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/vulnerability-alerts", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
3598    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
3599
3600    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3601        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3602    }
3603
3604    let local_var_req = local_var_req_builder.build()?;
3605    let local_var_resp = local_var_client.execute(local_var_req).await?;
3606
3607    let local_var_status = local_var_resp.status();
3608    let local_var_content = local_var_resp.text().await?;
3609
3610    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3611        Ok(())
3612    } else {
3613        let local_var_entity: Option<ReposSlashEnableVulnerabilityAlertsError> = serde_json::from_str(&local_var_content).ok();
3614        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3615        Err(Error::ResponseError(local_var_error))
3616    }
3617}
3618
3619/// Generate a name and body describing a [release](https://docs.github.com/rest/releases/releases#get-a-release). The body content will be markdown formatted and contain information like the changes since last release and users who contributed. The generated release notes are not saved anywhere. They are intended to be generated and used when creating a new release.
3620pub async fn repos_slash_generate_release_notes(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_generate_release_notes_request: models::ReposGenerateReleaseNotesRequest) -> Result<models::ReleaseNotesContent, Error<ReposSlashGenerateReleaseNotesError>> {
3621    let local_var_configuration = configuration;
3622
3623    let local_var_client = &local_var_configuration.client;
3624
3625    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/generate-notes", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
3626    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3627
3628    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3629        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3630    }
3631    local_var_req_builder = local_var_req_builder.json(&repos_generate_release_notes_request);
3632
3633    let local_var_req = local_var_req_builder.build()?;
3634    let local_var_resp = local_var_client.execute(local_var_req).await?;
3635
3636    let local_var_status = local_var_resp.status();
3637    let local_var_content = local_var_resp.text().await?;
3638
3639    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3640        serde_json::from_str(&local_var_content).map_err(Error::from)
3641    } else {
3642        let local_var_entity: Option<ReposSlashGenerateReleaseNotesError> = serde_json::from_str(&local_var_content).ok();
3643        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3644        Err(Error::ResponseError(local_var_error))
3645    }
3646}
3647
3648/// The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network.  **Note:** In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see \"[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).\"
3649pub async fn repos_slash_get(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::FullRepository, Error<ReposSlashGetError>> {
3650    let local_var_configuration = configuration;
3651
3652    let local_var_client = &local_var_configuration.client;
3653
3654    let local_var_uri_str = format!("{}/repos/{owner}/{repo}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
3655    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3656
3657    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3658        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3659    }
3660
3661    let local_var_req = local_var_req_builder.build()?;
3662    let local_var_resp = local_var_client.execute(local_var_req).await?;
3663
3664    let local_var_status = local_var_resp.status();
3665    let local_var_content = local_var_resp.text().await?;
3666
3667    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3668        serde_json::from_str(&local_var_content).map_err(Error::from)
3669    } else {
3670        let local_var_entity: Option<ReposSlashGetError> = serde_json::from_str(&local_var_content).ok();
3671        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3672        Err(Error::ResponseError(local_var_error))
3673    }
3674}
3675
3676/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Lists who has access to this protected branch.  **Note**: Users, apps, and teams `restrictions` are only available for organization-owned repositories.
3677pub async fn repos_slash_get_access_restrictions(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<models::BranchRestrictionPolicy, Error<ReposSlashGetAccessRestrictionsError>> {
3678    let local_var_configuration = configuration;
3679
3680    let local_var_client = &local_var_configuration.client;
3681
3682    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/restrictions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
3683    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3684
3685    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3686        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3687    }
3688
3689    let local_var_req = local_var_req_builder.build()?;
3690    let local_var_resp = local_var_client.execute(local_var_req).await?;
3691
3692    let local_var_status = local_var_resp.status();
3693    let local_var_content = local_var_resp.text().await?;
3694
3695    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3696        serde_json::from_str(&local_var_content).map_err(Error::from)
3697    } else {
3698        let local_var_entity: Option<ReposSlashGetAccessRestrictionsError> = serde_json::from_str(&local_var_content).ok();
3699        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3700        Err(Error::ResponseError(local_var_error))
3701    }
3702}
3703
3704/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
3705pub async fn repos_slash_get_admin_branch_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<models::ProtectedBranchAdminEnforced, Error<ReposSlashGetAdminBranchProtectionError>> {
3706    let local_var_configuration = configuration;
3707
3708    let local_var_client = &local_var_configuration.client;
3709
3710    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
3711    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3712
3713    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3714        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3715    }
3716
3717    let local_var_req = local_var_req_builder.build()?;
3718    let local_var_resp = local_var_client.execute(local_var_req).await?;
3719
3720    let local_var_status = local_var_resp.status();
3721    let local_var_content = local_var_resp.text().await?;
3722
3723    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3724        serde_json::from_str(&local_var_content).map_err(Error::from)
3725    } else {
3726        let local_var_entity: Option<ReposSlashGetAdminBranchProtectionError> = serde_json::from_str(&local_var_content).ok();
3727        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3728        Err(Error::ResponseError(local_var_error))
3729    }
3730}
3731
3732/// Gets all custom deployment protection rules that are enabled for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see \"[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment).\"  For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app).  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
3733pub async fn repos_slash_get_all_deployment_protection_rules(configuration: &configuration::Configuration, environment_name: &str, repo: &str, owner: &str) -> Result<models::ReposGetAllDeploymentProtectionRules200Response, Error<ReposSlashGetAllDeploymentProtectionRulesError>> {
3734    let local_var_configuration = configuration;
3735
3736    let local_var_client = &local_var_configuration.client;
3737
3738    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules", local_var_configuration.base_path, environment_name=crate::apis::urlencode(environment_name), repo=crate::apis::urlencode(repo), owner=crate::apis::urlencode(owner));
3739    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3740
3741    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3742        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3743    }
3744
3745    let local_var_req = local_var_req_builder.build()?;
3746    let local_var_resp = local_var_client.execute(local_var_req).await?;
3747
3748    let local_var_status = local_var_resp.status();
3749    let local_var_content = local_var_resp.text().await?;
3750
3751    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3752        serde_json::from_str(&local_var_content).map_err(Error::from)
3753    } else {
3754        let local_var_entity: Option<ReposSlashGetAllDeploymentProtectionRulesError> = serde_json::from_str(&local_var_content).ok();
3755        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3756        Err(Error::ResponseError(local_var_error))
3757    }
3758}
3759
3760/// Lists the environments for a repository.  Anyone with read access to the repository can use this endpoint.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
3761pub async fn repos_slash_get_all_environments(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::ReposGetAllEnvironments200Response, Error<ReposSlashGetAllEnvironmentsError>> {
3762    let local_var_configuration = configuration;
3763
3764    let local_var_client = &local_var_configuration.client;
3765
3766    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
3767    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3768
3769    if let Some(ref local_var_str) = per_page {
3770        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
3771    }
3772    if let Some(ref local_var_str) = page {
3773        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3774    }
3775    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3776        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3777    }
3778
3779    let local_var_req = local_var_req_builder.build()?;
3780    let local_var_resp = local_var_client.execute(local_var_req).await?;
3781
3782    let local_var_status = local_var_resp.status();
3783    let local_var_content = local_var_resp.text().await?;
3784
3785    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3786        serde_json::from_str(&local_var_content).map_err(Error::from)
3787    } else {
3788        let local_var_entity: Option<ReposSlashGetAllEnvironmentsError> = serde_json::from_str(&local_var_content).ok();
3789        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3790        Err(Error::ResponseError(local_var_error))
3791    }
3792}
3793
3794/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
3795pub async fn repos_slash_get_all_status_check_contexts(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<Vec<String>, Error<ReposSlashGetAllStatusCheckContextsError>> {
3796    let local_var_configuration = configuration;
3797
3798    let local_var_client = &local_var_configuration.client;
3799
3800    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
3801    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3802
3803    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3804        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3805    }
3806
3807    let local_var_req = local_var_req_builder.build()?;
3808    let local_var_resp = local_var_client.execute(local_var_req).await?;
3809
3810    let local_var_status = local_var_resp.status();
3811    let local_var_content = local_var_resp.text().await?;
3812
3813    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3814        serde_json::from_str(&local_var_content).map_err(Error::from)
3815    } else {
3816        let local_var_entity: Option<ReposSlashGetAllStatusCheckContextsError> = serde_json::from_str(&local_var_content).ok();
3817        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3818        Err(Error::ResponseError(local_var_error))
3819    }
3820}
3821
3822/// 
3823pub async fn repos_slash_get_all_topics(configuration: &configuration::Configuration, owner: &str, repo: &str, page: Option<i32>, per_page: Option<i32>) -> Result<models::Topic, Error<ReposSlashGetAllTopicsError>> {
3824    let local_var_configuration = configuration;
3825
3826    let local_var_client = &local_var_configuration.client;
3827
3828    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/topics", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
3829    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3830
3831    if let Some(ref local_var_str) = page {
3832        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3833    }
3834    if let Some(ref local_var_str) = per_page {
3835        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
3836    }
3837    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3838        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3839    }
3840
3841    let local_var_req = local_var_req_builder.build()?;
3842    let local_var_resp = local_var_client.execute(local_var_req).await?;
3843
3844    let local_var_status = local_var_resp.status();
3845    let local_var_content = local_var_resp.text().await?;
3846
3847    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3848        serde_json::from_str(&local_var_content).map_err(Error::from)
3849    } else {
3850        let local_var_entity: Option<ReposSlashGetAllTopicsError> = serde_json::from_str(&local_var_content).ok();
3851        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3852        Err(Error::ResponseError(local_var_error))
3853    }
3854}
3855
3856/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Lists the GitHub Apps that have push access to this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch.
3857pub async fn repos_slash_get_apps_with_access_to_protected_branch(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<Vec<models::Integration>, Error<ReposSlashGetAppsWithAccessToProtectedBranchError>> {
3858    let local_var_configuration = configuration;
3859
3860    let local_var_client = &local_var_configuration.client;
3861
3862    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
3863    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3864
3865    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3866        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3867    }
3868
3869    let local_var_req = local_var_req_builder.build()?;
3870    let local_var_resp = local_var_client.execute(local_var_req).await?;
3871
3872    let local_var_status = local_var_resp.status();
3873    let local_var_content = local_var_resp.text().await?;
3874
3875    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3876        serde_json::from_str(&local_var_content).map_err(Error::from)
3877    } else {
3878        let local_var_entity: Option<ReposSlashGetAppsWithAccessToProtectedBranchError> = serde_json::from_str(&local_var_content).ok();
3879        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3880        Err(Error::ResponseError(local_var_error))
3881    }
3882}
3883
3884/// This returns a single autolink reference by ID that was configured for the given repository.  Information about autolinks are only available to repository administrators.
3885pub async fn repos_slash_get_autolink(configuration: &configuration::Configuration, owner: &str, repo: &str, autolink_id: i32) -> Result<models::Autolink, Error<ReposSlashGetAutolinkError>> {
3886    let local_var_configuration = configuration;
3887
3888    let local_var_client = &local_var_configuration.client;
3889
3890    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/autolinks/{autolink_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), autolink_id=autolink_id);
3891    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3892
3893    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3894        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3895    }
3896
3897    let local_var_req = local_var_req_builder.build()?;
3898    let local_var_resp = local_var_client.execute(local_var_req).await?;
3899
3900    let local_var_status = local_var_resp.status();
3901    let local_var_content = local_var_resp.text().await?;
3902
3903    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3904        serde_json::from_str(&local_var_content).map_err(Error::from)
3905    } else {
3906        let local_var_entity: Option<ReposSlashGetAutolinkError> = serde_json::from_str(&local_var_content).ok();
3907        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3908        Err(Error::ResponseError(local_var_error))
3909    }
3910}
3911
3912/// 
3913pub async fn repos_slash_get_branch(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<models::BranchWithProtection, Error<ReposSlashGetBranchError>> {
3914    let local_var_configuration = configuration;
3915
3916    let local_var_client = &local_var_configuration.client;
3917
3918    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
3919    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3920
3921    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3922        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3923    }
3924
3925    let local_var_req = local_var_req_builder.build()?;
3926    let local_var_resp = local_var_client.execute(local_var_req).await?;
3927
3928    let local_var_status = local_var_resp.status();
3929    let local_var_content = local_var_resp.text().await?;
3930
3931    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3932        serde_json::from_str(&local_var_content).map_err(Error::from)
3933    } else {
3934        let local_var_entity: Option<ReposSlashGetBranchError> = serde_json::from_str(&local_var_content).ok();
3935        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3936        Err(Error::ResponseError(local_var_error))
3937    }
3938}
3939
3940/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
3941pub async fn repos_slash_get_branch_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<models::BranchProtection, Error<ReposSlashGetBranchProtectionError>> {
3942    let local_var_configuration = configuration;
3943
3944    let local_var_client = &local_var_configuration.client;
3945
3946    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
3947    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3948
3949    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3950        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3951    }
3952
3953    let local_var_req = local_var_req_builder.build()?;
3954    let local_var_resp = local_var_client.execute(local_var_req).await?;
3955
3956    let local_var_status = local_var_resp.status();
3957    let local_var_content = local_var_resp.text().await?;
3958
3959    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3960        serde_json::from_str(&local_var_content).map_err(Error::from)
3961    } else {
3962        let local_var_entity: Option<ReposSlashGetBranchProtectionError> = serde_json::from_str(&local_var_content).ok();
3963        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3964        Err(Error::ResponseError(local_var_error))
3965    }
3966}
3967
3968/// Returns all active rules that apply to the specified branch. The branch does not need to exist; rules that would apply to a branch with that name will be returned. All active rules that apply will be returned, regardless of the level at which they are configured (e.g. repository or organization). Rules in rulesets with \"evaluate\" or \"disabled\" enforcement statuses are not returned.
3969pub async fn repos_slash_get_branch_rules(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::RepositoryRuleDetailed>, Error<ReposSlashGetBranchRulesError>> {
3970    let local_var_configuration = configuration;
3971
3972    let local_var_client = &local_var_configuration.client;
3973
3974    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/rules/branches/{branch}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
3975    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3976
3977    if let Some(ref local_var_str) = per_page {
3978        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
3979    }
3980    if let Some(ref local_var_str) = page {
3981        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3982    }
3983    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3984        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3985    }
3986
3987    let local_var_req = local_var_req_builder.build()?;
3988    let local_var_resp = local_var_client.execute(local_var_req).await?;
3989
3990    let local_var_status = local_var_resp.status();
3991    let local_var_content = local_var_resp.text().await?;
3992
3993    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3994        serde_json::from_str(&local_var_content).map_err(Error::from)
3995    } else {
3996        let local_var_entity: Option<ReposSlashGetBranchRulesError> = serde_json::from_str(&local_var_content).ok();
3997        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3998        Err(Error::ResponseError(local_var_error))
3999    }
4000}
4001
4002/// Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.
4003pub async fn repos_slash_get_clones(configuration: &configuration::Configuration, owner: &str, repo: &str, per: Option<&str>) -> Result<models::CloneTraffic, Error<ReposSlashGetClonesError>> {
4004    let local_var_configuration = configuration;
4005
4006    let local_var_client = &local_var_configuration.client;
4007
4008    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/traffic/clones", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4009    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4010
4011    if let Some(ref local_var_str) = per {
4012        local_var_req_builder = local_var_req_builder.query(&[("per", &local_var_str.to_string())]);
4013    }
4014    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4015        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4016    }
4017
4018    let local_var_req = local_var_req_builder.build()?;
4019    let local_var_resp = local_var_client.execute(local_var_req).await?;
4020
4021    let local_var_status = local_var_resp.status();
4022    let local_var_content = local_var_resp.text().await?;
4023
4024    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4025        serde_json::from_str(&local_var_content).map_err(Error::from)
4026    } else {
4027        let local_var_entity: Option<ReposSlashGetClonesError> = serde_json::from_str(&local_var_content).ok();
4028        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4029        Err(Error::ResponseError(local_var_error))
4030    }
4031}
4032
4033///  Returns a weekly aggregate of the number of additions and deletions pushed to a repository.  **Note:** This endpoint can only be used for repositories with fewer than 10,000 commits. If the repository contains 10,000 or more commits, a 422 status code will be returned. 
4034pub async fn repos_slash_get_code_frequency_stats(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<Vec<Vec<i32>>, Error<ReposSlashGetCodeFrequencyStatsError>> {
4035    let local_var_configuration = configuration;
4036
4037    let local_var_client = &local_var_configuration.client;
4038
4039    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/stats/code_frequency", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4040    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4041
4042    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4043        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4044    }
4045
4046    let local_var_req = local_var_req_builder.build()?;
4047    let local_var_resp = local_var_client.execute(local_var_req).await?;
4048
4049    let local_var_status = local_var_resp.status();
4050    let local_var_content = local_var_resp.text().await?;
4051
4052    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4053        serde_json::from_str(&local_var_content).map_err(Error::from)
4054    } else {
4055        let local_var_entity: Option<ReposSlashGetCodeFrequencyStatsError> = serde_json::from_str(&local_var_content).ok();
4056        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4057        Err(Error::ResponseError(local_var_error))
4058    }
4059}
4060
4061/// Checks the repository permission of a collaborator. The possible repository permissions are `admin`, `write`, `read`, and `none`.  *Note*: The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the `maintain` role is mapped to `write` and the `triage` role is mapped to `read`. To determine the role assigned to the collaborator, see the `role_name` attribute, which will provide the full role name, including custom roles. The `permissions` hash can also be used to determine which base level of access the collaborator has to the repository.
4062pub async fn repos_slash_get_collaborator_permission_level(configuration: &configuration::Configuration, owner: &str, repo: &str, username: &str) -> Result<models::RepositoryCollaboratorPermission, Error<ReposSlashGetCollaboratorPermissionLevelError>> {
4063    let local_var_configuration = configuration;
4064
4065    let local_var_client = &local_var_configuration.client;
4066
4067    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/collaborators/{username}/permission", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), username=crate::apis::urlencode(username));
4068    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4069
4070    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4071        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4072    }
4073
4074    let local_var_req = local_var_req_builder.build()?;
4075    let local_var_resp = local_var_client.execute(local_var_req).await?;
4076
4077    let local_var_status = local_var_resp.status();
4078    let local_var_content = local_var_resp.text().await?;
4079
4080    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4081        serde_json::from_str(&local_var_content).map_err(Error::from)
4082    } else {
4083        let local_var_entity: Option<ReposSlashGetCollaboratorPermissionLevelError> = serde_json::from_str(&local_var_content).ok();
4084        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4085        Err(Error::ResponseError(local_var_error))
4086    }
4087}
4088
4089/// Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name.   Additionally, a combined `state` is returned. The `state` is one of:  *   **failure** if any of the contexts report as `error` or `failure` *   **pending** if there are no statuses or a context is `pending` *   **success** if the latest status for all contexts is `success`
4090pub async fn repos_slash_get_combined_status_for_ref(configuration: &configuration::Configuration, owner: &str, repo: &str, r#ref: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::CombinedCommitStatus, Error<ReposSlashGetCombinedStatusForRefError>> {
4091    let local_var_configuration = configuration;
4092
4093    let local_var_client = &local_var_configuration.client;
4094
4095    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/commits/{ref}/status", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), ref=crate::apis::urlencode(r#ref));
4096    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4097
4098    if let Some(ref local_var_str) = per_page {
4099        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
4100    }
4101    if let Some(ref local_var_str) = page {
4102        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
4103    }
4104    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4105        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4106    }
4107
4108    let local_var_req = local_var_req_builder.build()?;
4109    let local_var_resp = local_var_client.execute(local_var_req).await?;
4110
4111    let local_var_status = local_var_resp.status();
4112    let local_var_content = local_var_resp.text().await?;
4113
4114    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4115        serde_json::from_str(&local_var_content).map_err(Error::from)
4116    } else {
4117        let local_var_entity: Option<ReposSlashGetCombinedStatusForRefError> = serde_json::from_str(&local_var_content).ok();
4118        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4119        Err(Error::ResponseError(local_var_error))
4120    }
4121}
4122
4123/// Returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.  **Note:** If there are more than 300 files in the commit diff and the default JSON media type is requested, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\" Pagination query parameters are not supported for these media types.  - **`application/vnd.github.diff`**: Returns the diff of the commit. Larger diffs may time out and return a 5xx status code. - **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property. Larger diffs may time out and return a 5xx status code. - **`application/vnd.github.sha`**: Returns the commit's SHA-1 hash. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.  **Signature verification object**  The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:  | Name | Type | Description | | ---- | ---- | ----------- | | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | `signature` | `string` | The signature that was extracted from the commit. | | `payload` | `string` | The value that was signed. |  These are the possible values for `reason` in the `verification` object:  | Value | Description | | ----- | ----------- | | `expired_key` | The key that made the signature is expired. | | `not_signing_key` | The \"signing\" flag is not among the usage flags in the GPG key that made the signature. | | `gpgverify_error` | There was an error communicating with the signature verification service. | | `gpgverify_unavailable` | The signature verification service is currently unavailable. | | `unsigned` | The object does not include a signature. | | `unknown_signature_type` | A non-PGP signature was found in the commit. | | `no_user` | No user was associated with the `committer` email address in the commit. | | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. | | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | | `unknown_key` | The key that made the signature has not been registered with any user's account. | | `malformed_signature` | There was an error parsing the signature. | | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | `valid` | None of the above errors applied, so the signature is considered to be verified. |
4124pub async fn repos_slash_get_commit(configuration: &configuration::Configuration, owner: &str, repo: &str, r#ref: &str, page: Option<i32>, per_page: Option<i32>) -> Result<models::Commit, Error<ReposSlashGetCommitError>> {
4125    let local_var_configuration = configuration;
4126
4127    let local_var_client = &local_var_configuration.client;
4128
4129    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/commits/{ref}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), ref=crate::apis::urlencode(r#ref));
4130    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4131
4132    if let Some(ref local_var_str) = page {
4133        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
4134    }
4135    if let Some(ref local_var_str) = per_page {
4136        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
4137    }
4138    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4139        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4140    }
4141
4142    let local_var_req = local_var_req_builder.build()?;
4143    let local_var_resp = local_var_client.execute(local_var_req).await?;
4144
4145    let local_var_status = local_var_resp.status();
4146    let local_var_content = local_var_resp.text().await?;
4147
4148    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4149        serde_json::from_str(&local_var_content).map_err(Error::from)
4150    } else {
4151        let local_var_entity: Option<ReposSlashGetCommitError> = serde_json::from_str(&local_var_content).ok();
4152        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4153        Err(Error::ResponseError(local_var_error))
4154    }
4155}
4156
4157/// Returns the last year of commit activity grouped by week. The `days` array is a group of commits per day, starting on `Sunday`.
4158pub async fn repos_slash_get_commit_activity_stats(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<Vec<models::CommitActivity>, Error<ReposSlashGetCommitActivityStatsError>> {
4159    let local_var_configuration = configuration;
4160
4161    let local_var_client = &local_var_configuration.client;
4162
4163    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/stats/commit_activity", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4164    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4165
4166    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4167        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4168    }
4169
4170    let local_var_req = local_var_req_builder.build()?;
4171    let local_var_resp = local_var_client.execute(local_var_req).await?;
4172
4173    let local_var_status = local_var_resp.status();
4174    let local_var_content = local_var_resp.text().await?;
4175
4176    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4177        serde_json::from_str(&local_var_content).map_err(Error::from)
4178    } else {
4179        let local_var_entity: Option<ReposSlashGetCommitActivityStatsError> = serde_json::from_str(&local_var_content).ok();
4180        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4181        Err(Error::ResponseError(local_var_error))
4182    }
4183}
4184
4185/// Gets a specified commit comment.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
4186pub async fn repos_slash_get_commit_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32) -> Result<models::CommitComment, Error<ReposSlashGetCommitCommentError>> {
4187    let local_var_configuration = configuration;
4188
4189    let local_var_client = &local_var_configuration.client;
4190
4191    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/comments/{comment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
4192    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4193
4194    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4195        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4196    }
4197
4198    let local_var_req = local_var_req_builder.build()?;
4199    let local_var_resp = local_var_client.execute(local_var_req).await?;
4200
4201    let local_var_status = local_var_resp.status();
4202    let local_var_content = local_var_resp.text().await?;
4203
4204    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4205        serde_json::from_str(&local_var_content).map_err(Error::from)
4206    } else {
4207        let local_var_entity: Option<ReposSlashGetCommitCommentError> = serde_json::from_str(&local_var_content).ok();
4208        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4209        Err(Error::ResponseError(local_var_error))
4210    }
4211}
4212
4213/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://docs.github.com/articles/signing-commits-with-gpg) in GitHub Help.  **Note**: You must enable branch protection to require signed commits.
4214pub async fn repos_slash_get_commit_signature_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<models::ProtectedBranchAdminEnforced, Error<ReposSlashGetCommitSignatureProtectionError>> {
4215    let local_var_configuration = configuration;
4216
4217    let local_var_client = &local_var_configuration.client;
4218
4219    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
4220    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4221
4222    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4223        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4224    }
4225
4226    let local_var_req = local_var_req_builder.build()?;
4227    let local_var_resp = local_var_client.execute(local_var_req).await?;
4228
4229    let local_var_status = local_var_resp.status();
4230    let local_var_content = local_var_resp.text().await?;
4231
4232    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4233        serde_json::from_str(&local_var_content).map_err(Error::from)
4234    } else {
4235        let local_var_entity: Option<ReposSlashGetCommitSignatureProtectionError> = serde_json::from_str(&local_var_content).ok();
4236        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4237        Err(Error::ResponseError(local_var_error))
4238    }
4239}
4240
4241/// Returns all community profile metrics for a repository. The repository cannot be a fork.  The returned metrics include an overall health score, the repository description, the presence of documentation, the detected code of conduct, the detected license, and the presence of ISSUE\\_TEMPLATE, PULL\\_REQUEST\\_TEMPLATE, README, and CONTRIBUTING files.  The `health_percentage` score is defined as a percentage of how many of the recommended community health files are present. For more information, see \"[About community profiles for public repositories](https://docs.github.com/communities/setting-up-your-project-for-healthy-contributions/about-community-profiles-for-public-repositories).\"  `content_reports_enabled` is only returned for organization-owned repositories.
4242pub async fn repos_slash_get_community_profile_metrics(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::CommunityProfile, Error<ReposSlashGetCommunityProfileMetricsError>> {
4243    let local_var_configuration = configuration;
4244
4245    let local_var_client = &local_var_configuration.client;
4246
4247    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/community/profile", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4248    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4249
4250    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4251        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4252    }
4253
4254    let local_var_req = local_var_req_builder.build()?;
4255    let local_var_resp = local_var_client.execute(local_var_req).await?;
4256
4257    let local_var_status = local_var_resp.status();
4258    let local_var_content = local_var_resp.text().await?;
4259
4260    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4261        serde_json::from_str(&local_var_content).map_err(Error::from)
4262    } else {
4263        let local_var_entity: Option<ReposSlashGetCommunityProfileMetricsError> = serde_json::from_str(&local_var_content).ok();
4264        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4265        Err(Error::ResponseError(local_var_error))
4266    }
4267}
4268
4269/// Gets the contents of a file or directory in a repository. Specify the file path or directory with the `path` parameter. If you omit the `path` parameter, you will receive the contents of the repository's root directory.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw file contents for files and symlinks. - **`application/vnd.github.html+json`**: Returns the file contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). - **`application/vnd.github.object+json`**: Returns the contents in a consistent object format regardless of the content type. For example, instead of an array of objects for a directory, the response will be an object with an `entries` attribute containing the array of objects.  If the content is a directory, the response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their \"type\" specified as \"file\". Logically, the value _should_ be \"submodule\". This behavior exists [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as \"submodule\".  If the content is a symlink and the symlink's target is a normal file in the repository, then the API responds with the content of the file. Otherwise, the API responds with an object describing the symlink itself.  If the content is a submodule, the `submodule_git_url` field identifies the location of the submodule repository, and the `sha` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links[\"git\"]`) and the github.com URLs (`html_url` and `_links[\"html\"]`) will have null values.  **Notes**:  - To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/git/trees#get-a-tree). - This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees API](https://docs.github.com/rest/git/trees#get-a-tree). - Download URLs expire and are meant to be used just once. To ensure the download URL does not expire, please use the contents API to obtain a fresh download URL for each download. - If the requested file's size is:   - 1 MB or smaller: All features of this endpoint are supported.   - Between 1-100 MB: Only the `raw` or `object` custom media types are supported. Both will work as normal, except that when using the `object` media type, the `content` field will be an empty string and the `encoding` field will be `\"none\"`. To get the contents of these larger files, use the `raw` media type.   - Greater than 100 MB: This endpoint is not supported.
4270pub async fn repos_slash_get_content(configuration: &configuration::Configuration, owner: &str, repo: &str, path: &str, r#ref: Option<&str>) -> Result<models::ContentTree, Error<ReposSlashGetContentError>> {
4271    let local_var_configuration = configuration;
4272
4273    let local_var_client = &local_var_configuration.client;
4274
4275    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/contents/{path}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), path=crate::apis::urlencode(path));
4276    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4277
4278    if let Some(ref local_var_str) = r#ref {
4279        local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]);
4280    }
4281    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4282        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4283    }
4284
4285    let local_var_req = local_var_req_builder.build()?;
4286    let local_var_resp = local_var_client.execute(local_var_req).await?;
4287
4288    let local_var_status = local_var_resp.status();
4289    let local_var_content = local_var_resp.text().await?;
4290
4291    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4292        serde_json::from_str(&local_var_content).map_err(Error::from)
4293    } else {
4294        let local_var_entity: Option<ReposSlashGetContentError> = serde_json::from_str(&local_var_content).ok();
4295        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4296        Err(Error::ResponseError(local_var_error))
4297    }
4298}
4299
4300///  Returns the `total` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (`weeks` array) with the following information:  *   `w` - Start of the week, given as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time). *   `a` - Number of additions *   `d` - Number of deletions *   `c` - Number of commits  **Note:** This endpoint will return `0` values for all addition and deletion counts in repositories with 10,000 or more commits.
4301pub async fn repos_slash_get_contributors_stats(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<Vec<models::ContributorActivity>, Error<ReposSlashGetContributorsStatsError>> {
4302    let local_var_configuration = configuration;
4303
4304    let local_var_client = &local_var_configuration.client;
4305
4306    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/stats/contributors", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4307    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4308
4309    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4310        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4311    }
4312
4313    let local_var_req = local_var_req_builder.build()?;
4314    let local_var_resp = local_var_client.execute(local_var_req).await?;
4315
4316    let local_var_status = local_var_resp.status();
4317    let local_var_content = local_var_resp.text().await?;
4318
4319    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4320        serde_json::from_str(&local_var_content).map_err(Error::from)
4321    } else {
4322        let local_var_entity: Option<ReposSlashGetContributorsStatsError> = serde_json::from_str(&local_var_content).ok();
4323        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4324        Err(Error::ResponseError(local_var_error))
4325    }
4326}
4327
4328/// Gets an enabled custom deployment protection rule for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see \"[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment).\"  For more information about the app that is providing this custom deployment rule, see [`GET /apps/{app_slug}`](https://docs.github.com/rest/apps/apps#get-an-app).  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
4329pub async fn repos_slash_get_custom_deployment_protection_rule(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str, protection_rule_id: i32) -> Result<models::DeploymentProtectionRule, Error<ReposSlashGetCustomDeploymentProtectionRuleError>> {
4330    let local_var_configuration = configuration;
4331
4332    let local_var_client = &local_var_configuration.client;
4333
4334    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name), protection_rule_id=protection_rule_id);
4335    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4336
4337    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4338        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4339    }
4340
4341    let local_var_req = local_var_req_builder.build()?;
4342    let local_var_resp = local_var_client.execute(local_var_req).await?;
4343
4344    let local_var_status = local_var_resp.status();
4345    let local_var_content = local_var_resp.text().await?;
4346
4347    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4348        serde_json::from_str(&local_var_content).map_err(Error::from)
4349    } else {
4350        let local_var_entity: Option<ReposSlashGetCustomDeploymentProtectionRuleError> = serde_json::from_str(&local_var_content).ok();
4351        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4352        Err(Error::ResponseError(local_var_error))
4353    }
4354}
4355
4356/// Gets all custom property values that are set for a repository. Users with read access to the repository can use this endpoint.
4357pub async fn repos_slash_get_custom_properties_values(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<Vec<models::CustomPropertyValue>, Error<ReposSlashGetCustomPropertiesValuesError>> {
4358    let local_var_configuration = configuration;
4359
4360    let local_var_client = &local_var_configuration.client;
4361
4362    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/properties/values", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4363    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4364
4365    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4366        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4367    }
4368
4369    let local_var_req = local_var_req_builder.build()?;
4370    let local_var_resp = local_var_client.execute(local_var_req).await?;
4371
4372    let local_var_status = local_var_resp.status();
4373    let local_var_content = local_var_resp.text().await?;
4374
4375    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4376        serde_json::from_str(&local_var_content).map_err(Error::from)
4377    } else {
4378        let local_var_entity: Option<ReposSlashGetCustomPropertiesValuesError> = serde_json::from_str(&local_var_content).ok();
4379        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4380        Err(Error::ResponseError(local_var_error))
4381    }
4382}
4383
4384/// 
4385pub async fn repos_slash_get_deploy_key(configuration: &configuration::Configuration, owner: &str, repo: &str, key_id: i32) -> Result<models::DeployKey, Error<ReposSlashGetDeployKeyError>> {
4386    let local_var_configuration = configuration;
4387
4388    let local_var_client = &local_var_configuration.client;
4389
4390    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/keys/{key_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), key_id=key_id);
4391    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4392
4393    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4394        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4395    }
4396
4397    let local_var_req = local_var_req_builder.build()?;
4398    let local_var_resp = local_var_client.execute(local_var_req).await?;
4399
4400    let local_var_status = local_var_resp.status();
4401    let local_var_content = local_var_resp.text().await?;
4402
4403    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4404        serde_json::from_str(&local_var_content).map_err(Error::from)
4405    } else {
4406        let local_var_entity: Option<ReposSlashGetDeployKeyError> = serde_json::from_str(&local_var_content).ok();
4407        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4408        Err(Error::ResponseError(local_var_error))
4409    }
4410}
4411
4412/// 
4413pub async fn repos_slash_get_deployment(configuration: &configuration::Configuration, owner: &str, repo: &str, deployment_id: i32) -> Result<models::Deployment, Error<ReposSlashGetDeploymentError>> {
4414    let local_var_configuration = configuration;
4415
4416    let local_var_client = &local_var_configuration.client;
4417
4418    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/deployments/{deployment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), deployment_id=deployment_id);
4419    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4420
4421    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4422        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4423    }
4424
4425    let local_var_req = local_var_req_builder.build()?;
4426    let local_var_resp = local_var_client.execute(local_var_req).await?;
4427
4428    let local_var_status = local_var_resp.status();
4429    let local_var_content = local_var_resp.text().await?;
4430
4431    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4432        serde_json::from_str(&local_var_content).map_err(Error::from)
4433    } else {
4434        let local_var_entity: Option<ReposSlashGetDeploymentError> = serde_json::from_str(&local_var_content).ok();
4435        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4436        Err(Error::ResponseError(local_var_error))
4437    }
4438}
4439
4440/// Gets a deployment branch or tag policy for an environment.  Anyone with read access to the repository can use this endpoint.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
4441pub async fn repos_slash_get_deployment_branch_policy(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str, branch_policy_id: i32) -> Result<models::DeploymentBranchPolicy, Error<ReposSlashGetDeploymentBranchPolicyError>> {
4442    let local_var_configuration = configuration;
4443
4444    let local_var_client = &local_var_configuration.client;
4445
4446    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name), branch_policy_id=branch_policy_id);
4447    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4448
4449    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4450        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4451    }
4452
4453    let local_var_req = local_var_req_builder.build()?;
4454    let local_var_resp = local_var_client.execute(local_var_req).await?;
4455
4456    let local_var_status = local_var_resp.status();
4457    let local_var_content = local_var_resp.text().await?;
4458
4459    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4460        serde_json::from_str(&local_var_content).map_err(Error::from)
4461    } else {
4462        let local_var_entity: Option<ReposSlashGetDeploymentBranchPolicyError> = serde_json::from_str(&local_var_content).ok();
4463        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4464        Err(Error::ResponseError(local_var_error))
4465    }
4466}
4467
4468/// Users with pull access can view a deployment status for a deployment:
4469pub async fn repos_slash_get_deployment_status(configuration: &configuration::Configuration, owner: &str, repo: &str, deployment_id: i32, status_id: i32) -> Result<models::DeploymentStatus, Error<ReposSlashGetDeploymentStatusError>> {
4470    let local_var_configuration = configuration;
4471
4472    let local_var_client = &local_var_configuration.client;
4473
4474    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), deployment_id=deployment_id, status_id=status_id);
4475    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4476
4477    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4478        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4479    }
4480
4481    let local_var_req = local_var_req_builder.build()?;
4482    let local_var_resp = local_var_client.execute(local_var_req).await?;
4483
4484    let local_var_status = local_var_resp.status();
4485    let local_var_content = local_var_resp.text().await?;
4486
4487    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4488        serde_json::from_str(&local_var_content).map_err(Error::from)
4489    } else {
4490        let local_var_entity: Option<ReposSlashGetDeploymentStatusError> = serde_json::from_str(&local_var_content).ok();
4491        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4492        Err(Error::ResponseError(local_var_error))
4493    }
4494}
4495
4496/// **Note:** To get information about name patterns that branches must match in order to deploy to this environment, see \"[Get a deployment branch policy](/rest/deployments/branch-policies#get-a-deployment-branch-policy).\"  Anyone with read access to the repository can use this endpoint.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
4497pub async fn repos_slash_get_environment(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str) -> Result<models::Environment, Error<ReposSlashGetEnvironmentError>> {
4498    let local_var_configuration = configuration;
4499
4500    let local_var_client = &local_var_configuration.client;
4501
4502    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name));
4503    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4504
4505    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4506        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4507    }
4508
4509    let local_var_req = local_var_req_builder.build()?;
4510    let local_var_resp = local_var_client.execute(local_var_req).await?;
4511
4512    let local_var_status = local_var_resp.status();
4513    let local_var_content = local_var_resp.text().await?;
4514
4515    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4516        serde_json::from_str(&local_var_content).map_err(Error::from)
4517    } else {
4518        let local_var_entity: Option<ReposSlashGetEnvironmentError> = serde_json::from_str(&local_var_content).ok();
4519        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4520        Err(Error::ResponseError(local_var_error))
4521    }
4522}
4523
4524/// Gets information about the single most recent build of a GitHub Pages site.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
4525pub async fn repos_slash_get_latest_pages_build(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::PageBuild, Error<ReposSlashGetLatestPagesBuildError>> {
4526    let local_var_configuration = configuration;
4527
4528    let local_var_client = &local_var_configuration.client;
4529
4530    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pages/builds/latest", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4531    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4532
4533    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4534        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4535    }
4536
4537    let local_var_req = local_var_req_builder.build()?;
4538    let local_var_resp = local_var_client.execute(local_var_req).await?;
4539
4540    let local_var_status = local_var_resp.status();
4541    let local_var_content = local_var_resp.text().await?;
4542
4543    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4544        serde_json::from_str(&local_var_content).map_err(Error::from)
4545    } else {
4546        let local_var_entity: Option<ReposSlashGetLatestPagesBuildError> = serde_json::from_str(&local_var_content).ok();
4547        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4548        Err(Error::ResponseError(local_var_error))
4549    }
4550}
4551
4552/// View the latest published full release for the repository.  The latest release is the most recent non-prerelease, non-draft release, sorted by the `created_at` attribute. The `created_at` attribute is the date of the commit used for the release, and not the date when the release was drafted or published.
4553pub async fn repos_slash_get_latest_release(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::Release, Error<ReposSlashGetLatestReleaseError>> {
4554    let local_var_configuration = configuration;
4555
4556    let local_var_client = &local_var_configuration.client;
4557
4558    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/latest", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4559    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4560
4561    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4562        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4563    }
4564
4565    let local_var_req = local_var_req_builder.build()?;
4566    let local_var_resp = local_var_client.execute(local_var_req).await?;
4567
4568    let local_var_status = local_var_resp.status();
4569    let local_var_content = local_var_resp.text().await?;
4570
4571    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4572        serde_json::from_str(&local_var_content).map_err(Error::from)
4573    } else {
4574        let local_var_entity: Option<ReposSlashGetLatestReleaseError> = serde_json::from_str(&local_var_content).ok();
4575        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4576        Err(Error::ResponseError(local_var_error))
4577    }
4578}
4579
4580/// Gets information about a suite of rule evaluations from within an organization. For more information, see \"[Managing rulesets for repositories in your organization](https://docs.github.com/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets).\"
4581pub async fn repos_slash_get_org_rule_suite(configuration: &configuration::Configuration, org: &str, rule_suite_id: i32) -> Result<models::RuleSuite, Error<ReposSlashGetOrgRuleSuiteError>> {
4582    let local_var_configuration = configuration;
4583
4584    let local_var_client = &local_var_configuration.client;
4585
4586    let local_var_uri_str = format!("{}/orgs/{org}/rulesets/rule-suites/{rule_suite_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), rule_suite_id=rule_suite_id);
4587    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4588
4589    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4590        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4591    }
4592
4593    let local_var_req = local_var_req_builder.build()?;
4594    let local_var_resp = local_var_client.execute(local_var_req).await?;
4595
4596    let local_var_status = local_var_resp.status();
4597    let local_var_content = local_var_resp.text().await?;
4598
4599    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4600        serde_json::from_str(&local_var_content).map_err(Error::from)
4601    } else {
4602        let local_var_entity: Option<ReposSlashGetOrgRuleSuiteError> = serde_json::from_str(&local_var_content).ok();
4603        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4604        Err(Error::ResponseError(local_var_error))
4605    }
4606}
4607
4608/// Lists suites of rule evaluations at the organization level. For more information, see \"[Managing rulesets for repositories in your organization](https://docs.github.com/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets).\"
4609pub async fn repos_slash_get_org_rule_suites(configuration: &configuration::Configuration, org: &str, repository_name: Option<i32>, time_period: Option<&str>, actor_name: Option<&str>, rule_suite_result: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::RuleSuitesInner>, Error<ReposSlashGetOrgRuleSuitesError>> {
4610    let local_var_configuration = configuration;
4611
4612    let local_var_client = &local_var_configuration.client;
4613
4614    let local_var_uri_str = format!("{}/orgs/{org}/rulesets/rule-suites", local_var_configuration.base_path, org=crate::apis::urlencode(org));
4615    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4616
4617    if let Some(ref local_var_str) = repository_name {
4618        local_var_req_builder = local_var_req_builder.query(&[("repository_name", &local_var_str.to_string())]);
4619    }
4620    if let Some(ref local_var_str) = time_period {
4621        local_var_req_builder = local_var_req_builder.query(&[("time_period", &local_var_str.to_string())]);
4622    }
4623    if let Some(ref local_var_str) = actor_name {
4624        local_var_req_builder = local_var_req_builder.query(&[("actor_name", &local_var_str.to_string())]);
4625    }
4626    if let Some(ref local_var_str) = rule_suite_result {
4627        local_var_req_builder = local_var_req_builder.query(&[("rule_suite_result", &local_var_str.to_string())]);
4628    }
4629    if let Some(ref local_var_str) = per_page {
4630        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
4631    }
4632    if let Some(ref local_var_str) = page {
4633        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
4634    }
4635    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4636        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4637    }
4638
4639    let local_var_req = local_var_req_builder.build()?;
4640    let local_var_resp = local_var_client.execute(local_var_req).await?;
4641
4642    let local_var_status = local_var_resp.status();
4643    let local_var_content = local_var_resp.text().await?;
4644
4645    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4646        serde_json::from_str(&local_var_content).map_err(Error::from)
4647    } else {
4648        let local_var_entity: Option<ReposSlashGetOrgRuleSuitesError> = serde_json::from_str(&local_var_content).ok();
4649        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4650        Err(Error::ResponseError(local_var_error))
4651    }
4652}
4653
4654/// Get a repository ruleset for an organization.
4655pub async fn repos_slash_get_org_ruleset(configuration: &configuration::Configuration, org: &str, ruleset_id: i32) -> Result<models::RepositoryRuleset, Error<ReposSlashGetOrgRulesetError>> {
4656    let local_var_configuration = configuration;
4657
4658    let local_var_client = &local_var_configuration.client;
4659
4660    let local_var_uri_str = format!("{}/orgs/{org}/rulesets/{ruleset_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), ruleset_id=ruleset_id);
4661    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4662
4663    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4664        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4665    }
4666
4667    let local_var_req = local_var_req_builder.build()?;
4668    let local_var_resp = local_var_client.execute(local_var_req).await?;
4669
4670    let local_var_status = local_var_resp.status();
4671    let local_var_content = local_var_resp.text().await?;
4672
4673    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4674        serde_json::from_str(&local_var_content).map_err(Error::from)
4675    } else {
4676        let local_var_entity: Option<ReposSlashGetOrgRulesetError> = serde_json::from_str(&local_var_content).ok();
4677        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4678        Err(Error::ResponseError(local_var_error))
4679    }
4680}
4681
4682/// Get all the repository rulesets for an organization.
4683pub async fn repos_slash_get_org_rulesets(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::RepositoryRuleset>, Error<ReposSlashGetOrgRulesetsError>> {
4684    let local_var_configuration = configuration;
4685
4686    let local_var_client = &local_var_configuration.client;
4687
4688    let local_var_uri_str = format!("{}/orgs/{org}/rulesets", local_var_configuration.base_path, org=crate::apis::urlencode(org));
4689    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4690
4691    if let Some(ref local_var_str) = per_page {
4692        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
4693    }
4694    if let Some(ref local_var_str) = page {
4695        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
4696    }
4697    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4698        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4699    }
4700
4701    let local_var_req = local_var_req_builder.build()?;
4702    let local_var_resp = local_var_client.execute(local_var_req).await?;
4703
4704    let local_var_status = local_var_resp.status();
4705    let local_var_content = local_var_resp.text().await?;
4706
4707    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4708        serde_json::from_str(&local_var_content).map_err(Error::from)
4709    } else {
4710        let local_var_entity: Option<ReposSlashGetOrgRulesetsError> = serde_json::from_str(&local_var_content).ok();
4711        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4712        Err(Error::ResponseError(local_var_error))
4713    }
4714}
4715
4716/// Gets information about a GitHub Pages site.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
4717pub async fn repos_slash_get_pages(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::Page, Error<ReposSlashGetPagesError>> {
4718    let local_var_configuration = configuration;
4719
4720    let local_var_client = &local_var_configuration.client;
4721
4722    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pages", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4723    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4724
4725    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4726        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4727    }
4728
4729    let local_var_req = local_var_req_builder.build()?;
4730    let local_var_resp = local_var_client.execute(local_var_req).await?;
4731
4732    let local_var_status = local_var_resp.status();
4733    let local_var_content = local_var_resp.text().await?;
4734
4735    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4736        serde_json::from_str(&local_var_content).map_err(Error::from)
4737    } else {
4738        let local_var_entity: Option<ReposSlashGetPagesError> = serde_json::from_str(&local_var_content).ok();
4739        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4740        Err(Error::ResponseError(local_var_error))
4741    }
4742}
4743
4744/// Gets information about a GitHub Pages build.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
4745pub async fn repos_slash_get_pages_build(configuration: &configuration::Configuration, owner: &str, repo: &str, build_id: i32) -> Result<models::PageBuild, Error<ReposSlashGetPagesBuildError>> {
4746    let local_var_configuration = configuration;
4747
4748    let local_var_client = &local_var_configuration.client;
4749
4750    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pages/builds/{build_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), build_id=build_id);
4751    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4752
4753    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4754        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4755    }
4756
4757    let local_var_req = local_var_req_builder.build()?;
4758    let local_var_resp = local_var_client.execute(local_var_req).await?;
4759
4760    let local_var_status = local_var_resp.status();
4761    let local_var_content = local_var_resp.text().await?;
4762
4763    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4764        serde_json::from_str(&local_var_content).map_err(Error::from)
4765    } else {
4766        let local_var_entity: Option<ReposSlashGetPagesBuildError> = serde_json::from_str(&local_var_content).ok();
4767        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4768        Err(Error::ResponseError(local_var_error))
4769    }
4770}
4771
4772/// Gets the current status of a GitHub Pages deployment.  The authenticated user must have read permission for the GitHub Pages site.
4773pub async fn repos_slash_get_pages_deployment(configuration: &configuration::Configuration, owner: &str, repo: &str, pages_deployment_id: models::ActionsGetWorkflowWorkflowIdParameter) -> Result<models::PagesDeploymentStatus, Error<ReposSlashGetPagesDeploymentError>> {
4774    let local_var_configuration = configuration;
4775
4776    let local_var_client = &local_var_configuration.client;
4777
4778    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pages_deployment_id=pages_deployment_id);
4779    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4780
4781    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4782        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4783    }
4784
4785    let local_var_req = local_var_req_builder.build()?;
4786    let local_var_resp = local_var_client.execute(local_var_req).await?;
4787
4788    let local_var_status = local_var_resp.status();
4789    let local_var_content = local_var_resp.text().await?;
4790
4791    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4792        serde_json::from_str(&local_var_content).map_err(Error::from)
4793    } else {
4794        let local_var_entity: Option<ReposSlashGetPagesDeploymentError> = serde_json::from_str(&local_var_content).ok();
4795        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4796        Err(Error::ResponseError(local_var_error))
4797    }
4798}
4799
4800/// Gets a health check of the DNS settings for the `CNAME` record configured for a repository's GitHub Pages.  The first request to this endpoint returns a `202 Accepted` status and starts an asynchronous background task to get the results for the domain. After the background task completes, subsequent requests to this endpoint return a `200 OK` status with the health check results in the response.  The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission to use this endpoint.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
4801pub async fn repos_slash_get_pages_health_check(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::PagesHealthCheck, Error<ReposSlashGetPagesHealthCheckError>> {
4802    let local_var_configuration = configuration;
4803
4804    let local_var_client = &local_var_configuration.client;
4805
4806    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pages/health", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4807    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4808
4809    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4810        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4811    }
4812
4813    let local_var_req = local_var_req_builder.build()?;
4814    let local_var_resp = local_var_client.execute(local_var_req).await?;
4815
4816    let local_var_status = local_var_resp.status();
4817    let local_var_content = local_var_resp.text().await?;
4818
4819    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4820        serde_json::from_str(&local_var_content).map_err(Error::from)
4821    } else {
4822        let local_var_entity: Option<ReposSlashGetPagesHealthCheckError> = serde_json::from_str(&local_var_content).ok();
4823        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4824        Err(Error::ResponseError(local_var_error))
4825    }
4826}
4827
4828/// Returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract `owner` from `all`.  The array order is oldest week (index 0) to most recent week.  The most recent week is seven days ago at UTC midnight to today at UTC midnight.
4829pub async fn repos_slash_get_participation_stats(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::ParticipationStats, Error<ReposSlashGetParticipationStatsError>> {
4830    let local_var_configuration = configuration;
4831
4832    let local_var_client = &local_var_configuration.client;
4833
4834    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/stats/participation", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4835    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4836
4837    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4838        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4839    }
4840
4841    let local_var_req = local_var_req_builder.build()?;
4842    let local_var_resp = local_var_client.execute(local_var_req).await?;
4843
4844    let local_var_status = local_var_resp.status();
4845    let local_var_content = local_var_resp.text().await?;
4846
4847    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4848        serde_json::from_str(&local_var_content).map_err(Error::from)
4849    } else {
4850        let local_var_entity: Option<ReposSlashGetParticipationStatsError> = serde_json::from_str(&local_var_content).ok();
4851        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4852        Err(Error::ResponseError(local_var_error))
4853    }
4854}
4855
4856/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
4857pub async fn repos_slash_get_pull_request_review_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<models::ProtectedBranchPullRequestReview, Error<ReposSlashGetPullRequestReviewProtectionError>> {
4858    let local_var_configuration = configuration;
4859
4860    let local_var_client = &local_var_configuration.client;
4861
4862    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
4863    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4864
4865    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4866        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4867    }
4868
4869    let local_var_req = local_var_req_builder.build()?;
4870    let local_var_resp = local_var_client.execute(local_var_req).await?;
4871
4872    let local_var_status = local_var_resp.status();
4873    let local_var_content = local_var_resp.text().await?;
4874
4875    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4876        serde_json::from_str(&local_var_content).map_err(Error::from)
4877    } else {
4878        let local_var_entity: Option<ReposSlashGetPullRequestReviewProtectionError> = serde_json::from_str(&local_var_content).ok();
4879        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4880        Err(Error::ResponseError(local_var_error))
4881    }
4882}
4883
4884/// Each array contains the day number, hour number, and number of commits:  *   `0-6`: Sunday - Saturday *   `0-23`: Hour of day *   Number of commits  For example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits.
4885pub async fn repos_slash_get_punch_card_stats(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<Vec<Vec<i32>>, Error<ReposSlashGetPunchCardStatsError>> {
4886    let local_var_configuration = configuration;
4887
4888    let local_var_client = &local_var_configuration.client;
4889
4890    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/stats/punch_card", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4891    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4892
4893    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4894        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4895    }
4896
4897    let local_var_req = local_var_req_builder.build()?;
4898    let local_var_resp = local_var_client.execute(local_var_req).await?;
4899
4900    let local_var_status = local_var_resp.status();
4901    let local_var_content = local_var_resp.text().await?;
4902
4903    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4904        serde_json::from_str(&local_var_content).map_err(Error::from)
4905    } else {
4906        let local_var_entity: Option<ReposSlashGetPunchCardStatsError> = serde_json::from_str(&local_var_content).ok();
4907        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4908        Err(Error::ResponseError(local_var_error))
4909    }
4910}
4911
4912/// Gets the preferred README for a repository.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type. - **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).
4913pub async fn repos_slash_get_readme(configuration: &configuration::Configuration, owner: &str, repo: &str, r#ref: Option<&str>) -> Result<models::ContentFile, Error<ReposSlashGetReadmeError>> {
4914    let local_var_configuration = configuration;
4915
4916    let local_var_client = &local_var_configuration.client;
4917
4918    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/readme", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4919    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4920
4921    if let Some(ref local_var_str) = r#ref {
4922        local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]);
4923    }
4924    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4925        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4926    }
4927
4928    let local_var_req = local_var_req_builder.build()?;
4929    let local_var_resp = local_var_client.execute(local_var_req).await?;
4930
4931    let local_var_status = local_var_resp.status();
4932    let local_var_content = local_var_resp.text().await?;
4933
4934    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4935        serde_json::from_str(&local_var_content).map_err(Error::from)
4936    } else {
4937        let local_var_entity: Option<ReposSlashGetReadmeError> = serde_json::from_str(&local_var_content).ok();
4938        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4939        Err(Error::ResponseError(local_var_error))
4940    }
4941}
4942
4943/// Gets the README from a repository directory.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type. - **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).
4944pub async fn repos_slash_get_readme_in_directory(configuration: &configuration::Configuration, owner: &str, repo: &str, dir: &str, r#ref: Option<&str>) -> Result<models::ContentFile, Error<ReposSlashGetReadmeInDirectoryError>> {
4945    let local_var_configuration = configuration;
4946
4947    let local_var_client = &local_var_configuration.client;
4948
4949    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/readme/{dir}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), dir=crate::apis::urlencode(dir));
4950    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4951
4952    if let Some(ref local_var_str) = r#ref {
4953        local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]);
4954    }
4955    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4956        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4957    }
4958
4959    let local_var_req = local_var_req_builder.build()?;
4960    let local_var_resp = local_var_client.execute(local_var_req).await?;
4961
4962    let local_var_status = local_var_resp.status();
4963    let local_var_content = local_var_resp.text().await?;
4964
4965    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4966        serde_json::from_str(&local_var_content).map_err(Error::from)
4967    } else {
4968        let local_var_entity: Option<ReposSlashGetReadmeInDirectoryError> = serde_json::from_str(&local_var_content).ok();
4969        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4970        Err(Error::ResponseError(local_var_error))
4971    }
4972}
4973
4974/// Gets a public release with the specified release ID.  **Note:** This returns an `upload_url` key corresponding to the endpoint for uploading release assets. This key is a hypermedia resource. For more information, see \"[Getting started with the REST API](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia).\"
4975pub async fn repos_slash_get_release(configuration: &configuration::Configuration, owner: &str, repo: &str, release_id: i32) -> Result<models::Release, Error<ReposSlashGetReleaseError>> {
4976    let local_var_configuration = configuration;
4977
4978    let local_var_client = &local_var_configuration.client;
4979
4980    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{release_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), release_id=release_id);
4981    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4982
4983    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4984        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4985    }
4986
4987    let local_var_req = local_var_req_builder.build()?;
4988    let local_var_resp = local_var_client.execute(local_var_req).await?;
4989
4990    let local_var_status = local_var_resp.status();
4991    let local_var_content = local_var_resp.text().await?;
4992
4993    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4994        serde_json::from_str(&local_var_content).map_err(Error::from)
4995    } else {
4996        let local_var_entity: Option<ReposSlashGetReleaseError> = serde_json::from_str(&local_var_content).ok();
4997        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4998        Err(Error::ResponseError(local_var_error))
4999    }
5000}
5001
5002/// To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response.
5003pub async fn repos_slash_get_release_asset(configuration: &configuration::Configuration, owner: &str, repo: &str, asset_id: i32) -> Result<models::ReleaseAsset, Error<ReposSlashGetReleaseAssetError>> {
5004    let local_var_configuration = configuration;
5005
5006    let local_var_client = &local_var_configuration.client;
5007
5008    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/assets/{asset_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), asset_id=asset_id);
5009    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5010
5011    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5012        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5013    }
5014
5015    let local_var_req = local_var_req_builder.build()?;
5016    let local_var_resp = local_var_client.execute(local_var_req).await?;
5017
5018    let local_var_status = local_var_resp.status();
5019    let local_var_content = local_var_resp.text().await?;
5020
5021    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5022        serde_json::from_str(&local_var_content).map_err(Error::from)
5023    } else {
5024        let local_var_entity: Option<ReposSlashGetReleaseAssetError> = serde_json::from_str(&local_var_content).ok();
5025        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5026        Err(Error::ResponseError(local_var_error))
5027    }
5028}
5029
5030/// Get a published release with the specified tag.
5031pub async fn repos_slash_get_release_by_tag(configuration: &configuration::Configuration, owner: &str, repo: &str, tag: &str) -> Result<models::Release, Error<ReposSlashGetReleaseByTagError>> {
5032    let local_var_configuration = configuration;
5033
5034    let local_var_client = &local_var_configuration.client;
5035
5036    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/tags/{tag}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), tag=crate::apis::urlencode(tag));
5037    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5038
5039    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5040        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5041    }
5042
5043    let local_var_req = local_var_req_builder.build()?;
5044    let local_var_resp = local_var_client.execute(local_var_req).await?;
5045
5046    let local_var_status = local_var_resp.status();
5047    let local_var_content = local_var_resp.text().await?;
5048
5049    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5050        serde_json::from_str(&local_var_content).map_err(Error::from)
5051    } else {
5052        let local_var_entity: Option<ReposSlashGetReleaseByTagError> = serde_json::from_str(&local_var_content).ok();
5053        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5054        Err(Error::ResponseError(local_var_error))
5055    }
5056}
5057
5058/// Gets information about a suite of rule evaluations from within a repository. For more information, see \"[Managing rulesets for a repository](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets).\"
5059pub async fn repos_slash_get_repo_rule_suite(configuration: &configuration::Configuration, owner: &str, repo: &str, rule_suite_id: i32) -> Result<models::RuleSuite, Error<ReposSlashGetRepoRuleSuiteError>> {
5060    let local_var_configuration = configuration;
5061
5062    let local_var_client = &local_var_configuration.client;
5063
5064    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), rule_suite_id=rule_suite_id);
5065    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5066
5067    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5068        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5069    }
5070
5071    let local_var_req = local_var_req_builder.build()?;
5072    let local_var_resp = local_var_client.execute(local_var_req).await?;
5073
5074    let local_var_status = local_var_resp.status();
5075    let local_var_content = local_var_resp.text().await?;
5076
5077    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5078        serde_json::from_str(&local_var_content).map_err(Error::from)
5079    } else {
5080        let local_var_entity: Option<ReposSlashGetRepoRuleSuiteError> = serde_json::from_str(&local_var_content).ok();
5081        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5082        Err(Error::ResponseError(local_var_error))
5083    }
5084}
5085
5086/// Lists suites of rule evaluations at the repository level. For more information, see \"[Managing rulesets for a repository](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets).\"
5087pub async fn repos_slash_get_repo_rule_suites(configuration: &configuration::Configuration, owner: &str, repo: &str, r#ref: Option<&str>, time_period: Option<&str>, actor_name: Option<&str>, rule_suite_result: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::RuleSuitesInner>, Error<ReposSlashGetRepoRuleSuitesError>> {
5088    let local_var_configuration = configuration;
5089
5090    let local_var_client = &local_var_configuration.client;
5091
5092    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/rulesets/rule-suites", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
5093    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5094
5095    if let Some(ref local_var_str) = r#ref {
5096        local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]);
5097    }
5098    if let Some(ref local_var_str) = time_period {
5099        local_var_req_builder = local_var_req_builder.query(&[("time_period", &local_var_str.to_string())]);
5100    }
5101    if let Some(ref local_var_str) = actor_name {
5102        local_var_req_builder = local_var_req_builder.query(&[("actor_name", &local_var_str.to_string())]);
5103    }
5104    if let Some(ref local_var_str) = rule_suite_result {
5105        local_var_req_builder = local_var_req_builder.query(&[("rule_suite_result", &local_var_str.to_string())]);
5106    }
5107    if let Some(ref local_var_str) = per_page {
5108        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5109    }
5110    if let Some(ref local_var_str) = page {
5111        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5112    }
5113    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5114        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5115    }
5116
5117    let local_var_req = local_var_req_builder.build()?;
5118    let local_var_resp = local_var_client.execute(local_var_req).await?;
5119
5120    let local_var_status = local_var_resp.status();
5121    let local_var_content = local_var_resp.text().await?;
5122
5123    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5124        serde_json::from_str(&local_var_content).map_err(Error::from)
5125    } else {
5126        let local_var_entity: Option<ReposSlashGetRepoRuleSuitesError> = serde_json::from_str(&local_var_content).ok();
5127        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5128        Err(Error::ResponseError(local_var_error))
5129    }
5130}
5131
5132/// Get a ruleset for a repository.
5133pub async fn repos_slash_get_repo_ruleset(configuration: &configuration::Configuration, owner: &str, repo: &str, ruleset_id: i32, includes_parents: Option<bool>) -> Result<models::RepositoryRuleset, Error<ReposSlashGetRepoRulesetError>> {
5134    let local_var_configuration = configuration;
5135
5136    let local_var_client = &local_var_configuration.client;
5137
5138    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/rulesets/{ruleset_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), ruleset_id=ruleset_id);
5139    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5140
5141    if let Some(ref local_var_str) = includes_parents {
5142        local_var_req_builder = local_var_req_builder.query(&[("includes_parents", &local_var_str.to_string())]);
5143    }
5144    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5145        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5146    }
5147
5148    let local_var_req = local_var_req_builder.build()?;
5149    let local_var_resp = local_var_client.execute(local_var_req).await?;
5150
5151    let local_var_status = local_var_resp.status();
5152    let local_var_content = local_var_resp.text().await?;
5153
5154    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5155        serde_json::from_str(&local_var_content).map_err(Error::from)
5156    } else {
5157        let local_var_entity: Option<ReposSlashGetRepoRulesetError> = serde_json::from_str(&local_var_content).ok();
5158        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5159        Err(Error::ResponseError(local_var_error))
5160    }
5161}
5162
5163/// Get all the rulesets for a repository.
5164pub async fn repos_slash_get_repo_rulesets(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>, includes_parents: Option<bool>) -> Result<Vec<models::RepositoryRuleset>, Error<ReposSlashGetRepoRulesetsError>> {
5165    let local_var_configuration = configuration;
5166
5167    let local_var_client = &local_var_configuration.client;
5168
5169    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/rulesets", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
5170    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5171
5172    if let Some(ref local_var_str) = per_page {
5173        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5174    }
5175    if let Some(ref local_var_str) = page {
5176        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5177    }
5178    if let Some(ref local_var_str) = includes_parents {
5179        local_var_req_builder = local_var_req_builder.query(&[("includes_parents", &local_var_str.to_string())]);
5180    }
5181    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5182        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5183    }
5184
5185    let local_var_req = local_var_req_builder.build()?;
5186    let local_var_resp = local_var_client.execute(local_var_req).await?;
5187
5188    let local_var_status = local_var_resp.status();
5189    let local_var_content = local_var_resp.text().await?;
5190
5191    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5192        serde_json::from_str(&local_var_content).map_err(Error::from)
5193    } else {
5194        let local_var_entity: Option<ReposSlashGetRepoRulesetsError> = serde_json::from_str(&local_var_content).ok();
5195        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5196        Err(Error::ResponseError(local_var_error))
5197    }
5198}
5199
5200/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
5201pub async fn repos_slash_get_status_checks_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<models::StatusCheckPolicy, Error<ReposSlashGetStatusChecksProtectionError>> {
5202    let local_var_configuration = configuration;
5203
5204    let local_var_client = &local_var_configuration.client;
5205
5206    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
5207    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5208
5209    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5210        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5211    }
5212
5213    let local_var_req = local_var_req_builder.build()?;
5214    let local_var_resp = local_var_client.execute(local_var_req).await?;
5215
5216    let local_var_status = local_var_resp.status();
5217    let local_var_content = local_var_resp.text().await?;
5218
5219    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5220        serde_json::from_str(&local_var_content).map_err(Error::from)
5221    } else {
5222        let local_var_entity: Option<ReposSlashGetStatusChecksProtectionError> = serde_json::from_str(&local_var_content).ok();
5223        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5224        Err(Error::ResponseError(local_var_error))
5225    }
5226}
5227
5228/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Lists the teams who have push access to this branch. The list includes child teams.
5229pub async fn repos_slash_get_teams_with_access_to_protected_branch(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<Vec<models::Team>, Error<ReposSlashGetTeamsWithAccessToProtectedBranchError>> {
5230    let local_var_configuration = configuration;
5231
5232    let local_var_client = &local_var_configuration.client;
5233
5234    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
5235    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5236
5237    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5238        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5239    }
5240
5241    let local_var_req = local_var_req_builder.build()?;
5242    let local_var_resp = local_var_client.execute(local_var_req).await?;
5243
5244    let local_var_status = local_var_resp.status();
5245    let local_var_content = local_var_resp.text().await?;
5246
5247    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5248        serde_json::from_str(&local_var_content).map_err(Error::from)
5249    } else {
5250        let local_var_entity: Option<ReposSlashGetTeamsWithAccessToProtectedBranchError> = serde_json::from_str(&local_var_content).ok();
5251        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5252        Err(Error::ResponseError(local_var_error))
5253    }
5254}
5255
5256/// Get the top 10 popular contents over the last 14 days.
5257pub async fn repos_slash_get_top_paths(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<Vec<models::ContentTraffic>, Error<ReposSlashGetTopPathsError>> {
5258    let local_var_configuration = configuration;
5259
5260    let local_var_client = &local_var_configuration.client;
5261
5262    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/traffic/popular/paths", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
5263    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5264
5265    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5266        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5267    }
5268
5269    let local_var_req = local_var_req_builder.build()?;
5270    let local_var_resp = local_var_client.execute(local_var_req).await?;
5271
5272    let local_var_status = local_var_resp.status();
5273    let local_var_content = local_var_resp.text().await?;
5274
5275    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5276        serde_json::from_str(&local_var_content).map_err(Error::from)
5277    } else {
5278        let local_var_entity: Option<ReposSlashGetTopPathsError> = serde_json::from_str(&local_var_content).ok();
5279        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5280        Err(Error::ResponseError(local_var_error))
5281    }
5282}
5283
5284/// Get the top 10 referrers over the last 14 days.
5285pub async fn repos_slash_get_top_referrers(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<Vec<models::ReferrerTraffic>, Error<ReposSlashGetTopReferrersError>> {
5286    let local_var_configuration = configuration;
5287
5288    let local_var_client = &local_var_configuration.client;
5289
5290    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/traffic/popular/referrers", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
5291    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5292
5293    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5294        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5295    }
5296
5297    let local_var_req = local_var_req_builder.build()?;
5298    let local_var_resp = local_var_client.execute(local_var_req).await?;
5299
5300    let local_var_status = local_var_resp.status();
5301    let local_var_content = local_var_resp.text().await?;
5302
5303    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5304        serde_json::from_str(&local_var_content).map_err(Error::from)
5305    } else {
5306        let local_var_entity: Option<ReposSlashGetTopReferrersError> = serde_json::from_str(&local_var_content).ok();
5307        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5308        Err(Error::ResponseError(local_var_error))
5309    }
5310}
5311
5312/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Lists the people who have push access to this branch.
5313pub async fn repos_slash_get_users_with_access_to_protected_branch(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<Vec<models::SimpleUser>, Error<ReposSlashGetUsersWithAccessToProtectedBranchError>> {
5314    let local_var_configuration = configuration;
5315
5316    let local_var_client = &local_var_configuration.client;
5317
5318    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
5319    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5320
5321    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5322        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5323    }
5324
5325    let local_var_req = local_var_req_builder.build()?;
5326    let local_var_resp = local_var_client.execute(local_var_req).await?;
5327
5328    let local_var_status = local_var_resp.status();
5329    let local_var_content = local_var_resp.text().await?;
5330
5331    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5332        serde_json::from_str(&local_var_content).map_err(Error::from)
5333    } else {
5334        let local_var_entity: Option<ReposSlashGetUsersWithAccessToProtectedBranchError> = serde_json::from_str(&local_var_content).ok();
5335        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5336        Err(Error::ResponseError(local_var_error))
5337    }
5338}
5339
5340/// Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.
5341pub async fn repos_slash_get_views(configuration: &configuration::Configuration, owner: &str, repo: &str, per: Option<&str>) -> Result<models::ViewTraffic, Error<ReposSlashGetViewsError>> {
5342    let local_var_configuration = configuration;
5343
5344    let local_var_client = &local_var_configuration.client;
5345
5346    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/traffic/views", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
5347    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5348
5349    if let Some(ref local_var_str) = per {
5350        local_var_req_builder = local_var_req_builder.query(&[("per", &local_var_str.to_string())]);
5351    }
5352    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5353        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5354    }
5355
5356    let local_var_req = local_var_req_builder.build()?;
5357    let local_var_resp = local_var_client.execute(local_var_req).await?;
5358
5359    let local_var_status = local_var_resp.status();
5360    let local_var_content = local_var_resp.text().await?;
5361
5362    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5363        serde_json::from_str(&local_var_content).map_err(Error::from)
5364    } else {
5365        let local_var_entity: Option<ReposSlashGetViewsError> = serde_json::from_str(&local_var_content).ok();
5366        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5367        Err(Error::ResponseError(local_var_error))
5368    }
5369}
5370
5371/// Returns a webhook configured in a repository. To get only the webhook `config` properties, see \"[Get a webhook configuration for a repository](/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository).\"
5372pub async fn repos_slash_get_webhook(configuration: &configuration::Configuration, owner: &str, repo: &str, hook_id: i32) -> Result<models::Hook, Error<ReposSlashGetWebhookError>> {
5373    let local_var_configuration = configuration;
5374
5375    let local_var_client = &local_var_configuration.client;
5376
5377    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/{hook_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), hook_id=hook_id);
5378    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5379
5380    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5381        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5382    }
5383
5384    let local_var_req = local_var_req_builder.build()?;
5385    let local_var_resp = local_var_client.execute(local_var_req).await?;
5386
5387    let local_var_status = local_var_resp.status();
5388    let local_var_content = local_var_resp.text().await?;
5389
5390    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5391        serde_json::from_str(&local_var_content).map_err(Error::from)
5392    } else {
5393        let local_var_entity: Option<ReposSlashGetWebhookError> = serde_json::from_str(&local_var_content).ok();
5394        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5395        Err(Error::ResponseError(local_var_error))
5396    }
5397}
5398
5399/// Returns the webhook configuration for a repository. To get more information about the webhook, including the `active` state and `events`, use \"[Get a repository webhook](/rest/webhooks/repos#get-a-repository-webhook).\"  OAuth app tokens and personal access tokens (classic) need the `read:repo_hook` or `repo` scope to use this endpoint.
5400pub async fn repos_slash_get_webhook_config_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, hook_id: i32) -> Result<models::WebhookConfig, Error<ReposSlashGetWebhookConfigForRepoError>> {
5401    let local_var_configuration = configuration;
5402
5403    let local_var_client = &local_var_configuration.client;
5404
5405    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/{hook_id}/config", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), hook_id=hook_id);
5406    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5407
5408    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5409        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5410    }
5411
5412    let local_var_req = local_var_req_builder.build()?;
5413    let local_var_resp = local_var_client.execute(local_var_req).await?;
5414
5415    let local_var_status = local_var_resp.status();
5416    let local_var_content = local_var_resp.text().await?;
5417
5418    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5419        serde_json::from_str(&local_var_content).map_err(Error::from)
5420    } else {
5421        let local_var_entity: Option<ReposSlashGetWebhookConfigForRepoError> = serde_json::from_str(&local_var_content).ok();
5422        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5423        Err(Error::ResponseError(local_var_error))
5424    }
5425}
5426
5427/// Returns a delivery for a webhook configured in a repository.
5428pub async fn repos_slash_get_webhook_delivery(configuration: &configuration::Configuration, owner: &str, repo: &str, hook_id: i32, delivery_id: i32) -> Result<models::HookDelivery, Error<ReposSlashGetWebhookDeliveryError>> {
5429    let local_var_configuration = configuration;
5430
5431    let local_var_client = &local_var_configuration.client;
5432
5433    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), hook_id=hook_id, delivery_id=delivery_id);
5434    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5435
5436    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5437        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5438    }
5439
5440    let local_var_req = local_var_req_builder.build()?;
5441    let local_var_resp = local_var_client.execute(local_var_req).await?;
5442
5443    let local_var_status = local_var_resp.status();
5444    let local_var_content = local_var_resp.text().await?;
5445
5446    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5447        serde_json::from_str(&local_var_content).map_err(Error::from)
5448    } else {
5449        let local_var_entity: Option<ReposSlashGetWebhookDeliveryError> = serde_json::from_str(&local_var_content).ok();
5450        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5451        Err(Error::ResponseError(local_var_error))
5452    }
5453}
5454
5455/// Lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users.  For more information about viewing repository activity, see \"[Viewing activity and data for your repository](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository).\"
5456pub async fn repos_slash_list_activities(configuration: &configuration::Configuration, owner: &str, repo: &str, direction: Option<&str>, per_page: Option<i32>, before: Option<&str>, after: Option<&str>, r#ref: Option<&str>, actor: Option<&str>, time_period: Option<&str>, activity_type: Option<&str>) -> Result<Vec<models::Activity>, Error<ReposSlashListActivitiesError>> {
5457    let local_var_configuration = configuration;
5458
5459    let local_var_client = &local_var_configuration.client;
5460
5461    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/activity", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
5462    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5463
5464    if let Some(ref local_var_str) = direction {
5465        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
5466    }
5467    if let Some(ref local_var_str) = per_page {
5468        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5469    }
5470    if let Some(ref local_var_str) = before {
5471        local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
5472    }
5473    if let Some(ref local_var_str) = after {
5474        local_var_req_builder = local_var_req_builder.query(&[("after", &local_var_str.to_string())]);
5475    }
5476    if let Some(ref local_var_str) = r#ref {
5477        local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]);
5478    }
5479    if let Some(ref local_var_str) = actor {
5480        local_var_req_builder = local_var_req_builder.query(&[("actor", &local_var_str.to_string())]);
5481    }
5482    if let Some(ref local_var_str) = time_period {
5483        local_var_req_builder = local_var_req_builder.query(&[("time_period", &local_var_str.to_string())]);
5484    }
5485    if let Some(ref local_var_str) = activity_type {
5486        local_var_req_builder = local_var_req_builder.query(&[("activity_type", &local_var_str.to_string())]);
5487    }
5488    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5489        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5490    }
5491
5492    let local_var_req = local_var_req_builder.build()?;
5493    let local_var_resp = local_var_client.execute(local_var_req).await?;
5494
5495    let local_var_status = local_var_resp.status();
5496    let local_var_content = local_var_resp.text().await?;
5497
5498    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5499        serde_json::from_str(&local_var_content).map_err(Error::from)
5500    } else {
5501        let local_var_entity: Option<ReposSlashListActivitiesError> = serde_json::from_str(&local_var_content).ok();
5502        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5503        Err(Error::ResponseError(local_var_error))
5504    }
5505}
5506
5507/// Gets all autolinks that are configured for a repository.  Information about autolinks are only available to repository administrators.
5508pub async fn repos_slash_list_autolinks(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<Vec<models::Autolink>, Error<ReposSlashListAutolinksError>> {
5509    let local_var_configuration = configuration;
5510
5511    let local_var_client = &local_var_configuration.client;
5512
5513    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/autolinks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
5514    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5515
5516    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5517        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5518    }
5519
5520    let local_var_req = local_var_req_builder.build()?;
5521    let local_var_resp = local_var_client.execute(local_var_req).await?;
5522
5523    let local_var_status = local_var_resp.status();
5524    let local_var_content = local_var_resp.text().await?;
5525
5526    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5527        serde_json::from_str(&local_var_content).map_err(Error::from)
5528    } else {
5529        let local_var_entity: Option<ReposSlashListAutolinksError> = serde_json::from_str(&local_var_content).ok();
5530        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5531        Err(Error::ResponseError(local_var_error))
5532    }
5533}
5534
5535/// 
5536pub async fn repos_slash_list_branches(configuration: &configuration::Configuration, owner: &str, repo: &str, protected: Option<bool>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::ShortBranch>, Error<ReposSlashListBranchesError>> {
5537    let local_var_configuration = configuration;
5538
5539    let local_var_client = &local_var_configuration.client;
5540
5541    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
5542    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5543
5544    if let Some(ref local_var_str) = protected {
5545        local_var_req_builder = local_var_req_builder.query(&[("protected", &local_var_str.to_string())]);
5546    }
5547    if let Some(ref local_var_str) = per_page {
5548        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5549    }
5550    if let Some(ref local_var_str) = page {
5551        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5552    }
5553    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5554        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5555    }
5556
5557    let local_var_req = local_var_req_builder.build()?;
5558    let local_var_resp = local_var_client.execute(local_var_req).await?;
5559
5560    let local_var_status = local_var_resp.status();
5561    let local_var_content = local_var_resp.text().await?;
5562
5563    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5564        serde_json::from_str(&local_var_content).map_err(Error::from)
5565    } else {
5566        let local_var_entity: Option<ReposSlashListBranchesError> = serde_json::from_str(&local_var_content).ok();
5567        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5568        Err(Error::ResponseError(local_var_error))
5569    }
5570}
5571
5572/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch.
5573pub async fn repos_slash_list_branches_for_head_commit(configuration: &configuration::Configuration, owner: &str, repo: &str, commit_sha: &str) -> Result<Vec<models::BranchShort>, Error<ReposSlashListBranchesForHeadCommitError>> {
5574    let local_var_configuration = configuration;
5575
5576    let local_var_client = &local_var_configuration.client;
5577
5578    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), commit_sha=crate::apis::urlencode(commit_sha));
5579    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5580
5581    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5582        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5583    }
5584
5585    let local_var_req = local_var_req_builder.build()?;
5586    let local_var_resp = local_var_client.execute(local_var_req).await?;
5587
5588    let local_var_status = local_var_resp.status();
5589    let local_var_content = local_var_resp.text().await?;
5590
5591    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5592        serde_json::from_str(&local_var_content).map_err(Error::from)
5593    } else {
5594        let local_var_entity: Option<ReposSlashListBranchesForHeadCommitError> = serde_json::from_str(&local_var_content).ok();
5595        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5596        Err(Error::ResponseError(local_var_error))
5597    }
5598}
5599
5600/// For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint.  Team members will include the members of child teams.  The authenticated user must have push access to the repository to use this endpoint.  OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint.
5601pub async fn repos_slash_list_collaborators(configuration: &configuration::Configuration, owner: &str, repo: &str, affiliation: Option<&str>, permission: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Collaborator>, Error<ReposSlashListCollaboratorsError>> {
5602    let local_var_configuration = configuration;
5603
5604    let local_var_client = &local_var_configuration.client;
5605
5606    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/collaborators", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
5607    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5608
5609    if let Some(ref local_var_str) = affiliation {
5610        local_var_req_builder = local_var_req_builder.query(&[("affiliation", &local_var_str.to_string())]);
5611    }
5612    if let Some(ref local_var_str) = permission {
5613        local_var_req_builder = local_var_req_builder.query(&[("permission", &local_var_str.to_string())]);
5614    }
5615    if let Some(ref local_var_str) = per_page {
5616        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5617    }
5618    if let Some(ref local_var_str) = page {
5619        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5620    }
5621    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5622        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5623    }
5624
5625    let local_var_req = local_var_req_builder.build()?;
5626    let local_var_resp = local_var_client.execute(local_var_req).await?;
5627
5628    let local_var_status = local_var_resp.status();
5629    let local_var_content = local_var_resp.text().await?;
5630
5631    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5632        serde_json::from_str(&local_var_content).map_err(Error::from)
5633    } else {
5634        let local_var_entity: Option<ReposSlashListCollaboratorsError> = serde_json::from_str(&local_var_content).ok();
5635        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5636        Err(Error::ResponseError(local_var_error))
5637    }
5638}
5639
5640/// Lists the comments for a specified commit.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
5641pub async fn repos_slash_list_comments_for_commit(configuration: &configuration::Configuration, owner: &str, repo: &str, commit_sha: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::CommitComment>, Error<ReposSlashListCommentsForCommitError>> {
5642    let local_var_configuration = configuration;
5643
5644    let local_var_client = &local_var_configuration.client;
5645
5646    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/commits/{commit_sha}/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), commit_sha=crate::apis::urlencode(commit_sha));
5647    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5648
5649    if let Some(ref local_var_str) = per_page {
5650        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5651    }
5652    if let Some(ref local_var_str) = page {
5653        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5654    }
5655    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5656        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5657    }
5658
5659    let local_var_req = local_var_req_builder.build()?;
5660    let local_var_resp = local_var_client.execute(local_var_req).await?;
5661
5662    let local_var_status = local_var_resp.status();
5663    let local_var_content = local_var_resp.text().await?;
5664
5665    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5666        serde_json::from_str(&local_var_content).map_err(Error::from)
5667    } else {
5668        let local_var_entity: Option<ReposSlashListCommentsForCommitError> = serde_json::from_str(&local_var_content).ok();
5669        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5670        Err(Error::ResponseError(local_var_error))
5671    }
5672}
5673
5674/// Lists the commit comments for a specified repository. Comments are ordered by ascending ID.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
5675pub async fn repos_slash_list_commit_comments_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::CommitComment>, Error<ReposSlashListCommitCommentsForRepoError>> {
5676    let local_var_configuration = configuration;
5677
5678    let local_var_client = &local_var_configuration.client;
5679
5680    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
5681    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5682
5683    if let Some(ref local_var_str) = per_page {
5684        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5685    }
5686    if let Some(ref local_var_str) = page {
5687        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5688    }
5689    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5690        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5691    }
5692
5693    let local_var_req = local_var_req_builder.build()?;
5694    let local_var_resp = local_var_client.execute(local_var_req).await?;
5695
5696    let local_var_status = local_var_resp.status();
5697    let local_var_content = local_var_resp.text().await?;
5698
5699    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5700        serde_json::from_str(&local_var_content).map_err(Error::from)
5701    } else {
5702        let local_var_entity: Option<ReposSlashListCommitCommentsForRepoError> = serde_json::from_str(&local_var_content).ok();
5703        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5704        Err(Error::ResponseError(local_var_error))
5705    }
5706}
5707
5708/// Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.  This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`.
5709pub async fn repos_slash_list_commit_statuses_for_ref(configuration: &configuration::Configuration, owner: &str, repo: &str, r#ref: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Status>, Error<ReposSlashListCommitStatusesForRefError>> {
5710    let local_var_configuration = configuration;
5711
5712    let local_var_client = &local_var_configuration.client;
5713
5714    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/commits/{ref}/statuses", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), ref=crate::apis::urlencode(r#ref));
5715    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5716
5717    if let Some(ref local_var_str) = per_page {
5718        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5719    }
5720    if let Some(ref local_var_str) = page {
5721        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5722    }
5723    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5724        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5725    }
5726
5727    let local_var_req = local_var_req_builder.build()?;
5728    let local_var_resp = local_var_client.execute(local_var_req).await?;
5729
5730    let local_var_status = local_var_resp.status();
5731    let local_var_content = local_var_resp.text().await?;
5732
5733    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5734        serde_json::from_str(&local_var_content).map_err(Error::from)
5735    } else {
5736        let local_var_entity: Option<ReposSlashListCommitStatusesForRefError> = serde_json::from_str(&local_var_content).ok();
5737        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5738        Err(Error::ResponseError(local_var_error))
5739    }
5740}
5741
5742/// **Signature verification object**  The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:  | Name | Type | Description | | ---- | ---- | ----------- | | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | `signature` | `string` | The signature that was extracted from the commit. | | `payload` | `string` | The value that was signed. |  These are the possible values for `reason` in the `verification` object:  | Value | Description | | ----- | ----------- | | `expired_key` | The key that made the signature is expired. | | `not_signing_key` | The \"signing\" flag is not among the usage flags in the GPG key that made the signature. | | `gpgverify_error` | There was an error communicating with the signature verification service. | | `gpgverify_unavailable` | The signature verification service is currently unavailable. | | `unsigned` | The object does not include a signature. | | `unknown_signature_type` | A non-PGP signature was found in the commit. | | `no_user` | No user was associated with the `committer` email address in the commit. | | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. | | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | | `unknown_key` | The key that made the signature has not been registered with any user's account. | | `malformed_signature` | There was an error parsing the signature. | | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | `valid` | None of the above errors applied, so the signature is considered to be verified. |
5743pub async fn repos_slash_list_commits(configuration: &configuration::Configuration, owner: &str, repo: &str, sha: Option<&str>, path: Option<&str>, author: Option<&str>, committer: Option<&str>, since: Option<String>, until: Option<String>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Commit>, Error<ReposSlashListCommitsError>> {
5744    let local_var_configuration = configuration;
5745
5746    let local_var_client = &local_var_configuration.client;
5747
5748    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/commits", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
5749    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5750
5751    if let Some(ref local_var_str) = sha {
5752        local_var_req_builder = local_var_req_builder.query(&[("sha", &local_var_str.to_string())]);
5753    }
5754    if let Some(ref local_var_str) = path {
5755        local_var_req_builder = local_var_req_builder.query(&[("path", &local_var_str.to_string())]);
5756    }
5757    if let Some(ref local_var_str) = author {
5758        local_var_req_builder = local_var_req_builder.query(&[("author", &local_var_str.to_string())]);
5759    }
5760    if let Some(ref local_var_str) = committer {
5761        local_var_req_builder = local_var_req_builder.query(&[("committer", &local_var_str.to_string())]);
5762    }
5763    if let Some(ref local_var_str) = since {
5764        local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
5765    }
5766    if let Some(ref local_var_str) = until {
5767        local_var_req_builder = local_var_req_builder.query(&[("until", &local_var_str.to_string())]);
5768    }
5769    if let Some(ref local_var_str) = per_page {
5770        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5771    }
5772    if let Some(ref local_var_str) = page {
5773        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5774    }
5775    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5776        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5777    }
5778
5779    let local_var_req = local_var_req_builder.build()?;
5780    let local_var_resp = local_var_client.execute(local_var_req).await?;
5781
5782    let local_var_status = local_var_resp.status();
5783    let local_var_content = local_var_resp.text().await?;
5784
5785    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5786        serde_json::from_str(&local_var_content).map_err(Error::from)
5787    } else {
5788        let local_var_entity: Option<ReposSlashListCommitsError> = serde_json::from_str(&local_var_content).ok();
5789        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5790        Err(Error::ResponseError(local_var_error))
5791    }
5792}
5793
5794/// Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API caches contributor data to improve performance.  GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information.
5795pub async fn repos_slash_list_contributors(configuration: &configuration::Configuration, owner: &str, repo: &str, anon: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Contributor>, Error<ReposSlashListContributorsError>> {
5796    let local_var_configuration = configuration;
5797
5798    let local_var_client = &local_var_configuration.client;
5799
5800    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/contributors", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
5801    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5802
5803    if let Some(ref local_var_str) = anon {
5804        local_var_req_builder = local_var_req_builder.query(&[("anon", &local_var_str.to_string())]);
5805    }
5806    if let Some(ref local_var_str) = per_page {
5807        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5808    }
5809    if let Some(ref local_var_str) = page {
5810        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5811    }
5812    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5813        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5814    }
5815
5816    let local_var_req = local_var_req_builder.build()?;
5817    let local_var_resp = local_var_client.execute(local_var_req).await?;
5818
5819    let local_var_status = local_var_resp.status();
5820    let local_var_content = local_var_resp.text().await?;
5821
5822    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5823        serde_json::from_str(&local_var_content).map_err(Error::from)
5824    } else {
5825        let local_var_entity: Option<ReposSlashListContributorsError> = serde_json::from_str(&local_var_content).ok();
5826        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5827        Err(Error::ResponseError(local_var_error))
5828    }
5829}
5830
5831/// Gets all custom deployment protection rule integrations that are available for an environment. Anyone with read access to the repository can use this endpoint.  For more information about environments, see \"[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment).\"  For more information about the app that is providing this custom deployment rule, see \"[GET an app](https://docs.github.com/rest/apps/apps#get-an-app)\".  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
5832pub async fn repos_slash_list_custom_deployment_rule_integrations(configuration: &configuration::Configuration, environment_name: &str, repo: &str, owner: &str, page: Option<i32>, per_page: Option<i32>) -> Result<models::ReposListCustomDeploymentRuleIntegrations200Response, Error<ReposSlashListCustomDeploymentRuleIntegrationsError>> {
5833    let local_var_configuration = configuration;
5834
5835    let local_var_client = &local_var_configuration.client;
5836
5837    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps", local_var_configuration.base_path, environment_name=crate::apis::urlencode(environment_name), repo=crate::apis::urlencode(repo), owner=crate::apis::urlencode(owner));
5838    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5839
5840    if let Some(ref local_var_str) = page {
5841        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5842    }
5843    if let Some(ref local_var_str) = per_page {
5844        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5845    }
5846    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5847        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5848    }
5849
5850    let local_var_req = local_var_req_builder.build()?;
5851    let local_var_resp = local_var_client.execute(local_var_req).await?;
5852
5853    let local_var_status = local_var_resp.status();
5854    let local_var_content = local_var_resp.text().await?;
5855
5856    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5857        serde_json::from_str(&local_var_content).map_err(Error::from)
5858    } else {
5859        let local_var_entity: Option<ReposSlashListCustomDeploymentRuleIntegrationsError> = serde_json::from_str(&local_var_content).ok();
5860        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5861        Err(Error::ResponseError(local_var_error))
5862    }
5863}
5864
5865/// 
5866pub async fn repos_slash_list_deploy_keys(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::DeployKey>, Error<ReposSlashListDeployKeysError>> {
5867    let local_var_configuration = configuration;
5868
5869    let local_var_client = &local_var_configuration.client;
5870
5871    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/keys", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
5872    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5873
5874    if let Some(ref local_var_str) = per_page {
5875        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5876    }
5877    if let Some(ref local_var_str) = page {
5878        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5879    }
5880    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5881        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5882    }
5883
5884    let local_var_req = local_var_req_builder.build()?;
5885    let local_var_resp = local_var_client.execute(local_var_req).await?;
5886
5887    let local_var_status = local_var_resp.status();
5888    let local_var_content = local_var_resp.text().await?;
5889
5890    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5891        serde_json::from_str(&local_var_content).map_err(Error::from)
5892    } else {
5893        let local_var_entity: Option<ReposSlashListDeployKeysError> = serde_json::from_str(&local_var_content).ok();
5894        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5895        Err(Error::ResponseError(local_var_error))
5896    }
5897}
5898
5899/// Lists the deployment branch policies for an environment.  Anyone with read access to the repository can use this endpoint.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
5900pub async fn repos_slash_list_deployment_branch_policies(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::ReposListDeploymentBranchPolicies200Response, Error<ReposSlashListDeploymentBranchPoliciesError>> {
5901    let local_var_configuration = configuration;
5902
5903    let local_var_client = &local_var_configuration.client;
5904
5905    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name));
5906    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5907
5908    if let Some(ref local_var_str) = per_page {
5909        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5910    }
5911    if let Some(ref local_var_str) = page {
5912        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5913    }
5914    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5915        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5916    }
5917
5918    let local_var_req = local_var_req_builder.build()?;
5919    let local_var_resp = local_var_client.execute(local_var_req).await?;
5920
5921    let local_var_status = local_var_resp.status();
5922    let local_var_content = local_var_resp.text().await?;
5923
5924    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5925        serde_json::from_str(&local_var_content).map_err(Error::from)
5926    } else {
5927        let local_var_entity: Option<ReposSlashListDeploymentBranchPoliciesError> = serde_json::from_str(&local_var_content).ok();
5928        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5929        Err(Error::ResponseError(local_var_error))
5930    }
5931}
5932
5933/// Users with pull access can view deployment statuses for a deployment:
5934pub async fn repos_slash_list_deployment_statuses(configuration: &configuration::Configuration, owner: &str, repo: &str, deployment_id: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::DeploymentStatus>, Error<ReposSlashListDeploymentStatusesError>> {
5935    let local_var_configuration = configuration;
5936
5937    let local_var_client = &local_var_configuration.client;
5938
5939    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/deployments/{deployment_id}/statuses", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), deployment_id=deployment_id);
5940    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5941
5942    if let Some(ref local_var_str) = per_page {
5943        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5944    }
5945    if let Some(ref local_var_str) = page {
5946        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5947    }
5948    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5949        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5950    }
5951
5952    let local_var_req = local_var_req_builder.build()?;
5953    let local_var_resp = local_var_client.execute(local_var_req).await?;
5954
5955    let local_var_status = local_var_resp.status();
5956    let local_var_content = local_var_resp.text().await?;
5957
5958    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5959        serde_json::from_str(&local_var_content).map_err(Error::from)
5960    } else {
5961        let local_var_entity: Option<ReposSlashListDeploymentStatusesError> = serde_json::from_str(&local_var_content).ok();
5962        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5963        Err(Error::ResponseError(local_var_error))
5964    }
5965}
5966
5967/// Simple filtering of deployments is available via query parameters:
5968pub async fn repos_slash_list_deployments(configuration: &configuration::Configuration, owner: &str, repo: &str, sha: Option<&str>, r#ref: Option<&str>, task: Option<&str>, environment: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Deployment>, Error<ReposSlashListDeploymentsError>> {
5969    let local_var_configuration = configuration;
5970
5971    let local_var_client = &local_var_configuration.client;
5972
5973    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/deployments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
5974    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5975
5976    if let Some(ref local_var_str) = sha {
5977        local_var_req_builder = local_var_req_builder.query(&[("sha", &local_var_str.to_string())]);
5978    }
5979    if let Some(ref local_var_str) = r#ref {
5980        local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]);
5981    }
5982    if let Some(ref local_var_str) = task {
5983        local_var_req_builder = local_var_req_builder.query(&[("task", &local_var_str.to_string())]);
5984    }
5985    if let Some(ref local_var_str) = environment {
5986        local_var_req_builder = local_var_req_builder.query(&[("environment", &local_var_str.to_string())]);
5987    }
5988    if let Some(ref local_var_str) = per_page {
5989        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
5990    }
5991    if let Some(ref local_var_str) = page {
5992        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5993    }
5994    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5995        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5996    }
5997
5998    let local_var_req = local_var_req_builder.build()?;
5999    let local_var_resp = local_var_client.execute(local_var_req).await?;
6000
6001    let local_var_status = local_var_resp.status();
6002    let local_var_content = local_var_resp.text().await?;
6003
6004    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6005        serde_json::from_str(&local_var_content).map_err(Error::from)
6006    } else {
6007        let local_var_entity: Option<ReposSlashListDeploymentsError> = serde_json::from_str(&local_var_content).ok();
6008        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6009        Err(Error::ResponseError(local_var_error))
6010    }
6011}
6012
6013/// Lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.  The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.
6014pub async fn repos_slash_list_for_authenticated_user(configuration: &configuration::Configuration, visibility: Option<&str>, affiliation: Option<&str>, r#type: Option<&str>, sort: Option<&str>, direction: Option<&str>, per_page: Option<i32>, page: Option<i32>, since: Option<String>, before: Option<String>) -> Result<Vec<models::Repository>, Error<ReposSlashListForAuthenticatedUserError>> {
6015    let local_var_configuration = configuration;
6016
6017    let local_var_client = &local_var_configuration.client;
6018
6019    let local_var_uri_str = format!("{}/user/repos", local_var_configuration.base_path);
6020    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6021
6022    if let Some(ref local_var_str) = visibility {
6023        local_var_req_builder = local_var_req_builder.query(&[("visibility", &local_var_str.to_string())]);
6024    }
6025    if let Some(ref local_var_str) = affiliation {
6026        local_var_req_builder = local_var_req_builder.query(&[("affiliation", &local_var_str.to_string())]);
6027    }
6028    if let Some(ref local_var_str) = r#type {
6029        local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]);
6030    }
6031    if let Some(ref local_var_str) = sort {
6032        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
6033    }
6034    if let Some(ref local_var_str) = direction {
6035        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
6036    }
6037    if let Some(ref local_var_str) = per_page {
6038        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
6039    }
6040    if let Some(ref local_var_str) = page {
6041        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
6042    }
6043    if let Some(ref local_var_str) = since {
6044        local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
6045    }
6046    if let Some(ref local_var_str) = before {
6047        local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
6048    }
6049    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6050        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6051    }
6052
6053    let local_var_req = local_var_req_builder.build()?;
6054    let local_var_resp = local_var_client.execute(local_var_req).await?;
6055
6056    let local_var_status = local_var_resp.status();
6057    let local_var_content = local_var_resp.text().await?;
6058
6059    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6060        serde_json::from_str(&local_var_content).map_err(Error::from)
6061    } else {
6062        let local_var_entity: Option<ReposSlashListForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
6063        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6064        Err(Error::ResponseError(local_var_error))
6065    }
6066}
6067
6068/// Lists repositories for the specified organization.  **Note:** In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see \"[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).\"
6069pub async fn repos_slash_list_for_org(configuration: &configuration::Configuration, org: &str, r#type: Option<&str>, sort: Option<&str>, direction: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::MinimalRepository>, Error<ReposSlashListForOrgError>> {
6070    let local_var_configuration = configuration;
6071
6072    let local_var_client = &local_var_configuration.client;
6073
6074    let local_var_uri_str = format!("{}/orgs/{org}/repos", local_var_configuration.base_path, org=crate::apis::urlencode(org));
6075    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6076
6077    if let Some(ref local_var_str) = r#type {
6078        local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]);
6079    }
6080    if let Some(ref local_var_str) = sort {
6081        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
6082    }
6083    if let Some(ref local_var_str) = direction {
6084        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
6085    }
6086    if let Some(ref local_var_str) = per_page {
6087        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
6088    }
6089    if let Some(ref local_var_str) = page {
6090        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
6091    }
6092    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6093        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6094    }
6095
6096    let local_var_req = local_var_req_builder.build()?;
6097    let local_var_resp = local_var_client.execute(local_var_req).await?;
6098
6099    let local_var_status = local_var_resp.status();
6100    let local_var_content = local_var_resp.text().await?;
6101
6102    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6103        serde_json::from_str(&local_var_content).map_err(Error::from)
6104    } else {
6105        let local_var_entity: Option<ReposSlashListForOrgError> = serde_json::from_str(&local_var_content).ok();
6106        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6107        Err(Error::ResponseError(local_var_error))
6108    }
6109}
6110
6111/// Lists public repositories for the specified user.
6112pub async fn repos_slash_list_for_user(configuration: &configuration::Configuration, username: &str, r#type: Option<&str>, sort: Option<&str>, direction: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::MinimalRepository>, Error<ReposSlashListForUserError>> {
6113    let local_var_configuration = configuration;
6114
6115    let local_var_client = &local_var_configuration.client;
6116
6117    let local_var_uri_str = format!("{}/users/{username}/repos", local_var_configuration.base_path, username=crate::apis::urlencode(username));
6118    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6119
6120    if let Some(ref local_var_str) = r#type {
6121        local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]);
6122    }
6123    if let Some(ref local_var_str) = sort {
6124        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
6125    }
6126    if let Some(ref local_var_str) = direction {
6127        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
6128    }
6129    if let Some(ref local_var_str) = per_page {
6130        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
6131    }
6132    if let Some(ref local_var_str) = page {
6133        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
6134    }
6135    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6136        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6137    }
6138
6139    let local_var_req = local_var_req_builder.build()?;
6140    let local_var_resp = local_var_client.execute(local_var_req).await?;
6141
6142    let local_var_status = local_var_resp.status();
6143    let local_var_content = local_var_resp.text().await?;
6144
6145    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6146        serde_json::from_str(&local_var_content).map_err(Error::from)
6147    } else {
6148        let local_var_entity: Option<ReposSlashListForUserError> = serde_json::from_str(&local_var_content).ok();
6149        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6150        Err(Error::ResponseError(local_var_error))
6151    }
6152}
6153
6154/// 
6155pub async fn repos_slash_list_forks(configuration: &configuration::Configuration, owner: &str, repo: &str, sort: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::MinimalRepository>, Error<ReposSlashListForksError>> {
6156    let local_var_configuration = configuration;
6157
6158    let local_var_client = &local_var_configuration.client;
6159
6160    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/forks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
6161    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6162
6163    if let Some(ref local_var_str) = sort {
6164        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
6165    }
6166    if let Some(ref local_var_str) = per_page {
6167        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
6168    }
6169    if let Some(ref local_var_str) = page {
6170        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
6171    }
6172    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6173        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6174    }
6175
6176    let local_var_req = local_var_req_builder.build()?;
6177    let local_var_resp = local_var_client.execute(local_var_req).await?;
6178
6179    let local_var_status = local_var_resp.status();
6180    let local_var_content = local_var_resp.text().await?;
6181
6182    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6183        serde_json::from_str(&local_var_content).map_err(Error::from)
6184    } else {
6185        let local_var_entity: Option<ReposSlashListForksError> = serde_json::from_str(&local_var_content).ok();
6186        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6187        Err(Error::ResponseError(local_var_error))
6188    }
6189}
6190
6191/// When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations.
6192pub async fn repos_slash_list_invitations(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::RepositoryInvitation>, Error<ReposSlashListInvitationsError>> {
6193    let local_var_configuration = configuration;
6194
6195    let local_var_client = &local_var_configuration.client;
6196
6197    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/invitations", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
6198    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6199
6200    if let Some(ref local_var_str) = per_page {
6201        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
6202    }
6203    if let Some(ref local_var_str) = page {
6204        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
6205    }
6206    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6207        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6208    }
6209
6210    let local_var_req = local_var_req_builder.build()?;
6211    let local_var_resp = local_var_client.execute(local_var_req).await?;
6212
6213    let local_var_status = local_var_resp.status();
6214    let local_var_content = local_var_resp.text().await?;
6215
6216    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6217        serde_json::from_str(&local_var_content).map_err(Error::from)
6218    } else {
6219        let local_var_entity: Option<ReposSlashListInvitationsError> = serde_json::from_str(&local_var_content).ok();
6220        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6221        Err(Error::ResponseError(local_var_error))
6222    }
6223}
6224
6225/// When authenticating as a user, this endpoint will list all currently open repository invitations for that user.
6226pub async fn repos_slash_list_invitations_for_authenticated_user(configuration: &configuration::Configuration, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::RepositoryInvitation>, Error<ReposSlashListInvitationsForAuthenticatedUserError>> {
6227    let local_var_configuration = configuration;
6228
6229    let local_var_client = &local_var_configuration.client;
6230
6231    let local_var_uri_str = format!("{}/user/repository_invitations", local_var_configuration.base_path);
6232    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6233
6234    if let Some(ref local_var_str) = per_page {
6235        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
6236    }
6237    if let Some(ref local_var_str) = page {
6238        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
6239    }
6240    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6241        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6242    }
6243
6244    let local_var_req = local_var_req_builder.build()?;
6245    let local_var_resp = local_var_client.execute(local_var_req).await?;
6246
6247    let local_var_status = local_var_resp.status();
6248    let local_var_content = local_var_resp.text().await?;
6249
6250    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6251        serde_json::from_str(&local_var_content).map_err(Error::from)
6252    } else {
6253        let local_var_entity: Option<ReposSlashListInvitationsForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
6254        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6255        Err(Error::ResponseError(local_var_error))
6256    }
6257}
6258
6259/// Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language.
6260pub async fn repos_slash_list_languages(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<std::collections::HashMap<String, i32>, Error<ReposSlashListLanguagesError>> {
6261    let local_var_configuration = configuration;
6262
6263    let local_var_client = &local_var_configuration.client;
6264
6265    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/languages", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
6266    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6267
6268    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6269        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6270    }
6271
6272    let local_var_req = local_var_req_builder.build()?;
6273    let local_var_resp = local_var_client.execute(local_var_req).await?;
6274
6275    let local_var_status = local_var_resp.status();
6276    let local_var_content = local_var_resp.text().await?;
6277
6278    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6279        serde_json::from_str(&local_var_content).map_err(Error::from)
6280    } else {
6281        let local_var_entity: Option<ReposSlashListLanguagesError> = serde_json::from_str(&local_var_content).ok();
6282        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6283        Err(Error::ResponseError(local_var_error))
6284    }
6285}
6286
6287/// Lists builts of a GitHub Pages site.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
6288pub async fn repos_slash_list_pages_builds(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::PageBuild>, Error<ReposSlashListPagesBuildsError>> {
6289    let local_var_configuration = configuration;
6290
6291    let local_var_client = &local_var_configuration.client;
6292
6293    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pages/builds", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
6294    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6295
6296    if let Some(ref local_var_str) = per_page {
6297        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
6298    }
6299    if let Some(ref local_var_str) = page {
6300        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
6301    }
6302    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6303        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6304    }
6305
6306    let local_var_req = local_var_req_builder.build()?;
6307    let local_var_resp = local_var_client.execute(local_var_req).await?;
6308
6309    let local_var_status = local_var_resp.status();
6310    let local_var_content = local_var_resp.text().await?;
6311
6312    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6313        serde_json::from_str(&local_var_content).map_err(Error::from)
6314    } else {
6315        let local_var_entity: Option<ReposSlashListPagesBuildsError> = serde_json::from_str(&local_var_content).ok();
6316        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6317        Err(Error::ResponseError(local_var_error))
6318    }
6319}
6320
6321/// Lists all public repositories in the order that they were created.  Note: - For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise. - Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of repositories.
6322pub async fn repos_slash_list_public(configuration: &configuration::Configuration, since: Option<i32>) -> Result<Vec<models::MinimalRepository>, Error<ReposSlashListPublicError>> {
6323    let local_var_configuration = configuration;
6324
6325    let local_var_client = &local_var_configuration.client;
6326
6327    let local_var_uri_str = format!("{}/repositories", local_var_configuration.base_path);
6328    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6329
6330    if let Some(ref local_var_str) = since {
6331        local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
6332    }
6333    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6334        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6335    }
6336
6337    let local_var_req = local_var_req_builder.build()?;
6338    let local_var_resp = local_var_client.execute(local_var_req).await?;
6339
6340    let local_var_status = local_var_resp.status();
6341    let local_var_content = local_var_resp.text().await?;
6342
6343    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6344        serde_json::from_str(&local_var_content).map_err(Error::from)
6345    } else {
6346        let local_var_entity: Option<ReposSlashListPublicError> = serde_json::from_str(&local_var_content).ok();
6347        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6348        Err(Error::ResponseError(local_var_error))
6349    }
6350}
6351
6352/// Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit.  To list the open or merged pull requests associated with a branch, you can set the `commit_sha` parameter to the branch name.
6353pub async fn repos_slash_list_pull_requests_associated_with_commit(configuration: &configuration::Configuration, owner: &str, repo: &str, commit_sha: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::PullRequestSimple>, Error<ReposSlashListPullRequestsAssociatedWithCommitError>> {
6354    let local_var_configuration = configuration;
6355
6356    let local_var_client = &local_var_configuration.client;
6357
6358    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/commits/{commit_sha}/pulls", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), commit_sha=crate::apis::urlencode(commit_sha));
6359    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6360
6361    if let Some(ref local_var_str) = per_page {
6362        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
6363    }
6364    if let Some(ref local_var_str) = page {
6365        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
6366    }
6367    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6368        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6369    }
6370
6371    let local_var_req = local_var_req_builder.build()?;
6372    let local_var_resp = local_var_client.execute(local_var_req).await?;
6373
6374    let local_var_status = local_var_resp.status();
6375    let local_var_content = local_var_resp.text().await?;
6376
6377    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6378        serde_json::from_str(&local_var_content).map_err(Error::from)
6379    } else {
6380        let local_var_entity: Option<ReposSlashListPullRequestsAssociatedWithCommitError> = serde_json::from_str(&local_var_content).ok();
6381        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6382        Err(Error::ResponseError(local_var_error))
6383    }
6384}
6385
6386/// 
6387pub async fn repos_slash_list_release_assets(configuration: &configuration::Configuration, owner: &str, repo: &str, release_id: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::ReleaseAsset>, Error<ReposSlashListReleaseAssetsError>> {
6388    let local_var_configuration = configuration;
6389
6390    let local_var_client = &local_var_configuration.client;
6391
6392    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{release_id}/assets", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), release_id=release_id);
6393    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6394
6395    if let Some(ref local_var_str) = per_page {
6396        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
6397    }
6398    if let Some(ref local_var_str) = page {
6399        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
6400    }
6401    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6402        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6403    }
6404
6405    let local_var_req = local_var_req_builder.build()?;
6406    let local_var_resp = local_var_client.execute(local_var_req).await?;
6407
6408    let local_var_status = local_var_resp.status();
6409    let local_var_content = local_var_resp.text().await?;
6410
6411    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6412        serde_json::from_str(&local_var_content).map_err(Error::from)
6413    } else {
6414        let local_var_entity: Option<ReposSlashListReleaseAssetsError> = serde_json::from_str(&local_var_content).ok();
6415        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6416        Err(Error::ResponseError(local_var_error))
6417    }
6418}
6419
6420/// This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/repos/repos#list-repository-tags).  Information about published releases are available to everyone. Only users with push access will receive listings for draft releases.
6421pub async fn repos_slash_list_releases(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Release>, Error<ReposSlashListReleasesError>> {
6422    let local_var_configuration = configuration;
6423
6424    let local_var_client = &local_var_configuration.client;
6425
6426    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
6427    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6428
6429    if let Some(ref local_var_str) = per_page {
6430        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
6431    }
6432    if let Some(ref local_var_str) = page {
6433        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
6434    }
6435    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6436        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6437    }
6438
6439    let local_var_req = local_var_req_builder.build()?;
6440    let local_var_resp = local_var_client.execute(local_var_req).await?;
6441
6442    let local_var_status = local_var_resp.status();
6443    let local_var_content = local_var_resp.text().await?;
6444
6445    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6446        serde_json::from_str(&local_var_content).map_err(Error::from)
6447    } else {
6448        let local_var_entity: Option<ReposSlashListReleasesError> = serde_json::from_str(&local_var_content).ok();
6449        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6450        Err(Error::ResponseError(local_var_error))
6451    }
6452}
6453
6454/// This returns the tag protection states of a repository.  This information is only available to repository administrators.
6455pub async fn repos_slash_list_tag_protection(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<Vec<models::TagProtection>, Error<ReposSlashListTagProtectionError>> {
6456    let local_var_configuration = configuration;
6457
6458    let local_var_client = &local_var_configuration.client;
6459
6460    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/tags/protection", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
6461    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6462
6463    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6464        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6465    }
6466
6467    let local_var_req = local_var_req_builder.build()?;
6468    let local_var_resp = local_var_client.execute(local_var_req).await?;
6469
6470    let local_var_status = local_var_resp.status();
6471    let local_var_content = local_var_resp.text().await?;
6472
6473    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6474        serde_json::from_str(&local_var_content).map_err(Error::from)
6475    } else {
6476        let local_var_entity: Option<ReposSlashListTagProtectionError> = serde_json::from_str(&local_var_content).ok();
6477        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6478        Err(Error::ResponseError(local_var_error))
6479    }
6480}
6481
6482/// 
6483pub async fn repos_slash_list_tags(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Tag>, Error<ReposSlashListTagsError>> {
6484    let local_var_configuration = configuration;
6485
6486    let local_var_client = &local_var_configuration.client;
6487
6488    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/tags", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
6489    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6490
6491    if let Some(ref local_var_str) = per_page {
6492        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
6493    }
6494    if let Some(ref local_var_str) = page {
6495        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
6496    }
6497    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6498        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6499    }
6500
6501    let local_var_req = local_var_req_builder.build()?;
6502    let local_var_resp = local_var_client.execute(local_var_req).await?;
6503
6504    let local_var_status = local_var_resp.status();
6505    let local_var_content = local_var_resp.text().await?;
6506
6507    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6508        serde_json::from_str(&local_var_content).map_err(Error::from)
6509    } else {
6510        let local_var_entity: Option<ReposSlashListTagsError> = serde_json::from_str(&local_var_content).ok();
6511        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6512        Err(Error::ResponseError(local_var_error))
6513    }
6514}
6515
6516/// Lists the teams that have access to the specified repository and that are also visible to the authenticated user.  For a public repository, a team is listed only if that team added the public repository explicitly.  OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to use this endpoint with a public repository, and `repo` scope to use this endpoint with a private repository.
6517pub async fn repos_slash_list_teams(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Team>, Error<ReposSlashListTeamsError>> {
6518    let local_var_configuration = configuration;
6519
6520    let local_var_client = &local_var_configuration.client;
6521
6522    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/teams", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
6523    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6524
6525    if let Some(ref local_var_str) = per_page {
6526        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
6527    }
6528    if let Some(ref local_var_str) = page {
6529        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
6530    }
6531    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6532        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6533    }
6534
6535    let local_var_req = local_var_req_builder.build()?;
6536    let local_var_resp = local_var_client.execute(local_var_req).await?;
6537
6538    let local_var_status = local_var_resp.status();
6539    let local_var_content = local_var_resp.text().await?;
6540
6541    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6542        serde_json::from_str(&local_var_content).map_err(Error::from)
6543    } else {
6544        let local_var_entity: Option<ReposSlashListTeamsError> = serde_json::from_str(&local_var_content).ok();
6545        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6546        Err(Error::ResponseError(local_var_error))
6547    }
6548}
6549
6550/// Returns a list of webhook deliveries for a webhook configured in a repository.
6551pub async fn repos_slash_list_webhook_deliveries(configuration: &configuration::Configuration, owner: &str, repo: &str, hook_id: i32, per_page: Option<i32>, cursor: Option<&str>, redelivery: Option<bool>) -> Result<Vec<models::HookDeliveryItem>, Error<ReposSlashListWebhookDeliveriesError>> {
6552    let local_var_configuration = configuration;
6553
6554    let local_var_client = &local_var_configuration.client;
6555
6556    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/{hook_id}/deliveries", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), hook_id=hook_id);
6557    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6558
6559    if let Some(ref local_var_str) = per_page {
6560        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
6561    }
6562    if let Some(ref local_var_str) = cursor {
6563        local_var_req_builder = local_var_req_builder.query(&[("cursor", &local_var_str.to_string())]);
6564    }
6565    if let Some(ref local_var_str) = redelivery {
6566        local_var_req_builder = local_var_req_builder.query(&[("redelivery", &local_var_str.to_string())]);
6567    }
6568    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6569        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6570    }
6571
6572    let local_var_req = local_var_req_builder.build()?;
6573    let local_var_resp = local_var_client.execute(local_var_req).await?;
6574
6575    let local_var_status = local_var_resp.status();
6576    let local_var_content = local_var_resp.text().await?;
6577
6578    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6579        serde_json::from_str(&local_var_content).map_err(Error::from)
6580    } else {
6581        let local_var_entity: Option<ReposSlashListWebhookDeliveriesError> = serde_json::from_str(&local_var_content).ok();
6582        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6583        Err(Error::ResponseError(local_var_error))
6584    }
6585}
6586
6587/// Lists webhooks for a repository. `last response` may return null if there have not been any deliveries within 30 days.
6588pub async fn repos_slash_list_webhooks(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Hook>, Error<ReposSlashListWebhooksError>> {
6589    let local_var_configuration = configuration;
6590
6591    let local_var_client = &local_var_configuration.client;
6592
6593    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
6594    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
6595
6596    if let Some(ref local_var_str) = per_page {
6597        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
6598    }
6599    if let Some(ref local_var_str) = page {
6600        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
6601    }
6602    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6603        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6604    }
6605
6606    let local_var_req = local_var_req_builder.build()?;
6607    let local_var_resp = local_var_client.execute(local_var_req).await?;
6608
6609    let local_var_status = local_var_resp.status();
6610    let local_var_content = local_var_resp.text().await?;
6611
6612    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6613        serde_json::from_str(&local_var_content).map_err(Error::from)
6614    } else {
6615        let local_var_entity: Option<ReposSlashListWebhooksError> = serde_json::from_str(&local_var_content).ok();
6616        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6617        Err(Error::ResponseError(local_var_error))
6618    }
6619}
6620
6621/// 
6622pub async fn repos_slash_merge(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_merge_request: models::ReposMergeRequest) -> Result<models::Commit, Error<ReposSlashMergeError>> {
6623    let local_var_configuration = configuration;
6624
6625    let local_var_client = &local_var_configuration.client;
6626
6627    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/merges", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
6628    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
6629
6630    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6631        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6632    }
6633    local_var_req_builder = local_var_req_builder.json(&repos_merge_request);
6634
6635    let local_var_req = local_var_req_builder.build()?;
6636    let local_var_resp = local_var_client.execute(local_var_req).await?;
6637
6638    let local_var_status = local_var_resp.status();
6639    let local_var_content = local_var_resp.text().await?;
6640
6641    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6642        serde_json::from_str(&local_var_content).map_err(Error::from)
6643    } else {
6644        let local_var_entity: Option<ReposSlashMergeError> = serde_json::from_str(&local_var_content).ok();
6645        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6646        Err(Error::ResponseError(local_var_error))
6647    }
6648}
6649
6650/// Sync a branch of a forked repository to keep it up-to-date with the upstream repository.
6651pub async fn repos_slash_merge_upstream(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_merge_upstream_request: models::ReposMergeUpstreamRequest) -> Result<models::MergedUpstream, Error<ReposSlashMergeUpstreamError>> {
6652    let local_var_configuration = configuration;
6653
6654    let local_var_client = &local_var_configuration.client;
6655
6656    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/merge-upstream", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
6657    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
6658
6659    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6660        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6661    }
6662    local_var_req_builder = local_var_req_builder.json(&repos_merge_upstream_request);
6663
6664    let local_var_req = local_var_req_builder.build()?;
6665    let local_var_resp = local_var_client.execute(local_var_req).await?;
6666
6667    let local_var_status = local_var_resp.status();
6668    let local_var_content = local_var_resp.text().await?;
6669
6670    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6671        serde_json::from_str(&local_var_content).map_err(Error::from)
6672    } else {
6673        let local_var_entity: Option<ReposSlashMergeUpstreamError> = serde_json::from_str(&local_var_content).ok();
6674        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6675        Err(Error::ResponseError(local_var_error))
6676    }
6677}
6678
6679/// This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook.
6680pub async fn repos_slash_ping_webhook(configuration: &configuration::Configuration, owner: &str, repo: &str, hook_id: i32) -> Result<(), Error<ReposSlashPingWebhookError>> {
6681    let local_var_configuration = configuration;
6682
6683    let local_var_client = &local_var_configuration.client;
6684
6685    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/{hook_id}/pings", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), hook_id=hook_id);
6686    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
6687
6688    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6689        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6690    }
6691
6692    let local_var_req = local_var_req_builder.build()?;
6693    let local_var_resp = local_var_client.execute(local_var_req).await?;
6694
6695    let local_var_status = local_var_resp.status();
6696    let local_var_content = local_var_resp.text().await?;
6697
6698    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6699        Ok(())
6700    } else {
6701        let local_var_entity: Option<ReposSlashPingWebhookError> = serde_json::from_str(&local_var_content).ok();
6702        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6703        Err(Error::ResponseError(local_var_error))
6704    }
6705}
6706
6707/// Redeliver a webhook delivery for a webhook configured in a repository.
6708pub async fn repos_slash_redeliver_webhook_delivery(configuration: &configuration::Configuration, owner: &str, repo: &str, hook_id: i32, delivery_id: i32) -> Result<serde_json::Value, Error<ReposSlashRedeliverWebhookDeliveryError>> {
6709    let local_var_configuration = configuration;
6710
6711    let local_var_client = &local_var_configuration.client;
6712
6713    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), hook_id=hook_id, delivery_id=delivery_id);
6714    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
6715
6716    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6717        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6718    }
6719
6720    let local_var_req = local_var_req_builder.build()?;
6721    let local_var_resp = local_var_client.execute(local_var_req).await?;
6722
6723    let local_var_status = local_var_resp.status();
6724    let local_var_content = local_var_resp.text().await?;
6725
6726    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6727        serde_json::from_str(&local_var_content).map_err(Error::from)
6728    } else {
6729        let local_var_entity: Option<ReposSlashRedeliverWebhookDeliveryError> = serde_json::from_str(&local_var_content).ok();
6730        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6731        Err(Error::ResponseError(local_var_error))
6732    }
6733}
6734
6735/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Removes the ability of an app to push to this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch.
6736pub async fn repos_slash_remove_app_access_restrictions(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_set_app_access_restrictions_request: Option<models::ReposSetAppAccessRestrictionsRequest>) -> Result<Vec<models::Integration>, Error<ReposSlashRemoveAppAccessRestrictionsError>> {
6737    let local_var_configuration = configuration;
6738
6739    let local_var_client = &local_var_configuration.client;
6740
6741    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
6742    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
6743
6744    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6745        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6746    }
6747    local_var_req_builder = local_var_req_builder.json(&repos_set_app_access_restrictions_request);
6748
6749    let local_var_req = local_var_req_builder.build()?;
6750    let local_var_resp = local_var_client.execute(local_var_req).await?;
6751
6752    let local_var_status = local_var_resp.status();
6753    let local_var_content = local_var_resp.text().await?;
6754
6755    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6756        serde_json::from_str(&local_var_content).map_err(Error::from)
6757    } else {
6758        let local_var_entity: Option<ReposSlashRemoveAppAccessRestrictionsError> = serde_json::from_str(&local_var_content).ok();
6759        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6760        Err(Error::ResponseError(local_var_error))
6761    }
6762}
6763
6764/// Removes a collaborator from a repository.  To use this endpoint, the authenticated user must either be an administrator of the repository or target themselves for removal.  This endpoint also: - Cancels any outstanding invitations - Unasigns the user from any issues - Removes access to organization projects if the user is not an organization member and is not a collaborator on any other organization repositories. - Unstars the repository - Updates access permissions to packages  Removing a user as a collaborator has the following effects on forks:  - If the user had access to a fork through their membership to this repository, the user will also be removed from the fork.  - If the user had their own fork of the repository, the fork will be deleted.  - If the user still has read access to the repository, open pull requests by this user from a fork will be denied.  **Note**: A user can still have access to the repository through organization permissions like base repository permissions.  Although the API responds immediately, the additional permission updates might take some extra time to complete in the background.  For more information on fork permissions, see \"[About permissions and visibility of forks](https://docs.github.com/pull-requests/collaborating-with-pull-requests/working-with-forks/about-permissions-and-visibility-of-forks)\".
6765pub async fn repos_slash_remove_collaborator(configuration: &configuration::Configuration, owner: &str, repo: &str, username: &str) -> Result<(), Error<ReposSlashRemoveCollaboratorError>> {
6766    let local_var_configuration = configuration;
6767
6768    let local_var_client = &local_var_configuration.client;
6769
6770    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/collaborators/{username}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), username=crate::apis::urlencode(username));
6771    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
6772
6773    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6774        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6775    }
6776
6777    let local_var_req = local_var_req_builder.build()?;
6778    let local_var_resp = local_var_client.execute(local_var_req).await?;
6779
6780    let local_var_status = local_var_resp.status();
6781    let local_var_content = local_var_resp.text().await?;
6782
6783    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6784        Ok(())
6785    } else {
6786        let local_var_entity: Option<ReposSlashRemoveCollaboratorError> = serde_json::from_str(&local_var_content).ok();
6787        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6788        Err(Error::ResponseError(local_var_error))
6789    }
6790}
6791
6792/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
6793pub async fn repos_slash_remove_status_check_contexts(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_set_status_check_contexts_request: Option<models::ReposSetStatusCheckContextsRequest>) -> Result<Vec<String>, Error<ReposSlashRemoveStatusCheckContextsError>> {
6794    let local_var_configuration = configuration;
6795
6796    let local_var_client = &local_var_configuration.client;
6797
6798    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
6799    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
6800
6801    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6802        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6803    }
6804    local_var_req_builder = local_var_req_builder.json(&repos_set_status_check_contexts_request);
6805
6806    let local_var_req = local_var_req_builder.build()?;
6807    let local_var_resp = local_var_client.execute(local_var_req).await?;
6808
6809    let local_var_status = local_var_resp.status();
6810    let local_var_content = local_var_resp.text().await?;
6811
6812    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6813        serde_json::from_str(&local_var_content).map_err(Error::from)
6814    } else {
6815        let local_var_entity: Option<ReposSlashRemoveStatusCheckContextsError> = serde_json::from_str(&local_var_content).ok();
6816        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6817        Err(Error::ResponseError(local_var_error))
6818    }
6819}
6820
6821/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
6822pub async fn repos_slash_remove_status_check_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<(), Error<ReposSlashRemoveStatusCheckProtectionError>> {
6823    let local_var_configuration = configuration;
6824
6825    let local_var_client = &local_var_configuration.client;
6826
6827    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
6828    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
6829
6830    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6831        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6832    }
6833
6834    let local_var_req = local_var_req_builder.build()?;
6835    let local_var_resp = local_var_client.execute(local_var_req).await?;
6836
6837    let local_var_status = local_var_resp.status();
6838    let local_var_content = local_var_resp.text().await?;
6839
6840    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6841        Ok(())
6842    } else {
6843        let local_var_entity: Option<ReposSlashRemoveStatusCheckProtectionError> = serde_json::from_str(&local_var_content).ok();
6844        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6845        Err(Error::ResponseError(local_var_error))
6846    }
6847}
6848
6849/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Removes the ability of a team to push to this branch. You can also remove push access for child teams.
6850pub async fn repos_slash_remove_team_access_restrictions(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_add_team_access_restrictions_request: Option<models::ReposAddTeamAccessRestrictionsRequest>) -> Result<Vec<models::Team>, Error<ReposSlashRemoveTeamAccessRestrictionsError>> {
6851    let local_var_configuration = configuration;
6852
6853    let local_var_client = &local_var_configuration.client;
6854
6855    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
6856    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
6857
6858    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6859        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6860    }
6861    local_var_req_builder = local_var_req_builder.json(&repos_add_team_access_restrictions_request);
6862
6863    let local_var_req = local_var_req_builder.build()?;
6864    let local_var_resp = local_var_client.execute(local_var_req).await?;
6865
6866    let local_var_status = local_var_resp.status();
6867    let local_var_content = local_var_resp.text().await?;
6868
6869    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6870        serde_json::from_str(&local_var_content).map_err(Error::from)
6871    } else {
6872        let local_var_entity: Option<ReposSlashRemoveTeamAccessRestrictionsError> = serde_json::from_str(&local_var_content).ok();
6873        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6874        Err(Error::ResponseError(local_var_error))
6875    }
6876}
6877
6878/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Removes the ability of a user to push to this branch.  | Type    | Description                                                                                                                                   | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | `array` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |
6879pub async fn repos_slash_remove_user_access_restrictions(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_set_user_access_restrictions_request: Option<models::ReposSetUserAccessRestrictionsRequest>) -> Result<Vec<models::SimpleUser>, Error<ReposSlashRemoveUserAccessRestrictionsError>> {
6880    let local_var_configuration = configuration;
6881
6882    let local_var_client = &local_var_configuration.client;
6883
6884    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
6885    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
6886
6887    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6888        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6889    }
6890    local_var_req_builder = local_var_req_builder.json(&repos_set_user_access_restrictions_request);
6891
6892    let local_var_req = local_var_req_builder.build()?;
6893    let local_var_resp = local_var_client.execute(local_var_req).await?;
6894
6895    let local_var_status = local_var_resp.status();
6896    let local_var_content = local_var_resp.text().await?;
6897
6898    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6899        serde_json::from_str(&local_var_content).map_err(Error::from)
6900    } else {
6901        let local_var_entity: Option<ReposSlashRemoveUserAccessRestrictionsError> = serde_json::from_str(&local_var_content).ok();
6902        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6903        Err(Error::ResponseError(local_var_error))
6904    }
6905}
6906
6907/// Renames a branch in a repository.  **Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see \"[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)\".  The authenticated user must have push access to the branch. If the branch is the default branch, the authenticated user must also have admin or owner permissions.  In order to rename the default branch, fine-grained access tokens also need the `administration:write` repository permission.
6908pub async fn repos_slash_rename_branch(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_rename_branch_request: models::ReposRenameBranchRequest) -> Result<models::BranchWithProtection, Error<ReposSlashRenameBranchError>> {
6909    let local_var_configuration = configuration;
6910
6911    let local_var_client = &local_var_configuration.client;
6912
6913    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/rename", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
6914    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
6915
6916    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6917        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6918    }
6919    local_var_req_builder = local_var_req_builder.json(&repos_rename_branch_request);
6920
6921    let local_var_req = local_var_req_builder.build()?;
6922    let local_var_resp = local_var_client.execute(local_var_req).await?;
6923
6924    let local_var_status = local_var_resp.status();
6925    let local_var_content = local_var_resp.text().await?;
6926
6927    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6928        serde_json::from_str(&local_var_content).map_err(Error::from)
6929    } else {
6930        let local_var_entity: Option<ReposSlashRenameBranchError> = serde_json::from_str(&local_var_content).ok();
6931        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6932        Err(Error::ResponseError(local_var_error))
6933    }
6934}
6935
6936/// 
6937pub async fn repos_slash_replace_all_topics(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_replace_all_topics_request: models::ReposReplaceAllTopicsRequest) -> Result<models::Topic, Error<ReposSlashReplaceAllTopicsError>> {
6938    let local_var_configuration = configuration;
6939
6940    let local_var_client = &local_var_configuration.client;
6941
6942    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/topics", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
6943    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
6944
6945    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6946        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6947    }
6948    local_var_req_builder = local_var_req_builder.json(&repos_replace_all_topics_request);
6949
6950    let local_var_req = local_var_req_builder.build()?;
6951    let local_var_resp = local_var_client.execute(local_var_req).await?;
6952
6953    let local_var_status = local_var_resp.status();
6954    let local_var_content = local_var_resp.text().await?;
6955
6956    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6957        serde_json::from_str(&local_var_content).map_err(Error::from)
6958    } else {
6959        let local_var_entity: Option<ReposSlashReplaceAllTopicsError> = serde_json::from_str(&local_var_content).ok();
6960        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6961        Err(Error::ResponseError(local_var_error))
6962    }
6963}
6964
6965/// You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.  Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes.
6966pub async fn repos_slash_request_pages_build(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::PageBuildStatus, Error<ReposSlashRequestPagesBuildError>> {
6967    let local_var_configuration = configuration;
6968
6969    let local_var_client = &local_var_configuration.client;
6970
6971    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pages/builds", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
6972    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
6973
6974    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6975        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6976    }
6977
6978    let local_var_req = local_var_req_builder.build()?;
6979    let local_var_resp = local_var_client.execute(local_var_req).await?;
6980
6981    let local_var_status = local_var_resp.status();
6982    let local_var_content = local_var_resp.text().await?;
6983
6984    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6985        serde_json::from_str(&local_var_content).map_err(Error::from)
6986    } else {
6987        let local_var_entity: Option<ReposSlashRequestPagesBuildError> = serde_json::from_str(&local_var_content).ok();
6988        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6989        Err(Error::ResponseError(local_var_error))
6990    }
6991}
6992
6993/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.
6994pub async fn repos_slash_set_admin_branch_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<models::ProtectedBranchAdminEnforced, Error<ReposSlashSetAdminBranchProtectionError>> {
6995    let local_var_configuration = configuration;
6996
6997    let local_var_client = &local_var_configuration.client;
6998
6999    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
7000    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
7001
7002    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7003        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7004    }
7005
7006    let local_var_req = local_var_req_builder.build()?;
7007    let local_var_resp = local_var_client.execute(local_var_req).await?;
7008
7009    let local_var_status = local_var_resp.status();
7010    let local_var_content = local_var_resp.text().await?;
7011
7012    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7013        serde_json::from_str(&local_var_content).map_err(Error::from)
7014    } else {
7015        let local_var_entity: Option<ReposSlashSetAdminBranchProtectionError> = serde_json::from_str(&local_var_content).ok();
7016        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7017        Err(Error::ResponseError(local_var_error))
7018    }
7019}
7020
7021/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch.
7022pub async fn repos_slash_set_app_access_restrictions(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_set_app_access_restrictions_request: Option<models::ReposSetAppAccessRestrictionsRequest>) -> Result<Vec<models::Integration>, Error<ReposSlashSetAppAccessRestrictionsError>> {
7023    let local_var_configuration = configuration;
7024
7025    let local_var_client = &local_var_configuration.client;
7026
7027    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
7028    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
7029
7030    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7031        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7032    }
7033    local_var_req_builder = local_var_req_builder.json(&repos_set_app_access_restrictions_request);
7034
7035    let local_var_req = local_var_req_builder.build()?;
7036    let local_var_resp = local_var_client.execute(local_var_req).await?;
7037
7038    let local_var_status = local_var_resp.status();
7039    let local_var_content = local_var_resp.text().await?;
7040
7041    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7042        serde_json::from_str(&local_var_content).map_err(Error::from)
7043    } else {
7044        let local_var_entity: Option<ReposSlashSetAppAccessRestrictionsError> = serde_json::from_str(&local_var_content).ok();
7045        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7046        Err(Error::ResponseError(local_var_error))
7047    }
7048}
7049
7050/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
7051pub async fn repos_slash_set_status_check_contexts(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_set_status_check_contexts_request: Option<models::ReposSetStatusCheckContextsRequest>) -> Result<Vec<String>, Error<ReposSlashSetStatusCheckContextsError>> {
7052    let local_var_configuration = configuration;
7053
7054    let local_var_client = &local_var_configuration.client;
7055
7056    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
7057    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
7058
7059    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7060        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7061    }
7062    local_var_req_builder = local_var_req_builder.json(&repos_set_status_check_contexts_request);
7063
7064    let local_var_req = local_var_req_builder.build()?;
7065    let local_var_resp = local_var_client.execute(local_var_req).await?;
7066
7067    let local_var_status = local_var_resp.status();
7068    let local_var_content = local_var_resp.text().await?;
7069
7070    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7071        serde_json::from_str(&local_var_content).map_err(Error::from)
7072    } else {
7073        let local_var_entity: Option<ReposSlashSetStatusCheckContextsError> = serde_json::from_str(&local_var_content).ok();
7074        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7075        Err(Error::ResponseError(local_var_error))
7076    }
7077}
7078
7079/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams.
7080pub async fn repos_slash_set_team_access_restrictions(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_set_team_access_restrictions_request: Option<models::ReposSetTeamAccessRestrictionsRequest>) -> Result<Vec<models::Team>, Error<ReposSlashSetTeamAccessRestrictionsError>> {
7081    let local_var_configuration = configuration;
7082
7083    let local_var_client = &local_var_configuration.client;
7084
7085    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
7086    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
7087
7088    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7089        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7090    }
7091    local_var_req_builder = local_var_req_builder.json(&repos_set_team_access_restrictions_request);
7092
7093    let local_var_req = local_var_req_builder.build()?;
7094    let local_var_resp = local_var_client.execute(local_var_req).await?;
7095
7096    let local_var_status = local_var_resp.status();
7097    let local_var_content = local_var_resp.text().await?;
7098
7099    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7100        serde_json::from_str(&local_var_content).map_err(Error::from)
7101    } else {
7102        let local_var_entity: Option<ReposSlashSetTeamAccessRestrictionsError> = serde_json::from_str(&local_var_content).ok();
7103        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7104        Err(Error::ResponseError(local_var_error))
7105    }
7106}
7107
7108/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people.  | Type    | Description                                                                                                                   | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |
7109pub async fn repos_slash_set_user_access_restrictions(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_set_user_access_restrictions_request: Option<models::ReposSetUserAccessRestrictionsRequest>) -> Result<Vec<models::SimpleUser>, Error<ReposSlashSetUserAccessRestrictionsError>> {
7110    let local_var_configuration = configuration;
7111
7112    let local_var_client = &local_var_configuration.client;
7113
7114    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
7115    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
7116
7117    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7118        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7119    }
7120    local_var_req_builder = local_var_req_builder.json(&repos_set_user_access_restrictions_request);
7121
7122    let local_var_req = local_var_req_builder.build()?;
7123    let local_var_resp = local_var_client.execute(local_var_req).await?;
7124
7125    let local_var_status = local_var_resp.status();
7126    let local_var_content = local_var_resp.text().await?;
7127
7128    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7129        serde_json::from_str(&local_var_content).map_err(Error::from)
7130    } else {
7131        let local_var_entity: Option<ReposSlashSetUserAccessRestrictionsError> = serde_json::from_str(&local_var_content).ok();
7132        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7133        Err(Error::ResponseError(local_var_error))
7134    }
7135}
7136
7137/// This will trigger the hook with the latest push to the current repository if the hook is subscribed to `push` events. If the hook is not subscribed to `push` events, the server will respond with 204 but no test POST will be generated.  **Note**: Previously `/repos/:owner/:repo/hooks/:hook_id/test`
7138pub async fn repos_slash_test_push_webhook(configuration: &configuration::Configuration, owner: &str, repo: &str, hook_id: i32) -> Result<(), Error<ReposSlashTestPushWebhookError>> {
7139    let local_var_configuration = configuration;
7140
7141    let local_var_client = &local_var_configuration.client;
7142
7143    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/{hook_id}/tests", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), hook_id=hook_id);
7144    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
7145
7146    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7147        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7148    }
7149
7150    let local_var_req = local_var_req_builder.build()?;
7151    let local_var_resp = local_var_client.execute(local_var_req).await?;
7152
7153    let local_var_status = local_var_resp.status();
7154    let local_var_content = local_var_resp.text().await?;
7155
7156    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7157        Ok(())
7158    } else {
7159        let local_var_entity: Option<ReposSlashTestPushWebhookError> = serde_json::from_str(&local_var_content).ok();
7160        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7161        Err(Error::ResponseError(local_var_error))
7162    }
7163}
7164
7165/// A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original `owner`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://docs.github.com/articles/about-repository-transfers/).
7166pub async fn repos_slash_transfer(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_transfer_request: models::ReposTransferRequest) -> Result<models::MinimalRepository, Error<ReposSlashTransferError>> {
7167    let local_var_configuration = configuration;
7168
7169    let local_var_client = &local_var_configuration.client;
7170
7171    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/transfer", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
7172    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
7173
7174    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7175        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7176    }
7177    local_var_req_builder = local_var_req_builder.json(&repos_transfer_request);
7178
7179    let local_var_req = local_var_req_builder.build()?;
7180    let local_var_resp = local_var_client.execute(local_var_req).await?;
7181
7182    let local_var_status = local_var_resp.status();
7183    let local_var_content = local_var_resp.text().await?;
7184
7185    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7186        serde_json::from_str(&local_var_content).map_err(Error::from)
7187    } else {
7188        let local_var_entity: Option<ReposSlashTransferError> = serde_json::from_str(&local_var_content).ok();
7189        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7190        Err(Error::ResponseError(local_var_error))
7191    }
7192}
7193
7194/// **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/repos/repos#replace-all-repository-topics) endpoint.
7195pub async fn repos_slash_update(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_update_request: Option<models::ReposUpdateRequest>) -> Result<models::FullRepository, Error<ReposSlashUpdateError>> {
7196    let local_var_configuration = configuration;
7197
7198    let local_var_client = &local_var_configuration.client;
7199
7200    let local_var_uri_str = format!("{}/repos/{owner}/{repo}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
7201    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
7202
7203    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7204        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7205    }
7206    local_var_req_builder = local_var_req_builder.json(&repos_update_request);
7207
7208    let local_var_req = local_var_req_builder.build()?;
7209    let local_var_resp = local_var_client.execute(local_var_req).await?;
7210
7211    let local_var_status = local_var_resp.status();
7212    let local_var_content = local_var_resp.text().await?;
7213
7214    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7215        serde_json::from_str(&local_var_content).map_err(Error::from)
7216    } else {
7217        let local_var_entity: Option<ReposSlashUpdateError> = serde_json::from_str(&local_var_content).ok();
7218        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7219        Err(Error::ResponseError(local_var_error))
7220    }
7221}
7222
7223/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Protecting a branch requires admin or owner permissions to the repository.  **Note**: Passing new arrays of `users` and `teams` replaces their previous values.  **Note**: The list of users, apps, and teams in total is limited to 100 items.
7224pub async fn repos_slash_update_branch_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_update_branch_protection_request: models::ReposUpdateBranchProtectionRequest) -> Result<models::ProtectedBranch, Error<ReposSlashUpdateBranchProtectionError>> {
7225    let local_var_configuration = configuration;
7226
7227    let local_var_client = &local_var_configuration.client;
7228
7229    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
7230    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
7231
7232    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7233        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7234    }
7235    local_var_req_builder = local_var_req_builder.json(&repos_update_branch_protection_request);
7236
7237    let local_var_req = local_var_req_builder.build()?;
7238    let local_var_resp = local_var_client.execute(local_var_req).await?;
7239
7240    let local_var_status = local_var_resp.status();
7241    let local_var_content = local_var_resp.text().await?;
7242
7243    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7244        serde_json::from_str(&local_var_content).map_err(Error::from)
7245    } else {
7246        let local_var_entity: Option<ReposSlashUpdateBranchProtectionError> = serde_json::from_str(&local_var_content).ok();
7247        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7248        Err(Error::ResponseError(local_var_error))
7249    }
7250}
7251
7252/// Updates the contents of a specified commit comment.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
7253pub async fn repos_slash_update_commit_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32, repos_update_commit_comment_request: models::ReposUpdateCommitCommentRequest) -> Result<models::CommitComment, Error<ReposSlashUpdateCommitCommentError>> {
7254    let local_var_configuration = configuration;
7255
7256    let local_var_client = &local_var_configuration.client;
7257
7258    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/comments/{comment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
7259    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
7260
7261    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7262        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7263    }
7264    local_var_req_builder = local_var_req_builder.json(&repos_update_commit_comment_request);
7265
7266    let local_var_req = local_var_req_builder.build()?;
7267    let local_var_resp = local_var_client.execute(local_var_req).await?;
7268
7269    let local_var_status = local_var_resp.status();
7270    let local_var_content = local_var_resp.text().await?;
7271
7272    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7273        serde_json::from_str(&local_var_content).map_err(Error::from)
7274    } else {
7275        let local_var_entity: Option<ReposSlashUpdateCommitCommentError> = serde_json::from_str(&local_var_content).ok();
7276        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7277        Err(Error::ResponseError(local_var_error))
7278    }
7279}
7280
7281/// Updates a deployment branch or tag policy for an environment.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
7282pub async fn repos_slash_update_deployment_branch_policy(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str, branch_policy_id: i32, deployment_branch_policy_name_pattern: models::DeploymentBranchPolicyNamePattern) -> Result<models::DeploymentBranchPolicy, Error<ReposSlashUpdateDeploymentBranchPolicyError>> {
7283    let local_var_configuration = configuration;
7284
7285    let local_var_client = &local_var_configuration.client;
7286
7287    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name), branch_policy_id=branch_policy_id);
7288    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
7289
7290    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7291        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7292    }
7293    local_var_req_builder = local_var_req_builder.json(&deployment_branch_policy_name_pattern);
7294
7295    let local_var_req = local_var_req_builder.build()?;
7296    let local_var_resp = local_var_client.execute(local_var_req).await?;
7297
7298    let local_var_status = local_var_resp.status();
7299    let local_var_content = local_var_resp.text().await?;
7300
7301    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7302        serde_json::from_str(&local_var_content).map_err(Error::from)
7303    } else {
7304        let local_var_entity: Option<ReposSlashUpdateDeploymentBranchPolicyError> = serde_json::from_str(&local_var_content).ok();
7305        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7306        Err(Error::ResponseError(local_var_error))
7307    }
7308}
7309
7310/// Updates information for a GitHub Pages site. For more information, see \"[About GitHub Pages](/github/working-with-github-pages/about-github-pages).  The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.  OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
7311pub async fn repos_slash_update_information_about_pages_site(configuration: &configuration::Configuration, owner: &str, repo: &str, repos_update_information_about_pages_site_request: Option<models::ReposUpdateInformationAboutPagesSiteRequest>) -> Result<(), Error<ReposSlashUpdateInformationAboutPagesSiteError>> {
7312    let local_var_configuration = configuration;
7313
7314    let local_var_client = &local_var_configuration.client;
7315
7316    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pages", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
7317    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
7318
7319    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7320        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7321    }
7322    local_var_req_builder = local_var_req_builder.json(&repos_update_information_about_pages_site_request);
7323
7324    let local_var_req = local_var_req_builder.build()?;
7325    let local_var_resp = local_var_client.execute(local_var_req).await?;
7326
7327    let local_var_status = local_var_resp.status();
7328    let local_var_content = local_var_resp.text().await?;
7329
7330    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7331        Ok(())
7332    } else {
7333        let local_var_entity: Option<ReposSlashUpdateInformationAboutPagesSiteError> = serde_json::from_str(&local_var_content).ok();
7334        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7335        Err(Error::ResponseError(local_var_error))
7336    }
7337}
7338
7339/// 
7340pub async fn repos_slash_update_invitation(configuration: &configuration::Configuration, owner: &str, repo: &str, invitation_id: i32, repos_update_invitation_request: Option<models::ReposUpdateInvitationRequest>) -> Result<models::RepositoryInvitation, Error<ReposSlashUpdateInvitationError>> {
7341    let local_var_configuration = configuration;
7342
7343    let local_var_client = &local_var_configuration.client;
7344
7345    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/invitations/{invitation_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), invitation_id=invitation_id);
7346    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
7347
7348    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7349        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7350    }
7351    local_var_req_builder = local_var_req_builder.json(&repos_update_invitation_request);
7352
7353    let local_var_req = local_var_req_builder.build()?;
7354    let local_var_resp = local_var_client.execute(local_var_req).await?;
7355
7356    let local_var_status = local_var_resp.status();
7357    let local_var_content = local_var_resp.text().await?;
7358
7359    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7360        serde_json::from_str(&local_var_content).map_err(Error::from)
7361    } else {
7362        let local_var_entity: Option<ReposSlashUpdateInvitationError> = serde_json::from_str(&local_var_content).ok();
7363        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7364        Err(Error::ResponseError(local_var_error))
7365    }
7366}
7367
7368/// Update a ruleset for an organization.
7369pub async fn repos_slash_update_org_ruleset(configuration: &configuration::Configuration, org: &str, ruleset_id: i32, repos_update_org_ruleset_request: Option<models::ReposUpdateOrgRulesetRequest>) -> Result<models::RepositoryRuleset, Error<ReposSlashUpdateOrgRulesetError>> {
7370    let local_var_configuration = configuration;
7371
7372    let local_var_client = &local_var_configuration.client;
7373
7374    let local_var_uri_str = format!("{}/orgs/{org}/rulesets/{ruleset_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), ruleset_id=ruleset_id);
7375    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
7376
7377    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7378        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7379    }
7380    local_var_req_builder = local_var_req_builder.json(&repos_update_org_ruleset_request);
7381
7382    let local_var_req = local_var_req_builder.build()?;
7383    let local_var_resp = local_var_client.execute(local_var_req).await?;
7384
7385    let local_var_status = local_var_resp.status();
7386    let local_var_content = local_var_resp.text().await?;
7387
7388    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7389        serde_json::from_str(&local_var_content).map_err(Error::from)
7390    } else {
7391        let local_var_entity: Option<ReposSlashUpdateOrgRulesetError> = serde_json::from_str(&local_var_content).ok();
7392        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7393        Err(Error::ResponseError(local_var_error))
7394    }
7395}
7396
7397/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled.  **Note**: Passing new arrays of `users` and `teams` replaces their previous values.
7398pub async fn repos_slash_update_pull_request_review_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_update_pull_request_review_protection_request: Option<models::ReposUpdatePullRequestReviewProtectionRequest>) -> Result<models::ProtectedBranchPullRequestReview, Error<ReposSlashUpdatePullRequestReviewProtectionError>> {
7399    let local_var_configuration = configuration;
7400
7401    let local_var_client = &local_var_configuration.client;
7402
7403    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
7404    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
7405
7406    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7407        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7408    }
7409    local_var_req_builder = local_var_req_builder.json(&repos_update_pull_request_review_protection_request);
7410
7411    let local_var_req = local_var_req_builder.build()?;
7412    let local_var_resp = local_var_client.execute(local_var_req).await?;
7413
7414    let local_var_status = local_var_resp.status();
7415    let local_var_content = local_var_resp.text().await?;
7416
7417    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7418        serde_json::from_str(&local_var_content).map_err(Error::from)
7419    } else {
7420        let local_var_entity: Option<ReposSlashUpdatePullRequestReviewProtectionError> = serde_json::from_str(&local_var_content).ok();
7421        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7422        Err(Error::ResponseError(local_var_error))
7423    }
7424}
7425
7426/// Users with push access to the repository can edit a release.
7427pub async fn repos_slash_update_release(configuration: &configuration::Configuration, owner: &str, repo: &str, release_id: i32, repos_update_release_request: Option<models::ReposUpdateReleaseRequest>) -> Result<models::Release, Error<ReposSlashUpdateReleaseError>> {
7428    let local_var_configuration = configuration;
7429
7430    let local_var_client = &local_var_configuration.client;
7431
7432    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{release_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), release_id=release_id);
7433    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
7434
7435    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7436        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7437    }
7438    local_var_req_builder = local_var_req_builder.json(&repos_update_release_request);
7439
7440    let local_var_req = local_var_req_builder.build()?;
7441    let local_var_resp = local_var_client.execute(local_var_req).await?;
7442
7443    let local_var_status = local_var_resp.status();
7444    let local_var_content = local_var_resp.text().await?;
7445
7446    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7447        serde_json::from_str(&local_var_content).map_err(Error::from)
7448    } else {
7449        let local_var_entity: Option<ReposSlashUpdateReleaseError> = serde_json::from_str(&local_var_content).ok();
7450        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7451        Err(Error::ResponseError(local_var_error))
7452    }
7453}
7454
7455/// Users with push access to the repository can edit a release asset.
7456pub async fn repos_slash_update_release_asset(configuration: &configuration::Configuration, owner: &str, repo: &str, asset_id: i32, repos_update_release_asset_request: Option<models::ReposUpdateReleaseAssetRequest>) -> Result<models::ReleaseAsset, Error<ReposSlashUpdateReleaseAssetError>> {
7457    let local_var_configuration = configuration;
7458
7459    let local_var_client = &local_var_configuration.client;
7460
7461    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/assets/{asset_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), asset_id=asset_id);
7462    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
7463
7464    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7465        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7466    }
7467    local_var_req_builder = local_var_req_builder.json(&repos_update_release_asset_request);
7468
7469    let local_var_req = local_var_req_builder.build()?;
7470    let local_var_resp = local_var_client.execute(local_var_req).await?;
7471
7472    let local_var_status = local_var_resp.status();
7473    let local_var_content = local_var_resp.text().await?;
7474
7475    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7476        serde_json::from_str(&local_var_content).map_err(Error::from)
7477    } else {
7478        let local_var_entity: Option<ReposSlashUpdateReleaseAssetError> = serde_json::from_str(&local_var_content).ok();
7479        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7480        Err(Error::ResponseError(local_var_error))
7481    }
7482}
7483
7484/// Update a ruleset for a repository.
7485pub async fn repos_slash_update_repo_ruleset(configuration: &configuration::Configuration, owner: &str, repo: &str, ruleset_id: i32, repos_update_repo_ruleset_request: Option<models::ReposUpdateRepoRulesetRequest>) -> Result<models::RepositoryRuleset, Error<ReposSlashUpdateRepoRulesetError>> {
7486    let local_var_configuration = configuration;
7487
7488    let local_var_client = &local_var_configuration.client;
7489
7490    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/rulesets/{ruleset_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), ruleset_id=ruleset_id);
7491    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
7492
7493    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7494        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7495    }
7496    local_var_req_builder = local_var_req_builder.json(&repos_update_repo_ruleset_request);
7497
7498    let local_var_req = local_var_req_builder.build()?;
7499    let local_var_resp = local_var_client.execute(local_var_req).await?;
7500
7501    let local_var_status = local_var_resp.status();
7502    let local_var_content = local_var_resp.text().await?;
7503
7504    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7505        serde_json::from_str(&local_var_content).map_err(Error::from)
7506    } else {
7507        let local_var_entity: Option<ReposSlashUpdateRepoRulesetError> = serde_json::from_str(&local_var_content).ok();
7508        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7509        Err(Error::ResponseError(local_var_error))
7510    }
7511}
7512
7513/// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled.
7514pub async fn repos_slash_update_status_check_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str, repos_update_status_check_protection_request: Option<models::ReposUpdateStatusCheckProtectionRequest>) -> Result<models::StatusCheckPolicy, Error<ReposSlashUpdateStatusCheckProtectionError>> {
7515    let local_var_configuration = configuration;
7516
7517    let local_var_client = &local_var_configuration.client;
7518
7519    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch));
7520    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
7521
7522    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7523        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7524    }
7525    local_var_req_builder = local_var_req_builder.json(&repos_update_status_check_protection_request);
7526
7527    let local_var_req = local_var_req_builder.build()?;
7528    let local_var_resp = local_var_client.execute(local_var_req).await?;
7529
7530    let local_var_status = local_var_resp.status();
7531    let local_var_content = local_var_resp.text().await?;
7532
7533    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7534        serde_json::from_str(&local_var_content).map_err(Error::from)
7535    } else {
7536        let local_var_entity: Option<ReposSlashUpdateStatusCheckProtectionError> = serde_json::from_str(&local_var_content).ok();
7537        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7538        Err(Error::ResponseError(local_var_error))
7539    }
7540}
7541
7542/// Updates a webhook configured in a repository. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use \"[Update a webhook configuration for a repository](/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository).\"
7543pub async fn repos_slash_update_webhook(configuration: &configuration::Configuration, owner: &str, repo: &str, hook_id: i32, repos_update_webhook_request: models::ReposUpdateWebhookRequest) -> Result<models::Hook, Error<ReposSlashUpdateWebhookError>> {
7544    let local_var_configuration = configuration;
7545
7546    let local_var_client = &local_var_configuration.client;
7547
7548    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/{hook_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), hook_id=hook_id);
7549    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
7550
7551    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7552        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7553    }
7554    local_var_req_builder = local_var_req_builder.json(&repos_update_webhook_request);
7555
7556    let local_var_req = local_var_req_builder.build()?;
7557    let local_var_resp = local_var_client.execute(local_var_req).await?;
7558
7559    let local_var_status = local_var_resp.status();
7560    let local_var_content = local_var_resp.text().await?;
7561
7562    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7563        serde_json::from_str(&local_var_content).map_err(Error::from)
7564    } else {
7565        let local_var_entity: Option<ReposSlashUpdateWebhookError> = serde_json::from_str(&local_var_content).ok();
7566        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7567        Err(Error::ResponseError(local_var_error))
7568    }
7569}
7570
7571/// Updates the webhook configuration for a repository. To update more information about the webhook, including the `active` state and `events`, use \"[Update a repository webhook](/rest/webhooks/repos#update-a-repository-webhook).\"  OAuth app tokens and personal access tokens (classic) need the `write:repo_hook` or `repo` scope to use this endpoint.
7572pub async fn repos_slash_update_webhook_config_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, hook_id: i32, repos_update_webhook_config_for_repo_request: Option<models::ReposUpdateWebhookConfigForRepoRequest>) -> Result<models::WebhookConfig, Error<ReposSlashUpdateWebhookConfigForRepoError>> {
7573    let local_var_configuration = configuration;
7574
7575    let local_var_client = &local_var_configuration.client;
7576
7577    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/{hook_id}/config", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), hook_id=hook_id);
7578    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
7579
7580    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7581        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7582    }
7583    local_var_req_builder = local_var_req_builder.json(&repos_update_webhook_config_for_repo_request);
7584
7585    let local_var_req = local_var_req_builder.build()?;
7586    let local_var_resp = local_var_client.execute(local_var_req).await?;
7587
7588    let local_var_status = local_var_resp.status();
7589    let local_var_content = local_var_resp.text().await?;
7590
7591    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7592        serde_json::from_str(&local_var_content).map_err(Error::from)
7593    } else {
7594        let local_var_entity: Option<ReposSlashUpdateWebhookConfigForRepoError> = serde_json::from_str(&local_var_content).ok();
7595        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7596        Err(Error::ResponseError(local_var_error))
7597    }
7598}
7599
7600/// This endpoint makes use of a [Hypermedia relation](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned in the response of the [Create a release endpoint](https://docs.github.com/rest/releases/releases#create-a-release) to upload a release asset.  You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint.  Most libraries will set the required `Content-Length` header automatically. Use the required `Content-Type` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example:   `application/zip`  GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, you'll still need to pass your authentication to be able to upload an asset.  When an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted.  **Notes:** *   GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The \"[List release assets](https://docs.github.com/rest/releases/assets#list-release-assets)\" endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api). *   To find the `release_id` query the [`GET /repos/{owner}/{repo}/releases/latest` endpoint](https://docs.github.com/rest/releases/releases#get-the-latest-release).  *   If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset.
7601pub async fn repos_slash_upload_release_asset(configuration: &configuration::Configuration, owner: &str, repo: &str, release_id: i32, name: &str, label: Option<&str>, body: Option<std::path::PathBuf>) -> Result<models::ReleaseAsset, Error<ReposSlashUploadReleaseAssetError>> {
7602    let local_var_configuration = configuration;
7603
7604    let local_var_client = &local_var_configuration.client;
7605
7606    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{release_id}/assets", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), release_id=release_id);
7607    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
7608
7609    local_var_req_builder = local_var_req_builder.query(&[("name", &name.to_string())]);
7610    if let Some(ref local_var_str) = label {
7611        local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
7612    }
7613    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
7614        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
7615    }
7616    local_var_req_builder = local_var_req_builder.json(&body);
7617
7618    let local_var_req = local_var_req_builder.build()?;
7619    let local_var_resp = local_var_client.execute(local_var_req).await?;
7620
7621    let local_var_status = local_var_resp.status();
7622    let local_var_content = local_var_resp.text().await?;
7623
7624    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
7625        serde_json::from_str(&local_var_content).map_err(Error::from)
7626    } else {
7627        let local_var_entity: Option<ReposSlashUploadReleaseAssetError> = serde_json::from_str(&local_var_content).ok();
7628        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
7629        Err(Error::ResponseError(local_var_error))
7630    }
7631}
7632