roctogen/endpoints/
orgs.rs

1//! Method, error and parameter types for the Orgs endpoint.
2#![allow(
3    clippy::all
4)]
5/* 
6 * GitHub v3 REST API
7 *
8 * GitHub's v3 REST API.
9 *
10 * OpenAPI spec version: 1.1.4
11 * 
12 * Generated by: https://github.com/swagger-api/swagger-codegen.git
13 */
14
15use serde::Deserialize;
16
17use roctokit::adapters::{AdapterError, Client, GitHubRequest, GitHubResponseExt};
18use crate::models::*;
19
20use super::PerPage;
21
22use std::collections::HashMap;
23use serde_json::value::Value;
24
25pub struct Orgs<'api, C: Client> where AdapterError: From<<C as Client>::Err> {
26    client: &'api C
27}
28
29pub fn new<C: Client>(client: &C) -> Orgs<C> where AdapterError: From<<C as Client>::Err> {
30    Orgs { client }
31}
32
33/// Errors for the [Add a security manager team](Orgs::add_security_manager_team_async()) endpoint.
34#[derive(Debug, thiserror::Error)]
35pub enum OrgsAddSecurityManagerTeamError {
36    #[error("Status code: {}", code)]
37    Generic { code: u16 },
38}
39
40impl From<OrgsAddSecurityManagerTeamError> for AdapterError {
41    fn from(err: OrgsAddSecurityManagerTeamError) -> Self {
42        let (description, status_code) = match err {
43            OrgsAddSecurityManagerTeamError::Generic { code } => (String::from("Generic"), code)
44        };
45
46        Self::Endpoint {
47            description,
48            status_code,
49            source: Some(Box::new(err))
50        }
51    }
52}
53
54/// Errors for the [Assign an organization role to a team](Orgs::assign_team_to_org_role_async()) endpoint.
55#[derive(Debug, thiserror::Error)]
56pub enum OrgsAssignTeamToOrgRoleError {
57    #[error("Response if the organization, team or role does not exist.")]
58    Status404,
59    #[error("Response if the organization roles feature is not enabled for the organization, or validation failed.")]
60    Status422,
61    #[error("Status code: {}", code)]
62    Generic { code: u16 },
63}
64
65impl From<OrgsAssignTeamToOrgRoleError> for AdapterError {
66    fn from(err: OrgsAssignTeamToOrgRoleError) -> Self {
67        let (description, status_code) = match err {
68            OrgsAssignTeamToOrgRoleError::Status404 => (String::from("Response if the organization, team or role does not exist."), 404),
69            OrgsAssignTeamToOrgRoleError::Status422 => (String::from("Response if the organization roles feature is not enabled for the organization, or validation failed."), 422),
70            OrgsAssignTeamToOrgRoleError::Generic { code } => (String::from("Generic"), code)
71        };
72
73        Self::Endpoint {
74            description,
75            status_code,
76            source: Some(Box::new(err))
77        }
78    }
79}
80
81/// Errors for the [Assign an organization role to a user](Orgs::assign_user_to_org_role_async()) endpoint.
82#[derive(Debug, thiserror::Error)]
83pub enum OrgsAssignUserToOrgRoleError {
84    #[error("Response if the organization, user or role does not exist.")]
85    Status404,
86    #[error("Response if the organization roles feature is not enabled enabled for the organization, the validation failed, or the user is not an organization member.")]
87    Status422,
88    #[error("Status code: {}", code)]
89    Generic { code: u16 },
90}
91
92impl From<OrgsAssignUserToOrgRoleError> for AdapterError {
93    fn from(err: OrgsAssignUserToOrgRoleError) -> Self {
94        let (description, status_code) = match err {
95            OrgsAssignUserToOrgRoleError::Status404 => (String::from("Response if the organization, user or role does not exist."), 404),
96            OrgsAssignUserToOrgRoleError::Status422 => (String::from("Response if the organization roles feature is not enabled enabled for the organization, the validation failed, or the user is not an organization member."), 422),
97            OrgsAssignUserToOrgRoleError::Generic { code } => (String::from("Generic"), code)
98        };
99
100        Self::Endpoint {
101            description,
102            status_code,
103            source: Some(Box::new(err))
104        }
105    }
106}
107
108/// Errors for the [Block a user from an organization](Orgs::block_user_async()) endpoint.
109#[derive(Debug, thiserror::Error)]
110pub enum OrgsBlockUserError {
111    #[error("Validation failed, or the endpoint has been spammed.")]
112    Status422(ValidationError),
113    #[error("Status code: {}", code)]
114    Generic { code: u16 },
115}
116
117impl From<OrgsBlockUserError> for AdapterError {
118    fn from(err: OrgsBlockUserError) -> Self {
119        let (description, status_code) = match err {
120            OrgsBlockUserError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
121            OrgsBlockUserError::Generic { code } => (String::from("Generic"), code)
122        };
123
124        Self::Endpoint {
125            description,
126            status_code,
127            source: Some(Box::new(err))
128        }
129    }
130}
131
132/// Errors for the [Cancel an organization invitation](Orgs::cancel_invitation_async()) endpoint.
133#[derive(Debug, thiserror::Error)]
134pub enum OrgsCancelInvitationError {
135    #[error("Validation failed, or the endpoint has been spammed.")]
136    Status422(ValidationError),
137    #[error("Resource not found")]
138    Status404(BasicError),
139    #[error("Status code: {}", code)]
140    Generic { code: u16 },
141}
142
143impl From<OrgsCancelInvitationError> for AdapterError {
144    fn from(err: OrgsCancelInvitationError) -> Self {
145        let (description, status_code) = match err {
146            OrgsCancelInvitationError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
147            OrgsCancelInvitationError::Status404(_) => (String::from("Resource not found"), 404),
148            OrgsCancelInvitationError::Generic { code } => (String::from("Generic"), code)
149        };
150
151        Self::Endpoint {
152            description,
153            status_code,
154            source: Some(Box::new(err))
155        }
156    }
157}
158
159/// Errors for the [Check if a user is blocked by an organization](Orgs::check_blocked_user_async()) endpoint.
160#[derive(Debug, thiserror::Error)]
161pub enum OrgsCheckBlockedUserError {
162    #[error("If the user is not blocked")]
163    Status404(BasicError),
164    #[error("Status code: {}", code)]
165    Generic { code: u16 },
166}
167
168impl From<OrgsCheckBlockedUserError> for AdapterError {
169    fn from(err: OrgsCheckBlockedUserError) -> Self {
170        let (description, status_code) = match err {
171            OrgsCheckBlockedUserError::Status404(_) => (String::from("If the user is not blocked"), 404),
172            OrgsCheckBlockedUserError::Generic { code } => (String::from("Generic"), code)
173        };
174
175        Self::Endpoint {
176            description,
177            status_code,
178            source: Some(Box::new(err))
179        }
180    }
181}
182
183/// Errors for the [Check organization membership for a user](Orgs::check_membership_for_user_async()) endpoint.
184#[derive(Debug, thiserror::Error)]
185pub enum OrgsCheckMembershipForUserError {
186    #[error("Response if requester is not an organization member")]
187    Status302,
188    #[error("Not Found if requester is an organization member and user is not a member")]
189    Status404,
190    #[error("Status code: {}", code)]
191    Generic { code: u16 },
192}
193
194impl From<OrgsCheckMembershipForUserError> for AdapterError {
195    fn from(err: OrgsCheckMembershipForUserError) -> Self {
196        let (description, status_code) = match err {
197            OrgsCheckMembershipForUserError::Status302 => (String::from("Response if requester is not an organization member"), 302),
198            OrgsCheckMembershipForUserError::Status404 => (String::from("Not Found if requester is an organization member and user is not a member"), 404),
199            OrgsCheckMembershipForUserError::Generic { code } => (String::from("Generic"), code)
200        };
201
202        Self::Endpoint {
203            description,
204            status_code,
205            source: Some(Box::new(err))
206        }
207    }
208}
209
210/// Errors for the [Check public organization membership for a user](Orgs::check_public_membership_for_user_async()) endpoint.
211#[derive(Debug, thiserror::Error)]
212pub enum OrgsCheckPublicMembershipForUserError {
213    #[error("Not Found if user is not a public member")]
214    Status404,
215    #[error("Status code: {}", code)]
216    Generic { code: u16 },
217}
218
219impl From<OrgsCheckPublicMembershipForUserError> for AdapterError {
220    fn from(err: OrgsCheckPublicMembershipForUserError) -> Self {
221        let (description, status_code) = match err {
222            OrgsCheckPublicMembershipForUserError::Status404 => (String::from("Not Found if user is not a public member"), 404),
223            OrgsCheckPublicMembershipForUserError::Generic { code } => (String::from("Generic"), code)
224        };
225
226        Self::Endpoint {
227            description,
228            status_code,
229            source: Some(Box::new(err))
230        }
231    }
232}
233
234/// Errors for the [Convert an organization member to outside collaborator](Orgs::convert_member_to_outside_collaborator_async()) endpoint.
235#[derive(Debug, thiserror::Error)]
236pub enum OrgsConvertMemberToOutsideCollaboratorError {
237    #[error("User was converted")]
238    Status204,
239    #[error("Forbidden if user is the last owner of the organization, not a member of the organization, or if the enterprise enforces a policy for inviting outside collaborators. 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).\"")]
240    Status403,
241    #[error("Resource not found")]
242    Status404(BasicError),
243    #[error("Status code: {}", code)]
244    Generic { code: u16 },
245}
246
247impl From<OrgsConvertMemberToOutsideCollaboratorError> for AdapterError {
248    fn from(err: OrgsConvertMemberToOutsideCollaboratorError) -> Self {
249        let (description, status_code) = match err {
250            OrgsConvertMemberToOutsideCollaboratorError::Status204 => (String::from("User was converted"), 204),
251            OrgsConvertMemberToOutsideCollaboratorError::Status403 => (String::from("Forbidden if user is the last owner of the organization, not a member of the organization, or if the enterprise enforces a policy for inviting outside collaborators. 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).\""), 403),
252            OrgsConvertMemberToOutsideCollaboratorError::Status404(_) => (String::from("Resource not found"), 404),
253            OrgsConvertMemberToOutsideCollaboratorError::Generic { code } => (String::from("Generic"), code)
254        };
255
256        Self::Endpoint {
257            description,
258            status_code,
259            source: Some(Box::new(err))
260        }
261    }
262}
263
264/// Errors for the [Create an organization invitation](Orgs::create_invitation_async()) endpoint.
265#[derive(Debug, thiserror::Error)]
266pub enum OrgsCreateInvitationError {
267    #[error("Validation failed, or the endpoint has been spammed.")]
268    Status422(ValidationError),
269    #[error("Resource not found")]
270    Status404(BasicError),
271    #[error("Status code: {}", code)]
272    Generic { code: u16 },
273}
274
275impl From<OrgsCreateInvitationError> for AdapterError {
276    fn from(err: OrgsCreateInvitationError) -> Self {
277        let (description, status_code) = match err {
278            OrgsCreateInvitationError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
279            OrgsCreateInvitationError::Status404(_) => (String::from("Resource not found"), 404),
280            OrgsCreateInvitationError::Generic { code } => (String::from("Generic"), code)
281        };
282
283        Self::Endpoint {
284            description,
285            status_code,
286            source: Some(Box::new(err))
287        }
288    }
289}
290
291/// Errors for the [Create issue type for an organization](Orgs::create_issue_type_async()) endpoint.
292#[derive(Debug, thiserror::Error)]
293pub enum OrgsCreateIssueTypeError {
294    #[error("Resource not found")]
295    Status404(BasicError),
296    #[error("Validation failed, or the endpoint has been spammed.")]
297    Status422(ValidationErrorSimple),
298    #[error("Status code: {}", code)]
299    Generic { code: u16 },
300}
301
302impl From<OrgsCreateIssueTypeError> for AdapterError {
303    fn from(err: OrgsCreateIssueTypeError) -> Self {
304        let (description, status_code) = match err {
305            OrgsCreateIssueTypeError::Status404(_) => (String::from("Resource not found"), 404),
306            OrgsCreateIssueTypeError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
307            OrgsCreateIssueTypeError::Generic { code } => (String::from("Generic"), code)
308        };
309
310        Self::Endpoint {
311            description,
312            status_code,
313            source: Some(Box::new(err))
314        }
315    }
316}
317
318/// Errors for the [Create or update custom properties for an organization](Orgs::create_or_update_custom_properties_async()) endpoint.
319#[derive(Debug, thiserror::Error)]
320pub enum OrgsCreateOrUpdateCustomPropertiesError {
321    #[error("Forbidden")]
322    Status403(BasicError),
323    #[error("Resource not found")]
324    Status404(BasicError),
325    #[error("Status code: {}", code)]
326    Generic { code: u16 },
327}
328
329impl From<OrgsCreateOrUpdateCustomPropertiesError> for AdapterError {
330    fn from(err: OrgsCreateOrUpdateCustomPropertiesError) -> Self {
331        let (description, status_code) = match err {
332            OrgsCreateOrUpdateCustomPropertiesError::Status403(_) => (String::from("Forbidden"), 403),
333            OrgsCreateOrUpdateCustomPropertiesError::Status404(_) => (String::from("Resource not found"), 404),
334            OrgsCreateOrUpdateCustomPropertiesError::Generic { code } => (String::from("Generic"), code)
335        };
336
337        Self::Endpoint {
338            description,
339            status_code,
340            source: Some(Box::new(err))
341        }
342    }
343}
344
345/// Errors for the [Create or update custom property values for organization repositories](Orgs::create_or_update_custom_properties_values_for_repos_async()) endpoint.
346#[derive(Debug, thiserror::Error)]
347pub enum OrgsCreateOrUpdateCustomPropertiesValuesForReposError {
348    #[error("Forbidden")]
349    Status403(BasicError),
350    #[error("Resource not found")]
351    Status404(BasicError),
352    #[error("Validation failed, or the endpoint has been spammed.")]
353    Status422(ValidationError),
354    #[error("Status code: {}", code)]
355    Generic { code: u16 },
356}
357
358impl From<OrgsCreateOrUpdateCustomPropertiesValuesForReposError> for AdapterError {
359    fn from(err: OrgsCreateOrUpdateCustomPropertiesValuesForReposError) -> Self {
360        let (description, status_code) = match err {
361            OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status403(_) => (String::from("Forbidden"), 403),
362            OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status404(_) => (String::from("Resource not found"), 404),
363            OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
364            OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Generic { code } => (String::from("Generic"), code)
365        };
366
367        Self::Endpoint {
368            description,
369            status_code,
370            source: Some(Box::new(err))
371        }
372    }
373}
374
375/// Errors for the [Create or update a custom property for an organization](Orgs::create_or_update_custom_property_async()) endpoint.
376#[derive(Debug, thiserror::Error)]
377pub enum OrgsCreateOrUpdateCustomPropertyError {
378    #[error("Forbidden")]
379    Status403(BasicError),
380    #[error("Resource not found")]
381    Status404(BasicError),
382    #[error("Status code: {}", code)]
383    Generic { code: u16 },
384}
385
386impl From<OrgsCreateOrUpdateCustomPropertyError> for AdapterError {
387    fn from(err: OrgsCreateOrUpdateCustomPropertyError) -> Self {
388        let (description, status_code) = match err {
389            OrgsCreateOrUpdateCustomPropertyError::Status403(_) => (String::from("Forbidden"), 403),
390            OrgsCreateOrUpdateCustomPropertyError::Status404(_) => (String::from("Resource not found"), 404),
391            OrgsCreateOrUpdateCustomPropertyError::Generic { code } => (String::from("Generic"), code)
392        };
393
394        Self::Endpoint {
395            description,
396            status_code,
397            source: Some(Box::new(err))
398        }
399    }
400}
401
402/// Errors for the [Create an organization webhook](Orgs::create_webhook_async()) endpoint.
403#[derive(Debug, thiserror::Error)]
404pub enum OrgsCreateWebhookError {
405    #[error("Validation failed, or the endpoint has been spammed.")]
406    Status422(ValidationError),
407    #[error("Resource not found")]
408    Status404(BasicError),
409    #[error("Status code: {}", code)]
410    Generic { code: u16 },
411}
412
413impl From<OrgsCreateWebhookError> for AdapterError {
414    fn from(err: OrgsCreateWebhookError) -> Self {
415        let (description, status_code) = match err {
416            OrgsCreateWebhookError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
417            OrgsCreateWebhookError::Status404(_) => (String::from("Resource not found"), 404),
418            OrgsCreateWebhookError::Generic { code } => (String::from("Generic"), code)
419        };
420
421        Self::Endpoint {
422            description,
423            status_code,
424            source: Some(Box::new(err))
425        }
426    }
427}
428
429/// Errors for the [Delete an organization](Orgs::delete_async()) endpoint.
430#[derive(Debug, thiserror::Error)]
431pub enum OrgsDeleteError {
432    #[error("Resource not found")]
433    Status404(BasicError),
434    #[error("Forbidden")]
435    Status403(BasicError),
436    #[error("Status code: {}", code)]
437    Generic { code: u16 },
438}
439
440impl From<OrgsDeleteError> for AdapterError {
441    fn from(err: OrgsDeleteError) -> Self {
442        let (description, status_code) = match err {
443            OrgsDeleteError::Status404(_) => (String::from("Resource not found"), 404),
444            OrgsDeleteError::Status403(_) => (String::from("Forbidden"), 403),
445            OrgsDeleteError::Generic { code } => (String::from("Generic"), code)
446        };
447
448        Self::Endpoint {
449            description,
450            status_code,
451            source: Some(Box::new(err))
452        }
453    }
454}
455
456/// Errors for the [Delete issue type for an organization](Orgs::delete_issue_type_async()) endpoint.
457#[derive(Debug, thiserror::Error)]
458pub enum OrgsDeleteIssueTypeError {
459    #[error("Validation failed, or the endpoint has been spammed.")]
460    Status422(ValidationErrorSimple),
461    #[error("Resource not found")]
462    Status404(BasicError),
463    #[error("Status code: {}", code)]
464    Generic { code: u16 },
465}
466
467impl From<OrgsDeleteIssueTypeError> for AdapterError {
468    fn from(err: OrgsDeleteIssueTypeError) -> Self {
469        let (description, status_code) = match err {
470            OrgsDeleteIssueTypeError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
471            OrgsDeleteIssueTypeError::Status404(_) => (String::from("Resource not found"), 404),
472            OrgsDeleteIssueTypeError::Generic { code } => (String::from("Generic"), code)
473        };
474
475        Self::Endpoint {
476            description,
477            status_code,
478            source: Some(Box::new(err))
479        }
480    }
481}
482
483/// Errors for the [Delete an organization webhook](Orgs::delete_webhook_async()) endpoint.
484#[derive(Debug, thiserror::Error)]
485pub enum OrgsDeleteWebhookError {
486    #[error("Resource not found")]
487    Status404(BasicError),
488    #[error("Status code: {}", code)]
489    Generic { code: u16 },
490}
491
492impl From<OrgsDeleteWebhookError> for AdapterError {
493    fn from(err: OrgsDeleteWebhookError) -> Self {
494        let (description, status_code) = match err {
495            OrgsDeleteWebhookError::Status404(_) => (String::from("Resource not found"), 404),
496            OrgsDeleteWebhookError::Generic { code } => (String::from("Generic"), code)
497        };
498
499        Self::Endpoint {
500            description,
501            status_code,
502            source: Some(Box::new(err))
503        }
504    }
505}
506
507/// Errors for the [Enable or disable a security feature for an organization](Orgs::enable_or_disable_security_product_on_all_org_repos_async()) endpoint.
508#[derive(Debug, thiserror::Error)]
509pub enum OrgsEnableOrDisableSecurityProductOnAllOrgReposError {
510    #[error("The action could not be taken due to an in progress enablement, or a policy is preventing enablement")]
511    Status422,
512    #[error("Status code: {}", code)]
513    Generic { code: u16 },
514}
515
516impl From<OrgsEnableOrDisableSecurityProductOnAllOrgReposError> for AdapterError {
517    fn from(err: OrgsEnableOrDisableSecurityProductOnAllOrgReposError) -> Self {
518        let (description, status_code) = match err {
519            OrgsEnableOrDisableSecurityProductOnAllOrgReposError::Status422 => (String::from("The action could not be taken due to an in progress enablement, or a policy is preventing enablement"), 422),
520            OrgsEnableOrDisableSecurityProductOnAllOrgReposError::Generic { code } => (String::from("Generic"), code)
521        };
522
523        Self::Endpoint {
524            description,
525            status_code,
526            source: Some(Box::new(err))
527        }
528    }
529}
530
531/// Errors for the [Get an organization](Orgs::get_async()) endpoint.
532#[derive(Debug, thiserror::Error)]
533pub enum OrgsGetError {
534    #[error("Resource not found")]
535    Status404(BasicError),
536    #[error("Status code: {}", code)]
537    Generic { code: u16 },
538}
539
540impl From<OrgsGetError> for AdapterError {
541    fn from(err: OrgsGetError) -> Self {
542        let (description, status_code) = match err {
543            OrgsGetError::Status404(_) => (String::from("Resource not found"), 404),
544            OrgsGetError::Generic { code } => (String::from("Generic"), code)
545        };
546
547        Self::Endpoint {
548            description,
549            status_code,
550            source: Some(Box::new(err))
551        }
552    }
553}
554
555/// Errors for the [Get all custom properties for an organization](Orgs::get_all_custom_properties_async()) endpoint.
556#[derive(Debug, thiserror::Error)]
557pub enum OrgsGetAllCustomPropertiesError {
558    #[error("Forbidden")]
559    Status403(BasicError),
560    #[error("Resource not found")]
561    Status404(BasicError),
562    #[error("Status code: {}", code)]
563    Generic { code: u16 },
564}
565
566impl From<OrgsGetAllCustomPropertiesError> for AdapterError {
567    fn from(err: OrgsGetAllCustomPropertiesError) -> Self {
568        let (description, status_code) = match err {
569            OrgsGetAllCustomPropertiesError::Status403(_) => (String::from("Forbidden"), 403),
570            OrgsGetAllCustomPropertiesError::Status404(_) => (String::from("Resource not found"), 404),
571            OrgsGetAllCustomPropertiesError::Generic { code } => (String::from("Generic"), code)
572        };
573
574        Self::Endpoint {
575            description,
576            status_code,
577            source: Some(Box::new(err))
578        }
579    }
580}
581
582/// Errors for the [Get a custom property for an organization](Orgs::get_custom_property_async()) endpoint.
583#[derive(Debug, thiserror::Error)]
584pub enum OrgsGetCustomPropertyError {
585    #[error("Forbidden")]
586    Status403(BasicError),
587    #[error("Resource not found")]
588    Status404(BasicError),
589    #[error("Status code: {}", code)]
590    Generic { code: u16 },
591}
592
593impl From<OrgsGetCustomPropertyError> for AdapterError {
594    fn from(err: OrgsGetCustomPropertyError) -> Self {
595        let (description, status_code) = match err {
596            OrgsGetCustomPropertyError::Status403(_) => (String::from("Forbidden"), 403),
597            OrgsGetCustomPropertyError::Status404(_) => (String::from("Resource not found"), 404),
598            OrgsGetCustomPropertyError::Generic { code } => (String::from("Generic"), code)
599        };
600
601        Self::Endpoint {
602            description,
603            status_code,
604            source: Some(Box::new(err))
605        }
606    }
607}
608
609/// Errors for the [Get an organization membership for the authenticated user](Orgs::get_membership_for_authenticated_user_async()) endpoint.
610#[derive(Debug, thiserror::Error)]
611pub enum OrgsGetMembershipForAuthenticatedUserError {
612    #[error("Forbidden")]
613    Status403(BasicError),
614    #[error("Resource not found")]
615    Status404(BasicError),
616    #[error("Status code: {}", code)]
617    Generic { code: u16 },
618}
619
620impl From<OrgsGetMembershipForAuthenticatedUserError> for AdapterError {
621    fn from(err: OrgsGetMembershipForAuthenticatedUserError) -> Self {
622        let (description, status_code) = match err {
623            OrgsGetMembershipForAuthenticatedUserError::Status403(_) => (String::from("Forbidden"), 403),
624            OrgsGetMembershipForAuthenticatedUserError::Status404(_) => (String::from("Resource not found"), 404),
625            OrgsGetMembershipForAuthenticatedUserError::Generic { code } => (String::from("Generic"), code)
626        };
627
628        Self::Endpoint {
629            description,
630            status_code,
631            source: Some(Box::new(err))
632        }
633    }
634}
635
636/// Errors for the [Get organization membership for a user](Orgs::get_membership_for_user_async()) endpoint.
637#[derive(Debug, thiserror::Error)]
638pub enum OrgsGetMembershipForUserError {
639    #[error("Resource not found")]
640    Status404(BasicError),
641    #[error("Forbidden")]
642    Status403(BasicError),
643    #[error("Status code: {}", code)]
644    Generic { code: u16 },
645}
646
647impl From<OrgsGetMembershipForUserError> for AdapterError {
648    fn from(err: OrgsGetMembershipForUserError) -> Self {
649        let (description, status_code) = match err {
650            OrgsGetMembershipForUserError::Status404(_) => (String::from("Resource not found"), 404),
651            OrgsGetMembershipForUserError::Status403(_) => (String::from("Forbidden"), 403),
652            OrgsGetMembershipForUserError::Generic { code } => (String::from("Generic"), code)
653        };
654
655        Self::Endpoint {
656            description,
657            status_code,
658            source: Some(Box::new(err))
659        }
660    }
661}
662
663/// Errors for the [Get an organization role](Orgs::get_org_role_async()) endpoint.
664#[derive(Debug, thiserror::Error)]
665pub enum OrgsGetOrgRoleError {
666    #[error("Resource not found")]
667    Status404(BasicError),
668    #[error("Validation failed, or the endpoint has been spammed.")]
669    Status422(ValidationError),
670    #[error("Status code: {}", code)]
671    Generic { code: u16 },
672}
673
674impl From<OrgsGetOrgRoleError> for AdapterError {
675    fn from(err: OrgsGetOrgRoleError) -> Self {
676        let (description, status_code) = match err {
677            OrgsGetOrgRoleError::Status404(_) => (String::from("Resource not found"), 404),
678            OrgsGetOrgRoleError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
679            OrgsGetOrgRoleError::Generic { code } => (String::from("Generic"), code)
680        };
681
682        Self::Endpoint {
683            description,
684            status_code,
685            source: Some(Box::new(err))
686        }
687    }
688}
689
690/// Errors for the [Get organization ruleset history](Orgs::get_org_ruleset_history_async()) endpoint.
691#[derive(Debug, thiserror::Error)]
692pub enum OrgsGetOrgRulesetHistoryError {
693    #[error("Resource not found")]
694    Status404(BasicError),
695    #[error("Internal Error")]
696    Status500(BasicError),
697    #[error("Status code: {}", code)]
698    Generic { code: u16 },
699}
700
701impl From<OrgsGetOrgRulesetHistoryError> for AdapterError {
702    fn from(err: OrgsGetOrgRulesetHistoryError) -> Self {
703        let (description, status_code) = match err {
704            OrgsGetOrgRulesetHistoryError::Status404(_) => (String::from("Resource not found"), 404),
705            OrgsGetOrgRulesetHistoryError::Status500(_) => (String::from("Internal Error"), 500),
706            OrgsGetOrgRulesetHistoryError::Generic { code } => (String::from("Generic"), code)
707        };
708
709        Self::Endpoint {
710            description,
711            status_code,
712            source: Some(Box::new(err))
713        }
714    }
715}
716
717/// Errors for the [Get organization ruleset version](Orgs::get_org_ruleset_version_async()) endpoint.
718#[derive(Debug, thiserror::Error)]
719pub enum OrgsGetOrgRulesetVersionError {
720    #[error("Resource not found")]
721    Status404(BasicError),
722    #[error("Internal Error")]
723    Status500(BasicError),
724    #[error("Status code: {}", code)]
725    Generic { code: u16 },
726}
727
728impl From<OrgsGetOrgRulesetVersionError> for AdapterError {
729    fn from(err: OrgsGetOrgRulesetVersionError) -> Self {
730        let (description, status_code) = match err {
731            OrgsGetOrgRulesetVersionError::Status404(_) => (String::from("Resource not found"), 404),
732            OrgsGetOrgRulesetVersionError::Status500(_) => (String::from("Internal Error"), 500),
733            OrgsGetOrgRulesetVersionError::Generic { code } => (String::from("Generic"), code)
734        };
735
736        Self::Endpoint {
737            description,
738            status_code,
739            source: Some(Box::new(err))
740        }
741    }
742}
743
744/// Errors for the [Get route stats by actor](Orgs::get_route_stats_by_actor_async()) endpoint.
745#[derive(Debug, thiserror::Error)]
746pub enum OrgsGetRouteStatsByActorError {
747    #[error("Status code: {}", code)]
748    Generic { code: u16 },
749}
750
751impl From<OrgsGetRouteStatsByActorError> for AdapterError {
752    fn from(err: OrgsGetRouteStatsByActorError) -> Self {
753        let (description, status_code) = match err {
754            OrgsGetRouteStatsByActorError::Generic { code } => (String::from("Generic"), code)
755        };
756
757        Self::Endpoint {
758            description,
759            status_code,
760            source: Some(Box::new(err))
761        }
762    }
763}
764
765/// Errors for the [Get subject stats](Orgs::get_subject_stats_async()) endpoint.
766#[derive(Debug, thiserror::Error)]
767pub enum OrgsGetSubjectStatsError {
768    #[error("Status code: {}", code)]
769    Generic { code: u16 },
770}
771
772impl From<OrgsGetSubjectStatsError> for AdapterError {
773    fn from(err: OrgsGetSubjectStatsError) -> Self {
774        let (description, status_code) = match err {
775            OrgsGetSubjectStatsError::Generic { code } => (String::from("Generic"), code)
776        };
777
778        Self::Endpoint {
779            description,
780            status_code,
781            source: Some(Box::new(err))
782        }
783    }
784}
785
786/// Errors for the [Get summary stats](Orgs::get_summary_stats_async()) endpoint.
787#[derive(Debug, thiserror::Error)]
788pub enum OrgsGetSummaryStatsError {
789    #[error("Status code: {}", code)]
790    Generic { code: u16 },
791}
792
793impl From<OrgsGetSummaryStatsError> for AdapterError {
794    fn from(err: OrgsGetSummaryStatsError) -> Self {
795        let (description, status_code) = match err {
796            OrgsGetSummaryStatsError::Generic { code } => (String::from("Generic"), code)
797        };
798
799        Self::Endpoint {
800            description,
801            status_code,
802            source: Some(Box::new(err))
803        }
804    }
805}
806
807/// Errors for the [Get summary stats by actor](Orgs::get_summary_stats_by_actor_async()) endpoint.
808#[derive(Debug, thiserror::Error)]
809pub enum OrgsGetSummaryStatsByActorError {
810    #[error("Status code: {}", code)]
811    Generic { code: u16 },
812}
813
814impl From<OrgsGetSummaryStatsByActorError> for AdapterError {
815    fn from(err: OrgsGetSummaryStatsByActorError) -> Self {
816        let (description, status_code) = match err {
817            OrgsGetSummaryStatsByActorError::Generic { code } => (String::from("Generic"), code)
818        };
819
820        Self::Endpoint {
821            description,
822            status_code,
823            source: Some(Box::new(err))
824        }
825    }
826}
827
828/// Errors for the [Get summary stats by user](Orgs::get_summary_stats_by_user_async()) endpoint.
829#[derive(Debug, thiserror::Error)]
830pub enum OrgsGetSummaryStatsByUserError {
831    #[error("Status code: {}", code)]
832    Generic { code: u16 },
833}
834
835impl From<OrgsGetSummaryStatsByUserError> for AdapterError {
836    fn from(err: OrgsGetSummaryStatsByUserError) -> Self {
837        let (description, status_code) = match err {
838            OrgsGetSummaryStatsByUserError::Generic { code } => (String::from("Generic"), code)
839        };
840
841        Self::Endpoint {
842            description,
843            status_code,
844            source: Some(Box::new(err))
845        }
846    }
847}
848
849/// Errors for the [Get time stats](Orgs::get_time_stats_async()) endpoint.
850#[derive(Debug, thiserror::Error)]
851pub enum OrgsGetTimeStatsError {
852    #[error("Status code: {}", code)]
853    Generic { code: u16 },
854}
855
856impl From<OrgsGetTimeStatsError> for AdapterError {
857    fn from(err: OrgsGetTimeStatsError) -> Self {
858        let (description, status_code) = match err {
859            OrgsGetTimeStatsError::Generic { code } => (String::from("Generic"), code)
860        };
861
862        Self::Endpoint {
863            description,
864            status_code,
865            source: Some(Box::new(err))
866        }
867    }
868}
869
870/// Errors for the [Get time stats by actor](Orgs::get_time_stats_by_actor_async()) endpoint.
871#[derive(Debug, thiserror::Error)]
872pub enum OrgsGetTimeStatsByActorError {
873    #[error("Status code: {}", code)]
874    Generic { code: u16 },
875}
876
877impl From<OrgsGetTimeStatsByActorError> for AdapterError {
878    fn from(err: OrgsGetTimeStatsByActorError) -> Self {
879        let (description, status_code) = match err {
880            OrgsGetTimeStatsByActorError::Generic { code } => (String::from("Generic"), code)
881        };
882
883        Self::Endpoint {
884            description,
885            status_code,
886            source: Some(Box::new(err))
887        }
888    }
889}
890
891/// Errors for the [Get time stats by user](Orgs::get_time_stats_by_user_async()) endpoint.
892#[derive(Debug, thiserror::Error)]
893pub enum OrgsGetTimeStatsByUserError {
894    #[error("Status code: {}", code)]
895    Generic { code: u16 },
896}
897
898impl From<OrgsGetTimeStatsByUserError> for AdapterError {
899    fn from(err: OrgsGetTimeStatsByUserError) -> Self {
900        let (description, status_code) = match err {
901            OrgsGetTimeStatsByUserError::Generic { code } => (String::from("Generic"), code)
902        };
903
904        Self::Endpoint {
905            description,
906            status_code,
907            source: Some(Box::new(err))
908        }
909    }
910}
911
912/// Errors for the [Get user stats](Orgs::get_user_stats_async()) endpoint.
913#[derive(Debug, thiserror::Error)]
914pub enum OrgsGetUserStatsError {
915    #[error("Status code: {}", code)]
916    Generic { code: u16 },
917}
918
919impl From<OrgsGetUserStatsError> for AdapterError {
920    fn from(err: OrgsGetUserStatsError) -> Self {
921        let (description, status_code) = match err {
922            OrgsGetUserStatsError::Generic { code } => (String::from("Generic"), code)
923        };
924
925        Self::Endpoint {
926            description,
927            status_code,
928            source: Some(Box::new(err))
929        }
930    }
931}
932
933/// Errors for the [Get an organization webhook](Orgs::get_webhook_async()) endpoint.
934#[derive(Debug, thiserror::Error)]
935pub enum OrgsGetWebhookError {
936    #[error("Resource not found")]
937    Status404(BasicError),
938    #[error("Status code: {}", code)]
939    Generic { code: u16 },
940}
941
942impl From<OrgsGetWebhookError> for AdapterError {
943    fn from(err: OrgsGetWebhookError) -> Self {
944        let (description, status_code) = match err {
945            OrgsGetWebhookError::Status404(_) => (String::from("Resource not found"), 404),
946            OrgsGetWebhookError::Generic { code } => (String::from("Generic"), code)
947        };
948
949        Self::Endpoint {
950            description,
951            status_code,
952            source: Some(Box::new(err))
953        }
954    }
955}
956
957/// Errors for the [Get a webhook configuration for an organization](Orgs::get_webhook_config_for_org_async()) endpoint.
958#[derive(Debug, thiserror::Error)]
959pub enum OrgsGetWebhookConfigForOrgError {
960    #[error("Status code: {}", code)]
961    Generic { code: u16 },
962}
963
964impl From<OrgsGetWebhookConfigForOrgError> for AdapterError {
965    fn from(err: OrgsGetWebhookConfigForOrgError) -> Self {
966        let (description, status_code) = match err {
967            OrgsGetWebhookConfigForOrgError::Generic { code } => (String::from("Generic"), code)
968        };
969
970        Self::Endpoint {
971            description,
972            status_code,
973            source: Some(Box::new(err))
974        }
975    }
976}
977
978/// Errors for the [Get a webhook delivery for an organization webhook](Orgs::get_webhook_delivery_async()) endpoint.
979#[derive(Debug, thiserror::Error)]
980pub enum OrgsGetWebhookDeliveryError {
981    #[error("Bad Request")]
982    Status400(BasicError),
983    #[error("Validation failed, or the endpoint has been spammed.")]
984    Status422(ValidationError),
985    #[error("Status code: {}", code)]
986    Generic { code: u16 },
987}
988
989impl From<OrgsGetWebhookDeliveryError> for AdapterError {
990    fn from(err: OrgsGetWebhookDeliveryError) -> Self {
991        let (description, status_code) = match err {
992            OrgsGetWebhookDeliveryError::Status400(_) => (String::from("Bad Request"), 400),
993            OrgsGetWebhookDeliveryError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
994            OrgsGetWebhookDeliveryError::Generic { code } => (String::from("Generic"), code)
995        };
996
997        Self::Endpoint {
998            description,
999            status_code,
1000            source: Some(Box::new(err))
1001        }
1002    }
1003}
1004
1005/// Errors for the [List organizations](Orgs::list_async()) endpoint.
1006#[derive(Debug, thiserror::Error)]
1007pub enum OrgsListError {
1008    #[error("Not modified")]
1009    Status304,
1010    #[error("Status code: {}", code)]
1011    Generic { code: u16 },
1012}
1013
1014impl From<OrgsListError> for AdapterError {
1015    fn from(err: OrgsListError) -> Self {
1016        let (description, status_code) = match err {
1017            OrgsListError::Status304 => (String::from("Not modified"), 304),
1018            OrgsListError::Generic { code } => (String::from("Generic"), code)
1019        };
1020
1021        Self::Endpoint {
1022            description,
1023            status_code,
1024            source: Some(Box::new(err))
1025        }
1026    }
1027}
1028
1029/// Errors for the [List app installations for an organization](Orgs::list_app_installations_async()) endpoint.
1030#[derive(Debug, thiserror::Error)]
1031pub enum OrgsListAppInstallationsError {
1032    #[error("Status code: {}", code)]
1033    Generic { code: u16 },
1034}
1035
1036impl From<OrgsListAppInstallationsError> for AdapterError {
1037    fn from(err: OrgsListAppInstallationsError) -> Self {
1038        let (description, status_code) = match err {
1039            OrgsListAppInstallationsError::Generic { code } => (String::from("Generic"), code)
1040        };
1041
1042        Self::Endpoint {
1043            description,
1044            status_code,
1045            source: Some(Box::new(err))
1046        }
1047    }
1048}
1049
1050/// Errors for the [List attestations](Orgs::list_attestations_async()) endpoint.
1051#[derive(Debug, thiserror::Error)]
1052pub enum OrgsListAttestationsError {
1053    #[error("Status code: {}", code)]
1054    Generic { code: u16 },
1055}
1056
1057impl From<OrgsListAttestationsError> for AdapterError {
1058    fn from(err: OrgsListAttestationsError) -> Self {
1059        let (description, status_code) = match err {
1060            OrgsListAttestationsError::Generic { code } => (String::from("Generic"), code)
1061        };
1062
1063        Self::Endpoint {
1064            description,
1065            status_code,
1066            source: Some(Box::new(err))
1067        }
1068    }
1069}
1070
1071/// Errors for the [List attestations by bulk subject digests](Orgs::list_attestations_bulk_async()) endpoint.
1072#[derive(Debug, thiserror::Error)]
1073pub enum OrgsListAttestationsBulkError {
1074    #[error("Status code: {}", code)]
1075    Generic { code: u16 },
1076}
1077
1078impl From<OrgsListAttestationsBulkError> for AdapterError {
1079    fn from(err: OrgsListAttestationsBulkError) -> Self {
1080        let (description, status_code) = match err {
1081            OrgsListAttestationsBulkError::Generic { code } => (String::from("Generic"), code)
1082        };
1083
1084        Self::Endpoint {
1085            description,
1086            status_code,
1087            source: Some(Box::new(err))
1088        }
1089    }
1090}
1091
1092/// Errors for the [List users blocked by an organization](Orgs::list_blocked_users_async()) endpoint.
1093#[derive(Debug, thiserror::Error)]
1094pub enum OrgsListBlockedUsersError {
1095    #[error("Status code: {}", code)]
1096    Generic { code: u16 },
1097}
1098
1099impl From<OrgsListBlockedUsersError> for AdapterError {
1100    fn from(err: OrgsListBlockedUsersError) -> Self {
1101        let (description, status_code) = match err {
1102            OrgsListBlockedUsersError::Generic { code } => (String::from("Generic"), code)
1103        };
1104
1105        Self::Endpoint {
1106            description,
1107            status_code,
1108            source: Some(Box::new(err))
1109        }
1110    }
1111}
1112
1113/// Errors for the [List custom property values for organization repositories](Orgs::list_custom_properties_values_for_repos_async()) endpoint.
1114#[derive(Debug, thiserror::Error)]
1115pub enum OrgsListCustomPropertiesValuesForReposError {
1116    #[error("Forbidden")]
1117    Status403(BasicError),
1118    #[error("Resource not found")]
1119    Status404(BasicError),
1120    #[error("Status code: {}", code)]
1121    Generic { code: u16 },
1122}
1123
1124impl From<OrgsListCustomPropertiesValuesForReposError> for AdapterError {
1125    fn from(err: OrgsListCustomPropertiesValuesForReposError) -> Self {
1126        let (description, status_code) = match err {
1127            OrgsListCustomPropertiesValuesForReposError::Status403(_) => (String::from("Forbidden"), 403),
1128            OrgsListCustomPropertiesValuesForReposError::Status404(_) => (String::from("Resource not found"), 404),
1129            OrgsListCustomPropertiesValuesForReposError::Generic { code } => (String::from("Generic"), code)
1130        };
1131
1132        Self::Endpoint {
1133            description,
1134            status_code,
1135            source: Some(Box::new(err))
1136        }
1137    }
1138}
1139
1140/// Errors for the [List failed organization invitations](Orgs::list_failed_invitations_async()) endpoint.
1141#[derive(Debug, thiserror::Error)]
1142pub enum OrgsListFailedInvitationsError {
1143    #[error("Resource not found")]
1144    Status404(BasicError),
1145    #[error("Status code: {}", code)]
1146    Generic { code: u16 },
1147}
1148
1149impl From<OrgsListFailedInvitationsError> for AdapterError {
1150    fn from(err: OrgsListFailedInvitationsError) -> Self {
1151        let (description, status_code) = match err {
1152            OrgsListFailedInvitationsError::Status404(_) => (String::from("Resource not found"), 404),
1153            OrgsListFailedInvitationsError::Generic { code } => (String::from("Generic"), code)
1154        };
1155
1156        Self::Endpoint {
1157            description,
1158            status_code,
1159            source: Some(Box::new(err))
1160        }
1161    }
1162}
1163
1164/// Errors for the [List organizations for the authenticated user](Orgs::list_for_authenticated_user_async()) endpoint.
1165#[derive(Debug, thiserror::Error)]
1166pub enum OrgsListForAuthenticatedUserError {
1167    #[error("Not modified")]
1168    Status304,
1169    #[error("Forbidden")]
1170    Status403(BasicError),
1171    #[error("Requires authentication")]
1172    Status401(BasicError),
1173    #[error("Status code: {}", code)]
1174    Generic { code: u16 },
1175}
1176
1177impl From<OrgsListForAuthenticatedUserError> for AdapterError {
1178    fn from(err: OrgsListForAuthenticatedUserError) -> Self {
1179        let (description, status_code) = match err {
1180            OrgsListForAuthenticatedUserError::Status304 => (String::from("Not modified"), 304),
1181            OrgsListForAuthenticatedUserError::Status403(_) => (String::from("Forbidden"), 403),
1182            OrgsListForAuthenticatedUserError::Status401(_) => (String::from("Requires authentication"), 401),
1183            OrgsListForAuthenticatedUserError::Generic { code } => (String::from("Generic"), code)
1184        };
1185
1186        Self::Endpoint {
1187            description,
1188            status_code,
1189            source: Some(Box::new(err))
1190        }
1191    }
1192}
1193
1194/// Errors for the [List organizations for a user](Orgs::list_for_user_async()) endpoint.
1195#[derive(Debug, thiserror::Error)]
1196pub enum OrgsListForUserError {
1197    #[error("Status code: {}", code)]
1198    Generic { code: u16 },
1199}
1200
1201impl From<OrgsListForUserError> for AdapterError {
1202    fn from(err: OrgsListForUserError) -> Self {
1203        let (description, status_code) = match err {
1204            OrgsListForUserError::Generic { code } => (String::from("Generic"), code)
1205        };
1206
1207        Self::Endpoint {
1208            description,
1209            status_code,
1210            source: Some(Box::new(err))
1211        }
1212    }
1213}
1214
1215/// Errors for the [List organization invitation teams](Orgs::list_invitation_teams_async()) endpoint.
1216#[derive(Debug, thiserror::Error)]
1217pub enum OrgsListInvitationTeamsError {
1218    #[error("Resource not found")]
1219    Status404(BasicError),
1220    #[error("Status code: {}", code)]
1221    Generic { code: u16 },
1222}
1223
1224impl From<OrgsListInvitationTeamsError> for AdapterError {
1225    fn from(err: OrgsListInvitationTeamsError) -> Self {
1226        let (description, status_code) = match err {
1227            OrgsListInvitationTeamsError::Status404(_) => (String::from("Resource not found"), 404),
1228            OrgsListInvitationTeamsError::Generic { code } => (String::from("Generic"), code)
1229        };
1230
1231        Self::Endpoint {
1232            description,
1233            status_code,
1234            source: Some(Box::new(err))
1235        }
1236    }
1237}
1238
1239/// Errors for the [List issue types for an organization](Orgs::list_issue_types_async()) endpoint.
1240#[derive(Debug, thiserror::Error)]
1241pub enum OrgsListIssueTypesError {
1242    #[error("Resource not found")]
1243    Status404(BasicError),
1244    #[error("Status code: {}", code)]
1245    Generic { code: u16 },
1246}
1247
1248impl From<OrgsListIssueTypesError> for AdapterError {
1249    fn from(err: OrgsListIssueTypesError) -> Self {
1250        let (description, status_code) = match err {
1251            OrgsListIssueTypesError::Status404(_) => (String::from("Resource not found"), 404),
1252            OrgsListIssueTypesError::Generic { code } => (String::from("Generic"), code)
1253        };
1254
1255        Self::Endpoint {
1256            description,
1257            status_code,
1258            source: Some(Box::new(err))
1259        }
1260    }
1261}
1262
1263/// Errors for the [List organization members](Orgs::list_members_async()) endpoint.
1264#[derive(Debug, thiserror::Error)]
1265pub enum OrgsListMembersError {
1266    #[error("Validation failed, or the endpoint has been spammed.")]
1267    Status422(ValidationError),
1268    #[error("Status code: {}", code)]
1269    Generic { code: u16 },
1270}
1271
1272impl From<OrgsListMembersError> for AdapterError {
1273    fn from(err: OrgsListMembersError) -> Self {
1274        let (description, status_code) = match err {
1275            OrgsListMembersError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
1276            OrgsListMembersError::Generic { code } => (String::from("Generic"), code)
1277        };
1278
1279        Self::Endpoint {
1280            description,
1281            status_code,
1282            source: Some(Box::new(err))
1283        }
1284    }
1285}
1286
1287/// Errors for the [List organization memberships for the authenticated user](Orgs::list_memberships_for_authenticated_user_async()) endpoint.
1288#[derive(Debug, thiserror::Error)]
1289pub enum OrgsListMembershipsForAuthenticatedUserError {
1290    #[error("Not modified")]
1291    Status304,
1292    #[error("Forbidden")]
1293    Status403(BasicError),
1294    #[error("Requires authentication")]
1295    Status401(BasicError),
1296    #[error("Validation failed, or the endpoint has been spammed.")]
1297    Status422(ValidationError),
1298    #[error("Status code: {}", code)]
1299    Generic { code: u16 },
1300}
1301
1302impl From<OrgsListMembershipsForAuthenticatedUserError> for AdapterError {
1303    fn from(err: OrgsListMembershipsForAuthenticatedUserError) -> Self {
1304        let (description, status_code) = match err {
1305            OrgsListMembershipsForAuthenticatedUserError::Status304 => (String::from("Not modified"), 304),
1306            OrgsListMembershipsForAuthenticatedUserError::Status403(_) => (String::from("Forbidden"), 403),
1307            OrgsListMembershipsForAuthenticatedUserError::Status401(_) => (String::from("Requires authentication"), 401),
1308            OrgsListMembershipsForAuthenticatedUserError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
1309            OrgsListMembershipsForAuthenticatedUserError::Generic { code } => (String::from("Generic"), code)
1310        };
1311
1312        Self::Endpoint {
1313            description,
1314            status_code,
1315            source: Some(Box::new(err))
1316        }
1317    }
1318}
1319
1320/// Errors for the [List teams that are assigned to an organization role](Orgs::list_org_role_teams_async()) endpoint.
1321#[derive(Debug, thiserror::Error)]
1322pub enum OrgsListOrgRoleTeamsError {
1323    #[error("Response if the organization or role does not exist.")]
1324    Status404,
1325    #[error("Response if the organization roles feature is not enabled or validation failed.")]
1326    Status422,
1327    #[error("Status code: {}", code)]
1328    Generic { code: u16 },
1329}
1330
1331impl From<OrgsListOrgRoleTeamsError> for AdapterError {
1332    fn from(err: OrgsListOrgRoleTeamsError) -> Self {
1333        let (description, status_code) = match err {
1334            OrgsListOrgRoleTeamsError::Status404 => (String::from("Response if the organization or role does not exist."), 404),
1335            OrgsListOrgRoleTeamsError::Status422 => (String::from("Response if the organization roles feature is not enabled or validation failed."), 422),
1336            OrgsListOrgRoleTeamsError::Generic { code } => (String::from("Generic"), code)
1337        };
1338
1339        Self::Endpoint {
1340            description,
1341            status_code,
1342            source: Some(Box::new(err))
1343        }
1344    }
1345}
1346
1347/// Errors for the [List users that are assigned to an organization role](Orgs::list_org_role_users_async()) endpoint.
1348#[derive(Debug, thiserror::Error)]
1349pub enum OrgsListOrgRoleUsersError {
1350    #[error("Response if the organization or role does not exist.")]
1351    Status404,
1352    #[error("Response if the organization roles feature is not enabled or validation failed.")]
1353    Status422,
1354    #[error("Status code: {}", code)]
1355    Generic { code: u16 },
1356}
1357
1358impl From<OrgsListOrgRoleUsersError> for AdapterError {
1359    fn from(err: OrgsListOrgRoleUsersError) -> Self {
1360        let (description, status_code) = match err {
1361            OrgsListOrgRoleUsersError::Status404 => (String::from("Response if the organization or role does not exist."), 404),
1362            OrgsListOrgRoleUsersError::Status422 => (String::from("Response if the organization roles feature is not enabled or validation failed."), 422),
1363            OrgsListOrgRoleUsersError::Generic { code } => (String::from("Generic"), code)
1364        };
1365
1366        Self::Endpoint {
1367            description,
1368            status_code,
1369            source: Some(Box::new(err))
1370        }
1371    }
1372}
1373
1374/// Errors for the [Get all organization roles for an organization](Orgs::list_org_roles_async()) endpoint.
1375#[derive(Debug, thiserror::Error)]
1376pub enum OrgsListOrgRolesError {
1377    #[error("Resource not found")]
1378    Status404(BasicError),
1379    #[error("Validation failed, or the endpoint has been spammed.")]
1380    Status422(ValidationError),
1381    #[error("Status code: {}", code)]
1382    Generic { code: u16 },
1383}
1384
1385impl From<OrgsListOrgRolesError> for AdapterError {
1386    fn from(err: OrgsListOrgRolesError) -> Self {
1387        let (description, status_code) = match err {
1388            OrgsListOrgRolesError::Status404(_) => (String::from("Resource not found"), 404),
1389            OrgsListOrgRolesError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
1390            OrgsListOrgRolesError::Generic { code } => (String::from("Generic"), code)
1391        };
1392
1393        Self::Endpoint {
1394            description,
1395            status_code,
1396            source: Some(Box::new(err))
1397        }
1398    }
1399}
1400
1401/// Errors for the [List outside collaborators for an organization](Orgs::list_outside_collaborators_async()) endpoint.
1402#[derive(Debug, thiserror::Error)]
1403pub enum OrgsListOutsideCollaboratorsError {
1404    #[error("Status code: {}", code)]
1405    Generic { code: u16 },
1406}
1407
1408impl From<OrgsListOutsideCollaboratorsError> for AdapterError {
1409    fn from(err: OrgsListOutsideCollaboratorsError) -> Self {
1410        let (description, status_code) = match err {
1411            OrgsListOutsideCollaboratorsError::Generic { code } => (String::from("Generic"), code)
1412        };
1413
1414        Self::Endpoint {
1415            description,
1416            status_code,
1417            source: Some(Box::new(err))
1418        }
1419    }
1420}
1421
1422/// Errors for the [List repositories a fine-grained personal access token has access to](Orgs::list_pat_grant_repositories_async()) endpoint.
1423#[derive(Debug, thiserror::Error)]
1424pub enum OrgsListPatGrantRepositoriesError {
1425    #[error("Internal Error")]
1426    Status500(BasicError),
1427    #[error("Resource not found")]
1428    Status404(BasicError),
1429    #[error("Forbidden")]
1430    Status403(BasicError),
1431    #[error("Status code: {}", code)]
1432    Generic { code: u16 },
1433}
1434
1435impl From<OrgsListPatGrantRepositoriesError> for AdapterError {
1436    fn from(err: OrgsListPatGrantRepositoriesError) -> Self {
1437        let (description, status_code) = match err {
1438            OrgsListPatGrantRepositoriesError::Status500(_) => (String::from("Internal Error"), 500),
1439            OrgsListPatGrantRepositoriesError::Status404(_) => (String::from("Resource not found"), 404),
1440            OrgsListPatGrantRepositoriesError::Status403(_) => (String::from("Forbidden"), 403),
1441            OrgsListPatGrantRepositoriesError::Generic { code } => (String::from("Generic"), code)
1442        };
1443
1444        Self::Endpoint {
1445            description,
1446            status_code,
1447            source: Some(Box::new(err))
1448        }
1449    }
1450}
1451
1452/// Errors for the [List repositories requested to be accessed by a fine-grained personal access token](Orgs::list_pat_grant_request_repositories_async()) endpoint.
1453#[derive(Debug, thiserror::Error)]
1454pub enum OrgsListPatGrantRequestRepositoriesError {
1455    #[error("Internal Error")]
1456    Status500(BasicError),
1457    #[error("Resource not found")]
1458    Status404(BasicError),
1459    #[error("Forbidden")]
1460    Status403(BasicError),
1461    #[error("Status code: {}", code)]
1462    Generic { code: u16 },
1463}
1464
1465impl From<OrgsListPatGrantRequestRepositoriesError> for AdapterError {
1466    fn from(err: OrgsListPatGrantRequestRepositoriesError) -> Self {
1467        let (description, status_code) = match err {
1468            OrgsListPatGrantRequestRepositoriesError::Status500(_) => (String::from("Internal Error"), 500),
1469            OrgsListPatGrantRequestRepositoriesError::Status404(_) => (String::from("Resource not found"), 404),
1470            OrgsListPatGrantRequestRepositoriesError::Status403(_) => (String::from("Forbidden"), 403),
1471            OrgsListPatGrantRequestRepositoriesError::Generic { code } => (String::from("Generic"), code)
1472        };
1473
1474        Self::Endpoint {
1475            description,
1476            status_code,
1477            source: Some(Box::new(err))
1478        }
1479    }
1480}
1481
1482/// Errors for the [List requests to access organization resources with fine-grained personal access tokens](Orgs::list_pat_grant_requests_async()) endpoint.
1483#[derive(Debug, thiserror::Error)]
1484pub enum OrgsListPatGrantRequestsError {
1485    #[error("Internal Error")]
1486    Status500(BasicError),
1487    #[error("Validation failed, or the endpoint has been spammed.")]
1488    Status422(ValidationError),
1489    #[error("Resource not found")]
1490    Status404(BasicError),
1491    #[error("Forbidden")]
1492    Status403(BasicError),
1493    #[error("Status code: {}", code)]
1494    Generic { code: u16 },
1495}
1496
1497impl From<OrgsListPatGrantRequestsError> for AdapterError {
1498    fn from(err: OrgsListPatGrantRequestsError) -> Self {
1499        let (description, status_code) = match err {
1500            OrgsListPatGrantRequestsError::Status500(_) => (String::from("Internal Error"), 500),
1501            OrgsListPatGrantRequestsError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
1502            OrgsListPatGrantRequestsError::Status404(_) => (String::from("Resource not found"), 404),
1503            OrgsListPatGrantRequestsError::Status403(_) => (String::from("Forbidden"), 403),
1504            OrgsListPatGrantRequestsError::Generic { code } => (String::from("Generic"), code)
1505        };
1506
1507        Self::Endpoint {
1508            description,
1509            status_code,
1510            source: Some(Box::new(err))
1511        }
1512    }
1513}
1514
1515/// Errors for the [List fine-grained personal access tokens with access to organization resources](Orgs::list_pat_grants_async()) endpoint.
1516#[derive(Debug, thiserror::Error)]
1517pub enum OrgsListPatGrantsError {
1518    #[error("Internal Error")]
1519    Status500(BasicError),
1520    #[error("Validation failed, or the endpoint has been spammed.")]
1521    Status422(ValidationError),
1522    #[error("Resource not found")]
1523    Status404(BasicError),
1524    #[error("Forbidden")]
1525    Status403(BasicError),
1526    #[error("Status code: {}", code)]
1527    Generic { code: u16 },
1528}
1529
1530impl From<OrgsListPatGrantsError> for AdapterError {
1531    fn from(err: OrgsListPatGrantsError) -> Self {
1532        let (description, status_code) = match err {
1533            OrgsListPatGrantsError::Status500(_) => (String::from("Internal Error"), 500),
1534            OrgsListPatGrantsError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
1535            OrgsListPatGrantsError::Status404(_) => (String::from("Resource not found"), 404),
1536            OrgsListPatGrantsError::Status403(_) => (String::from("Forbidden"), 403),
1537            OrgsListPatGrantsError::Generic { code } => (String::from("Generic"), code)
1538        };
1539
1540        Self::Endpoint {
1541            description,
1542            status_code,
1543            source: Some(Box::new(err))
1544        }
1545    }
1546}
1547
1548/// Errors for the [List pending organization invitations](Orgs::list_pending_invitations_async()) endpoint.
1549#[derive(Debug, thiserror::Error)]
1550pub enum OrgsListPendingInvitationsError {
1551    #[error("Resource not found")]
1552    Status404(BasicError),
1553    #[error("Status code: {}", code)]
1554    Generic { code: u16 },
1555}
1556
1557impl From<OrgsListPendingInvitationsError> for AdapterError {
1558    fn from(err: OrgsListPendingInvitationsError) -> Self {
1559        let (description, status_code) = match err {
1560            OrgsListPendingInvitationsError::Status404(_) => (String::from("Resource not found"), 404),
1561            OrgsListPendingInvitationsError::Generic { code } => (String::from("Generic"), code)
1562        };
1563
1564        Self::Endpoint {
1565            description,
1566            status_code,
1567            source: Some(Box::new(err))
1568        }
1569    }
1570}
1571
1572/// Errors for the [List public organization members](Orgs::list_public_members_async()) endpoint.
1573#[derive(Debug, thiserror::Error)]
1574pub enum OrgsListPublicMembersError {
1575    #[error("Status code: {}", code)]
1576    Generic { code: u16 },
1577}
1578
1579impl From<OrgsListPublicMembersError> for AdapterError {
1580    fn from(err: OrgsListPublicMembersError) -> Self {
1581        let (description, status_code) = match err {
1582            OrgsListPublicMembersError::Generic { code } => (String::from("Generic"), code)
1583        };
1584
1585        Self::Endpoint {
1586            description,
1587            status_code,
1588            source: Some(Box::new(err))
1589        }
1590    }
1591}
1592
1593/// Errors for the [List security manager teams](Orgs::list_security_manager_teams_async()) endpoint.
1594#[derive(Debug, thiserror::Error)]
1595pub enum OrgsListSecurityManagerTeamsError {
1596    #[error("Status code: {}", code)]
1597    Generic { code: u16 },
1598}
1599
1600impl From<OrgsListSecurityManagerTeamsError> for AdapterError {
1601    fn from(err: OrgsListSecurityManagerTeamsError) -> Self {
1602        let (description, status_code) = match err {
1603            OrgsListSecurityManagerTeamsError::Generic { code } => (String::from("Generic"), code)
1604        };
1605
1606        Self::Endpoint {
1607            description,
1608            status_code,
1609            source: Some(Box::new(err))
1610        }
1611    }
1612}
1613
1614/// Errors for the [List deliveries for an organization webhook](Orgs::list_webhook_deliveries_async()) endpoint.
1615#[derive(Debug, thiserror::Error)]
1616pub enum OrgsListWebhookDeliveriesError {
1617    #[error("Bad Request")]
1618    Status400(BasicError),
1619    #[error("Validation failed, or the endpoint has been spammed.")]
1620    Status422(ValidationError),
1621    #[error("Status code: {}", code)]
1622    Generic { code: u16 },
1623}
1624
1625impl From<OrgsListWebhookDeliveriesError> for AdapterError {
1626    fn from(err: OrgsListWebhookDeliveriesError) -> Self {
1627        let (description, status_code) = match err {
1628            OrgsListWebhookDeliveriesError::Status400(_) => (String::from("Bad Request"), 400),
1629            OrgsListWebhookDeliveriesError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
1630            OrgsListWebhookDeliveriesError::Generic { code } => (String::from("Generic"), code)
1631        };
1632
1633        Self::Endpoint {
1634            description,
1635            status_code,
1636            source: Some(Box::new(err))
1637        }
1638    }
1639}
1640
1641/// Errors for the [List organization webhooks](Orgs::list_webhooks_async()) endpoint.
1642#[derive(Debug, thiserror::Error)]
1643pub enum OrgsListWebhooksError {
1644    #[error("Resource not found")]
1645    Status404(BasicError),
1646    #[error("Status code: {}", code)]
1647    Generic { code: u16 },
1648}
1649
1650impl From<OrgsListWebhooksError> for AdapterError {
1651    fn from(err: OrgsListWebhooksError) -> Self {
1652        let (description, status_code) = match err {
1653            OrgsListWebhooksError::Status404(_) => (String::from("Resource not found"), 404),
1654            OrgsListWebhooksError::Generic { code } => (String::from("Generic"), code)
1655        };
1656
1657        Self::Endpoint {
1658            description,
1659            status_code,
1660            source: Some(Box::new(err))
1661        }
1662    }
1663}
1664
1665/// Errors for the [Ping an organization webhook](Orgs::ping_webhook_async()) endpoint.
1666#[derive(Debug, thiserror::Error)]
1667pub enum OrgsPingWebhookError {
1668    #[error("Resource not found")]
1669    Status404(BasicError),
1670    #[error("Status code: {}", code)]
1671    Generic { code: u16 },
1672}
1673
1674impl From<OrgsPingWebhookError> for AdapterError {
1675    fn from(err: OrgsPingWebhookError) -> Self {
1676        let (description, status_code) = match err {
1677            OrgsPingWebhookError::Status404(_) => (String::from("Resource not found"), 404),
1678            OrgsPingWebhookError::Generic { code } => (String::from("Generic"), code)
1679        };
1680
1681        Self::Endpoint {
1682            description,
1683            status_code,
1684            source: Some(Box::new(err))
1685        }
1686    }
1687}
1688
1689/// Errors for the [Redeliver a delivery for an organization webhook](Orgs::redeliver_webhook_delivery_async()) endpoint.
1690#[derive(Debug, thiserror::Error)]
1691pub enum OrgsRedeliverWebhookDeliveryError {
1692    #[error("Bad Request")]
1693    Status400(BasicError),
1694    #[error("Validation failed, or the endpoint has been spammed.")]
1695    Status422(ValidationError),
1696    #[error("Status code: {}", code)]
1697    Generic { code: u16 },
1698}
1699
1700impl From<OrgsRedeliverWebhookDeliveryError> for AdapterError {
1701    fn from(err: OrgsRedeliverWebhookDeliveryError) -> Self {
1702        let (description, status_code) = match err {
1703            OrgsRedeliverWebhookDeliveryError::Status400(_) => (String::from("Bad Request"), 400),
1704            OrgsRedeliverWebhookDeliveryError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
1705            OrgsRedeliverWebhookDeliveryError::Generic { code } => (String::from("Generic"), code)
1706        };
1707
1708        Self::Endpoint {
1709            description,
1710            status_code,
1711            source: Some(Box::new(err))
1712        }
1713    }
1714}
1715
1716/// Errors for the [Remove a custom property for an organization](Orgs::remove_custom_property_async()) endpoint.
1717#[derive(Debug, thiserror::Error)]
1718pub enum OrgsRemoveCustomPropertyError {
1719    #[error("Forbidden")]
1720    Status403(BasicError),
1721    #[error("Resource not found")]
1722    Status404(BasicError),
1723    #[error("Status code: {}", code)]
1724    Generic { code: u16 },
1725}
1726
1727impl From<OrgsRemoveCustomPropertyError> for AdapterError {
1728    fn from(err: OrgsRemoveCustomPropertyError) -> Self {
1729        let (description, status_code) = match err {
1730            OrgsRemoveCustomPropertyError::Status403(_) => (String::from("Forbidden"), 403),
1731            OrgsRemoveCustomPropertyError::Status404(_) => (String::from("Resource not found"), 404),
1732            OrgsRemoveCustomPropertyError::Generic { code } => (String::from("Generic"), code)
1733        };
1734
1735        Self::Endpoint {
1736            description,
1737            status_code,
1738            source: Some(Box::new(err))
1739        }
1740    }
1741}
1742
1743/// Errors for the [Remove an organization member](Orgs::remove_member_async()) endpoint.
1744#[derive(Debug, thiserror::Error)]
1745pub enum OrgsRemoveMemberError {
1746    #[error("Forbidden")]
1747    Status403(BasicError),
1748    #[error("Status code: {}", code)]
1749    Generic { code: u16 },
1750}
1751
1752impl From<OrgsRemoveMemberError> for AdapterError {
1753    fn from(err: OrgsRemoveMemberError) -> Self {
1754        let (description, status_code) = match err {
1755            OrgsRemoveMemberError::Status403(_) => (String::from("Forbidden"), 403),
1756            OrgsRemoveMemberError::Generic { code } => (String::from("Generic"), code)
1757        };
1758
1759        Self::Endpoint {
1760            description,
1761            status_code,
1762            source: Some(Box::new(err))
1763        }
1764    }
1765}
1766
1767/// Errors for the [Remove organization membership for a user](Orgs::remove_membership_for_user_async()) endpoint.
1768#[derive(Debug, thiserror::Error)]
1769pub enum OrgsRemoveMembershipForUserError {
1770    #[error("Forbidden")]
1771    Status403(BasicError),
1772    #[error("Resource not found")]
1773    Status404(BasicError),
1774    #[error("Status code: {}", code)]
1775    Generic { code: u16 },
1776}
1777
1778impl From<OrgsRemoveMembershipForUserError> for AdapterError {
1779    fn from(err: OrgsRemoveMembershipForUserError) -> Self {
1780        let (description, status_code) = match err {
1781            OrgsRemoveMembershipForUserError::Status403(_) => (String::from("Forbidden"), 403),
1782            OrgsRemoveMembershipForUserError::Status404(_) => (String::from("Resource not found"), 404),
1783            OrgsRemoveMembershipForUserError::Generic { code } => (String::from("Generic"), code)
1784        };
1785
1786        Self::Endpoint {
1787            description,
1788            status_code,
1789            source: Some(Box::new(err))
1790        }
1791    }
1792}
1793
1794/// Errors for the [Remove outside collaborator from an organization](Orgs::remove_outside_collaborator_async()) endpoint.
1795#[derive(Debug, thiserror::Error)]
1796pub enum OrgsRemoveOutsideCollaboratorError {
1797    #[error("Unprocessable Entity if user is a member of the organization")]
1798    Status422(PutTeamsAddOrUpdateProjectPermissionsLegacyResponse403),
1799    #[error("Status code: {}", code)]
1800    Generic { code: u16 },
1801}
1802
1803impl From<OrgsRemoveOutsideCollaboratorError> for AdapterError {
1804    fn from(err: OrgsRemoveOutsideCollaboratorError) -> Self {
1805        let (description, status_code) = match err {
1806            OrgsRemoveOutsideCollaboratorError::Status422(_) => (String::from("Unprocessable Entity if user is a member of the organization"), 422),
1807            OrgsRemoveOutsideCollaboratorError::Generic { code } => (String::from("Generic"), code)
1808        };
1809
1810        Self::Endpoint {
1811            description,
1812            status_code,
1813            source: Some(Box::new(err))
1814        }
1815    }
1816}
1817
1818/// Errors for the [Remove public organization membership for the authenticated user](Orgs::remove_public_membership_for_authenticated_user_async()) endpoint.
1819#[derive(Debug, thiserror::Error)]
1820pub enum OrgsRemovePublicMembershipForAuthenticatedUserError {
1821    #[error("Status code: {}", code)]
1822    Generic { code: u16 },
1823}
1824
1825impl From<OrgsRemovePublicMembershipForAuthenticatedUserError> for AdapterError {
1826    fn from(err: OrgsRemovePublicMembershipForAuthenticatedUserError) -> Self {
1827        let (description, status_code) = match err {
1828            OrgsRemovePublicMembershipForAuthenticatedUserError::Generic { code } => (String::from("Generic"), code)
1829        };
1830
1831        Self::Endpoint {
1832            description,
1833            status_code,
1834            source: Some(Box::new(err))
1835        }
1836    }
1837}
1838
1839/// Errors for the [Remove a security manager team](Orgs::remove_security_manager_team_async()) endpoint.
1840#[derive(Debug, thiserror::Error)]
1841pub enum OrgsRemoveSecurityManagerTeamError {
1842    #[error("Status code: {}", code)]
1843    Generic { code: u16 },
1844}
1845
1846impl From<OrgsRemoveSecurityManagerTeamError> for AdapterError {
1847    fn from(err: OrgsRemoveSecurityManagerTeamError) -> Self {
1848        let (description, status_code) = match err {
1849            OrgsRemoveSecurityManagerTeamError::Generic { code } => (String::from("Generic"), code)
1850        };
1851
1852        Self::Endpoint {
1853            description,
1854            status_code,
1855            source: Some(Box::new(err))
1856        }
1857    }
1858}
1859
1860/// Errors for the [Review a request to access organization resources with a fine-grained personal access token](Orgs::review_pat_grant_request_async()) endpoint.
1861#[derive(Debug, thiserror::Error)]
1862pub enum OrgsReviewPatGrantRequestError {
1863    #[error("Internal Error")]
1864    Status500(BasicError),
1865    #[error("Validation failed, or the endpoint has been spammed.")]
1866    Status422(ValidationError),
1867    #[error("Resource not found")]
1868    Status404(BasicError),
1869    #[error("Forbidden")]
1870    Status403(BasicError),
1871    #[error("Status code: {}", code)]
1872    Generic { code: u16 },
1873}
1874
1875impl From<OrgsReviewPatGrantRequestError> for AdapterError {
1876    fn from(err: OrgsReviewPatGrantRequestError) -> Self {
1877        let (description, status_code) = match err {
1878            OrgsReviewPatGrantRequestError::Status500(_) => (String::from("Internal Error"), 500),
1879            OrgsReviewPatGrantRequestError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
1880            OrgsReviewPatGrantRequestError::Status404(_) => (String::from("Resource not found"), 404),
1881            OrgsReviewPatGrantRequestError::Status403(_) => (String::from("Forbidden"), 403),
1882            OrgsReviewPatGrantRequestError::Generic { code } => (String::from("Generic"), code)
1883        };
1884
1885        Self::Endpoint {
1886            description,
1887            status_code,
1888            source: Some(Box::new(err))
1889        }
1890    }
1891}
1892
1893/// Errors for the [Review requests to access organization resources with fine-grained personal access tokens](Orgs::review_pat_grant_requests_in_bulk_async()) endpoint.
1894#[derive(Debug, thiserror::Error)]
1895pub enum OrgsReviewPatGrantRequestsInBulkError {
1896    #[error("Internal Error")]
1897    Status500(BasicError),
1898    #[error("Validation failed, or the endpoint has been spammed.")]
1899    Status422(ValidationError),
1900    #[error("Resource not found")]
1901    Status404(BasicError),
1902    #[error("Forbidden")]
1903    Status403(BasicError),
1904    #[error("Status code: {}", code)]
1905    Generic { code: u16 },
1906}
1907
1908impl From<OrgsReviewPatGrantRequestsInBulkError> for AdapterError {
1909    fn from(err: OrgsReviewPatGrantRequestsInBulkError) -> Self {
1910        let (description, status_code) = match err {
1911            OrgsReviewPatGrantRequestsInBulkError::Status500(_) => (String::from("Internal Error"), 500),
1912            OrgsReviewPatGrantRequestsInBulkError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
1913            OrgsReviewPatGrantRequestsInBulkError::Status404(_) => (String::from("Resource not found"), 404),
1914            OrgsReviewPatGrantRequestsInBulkError::Status403(_) => (String::from("Forbidden"), 403),
1915            OrgsReviewPatGrantRequestsInBulkError::Generic { code } => (String::from("Generic"), code)
1916        };
1917
1918        Self::Endpoint {
1919            description,
1920            status_code,
1921            source: Some(Box::new(err))
1922        }
1923    }
1924}
1925
1926/// Errors for the [Remove all organization roles for a team](Orgs::revoke_all_org_roles_team_async()) endpoint.
1927#[derive(Debug, thiserror::Error)]
1928pub enum OrgsRevokeAllOrgRolesTeamError {
1929    #[error("Status code: {}", code)]
1930    Generic { code: u16 },
1931}
1932
1933impl From<OrgsRevokeAllOrgRolesTeamError> for AdapterError {
1934    fn from(err: OrgsRevokeAllOrgRolesTeamError) -> Self {
1935        let (description, status_code) = match err {
1936            OrgsRevokeAllOrgRolesTeamError::Generic { code } => (String::from("Generic"), code)
1937        };
1938
1939        Self::Endpoint {
1940            description,
1941            status_code,
1942            source: Some(Box::new(err))
1943        }
1944    }
1945}
1946
1947/// Errors for the [Remove all organization roles for a user](Orgs::revoke_all_org_roles_user_async()) endpoint.
1948#[derive(Debug, thiserror::Error)]
1949pub enum OrgsRevokeAllOrgRolesUserError {
1950    #[error("Status code: {}", code)]
1951    Generic { code: u16 },
1952}
1953
1954impl From<OrgsRevokeAllOrgRolesUserError> for AdapterError {
1955    fn from(err: OrgsRevokeAllOrgRolesUserError) -> Self {
1956        let (description, status_code) = match err {
1957            OrgsRevokeAllOrgRolesUserError::Generic { code } => (String::from("Generic"), code)
1958        };
1959
1960        Self::Endpoint {
1961            description,
1962            status_code,
1963            source: Some(Box::new(err))
1964        }
1965    }
1966}
1967
1968/// Errors for the [Remove an organization role from a team](Orgs::revoke_org_role_team_async()) endpoint.
1969#[derive(Debug, thiserror::Error)]
1970pub enum OrgsRevokeOrgRoleTeamError {
1971    #[error("Status code: {}", code)]
1972    Generic { code: u16 },
1973}
1974
1975impl From<OrgsRevokeOrgRoleTeamError> for AdapterError {
1976    fn from(err: OrgsRevokeOrgRoleTeamError) -> Self {
1977        let (description, status_code) = match err {
1978            OrgsRevokeOrgRoleTeamError::Generic { code } => (String::from("Generic"), code)
1979        };
1980
1981        Self::Endpoint {
1982            description,
1983            status_code,
1984            source: Some(Box::new(err))
1985        }
1986    }
1987}
1988
1989/// Errors for the [Remove an organization role from a user](Orgs::revoke_org_role_user_async()) endpoint.
1990#[derive(Debug, thiserror::Error)]
1991pub enum OrgsRevokeOrgRoleUserError {
1992    #[error("Status code: {}", code)]
1993    Generic { code: u16 },
1994}
1995
1996impl From<OrgsRevokeOrgRoleUserError> for AdapterError {
1997    fn from(err: OrgsRevokeOrgRoleUserError) -> Self {
1998        let (description, status_code) = match err {
1999            OrgsRevokeOrgRoleUserError::Generic { code } => (String::from("Generic"), code)
2000        };
2001
2002        Self::Endpoint {
2003            description,
2004            status_code,
2005            source: Some(Box::new(err))
2006        }
2007    }
2008}
2009
2010/// Errors for the [Set organization membership for a user](Orgs::set_membership_for_user_async()) endpoint.
2011#[derive(Debug, thiserror::Error)]
2012pub enum OrgsSetMembershipForUserError {
2013    #[error("Validation failed, or the endpoint has been spammed.")]
2014    Status422(ValidationError),
2015    #[error("Forbidden")]
2016    Status403(BasicError),
2017    #[error("Status code: {}", code)]
2018    Generic { code: u16 },
2019}
2020
2021impl From<OrgsSetMembershipForUserError> for AdapterError {
2022    fn from(err: OrgsSetMembershipForUserError) -> Self {
2023        let (description, status_code) = match err {
2024            OrgsSetMembershipForUserError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
2025            OrgsSetMembershipForUserError::Status403(_) => (String::from("Forbidden"), 403),
2026            OrgsSetMembershipForUserError::Generic { code } => (String::from("Generic"), code)
2027        };
2028
2029        Self::Endpoint {
2030            description,
2031            status_code,
2032            source: Some(Box::new(err))
2033        }
2034    }
2035}
2036
2037/// Errors for the [Set public organization membership for the authenticated user](Orgs::set_public_membership_for_authenticated_user_async()) endpoint.
2038#[derive(Debug, thiserror::Error)]
2039pub enum OrgsSetPublicMembershipForAuthenticatedUserError {
2040    #[error("Forbidden")]
2041    Status403(BasicError),
2042    #[error("Status code: {}", code)]
2043    Generic { code: u16 },
2044}
2045
2046impl From<OrgsSetPublicMembershipForAuthenticatedUserError> for AdapterError {
2047    fn from(err: OrgsSetPublicMembershipForAuthenticatedUserError) -> Self {
2048        let (description, status_code) = match err {
2049            OrgsSetPublicMembershipForAuthenticatedUserError::Status403(_) => (String::from("Forbidden"), 403),
2050            OrgsSetPublicMembershipForAuthenticatedUserError::Generic { code } => (String::from("Generic"), code)
2051        };
2052
2053        Self::Endpoint {
2054            description,
2055            status_code,
2056            source: Some(Box::new(err))
2057        }
2058    }
2059}
2060
2061/// Errors for the [Unblock a user from an organization](Orgs::unblock_user_async()) endpoint.
2062#[derive(Debug, thiserror::Error)]
2063pub enum OrgsUnblockUserError {
2064    #[error("Status code: {}", code)]
2065    Generic { code: u16 },
2066}
2067
2068impl From<OrgsUnblockUserError> for AdapterError {
2069    fn from(err: OrgsUnblockUserError) -> Self {
2070        let (description, status_code) = match err {
2071            OrgsUnblockUserError::Generic { code } => (String::from("Generic"), code)
2072        };
2073
2074        Self::Endpoint {
2075            description,
2076            status_code,
2077            source: Some(Box::new(err))
2078        }
2079    }
2080}
2081
2082/// Errors for the [Update an organization](Orgs::update_async()) endpoint.
2083#[derive(Debug, thiserror::Error)]
2084pub enum OrgsUpdateError {
2085    #[error("Validation failed")]
2086    Status422(PostProjectsCreateCardResponse422),
2087    #[error("Conflict")]
2088    Status409(BasicError),
2089    #[error("Status code: {}", code)]
2090    Generic { code: u16 },
2091}
2092
2093impl From<OrgsUpdateError> for AdapterError {
2094    fn from(err: OrgsUpdateError) -> Self {
2095        let (description, status_code) = match err {
2096            OrgsUpdateError::Status422(_) => (String::from("Validation failed"), 422),
2097            OrgsUpdateError::Status409(_) => (String::from("Conflict"), 409),
2098            OrgsUpdateError::Generic { code } => (String::from("Generic"), code)
2099        };
2100
2101        Self::Endpoint {
2102            description,
2103            status_code,
2104            source: Some(Box::new(err))
2105        }
2106    }
2107}
2108
2109/// Errors for the [Update issue type for an organization](Orgs::update_issue_type_async()) endpoint.
2110#[derive(Debug, thiserror::Error)]
2111pub enum OrgsUpdateIssueTypeError {
2112    #[error("Resource not found")]
2113    Status404(BasicError),
2114    #[error("Validation failed, or the endpoint has been spammed.")]
2115    Status422(ValidationErrorSimple),
2116    #[error("Status code: {}", code)]
2117    Generic { code: u16 },
2118}
2119
2120impl From<OrgsUpdateIssueTypeError> for AdapterError {
2121    fn from(err: OrgsUpdateIssueTypeError) -> Self {
2122        let (description, status_code) = match err {
2123            OrgsUpdateIssueTypeError::Status404(_) => (String::from("Resource not found"), 404),
2124            OrgsUpdateIssueTypeError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
2125            OrgsUpdateIssueTypeError::Generic { code } => (String::from("Generic"), code)
2126        };
2127
2128        Self::Endpoint {
2129            description,
2130            status_code,
2131            source: Some(Box::new(err))
2132        }
2133    }
2134}
2135
2136/// Errors for the [Update an organization membership for the authenticated user](Orgs::update_membership_for_authenticated_user_async()) endpoint.
2137#[derive(Debug, thiserror::Error)]
2138pub enum OrgsUpdateMembershipForAuthenticatedUserError {
2139    #[error("Forbidden")]
2140    Status403(BasicError),
2141    #[error("Resource not found")]
2142    Status404(BasicError),
2143    #[error("Validation failed, or the endpoint has been spammed.")]
2144    Status422(ValidationError),
2145    #[error("Status code: {}", code)]
2146    Generic { code: u16 },
2147}
2148
2149impl From<OrgsUpdateMembershipForAuthenticatedUserError> for AdapterError {
2150    fn from(err: OrgsUpdateMembershipForAuthenticatedUserError) -> Self {
2151        let (description, status_code) = match err {
2152            OrgsUpdateMembershipForAuthenticatedUserError::Status403(_) => (String::from("Forbidden"), 403),
2153            OrgsUpdateMembershipForAuthenticatedUserError::Status404(_) => (String::from("Resource not found"), 404),
2154            OrgsUpdateMembershipForAuthenticatedUserError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
2155            OrgsUpdateMembershipForAuthenticatedUserError::Generic { code } => (String::from("Generic"), code)
2156        };
2157
2158        Self::Endpoint {
2159            description,
2160            status_code,
2161            source: Some(Box::new(err))
2162        }
2163    }
2164}
2165
2166/// Errors for the [Update the access a fine-grained personal access token has to organization resources](Orgs::update_pat_access_async()) endpoint.
2167#[derive(Debug, thiserror::Error)]
2168pub enum OrgsUpdatePatAccessError {
2169    #[error("Internal Error")]
2170    Status500(BasicError),
2171    #[error("Resource not found")]
2172    Status404(BasicError),
2173    #[error("Forbidden")]
2174    Status403(BasicError),
2175    #[error("Validation failed, or the endpoint has been spammed.")]
2176    Status422(ValidationError),
2177    #[error("Status code: {}", code)]
2178    Generic { code: u16 },
2179}
2180
2181impl From<OrgsUpdatePatAccessError> for AdapterError {
2182    fn from(err: OrgsUpdatePatAccessError) -> Self {
2183        let (description, status_code) = match err {
2184            OrgsUpdatePatAccessError::Status500(_) => (String::from("Internal Error"), 500),
2185            OrgsUpdatePatAccessError::Status404(_) => (String::from("Resource not found"), 404),
2186            OrgsUpdatePatAccessError::Status403(_) => (String::from("Forbidden"), 403),
2187            OrgsUpdatePatAccessError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
2188            OrgsUpdatePatAccessError::Generic { code } => (String::from("Generic"), code)
2189        };
2190
2191        Self::Endpoint {
2192            description,
2193            status_code,
2194            source: Some(Box::new(err))
2195        }
2196    }
2197}
2198
2199/// Errors for the [Update the access to organization resources via fine-grained personal access tokens](Orgs::update_pat_accesses_async()) endpoint.
2200#[derive(Debug, thiserror::Error)]
2201pub enum OrgsUpdatePatAccessesError {
2202    #[error("Internal Error")]
2203    Status500(BasicError),
2204    #[error("Resource not found")]
2205    Status404(BasicError),
2206    #[error("Forbidden")]
2207    Status403(BasicError),
2208    #[error("Validation failed, or the endpoint has been spammed.")]
2209    Status422(ValidationError),
2210    #[error("Status code: {}", code)]
2211    Generic { code: u16 },
2212}
2213
2214impl From<OrgsUpdatePatAccessesError> for AdapterError {
2215    fn from(err: OrgsUpdatePatAccessesError) -> Self {
2216        let (description, status_code) = match err {
2217            OrgsUpdatePatAccessesError::Status500(_) => (String::from("Internal Error"), 500),
2218            OrgsUpdatePatAccessesError::Status404(_) => (String::from("Resource not found"), 404),
2219            OrgsUpdatePatAccessesError::Status403(_) => (String::from("Forbidden"), 403),
2220            OrgsUpdatePatAccessesError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
2221            OrgsUpdatePatAccessesError::Generic { code } => (String::from("Generic"), code)
2222        };
2223
2224        Self::Endpoint {
2225            description,
2226            status_code,
2227            source: Some(Box::new(err))
2228        }
2229    }
2230}
2231
2232/// Errors for the [Update an organization webhook](Orgs::update_webhook_async()) endpoint.
2233#[derive(Debug, thiserror::Error)]
2234pub enum OrgsUpdateWebhookError {
2235    #[error("Validation failed, or the endpoint has been spammed.")]
2236    Status422(ValidationError),
2237    #[error("Resource not found")]
2238    Status404(BasicError),
2239    #[error("Status code: {}", code)]
2240    Generic { code: u16 },
2241}
2242
2243impl From<OrgsUpdateWebhookError> for AdapterError {
2244    fn from(err: OrgsUpdateWebhookError) -> Self {
2245        let (description, status_code) = match err {
2246            OrgsUpdateWebhookError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
2247            OrgsUpdateWebhookError::Status404(_) => (String::from("Resource not found"), 404),
2248            OrgsUpdateWebhookError::Generic { code } => (String::from("Generic"), code)
2249        };
2250
2251        Self::Endpoint {
2252            description,
2253            status_code,
2254            source: Some(Box::new(err))
2255        }
2256    }
2257}
2258
2259/// Errors for the [Update a webhook configuration for an organization](Orgs::update_webhook_config_for_org_async()) endpoint.
2260#[derive(Debug, thiserror::Error)]
2261pub enum OrgsUpdateWebhookConfigForOrgError {
2262    #[error("Status code: {}", code)]
2263    Generic { code: u16 },
2264}
2265
2266impl From<OrgsUpdateWebhookConfigForOrgError> for AdapterError {
2267    fn from(err: OrgsUpdateWebhookConfigForOrgError) -> Self {
2268        let (description, status_code) = match err {
2269            OrgsUpdateWebhookConfigForOrgError::Generic { code } => (String::from("Generic"), code)
2270        };
2271
2272        Self::Endpoint {
2273            description,
2274            status_code,
2275            source: Some(Box::new(err))
2276        }
2277    }
2278}
2279
2280
2281/// Query parameters for the [Get organization ruleset history](Orgs::get_org_ruleset_history_async()) endpoint.
2282#[derive(Default, Serialize)]
2283pub struct OrgsGetOrgRulesetHistoryParams {
2284    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2285    per_page: Option<u16>, 
2286    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2287    page: Option<u16>
2288}
2289
2290impl OrgsGetOrgRulesetHistoryParams {
2291    pub fn new() -> Self {
2292        Self::default()
2293    }
2294
2295    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2296    pub fn per_page(self, per_page: u16) -> Self {
2297        Self {
2298            per_page: Some(per_page),
2299            page: self.page, 
2300        }
2301    }
2302
2303    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2304    pub fn page(self, page: u16) -> Self {
2305        Self {
2306            per_page: self.per_page, 
2307            page: Some(page),
2308        }
2309    }
2310}
2311
2312impl<'enc> From<&'enc PerPage> for OrgsGetOrgRulesetHistoryParams {
2313    fn from(per_page: &'enc PerPage) -> Self {
2314        Self {
2315            per_page: Some(per_page.per_page),
2316            page: Some(per_page.page),
2317            ..Default::default()
2318        }
2319    }
2320}
2321/// Query parameters for the [Get route stats by actor](Orgs::get_route_stats_by_actor_async()) endpoint.
2322#[derive(Default, Serialize)]
2323pub struct OrgsGetRouteStatsByActorParams<'req> {
2324    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2325    min_timestamp: &'req str, 
2326    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2327    max_timestamp: Option<&'req str>, 
2328    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2329    page: Option<u16>, 
2330    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2331    per_page: Option<u16>, 
2332    /// The direction to sort the results by.
2333    direction: Option<&'req str>, 
2334    /// The property to sort the results by.
2335    sort: Option<Vec<String>>, 
2336    /// Providing a substring will filter results where the API route contains the substring. This is a case-insensitive search.
2337    api_route_substring: Option<&'req str>
2338}
2339
2340impl<'req> OrgsGetRouteStatsByActorParams<'req> {
2341    pub fn new() -> Self {
2342        Self::default()
2343    }
2344
2345    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2346    pub fn min_timestamp(self, min_timestamp: &'req str) -> Self {
2347        Self {
2348            min_timestamp: min_timestamp,
2349            max_timestamp: self.max_timestamp, 
2350            page: self.page, 
2351            per_page: self.per_page, 
2352            direction: self.direction, 
2353            sort: self.sort, 
2354            api_route_substring: self.api_route_substring, 
2355        }
2356    }
2357
2358    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2359    pub fn max_timestamp(self, max_timestamp: &'req str) -> Self {
2360        Self {
2361            min_timestamp: self.min_timestamp, 
2362            max_timestamp: Some(max_timestamp),
2363            page: self.page, 
2364            per_page: self.per_page, 
2365            direction: self.direction, 
2366            sort: self.sort, 
2367            api_route_substring: self.api_route_substring, 
2368        }
2369    }
2370
2371    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2372    pub fn page(self, page: u16) -> Self {
2373        Self {
2374            min_timestamp: self.min_timestamp, 
2375            max_timestamp: self.max_timestamp, 
2376            page: Some(page),
2377            per_page: self.per_page, 
2378            direction: self.direction, 
2379            sort: self.sort, 
2380            api_route_substring: self.api_route_substring, 
2381        }
2382    }
2383
2384    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2385    pub fn per_page(self, per_page: u16) -> Self {
2386        Self {
2387            min_timestamp: self.min_timestamp, 
2388            max_timestamp: self.max_timestamp, 
2389            page: self.page, 
2390            per_page: Some(per_page),
2391            direction: self.direction, 
2392            sort: self.sort, 
2393            api_route_substring: self.api_route_substring, 
2394        }
2395    }
2396
2397    /// The direction to sort the results by.
2398    pub fn direction(self, direction: &'req str) -> Self {
2399        Self {
2400            min_timestamp: self.min_timestamp, 
2401            max_timestamp: self.max_timestamp, 
2402            page: self.page, 
2403            per_page: self.per_page, 
2404            direction: Some(direction),
2405            sort: self.sort, 
2406            api_route_substring: self.api_route_substring, 
2407        }
2408    }
2409
2410    /// The property to sort the results by.
2411    pub fn sort(self, sort: Vec<String>) -> Self {
2412        Self {
2413            min_timestamp: self.min_timestamp, 
2414            max_timestamp: self.max_timestamp, 
2415            page: self.page, 
2416            per_page: self.per_page, 
2417            direction: self.direction, 
2418            sort: Some(sort),
2419            api_route_substring: self.api_route_substring, 
2420        }
2421    }
2422
2423    /// Providing a substring will filter results where the API route contains the substring. This is a case-insensitive search.
2424    pub fn api_route_substring(self, api_route_substring: &'req str) -> Self {
2425        Self {
2426            min_timestamp: self.min_timestamp, 
2427            max_timestamp: self.max_timestamp, 
2428            page: self.page, 
2429            per_page: self.per_page, 
2430            direction: self.direction, 
2431            sort: self.sort, 
2432            api_route_substring: Some(api_route_substring),
2433        }
2434    }
2435}
2436
2437impl<'enc> From<&'enc PerPage> for OrgsGetRouteStatsByActorParams<'enc> {
2438    fn from(per_page: &'enc PerPage) -> Self {
2439        Self {
2440            per_page: Some(per_page.per_page),
2441            page: Some(per_page.page),
2442            ..Default::default()
2443        }
2444    }
2445}
2446/// Query parameters for the [Get subject stats](Orgs::get_subject_stats_async()) endpoint.
2447#[derive(Default, Serialize)]
2448pub struct OrgsGetSubjectStatsParams<'req> {
2449    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2450    min_timestamp: &'req str, 
2451    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2452    max_timestamp: Option<&'req str>, 
2453    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2454    page: Option<u16>, 
2455    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2456    per_page: Option<u16>, 
2457    /// The direction to sort the results by.
2458    direction: Option<&'req str>, 
2459    /// The property to sort the results by.
2460    sort: Option<Vec<String>>, 
2461    /// Providing a substring will filter results where the subject name contains the substring. This is a case-insensitive search.
2462    subject_name_substring: Option<&'req str>
2463}
2464
2465impl<'req> OrgsGetSubjectStatsParams<'req> {
2466    pub fn new() -> Self {
2467        Self::default()
2468    }
2469
2470    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2471    pub fn min_timestamp(self, min_timestamp: &'req str) -> Self {
2472        Self {
2473            min_timestamp: min_timestamp,
2474            max_timestamp: self.max_timestamp, 
2475            page: self.page, 
2476            per_page: self.per_page, 
2477            direction: self.direction, 
2478            sort: self.sort, 
2479            subject_name_substring: self.subject_name_substring, 
2480        }
2481    }
2482
2483    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2484    pub fn max_timestamp(self, max_timestamp: &'req str) -> Self {
2485        Self {
2486            min_timestamp: self.min_timestamp, 
2487            max_timestamp: Some(max_timestamp),
2488            page: self.page, 
2489            per_page: self.per_page, 
2490            direction: self.direction, 
2491            sort: self.sort, 
2492            subject_name_substring: self.subject_name_substring, 
2493        }
2494    }
2495
2496    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2497    pub fn page(self, page: u16) -> Self {
2498        Self {
2499            min_timestamp: self.min_timestamp, 
2500            max_timestamp: self.max_timestamp, 
2501            page: Some(page),
2502            per_page: self.per_page, 
2503            direction: self.direction, 
2504            sort: self.sort, 
2505            subject_name_substring: self.subject_name_substring, 
2506        }
2507    }
2508
2509    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2510    pub fn per_page(self, per_page: u16) -> Self {
2511        Self {
2512            min_timestamp: self.min_timestamp, 
2513            max_timestamp: self.max_timestamp, 
2514            page: self.page, 
2515            per_page: Some(per_page),
2516            direction: self.direction, 
2517            sort: self.sort, 
2518            subject_name_substring: self.subject_name_substring, 
2519        }
2520    }
2521
2522    /// The direction to sort the results by.
2523    pub fn direction(self, direction: &'req str) -> Self {
2524        Self {
2525            min_timestamp: self.min_timestamp, 
2526            max_timestamp: self.max_timestamp, 
2527            page: self.page, 
2528            per_page: self.per_page, 
2529            direction: Some(direction),
2530            sort: self.sort, 
2531            subject_name_substring: self.subject_name_substring, 
2532        }
2533    }
2534
2535    /// The property to sort the results by.
2536    pub fn sort(self, sort: Vec<String>) -> Self {
2537        Self {
2538            min_timestamp: self.min_timestamp, 
2539            max_timestamp: self.max_timestamp, 
2540            page: self.page, 
2541            per_page: self.per_page, 
2542            direction: self.direction, 
2543            sort: Some(sort),
2544            subject_name_substring: self.subject_name_substring, 
2545        }
2546    }
2547
2548    /// Providing a substring will filter results where the subject name contains the substring. This is a case-insensitive search.
2549    pub fn subject_name_substring(self, subject_name_substring: &'req str) -> Self {
2550        Self {
2551            min_timestamp: self.min_timestamp, 
2552            max_timestamp: self.max_timestamp, 
2553            page: self.page, 
2554            per_page: self.per_page, 
2555            direction: self.direction, 
2556            sort: self.sort, 
2557            subject_name_substring: Some(subject_name_substring),
2558        }
2559    }
2560}
2561
2562impl<'enc> From<&'enc PerPage> for OrgsGetSubjectStatsParams<'enc> {
2563    fn from(per_page: &'enc PerPage) -> Self {
2564        Self {
2565            per_page: Some(per_page.per_page),
2566            page: Some(per_page.page),
2567            ..Default::default()
2568        }
2569    }
2570}
2571/// Query parameters for the [Get summary stats](Orgs::get_summary_stats_async()) endpoint.
2572#[derive(Default, Serialize)]
2573pub struct OrgsGetSummaryStatsParams<'req> {
2574    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2575    min_timestamp: &'req str, 
2576    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2577    max_timestamp: Option<&'req str>
2578}
2579
2580impl<'req> OrgsGetSummaryStatsParams<'req> {
2581    pub fn new() -> Self {
2582        Self::default()
2583    }
2584
2585    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2586    pub fn min_timestamp(self, min_timestamp: &'req str) -> Self {
2587        Self {
2588            min_timestamp: min_timestamp,
2589            max_timestamp: self.max_timestamp, 
2590        }
2591    }
2592
2593    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2594    pub fn max_timestamp(self, max_timestamp: &'req str) -> Self {
2595        Self {
2596            min_timestamp: self.min_timestamp, 
2597            max_timestamp: Some(max_timestamp),
2598        }
2599    }
2600}
2601
2602/// Query parameters for the [Get summary stats by actor](Orgs::get_summary_stats_by_actor_async()) endpoint.
2603#[derive(Default, Serialize)]
2604pub struct OrgsGetSummaryStatsByActorParams<'req> {
2605    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2606    min_timestamp: &'req str, 
2607    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2608    max_timestamp: Option<&'req str>
2609}
2610
2611impl<'req> OrgsGetSummaryStatsByActorParams<'req> {
2612    pub fn new() -> Self {
2613        Self::default()
2614    }
2615
2616    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2617    pub fn min_timestamp(self, min_timestamp: &'req str) -> Self {
2618        Self {
2619            min_timestamp: min_timestamp,
2620            max_timestamp: self.max_timestamp, 
2621        }
2622    }
2623
2624    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2625    pub fn max_timestamp(self, max_timestamp: &'req str) -> Self {
2626        Self {
2627            min_timestamp: self.min_timestamp, 
2628            max_timestamp: Some(max_timestamp),
2629        }
2630    }
2631}
2632
2633/// Query parameters for the [Get summary stats by user](Orgs::get_summary_stats_by_user_async()) endpoint.
2634#[derive(Default, Serialize)]
2635pub struct OrgsGetSummaryStatsByUserParams<'req> {
2636    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2637    min_timestamp: &'req str, 
2638    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2639    max_timestamp: Option<&'req str>
2640}
2641
2642impl<'req> OrgsGetSummaryStatsByUserParams<'req> {
2643    pub fn new() -> Self {
2644        Self::default()
2645    }
2646
2647    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2648    pub fn min_timestamp(self, min_timestamp: &'req str) -> Self {
2649        Self {
2650            min_timestamp: min_timestamp,
2651            max_timestamp: self.max_timestamp, 
2652        }
2653    }
2654
2655    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2656    pub fn max_timestamp(self, max_timestamp: &'req str) -> Self {
2657        Self {
2658            min_timestamp: self.min_timestamp, 
2659            max_timestamp: Some(max_timestamp),
2660        }
2661    }
2662}
2663
2664/// Query parameters for the [Get time stats](Orgs::get_time_stats_async()) endpoint.
2665#[derive(Default, Serialize)]
2666pub struct OrgsGetTimeStatsParams<'req> {
2667    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2668    min_timestamp: &'req str, 
2669    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2670    max_timestamp: Option<&'req str>, 
2671    /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.)
2672    timestamp_increment: &'req str
2673}
2674
2675impl<'req> OrgsGetTimeStatsParams<'req> {
2676    pub fn new() -> Self {
2677        Self::default()
2678    }
2679
2680    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2681    pub fn min_timestamp(self, min_timestamp: &'req str) -> Self {
2682        Self {
2683            min_timestamp: min_timestamp,
2684            max_timestamp: self.max_timestamp, 
2685            timestamp_increment: self.timestamp_increment, 
2686        }
2687    }
2688
2689    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2690    pub fn max_timestamp(self, max_timestamp: &'req str) -> Self {
2691        Self {
2692            min_timestamp: self.min_timestamp, 
2693            max_timestamp: Some(max_timestamp),
2694            timestamp_increment: self.timestamp_increment, 
2695        }
2696    }
2697
2698    /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.)
2699    pub fn timestamp_increment(self, timestamp_increment: &'req str) -> Self {
2700        Self {
2701            min_timestamp: self.min_timestamp, 
2702            max_timestamp: self.max_timestamp, 
2703            timestamp_increment: timestamp_increment,
2704        }
2705    }
2706}
2707
2708/// Query parameters for the [Get time stats by actor](Orgs::get_time_stats_by_actor_async()) endpoint.
2709#[derive(Default, Serialize)]
2710pub struct OrgsGetTimeStatsByActorParams<'req> {
2711    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2712    min_timestamp: &'req str, 
2713    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2714    max_timestamp: Option<&'req str>, 
2715    /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.)
2716    timestamp_increment: &'req str
2717}
2718
2719impl<'req> OrgsGetTimeStatsByActorParams<'req> {
2720    pub fn new() -> Self {
2721        Self::default()
2722    }
2723
2724    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2725    pub fn min_timestamp(self, min_timestamp: &'req str) -> Self {
2726        Self {
2727            min_timestamp: min_timestamp,
2728            max_timestamp: self.max_timestamp, 
2729            timestamp_increment: self.timestamp_increment, 
2730        }
2731    }
2732
2733    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2734    pub fn max_timestamp(self, max_timestamp: &'req str) -> Self {
2735        Self {
2736            min_timestamp: self.min_timestamp, 
2737            max_timestamp: Some(max_timestamp),
2738            timestamp_increment: self.timestamp_increment, 
2739        }
2740    }
2741
2742    /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.)
2743    pub fn timestamp_increment(self, timestamp_increment: &'req str) -> Self {
2744        Self {
2745            min_timestamp: self.min_timestamp, 
2746            max_timestamp: self.max_timestamp, 
2747            timestamp_increment: timestamp_increment,
2748        }
2749    }
2750}
2751
2752/// Query parameters for the [Get time stats by user](Orgs::get_time_stats_by_user_async()) endpoint.
2753#[derive(Default, Serialize)]
2754pub struct OrgsGetTimeStatsByUserParams<'req> {
2755    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2756    min_timestamp: &'req str, 
2757    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2758    max_timestamp: Option<&'req str>, 
2759    /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.)
2760    timestamp_increment: &'req str
2761}
2762
2763impl<'req> OrgsGetTimeStatsByUserParams<'req> {
2764    pub fn new() -> Self {
2765        Self::default()
2766    }
2767
2768    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2769    pub fn min_timestamp(self, min_timestamp: &'req str) -> Self {
2770        Self {
2771            min_timestamp: min_timestamp,
2772            max_timestamp: self.max_timestamp, 
2773            timestamp_increment: self.timestamp_increment, 
2774        }
2775    }
2776
2777    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2778    pub fn max_timestamp(self, max_timestamp: &'req str) -> Self {
2779        Self {
2780            min_timestamp: self.min_timestamp, 
2781            max_timestamp: Some(max_timestamp),
2782            timestamp_increment: self.timestamp_increment, 
2783        }
2784    }
2785
2786    /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.)
2787    pub fn timestamp_increment(self, timestamp_increment: &'req str) -> Self {
2788        Self {
2789            min_timestamp: self.min_timestamp, 
2790            max_timestamp: self.max_timestamp, 
2791            timestamp_increment: timestamp_increment,
2792        }
2793    }
2794}
2795
2796/// Query parameters for the [Get user stats](Orgs::get_user_stats_async()) endpoint.
2797#[derive(Default, Serialize)]
2798pub struct OrgsGetUserStatsParams<'req> {
2799    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2800    min_timestamp: &'req str, 
2801    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2802    max_timestamp: Option<&'req str>, 
2803    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2804    page: Option<u16>, 
2805    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2806    per_page: Option<u16>, 
2807    /// The direction to sort the results by.
2808    direction: Option<&'req str>, 
2809    /// The property to sort the results by.
2810    sort: Option<Vec<String>>, 
2811    /// Providing a substring will filter results where the actor name contains the substring. This is a case-insensitive search.
2812    actor_name_substring: Option<&'req str>
2813}
2814
2815impl<'req> OrgsGetUserStatsParams<'req> {
2816    pub fn new() -> Self {
2817        Self::default()
2818    }
2819
2820    /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2821    pub fn min_timestamp(self, min_timestamp: &'req str) -> Self {
2822        Self {
2823            min_timestamp: min_timestamp,
2824            max_timestamp: self.max_timestamp, 
2825            page: self.page, 
2826            per_page: self.per_page, 
2827            direction: self.direction, 
2828            sort: self.sort, 
2829            actor_name_substring: self.actor_name_substring, 
2830        }
2831    }
2832
2833    /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
2834    pub fn max_timestamp(self, max_timestamp: &'req str) -> Self {
2835        Self {
2836            min_timestamp: self.min_timestamp, 
2837            max_timestamp: Some(max_timestamp),
2838            page: self.page, 
2839            per_page: self.per_page, 
2840            direction: self.direction, 
2841            sort: self.sort, 
2842            actor_name_substring: self.actor_name_substring, 
2843        }
2844    }
2845
2846    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2847    pub fn page(self, page: u16) -> Self {
2848        Self {
2849            min_timestamp: self.min_timestamp, 
2850            max_timestamp: self.max_timestamp, 
2851            page: Some(page),
2852            per_page: self.per_page, 
2853            direction: self.direction, 
2854            sort: self.sort, 
2855            actor_name_substring: self.actor_name_substring, 
2856        }
2857    }
2858
2859    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2860    pub fn per_page(self, per_page: u16) -> Self {
2861        Self {
2862            min_timestamp: self.min_timestamp, 
2863            max_timestamp: self.max_timestamp, 
2864            page: self.page, 
2865            per_page: Some(per_page),
2866            direction: self.direction, 
2867            sort: self.sort, 
2868            actor_name_substring: self.actor_name_substring, 
2869        }
2870    }
2871
2872    /// The direction to sort the results by.
2873    pub fn direction(self, direction: &'req str) -> Self {
2874        Self {
2875            min_timestamp: self.min_timestamp, 
2876            max_timestamp: self.max_timestamp, 
2877            page: self.page, 
2878            per_page: self.per_page, 
2879            direction: Some(direction),
2880            sort: self.sort, 
2881            actor_name_substring: self.actor_name_substring, 
2882        }
2883    }
2884
2885    /// The property to sort the results by.
2886    pub fn sort(self, sort: Vec<String>) -> Self {
2887        Self {
2888            min_timestamp: self.min_timestamp, 
2889            max_timestamp: self.max_timestamp, 
2890            page: self.page, 
2891            per_page: self.per_page, 
2892            direction: self.direction, 
2893            sort: Some(sort),
2894            actor_name_substring: self.actor_name_substring, 
2895        }
2896    }
2897
2898    /// Providing a substring will filter results where the actor name contains the substring. This is a case-insensitive search.
2899    pub fn actor_name_substring(self, actor_name_substring: &'req str) -> Self {
2900        Self {
2901            min_timestamp: self.min_timestamp, 
2902            max_timestamp: self.max_timestamp, 
2903            page: self.page, 
2904            per_page: self.per_page, 
2905            direction: self.direction, 
2906            sort: self.sort, 
2907            actor_name_substring: Some(actor_name_substring),
2908        }
2909    }
2910}
2911
2912impl<'enc> From<&'enc PerPage> for OrgsGetUserStatsParams<'enc> {
2913    fn from(per_page: &'enc PerPage) -> Self {
2914        Self {
2915            per_page: Some(per_page.per_page),
2916            page: Some(per_page.page),
2917            ..Default::default()
2918        }
2919    }
2920}
2921/// Query parameters for the [List organizations](Orgs::list_async()) endpoint.
2922#[derive(Default, Serialize)]
2923pub struct OrgsListParams {
2924    /// An organization ID. Only return organizations with an ID greater than this ID.
2925    since: Option<i32>, 
2926    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2927    per_page: Option<u16>
2928}
2929
2930impl OrgsListParams {
2931    pub fn new() -> Self {
2932        Self::default()
2933    }
2934
2935    /// An organization ID. Only return organizations with an ID greater than this ID.
2936    pub fn since(self, since: i32) -> Self {
2937        Self {
2938            since: Some(since),
2939            per_page: self.per_page, 
2940        }
2941    }
2942
2943    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2944    pub fn per_page(self, per_page: u16) -> Self {
2945        Self {
2946            since: self.since, 
2947            per_page: Some(per_page),
2948        }
2949    }
2950}
2951
2952/// Query parameters for the [List app installations for an organization](Orgs::list_app_installations_async()) endpoint.
2953#[derive(Default, Serialize)]
2954pub struct OrgsListAppInstallationsParams {
2955    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2956    per_page: Option<u16>, 
2957    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2958    page: Option<u16>
2959}
2960
2961impl OrgsListAppInstallationsParams {
2962    pub fn new() -> Self {
2963        Self::default()
2964    }
2965
2966    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2967    pub fn per_page(self, per_page: u16) -> Self {
2968        Self {
2969            per_page: Some(per_page),
2970            page: self.page, 
2971        }
2972    }
2973
2974    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2975    pub fn page(self, page: u16) -> Self {
2976        Self {
2977            per_page: self.per_page, 
2978            page: Some(page),
2979        }
2980    }
2981}
2982
2983impl<'enc> From<&'enc PerPage> for OrgsListAppInstallationsParams {
2984    fn from(per_page: &'enc PerPage) -> Self {
2985        Self {
2986            per_page: Some(per_page.per_page),
2987            page: Some(per_page.page),
2988            ..Default::default()
2989        }
2990    }
2991}
2992/// Query parameters for the [List attestations](Orgs::list_attestations_async()) endpoint.
2993#[derive(Default, Serialize)]
2994pub struct OrgsListAttestationsParams<'req> {
2995    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2996    per_page: Option<u16>, 
2997    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
2998    before: Option<&'req str>, 
2999    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3000    after: Option<&'req str>, 
3001    /// Optional filter for fetching attestations with a given predicate type. This option accepts `provenance`, `sbom`, or freeform text for custom predicate types.
3002    predicate_type: Option<&'req str>
3003}
3004
3005impl<'req> OrgsListAttestationsParams<'req> {
3006    pub fn new() -> Self {
3007        Self::default()
3008    }
3009
3010    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3011    pub fn per_page(self, per_page: u16) -> Self {
3012        Self {
3013            per_page: Some(per_page),
3014            before: self.before, 
3015            after: self.after, 
3016            predicate_type: self.predicate_type, 
3017        }
3018    }
3019
3020    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3021    pub fn before(self, before: &'req str) -> Self {
3022        Self {
3023            per_page: self.per_page, 
3024            before: Some(before),
3025            after: self.after, 
3026            predicate_type: self.predicate_type, 
3027        }
3028    }
3029
3030    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3031    pub fn after(self, after: &'req str) -> Self {
3032        Self {
3033            per_page: self.per_page, 
3034            before: self.before, 
3035            after: Some(after),
3036            predicate_type: self.predicate_type, 
3037        }
3038    }
3039
3040    /// Optional filter for fetching attestations with a given predicate type. This option accepts `provenance`, `sbom`, or freeform text for custom predicate types.
3041    pub fn predicate_type(self, predicate_type: &'req str) -> Self {
3042        Self {
3043            per_page: self.per_page, 
3044            before: self.before, 
3045            after: self.after, 
3046            predicate_type: Some(predicate_type),
3047        }
3048    }
3049}
3050
3051/// Query parameters for the [List attestations by bulk subject digests](Orgs::list_attestations_bulk_async()) endpoint.
3052#[derive(Default, Serialize)]
3053pub struct OrgsListAttestationsBulkParams<'req> {
3054    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3055    per_page: Option<u16>, 
3056    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3057    before: Option<&'req str>, 
3058    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3059    after: Option<&'req str>
3060}
3061
3062impl<'req> OrgsListAttestationsBulkParams<'req> {
3063    pub fn new() -> Self {
3064        Self::default()
3065    }
3066
3067    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3068    pub fn per_page(self, per_page: u16) -> Self {
3069        Self {
3070            per_page: Some(per_page),
3071            before: self.before, 
3072            after: self.after, 
3073        }
3074    }
3075
3076    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3077    pub fn before(self, before: &'req str) -> Self {
3078        Self {
3079            per_page: self.per_page, 
3080            before: Some(before),
3081            after: self.after, 
3082        }
3083    }
3084
3085    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3086    pub fn after(self, after: &'req str) -> Self {
3087        Self {
3088            per_page: self.per_page, 
3089            before: self.before, 
3090            after: Some(after),
3091        }
3092    }
3093}
3094
3095/// Query parameters for the [List users blocked by an organization](Orgs::list_blocked_users_async()) endpoint.
3096#[derive(Default, Serialize)]
3097pub struct OrgsListBlockedUsersParams {
3098    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3099    per_page: Option<u16>, 
3100    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3101    page: Option<u16>
3102}
3103
3104impl OrgsListBlockedUsersParams {
3105    pub fn new() -> Self {
3106        Self::default()
3107    }
3108
3109    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3110    pub fn per_page(self, per_page: u16) -> Self {
3111        Self {
3112            per_page: Some(per_page),
3113            page: self.page, 
3114        }
3115    }
3116
3117    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3118    pub fn page(self, page: u16) -> Self {
3119        Self {
3120            per_page: self.per_page, 
3121            page: Some(page),
3122        }
3123    }
3124}
3125
3126impl<'enc> From<&'enc PerPage> for OrgsListBlockedUsersParams {
3127    fn from(per_page: &'enc PerPage) -> Self {
3128        Self {
3129            per_page: Some(per_page.per_page),
3130            page: Some(per_page.page),
3131            ..Default::default()
3132        }
3133    }
3134}
3135/// Query parameters for the [List custom property values for organization repositories](Orgs::list_custom_properties_values_for_repos_async()) endpoint.
3136#[derive(Default, Serialize)]
3137pub struct OrgsListCustomPropertiesValuesForReposParams<'req> {
3138    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3139    per_page: Option<u16>, 
3140    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3141    page: Option<u16>, 
3142    /// Finds repositories in the organization with a query containing one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See \"[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)\" for a detailed list of qualifiers.
3143    repository_query: Option<&'req str>
3144}
3145
3146impl<'req> OrgsListCustomPropertiesValuesForReposParams<'req> {
3147    pub fn new() -> Self {
3148        Self::default()
3149    }
3150
3151    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3152    pub fn per_page(self, per_page: u16) -> Self {
3153        Self {
3154            per_page: Some(per_page),
3155            page: self.page, 
3156            repository_query: self.repository_query, 
3157        }
3158    }
3159
3160    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3161    pub fn page(self, page: u16) -> Self {
3162        Self {
3163            per_page: self.per_page, 
3164            page: Some(page),
3165            repository_query: self.repository_query, 
3166        }
3167    }
3168
3169    /// Finds repositories in the organization with a query containing one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See \"[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)\" for a detailed list of qualifiers.
3170    pub fn repository_query(self, repository_query: &'req str) -> Self {
3171        Self {
3172            per_page: self.per_page, 
3173            page: self.page, 
3174            repository_query: Some(repository_query),
3175        }
3176    }
3177}
3178
3179impl<'enc> From<&'enc PerPage> for OrgsListCustomPropertiesValuesForReposParams<'enc> {
3180    fn from(per_page: &'enc PerPage) -> Self {
3181        Self {
3182            per_page: Some(per_page.per_page),
3183            page: Some(per_page.page),
3184            ..Default::default()
3185        }
3186    }
3187}
3188/// Query parameters for the [List failed organization invitations](Orgs::list_failed_invitations_async()) endpoint.
3189#[derive(Default, Serialize)]
3190pub struct OrgsListFailedInvitationsParams {
3191    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3192    per_page: Option<u16>, 
3193    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3194    page: Option<u16>
3195}
3196
3197impl OrgsListFailedInvitationsParams {
3198    pub fn new() -> Self {
3199        Self::default()
3200    }
3201
3202    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3203    pub fn per_page(self, per_page: u16) -> Self {
3204        Self {
3205            per_page: Some(per_page),
3206            page: self.page, 
3207        }
3208    }
3209
3210    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3211    pub fn page(self, page: u16) -> Self {
3212        Self {
3213            per_page: self.per_page, 
3214            page: Some(page),
3215        }
3216    }
3217}
3218
3219impl<'enc> From<&'enc PerPage> for OrgsListFailedInvitationsParams {
3220    fn from(per_page: &'enc PerPage) -> Self {
3221        Self {
3222            per_page: Some(per_page.per_page),
3223            page: Some(per_page.page),
3224            ..Default::default()
3225        }
3226    }
3227}
3228/// Query parameters for the [List organizations for the authenticated user](Orgs::list_for_authenticated_user_async()) endpoint.
3229#[derive(Default, Serialize)]
3230pub struct OrgsListForAuthenticatedUserParams {
3231    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3232    per_page: Option<u16>, 
3233    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3234    page: Option<u16>
3235}
3236
3237impl OrgsListForAuthenticatedUserParams {
3238    pub fn new() -> Self {
3239        Self::default()
3240    }
3241
3242    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3243    pub fn per_page(self, per_page: u16) -> Self {
3244        Self {
3245            per_page: Some(per_page),
3246            page: self.page, 
3247        }
3248    }
3249
3250    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3251    pub fn page(self, page: u16) -> Self {
3252        Self {
3253            per_page: self.per_page, 
3254            page: Some(page),
3255        }
3256    }
3257}
3258
3259impl<'enc> From<&'enc PerPage> for OrgsListForAuthenticatedUserParams {
3260    fn from(per_page: &'enc PerPage) -> Self {
3261        Self {
3262            per_page: Some(per_page.per_page),
3263            page: Some(per_page.page),
3264            ..Default::default()
3265        }
3266    }
3267}
3268/// Query parameters for the [List organizations for a user](Orgs::list_for_user_async()) endpoint.
3269#[derive(Default, Serialize)]
3270pub struct OrgsListForUserParams {
3271    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3272    per_page: Option<u16>, 
3273    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3274    page: Option<u16>
3275}
3276
3277impl OrgsListForUserParams {
3278    pub fn new() -> Self {
3279        Self::default()
3280    }
3281
3282    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3283    pub fn per_page(self, per_page: u16) -> Self {
3284        Self {
3285            per_page: Some(per_page),
3286            page: self.page, 
3287        }
3288    }
3289
3290    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3291    pub fn page(self, page: u16) -> Self {
3292        Self {
3293            per_page: self.per_page, 
3294            page: Some(page),
3295        }
3296    }
3297}
3298
3299impl<'enc> From<&'enc PerPage> for OrgsListForUserParams {
3300    fn from(per_page: &'enc PerPage) -> Self {
3301        Self {
3302            per_page: Some(per_page.per_page),
3303            page: Some(per_page.page),
3304            ..Default::default()
3305        }
3306    }
3307}
3308/// Query parameters for the [List organization invitation teams](Orgs::list_invitation_teams_async()) endpoint.
3309#[derive(Default, Serialize)]
3310pub struct OrgsListInvitationTeamsParams {
3311    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3312    per_page: Option<u16>, 
3313    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3314    page: Option<u16>
3315}
3316
3317impl OrgsListInvitationTeamsParams {
3318    pub fn new() -> Self {
3319        Self::default()
3320    }
3321
3322    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3323    pub fn per_page(self, per_page: u16) -> Self {
3324        Self {
3325            per_page: Some(per_page),
3326            page: self.page, 
3327        }
3328    }
3329
3330    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3331    pub fn page(self, page: u16) -> Self {
3332        Self {
3333            per_page: self.per_page, 
3334            page: Some(page),
3335        }
3336    }
3337}
3338
3339impl<'enc> From<&'enc PerPage> for OrgsListInvitationTeamsParams {
3340    fn from(per_page: &'enc PerPage) -> Self {
3341        Self {
3342            per_page: Some(per_page.per_page),
3343            page: Some(per_page.page),
3344            ..Default::default()
3345        }
3346    }
3347}
3348/// Query parameters for the [List organization members](Orgs::list_members_async()) endpoint.
3349#[derive(Default, Serialize)]
3350pub struct OrgsListMembersParams<'req> {
3351    /// Filter members returned in the list. `2fa_disabled` means that only members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. `2fa_insecure` means that only members with [insecure 2FA methods](https://docs.github.com/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/requiring-two-factor-authentication-in-your-organization#requiring-secure-methods-of-two-factor-authentication-in-your-organization) will be returned. These options are only available for organization owners.
3352    filter: Option<&'req str>, 
3353    /// Filter members returned by their role.
3354    role: Option<&'req str>, 
3355    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3356    per_page: Option<u16>, 
3357    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3358    page: Option<u16>
3359}
3360
3361impl<'req> OrgsListMembersParams<'req> {
3362    pub fn new() -> Self {
3363        Self::default()
3364    }
3365
3366    /// Filter members returned in the list. `2fa_disabled` means that only members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. `2fa_insecure` means that only members with [insecure 2FA methods](https://docs.github.com/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/requiring-two-factor-authentication-in-your-organization#requiring-secure-methods-of-two-factor-authentication-in-your-organization) will be returned. These options are only available for organization owners.
3367    pub fn filter(self, filter: &'req str) -> Self {
3368        Self {
3369            filter: Some(filter),
3370            role: self.role, 
3371            per_page: self.per_page, 
3372            page: self.page, 
3373        }
3374    }
3375
3376    /// Filter members returned by their role.
3377    pub fn role(self, role: &'req str) -> Self {
3378        Self {
3379            filter: self.filter, 
3380            role: Some(role),
3381            per_page: self.per_page, 
3382            page: self.page, 
3383        }
3384    }
3385
3386    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3387    pub fn per_page(self, per_page: u16) -> Self {
3388        Self {
3389            filter: self.filter, 
3390            role: self.role, 
3391            per_page: Some(per_page),
3392            page: self.page, 
3393        }
3394    }
3395
3396    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3397    pub fn page(self, page: u16) -> Self {
3398        Self {
3399            filter: self.filter, 
3400            role: self.role, 
3401            per_page: self.per_page, 
3402            page: Some(page),
3403        }
3404    }
3405}
3406
3407impl<'enc> From<&'enc PerPage> for OrgsListMembersParams<'enc> {
3408    fn from(per_page: &'enc PerPage) -> Self {
3409        Self {
3410            per_page: Some(per_page.per_page),
3411            page: Some(per_page.page),
3412            ..Default::default()
3413        }
3414    }
3415}
3416/// Query parameters for the [List organization memberships for the authenticated user](Orgs::list_memberships_for_authenticated_user_async()) endpoint.
3417#[derive(Default, Serialize)]
3418pub struct OrgsListMembershipsForAuthenticatedUserParams<'req> {
3419    /// Indicates the state of the memberships to return. If not specified, the API returns both active and pending memberships.
3420    state: Option<&'req str>, 
3421    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3422    per_page: Option<u16>, 
3423    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3424    page: Option<u16>
3425}
3426
3427impl<'req> OrgsListMembershipsForAuthenticatedUserParams<'req> {
3428    pub fn new() -> Self {
3429        Self::default()
3430    }
3431
3432    /// Indicates the state of the memberships to return. If not specified, the API returns both active and pending memberships.
3433    pub fn state(self, state: &'req str) -> Self {
3434        Self {
3435            state: Some(state),
3436            per_page: self.per_page, 
3437            page: self.page, 
3438        }
3439    }
3440
3441    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3442    pub fn per_page(self, per_page: u16) -> Self {
3443        Self {
3444            state: self.state, 
3445            per_page: Some(per_page),
3446            page: self.page, 
3447        }
3448    }
3449
3450    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3451    pub fn page(self, page: u16) -> Self {
3452        Self {
3453            state: self.state, 
3454            per_page: self.per_page, 
3455            page: Some(page),
3456        }
3457    }
3458}
3459
3460impl<'enc> From<&'enc PerPage> for OrgsListMembershipsForAuthenticatedUserParams<'enc> {
3461    fn from(per_page: &'enc PerPage) -> Self {
3462        Self {
3463            per_page: Some(per_page.per_page),
3464            page: Some(per_page.page),
3465            ..Default::default()
3466        }
3467    }
3468}
3469/// Query parameters for the [List teams that are assigned to an organization role](Orgs::list_org_role_teams_async()) endpoint.
3470#[derive(Default, Serialize)]
3471pub struct OrgsListOrgRoleTeamsParams {
3472    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3473    per_page: Option<u16>, 
3474    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3475    page: Option<u16>
3476}
3477
3478impl OrgsListOrgRoleTeamsParams {
3479    pub fn new() -> Self {
3480        Self::default()
3481    }
3482
3483    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3484    pub fn per_page(self, per_page: u16) -> Self {
3485        Self {
3486            per_page: Some(per_page),
3487            page: self.page, 
3488        }
3489    }
3490
3491    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3492    pub fn page(self, page: u16) -> Self {
3493        Self {
3494            per_page: self.per_page, 
3495            page: Some(page),
3496        }
3497    }
3498}
3499
3500impl<'enc> From<&'enc PerPage> for OrgsListOrgRoleTeamsParams {
3501    fn from(per_page: &'enc PerPage) -> Self {
3502        Self {
3503            per_page: Some(per_page.per_page),
3504            page: Some(per_page.page),
3505            ..Default::default()
3506        }
3507    }
3508}
3509/// Query parameters for the [List users that are assigned to an organization role](Orgs::list_org_role_users_async()) endpoint.
3510#[derive(Default, Serialize)]
3511pub struct OrgsListOrgRoleUsersParams {
3512    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3513    per_page: Option<u16>, 
3514    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3515    page: Option<u16>
3516}
3517
3518impl OrgsListOrgRoleUsersParams {
3519    pub fn new() -> Self {
3520        Self::default()
3521    }
3522
3523    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3524    pub fn per_page(self, per_page: u16) -> Self {
3525        Self {
3526            per_page: Some(per_page),
3527            page: self.page, 
3528        }
3529    }
3530
3531    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3532    pub fn page(self, page: u16) -> Self {
3533        Self {
3534            per_page: self.per_page, 
3535            page: Some(page),
3536        }
3537    }
3538}
3539
3540impl<'enc> From<&'enc PerPage> for OrgsListOrgRoleUsersParams {
3541    fn from(per_page: &'enc PerPage) -> Self {
3542        Self {
3543            per_page: Some(per_page.per_page),
3544            page: Some(per_page.page),
3545            ..Default::default()
3546        }
3547    }
3548}
3549/// Query parameters for the [List outside collaborators for an organization](Orgs::list_outside_collaborators_async()) endpoint.
3550#[derive(Default, Serialize)]
3551pub struct OrgsListOutsideCollaboratorsParams<'req> {
3552    /// Filter the list of outside collaborators. `2fa_disabled` means that only outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. `2fa_insecure` means that only outside collaborators with [insecure 2FA methods](https://docs.github.com/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/requiring-two-factor-authentication-in-your-organization#requiring-secure-methods-of-two-factor-authentication-in-your-organization) will be returned.
3553    filter: Option<&'req str>, 
3554    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3555    per_page: Option<u16>, 
3556    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3557    page: Option<u16>
3558}
3559
3560impl<'req> OrgsListOutsideCollaboratorsParams<'req> {
3561    pub fn new() -> Self {
3562        Self::default()
3563    }
3564
3565    /// Filter the list of outside collaborators. `2fa_disabled` means that only outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. `2fa_insecure` means that only outside collaborators with [insecure 2FA methods](https://docs.github.com/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/requiring-two-factor-authentication-in-your-organization#requiring-secure-methods-of-two-factor-authentication-in-your-organization) will be returned.
3566    pub fn filter(self, filter: &'req str) -> Self {
3567        Self {
3568            filter: Some(filter),
3569            per_page: self.per_page, 
3570            page: self.page, 
3571        }
3572    }
3573
3574    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3575    pub fn per_page(self, per_page: u16) -> Self {
3576        Self {
3577            filter: self.filter, 
3578            per_page: Some(per_page),
3579            page: self.page, 
3580        }
3581    }
3582
3583    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3584    pub fn page(self, page: u16) -> Self {
3585        Self {
3586            filter: self.filter, 
3587            per_page: self.per_page, 
3588            page: Some(page),
3589        }
3590    }
3591}
3592
3593impl<'enc> From<&'enc PerPage> for OrgsListOutsideCollaboratorsParams<'enc> {
3594    fn from(per_page: &'enc PerPage) -> Self {
3595        Self {
3596            per_page: Some(per_page.per_page),
3597            page: Some(per_page.page),
3598            ..Default::default()
3599        }
3600    }
3601}
3602/// Query parameters for the [List repositories a fine-grained personal access token has access to](Orgs::list_pat_grant_repositories_async()) endpoint.
3603#[derive(Default, Serialize)]
3604pub struct OrgsListPatGrantRepositoriesParams {
3605    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3606    per_page: Option<u16>, 
3607    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3608    page: Option<u16>
3609}
3610
3611impl OrgsListPatGrantRepositoriesParams {
3612    pub fn new() -> Self {
3613        Self::default()
3614    }
3615
3616    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3617    pub fn per_page(self, per_page: u16) -> Self {
3618        Self {
3619            per_page: Some(per_page),
3620            page: self.page, 
3621        }
3622    }
3623
3624    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3625    pub fn page(self, page: u16) -> Self {
3626        Self {
3627            per_page: self.per_page, 
3628            page: Some(page),
3629        }
3630    }
3631}
3632
3633impl<'enc> From<&'enc PerPage> for OrgsListPatGrantRepositoriesParams {
3634    fn from(per_page: &'enc PerPage) -> Self {
3635        Self {
3636            per_page: Some(per_page.per_page),
3637            page: Some(per_page.page),
3638            ..Default::default()
3639        }
3640    }
3641}
3642/// Query parameters for the [List repositories requested to be accessed by a fine-grained personal access token](Orgs::list_pat_grant_request_repositories_async()) endpoint.
3643#[derive(Default, Serialize)]
3644pub struct OrgsListPatGrantRequestRepositoriesParams {
3645    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3646    per_page: Option<u16>, 
3647    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3648    page: Option<u16>
3649}
3650
3651impl OrgsListPatGrantRequestRepositoriesParams {
3652    pub fn new() -> Self {
3653        Self::default()
3654    }
3655
3656    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3657    pub fn per_page(self, per_page: u16) -> Self {
3658        Self {
3659            per_page: Some(per_page),
3660            page: self.page, 
3661        }
3662    }
3663
3664    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3665    pub fn page(self, page: u16) -> Self {
3666        Self {
3667            per_page: self.per_page, 
3668            page: Some(page),
3669        }
3670    }
3671}
3672
3673impl<'enc> From<&'enc PerPage> for OrgsListPatGrantRequestRepositoriesParams {
3674    fn from(per_page: &'enc PerPage) -> Self {
3675        Self {
3676            per_page: Some(per_page.per_page),
3677            page: Some(per_page.page),
3678            ..Default::default()
3679        }
3680    }
3681}
3682/// Query parameters for the [List requests to access organization resources with fine-grained personal access tokens](Orgs::list_pat_grant_requests_async()) endpoint.
3683#[derive(Default, Serialize)]
3684pub struct OrgsListPatGrantRequestsParams<'req> {
3685    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3686    per_page: Option<u16>, 
3687    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3688    page: Option<u16>, 
3689    /// The property by which to sort the results.
3690    sort: Option<&'req str>, 
3691    /// The direction to sort the results by.
3692    direction: Option<&'req str>, 
3693    /// A list of owner usernames to use to filter the results.
3694    owner: Option<Vec<String>>, 
3695    /// The name of the repository to use to filter the results.
3696    repository: Option<&'req str>, 
3697    /// The permission to use to filter the results.
3698    permission: Option<&'req str>, 
3699    /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
3700    last_used_before: Option<chrono::DateTime<chrono::Utc>>, 
3701    /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
3702    last_used_after: Option<chrono::DateTime<chrono::Utc>>, 
3703    /// The ID of the token
3704    token_id: Option<Vec<String>>
3705}
3706
3707impl<'req> OrgsListPatGrantRequestsParams<'req> {
3708    pub fn new() -> Self {
3709        Self::default()
3710    }
3711
3712    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3713    pub fn per_page(self, per_page: u16) -> Self {
3714        Self {
3715            per_page: Some(per_page),
3716            page: self.page, 
3717            sort: self.sort, 
3718            direction: self.direction, 
3719            owner: self.owner, 
3720            repository: self.repository, 
3721            permission: self.permission, 
3722            last_used_before: self.last_used_before, 
3723            last_used_after: self.last_used_after, 
3724            token_id: self.token_id, 
3725        }
3726    }
3727
3728    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3729    pub fn page(self, page: u16) -> Self {
3730        Self {
3731            per_page: self.per_page, 
3732            page: Some(page),
3733            sort: self.sort, 
3734            direction: self.direction, 
3735            owner: self.owner, 
3736            repository: self.repository, 
3737            permission: self.permission, 
3738            last_used_before: self.last_used_before, 
3739            last_used_after: self.last_used_after, 
3740            token_id: self.token_id, 
3741        }
3742    }
3743
3744    /// The property by which to sort the results.
3745    pub fn sort(self, sort: &'req str) -> Self {
3746        Self {
3747            per_page: self.per_page, 
3748            page: self.page, 
3749            sort: Some(sort),
3750            direction: self.direction, 
3751            owner: self.owner, 
3752            repository: self.repository, 
3753            permission: self.permission, 
3754            last_used_before: self.last_used_before, 
3755            last_used_after: self.last_used_after, 
3756            token_id: self.token_id, 
3757        }
3758    }
3759
3760    /// The direction to sort the results by.
3761    pub fn direction(self, direction: &'req str) -> Self {
3762        Self {
3763            per_page: self.per_page, 
3764            page: self.page, 
3765            sort: self.sort, 
3766            direction: Some(direction),
3767            owner: self.owner, 
3768            repository: self.repository, 
3769            permission: self.permission, 
3770            last_used_before: self.last_used_before, 
3771            last_used_after: self.last_used_after, 
3772            token_id: self.token_id, 
3773        }
3774    }
3775
3776    /// A list of owner usernames to use to filter the results.
3777    pub fn owner(self, owner: Vec<String>) -> Self {
3778        Self {
3779            per_page: self.per_page, 
3780            page: self.page, 
3781            sort: self.sort, 
3782            direction: self.direction, 
3783            owner: Some(owner),
3784            repository: self.repository, 
3785            permission: self.permission, 
3786            last_used_before: self.last_used_before, 
3787            last_used_after: self.last_used_after, 
3788            token_id: self.token_id, 
3789        }
3790    }
3791
3792    /// The name of the repository to use to filter the results.
3793    pub fn repository(self, repository: &'req str) -> Self {
3794        Self {
3795            per_page: self.per_page, 
3796            page: self.page, 
3797            sort: self.sort, 
3798            direction: self.direction, 
3799            owner: self.owner, 
3800            repository: Some(repository),
3801            permission: self.permission, 
3802            last_used_before: self.last_used_before, 
3803            last_used_after: self.last_used_after, 
3804            token_id: self.token_id, 
3805        }
3806    }
3807
3808    /// The permission to use to filter the results.
3809    pub fn permission(self, permission: &'req str) -> Self {
3810        Self {
3811            per_page: self.per_page, 
3812            page: self.page, 
3813            sort: self.sort, 
3814            direction: self.direction, 
3815            owner: self.owner, 
3816            repository: self.repository, 
3817            permission: Some(permission),
3818            last_used_before: self.last_used_before, 
3819            last_used_after: self.last_used_after, 
3820            token_id: self.token_id, 
3821        }
3822    }
3823
3824    /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
3825    pub fn last_used_before(self, last_used_before: chrono::DateTime<chrono::Utc>) -> Self {
3826        Self {
3827            per_page: self.per_page, 
3828            page: self.page, 
3829            sort: self.sort, 
3830            direction: self.direction, 
3831            owner: self.owner, 
3832            repository: self.repository, 
3833            permission: self.permission, 
3834            last_used_before: Some(last_used_before),
3835            last_used_after: self.last_used_after, 
3836            token_id: self.token_id, 
3837        }
3838    }
3839
3840    /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
3841    pub fn last_used_after(self, last_used_after: chrono::DateTime<chrono::Utc>) -> Self {
3842        Self {
3843            per_page: self.per_page, 
3844            page: self.page, 
3845            sort: self.sort, 
3846            direction: self.direction, 
3847            owner: self.owner, 
3848            repository: self.repository, 
3849            permission: self.permission, 
3850            last_used_before: self.last_used_before, 
3851            last_used_after: Some(last_used_after),
3852            token_id: self.token_id, 
3853        }
3854    }
3855
3856    /// The ID of the token
3857    pub fn token_id(self, token_id: Vec<String>) -> Self {
3858        Self {
3859            per_page: self.per_page, 
3860            page: self.page, 
3861            sort: self.sort, 
3862            direction: self.direction, 
3863            owner: self.owner, 
3864            repository: self.repository, 
3865            permission: self.permission, 
3866            last_used_before: self.last_used_before, 
3867            last_used_after: self.last_used_after, 
3868            token_id: Some(token_id),
3869        }
3870    }
3871}
3872
3873impl<'enc> From<&'enc PerPage> for OrgsListPatGrantRequestsParams<'enc> {
3874    fn from(per_page: &'enc PerPage) -> Self {
3875        Self {
3876            per_page: Some(per_page.per_page),
3877            page: Some(per_page.page),
3878            ..Default::default()
3879        }
3880    }
3881}
3882/// Query parameters for the [List fine-grained personal access tokens with access to organization resources](Orgs::list_pat_grants_async()) endpoint.
3883#[derive(Default, Serialize)]
3884pub struct OrgsListPatGrantsParams<'req> {
3885    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3886    per_page: Option<u16>, 
3887    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3888    page: Option<u16>, 
3889    /// The property by which to sort the results.
3890    sort: Option<&'req str>, 
3891    /// The direction to sort the results by.
3892    direction: Option<&'req str>, 
3893    /// A list of owner usernames to use to filter the results.
3894    owner: Option<Vec<String>>, 
3895    /// The name of the repository to use to filter the results.
3896    repository: Option<&'req str>, 
3897    /// The permission to use to filter the results.
3898    permission: Option<&'req str>, 
3899    /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
3900    last_used_before: Option<chrono::DateTime<chrono::Utc>>, 
3901    /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
3902    last_used_after: Option<chrono::DateTime<chrono::Utc>>, 
3903    /// The ID of the token
3904    token_id: Option<Vec<String>>
3905}
3906
3907impl<'req> OrgsListPatGrantsParams<'req> {
3908    pub fn new() -> Self {
3909        Self::default()
3910    }
3911
3912    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3913    pub fn per_page(self, per_page: u16) -> Self {
3914        Self {
3915            per_page: Some(per_page),
3916            page: self.page, 
3917            sort: self.sort, 
3918            direction: self.direction, 
3919            owner: self.owner, 
3920            repository: self.repository, 
3921            permission: self.permission, 
3922            last_used_before: self.last_used_before, 
3923            last_used_after: self.last_used_after, 
3924            token_id: self.token_id, 
3925        }
3926    }
3927
3928    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
3929    pub fn page(self, page: u16) -> Self {
3930        Self {
3931            per_page: self.per_page, 
3932            page: Some(page),
3933            sort: self.sort, 
3934            direction: self.direction, 
3935            owner: self.owner, 
3936            repository: self.repository, 
3937            permission: self.permission, 
3938            last_used_before: self.last_used_before, 
3939            last_used_after: self.last_used_after, 
3940            token_id: self.token_id, 
3941        }
3942    }
3943
3944    /// The property by which to sort the results.
3945    pub fn sort(self, sort: &'req str) -> Self {
3946        Self {
3947            per_page: self.per_page, 
3948            page: self.page, 
3949            sort: Some(sort),
3950            direction: self.direction, 
3951            owner: self.owner, 
3952            repository: self.repository, 
3953            permission: self.permission, 
3954            last_used_before: self.last_used_before, 
3955            last_used_after: self.last_used_after, 
3956            token_id: self.token_id, 
3957        }
3958    }
3959
3960    /// The direction to sort the results by.
3961    pub fn direction(self, direction: &'req str) -> Self {
3962        Self {
3963            per_page: self.per_page, 
3964            page: self.page, 
3965            sort: self.sort, 
3966            direction: Some(direction),
3967            owner: self.owner, 
3968            repository: self.repository, 
3969            permission: self.permission, 
3970            last_used_before: self.last_used_before, 
3971            last_used_after: self.last_used_after, 
3972            token_id: self.token_id, 
3973        }
3974    }
3975
3976    /// A list of owner usernames to use to filter the results.
3977    pub fn owner(self, owner: Vec<String>) -> Self {
3978        Self {
3979            per_page: self.per_page, 
3980            page: self.page, 
3981            sort: self.sort, 
3982            direction: self.direction, 
3983            owner: Some(owner),
3984            repository: self.repository, 
3985            permission: self.permission, 
3986            last_used_before: self.last_used_before, 
3987            last_used_after: self.last_used_after, 
3988            token_id: self.token_id, 
3989        }
3990    }
3991
3992    /// The name of the repository to use to filter the results.
3993    pub fn repository(self, repository: &'req str) -> Self {
3994        Self {
3995            per_page: self.per_page, 
3996            page: self.page, 
3997            sort: self.sort, 
3998            direction: self.direction, 
3999            owner: self.owner, 
4000            repository: Some(repository),
4001            permission: self.permission, 
4002            last_used_before: self.last_used_before, 
4003            last_used_after: self.last_used_after, 
4004            token_id: self.token_id, 
4005        }
4006    }
4007
4008    /// The permission to use to filter the results.
4009    pub fn permission(self, permission: &'req str) -> Self {
4010        Self {
4011            per_page: self.per_page, 
4012            page: self.page, 
4013            sort: self.sort, 
4014            direction: self.direction, 
4015            owner: self.owner, 
4016            repository: self.repository, 
4017            permission: Some(permission),
4018            last_used_before: self.last_used_before, 
4019            last_used_after: self.last_used_after, 
4020            token_id: self.token_id, 
4021        }
4022    }
4023
4024    /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
4025    pub fn last_used_before(self, last_used_before: chrono::DateTime<chrono::Utc>) -> Self {
4026        Self {
4027            per_page: self.per_page, 
4028            page: self.page, 
4029            sort: self.sort, 
4030            direction: self.direction, 
4031            owner: self.owner, 
4032            repository: self.repository, 
4033            permission: self.permission, 
4034            last_used_before: Some(last_used_before),
4035            last_used_after: self.last_used_after, 
4036            token_id: self.token_id, 
4037        }
4038    }
4039
4040    /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
4041    pub fn last_used_after(self, last_used_after: chrono::DateTime<chrono::Utc>) -> Self {
4042        Self {
4043            per_page: self.per_page, 
4044            page: self.page, 
4045            sort: self.sort, 
4046            direction: self.direction, 
4047            owner: self.owner, 
4048            repository: self.repository, 
4049            permission: self.permission, 
4050            last_used_before: self.last_used_before, 
4051            last_used_after: Some(last_used_after),
4052            token_id: self.token_id, 
4053        }
4054    }
4055
4056    /// The ID of the token
4057    pub fn token_id(self, token_id: Vec<String>) -> Self {
4058        Self {
4059            per_page: self.per_page, 
4060            page: self.page, 
4061            sort: self.sort, 
4062            direction: self.direction, 
4063            owner: self.owner, 
4064            repository: self.repository, 
4065            permission: self.permission, 
4066            last_used_before: self.last_used_before, 
4067            last_used_after: self.last_used_after, 
4068            token_id: Some(token_id),
4069        }
4070    }
4071}
4072
4073impl<'enc> From<&'enc PerPage> for OrgsListPatGrantsParams<'enc> {
4074    fn from(per_page: &'enc PerPage) -> Self {
4075        Self {
4076            per_page: Some(per_page.per_page),
4077            page: Some(per_page.page),
4078            ..Default::default()
4079        }
4080    }
4081}
4082/// Query parameters for the [List pending organization invitations](Orgs::list_pending_invitations_async()) endpoint.
4083#[derive(Default, Serialize)]
4084pub struct OrgsListPendingInvitationsParams<'req> {
4085    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
4086    per_page: Option<u16>, 
4087    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
4088    page: Option<u16>, 
4089    /// Filter invitations by their member role.
4090    role: Option<&'req str>, 
4091    /// Filter invitations by their invitation source.
4092    invitation_source: Option<&'req str>
4093}
4094
4095impl<'req> OrgsListPendingInvitationsParams<'req> {
4096    pub fn new() -> Self {
4097        Self::default()
4098    }
4099
4100    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
4101    pub fn per_page(self, per_page: u16) -> Self {
4102        Self {
4103            per_page: Some(per_page),
4104            page: self.page, 
4105            role: self.role, 
4106            invitation_source: self.invitation_source, 
4107        }
4108    }
4109
4110    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
4111    pub fn page(self, page: u16) -> Self {
4112        Self {
4113            per_page: self.per_page, 
4114            page: Some(page),
4115            role: self.role, 
4116            invitation_source: self.invitation_source, 
4117        }
4118    }
4119
4120    /// Filter invitations by their member role.
4121    pub fn role(self, role: &'req str) -> Self {
4122        Self {
4123            per_page: self.per_page, 
4124            page: self.page, 
4125            role: Some(role),
4126            invitation_source: self.invitation_source, 
4127        }
4128    }
4129
4130    /// Filter invitations by their invitation source.
4131    pub fn invitation_source(self, invitation_source: &'req str) -> Self {
4132        Self {
4133            per_page: self.per_page, 
4134            page: self.page, 
4135            role: self.role, 
4136            invitation_source: Some(invitation_source),
4137        }
4138    }
4139}
4140
4141impl<'enc> From<&'enc PerPage> for OrgsListPendingInvitationsParams<'enc> {
4142    fn from(per_page: &'enc PerPage) -> Self {
4143        Self {
4144            per_page: Some(per_page.per_page),
4145            page: Some(per_page.page),
4146            ..Default::default()
4147        }
4148    }
4149}
4150/// Query parameters for the [List public organization members](Orgs::list_public_members_async()) endpoint.
4151#[derive(Default, Serialize)]
4152pub struct OrgsListPublicMembersParams {
4153    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
4154    per_page: Option<u16>, 
4155    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
4156    page: Option<u16>
4157}
4158
4159impl OrgsListPublicMembersParams {
4160    pub fn new() -> Self {
4161        Self::default()
4162    }
4163
4164    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
4165    pub fn per_page(self, per_page: u16) -> Self {
4166        Self {
4167            per_page: Some(per_page),
4168            page: self.page, 
4169        }
4170    }
4171
4172    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
4173    pub fn page(self, page: u16) -> Self {
4174        Self {
4175            per_page: self.per_page, 
4176            page: Some(page),
4177        }
4178    }
4179}
4180
4181impl<'enc> From<&'enc PerPage> for OrgsListPublicMembersParams {
4182    fn from(per_page: &'enc PerPage) -> Self {
4183        Self {
4184            per_page: Some(per_page.per_page),
4185            page: Some(per_page.page),
4186            ..Default::default()
4187        }
4188    }
4189}
4190/// Query parameters for the [List deliveries for an organization webhook](Orgs::list_webhook_deliveries_async()) endpoint.
4191#[derive(Default, Serialize)]
4192pub struct OrgsListWebhookDeliveriesParams<'req> {
4193    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
4194    per_page: Option<u16>, 
4195    /// Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors.
4196    cursor: Option<&'req str>
4197}
4198
4199impl<'req> OrgsListWebhookDeliveriesParams<'req> {
4200    pub fn new() -> Self {
4201        Self::default()
4202    }
4203
4204    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
4205    pub fn per_page(self, per_page: u16) -> Self {
4206        Self {
4207            per_page: Some(per_page),
4208            cursor: self.cursor, 
4209        }
4210    }
4211
4212    /// Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors.
4213    pub fn cursor(self, cursor: &'req str) -> Self {
4214        Self {
4215            per_page: self.per_page, 
4216            cursor: Some(cursor),
4217        }
4218    }
4219}
4220
4221/// Query parameters for the [List organization webhooks](Orgs::list_webhooks_async()) endpoint.
4222#[derive(Default, Serialize)]
4223pub struct OrgsListWebhooksParams {
4224    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
4225    per_page: Option<u16>, 
4226    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
4227    page: Option<u16>
4228}
4229
4230impl OrgsListWebhooksParams {
4231    pub fn new() -> Self {
4232        Self::default()
4233    }
4234
4235    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
4236    pub fn per_page(self, per_page: u16) -> Self {
4237        Self {
4238            per_page: Some(per_page),
4239            page: self.page, 
4240        }
4241    }
4242
4243    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
4244    pub fn page(self, page: u16) -> Self {
4245        Self {
4246            per_page: self.per_page, 
4247            page: Some(page),
4248        }
4249    }
4250}
4251
4252impl<'enc> From<&'enc PerPage> for OrgsListWebhooksParams {
4253    fn from(per_page: &'enc PerPage) -> Self {
4254        Self {
4255            per_page: Some(per_page.per_page),
4256            page: Some(per_page.page),
4257            ..Default::default()
4258        }
4259    }
4260}
4261
4262impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<<C as Client>::Err> {
4263    /// ---
4264    ///
4265    /// # Add a security manager team
4266    ///
4267    /// > [!WARNING]
4268    /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.
4269    ///
4270    /// [GitHub API docs for add_security_manager_team](https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team)
4271    ///
4272    /// ---
4273    pub async fn add_security_manager_team_async(&self, org: &str, team_slug: &str) -> Result<(), AdapterError> {
4274
4275        let request_uri = format!("{}/orgs/{}/security-managers/teams/{}", super::GITHUB_BASE_API_URL, org, team_slug);
4276
4277
4278        let req = GitHubRequest {
4279            uri: request_uri,
4280            body: None::<C::Body>,
4281            method: "PUT",
4282            headers: vec![]
4283        };
4284
4285        let request = self.client.build(req)?;
4286
4287        // --
4288
4289        let github_response = self.client.fetch_async(request).await?;
4290
4291        // --
4292
4293        if github_response.is_success() {
4294            Ok(())
4295        } else {
4296            match github_response.status_code() {
4297                code => Err(OrgsAddSecurityManagerTeamError::Generic { code }.into()),
4298            }
4299        }
4300    }
4301
4302    /// ---
4303    ///
4304    /// # Add a security manager team
4305    ///
4306    /// > [!WARNING]
4307    /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.
4308    ///
4309    /// [GitHub API docs for add_security_manager_team](https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team)
4310    ///
4311    /// ---
4312    #[cfg(not(target_arch = "wasm32"))]
4313    pub fn add_security_manager_team(&self, org: &str, team_slug: &str) -> Result<(), AdapterError> {
4314
4315        let request_uri = format!("{}/orgs/{}/security-managers/teams/{}", super::GITHUB_BASE_API_URL, org, team_slug);
4316
4317
4318        let req = GitHubRequest {
4319            uri: request_uri,
4320            body: None,
4321            method: "PUT",
4322            headers: vec![]
4323        };
4324
4325        let request = self.client.build(req)?;
4326
4327        // --
4328
4329        let github_response = self.client.fetch(request)?;
4330
4331        // --
4332
4333        if github_response.is_success() {
4334            Ok(())
4335        } else {
4336            match github_response.status_code() {
4337                code => Err(OrgsAddSecurityManagerTeamError::Generic { code }.into()),
4338            }
4339        }
4340    }
4341
4342    /// ---
4343    ///
4344    /// # Assign an organization role to a team
4345    ///
4346    /// Assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
4347    /// 
4348    /// The authenticated user must be an administrator for the organization to use this endpoint.
4349    /// 
4350    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
4351    ///
4352    /// [GitHub API docs for assign_team_to_org_role](https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team)
4353    ///
4354    /// ---
4355    pub async fn assign_team_to_org_role_async(&self, org: &str, team_slug: &str, role_id: i32) -> Result<(), AdapterError> {
4356
4357        let request_uri = format!("{}/orgs/{}/organization-roles/teams/{}/{}", super::GITHUB_BASE_API_URL, org, team_slug, role_id);
4358
4359
4360        let req = GitHubRequest {
4361            uri: request_uri,
4362            body: None::<C::Body>,
4363            method: "PUT",
4364            headers: vec![]
4365        };
4366
4367        let request = self.client.build(req)?;
4368
4369        // --
4370
4371        let github_response = self.client.fetch_async(request).await?;
4372
4373        // --
4374
4375        if github_response.is_success() {
4376            Ok(())
4377        } else {
4378            match github_response.status_code() {
4379                404 => Err(OrgsAssignTeamToOrgRoleError::Status404.into()),
4380                422 => Err(OrgsAssignTeamToOrgRoleError::Status422.into()),
4381                code => Err(OrgsAssignTeamToOrgRoleError::Generic { code }.into()),
4382            }
4383        }
4384    }
4385
4386    /// ---
4387    ///
4388    /// # Assign an organization role to a team
4389    ///
4390    /// Assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
4391    /// 
4392    /// The authenticated user must be an administrator for the organization to use this endpoint.
4393    /// 
4394    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
4395    ///
4396    /// [GitHub API docs for assign_team_to_org_role](https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team)
4397    ///
4398    /// ---
4399    #[cfg(not(target_arch = "wasm32"))]
4400    pub fn assign_team_to_org_role(&self, org: &str, team_slug: &str, role_id: i32) -> Result<(), AdapterError> {
4401
4402        let request_uri = format!("{}/orgs/{}/organization-roles/teams/{}/{}", super::GITHUB_BASE_API_URL, org, team_slug, role_id);
4403
4404
4405        let req = GitHubRequest {
4406            uri: request_uri,
4407            body: None,
4408            method: "PUT",
4409            headers: vec![]
4410        };
4411
4412        let request = self.client.build(req)?;
4413
4414        // --
4415
4416        let github_response = self.client.fetch(request)?;
4417
4418        // --
4419
4420        if github_response.is_success() {
4421            Ok(())
4422        } else {
4423            match github_response.status_code() {
4424                404 => Err(OrgsAssignTeamToOrgRoleError::Status404.into()),
4425                422 => Err(OrgsAssignTeamToOrgRoleError::Status422.into()),
4426                code => Err(OrgsAssignTeamToOrgRoleError::Generic { code }.into()),
4427            }
4428        }
4429    }
4430
4431    /// ---
4432    ///
4433    /// # Assign an organization role to a user
4434    ///
4435    /// Assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
4436    /// 
4437    /// The authenticated user must be an administrator for the organization to use this endpoint.
4438    /// 
4439    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
4440    ///
4441    /// [GitHub API docs for assign_user_to_org_role](https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user)
4442    ///
4443    /// ---
4444    pub async fn assign_user_to_org_role_async(&self, org: &str, username: &str, role_id: i32) -> Result<(), AdapterError> {
4445
4446        let request_uri = format!("{}/orgs/{}/organization-roles/users/{}/{}", super::GITHUB_BASE_API_URL, org, username, role_id);
4447
4448
4449        let req = GitHubRequest {
4450            uri: request_uri,
4451            body: None::<C::Body>,
4452            method: "PUT",
4453            headers: vec![]
4454        };
4455
4456        let request = self.client.build(req)?;
4457
4458        // --
4459
4460        let github_response = self.client.fetch_async(request).await?;
4461
4462        // --
4463
4464        if github_response.is_success() {
4465            Ok(())
4466        } else {
4467            match github_response.status_code() {
4468                404 => Err(OrgsAssignUserToOrgRoleError::Status404.into()),
4469                422 => Err(OrgsAssignUserToOrgRoleError::Status422.into()),
4470                code => Err(OrgsAssignUserToOrgRoleError::Generic { code }.into()),
4471            }
4472        }
4473    }
4474
4475    /// ---
4476    ///
4477    /// # Assign an organization role to a user
4478    ///
4479    /// Assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
4480    /// 
4481    /// The authenticated user must be an administrator for the organization to use this endpoint.
4482    /// 
4483    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
4484    ///
4485    /// [GitHub API docs for assign_user_to_org_role](https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user)
4486    ///
4487    /// ---
4488    #[cfg(not(target_arch = "wasm32"))]
4489    pub fn assign_user_to_org_role(&self, org: &str, username: &str, role_id: i32) -> Result<(), AdapterError> {
4490
4491        let request_uri = format!("{}/orgs/{}/organization-roles/users/{}/{}", super::GITHUB_BASE_API_URL, org, username, role_id);
4492
4493
4494        let req = GitHubRequest {
4495            uri: request_uri,
4496            body: None,
4497            method: "PUT",
4498            headers: vec![]
4499        };
4500
4501        let request = self.client.build(req)?;
4502
4503        // --
4504
4505        let github_response = self.client.fetch(request)?;
4506
4507        // --
4508
4509        if github_response.is_success() {
4510            Ok(())
4511        } else {
4512            match github_response.status_code() {
4513                404 => Err(OrgsAssignUserToOrgRoleError::Status404.into()),
4514                422 => Err(OrgsAssignUserToOrgRoleError::Status422.into()),
4515                code => Err(OrgsAssignUserToOrgRoleError::Generic { code }.into()),
4516            }
4517        }
4518    }
4519
4520    /// ---
4521    ///
4522    /// # Block a user from an organization
4523    ///
4524    /// Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned.
4525    ///
4526    /// [GitHub API docs for block_user](https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization)
4527    ///
4528    /// ---
4529    pub async fn block_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> {
4530
4531        let request_uri = format!("{}/orgs/{}/blocks/{}", super::GITHUB_BASE_API_URL, org, username);
4532
4533
4534        let req = GitHubRequest {
4535            uri: request_uri,
4536            body: None::<C::Body>,
4537            method: "PUT",
4538            headers: vec![]
4539        };
4540
4541        let request = self.client.build(req)?;
4542
4543        // --
4544
4545        let github_response = self.client.fetch_async(request).await?;
4546
4547        // --
4548
4549        if github_response.is_success() {
4550            Ok(())
4551        } else {
4552            match github_response.status_code() {
4553                422 => Err(OrgsBlockUserError::Status422(github_response.to_json_async().await?).into()),
4554                code => Err(OrgsBlockUserError::Generic { code }.into()),
4555            }
4556        }
4557    }
4558
4559    /// ---
4560    ///
4561    /// # Block a user from an organization
4562    ///
4563    /// Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned.
4564    ///
4565    /// [GitHub API docs for block_user](https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization)
4566    ///
4567    /// ---
4568    #[cfg(not(target_arch = "wasm32"))]
4569    pub fn block_user(&self, org: &str, username: &str) -> Result<(), AdapterError> {
4570
4571        let request_uri = format!("{}/orgs/{}/blocks/{}", super::GITHUB_BASE_API_URL, org, username);
4572
4573
4574        let req = GitHubRequest {
4575            uri: request_uri,
4576            body: None,
4577            method: "PUT",
4578            headers: vec![]
4579        };
4580
4581        let request = self.client.build(req)?;
4582
4583        // --
4584
4585        let github_response = self.client.fetch(request)?;
4586
4587        // --
4588
4589        if github_response.is_success() {
4590            Ok(())
4591        } else {
4592            match github_response.status_code() {
4593                422 => Err(OrgsBlockUserError::Status422(github_response.to_json()?).into()),
4594                code => Err(OrgsBlockUserError::Generic { code }.into()),
4595            }
4596        }
4597    }
4598
4599    /// ---
4600    ///
4601    /// # Cancel an organization invitation
4602    ///
4603    /// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.
4604    /// 
4605    /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications).
4606    ///
4607    /// [GitHub API docs for cancel_invitation](https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation)
4608    ///
4609    /// ---
4610    pub async fn cancel_invitation_async(&self, org: &str, invitation_id: i32) -> Result<(), AdapterError> {
4611
4612        let request_uri = format!("{}/orgs/{}/invitations/{}", super::GITHUB_BASE_API_URL, org, invitation_id);
4613
4614
4615        let req = GitHubRequest {
4616            uri: request_uri,
4617            body: None::<C::Body>,
4618            method: "DELETE",
4619            headers: vec![]
4620        };
4621
4622        let request = self.client.build(req)?;
4623
4624        // --
4625
4626        let github_response = self.client.fetch_async(request).await?;
4627
4628        // --
4629
4630        if github_response.is_success() {
4631            Ok(())
4632        } else {
4633            match github_response.status_code() {
4634                422 => Err(OrgsCancelInvitationError::Status422(github_response.to_json_async().await?).into()),
4635                404 => Err(OrgsCancelInvitationError::Status404(github_response.to_json_async().await?).into()),
4636                code => Err(OrgsCancelInvitationError::Generic { code }.into()),
4637            }
4638        }
4639    }
4640
4641    /// ---
4642    ///
4643    /// # Cancel an organization invitation
4644    ///
4645    /// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.
4646    /// 
4647    /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications).
4648    ///
4649    /// [GitHub API docs for cancel_invitation](https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation)
4650    ///
4651    /// ---
4652    #[cfg(not(target_arch = "wasm32"))]
4653    pub fn cancel_invitation(&self, org: &str, invitation_id: i32) -> Result<(), AdapterError> {
4654
4655        let request_uri = format!("{}/orgs/{}/invitations/{}", super::GITHUB_BASE_API_URL, org, invitation_id);
4656
4657
4658        let req = GitHubRequest {
4659            uri: request_uri,
4660            body: None,
4661            method: "DELETE",
4662            headers: vec![]
4663        };
4664
4665        let request = self.client.build(req)?;
4666
4667        // --
4668
4669        let github_response = self.client.fetch(request)?;
4670
4671        // --
4672
4673        if github_response.is_success() {
4674            Ok(())
4675        } else {
4676            match github_response.status_code() {
4677                422 => Err(OrgsCancelInvitationError::Status422(github_response.to_json()?).into()),
4678                404 => Err(OrgsCancelInvitationError::Status404(github_response.to_json()?).into()),
4679                code => Err(OrgsCancelInvitationError::Generic { code }.into()),
4680            }
4681        }
4682    }
4683
4684    /// ---
4685    ///
4686    /// # Check if a user is blocked by an organization
4687    ///
4688    /// Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub.
4689    ///
4690    /// [GitHub API docs for check_blocked_user](https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization)
4691    ///
4692    /// ---
4693    pub async fn check_blocked_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> {
4694
4695        let request_uri = format!("{}/orgs/{}/blocks/{}", super::GITHUB_BASE_API_URL, org, username);
4696
4697
4698        let req = GitHubRequest {
4699            uri: request_uri,
4700            body: None::<C::Body>,
4701            method: "GET",
4702            headers: vec![]
4703        };
4704
4705        let request = self.client.build(req)?;
4706
4707        // --
4708
4709        let github_response = self.client.fetch_async(request).await?;
4710
4711        // --
4712
4713        if github_response.is_success() {
4714            Ok(())
4715        } else {
4716            match github_response.status_code() {
4717                404 => Err(OrgsCheckBlockedUserError::Status404(github_response.to_json_async().await?).into()),
4718                code => Err(OrgsCheckBlockedUserError::Generic { code }.into()),
4719            }
4720        }
4721    }
4722
4723    /// ---
4724    ///
4725    /// # Check if a user is blocked by an organization
4726    ///
4727    /// Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub.
4728    ///
4729    /// [GitHub API docs for check_blocked_user](https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization)
4730    ///
4731    /// ---
4732    #[cfg(not(target_arch = "wasm32"))]
4733    pub fn check_blocked_user(&self, org: &str, username: &str) -> Result<(), AdapterError> {
4734
4735        let request_uri = format!("{}/orgs/{}/blocks/{}", super::GITHUB_BASE_API_URL, org, username);
4736
4737
4738        let req = GitHubRequest {
4739            uri: request_uri,
4740            body: None,
4741            method: "GET",
4742            headers: vec![]
4743        };
4744
4745        let request = self.client.build(req)?;
4746
4747        // --
4748
4749        let github_response = self.client.fetch(request)?;
4750
4751        // --
4752
4753        if github_response.is_success() {
4754            Ok(())
4755        } else {
4756            match github_response.status_code() {
4757                404 => Err(OrgsCheckBlockedUserError::Status404(github_response.to_json()?).into()),
4758                code => Err(OrgsCheckBlockedUserError::Generic { code }.into()),
4759            }
4760        }
4761    }
4762
4763    /// ---
4764    ///
4765    /// # Check organization membership for a user
4766    ///
4767    /// Check if a user is, publicly or privately, a member of the organization.
4768    ///
4769    /// [GitHub API docs for check_membership_for_user](https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user)
4770    ///
4771    /// ---
4772    pub async fn check_membership_for_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> {
4773
4774        let request_uri = format!("{}/orgs/{}/members/{}", super::GITHUB_BASE_API_URL, org, username);
4775
4776
4777        let req = GitHubRequest {
4778            uri: request_uri,
4779            body: None::<C::Body>,
4780            method: "GET",
4781            headers: vec![]
4782        };
4783
4784        let request = self.client.build(req)?;
4785
4786        // --
4787
4788        let github_response = self.client.fetch_async(request).await?;
4789
4790        // --
4791
4792        if github_response.is_success() {
4793            Ok(())
4794        } else {
4795            match github_response.status_code() {
4796                302 => Err(OrgsCheckMembershipForUserError::Status302.into()),
4797                404 => Err(OrgsCheckMembershipForUserError::Status404.into()),
4798                code => Err(OrgsCheckMembershipForUserError::Generic { code }.into()),
4799            }
4800        }
4801    }
4802
4803    /// ---
4804    ///
4805    /// # Check organization membership for a user
4806    ///
4807    /// Check if a user is, publicly or privately, a member of the organization.
4808    ///
4809    /// [GitHub API docs for check_membership_for_user](https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user)
4810    ///
4811    /// ---
4812    #[cfg(not(target_arch = "wasm32"))]
4813    pub fn check_membership_for_user(&self, org: &str, username: &str) -> Result<(), AdapterError> {
4814
4815        let request_uri = format!("{}/orgs/{}/members/{}", super::GITHUB_BASE_API_URL, org, username);
4816
4817
4818        let req = GitHubRequest {
4819            uri: request_uri,
4820            body: None,
4821            method: "GET",
4822            headers: vec![]
4823        };
4824
4825        let request = self.client.build(req)?;
4826
4827        // --
4828
4829        let github_response = self.client.fetch(request)?;
4830
4831        // --
4832
4833        if github_response.is_success() {
4834            Ok(())
4835        } else {
4836            match github_response.status_code() {
4837                302 => Err(OrgsCheckMembershipForUserError::Status302.into()),
4838                404 => Err(OrgsCheckMembershipForUserError::Status404.into()),
4839                code => Err(OrgsCheckMembershipForUserError::Generic { code }.into()),
4840            }
4841        }
4842    }
4843
4844    /// ---
4845    ///
4846    /// # Check public organization membership for a user
4847    ///
4848    /// Check if the provided user is a public member of the organization.
4849    ///
4850    /// [GitHub API docs for check_public_membership_for_user](https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user)
4851    ///
4852    /// ---
4853    pub async fn check_public_membership_for_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> {
4854
4855        let request_uri = format!("{}/orgs/{}/public_members/{}", super::GITHUB_BASE_API_URL, org, username);
4856
4857
4858        let req = GitHubRequest {
4859            uri: request_uri,
4860            body: None::<C::Body>,
4861            method: "GET",
4862            headers: vec![]
4863        };
4864
4865        let request = self.client.build(req)?;
4866
4867        // --
4868
4869        let github_response = self.client.fetch_async(request).await?;
4870
4871        // --
4872
4873        if github_response.is_success() {
4874            Ok(())
4875        } else {
4876            match github_response.status_code() {
4877                404 => Err(OrgsCheckPublicMembershipForUserError::Status404.into()),
4878                code => Err(OrgsCheckPublicMembershipForUserError::Generic { code }.into()),
4879            }
4880        }
4881    }
4882
4883    /// ---
4884    ///
4885    /// # Check public organization membership for a user
4886    ///
4887    /// Check if the provided user is a public member of the organization.
4888    ///
4889    /// [GitHub API docs for check_public_membership_for_user](https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user)
4890    ///
4891    /// ---
4892    #[cfg(not(target_arch = "wasm32"))]
4893    pub fn check_public_membership_for_user(&self, org: &str, username: &str) -> Result<(), AdapterError> {
4894
4895        let request_uri = format!("{}/orgs/{}/public_members/{}", super::GITHUB_BASE_API_URL, org, username);
4896
4897
4898        let req = GitHubRequest {
4899            uri: request_uri,
4900            body: None,
4901            method: "GET",
4902            headers: vec![]
4903        };
4904
4905        let request = self.client.build(req)?;
4906
4907        // --
4908
4909        let github_response = self.client.fetch(request)?;
4910
4911        // --
4912
4913        if github_response.is_success() {
4914            Ok(())
4915        } else {
4916            match github_response.status_code() {
4917                404 => Err(OrgsCheckPublicMembershipForUserError::Status404.into()),
4918                code => Err(OrgsCheckPublicMembershipForUserError::Generic { code }.into()),
4919            }
4920        }
4921    }
4922
4923    /// ---
4924    ///
4925    /// # Convert an organization member to outside collaborator
4926    ///
4927    /// When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to 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)."
4928    ///
4929    /// [GitHub API docs for convert_member_to_outside_collaborator](https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator)
4930    ///
4931    /// ---
4932    pub async fn convert_member_to_outside_collaborator_async(&self, org: &str, username: &str, body: PutOrgsConvertMemberToOutsideCollaborator) -> Result<HashMap<String, Value>, AdapterError> {
4933
4934        let request_uri = format!("{}/orgs/{}/outside_collaborators/{}", super::GITHUB_BASE_API_URL, org, username);
4935
4936
4937        let req = GitHubRequest {
4938            uri: request_uri,
4939            body: Some(C::from_json::<PutOrgsConvertMemberToOutsideCollaborator>(body)?),
4940            method: "PUT",
4941            headers: vec![]
4942        };
4943
4944        let request = self.client.build(req)?;
4945
4946        // --
4947
4948        let github_response = self.client.fetch_async(request).await?;
4949
4950        // --
4951
4952        if github_response.is_success() {
4953            Ok(github_response.to_json_async().await?)
4954        } else {
4955            match github_response.status_code() {
4956                204 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status204.into()),
4957                403 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status403.into()),
4958                404 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status404(github_response.to_json_async().await?).into()),
4959                code => Err(OrgsConvertMemberToOutsideCollaboratorError::Generic { code }.into()),
4960            }
4961        }
4962    }
4963
4964    /// ---
4965    ///
4966    /// # Convert an organization member to outside collaborator
4967    ///
4968    /// When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to 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)."
4969    ///
4970    /// [GitHub API docs for convert_member_to_outside_collaborator](https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator)
4971    ///
4972    /// ---
4973    #[cfg(not(target_arch = "wasm32"))]
4974    pub fn convert_member_to_outside_collaborator(&self, org: &str, username: &str, body: PutOrgsConvertMemberToOutsideCollaborator) -> Result<HashMap<String, Value>, AdapterError> {
4975
4976        let request_uri = format!("{}/orgs/{}/outside_collaborators/{}", super::GITHUB_BASE_API_URL, org, username);
4977
4978
4979        let req = GitHubRequest {
4980            uri: request_uri,
4981            body: Some(C::from_json::<PutOrgsConvertMemberToOutsideCollaborator>(body)?),
4982            method: "PUT",
4983            headers: vec![]
4984        };
4985
4986        let request = self.client.build(req)?;
4987
4988        // --
4989
4990        let github_response = self.client.fetch(request)?;
4991
4992        // --
4993
4994        if github_response.is_success() {
4995            Ok(github_response.to_json()?)
4996        } else {
4997            match github_response.status_code() {
4998                204 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status204.into()),
4999                403 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status403.into()),
5000                404 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status404(github_response.to_json()?).into()),
5001                code => Err(OrgsConvertMemberToOutsideCollaboratorError::Generic { code }.into()),
5002            }
5003        }
5004    }
5005
5006    /// ---
5007    ///
5008    /// # Create an organization invitation
5009    ///
5010    /// Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner.
5011    /// 
5012    /// 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/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
5013    /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."
5014    ///
5015    /// [GitHub API docs for create_invitation](https://docs.github.com/rest/orgs/members#create-an-organization-invitation)
5016    ///
5017    /// ---
5018    pub async fn create_invitation_async(&self, org: &str, body: PostOrgsCreateInvitation) -> Result<OrganizationInvitation, AdapterError> {
5019
5020        let request_uri = format!("{}/orgs/{}/invitations", super::GITHUB_BASE_API_URL, org);
5021
5022
5023        let req = GitHubRequest {
5024            uri: request_uri,
5025            body: Some(C::from_json::<PostOrgsCreateInvitation>(body)?),
5026            method: "POST",
5027            headers: vec![]
5028        };
5029
5030        let request = self.client.build(req)?;
5031
5032        // --
5033
5034        let github_response = self.client.fetch_async(request).await?;
5035
5036        // --
5037
5038        if github_response.is_success() {
5039            Ok(github_response.to_json_async().await?)
5040        } else {
5041            match github_response.status_code() {
5042                422 => Err(OrgsCreateInvitationError::Status422(github_response.to_json_async().await?).into()),
5043                404 => Err(OrgsCreateInvitationError::Status404(github_response.to_json_async().await?).into()),
5044                code => Err(OrgsCreateInvitationError::Generic { code }.into()),
5045            }
5046        }
5047    }
5048
5049    /// ---
5050    ///
5051    /// # Create an organization invitation
5052    ///
5053    /// Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner.
5054    /// 
5055    /// 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/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
5056    /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."
5057    ///
5058    /// [GitHub API docs for create_invitation](https://docs.github.com/rest/orgs/members#create-an-organization-invitation)
5059    ///
5060    /// ---
5061    #[cfg(not(target_arch = "wasm32"))]
5062    pub fn create_invitation(&self, org: &str, body: PostOrgsCreateInvitation) -> Result<OrganizationInvitation, AdapterError> {
5063
5064        let request_uri = format!("{}/orgs/{}/invitations", super::GITHUB_BASE_API_URL, org);
5065
5066
5067        let req = GitHubRequest {
5068            uri: request_uri,
5069            body: Some(C::from_json::<PostOrgsCreateInvitation>(body)?),
5070            method: "POST",
5071            headers: vec![]
5072        };
5073
5074        let request = self.client.build(req)?;
5075
5076        // --
5077
5078        let github_response = self.client.fetch(request)?;
5079
5080        // --
5081
5082        if github_response.is_success() {
5083            Ok(github_response.to_json()?)
5084        } else {
5085            match github_response.status_code() {
5086                422 => Err(OrgsCreateInvitationError::Status422(github_response.to_json()?).into()),
5087                404 => Err(OrgsCreateInvitationError::Status404(github_response.to_json()?).into()),
5088                code => Err(OrgsCreateInvitationError::Generic { code }.into()),
5089            }
5090        }
5091    }
5092
5093    /// ---
5094    ///
5095    /// # Create issue type for an organization
5096    ///
5097    /// Create a new issue type for an organization.
5098    /// 
5099    /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).
5100    /// 
5101    /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
5102    /// personal access tokens (classic) need the `admin:org` scope to use this endpoint.
5103    ///
5104    /// [GitHub API docs for create_issue_type](https://docs.github.com/rest/orgs/issue-types#create-issue-type-for-an-organization)
5105    ///
5106    /// ---
5107    pub async fn create_issue_type_async(&self, org: &str, body: PostOrgsCreateIssueType) -> Result<IssueType, AdapterError> {
5108
5109        let request_uri = format!("{}/orgs/{}/issue-types", super::GITHUB_BASE_API_URL, org);
5110
5111
5112        let req = GitHubRequest {
5113            uri: request_uri,
5114            body: Some(C::from_json::<PostOrgsCreateIssueType>(body)?),
5115            method: "POST",
5116            headers: vec![]
5117        };
5118
5119        let request = self.client.build(req)?;
5120
5121        // --
5122
5123        let github_response = self.client.fetch_async(request).await?;
5124
5125        // --
5126
5127        if github_response.is_success() {
5128            Ok(github_response.to_json_async().await?)
5129        } else {
5130            match github_response.status_code() {
5131                404 => Err(OrgsCreateIssueTypeError::Status404(github_response.to_json_async().await?).into()),
5132                422 => Err(OrgsCreateIssueTypeError::Status422(github_response.to_json_async().await?).into()),
5133                code => Err(OrgsCreateIssueTypeError::Generic { code }.into()),
5134            }
5135        }
5136    }
5137
5138    /// ---
5139    ///
5140    /// # Create issue type for an organization
5141    ///
5142    /// Create a new issue type for an organization.
5143    /// 
5144    /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).
5145    /// 
5146    /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
5147    /// personal access tokens (classic) need the `admin:org` scope to use this endpoint.
5148    ///
5149    /// [GitHub API docs for create_issue_type](https://docs.github.com/rest/orgs/issue-types#create-issue-type-for-an-organization)
5150    ///
5151    /// ---
5152    #[cfg(not(target_arch = "wasm32"))]
5153    pub fn create_issue_type(&self, org: &str, body: PostOrgsCreateIssueType) -> Result<IssueType, AdapterError> {
5154
5155        let request_uri = format!("{}/orgs/{}/issue-types", super::GITHUB_BASE_API_URL, org);
5156
5157
5158        let req = GitHubRequest {
5159            uri: request_uri,
5160            body: Some(C::from_json::<PostOrgsCreateIssueType>(body)?),
5161            method: "POST",
5162            headers: vec![]
5163        };
5164
5165        let request = self.client.build(req)?;
5166
5167        // --
5168
5169        let github_response = self.client.fetch(request)?;
5170
5171        // --
5172
5173        if github_response.is_success() {
5174            Ok(github_response.to_json()?)
5175        } else {
5176            match github_response.status_code() {
5177                404 => Err(OrgsCreateIssueTypeError::Status404(github_response.to_json()?).into()),
5178                422 => Err(OrgsCreateIssueTypeError::Status422(github_response.to_json()?).into()),
5179                code => Err(OrgsCreateIssueTypeError::Generic { code }.into()),
5180            }
5181        }
5182    }
5183
5184    /// ---
5185    ///
5186    /// # Create or update custom properties for an organization
5187    ///
5188    /// Creates new or updates existing custom properties defined for an organization in a batch.
5189    /// 
5190    /// If the property already exists, the existing property will be replaced with the new values.
5191    /// Missing optional values will fall back to default values, previous values will be overwritten.
5192    /// E.g. if a property exists with `values_editable_by: org_and_repo_actors` and it's updated without specifying `values_editable_by`, it will be updated to default value `org_actors`.
5193    /// 
5194    /// To use this endpoint, the authenticated user must be one of:
5195    ///   - An administrator for the organization.
5196    ///   - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization.
5197    ///
5198    /// [GitHub API docs for create_or_update_custom_properties](https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization)
5199    ///
5200    /// ---
5201    pub async fn create_or_update_custom_properties_async(&self, org: &str, body: PatchOrgsCreateOrUpdateCustomProperties) -> Result<Vec<CustomProperty>, AdapterError> {
5202
5203        let request_uri = format!("{}/orgs/{}/properties/schema", super::GITHUB_BASE_API_URL, org);
5204
5205
5206        let req = GitHubRequest {
5207            uri: request_uri,
5208            body: Some(C::from_json::<PatchOrgsCreateOrUpdateCustomProperties>(body)?),
5209            method: "PATCH",
5210            headers: vec![]
5211        };
5212
5213        let request = self.client.build(req)?;
5214
5215        // --
5216
5217        let github_response = self.client.fetch_async(request).await?;
5218
5219        // --
5220
5221        if github_response.is_success() {
5222            Ok(github_response.to_json_async().await?)
5223        } else {
5224            match github_response.status_code() {
5225                403 => Err(OrgsCreateOrUpdateCustomPropertiesError::Status403(github_response.to_json_async().await?).into()),
5226                404 => Err(OrgsCreateOrUpdateCustomPropertiesError::Status404(github_response.to_json_async().await?).into()),
5227                code => Err(OrgsCreateOrUpdateCustomPropertiesError::Generic { code }.into()),
5228            }
5229        }
5230    }
5231
5232    /// ---
5233    ///
5234    /// # Create or update custom properties for an organization
5235    ///
5236    /// Creates new or updates existing custom properties defined for an organization in a batch.
5237    /// 
5238    /// If the property already exists, the existing property will be replaced with the new values.
5239    /// Missing optional values will fall back to default values, previous values will be overwritten.
5240    /// E.g. if a property exists with `values_editable_by: org_and_repo_actors` and it's updated without specifying `values_editable_by`, it will be updated to default value `org_actors`.
5241    /// 
5242    /// To use this endpoint, the authenticated user must be one of:
5243    ///   - An administrator for the organization.
5244    ///   - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization.
5245    ///
5246    /// [GitHub API docs for create_or_update_custom_properties](https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization)
5247    ///
5248    /// ---
5249    #[cfg(not(target_arch = "wasm32"))]
5250    pub fn create_or_update_custom_properties(&self, org: &str, body: PatchOrgsCreateOrUpdateCustomProperties) -> Result<Vec<CustomProperty>, AdapterError> {
5251
5252        let request_uri = format!("{}/orgs/{}/properties/schema", super::GITHUB_BASE_API_URL, org);
5253
5254
5255        let req = GitHubRequest {
5256            uri: request_uri,
5257            body: Some(C::from_json::<PatchOrgsCreateOrUpdateCustomProperties>(body)?),
5258            method: "PATCH",
5259            headers: vec![]
5260        };
5261
5262        let request = self.client.build(req)?;
5263
5264        // --
5265
5266        let github_response = self.client.fetch(request)?;
5267
5268        // --
5269
5270        if github_response.is_success() {
5271            Ok(github_response.to_json()?)
5272        } else {
5273            match github_response.status_code() {
5274                403 => Err(OrgsCreateOrUpdateCustomPropertiesError::Status403(github_response.to_json()?).into()),
5275                404 => Err(OrgsCreateOrUpdateCustomPropertiesError::Status404(github_response.to_json()?).into()),
5276                code => Err(OrgsCreateOrUpdateCustomPropertiesError::Generic { code }.into()),
5277            }
5278        }
5279    }
5280
5281    /// ---
5282    ///
5283    /// # Create or update custom property values for organization repositories
5284    ///
5285    /// Create new or update existing custom property values for repositories in a batch that belong to an organization.
5286    /// Each target repository will have its custom property values updated to match the values provided in the request.
5287    /// 
5288    /// A maximum of 30 repositories can be updated in a single request.
5289    /// 
5290    /// Using a value of `null` for a custom property will remove or 'unset' the property value from the repository.
5291    /// 
5292    /// To use this endpoint, the authenticated user must be one of:
5293    ///   - An administrator for the organization.
5294    ///   - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization.
5295    ///
5296    /// [GitHub API docs for create_or_update_custom_properties_values_for_repos](https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories)
5297    ///
5298    /// ---
5299    pub async fn create_or_update_custom_properties_values_for_repos_async(&self, org: &str, body: PatchOrgsCreateOrUpdateCustomPropertiesValuesForRepos) -> Result<(), AdapterError> {
5300
5301        let request_uri = format!("{}/orgs/{}/properties/values", super::GITHUB_BASE_API_URL, org);
5302
5303
5304        let req = GitHubRequest {
5305            uri: request_uri,
5306            body: Some(C::from_json::<PatchOrgsCreateOrUpdateCustomPropertiesValuesForRepos>(body)?),
5307            method: "PATCH",
5308            headers: vec![]
5309        };
5310
5311        let request = self.client.build(req)?;
5312
5313        // --
5314
5315        let github_response = self.client.fetch_async(request).await?;
5316
5317        // --
5318
5319        if github_response.is_success() {
5320            Ok(())
5321        } else {
5322            match github_response.status_code() {
5323                403 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status403(github_response.to_json_async().await?).into()),
5324                404 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status404(github_response.to_json_async().await?).into()),
5325                422 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status422(github_response.to_json_async().await?).into()),
5326                code => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Generic { code }.into()),
5327            }
5328        }
5329    }
5330
5331    /// ---
5332    ///
5333    /// # Create or update custom property values for organization repositories
5334    ///
5335    /// Create new or update existing custom property values for repositories in a batch that belong to an organization.
5336    /// Each target repository will have its custom property values updated to match the values provided in the request.
5337    /// 
5338    /// A maximum of 30 repositories can be updated in a single request.
5339    /// 
5340    /// Using a value of `null` for a custom property will remove or 'unset' the property value from the repository.
5341    /// 
5342    /// To use this endpoint, the authenticated user must be one of:
5343    ///   - An administrator for the organization.
5344    ///   - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization.
5345    ///
5346    /// [GitHub API docs for create_or_update_custom_properties_values_for_repos](https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories)
5347    ///
5348    /// ---
5349    #[cfg(not(target_arch = "wasm32"))]
5350    pub fn create_or_update_custom_properties_values_for_repos(&self, org: &str, body: PatchOrgsCreateOrUpdateCustomPropertiesValuesForRepos) -> Result<(), AdapterError> {
5351
5352        let request_uri = format!("{}/orgs/{}/properties/values", super::GITHUB_BASE_API_URL, org);
5353
5354
5355        let req = GitHubRequest {
5356            uri: request_uri,
5357            body: Some(C::from_json::<PatchOrgsCreateOrUpdateCustomPropertiesValuesForRepos>(body)?),
5358            method: "PATCH",
5359            headers: vec![]
5360        };
5361
5362        let request = self.client.build(req)?;
5363
5364        // --
5365
5366        let github_response = self.client.fetch(request)?;
5367
5368        // --
5369
5370        if github_response.is_success() {
5371            Ok(())
5372        } else {
5373            match github_response.status_code() {
5374                403 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status403(github_response.to_json()?).into()),
5375                404 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status404(github_response.to_json()?).into()),
5376                422 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status422(github_response.to_json()?).into()),
5377                code => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Generic { code }.into()),
5378            }
5379        }
5380    }
5381
5382    /// ---
5383    ///
5384    /// # Create or update a custom property for an organization
5385    ///
5386    /// Creates a new or updates an existing custom property that is defined for an organization.
5387    /// 
5388    /// To use this endpoint, the authenticated user must be one of:
5389    /// - An administrator for the organization.
5390    /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization.
5391    ///
5392    /// [GitHub API docs for create_or_update_custom_property](https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization)
5393    ///
5394    /// ---
5395    pub async fn create_or_update_custom_property_async(&self, org: &str, custom_property_name: &str, body: PutOrgsCreateOrUpdateCustomProperty) -> Result<CustomProperty, AdapterError> {
5396
5397        let request_uri = format!("{}/orgs/{}/properties/schema/{}", super::GITHUB_BASE_API_URL, org, custom_property_name);
5398
5399
5400        let req = GitHubRequest {
5401            uri: request_uri,
5402            body: Some(C::from_json::<PutOrgsCreateOrUpdateCustomProperty>(body)?),
5403            method: "PUT",
5404            headers: vec![]
5405        };
5406
5407        let request = self.client.build(req)?;
5408
5409        // --
5410
5411        let github_response = self.client.fetch_async(request).await?;
5412
5413        // --
5414
5415        if github_response.is_success() {
5416            Ok(github_response.to_json_async().await?)
5417        } else {
5418            match github_response.status_code() {
5419                403 => Err(OrgsCreateOrUpdateCustomPropertyError::Status403(github_response.to_json_async().await?).into()),
5420                404 => Err(OrgsCreateOrUpdateCustomPropertyError::Status404(github_response.to_json_async().await?).into()),
5421                code => Err(OrgsCreateOrUpdateCustomPropertyError::Generic { code }.into()),
5422            }
5423        }
5424    }
5425
5426    /// ---
5427    ///
5428    /// # Create or update a custom property for an organization
5429    ///
5430    /// Creates a new or updates an existing custom property that is defined for an organization.
5431    /// 
5432    /// To use this endpoint, the authenticated user must be one of:
5433    /// - An administrator for the organization.
5434    /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization.
5435    ///
5436    /// [GitHub API docs for create_or_update_custom_property](https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization)
5437    ///
5438    /// ---
5439    #[cfg(not(target_arch = "wasm32"))]
5440    pub fn create_or_update_custom_property(&self, org: &str, custom_property_name: &str, body: PutOrgsCreateOrUpdateCustomProperty) -> Result<CustomProperty, AdapterError> {
5441
5442        let request_uri = format!("{}/orgs/{}/properties/schema/{}", super::GITHUB_BASE_API_URL, org, custom_property_name);
5443
5444
5445        let req = GitHubRequest {
5446            uri: request_uri,
5447            body: Some(C::from_json::<PutOrgsCreateOrUpdateCustomProperty>(body)?),
5448            method: "PUT",
5449            headers: vec![]
5450        };
5451
5452        let request = self.client.build(req)?;
5453
5454        // --
5455
5456        let github_response = self.client.fetch(request)?;
5457
5458        // --
5459
5460        if github_response.is_success() {
5461            Ok(github_response.to_json()?)
5462        } else {
5463            match github_response.status_code() {
5464                403 => Err(OrgsCreateOrUpdateCustomPropertyError::Status403(github_response.to_json()?).into()),
5465                404 => Err(OrgsCreateOrUpdateCustomPropertyError::Status404(github_response.to_json()?).into()),
5466                code => Err(OrgsCreateOrUpdateCustomPropertyError::Generic { code }.into()),
5467            }
5468        }
5469    }
5470
5471    /// ---
5472    ///
5473    /// # Create an organization webhook
5474    ///
5475    /// Create a hook that posts payloads in JSON format.
5476    /// 
5477    /// You must be an organization owner to use this endpoint.
5478    /// 
5479    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or
5480    /// edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
5481    ///
5482    /// [GitHub API docs for create_webhook](https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook)
5483    ///
5484    /// ---
5485    pub async fn create_webhook_async(&self, org: &str, body: PostOrgsCreateWebhook) -> Result<OrgHook, AdapterError> {
5486
5487        let request_uri = format!("{}/orgs/{}/hooks", super::GITHUB_BASE_API_URL, org);
5488
5489
5490        let req = GitHubRequest {
5491            uri: request_uri,
5492            body: Some(C::from_json::<PostOrgsCreateWebhook>(body)?),
5493            method: "POST",
5494            headers: vec![]
5495        };
5496
5497        let request = self.client.build(req)?;
5498
5499        // --
5500
5501        let github_response = self.client.fetch_async(request).await?;
5502
5503        // --
5504
5505        if github_response.is_success() {
5506            Ok(github_response.to_json_async().await?)
5507        } else {
5508            match github_response.status_code() {
5509                422 => Err(OrgsCreateWebhookError::Status422(github_response.to_json_async().await?).into()),
5510                404 => Err(OrgsCreateWebhookError::Status404(github_response.to_json_async().await?).into()),
5511                code => Err(OrgsCreateWebhookError::Generic { code }.into()),
5512            }
5513        }
5514    }
5515
5516    /// ---
5517    ///
5518    /// # Create an organization webhook
5519    ///
5520    /// Create a hook that posts payloads in JSON format.
5521    /// 
5522    /// You must be an organization owner to use this endpoint.
5523    /// 
5524    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or
5525    /// edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
5526    ///
5527    /// [GitHub API docs for create_webhook](https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook)
5528    ///
5529    /// ---
5530    #[cfg(not(target_arch = "wasm32"))]
5531    pub fn create_webhook(&self, org: &str, body: PostOrgsCreateWebhook) -> Result<OrgHook, AdapterError> {
5532
5533        let request_uri = format!("{}/orgs/{}/hooks", super::GITHUB_BASE_API_URL, org);
5534
5535
5536        let req = GitHubRequest {
5537            uri: request_uri,
5538            body: Some(C::from_json::<PostOrgsCreateWebhook>(body)?),
5539            method: "POST",
5540            headers: vec![]
5541        };
5542
5543        let request = self.client.build(req)?;
5544
5545        // --
5546
5547        let github_response = self.client.fetch(request)?;
5548
5549        // --
5550
5551        if github_response.is_success() {
5552            Ok(github_response.to_json()?)
5553        } else {
5554            match github_response.status_code() {
5555                422 => Err(OrgsCreateWebhookError::Status422(github_response.to_json()?).into()),
5556                404 => Err(OrgsCreateWebhookError::Status404(github_response.to_json()?).into()),
5557                code => Err(OrgsCreateWebhookError::Generic { code }.into()),
5558            }
5559        }
5560    }
5561
5562    /// ---
5563    ///
5564    /// # Delete an organization
5565    ///
5566    /// Deletes an organization and all its repositories.
5567    /// 
5568    /// The organization login will be unavailable for 90 days after deletion.
5569    /// 
5570    /// Please review the Terms of Service regarding account deletion before using this endpoint:
5571    /// 
5572    /// https://docs.github.com/site-policy/github-terms/github-terms-of-service
5573    ///
5574    /// [GitHub API docs for delete](https://docs.github.com/rest/orgs/orgs#delete-an-organization)
5575    ///
5576    /// ---
5577    pub async fn delete_async(&self, org: &str) -> Result<HashMap<String, Value>, AdapterError> {
5578
5579        let request_uri = format!("{}/orgs/{}", super::GITHUB_BASE_API_URL, org);
5580
5581
5582        let req = GitHubRequest {
5583            uri: request_uri,
5584            body: None::<C::Body>,
5585            method: "DELETE",
5586            headers: vec![]
5587        };
5588
5589        let request = self.client.build(req)?;
5590
5591        // --
5592
5593        let github_response = self.client.fetch_async(request).await?;
5594
5595        // --
5596
5597        if github_response.is_success() {
5598            Ok(github_response.to_json_async().await?)
5599        } else {
5600            match github_response.status_code() {
5601                404 => Err(OrgsDeleteError::Status404(github_response.to_json_async().await?).into()),
5602                403 => Err(OrgsDeleteError::Status403(github_response.to_json_async().await?).into()),
5603                code => Err(OrgsDeleteError::Generic { code }.into()),
5604            }
5605        }
5606    }
5607
5608    /// ---
5609    ///
5610    /// # Delete an organization
5611    ///
5612    /// Deletes an organization and all its repositories.
5613    /// 
5614    /// The organization login will be unavailable for 90 days after deletion.
5615    /// 
5616    /// Please review the Terms of Service regarding account deletion before using this endpoint:
5617    /// 
5618    /// https://docs.github.com/site-policy/github-terms/github-terms-of-service
5619    ///
5620    /// [GitHub API docs for delete](https://docs.github.com/rest/orgs/orgs#delete-an-organization)
5621    ///
5622    /// ---
5623    #[cfg(not(target_arch = "wasm32"))]
5624    pub fn delete(&self, org: &str) -> Result<HashMap<String, Value>, AdapterError> {
5625
5626        let request_uri = format!("{}/orgs/{}", super::GITHUB_BASE_API_URL, org);
5627
5628
5629        let req = GitHubRequest {
5630            uri: request_uri,
5631            body: None,
5632            method: "DELETE",
5633            headers: vec![]
5634        };
5635
5636        let request = self.client.build(req)?;
5637
5638        // --
5639
5640        let github_response = self.client.fetch(request)?;
5641
5642        // --
5643
5644        if github_response.is_success() {
5645            Ok(github_response.to_json()?)
5646        } else {
5647            match github_response.status_code() {
5648                404 => Err(OrgsDeleteError::Status404(github_response.to_json()?).into()),
5649                403 => Err(OrgsDeleteError::Status403(github_response.to_json()?).into()),
5650                code => Err(OrgsDeleteError::Generic { code }.into()),
5651            }
5652        }
5653    }
5654
5655    /// ---
5656    ///
5657    /// # Delete issue type for an organization
5658    ///
5659    /// Deletes an issue type for an organization.
5660    /// 
5661    /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).
5662    /// 
5663    /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
5664    /// personal access tokens (classic) need the `admin:org` scope to use this endpoint.
5665    ///
5666    /// [GitHub API docs for delete_issue_type](https://docs.github.com/rest/orgs/issue-types#delete-issue-type-for-an-organization)
5667    ///
5668    /// ---
5669    pub async fn delete_issue_type_async(&self, org: &str, issue_type_id: i32) -> Result<(), AdapterError> {
5670
5671        let request_uri = format!("{}/orgs/{}/issue-types/{}", super::GITHUB_BASE_API_URL, org, issue_type_id);
5672
5673
5674        let req = GitHubRequest {
5675            uri: request_uri,
5676            body: None::<C::Body>,
5677            method: "DELETE",
5678            headers: vec![]
5679        };
5680
5681        let request = self.client.build(req)?;
5682
5683        // --
5684
5685        let github_response = self.client.fetch_async(request).await?;
5686
5687        // --
5688
5689        if github_response.is_success() {
5690            Ok(())
5691        } else {
5692            match github_response.status_code() {
5693                422 => Err(OrgsDeleteIssueTypeError::Status422(github_response.to_json_async().await?).into()),
5694                404 => Err(OrgsDeleteIssueTypeError::Status404(github_response.to_json_async().await?).into()),
5695                code => Err(OrgsDeleteIssueTypeError::Generic { code }.into()),
5696            }
5697        }
5698    }
5699
5700    /// ---
5701    ///
5702    /// # Delete issue type for an organization
5703    ///
5704    /// Deletes an issue type for an organization.
5705    /// 
5706    /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).
5707    /// 
5708    /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
5709    /// personal access tokens (classic) need the `admin:org` scope to use this endpoint.
5710    ///
5711    /// [GitHub API docs for delete_issue_type](https://docs.github.com/rest/orgs/issue-types#delete-issue-type-for-an-organization)
5712    ///
5713    /// ---
5714    #[cfg(not(target_arch = "wasm32"))]
5715    pub fn delete_issue_type(&self, org: &str, issue_type_id: i32) -> Result<(), AdapterError> {
5716
5717        let request_uri = format!("{}/orgs/{}/issue-types/{}", super::GITHUB_BASE_API_URL, org, issue_type_id);
5718
5719
5720        let req = GitHubRequest {
5721            uri: request_uri,
5722            body: None,
5723            method: "DELETE",
5724            headers: vec![]
5725        };
5726
5727        let request = self.client.build(req)?;
5728
5729        // --
5730
5731        let github_response = self.client.fetch(request)?;
5732
5733        // --
5734
5735        if github_response.is_success() {
5736            Ok(())
5737        } else {
5738            match github_response.status_code() {
5739                422 => Err(OrgsDeleteIssueTypeError::Status422(github_response.to_json()?).into()),
5740                404 => Err(OrgsDeleteIssueTypeError::Status404(github_response.to_json()?).into()),
5741                code => Err(OrgsDeleteIssueTypeError::Generic { code }.into()),
5742            }
5743        }
5744    }
5745
5746    /// ---
5747    ///
5748    /// # Delete an organization webhook
5749    ///
5750    /// Delete a webhook for an organization.
5751    /// 
5752    /// The authenticated user must be an organization owner to use this endpoint.
5753    /// 
5754    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
5755    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
5756    ///
5757    /// [GitHub API docs for delete_webhook](https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook)
5758    ///
5759    /// ---
5760    pub async fn delete_webhook_async(&self, org: &str, hook_id: i32) -> Result<(), AdapterError> {
5761
5762        let request_uri = format!("{}/orgs/{}/hooks/{}", super::GITHUB_BASE_API_URL, org, hook_id);
5763
5764
5765        let req = GitHubRequest {
5766            uri: request_uri,
5767            body: None::<C::Body>,
5768            method: "DELETE",
5769            headers: vec![]
5770        };
5771
5772        let request = self.client.build(req)?;
5773
5774        // --
5775
5776        let github_response = self.client.fetch_async(request).await?;
5777
5778        // --
5779
5780        if github_response.is_success() {
5781            Ok(())
5782        } else {
5783            match github_response.status_code() {
5784                404 => Err(OrgsDeleteWebhookError::Status404(github_response.to_json_async().await?).into()),
5785                code => Err(OrgsDeleteWebhookError::Generic { code }.into()),
5786            }
5787        }
5788    }
5789
5790    /// ---
5791    ///
5792    /// # Delete an organization webhook
5793    ///
5794    /// Delete a webhook for an organization.
5795    /// 
5796    /// The authenticated user must be an organization owner to use this endpoint.
5797    /// 
5798    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
5799    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
5800    ///
5801    /// [GitHub API docs for delete_webhook](https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook)
5802    ///
5803    /// ---
5804    #[cfg(not(target_arch = "wasm32"))]
5805    pub fn delete_webhook(&self, org: &str, hook_id: i32) -> Result<(), AdapterError> {
5806
5807        let request_uri = format!("{}/orgs/{}/hooks/{}", super::GITHUB_BASE_API_URL, org, hook_id);
5808
5809
5810        let req = GitHubRequest {
5811            uri: request_uri,
5812            body: None,
5813            method: "DELETE",
5814            headers: vec![]
5815        };
5816
5817        let request = self.client.build(req)?;
5818
5819        // --
5820
5821        let github_response = self.client.fetch(request)?;
5822
5823        // --
5824
5825        if github_response.is_success() {
5826            Ok(())
5827        } else {
5828            match github_response.status_code() {
5829                404 => Err(OrgsDeleteWebhookError::Status404(github_response.to_json()?).into()),
5830                code => Err(OrgsDeleteWebhookError::Generic { code }.into()),
5831            }
5832        }
5833    }
5834
5835    /// ---
5836    ///
5837    /// # Enable or disable a security feature for an organization
5838    ///
5839    /// > [!WARNING]
5840    /// > **Closing down notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).
5841    /// 
5842    /// Enables or disables the specified security feature for all eligible repositories in an organization. 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)."
5843    /// 
5844    /// The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.
5845    /// 
5846    /// OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint.
5847    ///
5848    /// [GitHub API docs for enable_or_disable_security_product_on_all_org_repos](https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization)
5849    ///
5850    /// ---
5851    pub async fn enable_or_disable_security_product_on_all_org_repos_async(&self, org: &str, security_product: &str, enablement: &str, body: PostOrgsEnableOrDisableSecurityProductOnAllOrgRepos) -> Result<(), AdapterError> {
5852
5853        let request_uri = format!("{}/orgs/{}/{}/{}", super::GITHUB_BASE_API_URL, org, security_product, enablement);
5854
5855
5856        let req = GitHubRequest {
5857            uri: request_uri,
5858            body: Some(C::from_json::<PostOrgsEnableOrDisableSecurityProductOnAllOrgRepos>(body)?),
5859            method: "POST",
5860            headers: vec![]
5861        };
5862
5863        let request = self.client.build(req)?;
5864
5865        // --
5866
5867        let github_response = self.client.fetch_async(request).await?;
5868
5869        // --
5870
5871        if github_response.is_success() {
5872            Ok(())
5873        } else {
5874            match github_response.status_code() {
5875                422 => Err(OrgsEnableOrDisableSecurityProductOnAllOrgReposError::Status422.into()),
5876                code => Err(OrgsEnableOrDisableSecurityProductOnAllOrgReposError::Generic { code }.into()),
5877            }
5878        }
5879    }
5880
5881    /// ---
5882    ///
5883    /// # Enable or disable a security feature for an organization
5884    ///
5885    /// > [!WARNING]
5886    /// > **Closing down notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).
5887    /// 
5888    /// Enables or disables the specified security feature for all eligible repositories in an organization. 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)."
5889    /// 
5890    /// The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.
5891    /// 
5892    /// OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint.
5893    ///
5894    /// [GitHub API docs for enable_or_disable_security_product_on_all_org_repos](https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization)
5895    ///
5896    /// ---
5897    #[cfg(not(target_arch = "wasm32"))]
5898    pub fn enable_or_disable_security_product_on_all_org_repos(&self, org: &str, security_product: &str, enablement: &str, body: PostOrgsEnableOrDisableSecurityProductOnAllOrgRepos) -> Result<(), AdapterError> {
5899
5900        let request_uri = format!("{}/orgs/{}/{}/{}", super::GITHUB_BASE_API_URL, org, security_product, enablement);
5901
5902
5903        let req = GitHubRequest {
5904            uri: request_uri,
5905            body: Some(C::from_json::<PostOrgsEnableOrDisableSecurityProductOnAllOrgRepos>(body)?),
5906            method: "POST",
5907            headers: vec![]
5908        };
5909
5910        let request = self.client.build(req)?;
5911
5912        // --
5913
5914        let github_response = self.client.fetch(request)?;
5915
5916        // --
5917
5918        if github_response.is_success() {
5919            Ok(())
5920        } else {
5921            match github_response.status_code() {
5922                422 => Err(OrgsEnableOrDisableSecurityProductOnAllOrgReposError::Status422.into()),
5923                code => Err(OrgsEnableOrDisableSecurityProductOnAllOrgReposError::Generic { code }.into()),
5924            }
5925        }
5926    }
5927
5928    /// ---
5929    ///
5930    /// # Get an organization
5931    ///
5932    /// Gets information about an organization.
5933    /// 
5934    /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, outside collaborators, guest collaborators, repository collaborators, or everyone with access to any repository within the organization to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/).
5935    /// 
5936    /// To see the full details about an organization, the authenticated user must be an organization owner.
5937    /// 
5938    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization.
5939    /// 
5940    /// To see information about an organization's GitHub plan, GitHub Apps need the `Organization plan` permission.
5941    ///
5942    /// [GitHub API docs for get](https://docs.github.com/rest/orgs/orgs#get-an-organization)
5943    ///
5944    /// ---
5945    pub async fn get_async(&self, org: &str) -> Result<OrganizationFull, AdapterError> {
5946
5947        let request_uri = format!("{}/orgs/{}", super::GITHUB_BASE_API_URL, org);
5948
5949
5950        let req = GitHubRequest {
5951            uri: request_uri,
5952            body: None::<C::Body>,
5953            method: "GET",
5954            headers: vec![]
5955        };
5956
5957        let request = self.client.build(req)?;
5958
5959        // --
5960
5961        let github_response = self.client.fetch_async(request).await?;
5962
5963        // --
5964
5965        if github_response.is_success() {
5966            Ok(github_response.to_json_async().await?)
5967        } else {
5968            match github_response.status_code() {
5969                404 => Err(OrgsGetError::Status404(github_response.to_json_async().await?).into()),
5970                code => Err(OrgsGetError::Generic { code }.into()),
5971            }
5972        }
5973    }
5974
5975    /// ---
5976    ///
5977    /// # Get an organization
5978    ///
5979    /// Gets information about an organization.
5980    /// 
5981    /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, outside collaborators, guest collaborators, repository collaborators, or everyone with access to any repository within the organization to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/).
5982    /// 
5983    /// To see the full details about an organization, the authenticated user must be an organization owner.
5984    /// 
5985    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization.
5986    /// 
5987    /// To see information about an organization's GitHub plan, GitHub Apps need the `Organization plan` permission.
5988    ///
5989    /// [GitHub API docs for get](https://docs.github.com/rest/orgs/orgs#get-an-organization)
5990    ///
5991    /// ---
5992    #[cfg(not(target_arch = "wasm32"))]
5993    pub fn get(&self, org: &str) -> Result<OrganizationFull, AdapterError> {
5994
5995        let request_uri = format!("{}/orgs/{}", super::GITHUB_BASE_API_URL, org);
5996
5997
5998        let req = GitHubRequest {
5999            uri: request_uri,
6000            body: None,
6001            method: "GET",
6002            headers: vec![]
6003        };
6004
6005        let request = self.client.build(req)?;
6006
6007        // --
6008
6009        let github_response = self.client.fetch(request)?;
6010
6011        // --
6012
6013        if github_response.is_success() {
6014            Ok(github_response.to_json()?)
6015        } else {
6016            match github_response.status_code() {
6017                404 => Err(OrgsGetError::Status404(github_response.to_json()?).into()),
6018                code => Err(OrgsGetError::Generic { code }.into()),
6019            }
6020        }
6021    }
6022
6023    /// ---
6024    ///
6025    /// # Get all custom properties for an organization
6026    ///
6027    /// Gets all custom properties defined for an organization.
6028    /// Organization members can read these properties.
6029    ///
6030    /// [GitHub API docs for get_all_custom_properties](https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization)
6031    ///
6032    /// ---
6033    pub async fn get_all_custom_properties_async(&self, org: &str) -> Result<Vec<CustomProperty>, AdapterError> {
6034
6035        let request_uri = format!("{}/orgs/{}/properties/schema", super::GITHUB_BASE_API_URL, org);
6036
6037
6038        let req = GitHubRequest {
6039            uri: request_uri,
6040            body: None::<C::Body>,
6041            method: "GET",
6042            headers: vec![]
6043        };
6044
6045        let request = self.client.build(req)?;
6046
6047        // --
6048
6049        let github_response = self.client.fetch_async(request).await?;
6050
6051        // --
6052
6053        if github_response.is_success() {
6054            Ok(github_response.to_json_async().await?)
6055        } else {
6056            match github_response.status_code() {
6057                403 => Err(OrgsGetAllCustomPropertiesError::Status403(github_response.to_json_async().await?).into()),
6058                404 => Err(OrgsGetAllCustomPropertiesError::Status404(github_response.to_json_async().await?).into()),
6059                code => Err(OrgsGetAllCustomPropertiesError::Generic { code }.into()),
6060            }
6061        }
6062    }
6063
6064    /// ---
6065    ///
6066    /// # Get all custom properties for an organization
6067    ///
6068    /// Gets all custom properties defined for an organization.
6069    /// Organization members can read these properties.
6070    ///
6071    /// [GitHub API docs for get_all_custom_properties](https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization)
6072    ///
6073    /// ---
6074    #[cfg(not(target_arch = "wasm32"))]
6075    pub fn get_all_custom_properties(&self, org: &str) -> Result<Vec<CustomProperty>, AdapterError> {
6076
6077        let request_uri = format!("{}/orgs/{}/properties/schema", super::GITHUB_BASE_API_URL, org);
6078
6079
6080        let req = GitHubRequest {
6081            uri: request_uri,
6082            body: None,
6083            method: "GET",
6084            headers: vec![]
6085        };
6086
6087        let request = self.client.build(req)?;
6088
6089        // --
6090
6091        let github_response = self.client.fetch(request)?;
6092
6093        // --
6094
6095        if github_response.is_success() {
6096            Ok(github_response.to_json()?)
6097        } else {
6098            match github_response.status_code() {
6099                403 => Err(OrgsGetAllCustomPropertiesError::Status403(github_response.to_json()?).into()),
6100                404 => Err(OrgsGetAllCustomPropertiesError::Status404(github_response.to_json()?).into()),
6101                code => Err(OrgsGetAllCustomPropertiesError::Generic { code }.into()),
6102            }
6103        }
6104    }
6105
6106    /// ---
6107    ///
6108    /// # Get a custom property for an organization
6109    ///
6110    /// Gets a custom property that is defined for an organization.
6111    /// Organization members can read these properties.
6112    ///
6113    /// [GitHub API docs for get_custom_property](https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization)
6114    ///
6115    /// ---
6116    pub async fn get_custom_property_async(&self, org: &str, custom_property_name: &str) -> Result<CustomProperty, AdapterError> {
6117
6118        let request_uri = format!("{}/orgs/{}/properties/schema/{}", super::GITHUB_BASE_API_URL, org, custom_property_name);
6119
6120
6121        let req = GitHubRequest {
6122            uri: request_uri,
6123            body: None::<C::Body>,
6124            method: "GET",
6125            headers: vec![]
6126        };
6127
6128        let request = self.client.build(req)?;
6129
6130        // --
6131
6132        let github_response = self.client.fetch_async(request).await?;
6133
6134        // --
6135
6136        if github_response.is_success() {
6137            Ok(github_response.to_json_async().await?)
6138        } else {
6139            match github_response.status_code() {
6140                403 => Err(OrgsGetCustomPropertyError::Status403(github_response.to_json_async().await?).into()),
6141                404 => Err(OrgsGetCustomPropertyError::Status404(github_response.to_json_async().await?).into()),
6142                code => Err(OrgsGetCustomPropertyError::Generic { code }.into()),
6143            }
6144        }
6145    }
6146
6147    /// ---
6148    ///
6149    /// # Get a custom property for an organization
6150    ///
6151    /// Gets a custom property that is defined for an organization.
6152    /// Organization members can read these properties.
6153    ///
6154    /// [GitHub API docs for get_custom_property](https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization)
6155    ///
6156    /// ---
6157    #[cfg(not(target_arch = "wasm32"))]
6158    pub fn get_custom_property(&self, org: &str, custom_property_name: &str) -> Result<CustomProperty, AdapterError> {
6159
6160        let request_uri = format!("{}/orgs/{}/properties/schema/{}", super::GITHUB_BASE_API_URL, org, custom_property_name);
6161
6162
6163        let req = GitHubRequest {
6164            uri: request_uri,
6165            body: None,
6166            method: "GET",
6167            headers: vec![]
6168        };
6169
6170        let request = self.client.build(req)?;
6171
6172        // --
6173
6174        let github_response = self.client.fetch(request)?;
6175
6176        // --
6177
6178        if github_response.is_success() {
6179            Ok(github_response.to_json()?)
6180        } else {
6181            match github_response.status_code() {
6182                403 => Err(OrgsGetCustomPropertyError::Status403(github_response.to_json()?).into()),
6183                404 => Err(OrgsGetCustomPropertyError::Status404(github_response.to_json()?).into()),
6184                code => Err(OrgsGetCustomPropertyError::Generic { code }.into()),
6185            }
6186        }
6187    }
6188
6189    /// ---
6190    ///
6191    /// # Get an organization membership for the authenticated user
6192    ///
6193    /// If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a `404` is returned. This endpoint will return a `403` if the request is made by a GitHub App that is blocked by the organization.
6194    ///
6195    /// [GitHub API docs for get_membership_for_authenticated_user](https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user)
6196    ///
6197    /// ---
6198    pub async fn get_membership_for_authenticated_user_async(&self, org: &str) -> Result<OrgMembership, AdapterError> {
6199
6200        let request_uri = format!("{}/user/memberships/orgs/{}", super::GITHUB_BASE_API_URL, org);
6201
6202
6203        let req = GitHubRequest {
6204            uri: request_uri,
6205            body: None::<C::Body>,
6206            method: "GET",
6207            headers: vec![]
6208        };
6209
6210        let request = self.client.build(req)?;
6211
6212        // --
6213
6214        let github_response = self.client.fetch_async(request).await?;
6215
6216        // --
6217
6218        if github_response.is_success() {
6219            Ok(github_response.to_json_async().await?)
6220        } else {
6221            match github_response.status_code() {
6222                403 => Err(OrgsGetMembershipForAuthenticatedUserError::Status403(github_response.to_json_async().await?).into()),
6223                404 => Err(OrgsGetMembershipForAuthenticatedUserError::Status404(github_response.to_json_async().await?).into()),
6224                code => Err(OrgsGetMembershipForAuthenticatedUserError::Generic { code }.into()),
6225            }
6226        }
6227    }
6228
6229    /// ---
6230    ///
6231    /// # Get an organization membership for the authenticated user
6232    ///
6233    /// If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a `404` is returned. This endpoint will return a `403` if the request is made by a GitHub App that is blocked by the organization.
6234    ///
6235    /// [GitHub API docs for get_membership_for_authenticated_user](https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user)
6236    ///
6237    /// ---
6238    #[cfg(not(target_arch = "wasm32"))]
6239    pub fn get_membership_for_authenticated_user(&self, org: &str) -> Result<OrgMembership, AdapterError> {
6240
6241        let request_uri = format!("{}/user/memberships/orgs/{}", super::GITHUB_BASE_API_URL, org);
6242
6243
6244        let req = GitHubRequest {
6245            uri: request_uri,
6246            body: None,
6247            method: "GET",
6248            headers: vec![]
6249        };
6250
6251        let request = self.client.build(req)?;
6252
6253        // --
6254
6255        let github_response = self.client.fetch(request)?;
6256
6257        // --
6258
6259        if github_response.is_success() {
6260            Ok(github_response.to_json()?)
6261        } else {
6262            match github_response.status_code() {
6263                403 => Err(OrgsGetMembershipForAuthenticatedUserError::Status403(github_response.to_json()?).into()),
6264                404 => Err(OrgsGetMembershipForAuthenticatedUserError::Status404(github_response.to_json()?).into()),
6265                code => Err(OrgsGetMembershipForAuthenticatedUserError::Generic { code }.into()),
6266            }
6267        }
6268    }
6269
6270    /// ---
6271    ///
6272    /// # Get organization membership for a user
6273    ///
6274    /// In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status.
6275    ///
6276    /// [GitHub API docs for get_membership_for_user](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user)
6277    ///
6278    /// ---
6279    pub async fn get_membership_for_user_async(&self, org: &str, username: &str) -> Result<OrgMembership, AdapterError> {
6280
6281        let request_uri = format!("{}/orgs/{}/memberships/{}", super::GITHUB_BASE_API_URL, org, username);
6282
6283
6284        let req = GitHubRequest {
6285            uri: request_uri,
6286            body: None::<C::Body>,
6287            method: "GET",
6288            headers: vec![]
6289        };
6290
6291        let request = self.client.build(req)?;
6292
6293        // --
6294
6295        let github_response = self.client.fetch_async(request).await?;
6296
6297        // --
6298
6299        if github_response.is_success() {
6300            Ok(github_response.to_json_async().await?)
6301        } else {
6302            match github_response.status_code() {
6303                404 => Err(OrgsGetMembershipForUserError::Status404(github_response.to_json_async().await?).into()),
6304                403 => Err(OrgsGetMembershipForUserError::Status403(github_response.to_json_async().await?).into()),
6305                code => Err(OrgsGetMembershipForUserError::Generic { code }.into()),
6306            }
6307        }
6308    }
6309
6310    /// ---
6311    ///
6312    /// # Get organization membership for a user
6313    ///
6314    /// In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status.
6315    ///
6316    /// [GitHub API docs for get_membership_for_user](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user)
6317    ///
6318    /// ---
6319    #[cfg(not(target_arch = "wasm32"))]
6320    pub fn get_membership_for_user(&self, org: &str, username: &str) -> Result<OrgMembership, AdapterError> {
6321
6322        let request_uri = format!("{}/orgs/{}/memberships/{}", super::GITHUB_BASE_API_URL, org, username);
6323
6324
6325        let req = GitHubRequest {
6326            uri: request_uri,
6327            body: None,
6328            method: "GET",
6329            headers: vec![]
6330        };
6331
6332        let request = self.client.build(req)?;
6333
6334        // --
6335
6336        let github_response = self.client.fetch(request)?;
6337
6338        // --
6339
6340        if github_response.is_success() {
6341            Ok(github_response.to_json()?)
6342        } else {
6343            match github_response.status_code() {
6344                404 => Err(OrgsGetMembershipForUserError::Status404(github_response.to_json()?).into()),
6345                403 => Err(OrgsGetMembershipForUserError::Status403(github_response.to_json()?).into()),
6346                code => Err(OrgsGetMembershipForUserError::Generic { code }.into()),
6347            }
6348        }
6349    }
6350
6351    /// ---
6352    ///
6353    /// # Get an organization role
6354    ///
6355    /// Gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
6356    /// 
6357    /// To use this endpoint, the authenticated user must be one of:
6358    /// 
6359    /// - An administrator for the organization.
6360    /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.
6361    /// 
6362    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
6363    ///
6364    /// [GitHub API docs for get_org_role](https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role)
6365    ///
6366    /// ---
6367    pub async fn get_org_role_async(&self, org: &str, role_id: i32) -> Result<OrganizationRole, AdapterError> {
6368
6369        let request_uri = format!("{}/orgs/{}/organization-roles/{}", super::GITHUB_BASE_API_URL, org, role_id);
6370
6371
6372        let req = GitHubRequest {
6373            uri: request_uri,
6374            body: None::<C::Body>,
6375            method: "GET",
6376            headers: vec![]
6377        };
6378
6379        let request = self.client.build(req)?;
6380
6381        // --
6382
6383        let github_response = self.client.fetch_async(request).await?;
6384
6385        // --
6386
6387        if github_response.is_success() {
6388            Ok(github_response.to_json_async().await?)
6389        } else {
6390            match github_response.status_code() {
6391                404 => Err(OrgsGetOrgRoleError::Status404(github_response.to_json_async().await?).into()),
6392                422 => Err(OrgsGetOrgRoleError::Status422(github_response.to_json_async().await?).into()),
6393                code => Err(OrgsGetOrgRoleError::Generic { code }.into()),
6394            }
6395        }
6396    }
6397
6398    /// ---
6399    ///
6400    /// # Get an organization role
6401    ///
6402    /// Gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
6403    /// 
6404    /// To use this endpoint, the authenticated user must be one of:
6405    /// 
6406    /// - An administrator for the organization.
6407    /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.
6408    /// 
6409    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
6410    ///
6411    /// [GitHub API docs for get_org_role](https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role)
6412    ///
6413    /// ---
6414    #[cfg(not(target_arch = "wasm32"))]
6415    pub fn get_org_role(&self, org: &str, role_id: i32) -> Result<OrganizationRole, AdapterError> {
6416
6417        let request_uri = format!("{}/orgs/{}/organization-roles/{}", super::GITHUB_BASE_API_URL, org, role_id);
6418
6419
6420        let req = GitHubRequest {
6421            uri: request_uri,
6422            body: None,
6423            method: "GET",
6424            headers: vec![]
6425        };
6426
6427        let request = self.client.build(req)?;
6428
6429        // --
6430
6431        let github_response = self.client.fetch(request)?;
6432
6433        // --
6434
6435        if github_response.is_success() {
6436            Ok(github_response.to_json()?)
6437        } else {
6438            match github_response.status_code() {
6439                404 => Err(OrgsGetOrgRoleError::Status404(github_response.to_json()?).into()),
6440                422 => Err(OrgsGetOrgRoleError::Status422(github_response.to_json()?).into()),
6441                code => Err(OrgsGetOrgRoleError::Generic { code }.into()),
6442            }
6443        }
6444    }
6445
6446    /// ---
6447    ///
6448    /// # Get organization ruleset history
6449    ///
6450    /// Get the history of an organization ruleset.
6451    ///
6452    /// [GitHub API docs for get_org_ruleset_history](https://docs.github.com/rest/orgs/rules#get-organization-ruleset-history)
6453    ///
6454    /// ---
6455    pub async fn get_org_ruleset_history_async(&self, org: &str, ruleset_id: i32, query_params: Option<impl Into<OrgsGetOrgRulesetHistoryParams>>) -> Result<Vec<RulesetVersion>, AdapterError> {
6456
6457        let mut request_uri = format!("{}/orgs/{}/rulesets/{}/history", super::GITHUB_BASE_API_URL, org, ruleset_id);
6458
6459        if let Some(params) = query_params {
6460            request_uri.push_str("?");
6461            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
6462        }
6463
6464        let req = GitHubRequest {
6465            uri: request_uri,
6466            body: None::<C::Body>,
6467            method: "GET",
6468            headers: vec![]
6469        };
6470
6471        let request = self.client.build(req)?;
6472
6473        // --
6474
6475        let github_response = self.client.fetch_async(request).await?;
6476
6477        // --
6478
6479        if github_response.is_success() {
6480            Ok(github_response.to_json_async().await?)
6481        } else {
6482            match github_response.status_code() {
6483                404 => Err(OrgsGetOrgRulesetHistoryError::Status404(github_response.to_json_async().await?).into()),
6484                500 => Err(OrgsGetOrgRulesetHistoryError::Status500(github_response.to_json_async().await?).into()),
6485                code => Err(OrgsGetOrgRulesetHistoryError::Generic { code }.into()),
6486            }
6487        }
6488    }
6489
6490    /// ---
6491    ///
6492    /// # Get organization ruleset history
6493    ///
6494    /// Get the history of an organization ruleset.
6495    ///
6496    /// [GitHub API docs for get_org_ruleset_history](https://docs.github.com/rest/orgs/rules#get-organization-ruleset-history)
6497    ///
6498    /// ---
6499    #[cfg(not(target_arch = "wasm32"))]
6500    pub fn get_org_ruleset_history(&self, org: &str, ruleset_id: i32, query_params: Option<impl Into<OrgsGetOrgRulesetHistoryParams>>) -> Result<Vec<RulesetVersion>, AdapterError> {
6501
6502        let mut request_uri = format!("{}/orgs/{}/rulesets/{}/history", super::GITHUB_BASE_API_URL, org, ruleset_id);
6503
6504        if let Some(params) = query_params {
6505            request_uri.push_str("?");
6506            let qp: OrgsGetOrgRulesetHistoryParams = params.into();
6507            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
6508        }
6509
6510        let req = GitHubRequest {
6511            uri: request_uri,
6512            body: None,
6513            method: "GET",
6514            headers: vec![]
6515        };
6516
6517        let request = self.client.build(req)?;
6518
6519        // --
6520
6521        let github_response = self.client.fetch(request)?;
6522
6523        // --
6524
6525        if github_response.is_success() {
6526            Ok(github_response.to_json()?)
6527        } else {
6528            match github_response.status_code() {
6529                404 => Err(OrgsGetOrgRulesetHistoryError::Status404(github_response.to_json()?).into()),
6530                500 => Err(OrgsGetOrgRulesetHistoryError::Status500(github_response.to_json()?).into()),
6531                code => Err(OrgsGetOrgRulesetHistoryError::Generic { code }.into()),
6532            }
6533        }
6534    }
6535
6536    /// ---
6537    ///
6538    /// # Get organization ruleset version
6539    ///
6540    /// Get a version of an organization ruleset.
6541    ///
6542    /// [GitHub API docs for get_org_ruleset_version](https://docs.github.com/rest/orgs/rules#get-organization-ruleset-version)
6543    ///
6544    /// ---
6545    pub async fn get_org_ruleset_version_async(&self, org: &str, ruleset_id: i32, version_id: i32) -> Result<RulesetVersionWithState, AdapterError> {
6546
6547        let request_uri = format!("{}/orgs/{}/rulesets/{}/history/{}", super::GITHUB_BASE_API_URL, org, ruleset_id, version_id);
6548
6549
6550        let req = GitHubRequest {
6551            uri: request_uri,
6552            body: None::<C::Body>,
6553            method: "GET",
6554            headers: vec![]
6555        };
6556
6557        let request = self.client.build(req)?;
6558
6559        // --
6560
6561        let github_response = self.client.fetch_async(request).await?;
6562
6563        // --
6564
6565        if github_response.is_success() {
6566            Ok(github_response.to_json_async().await?)
6567        } else {
6568            match github_response.status_code() {
6569                404 => Err(OrgsGetOrgRulesetVersionError::Status404(github_response.to_json_async().await?).into()),
6570                500 => Err(OrgsGetOrgRulesetVersionError::Status500(github_response.to_json_async().await?).into()),
6571                code => Err(OrgsGetOrgRulesetVersionError::Generic { code }.into()),
6572            }
6573        }
6574    }
6575
6576    /// ---
6577    ///
6578    /// # Get organization ruleset version
6579    ///
6580    /// Get a version of an organization ruleset.
6581    ///
6582    /// [GitHub API docs for get_org_ruleset_version](https://docs.github.com/rest/orgs/rules#get-organization-ruleset-version)
6583    ///
6584    /// ---
6585    #[cfg(not(target_arch = "wasm32"))]
6586    pub fn get_org_ruleset_version(&self, org: &str, ruleset_id: i32, version_id: i32) -> Result<RulesetVersionWithState, AdapterError> {
6587
6588        let request_uri = format!("{}/orgs/{}/rulesets/{}/history/{}", super::GITHUB_BASE_API_URL, org, ruleset_id, version_id);
6589
6590
6591        let req = GitHubRequest {
6592            uri: request_uri,
6593            body: None,
6594            method: "GET",
6595            headers: vec![]
6596        };
6597
6598        let request = self.client.build(req)?;
6599
6600        // --
6601
6602        let github_response = self.client.fetch(request)?;
6603
6604        // --
6605
6606        if github_response.is_success() {
6607            Ok(github_response.to_json()?)
6608        } else {
6609            match github_response.status_code() {
6610                404 => Err(OrgsGetOrgRulesetVersionError::Status404(github_response.to_json()?).into()),
6611                500 => Err(OrgsGetOrgRulesetVersionError::Status500(github_response.to_json()?).into()),
6612                code => Err(OrgsGetOrgRulesetVersionError::Generic { code }.into()),
6613            }
6614        }
6615    }
6616
6617    /// ---
6618    ///
6619    /// # Get route stats by actor
6620    ///
6621    /// Get API request count statistics for an actor broken down by route within a specified time frame.
6622    ///
6623    /// [GitHub API docs for get_route_stats_by_actor](https://docs.github.com/rest/orgs/api-insights#get-route-stats-by-actor)
6624    ///
6625    /// ---
6626    pub async fn get_route_stats_by_actor_async(&self, org: &str, actor_type: &str, actor_id: i32, query_params: impl Into<OrgsGetRouteStatsByActorParams<'api>>) -> Result<ApiInsightsRouteStats, AdapterError> {
6627
6628        let mut request_uri = format!("{}/orgs/{}/insights/api/route-stats/{}/{}", super::GITHUB_BASE_API_URL, org, actor_type, actor_id);
6629
6630        request_uri.push_str("?");
6631        request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?);
6632
6633        let req = GitHubRequest {
6634            uri: request_uri,
6635            body: None::<C::Body>,
6636            method: "GET",
6637            headers: vec![]
6638        };
6639
6640        let request = self.client.build(req)?;
6641
6642        // --
6643
6644        let github_response = self.client.fetch_async(request).await?;
6645
6646        // --
6647
6648        if github_response.is_success() {
6649            Ok(github_response.to_json_async().await?)
6650        } else {
6651            match github_response.status_code() {
6652                code => Err(OrgsGetRouteStatsByActorError::Generic { code }.into()),
6653            }
6654        }
6655    }
6656
6657    /// ---
6658    ///
6659    /// # Get route stats by actor
6660    ///
6661    /// Get API request count statistics for an actor broken down by route within a specified time frame.
6662    ///
6663    /// [GitHub API docs for get_route_stats_by_actor](https://docs.github.com/rest/orgs/api-insights#get-route-stats-by-actor)
6664    ///
6665    /// ---
6666    #[cfg(not(target_arch = "wasm32"))]
6667    pub fn get_route_stats_by_actor(&self, org: &str, actor_type: &str, actor_id: i32, query_params: impl Into<OrgsGetRouteStatsByActorParams<'api>>) -> Result<ApiInsightsRouteStats, AdapterError> {
6668
6669        let mut request_uri = format!("{}/orgs/{}/insights/api/route-stats/{}/{}", super::GITHUB_BASE_API_URL, org, actor_type, actor_id);
6670
6671        request_uri.push_str("?");
6672        let qp: OrgsGetRouteStatsByActorParams = query_params.into();
6673        request_uri.push_str(&serde_urlencoded::to_string(qp)?);
6674
6675        let req = GitHubRequest {
6676            uri: request_uri,
6677            body: None,
6678            method: "GET",
6679            headers: vec![]
6680        };
6681
6682        let request = self.client.build(req)?;
6683
6684        // --
6685
6686        let github_response = self.client.fetch(request)?;
6687
6688        // --
6689
6690        if github_response.is_success() {
6691            Ok(github_response.to_json()?)
6692        } else {
6693            match github_response.status_code() {
6694                code => Err(OrgsGetRouteStatsByActorError::Generic { code }.into()),
6695            }
6696        }
6697    }
6698
6699    /// ---
6700    ///
6701    /// # Get subject stats
6702    ///
6703    /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps.
6704    ///
6705    /// [GitHub API docs for get_subject_stats](https://docs.github.com/rest/orgs/api-insights#get-subject-stats)
6706    ///
6707    /// ---
6708    pub async fn get_subject_stats_async(&self, org: &str, query_params: impl Into<OrgsGetSubjectStatsParams<'api>>) -> Result<ApiInsightsSubjectStats, AdapterError> {
6709
6710        let mut request_uri = format!("{}/orgs/{}/insights/api/subject-stats", super::GITHUB_BASE_API_URL, org);
6711
6712        request_uri.push_str("?");
6713        request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?);
6714
6715        let req = GitHubRequest {
6716            uri: request_uri,
6717            body: None::<C::Body>,
6718            method: "GET",
6719            headers: vec![]
6720        };
6721
6722        let request = self.client.build(req)?;
6723
6724        // --
6725
6726        let github_response = self.client.fetch_async(request).await?;
6727
6728        // --
6729
6730        if github_response.is_success() {
6731            Ok(github_response.to_json_async().await?)
6732        } else {
6733            match github_response.status_code() {
6734                code => Err(OrgsGetSubjectStatsError::Generic { code }.into()),
6735            }
6736        }
6737    }
6738
6739    /// ---
6740    ///
6741    /// # Get subject stats
6742    ///
6743    /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps.
6744    ///
6745    /// [GitHub API docs for get_subject_stats](https://docs.github.com/rest/orgs/api-insights#get-subject-stats)
6746    ///
6747    /// ---
6748    #[cfg(not(target_arch = "wasm32"))]
6749    pub fn get_subject_stats(&self, org: &str, query_params: impl Into<OrgsGetSubjectStatsParams<'api>>) -> Result<ApiInsightsSubjectStats, AdapterError> {
6750
6751        let mut request_uri = format!("{}/orgs/{}/insights/api/subject-stats", super::GITHUB_BASE_API_URL, org);
6752
6753        request_uri.push_str("?");
6754        let qp: OrgsGetSubjectStatsParams = query_params.into();
6755        request_uri.push_str(&serde_urlencoded::to_string(qp)?);
6756
6757        let req = GitHubRequest {
6758            uri: request_uri,
6759            body: None,
6760            method: "GET",
6761            headers: vec![]
6762        };
6763
6764        let request = self.client.build(req)?;
6765
6766        // --
6767
6768        let github_response = self.client.fetch(request)?;
6769
6770        // --
6771
6772        if github_response.is_success() {
6773            Ok(github_response.to_json()?)
6774        } else {
6775            match github_response.status_code() {
6776                code => Err(OrgsGetSubjectStatsError::Generic { code }.into()),
6777            }
6778        }
6779    }
6780
6781    /// ---
6782    ///
6783    /// # Get summary stats
6784    ///
6785    /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame.
6786    ///
6787    /// [GitHub API docs for get_summary_stats](https://docs.github.com/rest/orgs/api-insights#get-summary-stats)
6788    ///
6789    /// ---
6790    pub async fn get_summary_stats_async(&self, org: &str, query_params: impl Into<OrgsGetSummaryStatsParams<'api>>) -> Result<ApiInsightsSummaryStats, AdapterError> {
6791
6792        let mut request_uri = format!("{}/orgs/{}/insights/api/summary-stats", super::GITHUB_BASE_API_URL, org);
6793
6794        request_uri.push_str("?");
6795        request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?);
6796
6797        let req = GitHubRequest {
6798            uri: request_uri,
6799            body: None::<C::Body>,
6800            method: "GET",
6801            headers: vec![]
6802        };
6803
6804        let request = self.client.build(req)?;
6805
6806        // --
6807
6808        let github_response = self.client.fetch_async(request).await?;
6809
6810        // --
6811
6812        if github_response.is_success() {
6813            Ok(github_response.to_json_async().await?)
6814        } else {
6815            match github_response.status_code() {
6816                code => Err(OrgsGetSummaryStatsError::Generic { code }.into()),
6817            }
6818        }
6819    }
6820
6821    /// ---
6822    ///
6823    /// # Get summary stats
6824    ///
6825    /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame.
6826    ///
6827    /// [GitHub API docs for get_summary_stats](https://docs.github.com/rest/orgs/api-insights#get-summary-stats)
6828    ///
6829    /// ---
6830    #[cfg(not(target_arch = "wasm32"))]
6831    pub fn get_summary_stats(&self, org: &str, query_params: impl Into<OrgsGetSummaryStatsParams<'api>>) -> Result<ApiInsightsSummaryStats, AdapterError> {
6832
6833        let mut request_uri = format!("{}/orgs/{}/insights/api/summary-stats", super::GITHUB_BASE_API_URL, org);
6834
6835        request_uri.push_str("?");
6836        let qp: OrgsGetSummaryStatsParams = query_params.into();
6837        request_uri.push_str(&serde_urlencoded::to_string(qp)?);
6838
6839        let req = GitHubRequest {
6840            uri: request_uri,
6841            body: None,
6842            method: "GET",
6843            headers: vec![]
6844        };
6845
6846        let request = self.client.build(req)?;
6847
6848        // --
6849
6850        let github_response = self.client.fetch(request)?;
6851
6852        // --
6853
6854        if github_response.is_success() {
6855            Ok(github_response.to_json()?)
6856        } else {
6857            match github_response.status_code() {
6858                code => Err(OrgsGetSummaryStatsError::Generic { code }.into()),
6859            }
6860        }
6861    }
6862
6863    /// ---
6864    ///
6865    /// # Get summary stats by actor
6866    ///
6867    /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user.
6868    ///
6869    /// [GitHub API docs for get_summary_stats_by_actor](https://docs.github.com/rest/orgs/api-insights#get-summary-stats-by-actor)
6870    ///
6871    /// ---
6872    pub async fn get_summary_stats_by_actor_async(&self, org: &str, actor_type: &str, actor_id: i32, query_params: impl Into<OrgsGetSummaryStatsByActorParams<'api>>) -> Result<ApiInsightsSummaryStats, AdapterError> {
6873
6874        let mut request_uri = format!("{}/orgs/{}/insights/api/summary-stats/{}/{}", super::GITHUB_BASE_API_URL, org, actor_type, actor_id);
6875
6876        request_uri.push_str("?");
6877        request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?);
6878
6879        let req = GitHubRequest {
6880            uri: request_uri,
6881            body: None::<C::Body>,
6882            method: "GET",
6883            headers: vec![]
6884        };
6885
6886        let request = self.client.build(req)?;
6887
6888        // --
6889
6890        let github_response = self.client.fetch_async(request).await?;
6891
6892        // --
6893
6894        if github_response.is_success() {
6895            Ok(github_response.to_json_async().await?)
6896        } else {
6897            match github_response.status_code() {
6898                code => Err(OrgsGetSummaryStatsByActorError::Generic { code }.into()),
6899            }
6900        }
6901    }
6902
6903    /// ---
6904    ///
6905    /// # Get summary stats by actor
6906    ///
6907    /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user.
6908    ///
6909    /// [GitHub API docs for get_summary_stats_by_actor](https://docs.github.com/rest/orgs/api-insights#get-summary-stats-by-actor)
6910    ///
6911    /// ---
6912    #[cfg(not(target_arch = "wasm32"))]
6913    pub fn get_summary_stats_by_actor(&self, org: &str, actor_type: &str, actor_id: i32, query_params: impl Into<OrgsGetSummaryStatsByActorParams<'api>>) -> Result<ApiInsightsSummaryStats, AdapterError> {
6914
6915        let mut request_uri = format!("{}/orgs/{}/insights/api/summary-stats/{}/{}", super::GITHUB_BASE_API_URL, org, actor_type, actor_id);
6916
6917        request_uri.push_str("?");
6918        let qp: OrgsGetSummaryStatsByActorParams = query_params.into();
6919        request_uri.push_str(&serde_urlencoded::to_string(qp)?);
6920
6921        let req = GitHubRequest {
6922            uri: request_uri,
6923            body: None,
6924            method: "GET",
6925            headers: vec![]
6926        };
6927
6928        let request = self.client.build(req)?;
6929
6930        // --
6931
6932        let github_response = self.client.fetch(request)?;
6933
6934        // --
6935
6936        if github_response.is_success() {
6937            Ok(github_response.to_json()?)
6938        } else {
6939            match github_response.status_code() {
6940                code => Err(OrgsGetSummaryStatsByActorError::Generic { code }.into()),
6941            }
6942        }
6943    }
6944
6945    /// ---
6946    ///
6947    /// # Get summary stats by user
6948    ///
6949    /// Get overall statistics of API requests within the organization for a user.
6950    ///
6951    /// [GitHub API docs for get_summary_stats_by_user](https://docs.github.com/rest/orgs/api-insights#get-summary-stats-by-user)
6952    ///
6953    /// ---
6954    pub async fn get_summary_stats_by_user_async(&self, org: &str, user_id: &str, query_params: impl Into<OrgsGetSummaryStatsByUserParams<'api>>) -> Result<ApiInsightsSummaryStats, AdapterError> {
6955
6956        let mut request_uri = format!("{}/orgs/{}/insights/api/summary-stats/users/{}", super::GITHUB_BASE_API_URL, org, user_id);
6957
6958        request_uri.push_str("?");
6959        request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?);
6960
6961        let req = GitHubRequest {
6962            uri: request_uri,
6963            body: None::<C::Body>,
6964            method: "GET",
6965            headers: vec![]
6966        };
6967
6968        let request = self.client.build(req)?;
6969
6970        // --
6971
6972        let github_response = self.client.fetch_async(request).await?;
6973
6974        // --
6975
6976        if github_response.is_success() {
6977            Ok(github_response.to_json_async().await?)
6978        } else {
6979            match github_response.status_code() {
6980                code => Err(OrgsGetSummaryStatsByUserError::Generic { code }.into()),
6981            }
6982        }
6983    }
6984
6985    /// ---
6986    ///
6987    /// # Get summary stats by user
6988    ///
6989    /// Get overall statistics of API requests within the organization for a user.
6990    ///
6991    /// [GitHub API docs for get_summary_stats_by_user](https://docs.github.com/rest/orgs/api-insights#get-summary-stats-by-user)
6992    ///
6993    /// ---
6994    #[cfg(not(target_arch = "wasm32"))]
6995    pub fn get_summary_stats_by_user(&self, org: &str, user_id: &str, query_params: impl Into<OrgsGetSummaryStatsByUserParams<'api>>) -> Result<ApiInsightsSummaryStats, AdapterError> {
6996
6997        let mut request_uri = format!("{}/orgs/{}/insights/api/summary-stats/users/{}", super::GITHUB_BASE_API_URL, org, user_id);
6998
6999        request_uri.push_str("?");
7000        let qp: OrgsGetSummaryStatsByUserParams = query_params.into();
7001        request_uri.push_str(&serde_urlencoded::to_string(qp)?);
7002
7003        let req = GitHubRequest {
7004            uri: request_uri,
7005            body: None,
7006            method: "GET",
7007            headers: vec![]
7008        };
7009
7010        let request = self.client.build(req)?;
7011
7012        // --
7013
7014        let github_response = self.client.fetch(request)?;
7015
7016        // --
7017
7018        if github_response.is_success() {
7019            Ok(github_response.to_json()?)
7020        } else {
7021            match github_response.status_code() {
7022                code => Err(OrgsGetSummaryStatsByUserError::Generic { code }.into()),
7023            }
7024        }
7025    }
7026
7027    /// ---
7028    ///
7029    /// # Get time stats
7030    ///
7031    /// Get the number of API requests and rate-limited requests made within an organization over a specified time period.
7032    ///
7033    /// [GitHub API docs for get_time_stats](https://docs.github.com/rest/orgs/api-insights#get-time-stats)
7034    ///
7035    /// ---
7036    pub async fn get_time_stats_async(&self, org: &str, query_params: impl Into<OrgsGetTimeStatsParams<'api>>) -> Result<ApiInsightsTimeStats, AdapterError> {
7037
7038        let mut request_uri = format!("{}/orgs/{}/insights/api/time-stats", super::GITHUB_BASE_API_URL, org);
7039
7040        request_uri.push_str("?");
7041        request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?);
7042
7043        let req = GitHubRequest {
7044            uri: request_uri,
7045            body: None::<C::Body>,
7046            method: "GET",
7047            headers: vec![]
7048        };
7049
7050        let request = self.client.build(req)?;
7051
7052        // --
7053
7054        let github_response = self.client.fetch_async(request).await?;
7055
7056        // --
7057
7058        if github_response.is_success() {
7059            Ok(github_response.to_json_async().await?)
7060        } else {
7061            match github_response.status_code() {
7062                code => Err(OrgsGetTimeStatsError::Generic { code }.into()),
7063            }
7064        }
7065    }
7066
7067    /// ---
7068    ///
7069    /// # Get time stats
7070    ///
7071    /// Get the number of API requests and rate-limited requests made within an organization over a specified time period.
7072    ///
7073    /// [GitHub API docs for get_time_stats](https://docs.github.com/rest/orgs/api-insights#get-time-stats)
7074    ///
7075    /// ---
7076    #[cfg(not(target_arch = "wasm32"))]
7077    pub fn get_time_stats(&self, org: &str, query_params: impl Into<OrgsGetTimeStatsParams<'api>>) -> Result<ApiInsightsTimeStats, AdapterError> {
7078
7079        let mut request_uri = format!("{}/orgs/{}/insights/api/time-stats", super::GITHUB_BASE_API_URL, org);
7080
7081        request_uri.push_str("?");
7082        let qp: OrgsGetTimeStatsParams = query_params.into();
7083        request_uri.push_str(&serde_urlencoded::to_string(qp)?);
7084
7085        let req = GitHubRequest {
7086            uri: request_uri,
7087            body: None,
7088            method: "GET",
7089            headers: vec![]
7090        };
7091
7092        let request = self.client.build(req)?;
7093
7094        // --
7095
7096        let github_response = self.client.fetch(request)?;
7097
7098        // --
7099
7100        if github_response.is_success() {
7101            Ok(github_response.to_json()?)
7102        } else {
7103            match github_response.status_code() {
7104                code => Err(OrgsGetTimeStatsError::Generic { code }.into()),
7105            }
7106        }
7107    }
7108
7109    /// ---
7110    ///
7111    /// # Get time stats by actor
7112    ///
7113    /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period.
7114    ///
7115    /// [GitHub API docs for get_time_stats_by_actor](https://docs.github.com/rest/orgs/api-insights#get-time-stats-by-actor)
7116    ///
7117    /// ---
7118    pub async fn get_time_stats_by_actor_async(&self, org: &str, actor_type: &str, actor_id: i32, query_params: impl Into<OrgsGetTimeStatsByActorParams<'api>>) -> Result<ApiInsightsTimeStats, AdapterError> {
7119
7120        let mut request_uri = format!("{}/orgs/{}/insights/api/time-stats/{}/{}", super::GITHUB_BASE_API_URL, org, actor_type, actor_id);
7121
7122        request_uri.push_str("?");
7123        request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?);
7124
7125        let req = GitHubRequest {
7126            uri: request_uri,
7127            body: None::<C::Body>,
7128            method: "GET",
7129            headers: vec![]
7130        };
7131
7132        let request = self.client.build(req)?;
7133
7134        // --
7135
7136        let github_response = self.client.fetch_async(request).await?;
7137
7138        // --
7139
7140        if github_response.is_success() {
7141            Ok(github_response.to_json_async().await?)
7142        } else {
7143            match github_response.status_code() {
7144                code => Err(OrgsGetTimeStatsByActorError::Generic { code }.into()),
7145            }
7146        }
7147    }
7148
7149    /// ---
7150    ///
7151    /// # Get time stats by actor
7152    ///
7153    /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period.
7154    ///
7155    /// [GitHub API docs for get_time_stats_by_actor](https://docs.github.com/rest/orgs/api-insights#get-time-stats-by-actor)
7156    ///
7157    /// ---
7158    #[cfg(not(target_arch = "wasm32"))]
7159    pub fn get_time_stats_by_actor(&self, org: &str, actor_type: &str, actor_id: i32, query_params: impl Into<OrgsGetTimeStatsByActorParams<'api>>) -> Result<ApiInsightsTimeStats, AdapterError> {
7160
7161        let mut request_uri = format!("{}/orgs/{}/insights/api/time-stats/{}/{}", super::GITHUB_BASE_API_URL, org, actor_type, actor_id);
7162
7163        request_uri.push_str("?");
7164        let qp: OrgsGetTimeStatsByActorParams = query_params.into();
7165        request_uri.push_str(&serde_urlencoded::to_string(qp)?);
7166
7167        let req = GitHubRequest {
7168            uri: request_uri,
7169            body: None,
7170            method: "GET",
7171            headers: vec![]
7172        };
7173
7174        let request = self.client.build(req)?;
7175
7176        // --
7177
7178        let github_response = self.client.fetch(request)?;
7179
7180        // --
7181
7182        if github_response.is_success() {
7183            Ok(github_response.to_json()?)
7184        } else {
7185            match github_response.status_code() {
7186                code => Err(OrgsGetTimeStatsByActorError::Generic { code }.into()),
7187            }
7188        }
7189    }
7190
7191    /// ---
7192    ///
7193    /// # Get time stats by user
7194    ///
7195    /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period.
7196    ///
7197    /// [GitHub API docs for get_time_stats_by_user](https://docs.github.com/rest/orgs/api-insights#get-time-stats-by-user)
7198    ///
7199    /// ---
7200    pub async fn get_time_stats_by_user_async(&self, org: &str, user_id: &str, query_params: impl Into<OrgsGetTimeStatsByUserParams<'api>>) -> Result<ApiInsightsTimeStats, AdapterError> {
7201
7202        let mut request_uri = format!("{}/orgs/{}/insights/api/time-stats/users/{}", super::GITHUB_BASE_API_URL, org, user_id);
7203
7204        request_uri.push_str("?");
7205        request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?);
7206
7207        let req = GitHubRequest {
7208            uri: request_uri,
7209            body: None::<C::Body>,
7210            method: "GET",
7211            headers: vec![]
7212        };
7213
7214        let request = self.client.build(req)?;
7215
7216        // --
7217
7218        let github_response = self.client.fetch_async(request).await?;
7219
7220        // --
7221
7222        if github_response.is_success() {
7223            Ok(github_response.to_json_async().await?)
7224        } else {
7225            match github_response.status_code() {
7226                code => Err(OrgsGetTimeStatsByUserError::Generic { code }.into()),
7227            }
7228        }
7229    }
7230
7231    /// ---
7232    ///
7233    /// # Get time stats by user
7234    ///
7235    /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period.
7236    ///
7237    /// [GitHub API docs for get_time_stats_by_user](https://docs.github.com/rest/orgs/api-insights#get-time-stats-by-user)
7238    ///
7239    /// ---
7240    #[cfg(not(target_arch = "wasm32"))]
7241    pub fn get_time_stats_by_user(&self, org: &str, user_id: &str, query_params: impl Into<OrgsGetTimeStatsByUserParams<'api>>) -> Result<ApiInsightsTimeStats, AdapterError> {
7242
7243        let mut request_uri = format!("{}/orgs/{}/insights/api/time-stats/users/{}", super::GITHUB_BASE_API_URL, org, user_id);
7244
7245        request_uri.push_str("?");
7246        let qp: OrgsGetTimeStatsByUserParams = query_params.into();
7247        request_uri.push_str(&serde_urlencoded::to_string(qp)?);
7248
7249        let req = GitHubRequest {
7250            uri: request_uri,
7251            body: None,
7252            method: "GET",
7253            headers: vec![]
7254        };
7255
7256        let request = self.client.build(req)?;
7257
7258        // --
7259
7260        let github_response = self.client.fetch(request)?;
7261
7262        // --
7263
7264        if github_response.is_success() {
7265            Ok(github_response.to_json()?)
7266        } else {
7267            match github_response.status_code() {
7268                code => Err(OrgsGetTimeStatsByUserError::Generic { code }.into()),
7269            }
7270        }
7271    }
7272
7273    /// ---
7274    ///
7275    /// # Get user stats
7276    ///
7277    /// Get API usage statistics within an organization for a user broken down by the type of access.
7278    ///
7279    /// [GitHub API docs for get_user_stats](https://docs.github.com/rest/orgs/api-insights#get-user-stats)
7280    ///
7281    /// ---
7282    pub async fn get_user_stats_async(&self, org: &str, user_id: &str, query_params: impl Into<OrgsGetUserStatsParams<'api>>) -> Result<ApiInsightsUserStats, AdapterError> {
7283
7284        let mut request_uri = format!("{}/orgs/{}/insights/api/user-stats/{}", super::GITHUB_BASE_API_URL, org, user_id);
7285
7286        request_uri.push_str("?");
7287        request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?);
7288
7289        let req = GitHubRequest {
7290            uri: request_uri,
7291            body: None::<C::Body>,
7292            method: "GET",
7293            headers: vec![]
7294        };
7295
7296        let request = self.client.build(req)?;
7297
7298        // --
7299
7300        let github_response = self.client.fetch_async(request).await?;
7301
7302        // --
7303
7304        if github_response.is_success() {
7305            Ok(github_response.to_json_async().await?)
7306        } else {
7307            match github_response.status_code() {
7308                code => Err(OrgsGetUserStatsError::Generic { code }.into()),
7309            }
7310        }
7311    }
7312
7313    /// ---
7314    ///
7315    /// # Get user stats
7316    ///
7317    /// Get API usage statistics within an organization for a user broken down by the type of access.
7318    ///
7319    /// [GitHub API docs for get_user_stats](https://docs.github.com/rest/orgs/api-insights#get-user-stats)
7320    ///
7321    /// ---
7322    #[cfg(not(target_arch = "wasm32"))]
7323    pub fn get_user_stats(&self, org: &str, user_id: &str, query_params: impl Into<OrgsGetUserStatsParams<'api>>) -> Result<ApiInsightsUserStats, AdapterError> {
7324
7325        let mut request_uri = format!("{}/orgs/{}/insights/api/user-stats/{}", super::GITHUB_BASE_API_URL, org, user_id);
7326
7327        request_uri.push_str("?");
7328        let qp: OrgsGetUserStatsParams = query_params.into();
7329        request_uri.push_str(&serde_urlencoded::to_string(qp)?);
7330
7331        let req = GitHubRequest {
7332            uri: request_uri,
7333            body: None,
7334            method: "GET",
7335            headers: vec![]
7336        };
7337
7338        let request = self.client.build(req)?;
7339
7340        // --
7341
7342        let github_response = self.client.fetch(request)?;
7343
7344        // --
7345
7346        if github_response.is_success() {
7347            Ok(github_response.to_json()?)
7348        } else {
7349            match github_response.status_code() {
7350                code => Err(OrgsGetUserStatsError::Generic { code }.into()),
7351            }
7352        }
7353    }
7354
7355    /// ---
7356    ///
7357    /// # Get an organization webhook
7358    ///
7359    /// Returns a webhook configured in an organization. To get only the webhook
7360    /// `config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization).
7361    /// 
7362    /// You must be an organization owner to use this endpoint.
7363    /// 
7364    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
7365    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
7366    ///
7367    /// [GitHub API docs for get_webhook](https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook)
7368    ///
7369    /// ---
7370    pub async fn get_webhook_async(&self, org: &str, hook_id: i32) -> Result<OrgHook, AdapterError> {
7371
7372        let request_uri = format!("{}/orgs/{}/hooks/{}", super::GITHUB_BASE_API_URL, org, hook_id);
7373
7374
7375        let req = GitHubRequest {
7376            uri: request_uri,
7377            body: None::<C::Body>,
7378            method: "GET",
7379            headers: vec![]
7380        };
7381
7382        let request = self.client.build(req)?;
7383
7384        // --
7385
7386        let github_response = self.client.fetch_async(request).await?;
7387
7388        // --
7389
7390        if github_response.is_success() {
7391            Ok(github_response.to_json_async().await?)
7392        } else {
7393            match github_response.status_code() {
7394                404 => Err(OrgsGetWebhookError::Status404(github_response.to_json_async().await?).into()),
7395                code => Err(OrgsGetWebhookError::Generic { code }.into()),
7396            }
7397        }
7398    }
7399
7400    /// ---
7401    ///
7402    /// # Get an organization webhook
7403    ///
7404    /// Returns a webhook configured in an organization. To get only the webhook
7405    /// `config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization).
7406    /// 
7407    /// You must be an organization owner to use this endpoint.
7408    /// 
7409    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
7410    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
7411    ///
7412    /// [GitHub API docs for get_webhook](https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook)
7413    ///
7414    /// ---
7415    #[cfg(not(target_arch = "wasm32"))]
7416    pub fn get_webhook(&self, org: &str, hook_id: i32) -> Result<OrgHook, AdapterError> {
7417
7418        let request_uri = format!("{}/orgs/{}/hooks/{}", super::GITHUB_BASE_API_URL, org, hook_id);
7419
7420
7421        let req = GitHubRequest {
7422            uri: request_uri,
7423            body: None,
7424            method: "GET",
7425            headers: vec![]
7426        };
7427
7428        let request = self.client.build(req)?;
7429
7430        // --
7431
7432        let github_response = self.client.fetch(request)?;
7433
7434        // --
7435
7436        if github_response.is_success() {
7437            Ok(github_response.to_json()?)
7438        } else {
7439            match github_response.status_code() {
7440                404 => Err(OrgsGetWebhookError::Status404(github_response.to_json()?).into()),
7441                code => Err(OrgsGetWebhookError::Generic { code }.into()),
7442            }
7443        }
7444    }
7445
7446    /// ---
7447    ///
7448    /// # Get a webhook configuration for an organization
7449    ///
7450    /// Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)."
7451    /// 
7452    /// You must be an organization owner to use this endpoint.
7453    /// 
7454    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
7455    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
7456    ///
7457    /// [GitHub API docs for get_webhook_config_for_org](https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization)
7458    ///
7459    /// ---
7460    pub async fn get_webhook_config_for_org_async(&self, org: &str, hook_id: i32) -> Result<WebhookConfig, AdapterError> {
7461
7462        let request_uri = format!("{}/orgs/{}/hooks/{}/config", super::GITHUB_BASE_API_URL, org, hook_id);
7463
7464
7465        let req = GitHubRequest {
7466            uri: request_uri,
7467            body: None::<C::Body>,
7468            method: "GET",
7469            headers: vec![]
7470        };
7471
7472        let request = self.client.build(req)?;
7473
7474        // --
7475
7476        let github_response = self.client.fetch_async(request).await?;
7477
7478        // --
7479
7480        if github_response.is_success() {
7481            Ok(github_response.to_json_async().await?)
7482        } else {
7483            match github_response.status_code() {
7484                code => Err(OrgsGetWebhookConfigForOrgError::Generic { code }.into()),
7485            }
7486        }
7487    }
7488
7489    /// ---
7490    ///
7491    /// # Get a webhook configuration for an organization
7492    ///
7493    /// Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)."
7494    /// 
7495    /// You must be an organization owner to use this endpoint.
7496    /// 
7497    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
7498    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
7499    ///
7500    /// [GitHub API docs for get_webhook_config_for_org](https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization)
7501    ///
7502    /// ---
7503    #[cfg(not(target_arch = "wasm32"))]
7504    pub fn get_webhook_config_for_org(&self, org: &str, hook_id: i32) -> Result<WebhookConfig, AdapterError> {
7505
7506        let request_uri = format!("{}/orgs/{}/hooks/{}/config", super::GITHUB_BASE_API_URL, org, hook_id);
7507
7508
7509        let req = GitHubRequest {
7510            uri: request_uri,
7511            body: None,
7512            method: "GET",
7513            headers: vec![]
7514        };
7515
7516        let request = self.client.build(req)?;
7517
7518        // --
7519
7520        let github_response = self.client.fetch(request)?;
7521
7522        // --
7523
7524        if github_response.is_success() {
7525            Ok(github_response.to_json()?)
7526        } else {
7527            match github_response.status_code() {
7528                code => Err(OrgsGetWebhookConfigForOrgError::Generic { code }.into()),
7529            }
7530        }
7531    }
7532
7533    /// ---
7534    ///
7535    /// # Get a webhook delivery for an organization webhook
7536    ///
7537    /// Returns a delivery for a webhook configured in an organization.
7538    /// 
7539    /// You must be an organization owner to use this endpoint.
7540    /// 
7541    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
7542    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
7543    ///
7544    /// [GitHub API docs for get_webhook_delivery](https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook)
7545    ///
7546    /// ---
7547    pub async fn get_webhook_delivery_async(&self, org: &str, hook_id: i32, delivery_id: i32) -> Result<HookDelivery, AdapterError> {
7548
7549        let request_uri = format!("{}/orgs/{}/hooks/{}/deliveries/{}", super::GITHUB_BASE_API_URL, org, hook_id, delivery_id);
7550
7551
7552        let req = GitHubRequest {
7553            uri: request_uri,
7554            body: None::<C::Body>,
7555            method: "GET",
7556            headers: vec![]
7557        };
7558
7559        let request = self.client.build(req)?;
7560
7561        // --
7562
7563        let github_response = self.client.fetch_async(request).await?;
7564
7565        // --
7566
7567        if github_response.is_success() {
7568            Ok(github_response.to_json_async().await?)
7569        } else {
7570            match github_response.status_code() {
7571                400 => Err(OrgsGetWebhookDeliveryError::Status400(github_response.to_json_async().await?).into()),
7572                422 => Err(OrgsGetWebhookDeliveryError::Status422(github_response.to_json_async().await?).into()),
7573                code => Err(OrgsGetWebhookDeliveryError::Generic { code }.into()),
7574            }
7575        }
7576    }
7577
7578    /// ---
7579    ///
7580    /// # Get a webhook delivery for an organization webhook
7581    ///
7582    /// Returns a delivery for a webhook configured in an organization.
7583    /// 
7584    /// You must be an organization owner to use this endpoint.
7585    /// 
7586    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
7587    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
7588    ///
7589    /// [GitHub API docs for get_webhook_delivery](https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook)
7590    ///
7591    /// ---
7592    #[cfg(not(target_arch = "wasm32"))]
7593    pub fn get_webhook_delivery(&self, org: &str, hook_id: i32, delivery_id: i32) -> Result<HookDelivery, AdapterError> {
7594
7595        let request_uri = format!("{}/orgs/{}/hooks/{}/deliveries/{}", super::GITHUB_BASE_API_URL, org, hook_id, delivery_id);
7596
7597
7598        let req = GitHubRequest {
7599            uri: request_uri,
7600            body: None,
7601            method: "GET",
7602            headers: vec![]
7603        };
7604
7605        let request = self.client.build(req)?;
7606
7607        // --
7608
7609        let github_response = self.client.fetch(request)?;
7610
7611        // --
7612
7613        if github_response.is_success() {
7614            Ok(github_response.to_json()?)
7615        } else {
7616            match github_response.status_code() {
7617                400 => Err(OrgsGetWebhookDeliveryError::Status400(github_response.to_json()?).into()),
7618                422 => Err(OrgsGetWebhookDeliveryError::Status422(github_response.to_json()?).into()),
7619                code => Err(OrgsGetWebhookDeliveryError::Generic { code }.into()),
7620            }
7621        }
7622    }
7623
7624    /// ---
7625    ///
7626    /// # List organizations
7627    ///
7628    /// Lists all organizations, in the order that they were created.
7629    /// 
7630    /// > [!NOTE]
7631    /// > 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 organizations.
7632    ///
7633    /// [GitHub API docs for list](https://docs.github.com/rest/orgs/orgs#list-organizations)
7634    ///
7635    /// ---
7636    pub async fn list_async(&self, query_params: Option<impl Into<OrgsListParams>>) -> Result<Vec<OrganizationSimple>, AdapterError> {
7637
7638        let mut request_uri = format!("{}/organizations", super::GITHUB_BASE_API_URL);
7639
7640        if let Some(params) = query_params {
7641            request_uri.push_str("?");
7642            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
7643        }
7644
7645        let req = GitHubRequest {
7646            uri: request_uri,
7647            body: None::<C::Body>,
7648            method: "GET",
7649            headers: vec![]
7650        };
7651
7652        let request = self.client.build(req)?;
7653
7654        // --
7655
7656        let github_response = self.client.fetch_async(request).await?;
7657
7658        // --
7659
7660        if github_response.is_success() {
7661            Ok(github_response.to_json_async().await?)
7662        } else {
7663            match github_response.status_code() {
7664                304 => Err(OrgsListError::Status304.into()),
7665                code => Err(OrgsListError::Generic { code }.into()),
7666            }
7667        }
7668    }
7669
7670    /// ---
7671    ///
7672    /// # List organizations
7673    ///
7674    /// Lists all organizations, in the order that they were created.
7675    /// 
7676    /// > [!NOTE]
7677    /// > 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 organizations.
7678    ///
7679    /// [GitHub API docs for list](https://docs.github.com/rest/orgs/orgs#list-organizations)
7680    ///
7681    /// ---
7682    #[cfg(not(target_arch = "wasm32"))]
7683    pub fn list(&self, query_params: Option<impl Into<OrgsListParams>>) -> Result<Vec<OrganizationSimple>, AdapterError> {
7684
7685        let mut request_uri = format!("{}/organizations", super::GITHUB_BASE_API_URL);
7686
7687        if let Some(params) = query_params {
7688            request_uri.push_str("?");
7689            let qp: OrgsListParams = params.into();
7690            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
7691        }
7692
7693        let req = GitHubRequest {
7694            uri: request_uri,
7695            body: None,
7696            method: "GET",
7697            headers: vec![]
7698        };
7699
7700        let request = self.client.build(req)?;
7701
7702        // --
7703
7704        let github_response = self.client.fetch(request)?;
7705
7706        // --
7707
7708        if github_response.is_success() {
7709            Ok(github_response.to_json()?)
7710        } else {
7711            match github_response.status_code() {
7712                304 => Err(OrgsListError::Status304.into()),
7713                code => Err(OrgsListError::Generic { code }.into()),
7714            }
7715        }
7716    }
7717
7718    /// ---
7719    ///
7720    /// # List app installations for an organization
7721    ///
7722    /// Lists all GitHub Apps in an organization. The installation count includes
7723    /// all GitHub Apps installed on repositories in the organization.
7724    /// 
7725    /// The authenticated user must be an organization owner to use this endpoint.
7726    /// 
7727    /// OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint.
7728    ///
7729    /// [GitHub API docs for list_app_installations](https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization)
7730    ///
7731    /// ---
7732    pub async fn list_app_installations_async(&self, org: &str, query_params: Option<impl Into<OrgsListAppInstallationsParams>>) -> Result<GetAppsListInstallationsForAuthenticatedUserResponse200, AdapterError> {
7733
7734        let mut request_uri = format!("{}/orgs/{}/installations", super::GITHUB_BASE_API_URL, org);
7735
7736        if let Some(params) = query_params {
7737            request_uri.push_str("?");
7738            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
7739        }
7740
7741        let req = GitHubRequest {
7742            uri: request_uri,
7743            body: None::<C::Body>,
7744            method: "GET",
7745            headers: vec![]
7746        };
7747
7748        let request = self.client.build(req)?;
7749
7750        // --
7751
7752        let github_response = self.client.fetch_async(request).await?;
7753
7754        // --
7755
7756        if github_response.is_success() {
7757            Ok(github_response.to_json_async().await?)
7758        } else {
7759            match github_response.status_code() {
7760                code => Err(OrgsListAppInstallationsError::Generic { code }.into()),
7761            }
7762        }
7763    }
7764
7765    /// ---
7766    ///
7767    /// # List app installations for an organization
7768    ///
7769    /// Lists all GitHub Apps in an organization. The installation count includes
7770    /// all GitHub Apps installed on repositories in the organization.
7771    /// 
7772    /// The authenticated user must be an organization owner to use this endpoint.
7773    /// 
7774    /// OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint.
7775    ///
7776    /// [GitHub API docs for list_app_installations](https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization)
7777    ///
7778    /// ---
7779    #[cfg(not(target_arch = "wasm32"))]
7780    pub fn list_app_installations(&self, org: &str, query_params: Option<impl Into<OrgsListAppInstallationsParams>>) -> Result<GetAppsListInstallationsForAuthenticatedUserResponse200, AdapterError> {
7781
7782        let mut request_uri = format!("{}/orgs/{}/installations", super::GITHUB_BASE_API_URL, org);
7783
7784        if let Some(params) = query_params {
7785            request_uri.push_str("?");
7786            let qp: OrgsListAppInstallationsParams = params.into();
7787            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
7788        }
7789
7790        let req = GitHubRequest {
7791            uri: request_uri,
7792            body: None,
7793            method: "GET",
7794            headers: vec![]
7795        };
7796
7797        let request = self.client.build(req)?;
7798
7799        // --
7800
7801        let github_response = self.client.fetch(request)?;
7802
7803        // --
7804
7805        if github_response.is_success() {
7806            Ok(github_response.to_json()?)
7807        } else {
7808            match github_response.status_code() {
7809                code => Err(OrgsListAppInstallationsError::Generic { code }.into()),
7810            }
7811        }
7812    }
7813
7814    /// ---
7815    ///
7816    /// # List attestations
7817    ///
7818    /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization.
7819    /// 
7820    /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required.
7821    /// 
7822    /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
7823    ///
7824    /// [GitHub API docs for list_attestations](https://docs.github.com/rest/orgs/orgs#list-attestations)
7825    ///
7826    /// ---
7827    pub async fn list_attestations_async(&self, org: &str, subject_digest: &str, query_params: Option<impl Into<OrgsListAttestationsParams<'api>>>) -> Result<GetUsersListAttestationsResponse200, AdapterError> {
7828
7829        let mut request_uri = format!("{}/orgs/{}/attestations/{}", super::GITHUB_BASE_API_URL, org, subject_digest);
7830
7831        if let Some(params) = query_params {
7832            request_uri.push_str("?");
7833            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
7834        }
7835
7836        let req = GitHubRequest {
7837            uri: request_uri,
7838            body: None::<C::Body>,
7839            method: "GET",
7840            headers: vec![]
7841        };
7842
7843        let request = self.client.build(req)?;
7844
7845        // --
7846
7847        let github_response = self.client.fetch_async(request).await?;
7848
7849        // --
7850
7851        if github_response.is_success() {
7852            Ok(github_response.to_json_async().await?)
7853        } else {
7854            match github_response.status_code() {
7855                code => Err(OrgsListAttestationsError::Generic { code }.into()),
7856            }
7857        }
7858    }
7859
7860    /// ---
7861    ///
7862    /// # List attestations
7863    ///
7864    /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization.
7865    /// 
7866    /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required.
7867    /// 
7868    /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
7869    ///
7870    /// [GitHub API docs for list_attestations](https://docs.github.com/rest/orgs/orgs#list-attestations)
7871    ///
7872    /// ---
7873    #[cfg(not(target_arch = "wasm32"))]
7874    pub fn list_attestations(&self, org: &str, subject_digest: &str, query_params: Option<impl Into<OrgsListAttestationsParams<'api>>>) -> Result<GetUsersListAttestationsResponse200, AdapterError> {
7875
7876        let mut request_uri = format!("{}/orgs/{}/attestations/{}", super::GITHUB_BASE_API_URL, org, subject_digest);
7877
7878        if let Some(params) = query_params {
7879            request_uri.push_str("?");
7880            let qp: OrgsListAttestationsParams = params.into();
7881            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
7882        }
7883
7884        let req = GitHubRequest {
7885            uri: request_uri,
7886            body: None,
7887            method: "GET",
7888            headers: vec![]
7889        };
7890
7891        let request = self.client.build(req)?;
7892
7893        // --
7894
7895        let github_response = self.client.fetch(request)?;
7896
7897        // --
7898
7899        if github_response.is_success() {
7900            Ok(github_response.to_json()?)
7901        } else {
7902            match github_response.status_code() {
7903                code => Err(OrgsListAttestationsError::Generic { code }.into()),
7904            }
7905        }
7906    }
7907
7908    /// ---
7909    ///
7910    /// # List attestations by bulk subject digests
7911    ///
7912    /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization.
7913    /// 
7914    /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required.
7915    /// 
7916    /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
7917    ///
7918    /// [GitHub API docs for list_attestations_bulk](https://docs.github.com/rest/orgs/orgs#list-attestations-by-bulk-subject-digests)
7919    ///
7920    /// ---
7921    pub async fn list_attestations_bulk_async(&self, org: &str, query_params: Option<impl Into<OrgsListAttestationsBulkParams<'api>>>, body: PostOrgsListAttestationsBulk) -> Result<PostOrgsListAttestationsBulkResponse200, AdapterError> {
7922
7923        let mut request_uri = format!("{}/orgs/{}/attestations/bulk-list", super::GITHUB_BASE_API_URL, org);
7924
7925        if let Some(params) = query_params {
7926            request_uri.push_str("?");
7927            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
7928        }
7929
7930        let req = GitHubRequest {
7931            uri: request_uri,
7932            body: Some(C::from_json::<PostOrgsListAttestationsBulk>(body)?),
7933            method: "POST",
7934            headers: vec![]
7935        };
7936
7937        let request = self.client.build(req)?;
7938
7939        // --
7940
7941        let github_response = self.client.fetch_async(request).await?;
7942
7943        // --
7944
7945        if github_response.is_success() {
7946            Ok(github_response.to_json_async().await?)
7947        } else {
7948            match github_response.status_code() {
7949                code => Err(OrgsListAttestationsBulkError::Generic { code }.into()),
7950            }
7951        }
7952    }
7953
7954    /// ---
7955    ///
7956    /// # List attestations by bulk subject digests
7957    ///
7958    /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization.
7959    /// 
7960    /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required.
7961    /// 
7962    /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
7963    ///
7964    /// [GitHub API docs for list_attestations_bulk](https://docs.github.com/rest/orgs/orgs#list-attestations-by-bulk-subject-digests)
7965    ///
7966    /// ---
7967    #[cfg(not(target_arch = "wasm32"))]
7968    pub fn list_attestations_bulk(&self, org: &str, query_params: Option<impl Into<OrgsListAttestationsBulkParams<'api>>>, body: PostOrgsListAttestationsBulk) -> Result<PostOrgsListAttestationsBulkResponse200, AdapterError> {
7969
7970        let mut request_uri = format!("{}/orgs/{}/attestations/bulk-list", super::GITHUB_BASE_API_URL, org);
7971
7972        if let Some(params) = query_params {
7973            request_uri.push_str("?");
7974            let qp: OrgsListAttestationsBulkParams = params.into();
7975            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
7976        }
7977
7978        let req = GitHubRequest {
7979            uri: request_uri,
7980            body: Some(C::from_json::<PostOrgsListAttestationsBulk>(body)?),
7981            method: "POST",
7982            headers: vec![]
7983        };
7984
7985        let request = self.client.build(req)?;
7986
7987        // --
7988
7989        let github_response = self.client.fetch(request)?;
7990
7991        // --
7992
7993        if github_response.is_success() {
7994            Ok(github_response.to_json()?)
7995        } else {
7996            match github_response.status_code() {
7997                code => Err(OrgsListAttestationsBulkError::Generic { code }.into()),
7998            }
7999        }
8000    }
8001
8002    /// ---
8003    ///
8004    /// # List users blocked by an organization
8005    ///
8006    /// List the users blocked by an organization.
8007    ///
8008    /// [GitHub API docs for list_blocked_users](https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization)
8009    ///
8010    /// ---
8011    pub async fn list_blocked_users_async(&self, org: &str, query_params: Option<impl Into<OrgsListBlockedUsersParams>>) -> Result<Vec<SimpleUser>, AdapterError> {
8012
8013        let mut request_uri = format!("{}/orgs/{}/blocks", super::GITHUB_BASE_API_URL, org);
8014
8015        if let Some(params) = query_params {
8016            request_uri.push_str("?");
8017            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
8018        }
8019
8020        let req = GitHubRequest {
8021            uri: request_uri,
8022            body: None::<C::Body>,
8023            method: "GET",
8024            headers: vec![]
8025        };
8026
8027        let request = self.client.build(req)?;
8028
8029        // --
8030
8031        let github_response = self.client.fetch_async(request).await?;
8032
8033        // --
8034
8035        if github_response.is_success() {
8036            Ok(github_response.to_json_async().await?)
8037        } else {
8038            match github_response.status_code() {
8039                code => Err(OrgsListBlockedUsersError::Generic { code }.into()),
8040            }
8041        }
8042    }
8043
8044    /// ---
8045    ///
8046    /// # List users blocked by an organization
8047    ///
8048    /// List the users blocked by an organization.
8049    ///
8050    /// [GitHub API docs for list_blocked_users](https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization)
8051    ///
8052    /// ---
8053    #[cfg(not(target_arch = "wasm32"))]
8054    pub fn list_blocked_users(&self, org: &str, query_params: Option<impl Into<OrgsListBlockedUsersParams>>) -> Result<Vec<SimpleUser>, AdapterError> {
8055
8056        let mut request_uri = format!("{}/orgs/{}/blocks", super::GITHUB_BASE_API_URL, org);
8057
8058        if let Some(params) = query_params {
8059            request_uri.push_str("?");
8060            let qp: OrgsListBlockedUsersParams = params.into();
8061            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
8062        }
8063
8064        let req = GitHubRequest {
8065            uri: request_uri,
8066            body: None,
8067            method: "GET",
8068            headers: vec![]
8069        };
8070
8071        let request = self.client.build(req)?;
8072
8073        // --
8074
8075        let github_response = self.client.fetch(request)?;
8076
8077        // --
8078
8079        if github_response.is_success() {
8080            Ok(github_response.to_json()?)
8081        } else {
8082            match github_response.status_code() {
8083                code => Err(OrgsListBlockedUsersError::Generic { code }.into()),
8084            }
8085        }
8086    }
8087
8088    /// ---
8089    ///
8090    /// # List custom property values for organization repositories
8091    ///
8092    /// Lists organization repositories with all of their custom property values.
8093    /// Organization members can read these properties.
8094    ///
8095    /// [GitHub API docs for list_custom_properties_values_for_repos](https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories)
8096    ///
8097    /// ---
8098    pub async fn list_custom_properties_values_for_repos_async(&self, org: &str, query_params: Option<impl Into<OrgsListCustomPropertiesValuesForReposParams<'api>>>) -> Result<Vec<OrgRepoCustomPropertyValues>, AdapterError> {
8099
8100        let mut request_uri = format!("{}/orgs/{}/properties/values", super::GITHUB_BASE_API_URL, org);
8101
8102        if let Some(params) = query_params {
8103            request_uri.push_str("?");
8104            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
8105        }
8106
8107        let req = GitHubRequest {
8108            uri: request_uri,
8109            body: None::<C::Body>,
8110            method: "GET",
8111            headers: vec![]
8112        };
8113
8114        let request = self.client.build(req)?;
8115
8116        // --
8117
8118        let github_response = self.client.fetch_async(request).await?;
8119
8120        // --
8121
8122        if github_response.is_success() {
8123            Ok(github_response.to_json_async().await?)
8124        } else {
8125            match github_response.status_code() {
8126                403 => Err(OrgsListCustomPropertiesValuesForReposError::Status403(github_response.to_json_async().await?).into()),
8127                404 => Err(OrgsListCustomPropertiesValuesForReposError::Status404(github_response.to_json_async().await?).into()),
8128                code => Err(OrgsListCustomPropertiesValuesForReposError::Generic { code }.into()),
8129            }
8130        }
8131    }
8132
8133    /// ---
8134    ///
8135    /// # List custom property values for organization repositories
8136    ///
8137    /// Lists organization repositories with all of their custom property values.
8138    /// Organization members can read these properties.
8139    ///
8140    /// [GitHub API docs for list_custom_properties_values_for_repos](https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories)
8141    ///
8142    /// ---
8143    #[cfg(not(target_arch = "wasm32"))]
8144    pub fn list_custom_properties_values_for_repos(&self, org: &str, query_params: Option<impl Into<OrgsListCustomPropertiesValuesForReposParams<'api>>>) -> Result<Vec<OrgRepoCustomPropertyValues>, AdapterError> {
8145
8146        let mut request_uri = format!("{}/orgs/{}/properties/values", super::GITHUB_BASE_API_URL, org);
8147
8148        if let Some(params) = query_params {
8149            request_uri.push_str("?");
8150            let qp: OrgsListCustomPropertiesValuesForReposParams = params.into();
8151            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
8152        }
8153
8154        let req = GitHubRequest {
8155            uri: request_uri,
8156            body: None,
8157            method: "GET",
8158            headers: vec![]
8159        };
8160
8161        let request = self.client.build(req)?;
8162
8163        // --
8164
8165        let github_response = self.client.fetch(request)?;
8166
8167        // --
8168
8169        if github_response.is_success() {
8170            Ok(github_response.to_json()?)
8171        } else {
8172            match github_response.status_code() {
8173                403 => Err(OrgsListCustomPropertiesValuesForReposError::Status403(github_response.to_json()?).into()),
8174                404 => Err(OrgsListCustomPropertiesValuesForReposError::Status404(github_response.to_json()?).into()),
8175                code => Err(OrgsListCustomPropertiesValuesForReposError::Generic { code }.into()),
8176            }
8177        }
8178    }
8179
8180    /// ---
8181    ///
8182    /// # List failed organization invitations
8183    ///
8184    /// The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure.
8185    ///
8186    /// [GitHub API docs for list_failed_invitations](https://docs.github.com/rest/orgs/members#list-failed-organization-invitations)
8187    ///
8188    /// ---
8189    pub async fn list_failed_invitations_async(&self, org: &str, query_params: Option<impl Into<OrgsListFailedInvitationsParams>>) -> Result<Vec<OrganizationInvitation>, AdapterError> {
8190
8191        let mut request_uri = format!("{}/orgs/{}/failed_invitations", super::GITHUB_BASE_API_URL, org);
8192
8193        if let Some(params) = query_params {
8194            request_uri.push_str("?");
8195            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
8196        }
8197
8198        let req = GitHubRequest {
8199            uri: request_uri,
8200            body: None::<C::Body>,
8201            method: "GET",
8202            headers: vec![]
8203        };
8204
8205        let request = self.client.build(req)?;
8206
8207        // --
8208
8209        let github_response = self.client.fetch_async(request).await?;
8210
8211        // --
8212
8213        if github_response.is_success() {
8214            Ok(github_response.to_json_async().await?)
8215        } else {
8216            match github_response.status_code() {
8217                404 => Err(OrgsListFailedInvitationsError::Status404(github_response.to_json_async().await?).into()),
8218                code => Err(OrgsListFailedInvitationsError::Generic { code }.into()),
8219            }
8220        }
8221    }
8222
8223    /// ---
8224    ///
8225    /// # List failed organization invitations
8226    ///
8227    /// The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure.
8228    ///
8229    /// [GitHub API docs for list_failed_invitations](https://docs.github.com/rest/orgs/members#list-failed-organization-invitations)
8230    ///
8231    /// ---
8232    #[cfg(not(target_arch = "wasm32"))]
8233    pub fn list_failed_invitations(&self, org: &str, query_params: Option<impl Into<OrgsListFailedInvitationsParams>>) -> Result<Vec<OrganizationInvitation>, AdapterError> {
8234
8235        let mut request_uri = format!("{}/orgs/{}/failed_invitations", super::GITHUB_BASE_API_URL, org);
8236
8237        if let Some(params) = query_params {
8238            request_uri.push_str("?");
8239            let qp: OrgsListFailedInvitationsParams = params.into();
8240            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
8241        }
8242
8243        let req = GitHubRequest {
8244            uri: request_uri,
8245            body: None,
8246            method: "GET",
8247            headers: vec![]
8248        };
8249
8250        let request = self.client.build(req)?;
8251
8252        // --
8253
8254        let github_response = self.client.fetch(request)?;
8255
8256        // --
8257
8258        if github_response.is_success() {
8259            Ok(github_response.to_json()?)
8260        } else {
8261            match github_response.status_code() {
8262                404 => Err(OrgsListFailedInvitationsError::Status404(github_response.to_json()?).into()),
8263                code => Err(OrgsListFailedInvitationsError::Generic { code }.into()),
8264            }
8265        }
8266    }
8267
8268    /// ---
8269    ///
8270    /// # List organizations for the authenticated user
8271    ///
8272    /// List organizations for the authenticated user.
8273    /// 
8274    /// For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response.
8275    /// 
8276    /// > [!NOTE]
8277    /// > Requests using a fine-grained access token will receive a `200 Success` response with an empty list.
8278    ///
8279    /// [GitHub API docs for list_for_authenticated_user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user)
8280    ///
8281    /// ---
8282    pub async fn list_for_authenticated_user_async(&self, query_params: Option<impl Into<OrgsListForAuthenticatedUserParams>>) -> Result<Vec<OrganizationSimple>, AdapterError> {
8283
8284        let mut request_uri = format!("{}/user/orgs", super::GITHUB_BASE_API_URL);
8285
8286        if let Some(params) = query_params {
8287            request_uri.push_str("?");
8288            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
8289        }
8290
8291        let req = GitHubRequest {
8292            uri: request_uri,
8293            body: None::<C::Body>,
8294            method: "GET",
8295            headers: vec![]
8296        };
8297
8298        let request = self.client.build(req)?;
8299
8300        // --
8301
8302        let github_response = self.client.fetch_async(request).await?;
8303
8304        // --
8305
8306        if github_response.is_success() {
8307            Ok(github_response.to_json_async().await?)
8308        } else {
8309            match github_response.status_code() {
8310                304 => Err(OrgsListForAuthenticatedUserError::Status304.into()),
8311                403 => Err(OrgsListForAuthenticatedUserError::Status403(github_response.to_json_async().await?).into()),
8312                401 => Err(OrgsListForAuthenticatedUserError::Status401(github_response.to_json_async().await?).into()),
8313                code => Err(OrgsListForAuthenticatedUserError::Generic { code }.into()),
8314            }
8315        }
8316    }
8317
8318    /// ---
8319    ///
8320    /// # List organizations for the authenticated user
8321    ///
8322    /// List organizations for the authenticated user.
8323    /// 
8324    /// For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response.
8325    /// 
8326    /// > [!NOTE]
8327    /// > Requests using a fine-grained access token will receive a `200 Success` response with an empty list.
8328    ///
8329    /// [GitHub API docs for list_for_authenticated_user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user)
8330    ///
8331    /// ---
8332    #[cfg(not(target_arch = "wasm32"))]
8333    pub fn list_for_authenticated_user(&self, query_params: Option<impl Into<OrgsListForAuthenticatedUserParams>>) -> Result<Vec<OrganizationSimple>, AdapterError> {
8334
8335        let mut request_uri = format!("{}/user/orgs", super::GITHUB_BASE_API_URL);
8336
8337        if let Some(params) = query_params {
8338            request_uri.push_str("?");
8339            let qp: OrgsListForAuthenticatedUserParams = params.into();
8340            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
8341        }
8342
8343        let req = GitHubRequest {
8344            uri: request_uri,
8345            body: None,
8346            method: "GET",
8347            headers: vec![]
8348        };
8349
8350        let request = self.client.build(req)?;
8351
8352        // --
8353
8354        let github_response = self.client.fetch(request)?;
8355
8356        // --
8357
8358        if github_response.is_success() {
8359            Ok(github_response.to_json()?)
8360        } else {
8361            match github_response.status_code() {
8362                304 => Err(OrgsListForAuthenticatedUserError::Status304.into()),
8363                403 => Err(OrgsListForAuthenticatedUserError::Status403(github_response.to_json()?).into()),
8364                401 => Err(OrgsListForAuthenticatedUserError::Status401(github_response.to_json()?).into()),
8365                code => Err(OrgsListForAuthenticatedUserError::Generic { code }.into()),
8366            }
8367        }
8368    }
8369
8370    /// ---
8371    ///
8372    /// # List organizations for a user
8373    ///
8374    /// List [public organization memberships](https://docs.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user.
8375    /// 
8376    /// This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user) API instead.
8377    ///
8378    /// [GitHub API docs for list_for_user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user)
8379    ///
8380    /// ---
8381    pub async fn list_for_user_async(&self, username: &str, query_params: Option<impl Into<OrgsListForUserParams>>) -> Result<Vec<OrganizationSimple>, AdapterError> {
8382
8383        let mut request_uri = format!("{}/users/{}/orgs", super::GITHUB_BASE_API_URL, username);
8384
8385        if let Some(params) = query_params {
8386            request_uri.push_str("?");
8387            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
8388        }
8389
8390        let req = GitHubRequest {
8391            uri: request_uri,
8392            body: None::<C::Body>,
8393            method: "GET",
8394            headers: vec![]
8395        };
8396
8397        let request = self.client.build(req)?;
8398
8399        // --
8400
8401        let github_response = self.client.fetch_async(request).await?;
8402
8403        // --
8404
8405        if github_response.is_success() {
8406            Ok(github_response.to_json_async().await?)
8407        } else {
8408            match github_response.status_code() {
8409                code => Err(OrgsListForUserError::Generic { code }.into()),
8410            }
8411        }
8412    }
8413
8414    /// ---
8415    ///
8416    /// # List organizations for a user
8417    ///
8418    /// List [public organization memberships](https://docs.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user.
8419    /// 
8420    /// This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user) API instead.
8421    ///
8422    /// [GitHub API docs for list_for_user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user)
8423    ///
8424    /// ---
8425    #[cfg(not(target_arch = "wasm32"))]
8426    pub fn list_for_user(&self, username: &str, query_params: Option<impl Into<OrgsListForUserParams>>) -> Result<Vec<OrganizationSimple>, AdapterError> {
8427
8428        let mut request_uri = format!("{}/users/{}/orgs", super::GITHUB_BASE_API_URL, username);
8429
8430        if let Some(params) = query_params {
8431            request_uri.push_str("?");
8432            let qp: OrgsListForUserParams = params.into();
8433            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
8434        }
8435
8436        let req = GitHubRequest {
8437            uri: request_uri,
8438            body: None,
8439            method: "GET",
8440            headers: vec![]
8441        };
8442
8443        let request = self.client.build(req)?;
8444
8445        // --
8446
8447        let github_response = self.client.fetch(request)?;
8448
8449        // --
8450
8451        if github_response.is_success() {
8452            Ok(github_response.to_json()?)
8453        } else {
8454            match github_response.status_code() {
8455                code => Err(OrgsListForUserError::Generic { code }.into()),
8456            }
8457        }
8458    }
8459
8460    /// ---
8461    ///
8462    /// # List organization invitation teams
8463    ///
8464    /// List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner.
8465    ///
8466    /// [GitHub API docs for list_invitation_teams](https://docs.github.com/rest/orgs/members#list-organization-invitation-teams)
8467    ///
8468    /// ---
8469    pub async fn list_invitation_teams_async(&self, org: &str, invitation_id: i32, query_params: Option<impl Into<OrgsListInvitationTeamsParams>>) -> Result<Vec<Team>, AdapterError> {
8470
8471        let mut request_uri = format!("{}/orgs/{}/invitations/{}/teams", super::GITHUB_BASE_API_URL, org, invitation_id);
8472
8473        if let Some(params) = query_params {
8474            request_uri.push_str("?");
8475            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
8476        }
8477
8478        let req = GitHubRequest {
8479            uri: request_uri,
8480            body: None::<C::Body>,
8481            method: "GET",
8482            headers: vec![]
8483        };
8484
8485        let request = self.client.build(req)?;
8486
8487        // --
8488
8489        let github_response = self.client.fetch_async(request).await?;
8490
8491        // --
8492
8493        if github_response.is_success() {
8494            Ok(github_response.to_json_async().await?)
8495        } else {
8496            match github_response.status_code() {
8497                404 => Err(OrgsListInvitationTeamsError::Status404(github_response.to_json_async().await?).into()),
8498                code => Err(OrgsListInvitationTeamsError::Generic { code }.into()),
8499            }
8500        }
8501    }
8502
8503    /// ---
8504    ///
8505    /// # List organization invitation teams
8506    ///
8507    /// List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner.
8508    ///
8509    /// [GitHub API docs for list_invitation_teams](https://docs.github.com/rest/orgs/members#list-organization-invitation-teams)
8510    ///
8511    /// ---
8512    #[cfg(not(target_arch = "wasm32"))]
8513    pub fn list_invitation_teams(&self, org: &str, invitation_id: i32, query_params: Option<impl Into<OrgsListInvitationTeamsParams>>) -> Result<Vec<Team>, AdapterError> {
8514
8515        let mut request_uri = format!("{}/orgs/{}/invitations/{}/teams", super::GITHUB_BASE_API_URL, org, invitation_id);
8516
8517        if let Some(params) = query_params {
8518            request_uri.push_str("?");
8519            let qp: OrgsListInvitationTeamsParams = params.into();
8520            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
8521        }
8522
8523        let req = GitHubRequest {
8524            uri: request_uri,
8525            body: None,
8526            method: "GET",
8527            headers: vec![]
8528        };
8529
8530        let request = self.client.build(req)?;
8531
8532        // --
8533
8534        let github_response = self.client.fetch(request)?;
8535
8536        // --
8537
8538        if github_response.is_success() {
8539            Ok(github_response.to_json()?)
8540        } else {
8541            match github_response.status_code() {
8542                404 => Err(OrgsListInvitationTeamsError::Status404(github_response.to_json()?).into()),
8543                code => Err(OrgsListInvitationTeamsError::Generic { code }.into()),
8544            }
8545        }
8546    }
8547
8548    /// ---
8549    ///
8550    /// # List issue types for an organization
8551    ///
8552    /// Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.
8553    ///
8554    /// [GitHub API docs for list_issue_types](https://docs.github.com/rest/orgs/issue-types#list-issue-types-for-an-organization)
8555    ///
8556    /// ---
8557    pub async fn list_issue_types_async(&self, org: &str) -> Result<Vec<IssueType>, AdapterError> {
8558
8559        let request_uri = format!("{}/orgs/{}/issue-types", super::GITHUB_BASE_API_URL, org);
8560
8561
8562        let req = GitHubRequest {
8563            uri: request_uri,
8564            body: None::<C::Body>,
8565            method: "GET",
8566            headers: vec![]
8567        };
8568
8569        let request = self.client.build(req)?;
8570
8571        // --
8572
8573        let github_response = self.client.fetch_async(request).await?;
8574
8575        // --
8576
8577        if github_response.is_success() {
8578            Ok(github_response.to_json_async().await?)
8579        } else {
8580            match github_response.status_code() {
8581                404 => Err(OrgsListIssueTypesError::Status404(github_response.to_json_async().await?).into()),
8582                code => Err(OrgsListIssueTypesError::Generic { code }.into()),
8583            }
8584        }
8585    }
8586
8587    /// ---
8588    ///
8589    /// # List issue types for an organization
8590    ///
8591    /// Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.
8592    ///
8593    /// [GitHub API docs for list_issue_types](https://docs.github.com/rest/orgs/issue-types#list-issue-types-for-an-organization)
8594    ///
8595    /// ---
8596    #[cfg(not(target_arch = "wasm32"))]
8597    pub fn list_issue_types(&self, org: &str) -> Result<Vec<IssueType>, AdapterError> {
8598
8599        let request_uri = format!("{}/orgs/{}/issue-types", super::GITHUB_BASE_API_URL, org);
8600
8601
8602        let req = GitHubRequest {
8603            uri: request_uri,
8604            body: None,
8605            method: "GET",
8606            headers: vec![]
8607        };
8608
8609        let request = self.client.build(req)?;
8610
8611        // --
8612
8613        let github_response = self.client.fetch(request)?;
8614
8615        // --
8616
8617        if github_response.is_success() {
8618            Ok(github_response.to_json()?)
8619        } else {
8620            match github_response.status_code() {
8621                404 => Err(OrgsListIssueTypesError::Status404(github_response.to_json()?).into()),
8622                code => Err(OrgsListIssueTypesError::Generic { code }.into()),
8623            }
8624        }
8625    }
8626
8627    /// ---
8628    ///
8629    /// # List organization members
8630    ///
8631    /// List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.
8632    ///
8633    /// [GitHub API docs for list_members](https://docs.github.com/rest/orgs/members#list-organization-members)
8634    ///
8635    /// ---
8636    pub async fn list_members_async(&self, org: &str, query_params: Option<impl Into<OrgsListMembersParams<'api>>>) -> Result<Vec<SimpleUser>, AdapterError> {
8637
8638        let mut request_uri = format!("{}/orgs/{}/members", super::GITHUB_BASE_API_URL, org);
8639
8640        if let Some(params) = query_params {
8641            request_uri.push_str("?");
8642            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
8643        }
8644
8645        let req = GitHubRequest {
8646            uri: request_uri,
8647            body: None::<C::Body>,
8648            method: "GET",
8649            headers: vec![]
8650        };
8651
8652        let request = self.client.build(req)?;
8653
8654        // --
8655
8656        let github_response = self.client.fetch_async(request).await?;
8657
8658        // --
8659
8660        if github_response.is_success() {
8661            Ok(github_response.to_json_async().await?)
8662        } else {
8663            match github_response.status_code() {
8664                422 => Err(OrgsListMembersError::Status422(github_response.to_json_async().await?).into()),
8665                code => Err(OrgsListMembersError::Generic { code }.into()),
8666            }
8667        }
8668    }
8669
8670    /// ---
8671    ///
8672    /// # List organization members
8673    ///
8674    /// List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.
8675    ///
8676    /// [GitHub API docs for list_members](https://docs.github.com/rest/orgs/members#list-organization-members)
8677    ///
8678    /// ---
8679    #[cfg(not(target_arch = "wasm32"))]
8680    pub fn list_members(&self, org: &str, query_params: Option<impl Into<OrgsListMembersParams<'api>>>) -> Result<Vec<SimpleUser>, AdapterError> {
8681
8682        let mut request_uri = format!("{}/orgs/{}/members", super::GITHUB_BASE_API_URL, org);
8683
8684        if let Some(params) = query_params {
8685            request_uri.push_str("?");
8686            let qp: OrgsListMembersParams = params.into();
8687            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
8688        }
8689
8690        let req = GitHubRequest {
8691            uri: request_uri,
8692            body: None,
8693            method: "GET",
8694            headers: vec![]
8695        };
8696
8697        let request = self.client.build(req)?;
8698
8699        // --
8700
8701        let github_response = self.client.fetch(request)?;
8702
8703        // --
8704
8705        if github_response.is_success() {
8706            Ok(github_response.to_json()?)
8707        } else {
8708            match github_response.status_code() {
8709                422 => Err(OrgsListMembersError::Status422(github_response.to_json()?).into()),
8710                code => Err(OrgsListMembersError::Generic { code }.into()),
8711            }
8712        }
8713    }
8714
8715    /// ---
8716    ///
8717    /// # List organization memberships for the authenticated user
8718    ///
8719    /// Lists all of the authenticated user's organization memberships.
8720    ///
8721    /// [GitHub API docs for list_memberships_for_authenticated_user](https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user)
8722    ///
8723    /// ---
8724    pub async fn list_memberships_for_authenticated_user_async(&self, query_params: Option<impl Into<OrgsListMembershipsForAuthenticatedUserParams<'api>>>) -> Result<Vec<OrgMembership>, AdapterError> {
8725
8726        let mut request_uri = format!("{}/user/memberships/orgs", super::GITHUB_BASE_API_URL);
8727
8728        if let Some(params) = query_params {
8729            request_uri.push_str("?");
8730            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
8731        }
8732
8733        let req = GitHubRequest {
8734            uri: request_uri,
8735            body: None::<C::Body>,
8736            method: "GET",
8737            headers: vec![]
8738        };
8739
8740        let request = self.client.build(req)?;
8741
8742        // --
8743
8744        let github_response = self.client.fetch_async(request).await?;
8745
8746        // --
8747
8748        if github_response.is_success() {
8749            Ok(github_response.to_json_async().await?)
8750        } else {
8751            match github_response.status_code() {
8752                304 => Err(OrgsListMembershipsForAuthenticatedUserError::Status304.into()),
8753                403 => Err(OrgsListMembershipsForAuthenticatedUserError::Status403(github_response.to_json_async().await?).into()),
8754                401 => Err(OrgsListMembershipsForAuthenticatedUserError::Status401(github_response.to_json_async().await?).into()),
8755                422 => Err(OrgsListMembershipsForAuthenticatedUserError::Status422(github_response.to_json_async().await?).into()),
8756                code => Err(OrgsListMembershipsForAuthenticatedUserError::Generic { code }.into()),
8757            }
8758        }
8759    }
8760
8761    /// ---
8762    ///
8763    /// # List organization memberships for the authenticated user
8764    ///
8765    /// Lists all of the authenticated user's organization memberships.
8766    ///
8767    /// [GitHub API docs for list_memberships_for_authenticated_user](https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user)
8768    ///
8769    /// ---
8770    #[cfg(not(target_arch = "wasm32"))]
8771    pub fn list_memberships_for_authenticated_user(&self, query_params: Option<impl Into<OrgsListMembershipsForAuthenticatedUserParams<'api>>>) -> Result<Vec<OrgMembership>, AdapterError> {
8772
8773        let mut request_uri = format!("{}/user/memberships/orgs", super::GITHUB_BASE_API_URL);
8774
8775        if let Some(params) = query_params {
8776            request_uri.push_str("?");
8777            let qp: OrgsListMembershipsForAuthenticatedUserParams = params.into();
8778            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
8779        }
8780
8781        let req = GitHubRequest {
8782            uri: request_uri,
8783            body: None,
8784            method: "GET",
8785            headers: vec![]
8786        };
8787
8788        let request = self.client.build(req)?;
8789
8790        // --
8791
8792        let github_response = self.client.fetch(request)?;
8793
8794        // --
8795
8796        if github_response.is_success() {
8797            Ok(github_response.to_json()?)
8798        } else {
8799            match github_response.status_code() {
8800                304 => Err(OrgsListMembershipsForAuthenticatedUserError::Status304.into()),
8801                403 => Err(OrgsListMembershipsForAuthenticatedUserError::Status403(github_response.to_json()?).into()),
8802                401 => Err(OrgsListMembershipsForAuthenticatedUserError::Status401(github_response.to_json()?).into()),
8803                422 => Err(OrgsListMembershipsForAuthenticatedUserError::Status422(github_response.to_json()?).into()),
8804                code => Err(OrgsListMembershipsForAuthenticatedUserError::Generic { code }.into()),
8805            }
8806        }
8807    }
8808
8809    /// ---
8810    ///
8811    /// # List teams that are assigned to an organization role
8812    ///
8813    /// Lists the teams that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
8814    /// 
8815    /// To use this endpoint, you must be an administrator for the organization.
8816    /// 
8817    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
8818    ///
8819    /// [GitHub API docs for list_org_role_teams](https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role)
8820    ///
8821    /// ---
8822    pub async fn list_org_role_teams_async(&self, org: &str, role_id: i32, query_params: Option<impl Into<OrgsListOrgRoleTeamsParams>>) -> Result<Vec<TeamRoleAssignment>, AdapterError> {
8823
8824        let mut request_uri = format!("{}/orgs/{}/organization-roles/{}/teams", super::GITHUB_BASE_API_URL, org, role_id);
8825
8826        if let Some(params) = query_params {
8827            request_uri.push_str("?");
8828            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
8829        }
8830
8831        let req = GitHubRequest {
8832            uri: request_uri,
8833            body: None::<C::Body>,
8834            method: "GET",
8835            headers: vec![]
8836        };
8837
8838        let request = self.client.build(req)?;
8839
8840        // --
8841
8842        let github_response = self.client.fetch_async(request).await?;
8843
8844        // --
8845
8846        if github_response.is_success() {
8847            Ok(github_response.to_json_async().await?)
8848        } else {
8849            match github_response.status_code() {
8850                404 => Err(OrgsListOrgRoleTeamsError::Status404.into()),
8851                422 => Err(OrgsListOrgRoleTeamsError::Status422.into()),
8852                code => Err(OrgsListOrgRoleTeamsError::Generic { code }.into()),
8853            }
8854        }
8855    }
8856
8857    /// ---
8858    ///
8859    /// # List teams that are assigned to an organization role
8860    ///
8861    /// Lists the teams that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
8862    /// 
8863    /// To use this endpoint, you must be an administrator for the organization.
8864    /// 
8865    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
8866    ///
8867    /// [GitHub API docs for list_org_role_teams](https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role)
8868    ///
8869    /// ---
8870    #[cfg(not(target_arch = "wasm32"))]
8871    pub fn list_org_role_teams(&self, org: &str, role_id: i32, query_params: Option<impl Into<OrgsListOrgRoleTeamsParams>>) -> Result<Vec<TeamRoleAssignment>, AdapterError> {
8872
8873        let mut request_uri = format!("{}/orgs/{}/organization-roles/{}/teams", super::GITHUB_BASE_API_URL, org, role_id);
8874
8875        if let Some(params) = query_params {
8876            request_uri.push_str("?");
8877            let qp: OrgsListOrgRoleTeamsParams = params.into();
8878            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
8879        }
8880
8881        let req = GitHubRequest {
8882            uri: request_uri,
8883            body: None,
8884            method: "GET",
8885            headers: vec![]
8886        };
8887
8888        let request = self.client.build(req)?;
8889
8890        // --
8891
8892        let github_response = self.client.fetch(request)?;
8893
8894        // --
8895
8896        if github_response.is_success() {
8897            Ok(github_response.to_json()?)
8898        } else {
8899            match github_response.status_code() {
8900                404 => Err(OrgsListOrgRoleTeamsError::Status404.into()),
8901                422 => Err(OrgsListOrgRoleTeamsError::Status422.into()),
8902                code => Err(OrgsListOrgRoleTeamsError::Generic { code }.into()),
8903            }
8904        }
8905    }
8906
8907    /// ---
8908    ///
8909    /// # List users that are assigned to an organization role
8910    ///
8911    /// Lists organization members that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
8912    /// 
8913    /// To use this endpoint, you must be an administrator for the organization.
8914    /// 
8915    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
8916    ///
8917    /// [GitHub API docs for list_org_role_users](https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role)
8918    ///
8919    /// ---
8920    pub async fn list_org_role_users_async(&self, org: &str, role_id: i32, query_params: Option<impl Into<OrgsListOrgRoleUsersParams>>) -> Result<Vec<UserRoleAssignment>, AdapterError> {
8921
8922        let mut request_uri = format!("{}/orgs/{}/organization-roles/{}/users", super::GITHUB_BASE_API_URL, org, role_id);
8923
8924        if let Some(params) = query_params {
8925            request_uri.push_str("?");
8926            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
8927        }
8928
8929        let req = GitHubRequest {
8930            uri: request_uri,
8931            body: None::<C::Body>,
8932            method: "GET",
8933            headers: vec![]
8934        };
8935
8936        let request = self.client.build(req)?;
8937
8938        // --
8939
8940        let github_response = self.client.fetch_async(request).await?;
8941
8942        // --
8943
8944        if github_response.is_success() {
8945            Ok(github_response.to_json_async().await?)
8946        } else {
8947            match github_response.status_code() {
8948                404 => Err(OrgsListOrgRoleUsersError::Status404.into()),
8949                422 => Err(OrgsListOrgRoleUsersError::Status422.into()),
8950                code => Err(OrgsListOrgRoleUsersError::Generic { code }.into()),
8951            }
8952        }
8953    }
8954
8955    /// ---
8956    ///
8957    /// # List users that are assigned to an organization role
8958    ///
8959    /// Lists organization members that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
8960    /// 
8961    /// To use this endpoint, you must be an administrator for the organization.
8962    /// 
8963    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
8964    ///
8965    /// [GitHub API docs for list_org_role_users](https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role)
8966    ///
8967    /// ---
8968    #[cfg(not(target_arch = "wasm32"))]
8969    pub fn list_org_role_users(&self, org: &str, role_id: i32, query_params: Option<impl Into<OrgsListOrgRoleUsersParams>>) -> Result<Vec<UserRoleAssignment>, AdapterError> {
8970
8971        let mut request_uri = format!("{}/orgs/{}/organization-roles/{}/users", super::GITHUB_BASE_API_URL, org, role_id);
8972
8973        if let Some(params) = query_params {
8974            request_uri.push_str("?");
8975            let qp: OrgsListOrgRoleUsersParams = params.into();
8976            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
8977        }
8978
8979        let req = GitHubRequest {
8980            uri: request_uri,
8981            body: None,
8982            method: "GET",
8983            headers: vec![]
8984        };
8985
8986        let request = self.client.build(req)?;
8987
8988        // --
8989
8990        let github_response = self.client.fetch(request)?;
8991
8992        // --
8993
8994        if github_response.is_success() {
8995            Ok(github_response.to_json()?)
8996        } else {
8997            match github_response.status_code() {
8998                404 => Err(OrgsListOrgRoleUsersError::Status404.into()),
8999                422 => Err(OrgsListOrgRoleUsersError::Status422.into()),
9000                code => Err(OrgsListOrgRoleUsersError::Generic { code }.into()),
9001            }
9002        }
9003    }
9004
9005    /// ---
9006    ///
9007    /// # Get all organization roles for an organization
9008    ///
9009    /// Lists the organization roles available in this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
9010    /// 
9011    /// To use this endpoint, the authenticated user must be one of:
9012    /// 
9013    /// - An administrator for the organization.
9014    /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.
9015    /// 
9016    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
9017    ///
9018    /// [GitHub API docs for list_org_roles](https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization)
9019    ///
9020    /// ---
9021    pub async fn list_org_roles_async(&self, org: &str) -> Result<GetOrgsListOrgRolesResponse200, AdapterError> {
9022
9023        let request_uri = format!("{}/orgs/{}/organization-roles", super::GITHUB_BASE_API_URL, org);
9024
9025
9026        let req = GitHubRequest {
9027            uri: request_uri,
9028            body: None::<C::Body>,
9029            method: "GET",
9030            headers: vec![]
9031        };
9032
9033        let request = self.client.build(req)?;
9034
9035        // --
9036
9037        let github_response = self.client.fetch_async(request).await?;
9038
9039        // --
9040
9041        if github_response.is_success() {
9042            Ok(github_response.to_json_async().await?)
9043        } else {
9044            match github_response.status_code() {
9045                404 => Err(OrgsListOrgRolesError::Status404(github_response.to_json_async().await?).into()),
9046                422 => Err(OrgsListOrgRolesError::Status422(github_response.to_json_async().await?).into()),
9047                code => Err(OrgsListOrgRolesError::Generic { code }.into()),
9048            }
9049        }
9050    }
9051
9052    /// ---
9053    ///
9054    /// # Get all organization roles for an organization
9055    ///
9056    /// Lists the organization roles available in this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
9057    /// 
9058    /// To use this endpoint, the authenticated user must be one of:
9059    /// 
9060    /// - An administrator for the organization.
9061    /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.
9062    /// 
9063    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
9064    ///
9065    /// [GitHub API docs for list_org_roles](https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization)
9066    ///
9067    /// ---
9068    #[cfg(not(target_arch = "wasm32"))]
9069    pub fn list_org_roles(&self, org: &str) -> Result<GetOrgsListOrgRolesResponse200, AdapterError> {
9070
9071        let request_uri = format!("{}/orgs/{}/organization-roles", super::GITHUB_BASE_API_URL, org);
9072
9073
9074        let req = GitHubRequest {
9075            uri: request_uri,
9076            body: None,
9077            method: "GET",
9078            headers: vec![]
9079        };
9080
9081        let request = self.client.build(req)?;
9082
9083        // --
9084
9085        let github_response = self.client.fetch(request)?;
9086
9087        // --
9088
9089        if github_response.is_success() {
9090            Ok(github_response.to_json()?)
9091        } else {
9092            match github_response.status_code() {
9093                404 => Err(OrgsListOrgRolesError::Status404(github_response.to_json()?).into()),
9094                422 => Err(OrgsListOrgRolesError::Status422(github_response.to_json()?).into()),
9095                code => Err(OrgsListOrgRolesError::Generic { code }.into()),
9096            }
9097        }
9098    }
9099
9100    /// ---
9101    ///
9102    /// # List outside collaborators for an organization
9103    ///
9104    /// List all users who are outside collaborators of an organization.
9105    ///
9106    /// [GitHub API docs for list_outside_collaborators](https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization)
9107    ///
9108    /// ---
9109    pub async fn list_outside_collaborators_async(&self, org: &str, query_params: Option<impl Into<OrgsListOutsideCollaboratorsParams<'api>>>) -> Result<Vec<SimpleUser>, AdapterError> {
9110
9111        let mut request_uri = format!("{}/orgs/{}/outside_collaborators", super::GITHUB_BASE_API_URL, org);
9112
9113        if let Some(params) = query_params {
9114            request_uri.push_str("?");
9115            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
9116        }
9117
9118        let req = GitHubRequest {
9119            uri: request_uri,
9120            body: None::<C::Body>,
9121            method: "GET",
9122            headers: vec![]
9123        };
9124
9125        let request = self.client.build(req)?;
9126
9127        // --
9128
9129        let github_response = self.client.fetch_async(request).await?;
9130
9131        // --
9132
9133        if github_response.is_success() {
9134            Ok(github_response.to_json_async().await?)
9135        } else {
9136            match github_response.status_code() {
9137                code => Err(OrgsListOutsideCollaboratorsError::Generic { code }.into()),
9138            }
9139        }
9140    }
9141
9142    /// ---
9143    ///
9144    /// # List outside collaborators for an organization
9145    ///
9146    /// List all users who are outside collaborators of an organization.
9147    ///
9148    /// [GitHub API docs for list_outside_collaborators](https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization)
9149    ///
9150    /// ---
9151    #[cfg(not(target_arch = "wasm32"))]
9152    pub fn list_outside_collaborators(&self, org: &str, query_params: Option<impl Into<OrgsListOutsideCollaboratorsParams<'api>>>) -> Result<Vec<SimpleUser>, AdapterError> {
9153
9154        let mut request_uri = format!("{}/orgs/{}/outside_collaborators", super::GITHUB_BASE_API_URL, org);
9155
9156        if let Some(params) = query_params {
9157            request_uri.push_str("?");
9158            let qp: OrgsListOutsideCollaboratorsParams = params.into();
9159            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
9160        }
9161
9162        let req = GitHubRequest {
9163            uri: request_uri,
9164            body: None,
9165            method: "GET",
9166            headers: vec![]
9167        };
9168
9169        let request = self.client.build(req)?;
9170
9171        // --
9172
9173        let github_response = self.client.fetch(request)?;
9174
9175        // --
9176
9177        if github_response.is_success() {
9178            Ok(github_response.to_json()?)
9179        } else {
9180            match github_response.status_code() {
9181                code => Err(OrgsListOutsideCollaboratorsError::Generic { code }.into()),
9182            }
9183        }
9184    }
9185
9186    /// ---
9187    ///
9188    /// # List repositories a fine-grained personal access token has access to
9189    ///
9190    /// Lists the repositories a fine-grained personal access token has access to.
9191    /// 
9192    /// Only GitHub Apps can use this endpoint.
9193    ///
9194    /// [GitHub API docs for list_pat_grant_repositories](https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-a-fine-grained-personal-access-token-has-access-to)
9195    ///
9196    /// ---
9197    pub async fn list_pat_grant_repositories_async(&self, org: &str, pat_id: i32, query_params: Option<impl Into<OrgsListPatGrantRepositoriesParams>>) -> Result<Vec<MinimalRepository>, AdapterError> {
9198
9199        let mut request_uri = format!("{}/orgs/{}/personal-access-tokens/{}/repositories", super::GITHUB_BASE_API_URL, org, pat_id);
9200
9201        if let Some(params) = query_params {
9202            request_uri.push_str("?");
9203            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
9204        }
9205
9206        let req = GitHubRequest {
9207            uri: request_uri,
9208            body: None::<C::Body>,
9209            method: "GET",
9210            headers: vec![]
9211        };
9212
9213        let request = self.client.build(req)?;
9214
9215        // --
9216
9217        let github_response = self.client.fetch_async(request).await?;
9218
9219        // --
9220
9221        if github_response.is_success() {
9222            Ok(github_response.to_json_async().await?)
9223        } else {
9224            match github_response.status_code() {
9225                500 => Err(OrgsListPatGrantRepositoriesError::Status500(github_response.to_json_async().await?).into()),
9226                404 => Err(OrgsListPatGrantRepositoriesError::Status404(github_response.to_json_async().await?).into()),
9227                403 => Err(OrgsListPatGrantRepositoriesError::Status403(github_response.to_json_async().await?).into()),
9228                code => Err(OrgsListPatGrantRepositoriesError::Generic { code }.into()),
9229            }
9230        }
9231    }
9232
9233    /// ---
9234    ///
9235    /// # List repositories a fine-grained personal access token has access to
9236    ///
9237    /// Lists the repositories a fine-grained personal access token has access to.
9238    /// 
9239    /// Only GitHub Apps can use this endpoint.
9240    ///
9241    /// [GitHub API docs for list_pat_grant_repositories](https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-a-fine-grained-personal-access-token-has-access-to)
9242    ///
9243    /// ---
9244    #[cfg(not(target_arch = "wasm32"))]
9245    pub fn list_pat_grant_repositories(&self, org: &str, pat_id: i32, query_params: Option<impl Into<OrgsListPatGrantRepositoriesParams>>) -> Result<Vec<MinimalRepository>, AdapterError> {
9246
9247        let mut request_uri = format!("{}/orgs/{}/personal-access-tokens/{}/repositories", super::GITHUB_BASE_API_URL, org, pat_id);
9248
9249        if let Some(params) = query_params {
9250            request_uri.push_str("?");
9251            let qp: OrgsListPatGrantRepositoriesParams = params.into();
9252            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
9253        }
9254
9255        let req = GitHubRequest {
9256            uri: request_uri,
9257            body: None,
9258            method: "GET",
9259            headers: vec![]
9260        };
9261
9262        let request = self.client.build(req)?;
9263
9264        // --
9265
9266        let github_response = self.client.fetch(request)?;
9267
9268        // --
9269
9270        if github_response.is_success() {
9271            Ok(github_response.to_json()?)
9272        } else {
9273            match github_response.status_code() {
9274                500 => Err(OrgsListPatGrantRepositoriesError::Status500(github_response.to_json()?).into()),
9275                404 => Err(OrgsListPatGrantRepositoriesError::Status404(github_response.to_json()?).into()),
9276                403 => Err(OrgsListPatGrantRepositoriesError::Status403(github_response.to_json()?).into()),
9277                code => Err(OrgsListPatGrantRepositoriesError::Generic { code }.into()),
9278            }
9279        }
9280    }
9281
9282    /// ---
9283    ///
9284    /// # List repositories requested to be accessed by a fine-grained personal access token
9285    ///
9286    /// Lists the repositories a fine-grained personal access token request is requesting access to.
9287    /// 
9288    /// Only GitHub Apps can use this endpoint.
9289    ///
9290    /// [GitHub API docs for list_pat_grant_request_repositories](https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token)
9291    ///
9292    /// ---
9293    pub async fn list_pat_grant_request_repositories_async(&self, org: &str, pat_request_id: i32, query_params: Option<impl Into<OrgsListPatGrantRequestRepositoriesParams>>) -> Result<Vec<MinimalRepository>, AdapterError> {
9294
9295        let mut request_uri = format!("{}/orgs/{}/personal-access-token-requests/{}/repositories", super::GITHUB_BASE_API_URL, org, pat_request_id);
9296
9297        if let Some(params) = query_params {
9298            request_uri.push_str("?");
9299            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
9300        }
9301
9302        let req = GitHubRequest {
9303            uri: request_uri,
9304            body: None::<C::Body>,
9305            method: "GET",
9306            headers: vec![]
9307        };
9308
9309        let request = self.client.build(req)?;
9310
9311        // --
9312
9313        let github_response = self.client.fetch_async(request).await?;
9314
9315        // --
9316
9317        if github_response.is_success() {
9318            Ok(github_response.to_json_async().await?)
9319        } else {
9320            match github_response.status_code() {
9321                500 => Err(OrgsListPatGrantRequestRepositoriesError::Status500(github_response.to_json_async().await?).into()),
9322                404 => Err(OrgsListPatGrantRequestRepositoriesError::Status404(github_response.to_json_async().await?).into()),
9323                403 => Err(OrgsListPatGrantRequestRepositoriesError::Status403(github_response.to_json_async().await?).into()),
9324                code => Err(OrgsListPatGrantRequestRepositoriesError::Generic { code }.into()),
9325            }
9326        }
9327    }
9328
9329    /// ---
9330    ///
9331    /// # List repositories requested to be accessed by a fine-grained personal access token
9332    ///
9333    /// Lists the repositories a fine-grained personal access token request is requesting access to.
9334    /// 
9335    /// Only GitHub Apps can use this endpoint.
9336    ///
9337    /// [GitHub API docs for list_pat_grant_request_repositories](https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token)
9338    ///
9339    /// ---
9340    #[cfg(not(target_arch = "wasm32"))]
9341    pub fn list_pat_grant_request_repositories(&self, org: &str, pat_request_id: i32, query_params: Option<impl Into<OrgsListPatGrantRequestRepositoriesParams>>) -> Result<Vec<MinimalRepository>, AdapterError> {
9342
9343        let mut request_uri = format!("{}/orgs/{}/personal-access-token-requests/{}/repositories", super::GITHUB_BASE_API_URL, org, pat_request_id);
9344
9345        if let Some(params) = query_params {
9346            request_uri.push_str("?");
9347            let qp: OrgsListPatGrantRequestRepositoriesParams = params.into();
9348            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
9349        }
9350
9351        let req = GitHubRequest {
9352            uri: request_uri,
9353            body: None,
9354            method: "GET",
9355            headers: vec![]
9356        };
9357
9358        let request = self.client.build(req)?;
9359
9360        // --
9361
9362        let github_response = self.client.fetch(request)?;
9363
9364        // --
9365
9366        if github_response.is_success() {
9367            Ok(github_response.to_json()?)
9368        } else {
9369            match github_response.status_code() {
9370                500 => Err(OrgsListPatGrantRequestRepositoriesError::Status500(github_response.to_json()?).into()),
9371                404 => Err(OrgsListPatGrantRequestRepositoriesError::Status404(github_response.to_json()?).into()),
9372                403 => Err(OrgsListPatGrantRequestRepositoriesError::Status403(github_response.to_json()?).into()),
9373                code => Err(OrgsListPatGrantRequestRepositoriesError::Generic { code }.into()),
9374            }
9375        }
9376    }
9377
9378    /// ---
9379    ///
9380    /// # List requests to access organization resources with fine-grained personal access tokens
9381    ///
9382    /// Lists requests from organization members to access organization resources with a fine-grained personal access token.
9383    /// 
9384    /// Only GitHub Apps can use this endpoint.
9385    ///
9386    /// [GitHub API docs for list_pat_grant_requests](https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens)
9387    ///
9388    /// ---
9389    pub async fn list_pat_grant_requests_async(&self, org: &str, query_params: Option<impl Into<OrgsListPatGrantRequestsParams<'api>>>) -> Result<Vec<OrganizationProgrammaticAccessGrantRequest>, AdapterError> {
9390
9391        let mut request_uri = format!("{}/orgs/{}/personal-access-token-requests", super::GITHUB_BASE_API_URL, org);
9392
9393        if let Some(params) = query_params {
9394            request_uri.push_str("?");
9395            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
9396        }
9397
9398        let req = GitHubRequest {
9399            uri: request_uri,
9400            body: None::<C::Body>,
9401            method: "GET",
9402            headers: vec![]
9403        };
9404
9405        let request = self.client.build(req)?;
9406
9407        // --
9408
9409        let github_response = self.client.fetch_async(request).await?;
9410
9411        // --
9412
9413        if github_response.is_success() {
9414            Ok(github_response.to_json_async().await?)
9415        } else {
9416            match github_response.status_code() {
9417                500 => Err(OrgsListPatGrantRequestsError::Status500(github_response.to_json_async().await?).into()),
9418                422 => Err(OrgsListPatGrantRequestsError::Status422(github_response.to_json_async().await?).into()),
9419                404 => Err(OrgsListPatGrantRequestsError::Status404(github_response.to_json_async().await?).into()),
9420                403 => Err(OrgsListPatGrantRequestsError::Status403(github_response.to_json_async().await?).into()),
9421                code => Err(OrgsListPatGrantRequestsError::Generic { code }.into()),
9422            }
9423        }
9424    }
9425
9426    /// ---
9427    ///
9428    /// # List requests to access organization resources with fine-grained personal access tokens
9429    ///
9430    /// Lists requests from organization members to access organization resources with a fine-grained personal access token.
9431    /// 
9432    /// Only GitHub Apps can use this endpoint.
9433    ///
9434    /// [GitHub API docs for list_pat_grant_requests](https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens)
9435    ///
9436    /// ---
9437    #[cfg(not(target_arch = "wasm32"))]
9438    pub fn list_pat_grant_requests(&self, org: &str, query_params: Option<impl Into<OrgsListPatGrantRequestsParams<'api>>>) -> Result<Vec<OrganizationProgrammaticAccessGrantRequest>, AdapterError> {
9439
9440        let mut request_uri = format!("{}/orgs/{}/personal-access-token-requests", super::GITHUB_BASE_API_URL, org);
9441
9442        if let Some(params) = query_params {
9443            request_uri.push_str("?");
9444            let qp: OrgsListPatGrantRequestsParams = params.into();
9445            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
9446        }
9447
9448        let req = GitHubRequest {
9449            uri: request_uri,
9450            body: None,
9451            method: "GET",
9452            headers: vec![]
9453        };
9454
9455        let request = self.client.build(req)?;
9456
9457        // --
9458
9459        let github_response = self.client.fetch(request)?;
9460
9461        // --
9462
9463        if github_response.is_success() {
9464            Ok(github_response.to_json()?)
9465        } else {
9466            match github_response.status_code() {
9467                500 => Err(OrgsListPatGrantRequestsError::Status500(github_response.to_json()?).into()),
9468                422 => Err(OrgsListPatGrantRequestsError::Status422(github_response.to_json()?).into()),
9469                404 => Err(OrgsListPatGrantRequestsError::Status404(github_response.to_json()?).into()),
9470                403 => Err(OrgsListPatGrantRequestsError::Status403(github_response.to_json()?).into()),
9471                code => Err(OrgsListPatGrantRequestsError::Generic { code }.into()),
9472            }
9473        }
9474    }
9475
9476    /// ---
9477    ///
9478    /// # List fine-grained personal access tokens with access to organization resources
9479    ///
9480    /// Lists approved fine-grained personal access tokens owned by organization members that can access organization resources.
9481    /// 
9482    /// Only GitHub Apps can use this endpoint.
9483    ///
9484    /// [GitHub API docs for list_pat_grants](https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources)
9485    ///
9486    /// ---
9487    pub async fn list_pat_grants_async(&self, org: &str, query_params: Option<impl Into<OrgsListPatGrantsParams<'api>>>) -> Result<Vec<OrganizationProgrammaticAccessGrant>, AdapterError> {
9488
9489        let mut request_uri = format!("{}/orgs/{}/personal-access-tokens", super::GITHUB_BASE_API_URL, org);
9490
9491        if let Some(params) = query_params {
9492            request_uri.push_str("?");
9493            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
9494        }
9495
9496        let req = GitHubRequest {
9497            uri: request_uri,
9498            body: None::<C::Body>,
9499            method: "GET",
9500            headers: vec![]
9501        };
9502
9503        let request = self.client.build(req)?;
9504
9505        // --
9506
9507        let github_response = self.client.fetch_async(request).await?;
9508
9509        // --
9510
9511        if github_response.is_success() {
9512            Ok(github_response.to_json_async().await?)
9513        } else {
9514            match github_response.status_code() {
9515                500 => Err(OrgsListPatGrantsError::Status500(github_response.to_json_async().await?).into()),
9516                422 => Err(OrgsListPatGrantsError::Status422(github_response.to_json_async().await?).into()),
9517                404 => Err(OrgsListPatGrantsError::Status404(github_response.to_json_async().await?).into()),
9518                403 => Err(OrgsListPatGrantsError::Status403(github_response.to_json_async().await?).into()),
9519                code => Err(OrgsListPatGrantsError::Generic { code }.into()),
9520            }
9521        }
9522    }
9523
9524    /// ---
9525    ///
9526    /// # List fine-grained personal access tokens with access to organization resources
9527    ///
9528    /// Lists approved fine-grained personal access tokens owned by organization members that can access organization resources.
9529    /// 
9530    /// Only GitHub Apps can use this endpoint.
9531    ///
9532    /// [GitHub API docs for list_pat_grants](https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources)
9533    ///
9534    /// ---
9535    #[cfg(not(target_arch = "wasm32"))]
9536    pub fn list_pat_grants(&self, org: &str, query_params: Option<impl Into<OrgsListPatGrantsParams<'api>>>) -> Result<Vec<OrganizationProgrammaticAccessGrant>, AdapterError> {
9537
9538        let mut request_uri = format!("{}/orgs/{}/personal-access-tokens", super::GITHUB_BASE_API_URL, org);
9539
9540        if let Some(params) = query_params {
9541            request_uri.push_str("?");
9542            let qp: OrgsListPatGrantsParams = params.into();
9543            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
9544        }
9545
9546        let req = GitHubRequest {
9547            uri: request_uri,
9548            body: None,
9549            method: "GET",
9550            headers: vec![]
9551        };
9552
9553        let request = self.client.build(req)?;
9554
9555        // --
9556
9557        let github_response = self.client.fetch(request)?;
9558
9559        // --
9560
9561        if github_response.is_success() {
9562            Ok(github_response.to_json()?)
9563        } else {
9564            match github_response.status_code() {
9565                500 => Err(OrgsListPatGrantsError::Status500(github_response.to_json()?).into()),
9566                422 => Err(OrgsListPatGrantsError::Status422(github_response.to_json()?).into()),
9567                404 => Err(OrgsListPatGrantsError::Status404(github_response.to_json()?).into()),
9568                403 => Err(OrgsListPatGrantsError::Status403(github_response.to_json()?).into()),
9569                code => Err(OrgsListPatGrantsError::Generic { code }.into()),
9570            }
9571        }
9572    }
9573
9574    /// ---
9575    ///
9576    /// # List pending organization invitations
9577    ///
9578    /// The return hash contains a `role` field which refers to the Organization
9579    /// Invitation role and will be one of the following values: `direct_member`, `admin`,
9580    /// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub
9581    /// member, the `login` field in the return hash will be `null`.
9582    ///
9583    /// [GitHub API docs for list_pending_invitations](https://docs.github.com/rest/orgs/members#list-pending-organization-invitations)
9584    ///
9585    /// ---
9586    pub async fn list_pending_invitations_async(&self, org: &str, query_params: Option<impl Into<OrgsListPendingInvitationsParams<'api>>>) -> Result<Vec<OrganizationInvitation>, AdapterError> {
9587
9588        let mut request_uri = format!("{}/orgs/{}/invitations", super::GITHUB_BASE_API_URL, org);
9589
9590        if let Some(params) = query_params {
9591            request_uri.push_str("?");
9592            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
9593        }
9594
9595        let req = GitHubRequest {
9596            uri: request_uri,
9597            body: None::<C::Body>,
9598            method: "GET",
9599            headers: vec![]
9600        };
9601
9602        let request = self.client.build(req)?;
9603
9604        // --
9605
9606        let github_response = self.client.fetch_async(request).await?;
9607
9608        // --
9609
9610        if github_response.is_success() {
9611            Ok(github_response.to_json_async().await?)
9612        } else {
9613            match github_response.status_code() {
9614                404 => Err(OrgsListPendingInvitationsError::Status404(github_response.to_json_async().await?).into()),
9615                code => Err(OrgsListPendingInvitationsError::Generic { code }.into()),
9616            }
9617        }
9618    }
9619
9620    /// ---
9621    ///
9622    /// # List pending organization invitations
9623    ///
9624    /// The return hash contains a `role` field which refers to the Organization
9625    /// Invitation role and will be one of the following values: `direct_member`, `admin`,
9626    /// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub
9627    /// member, the `login` field in the return hash will be `null`.
9628    ///
9629    /// [GitHub API docs for list_pending_invitations](https://docs.github.com/rest/orgs/members#list-pending-organization-invitations)
9630    ///
9631    /// ---
9632    #[cfg(not(target_arch = "wasm32"))]
9633    pub fn list_pending_invitations(&self, org: &str, query_params: Option<impl Into<OrgsListPendingInvitationsParams<'api>>>) -> Result<Vec<OrganizationInvitation>, AdapterError> {
9634
9635        let mut request_uri = format!("{}/orgs/{}/invitations", super::GITHUB_BASE_API_URL, org);
9636
9637        if let Some(params) = query_params {
9638            request_uri.push_str("?");
9639            let qp: OrgsListPendingInvitationsParams = params.into();
9640            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
9641        }
9642
9643        let req = GitHubRequest {
9644            uri: request_uri,
9645            body: None,
9646            method: "GET",
9647            headers: vec![]
9648        };
9649
9650        let request = self.client.build(req)?;
9651
9652        // --
9653
9654        let github_response = self.client.fetch(request)?;
9655
9656        // --
9657
9658        if github_response.is_success() {
9659            Ok(github_response.to_json()?)
9660        } else {
9661            match github_response.status_code() {
9662                404 => Err(OrgsListPendingInvitationsError::Status404(github_response.to_json()?).into()),
9663                code => Err(OrgsListPendingInvitationsError::Generic { code }.into()),
9664            }
9665        }
9666    }
9667
9668    /// ---
9669    ///
9670    /// # List public organization members
9671    ///
9672    /// Members of an organization can choose to have their membership publicized or not.
9673    ///
9674    /// [GitHub API docs for list_public_members](https://docs.github.com/rest/orgs/members#list-public-organization-members)
9675    ///
9676    /// ---
9677    pub async fn list_public_members_async(&self, org: &str, query_params: Option<impl Into<OrgsListPublicMembersParams>>) -> Result<Vec<SimpleUser>, AdapterError> {
9678
9679        let mut request_uri = format!("{}/orgs/{}/public_members", super::GITHUB_BASE_API_URL, org);
9680
9681        if let Some(params) = query_params {
9682            request_uri.push_str("?");
9683            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
9684        }
9685
9686        let req = GitHubRequest {
9687            uri: request_uri,
9688            body: None::<C::Body>,
9689            method: "GET",
9690            headers: vec![]
9691        };
9692
9693        let request = self.client.build(req)?;
9694
9695        // --
9696
9697        let github_response = self.client.fetch_async(request).await?;
9698
9699        // --
9700
9701        if github_response.is_success() {
9702            Ok(github_response.to_json_async().await?)
9703        } else {
9704            match github_response.status_code() {
9705                code => Err(OrgsListPublicMembersError::Generic { code }.into()),
9706            }
9707        }
9708    }
9709
9710    /// ---
9711    ///
9712    /// # List public organization members
9713    ///
9714    /// Members of an organization can choose to have their membership publicized or not.
9715    ///
9716    /// [GitHub API docs for list_public_members](https://docs.github.com/rest/orgs/members#list-public-organization-members)
9717    ///
9718    /// ---
9719    #[cfg(not(target_arch = "wasm32"))]
9720    pub fn list_public_members(&self, org: &str, query_params: Option<impl Into<OrgsListPublicMembersParams>>) -> Result<Vec<SimpleUser>, AdapterError> {
9721
9722        let mut request_uri = format!("{}/orgs/{}/public_members", super::GITHUB_BASE_API_URL, org);
9723
9724        if let Some(params) = query_params {
9725            request_uri.push_str("?");
9726            let qp: OrgsListPublicMembersParams = params.into();
9727            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
9728        }
9729
9730        let req = GitHubRequest {
9731            uri: request_uri,
9732            body: None,
9733            method: "GET",
9734            headers: vec![]
9735        };
9736
9737        let request = self.client.build(req)?;
9738
9739        // --
9740
9741        let github_response = self.client.fetch(request)?;
9742
9743        // --
9744
9745        if github_response.is_success() {
9746            Ok(github_response.to_json()?)
9747        } else {
9748            match github_response.status_code() {
9749                code => Err(OrgsListPublicMembersError::Generic { code }.into()),
9750            }
9751        }
9752    }
9753
9754    /// ---
9755    ///
9756    /// # List security manager teams
9757    ///
9758    /// > [!WARNING]
9759    /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.
9760    ///
9761    /// [GitHub API docs for list_security_manager_teams](https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams)
9762    ///
9763    /// ---
9764    pub async fn list_security_manager_teams_async(&self, org: &str) -> Result<Vec<TeamSimple>, AdapterError> {
9765
9766        let request_uri = format!("{}/orgs/{}/security-managers", super::GITHUB_BASE_API_URL, org);
9767
9768
9769        let req = GitHubRequest {
9770            uri: request_uri,
9771            body: None::<C::Body>,
9772            method: "GET",
9773            headers: vec![]
9774        };
9775
9776        let request = self.client.build(req)?;
9777
9778        // --
9779
9780        let github_response = self.client.fetch_async(request).await?;
9781
9782        // --
9783
9784        if github_response.is_success() {
9785            Ok(github_response.to_json_async().await?)
9786        } else {
9787            match github_response.status_code() {
9788                code => Err(OrgsListSecurityManagerTeamsError::Generic { code }.into()),
9789            }
9790        }
9791    }
9792
9793    /// ---
9794    ///
9795    /// # List security manager teams
9796    ///
9797    /// > [!WARNING]
9798    /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.
9799    ///
9800    /// [GitHub API docs for list_security_manager_teams](https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams)
9801    ///
9802    /// ---
9803    #[cfg(not(target_arch = "wasm32"))]
9804    pub fn list_security_manager_teams(&self, org: &str) -> Result<Vec<TeamSimple>, AdapterError> {
9805
9806        let request_uri = format!("{}/orgs/{}/security-managers", super::GITHUB_BASE_API_URL, org);
9807
9808
9809        let req = GitHubRequest {
9810            uri: request_uri,
9811            body: None,
9812            method: "GET",
9813            headers: vec![]
9814        };
9815
9816        let request = self.client.build(req)?;
9817
9818        // --
9819
9820        let github_response = self.client.fetch(request)?;
9821
9822        // --
9823
9824        if github_response.is_success() {
9825            Ok(github_response.to_json()?)
9826        } else {
9827            match github_response.status_code() {
9828                code => Err(OrgsListSecurityManagerTeamsError::Generic { code }.into()),
9829            }
9830        }
9831    }
9832
9833    /// ---
9834    ///
9835    /// # List deliveries for an organization webhook
9836    ///
9837    /// Returns a list of webhook deliveries for a webhook configured in an organization.
9838    /// 
9839    /// You must be an organization owner to use this endpoint.
9840    /// 
9841    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
9842    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
9843    ///
9844    /// [GitHub API docs for list_webhook_deliveries](https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook)
9845    ///
9846    /// ---
9847    pub async fn list_webhook_deliveries_async(&self, org: &str, hook_id: i32, query_params: Option<impl Into<OrgsListWebhookDeliveriesParams<'api>>>) -> Result<Vec<HookDeliveryItem>, AdapterError> {
9848
9849        let mut request_uri = format!("{}/orgs/{}/hooks/{}/deliveries", super::GITHUB_BASE_API_URL, org, hook_id);
9850
9851        if let Some(params) = query_params {
9852            request_uri.push_str("?");
9853            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
9854        }
9855
9856        let req = GitHubRequest {
9857            uri: request_uri,
9858            body: None::<C::Body>,
9859            method: "GET",
9860            headers: vec![]
9861        };
9862
9863        let request = self.client.build(req)?;
9864
9865        // --
9866
9867        let github_response = self.client.fetch_async(request).await?;
9868
9869        // --
9870
9871        if github_response.is_success() {
9872            Ok(github_response.to_json_async().await?)
9873        } else {
9874            match github_response.status_code() {
9875                400 => Err(OrgsListWebhookDeliveriesError::Status400(github_response.to_json_async().await?).into()),
9876                422 => Err(OrgsListWebhookDeliveriesError::Status422(github_response.to_json_async().await?).into()),
9877                code => Err(OrgsListWebhookDeliveriesError::Generic { code }.into()),
9878            }
9879        }
9880    }
9881
9882    /// ---
9883    ///
9884    /// # List deliveries for an organization webhook
9885    ///
9886    /// Returns a list of webhook deliveries for a webhook configured in an organization.
9887    /// 
9888    /// You must be an organization owner to use this endpoint.
9889    /// 
9890    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
9891    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
9892    ///
9893    /// [GitHub API docs for list_webhook_deliveries](https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook)
9894    ///
9895    /// ---
9896    #[cfg(not(target_arch = "wasm32"))]
9897    pub fn list_webhook_deliveries(&self, org: &str, hook_id: i32, query_params: Option<impl Into<OrgsListWebhookDeliveriesParams<'api>>>) -> Result<Vec<HookDeliveryItem>, AdapterError> {
9898
9899        let mut request_uri = format!("{}/orgs/{}/hooks/{}/deliveries", super::GITHUB_BASE_API_URL, org, hook_id);
9900
9901        if let Some(params) = query_params {
9902            request_uri.push_str("?");
9903            let qp: OrgsListWebhookDeliveriesParams = params.into();
9904            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
9905        }
9906
9907        let req = GitHubRequest {
9908            uri: request_uri,
9909            body: None,
9910            method: "GET",
9911            headers: vec![]
9912        };
9913
9914        let request = self.client.build(req)?;
9915
9916        // --
9917
9918        let github_response = self.client.fetch(request)?;
9919
9920        // --
9921
9922        if github_response.is_success() {
9923            Ok(github_response.to_json()?)
9924        } else {
9925            match github_response.status_code() {
9926                400 => Err(OrgsListWebhookDeliveriesError::Status400(github_response.to_json()?).into()),
9927                422 => Err(OrgsListWebhookDeliveriesError::Status422(github_response.to_json()?).into()),
9928                code => Err(OrgsListWebhookDeliveriesError::Generic { code }.into()),
9929            }
9930        }
9931    }
9932
9933    /// ---
9934    ///
9935    /// # List organization webhooks
9936    ///
9937    /// List webhooks for an organization.
9938    /// 
9939    /// The authenticated user must be an organization owner to use this endpoint.
9940    /// 
9941    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
9942    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
9943    ///
9944    /// [GitHub API docs for list_webhooks](https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks)
9945    ///
9946    /// ---
9947    pub async fn list_webhooks_async(&self, org: &str, query_params: Option<impl Into<OrgsListWebhooksParams>>) -> Result<Vec<OrgHook>, AdapterError> {
9948
9949        let mut request_uri = format!("{}/orgs/{}/hooks", super::GITHUB_BASE_API_URL, org);
9950
9951        if let Some(params) = query_params {
9952            request_uri.push_str("?");
9953            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
9954        }
9955
9956        let req = GitHubRequest {
9957            uri: request_uri,
9958            body: None::<C::Body>,
9959            method: "GET",
9960            headers: vec![]
9961        };
9962
9963        let request = self.client.build(req)?;
9964
9965        // --
9966
9967        let github_response = self.client.fetch_async(request).await?;
9968
9969        // --
9970
9971        if github_response.is_success() {
9972            Ok(github_response.to_json_async().await?)
9973        } else {
9974            match github_response.status_code() {
9975                404 => Err(OrgsListWebhooksError::Status404(github_response.to_json_async().await?).into()),
9976                code => Err(OrgsListWebhooksError::Generic { code }.into()),
9977            }
9978        }
9979    }
9980
9981    /// ---
9982    ///
9983    /// # List organization webhooks
9984    ///
9985    /// List webhooks for an organization.
9986    /// 
9987    /// The authenticated user must be an organization owner to use this endpoint.
9988    /// 
9989    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
9990    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
9991    ///
9992    /// [GitHub API docs for list_webhooks](https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks)
9993    ///
9994    /// ---
9995    #[cfg(not(target_arch = "wasm32"))]
9996    pub fn list_webhooks(&self, org: &str, query_params: Option<impl Into<OrgsListWebhooksParams>>) -> Result<Vec<OrgHook>, AdapterError> {
9997
9998        let mut request_uri = format!("{}/orgs/{}/hooks", super::GITHUB_BASE_API_URL, org);
9999
10000        if let Some(params) = query_params {
10001            request_uri.push_str("?");
10002            let qp: OrgsListWebhooksParams = params.into();
10003            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
10004        }
10005
10006        let req = GitHubRequest {
10007            uri: request_uri,
10008            body: None,
10009            method: "GET",
10010            headers: vec![]
10011        };
10012
10013        let request = self.client.build(req)?;
10014
10015        // --
10016
10017        let github_response = self.client.fetch(request)?;
10018
10019        // --
10020
10021        if github_response.is_success() {
10022            Ok(github_response.to_json()?)
10023        } else {
10024            match github_response.status_code() {
10025                404 => Err(OrgsListWebhooksError::Status404(github_response.to_json()?).into()),
10026                code => Err(OrgsListWebhooksError::Generic { code }.into()),
10027            }
10028        }
10029    }
10030
10031    /// ---
10032    ///
10033    /// # Ping an organization webhook
10034    ///
10035    /// This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event)
10036    /// to be sent to the hook.
10037    /// 
10038    /// You must be an organization owner to use this endpoint.
10039    /// 
10040    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
10041    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
10042    ///
10043    /// [GitHub API docs for ping_webhook](https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook)
10044    ///
10045    /// ---
10046    pub async fn ping_webhook_async(&self, org: &str, hook_id: i32) -> Result<(), AdapterError> {
10047
10048        let request_uri = format!("{}/orgs/{}/hooks/{}/pings", super::GITHUB_BASE_API_URL, org, hook_id);
10049
10050
10051        let req = GitHubRequest {
10052            uri: request_uri,
10053            body: None::<C::Body>,
10054            method: "POST",
10055            headers: vec![]
10056        };
10057
10058        let request = self.client.build(req)?;
10059
10060        // --
10061
10062        let github_response = self.client.fetch_async(request).await?;
10063
10064        // --
10065
10066        if github_response.is_success() {
10067            Ok(())
10068        } else {
10069            match github_response.status_code() {
10070                404 => Err(OrgsPingWebhookError::Status404(github_response.to_json_async().await?).into()),
10071                code => Err(OrgsPingWebhookError::Generic { code }.into()),
10072            }
10073        }
10074    }
10075
10076    /// ---
10077    ///
10078    /// # Ping an organization webhook
10079    ///
10080    /// This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event)
10081    /// to be sent to the hook.
10082    /// 
10083    /// You must be an organization owner to use this endpoint.
10084    /// 
10085    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
10086    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
10087    ///
10088    /// [GitHub API docs for ping_webhook](https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook)
10089    ///
10090    /// ---
10091    #[cfg(not(target_arch = "wasm32"))]
10092    pub fn ping_webhook(&self, org: &str, hook_id: i32) -> Result<(), AdapterError> {
10093
10094        let request_uri = format!("{}/orgs/{}/hooks/{}/pings", super::GITHUB_BASE_API_URL, org, hook_id);
10095
10096
10097        let req = GitHubRequest {
10098            uri: request_uri,
10099            body: None,
10100            method: "POST",
10101            headers: vec![]
10102        };
10103
10104        let request = self.client.build(req)?;
10105
10106        // --
10107
10108        let github_response = self.client.fetch(request)?;
10109
10110        // --
10111
10112        if github_response.is_success() {
10113            Ok(())
10114        } else {
10115            match github_response.status_code() {
10116                404 => Err(OrgsPingWebhookError::Status404(github_response.to_json()?).into()),
10117                code => Err(OrgsPingWebhookError::Generic { code }.into()),
10118            }
10119        }
10120    }
10121
10122    /// ---
10123    ///
10124    /// # Redeliver a delivery for an organization webhook
10125    ///
10126    /// Redeliver a delivery for a webhook configured in an organization.
10127    /// 
10128    /// You must be an organization owner to use this endpoint.
10129    /// 
10130    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
10131    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
10132    ///
10133    /// [GitHub API docs for redeliver_webhook_delivery](https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook)
10134    ///
10135    /// ---
10136    pub async fn redeliver_webhook_delivery_async(&self, org: &str, hook_id: i32, delivery_id: i32) -> Result<HashMap<String, Value>, AdapterError> {
10137
10138        let request_uri = format!("{}/orgs/{}/hooks/{}/deliveries/{}/attempts", super::GITHUB_BASE_API_URL, org, hook_id, delivery_id);
10139
10140
10141        let req = GitHubRequest {
10142            uri: request_uri,
10143            body: None::<C::Body>,
10144            method: "POST",
10145            headers: vec![]
10146        };
10147
10148        let request = self.client.build(req)?;
10149
10150        // --
10151
10152        let github_response = self.client.fetch_async(request).await?;
10153
10154        // --
10155
10156        if github_response.is_success() {
10157            Ok(github_response.to_json_async().await?)
10158        } else {
10159            match github_response.status_code() {
10160                400 => Err(OrgsRedeliverWebhookDeliveryError::Status400(github_response.to_json_async().await?).into()),
10161                422 => Err(OrgsRedeliverWebhookDeliveryError::Status422(github_response.to_json_async().await?).into()),
10162                code => Err(OrgsRedeliverWebhookDeliveryError::Generic { code }.into()),
10163            }
10164        }
10165    }
10166
10167    /// ---
10168    ///
10169    /// # Redeliver a delivery for an organization webhook
10170    ///
10171    /// Redeliver a delivery for a webhook configured in an organization.
10172    /// 
10173    /// You must be an organization owner to use this endpoint.
10174    /// 
10175    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
10176    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
10177    ///
10178    /// [GitHub API docs for redeliver_webhook_delivery](https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook)
10179    ///
10180    /// ---
10181    #[cfg(not(target_arch = "wasm32"))]
10182    pub fn redeliver_webhook_delivery(&self, org: &str, hook_id: i32, delivery_id: i32) -> Result<HashMap<String, Value>, AdapterError> {
10183
10184        let request_uri = format!("{}/orgs/{}/hooks/{}/deliveries/{}/attempts", super::GITHUB_BASE_API_URL, org, hook_id, delivery_id);
10185
10186
10187        let req = GitHubRequest {
10188            uri: request_uri,
10189            body: None,
10190            method: "POST",
10191            headers: vec![]
10192        };
10193
10194        let request = self.client.build(req)?;
10195
10196        // --
10197
10198        let github_response = self.client.fetch(request)?;
10199
10200        // --
10201
10202        if github_response.is_success() {
10203            Ok(github_response.to_json()?)
10204        } else {
10205            match github_response.status_code() {
10206                400 => Err(OrgsRedeliverWebhookDeliveryError::Status400(github_response.to_json()?).into()),
10207                422 => Err(OrgsRedeliverWebhookDeliveryError::Status422(github_response.to_json()?).into()),
10208                code => Err(OrgsRedeliverWebhookDeliveryError::Generic { code }.into()),
10209            }
10210        }
10211    }
10212
10213    /// ---
10214    ///
10215    /// # Remove a custom property for an organization
10216    ///
10217    /// Removes a custom property that is defined for an organization.
10218    /// 
10219    /// To use this endpoint, the authenticated user must be one of:
10220    ///   - An administrator for the organization.
10221    ///   - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization.
10222    ///
10223    /// [GitHub API docs for remove_custom_property](https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization)
10224    ///
10225    /// ---
10226    pub async fn remove_custom_property_async(&self, org: &str, custom_property_name: &str) -> Result<(), AdapterError> {
10227
10228        let request_uri = format!("{}/orgs/{}/properties/schema/{}", super::GITHUB_BASE_API_URL, org, custom_property_name);
10229
10230
10231        let req = GitHubRequest {
10232            uri: request_uri,
10233            body: None::<C::Body>,
10234            method: "DELETE",
10235            headers: vec![]
10236        };
10237
10238        let request = self.client.build(req)?;
10239
10240        // --
10241
10242        let github_response = self.client.fetch_async(request).await?;
10243
10244        // --
10245
10246        if github_response.is_success() {
10247            Ok(())
10248        } else {
10249            match github_response.status_code() {
10250                403 => Err(OrgsRemoveCustomPropertyError::Status403(github_response.to_json_async().await?).into()),
10251                404 => Err(OrgsRemoveCustomPropertyError::Status404(github_response.to_json_async().await?).into()),
10252                code => Err(OrgsRemoveCustomPropertyError::Generic { code }.into()),
10253            }
10254        }
10255    }
10256
10257    /// ---
10258    ///
10259    /// # Remove a custom property for an organization
10260    ///
10261    /// Removes a custom property that is defined for an organization.
10262    /// 
10263    /// To use this endpoint, the authenticated user must be one of:
10264    ///   - An administrator for the organization.
10265    ///   - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization.
10266    ///
10267    /// [GitHub API docs for remove_custom_property](https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization)
10268    ///
10269    /// ---
10270    #[cfg(not(target_arch = "wasm32"))]
10271    pub fn remove_custom_property(&self, org: &str, custom_property_name: &str) -> Result<(), AdapterError> {
10272
10273        let request_uri = format!("{}/orgs/{}/properties/schema/{}", super::GITHUB_BASE_API_URL, org, custom_property_name);
10274
10275
10276        let req = GitHubRequest {
10277            uri: request_uri,
10278            body: None,
10279            method: "DELETE",
10280            headers: vec![]
10281        };
10282
10283        let request = self.client.build(req)?;
10284
10285        // --
10286
10287        let github_response = self.client.fetch(request)?;
10288
10289        // --
10290
10291        if github_response.is_success() {
10292            Ok(())
10293        } else {
10294            match github_response.status_code() {
10295                403 => Err(OrgsRemoveCustomPropertyError::Status403(github_response.to_json()?).into()),
10296                404 => Err(OrgsRemoveCustomPropertyError::Status404(github_response.to_json()?).into()),
10297                code => Err(OrgsRemoveCustomPropertyError::Generic { code }.into()),
10298            }
10299        }
10300    }
10301
10302    /// ---
10303    ///
10304    /// # Remove an organization member
10305    ///
10306    /// Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories.
10307    ///
10308    /// [GitHub API docs for remove_member](https://docs.github.com/rest/orgs/members#remove-an-organization-member)
10309    ///
10310    /// ---
10311    pub async fn remove_member_async(&self, org: &str, username: &str) -> Result<(), AdapterError> {
10312
10313        let request_uri = format!("{}/orgs/{}/members/{}", super::GITHUB_BASE_API_URL, org, username);
10314
10315
10316        let req = GitHubRequest {
10317            uri: request_uri,
10318            body: None::<C::Body>,
10319            method: "DELETE",
10320            headers: vec![]
10321        };
10322
10323        let request = self.client.build(req)?;
10324
10325        // --
10326
10327        let github_response = self.client.fetch_async(request).await?;
10328
10329        // --
10330
10331        if github_response.is_success() {
10332            Ok(())
10333        } else {
10334            match github_response.status_code() {
10335                403 => Err(OrgsRemoveMemberError::Status403(github_response.to_json_async().await?).into()),
10336                code => Err(OrgsRemoveMemberError::Generic { code }.into()),
10337            }
10338        }
10339    }
10340
10341    /// ---
10342    ///
10343    /// # Remove an organization member
10344    ///
10345    /// Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories.
10346    ///
10347    /// [GitHub API docs for remove_member](https://docs.github.com/rest/orgs/members#remove-an-organization-member)
10348    ///
10349    /// ---
10350    #[cfg(not(target_arch = "wasm32"))]
10351    pub fn remove_member(&self, org: &str, username: &str) -> Result<(), AdapterError> {
10352
10353        let request_uri = format!("{}/orgs/{}/members/{}", super::GITHUB_BASE_API_URL, org, username);
10354
10355
10356        let req = GitHubRequest {
10357            uri: request_uri,
10358            body: None,
10359            method: "DELETE",
10360            headers: vec![]
10361        };
10362
10363        let request = self.client.build(req)?;
10364
10365        // --
10366
10367        let github_response = self.client.fetch(request)?;
10368
10369        // --
10370
10371        if github_response.is_success() {
10372            Ok(())
10373        } else {
10374            match github_response.status_code() {
10375                403 => Err(OrgsRemoveMemberError::Status403(github_response.to_json()?).into()),
10376                code => Err(OrgsRemoveMemberError::Generic { code }.into()),
10377            }
10378        }
10379    }
10380
10381    /// ---
10382    ///
10383    /// # Remove organization membership for a user
10384    ///
10385    /// In order to remove a user's membership with an organization, the authenticated user must be an organization owner.
10386    /// 
10387    /// If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases.
10388    ///
10389    /// [GitHub API docs for remove_membership_for_user](https://docs.github.com/rest/orgs/members#remove-organization-membership-for-a-user)
10390    ///
10391    /// ---
10392    pub async fn remove_membership_for_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> {
10393
10394        let request_uri = format!("{}/orgs/{}/memberships/{}", super::GITHUB_BASE_API_URL, org, username);
10395
10396
10397        let req = GitHubRequest {
10398            uri: request_uri,
10399            body: None::<C::Body>,
10400            method: "DELETE",
10401            headers: vec![]
10402        };
10403
10404        let request = self.client.build(req)?;
10405
10406        // --
10407
10408        let github_response = self.client.fetch_async(request).await?;
10409
10410        // --
10411
10412        if github_response.is_success() {
10413            Ok(())
10414        } else {
10415            match github_response.status_code() {
10416                403 => Err(OrgsRemoveMembershipForUserError::Status403(github_response.to_json_async().await?).into()),
10417                404 => Err(OrgsRemoveMembershipForUserError::Status404(github_response.to_json_async().await?).into()),
10418                code => Err(OrgsRemoveMembershipForUserError::Generic { code }.into()),
10419            }
10420        }
10421    }
10422
10423    /// ---
10424    ///
10425    /// # Remove organization membership for a user
10426    ///
10427    /// In order to remove a user's membership with an organization, the authenticated user must be an organization owner.
10428    /// 
10429    /// If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases.
10430    ///
10431    /// [GitHub API docs for remove_membership_for_user](https://docs.github.com/rest/orgs/members#remove-organization-membership-for-a-user)
10432    ///
10433    /// ---
10434    #[cfg(not(target_arch = "wasm32"))]
10435    pub fn remove_membership_for_user(&self, org: &str, username: &str) -> Result<(), AdapterError> {
10436
10437        let request_uri = format!("{}/orgs/{}/memberships/{}", super::GITHUB_BASE_API_URL, org, username);
10438
10439
10440        let req = GitHubRequest {
10441            uri: request_uri,
10442            body: None,
10443            method: "DELETE",
10444            headers: vec![]
10445        };
10446
10447        let request = self.client.build(req)?;
10448
10449        // --
10450
10451        let github_response = self.client.fetch(request)?;
10452
10453        // --
10454
10455        if github_response.is_success() {
10456            Ok(())
10457        } else {
10458            match github_response.status_code() {
10459                403 => Err(OrgsRemoveMembershipForUserError::Status403(github_response.to_json()?).into()),
10460                404 => Err(OrgsRemoveMembershipForUserError::Status404(github_response.to_json()?).into()),
10461                code => Err(OrgsRemoveMembershipForUserError::Generic { code }.into()),
10462            }
10463        }
10464    }
10465
10466    /// ---
10467    ///
10468    /// # Remove outside collaborator from an organization
10469    ///
10470    /// Removing a user from this list will remove them from all the organization's repositories.
10471    ///
10472    /// [GitHub API docs for remove_outside_collaborator](https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization)
10473    ///
10474    /// ---
10475    pub async fn remove_outside_collaborator_async(&self, org: &str, username: &str) -> Result<(), AdapterError> {
10476
10477        let request_uri = format!("{}/orgs/{}/outside_collaborators/{}", super::GITHUB_BASE_API_URL, org, username);
10478
10479
10480        let req = GitHubRequest {
10481            uri: request_uri,
10482            body: None::<C::Body>,
10483            method: "DELETE",
10484            headers: vec![]
10485        };
10486
10487        let request = self.client.build(req)?;
10488
10489        // --
10490
10491        let github_response = self.client.fetch_async(request).await?;
10492
10493        // --
10494
10495        if github_response.is_success() {
10496            Ok(())
10497        } else {
10498            match github_response.status_code() {
10499                422 => Err(OrgsRemoveOutsideCollaboratorError::Status422(github_response.to_json_async().await?).into()),
10500                code => Err(OrgsRemoveOutsideCollaboratorError::Generic { code }.into()),
10501            }
10502        }
10503    }
10504
10505    /// ---
10506    ///
10507    /// # Remove outside collaborator from an organization
10508    ///
10509    /// Removing a user from this list will remove them from all the organization's repositories.
10510    ///
10511    /// [GitHub API docs for remove_outside_collaborator](https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization)
10512    ///
10513    /// ---
10514    #[cfg(not(target_arch = "wasm32"))]
10515    pub fn remove_outside_collaborator(&self, org: &str, username: &str) -> Result<(), AdapterError> {
10516
10517        let request_uri = format!("{}/orgs/{}/outside_collaborators/{}", super::GITHUB_BASE_API_URL, org, username);
10518
10519
10520        let req = GitHubRequest {
10521            uri: request_uri,
10522            body: None,
10523            method: "DELETE",
10524            headers: vec![]
10525        };
10526
10527        let request = self.client.build(req)?;
10528
10529        // --
10530
10531        let github_response = self.client.fetch(request)?;
10532
10533        // --
10534
10535        if github_response.is_success() {
10536            Ok(())
10537        } else {
10538            match github_response.status_code() {
10539                422 => Err(OrgsRemoveOutsideCollaboratorError::Status422(github_response.to_json()?).into()),
10540                code => Err(OrgsRemoveOutsideCollaboratorError::Generic { code }.into()),
10541            }
10542        }
10543    }
10544
10545    /// ---
10546    ///
10547    /// # Remove public organization membership for the authenticated user
10548    ///
10549    /// Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default.
10550    ///
10551    /// [GitHub API docs for remove_public_membership_for_authenticated_user](https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user)
10552    ///
10553    /// ---
10554    pub async fn remove_public_membership_for_authenticated_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> {
10555
10556        let request_uri = format!("{}/orgs/{}/public_members/{}", super::GITHUB_BASE_API_URL, org, username);
10557
10558
10559        let req = GitHubRequest {
10560            uri: request_uri,
10561            body: None::<C::Body>,
10562            method: "DELETE",
10563            headers: vec![]
10564        };
10565
10566        let request = self.client.build(req)?;
10567
10568        // --
10569
10570        let github_response = self.client.fetch_async(request).await?;
10571
10572        // --
10573
10574        if github_response.is_success() {
10575            Ok(())
10576        } else {
10577            match github_response.status_code() {
10578                code => Err(OrgsRemovePublicMembershipForAuthenticatedUserError::Generic { code }.into()),
10579            }
10580        }
10581    }
10582
10583    /// ---
10584    ///
10585    /// # Remove public organization membership for the authenticated user
10586    ///
10587    /// Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default.
10588    ///
10589    /// [GitHub API docs for remove_public_membership_for_authenticated_user](https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user)
10590    ///
10591    /// ---
10592    #[cfg(not(target_arch = "wasm32"))]
10593    pub fn remove_public_membership_for_authenticated_user(&self, org: &str, username: &str) -> Result<(), AdapterError> {
10594
10595        let request_uri = format!("{}/orgs/{}/public_members/{}", super::GITHUB_BASE_API_URL, org, username);
10596
10597
10598        let req = GitHubRequest {
10599            uri: request_uri,
10600            body: None,
10601            method: "DELETE",
10602            headers: vec![]
10603        };
10604
10605        let request = self.client.build(req)?;
10606
10607        // --
10608
10609        let github_response = self.client.fetch(request)?;
10610
10611        // --
10612
10613        if github_response.is_success() {
10614            Ok(())
10615        } else {
10616            match github_response.status_code() {
10617                code => Err(OrgsRemovePublicMembershipForAuthenticatedUserError::Generic { code }.into()),
10618            }
10619        }
10620    }
10621
10622    /// ---
10623    ///
10624    /// # Remove a security manager team
10625    ///
10626    /// > [!WARNING]
10627    /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.
10628    ///
10629    /// [GitHub API docs for remove_security_manager_team](https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team)
10630    ///
10631    /// ---
10632    pub async fn remove_security_manager_team_async(&self, org: &str, team_slug: &str) -> Result<(), AdapterError> {
10633
10634        let request_uri = format!("{}/orgs/{}/security-managers/teams/{}", super::GITHUB_BASE_API_URL, org, team_slug);
10635
10636
10637        let req = GitHubRequest {
10638            uri: request_uri,
10639            body: None::<C::Body>,
10640            method: "DELETE",
10641            headers: vec![]
10642        };
10643
10644        let request = self.client.build(req)?;
10645
10646        // --
10647
10648        let github_response = self.client.fetch_async(request).await?;
10649
10650        // --
10651
10652        if github_response.is_success() {
10653            Ok(())
10654        } else {
10655            match github_response.status_code() {
10656                code => Err(OrgsRemoveSecurityManagerTeamError::Generic { code }.into()),
10657            }
10658        }
10659    }
10660
10661    /// ---
10662    ///
10663    /// # Remove a security manager team
10664    ///
10665    /// > [!WARNING]
10666    /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.
10667    ///
10668    /// [GitHub API docs for remove_security_manager_team](https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team)
10669    ///
10670    /// ---
10671    #[cfg(not(target_arch = "wasm32"))]
10672    pub fn remove_security_manager_team(&self, org: &str, team_slug: &str) -> Result<(), AdapterError> {
10673
10674        let request_uri = format!("{}/orgs/{}/security-managers/teams/{}", super::GITHUB_BASE_API_URL, org, team_slug);
10675
10676
10677        let req = GitHubRequest {
10678            uri: request_uri,
10679            body: None,
10680            method: "DELETE",
10681            headers: vec![]
10682        };
10683
10684        let request = self.client.build(req)?;
10685
10686        // --
10687
10688        let github_response = self.client.fetch(request)?;
10689
10690        // --
10691
10692        if github_response.is_success() {
10693            Ok(())
10694        } else {
10695            match github_response.status_code() {
10696                code => Err(OrgsRemoveSecurityManagerTeamError::Generic { code }.into()),
10697            }
10698        }
10699    }
10700
10701    /// ---
10702    ///
10703    /// # Review a request to access organization resources with a fine-grained personal access token
10704    ///
10705    /// Approves or denies a pending request to access organization resources via a fine-grained personal access token.
10706    /// 
10707    /// Only GitHub Apps can use this endpoint.
10708    ///
10709    /// [GitHub API docs for review_pat_grant_request](https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token)
10710    ///
10711    /// ---
10712    pub async fn review_pat_grant_request_async(&self, org: &str, pat_request_id: i32, body: PostOrgsReviewPatGrantRequest) -> Result<(), AdapterError> {
10713
10714        let request_uri = format!("{}/orgs/{}/personal-access-token-requests/{}", super::GITHUB_BASE_API_URL, org, pat_request_id);
10715
10716
10717        let req = GitHubRequest {
10718            uri: request_uri,
10719            body: Some(C::from_json::<PostOrgsReviewPatGrantRequest>(body)?),
10720            method: "POST",
10721            headers: vec![]
10722        };
10723
10724        let request = self.client.build(req)?;
10725
10726        // --
10727
10728        let github_response = self.client.fetch_async(request).await?;
10729
10730        // --
10731
10732        if github_response.is_success() {
10733            Ok(())
10734        } else {
10735            match github_response.status_code() {
10736                500 => Err(OrgsReviewPatGrantRequestError::Status500(github_response.to_json_async().await?).into()),
10737                422 => Err(OrgsReviewPatGrantRequestError::Status422(github_response.to_json_async().await?).into()),
10738                404 => Err(OrgsReviewPatGrantRequestError::Status404(github_response.to_json_async().await?).into()),
10739                403 => Err(OrgsReviewPatGrantRequestError::Status403(github_response.to_json_async().await?).into()),
10740                code => Err(OrgsReviewPatGrantRequestError::Generic { code }.into()),
10741            }
10742        }
10743    }
10744
10745    /// ---
10746    ///
10747    /// # Review a request to access organization resources with a fine-grained personal access token
10748    ///
10749    /// Approves or denies a pending request to access organization resources via a fine-grained personal access token.
10750    /// 
10751    /// Only GitHub Apps can use this endpoint.
10752    ///
10753    /// [GitHub API docs for review_pat_grant_request](https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token)
10754    ///
10755    /// ---
10756    #[cfg(not(target_arch = "wasm32"))]
10757    pub fn review_pat_grant_request(&self, org: &str, pat_request_id: i32, body: PostOrgsReviewPatGrantRequest) -> Result<(), AdapterError> {
10758
10759        let request_uri = format!("{}/orgs/{}/personal-access-token-requests/{}", super::GITHUB_BASE_API_URL, org, pat_request_id);
10760
10761
10762        let req = GitHubRequest {
10763            uri: request_uri,
10764            body: Some(C::from_json::<PostOrgsReviewPatGrantRequest>(body)?),
10765            method: "POST",
10766            headers: vec![]
10767        };
10768
10769        let request = self.client.build(req)?;
10770
10771        // --
10772
10773        let github_response = self.client.fetch(request)?;
10774
10775        // --
10776
10777        if github_response.is_success() {
10778            Ok(())
10779        } else {
10780            match github_response.status_code() {
10781                500 => Err(OrgsReviewPatGrantRequestError::Status500(github_response.to_json()?).into()),
10782                422 => Err(OrgsReviewPatGrantRequestError::Status422(github_response.to_json()?).into()),
10783                404 => Err(OrgsReviewPatGrantRequestError::Status404(github_response.to_json()?).into()),
10784                403 => Err(OrgsReviewPatGrantRequestError::Status403(github_response.to_json()?).into()),
10785                code => Err(OrgsReviewPatGrantRequestError::Generic { code }.into()),
10786            }
10787        }
10788    }
10789
10790    /// ---
10791    ///
10792    /// # Review requests to access organization resources with fine-grained personal access tokens
10793    ///
10794    /// Approves or denies multiple pending requests to access organization resources via a fine-grained personal access token.
10795    /// 
10796    /// Only GitHub Apps can use this endpoint.
10797    ///
10798    /// [GitHub API docs for review_pat_grant_requests_in_bulk](https://docs.github.com/rest/orgs/personal-access-tokens#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens)
10799    ///
10800    /// ---
10801    pub async fn review_pat_grant_requests_in_bulk_async(&self, org: &str, body: PostOrgsReviewPatGrantRequestsInBulk) -> Result<HashMap<String, Value>, AdapterError> {
10802
10803        let request_uri = format!("{}/orgs/{}/personal-access-token-requests", super::GITHUB_BASE_API_URL, org);
10804
10805
10806        let req = GitHubRequest {
10807            uri: request_uri,
10808            body: Some(C::from_json::<PostOrgsReviewPatGrantRequestsInBulk>(body)?),
10809            method: "POST",
10810            headers: vec![]
10811        };
10812
10813        let request = self.client.build(req)?;
10814
10815        // --
10816
10817        let github_response = self.client.fetch_async(request).await?;
10818
10819        // --
10820
10821        if github_response.is_success() {
10822            Ok(github_response.to_json_async().await?)
10823        } else {
10824            match github_response.status_code() {
10825                500 => Err(OrgsReviewPatGrantRequestsInBulkError::Status500(github_response.to_json_async().await?).into()),
10826                422 => Err(OrgsReviewPatGrantRequestsInBulkError::Status422(github_response.to_json_async().await?).into()),
10827                404 => Err(OrgsReviewPatGrantRequestsInBulkError::Status404(github_response.to_json_async().await?).into()),
10828                403 => Err(OrgsReviewPatGrantRequestsInBulkError::Status403(github_response.to_json_async().await?).into()),
10829                code => Err(OrgsReviewPatGrantRequestsInBulkError::Generic { code }.into()),
10830            }
10831        }
10832    }
10833
10834    /// ---
10835    ///
10836    /// # Review requests to access organization resources with fine-grained personal access tokens
10837    ///
10838    /// Approves or denies multiple pending requests to access organization resources via a fine-grained personal access token.
10839    /// 
10840    /// Only GitHub Apps can use this endpoint.
10841    ///
10842    /// [GitHub API docs for review_pat_grant_requests_in_bulk](https://docs.github.com/rest/orgs/personal-access-tokens#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens)
10843    ///
10844    /// ---
10845    #[cfg(not(target_arch = "wasm32"))]
10846    pub fn review_pat_grant_requests_in_bulk(&self, org: &str, body: PostOrgsReviewPatGrantRequestsInBulk) -> Result<HashMap<String, Value>, AdapterError> {
10847
10848        let request_uri = format!("{}/orgs/{}/personal-access-token-requests", super::GITHUB_BASE_API_URL, org);
10849
10850
10851        let req = GitHubRequest {
10852            uri: request_uri,
10853            body: Some(C::from_json::<PostOrgsReviewPatGrantRequestsInBulk>(body)?),
10854            method: "POST",
10855            headers: vec![]
10856        };
10857
10858        let request = self.client.build(req)?;
10859
10860        // --
10861
10862        let github_response = self.client.fetch(request)?;
10863
10864        // --
10865
10866        if github_response.is_success() {
10867            Ok(github_response.to_json()?)
10868        } else {
10869            match github_response.status_code() {
10870                500 => Err(OrgsReviewPatGrantRequestsInBulkError::Status500(github_response.to_json()?).into()),
10871                422 => Err(OrgsReviewPatGrantRequestsInBulkError::Status422(github_response.to_json()?).into()),
10872                404 => Err(OrgsReviewPatGrantRequestsInBulkError::Status404(github_response.to_json()?).into()),
10873                403 => Err(OrgsReviewPatGrantRequestsInBulkError::Status403(github_response.to_json()?).into()),
10874                code => Err(OrgsReviewPatGrantRequestsInBulkError::Generic { code }.into()),
10875            }
10876        }
10877    }
10878
10879    /// ---
10880    ///
10881    /// # Remove all organization roles for a team
10882    ///
10883    /// Removes all assigned organization roles from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
10884    /// 
10885    /// The authenticated user must be an administrator for the organization to use this endpoint.
10886    /// 
10887    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
10888    ///
10889    /// [GitHub API docs for revoke_all_org_roles_team](https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-team)
10890    ///
10891    /// ---
10892    pub async fn revoke_all_org_roles_team_async(&self, org: &str, team_slug: &str) -> Result<(), AdapterError> {
10893
10894        let request_uri = format!("{}/orgs/{}/organization-roles/teams/{}", super::GITHUB_BASE_API_URL, org, team_slug);
10895
10896
10897        let req = GitHubRequest {
10898            uri: request_uri,
10899            body: None::<C::Body>,
10900            method: "DELETE",
10901            headers: vec![]
10902        };
10903
10904        let request = self.client.build(req)?;
10905
10906        // --
10907
10908        let github_response = self.client.fetch_async(request).await?;
10909
10910        // --
10911
10912        if github_response.is_success() {
10913            Ok(())
10914        } else {
10915            match github_response.status_code() {
10916                code => Err(OrgsRevokeAllOrgRolesTeamError::Generic { code }.into()),
10917            }
10918        }
10919    }
10920
10921    /// ---
10922    ///
10923    /// # Remove all organization roles for a team
10924    ///
10925    /// Removes all assigned organization roles from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
10926    /// 
10927    /// The authenticated user must be an administrator for the organization to use this endpoint.
10928    /// 
10929    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
10930    ///
10931    /// [GitHub API docs for revoke_all_org_roles_team](https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-team)
10932    ///
10933    /// ---
10934    #[cfg(not(target_arch = "wasm32"))]
10935    pub fn revoke_all_org_roles_team(&self, org: &str, team_slug: &str) -> Result<(), AdapterError> {
10936
10937        let request_uri = format!("{}/orgs/{}/organization-roles/teams/{}", super::GITHUB_BASE_API_URL, org, team_slug);
10938
10939
10940        let req = GitHubRequest {
10941            uri: request_uri,
10942            body: None,
10943            method: "DELETE",
10944            headers: vec![]
10945        };
10946
10947        let request = self.client.build(req)?;
10948
10949        // --
10950
10951        let github_response = self.client.fetch(request)?;
10952
10953        // --
10954
10955        if github_response.is_success() {
10956            Ok(())
10957        } else {
10958            match github_response.status_code() {
10959                code => Err(OrgsRevokeAllOrgRolesTeamError::Generic { code }.into()),
10960            }
10961        }
10962    }
10963
10964    /// ---
10965    ///
10966    /// # Remove all organization roles for a user
10967    ///
10968    /// Revokes all assigned organization roles from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
10969    /// 
10970    /// The authenticated user must be an administrator for the organization to use this endpoint.
10971    /// 
10972    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
10973    ///
10974    /// [GitHub API docs for revoke_all_org_roles_user](https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-user)
10975    ///
10976    /// ---
10977    pub async fn revoke_all_org_roles_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> {
10978
10979        let request_uri = format!("{}/orgs/{}/organization-roles/users/{}", super::GITHUB_BASE_API_URL, org, username);
10980
10981
10982        let req = GitHubRequest {
10983            uri: request_uri,
10984            body: None::<C::Body>,
10985            method: "DELETE",
10986            headers: vec![]
10987        };
10988
10989        let request = self.client.build(req)?;
10990
10991        // --
10992
10993        let github_response = self.client.fetch_async(request).await?;
10994
10995        // --
10996
10997        if github_response.is_success() {
10998            Ok(())
10999        } else {
11000            match github_response.status_code() {
11001                code => Err(OrgsRevokeAllOrgRolesUserError::Generic { code }.into()),
11002            }
11003        }
11004    }
11005
11006    /// ---
11007    ///
11008    /// # Remove all organization roles for a user
11009    ///
11010    /// Revokes all assigned organization roles from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
11011    /// 
11012    /// The authenticated user must be an administrator for the organization to use this endpoint.
11013    /// 
11014    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
11015    ///
11016    /// [GitHub API docs for revoke_all_org_roles_user](https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-user)
11017    ///
11018    /// ---
11019    #[cfg(not(target_arch = "wasm32"))]
11020    pub fn revoke_all_org_roles_user(&self, org: &str, username: &str) -> Result<(), AdapterError> {
11021
11022        let request_uri = format!("{}/orgs/{}/organization-roles/users/{}", super::GITHUB_BASE_API_URL, org, username);
11023
11024
11025        let req = GitHubRequest {
11026            uri: request_uri,
11027            body: None,
11028            method: "DELETE",
11029            headers: vec![]
11030        };
11031
11032        let request = self.client.build(req)?;
11033
11034        // --
11035
11036        let github_response = self.client.fetch(request)?;
11037
11038        // --
11039
11040        if github_response.is_success() {
11041            Ok(())
11042        } else {
11043            match github_response.status_code() {
11044                code => Err(OrgsRevokeAllOrgRolesUserError::Generic { code }.into()),
11045            }
11046        }
11047    }
11048
11049    /// ---
11050    ///
11051    /// # Remove an organization role from a team
11052    ///
11053    /// Removes an organization role from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
11054    /// 
11055    /// The authenticated user must be an administrator for the organization to use this endpoint.
11056    /// 
11057    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
11058    ///
11059    /// [GitHub API docs for revoke_org_role_team](https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team)
11060    ///
11061    /// ---
11062    pub async fn revoke_org_role_team_async(&self, org: &str, team_slug: &str, role_id: i32) -> Result<(), AdapterError> {
11063
11064        let request_uri = format!("{}/orgs/{}/organization-roles/teams/{}/{}", super::GITHUB_BASE_API_URL, org, team_slug, role_id);
11065
11066
11067        let req = GitHubRequest {
11068            uri: request_uri,
11069            body: None::<C::Body>,
11070            method: "DELETE",
11071            headers: vec![]
11072        };
11073
11074        let request = self.client.build(req)?;
11075
11076        // --
11077
11078        let github_response = self.client.fetch_async(request).await?;
11079
11080        // --
11081
11082        if github_response.is_success() {
11083            Ok(())
11084        } else {
11085            match github_response.status_code() {
11086                code => Err(OrgsRevokeOrgRoleTeamError::Generic { code }.into()),
11087            }
11088        }
11089    }
11090
11091    /// ---
11092    ///
11093    /// # Remove an organization role from a team
11094    ///
11095    /// Removes an organization role from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
11096    /// 
11097    /// The authenticated user must be an administrator for the organization to use this endpoint.
11098    /// 
11099    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
11100    ///
11101    /// [GitHub API docs for revoke_org_role_team](https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team)
11102    ///
11103    /// ---
11104    #[cfg(not(target_arch = "wasm32"))]
11105    pub fn revoke_org_role_team(&self, org: &str, team_slug: &str, role_id: i32) -> Result<(), AdapterError> {
11106
11107        let request_uri = format!("{}/orgs/{}/organization-roles/teams/{}/{}", super::GITHUB_BASE_API_URL, org, team_slug, role_id);
11108
11109
11110        let req = GitHubRequest {
11111            uri: request_uri,
11112            body: None,
11113            method: "DELETE",
11114            headers: vec![]
11115        };
11116
11117        let request = self.client.build(req)?;
11118
11119        // --
11120
11121        let github_response = self.client.fetch(request)?;
11122
11123        // --
11124
11125        if github_response.is_success() {
11126            Ok(())
11127        } else {
11128            match github_response.status_code() {
11129                code => Err(OrgsRevokeOrgRoleTeamError::Generic { code }.into()),
11130            }
11131        }
11132    }
11133
11134    /// ---
11135    ///
11136    /// # Remove an organization role from a user
11137    ///
11138    /// Remove an organization role from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
11139    /// 
11140    /// The authenticated user must be an administrator for the organization to use this endpoint.
11141    /// 
11142    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
11143    ///
11144    /// [GitHub API docs for revoke_org_role_user](https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user)
11145    ///
11146    /// ---
11147    pub async fn revoke_org_role_user_async(&self, org: &str, username: &str, role_id: i32) -> Result<(), AdapterError> {
11148
11149        let request_uri = format!("{}/orgs/{}/organization-roles/users/{}/{}", super::GITHUB_BASE_API_URL, org, username, role_id);
11150
11151
11152        let req = GitHubRequest {
11153            uri: request_uri,
11154            body: None::<C::Body>,
11155            method: "DELETE",
11156            headers: vec![]
11157        };
11158
11159        let request = self.client.build(req)?;
11160
11161        // --
11162
11163        let github_response = self.client.fetch_async(request).await?;
11164
11165        // --
11166
11167        if github_response.is_success() {
11168            Ok(())
11169        } else {
11170            match github_response.status_code() {
11171                code => Err(OrgsRevokeOrgRoleUserError::Generic { code }.into()),
11172            }
11173        }
11174    }
11175
11176    /// ---
11177    ///
11178    /// # Remove an organization role from a user
11179    ///
11180    /// Remove an organization role from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
11181    /// 
11182    /// The authenticated user must be an administrator for the organization to use this endpoint.
11183    /// 
11184    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
11185    ///
11186    /// [GitHub API docs for revoke_org_role_user](https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user)
11187    ///
11188    /// ---
11189    #[cfg(not(target_arch = "wasm32"))]
11190    pub fn revoke_org_role_user(&self, org: &str, username: &str, role_id: i32) -> Result<(), AdapterError> {
11191
11192        let request_uri = format!("{}/orgs/{}/organization-roles/users/{}/{}", super::GITHUB_BASE_API_URL, org, username, role_id);
11193
11194
11195        let req = GitHubRequest {
11196            uri: request_uri,
11197            body: None,
11198            method: "DELETE",
11199            headers: vec![]
11200        };
11201
11202        let request = self.client.build(req)?;
11203
11204        // --
11205
11206        let github_response = self.client.fetch(request)?;
11207
11208        // --
11209
11210        if github_response.is_success() {
11211            Ok(())
11212        } else {
11213            match github_response.status_code() {
11214                code => Err(OrgsRevokeOrgRoleUserError::Generic { code }.into()),
11215            }
11216        }
11217    }
11218
11219    /// ---
11220    ///
11221    /// # Set organization membership for a user
11222    ///
11223    /// Only authenticated organization owners can add a member to the organization or update the member's role.
11224    /// 
11225    /// *   If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) will be `pending` until they accept the invitation.
11226    ///     
11227    /// *   Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent.
11228    /// 
11229    /// **Rate limits**
11230    /// 
11231    /// To prevent abuse, organization owners are limited to creating 50 organization invitations for an organization within a 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period.
11232    ///
11233    /// [GitHub API docs for set_membership_for_user](https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user)
11234    ///
11235    /// ---
11236    pub async fn set_membership_for_user_async(&self, org: &str, username: &str, body: PutOrgsSetMembershipForUser) -> Result<OrgMembership, AdapterError> {
11237
11238        let request_uri = format!("{}/orgs/{}/memberships/{}", super::GITHUB_BASE_API_URL, org, username);
11239
11240
11241        let req = GitHubRequest {
11242            uri: request_uri,
11243            body: Some(C::from_json::<PutOrgsSetMembershipForUser>(body)?),
11244            method: "PUT",
11245            headers: vec![]
11246        };
11247
11248        let request = self.client.build(req)?;
11249
11250        // --
11251
11252        let github_response = self.client.fetch_async(request).await?;
11253
11254        // --
11255
11256        if github_response.is_success() {
11257            Ok(github_response.to_json_async().await?)
11258        } else {
11259            match github_response.status_code() {
11260                422 => Err(OrgsSetMembershipForUserError::Status422(github_response.to_json_async().await?).into()),
11261                403 => Err(OrgsSetMembershipForUserError::Status403(github_response.to_json_async().await?).into()),
11262                code => Err(OrgsSetMembershipForUserError::Generic { code }.into()),
11263            }
11264        }
11265    }
11266
11267    /// ---
11268    ///
11269    /// # Set organization membership for a user
11270    ///
11271    /// Only authenticated organization owners can add a member to the organization or update the member's role.
11272    /// 
11273    /// *   If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) will be `pending` until they accept the invitation.
11274    ///     
11275    /// *   Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent.
11276    /// 
11277    /// **Rate limits**
11278    /// 
11279    /// To prevent abuse, organization owners are limited to creating 50 organization invitations for an organization within a 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period.
11280    ///
11281    /// [GitHub API docs for set_membership_for_user](https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user)
11282    ///
11283    /// ---
11284    #[cfg(not(target_arch = "wasm32"))]
11285    pub fn set_membership_for_user(&self, org: &str, username: &str, body: PutOrgsSetMembershipForUser) -> Result<OrgMembership, AdapterError> {
11286
11287        let request_uri = format!("{}/orgs/{}/memberships/{}", super::GITHUB_BASE_API_URL, org, username);
11288
11289
11290        let req = GitHubRequest {
11291            uri: request_uri,
11292            body: Some(C::from_json::<PutOrgsSetMembershipForUser>(body)?),
11293            method: "PUT",
11294            headers: vec![]
11295        };
11296
11297        let request = self.client.build(req)?;
11298
11299        // --
11300
11301        let github_response = self.client.fetch(request)?;
11302
11303        // --
11304
11305        if github_response.is_success() {
11306            Ok(github_response.to_json()?)
11307        } else {
11308            match github_response.status_code() {
11309                422 => Err(OrgsSetMembershipForUserError::Status422(github_response.to_json()?).into()),
11310                403 => Err(OrgsSetMembershipForUserError::Status403(github_response.to_json()?).into()),
11311                code => Err(OrgsSetMembershipForUserError::Generic { code }.into()),
11312            }
11313        }
11314    }
11315
11316    /// ---
11317    ///
11318    /// # Set public organization membership for the authenticated user
11319    ///
11320    /// The user can publicize their own membership. (A user cannot publicize the membership for another user.)
11321    /// 
11322    /// Note that 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)."
11323    ///
11324    /// [GitHub API docs for set_public_membership_for_authenticated_user](https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user)
11325    ///
11326    /// ---
11327    pub async fn set_public_membership_for_authenticated_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> {
11328
11329        let request_uri = format!("{}/orgs/{}/public_members/{}", super::GITHUB_BASE_API_URL, org, username);
11330
11331
11332        let req = GitHubRequest {
11333            uri: request_uri,
11334            body: None::<C::Body>,
11335            method: "PUT",
11336            headers: vec![]
11337        };
11338
11339        let request = self.client.build(req)?;
11340
11341        // --
11342
11343        let github_response = self.client.fetch_async(request).await?;
11344
11345        // --
11346
11347        if github_response.is_success() {
11348            Ok(())
11349        } else {
11350            match github_response.status_code() {
11351                403 => Err(OrgsSetPublicMembershipForAuthenticatedUserError::Status403(github_response.to_json_async().await?).into()),
11352                code => Err(OrgsSetPublicMembershipForAuthenticatedUserError::Generic { code }.into()),
11353            }
11354        }
11355    }
11356
11357    /// ---
11358    ///
11359    /// # Set public organization membership for the authenticated user
11360    ///
11361    /// The user can publicize their own membership. (A user cannot publicize the membership for another user.)
11362    /// 
11363    /// Note that 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)."
11364    ///
11365    /// [GitHub API docs for set_public_membership_for_authenticated_user](https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user)
11366    ///
11367    /// ---
11368    #[cfg(not(target_arch = "wasm32"))]
11369    pub fn set_public_membership_for_authenticated_user(&self, org: &str, username: &str) -> Result<(), AdapterError> {
11370
11371        let request_uri = format!("{}/orgs/{}/public_members/{}", super::GITHUB_BASE_API_URL, org, username);
11372
11373
11374        let req = GitHubRequest {
11375            uri: request_uri,
11376            body: None,
11377            method: "PUT",
11378            headers: vec![]
11379        };
11380
11381        let request = self.client.build(req)?;
11382
11383        // --
11384
11385        let github_response = self.client.fetch(request)?;
11386
11387        // --
11388
11389        if github_response.is_success() {
11390            Ok(())
11391        } else {
11392            match github_response.status_code() {
11393                403 => Err(OrgsSetPublicMembershipForAuthenticatedUserError::Status403(github_response.to_json()?).into()),
11394                code => Err(OrgsSetPublicMembershipForAuthenticatedUserError::Generic { code }.into()),
11395            }
11396        }
11397    }
11398
11399    /// ---
11400    ///
11401    /// # Unblock a user from an organization
11402    ///
11403    /// Unblocks the given user on behalf of the specified organization.
11404    ///
11405    /// [GitHub API docs for unblock_user](https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization)
11406    ///
11407    /// ---
11408    pub async fn unblock_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> {
11409
11410        let request_uri = format!("{}/orgs/{}/blocks/{}", super::GITHUB_BASE_API_URL, org, username);
11411
11412
11413        let req = GitHubRequest {
11414            uri: request_uri,
11415            body: None::<C::Body>,
11416            method: "DELETE",
11417            headers: vec![]
11418        };
11419
11420        let request = self.client.build(req)?;
11421
11422        // --
11423
11424        let github_response = self.client.fetch_async(request).await?;
11425
11426        // --
11427
11428        if github_response.is_success() {
11429            Ok(())
11430        } else {
11431            match github_response.status_code() {
11432                code => Err(OrgsUnblockUserError::Generic { code }.into()),
11433            }
11434        }
11435    }
11436
11437    /// ---
11438    ///
11439    /// # Unblock a user from an organization
11440    ///
11441    /// Unblocks the given user on behalf of the specified organization.
11442    ///
11443    /// [GitHub API docs for unblock_user](https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization)
11444    ///
11445    /// ---
11446    #[cfg(not(target_arch = "wasm32"))]
11447    pub fn unblock_user(&self, org: &str, username: &str) -> Result<(), AdapterError> {
11448
11449        let request_uri = format!("{}/orgs/{}/blocks/{}", super::GITHUB_BASE_API_URL, org, username);
11450
11451
11452        let req = GitHubRequest {
11453            uri: request_uri,
11454            body: None,
11455            method: "DELETE",
11456            headers: vec![]
11457        };
11458
11459        let request = self.client.build(req)?;
11460
11461        // --
11462
11463        let github_response = self.client.fetch(request)?;
11464
11465        // --
11466
11467        if github_response.is_success() {
11468            Ok(())
11469        } else {
11470            match github_response.status_code() {
11471                code => Err(OrgsUnblockUserError::Generic { code }.into()),
11472            }
11473        }
11474    }
11475
11476    /// ---
11477    ///
11478    /// # Update an organization
11479    ///
11480    /// > [!WARNING]
11481    /// > **Closing down notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes).
11482    /// 
11483    /// > [!WARNING]
11484    /// > **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/).
11485    /// 
11486    /// Updates the organization's profile and member privileges.
11487    /// 
11488    /// The authenticated user must be an organization owner to use this endpoint.
11489    /// 
11490    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint.
11491    ///
11492    /// [GitHub API docs for update](https://docs.github.com/rest/orgs/orgs#update-an-organization)
11493    ///
11494    /// ---
11495    pub async fn update_async(&self, org: &str, body: PatchOrgsUpdate) -> Result<OrganizationFull, AdapterError> {
11496
11497        let request_uri = format!("{}/orgs/{}", super::GITHUB_BASE_API_URL, org);
11498
11499
11500        let req = GitHubRequest {
11501            uri: request_uri,
11502            body: Some(C::from_json::<PatchOrgsUpdate>(body)?),
11503            method: "PATCH",
11504            headers: vec![]
11505        };
11506
11507        let request = self.client.build(req)?;
11508
11509        // --
11510
11511        let github_response = self.client.fetch_async(request).await?;
11512
11513        // --
11514
11515        if github_response.is_success() {
11516            Ok(github_response.to_json_async().await?)
11517        } else {
11518            match github_response.status_code() {
11519                422 => Err(OrgsUpdateError::Status422(github_response.to_json_async().await?).into()),
11520                409 => Err(OrgsUpdateError::Status409(github_response.to_json_async().await?).into()),
11521                code => Err(OrgsUpdateError::Generic { code }.into()),
11522            }
11523        }
11524    }
11525
11526    /// ---
11527    ///
11528    /// # Update an organization
11529    ///
11530    /// > [!WARNING]
11531    /// > **Closing down notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes).
11532    /// 
11533    /// > [!WARNING]
11534    /// > **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/).
11535    /// 
11536    /// Updates the organization's profile and member privileges.
11537    /// 
11538    /// The authenticated user must be an organization owner to use this endpoint.
11539    /// 
11540    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint.
11541    ///
11542    /// [GitHub API docs for update](https://docs.github.com/rest/orgs/orgs#update-an-organization)
11543    ///
11544    /// ---
11545    #[cfg(not(target_arch = "wasm32"))]
11546    pub fn update(&self, org: &str, body: PatchOrgsUpdate) -> Result<OrganizationFull, AdapterError> {
11547
11548        let request_uri = format!("{}/orgs/{}", super::GITHUB_BASE_API_URL, org);
11549
11550
11551        let req = GitHubRequest {
11552            uri: request_uri,
11553            body: Some(C::from_json::<PatchOrgsUpdate>(body)?),
11554            method: "PATCH",
11555            headers: vec![]
11556        };
11557
11558        let request = self.client.build(req)?;
11559
11560        // --
11561
11562        let github_response = self.client.fetch(request)?;
11563
11564        // --
11565
11566        if github_response.is_success() {
11567            Ok(github_response.to_json()?)
11568        } else {
11569            match github_response.status_code() {
11570                422 => Err(OrgsUpdateError::Status422(github_response.to_json()?).into()),
11571                409 => Err(OrgsUpdateError::Status409(github_response.to_json()?).into()),
11572                code => Err(OrgsUpdateError::Generic { code }.into()),
11573            }
11574        }
11575    }
11576
11577    /// ---
11578    ///
11579    /// # Update issue type for an organization
11580    ///
11581    /// Updates an issue type for an organization.
11582    /// 
11583    /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).
11584    /// 
11585    /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
11586    /// personal access tokens (classic) need the `admin:org` scope to use this endpoint.
11587    ///
11588    /// [GitHub API docs for update_issue_type](https://docs.github.com/rest/orgs/issue-types#update-issue-type-for-an-organization)
11589    ///
11590    /// ---
11591    pub async fn update_issue_type_async(&self, org: &str, issue_type_id: i32, body: PutOrgsUpdateIssueType) -> Result<IssueType, AdapterError> {
11592
11593        let request_uri = format!("{}/orgs/{}/issue-types/{}", super::GITHUB_BASE_API_URL, org, issue_type_id);
11594
11595
11596        let req = GitHubRequest {
11597            uri: request_uri,
11598            body: Some(C::from_json::<PutOrgsUpdateIssueType>(body)?),
11599            method: "PUT",
11600            headers: vec![]
11601        };
11602
11603        let request = self.client.build(req)?;
11604
11605        // --
11606
11607        let github_response = self.client.fetch_async(request).await?;
11608
11609        // --
11610
11611        if github_response.is_success() {
11612            Ok(github_response.to_json_async().await?)
11613        } else {
11614            match github_response.status_code() {
11615                404 => Err(OrgsUpdateIssueTypeError::Status404(github_response.to_json_async().await?).into()),
11616                422 => Err(OrgsUpdateIssueTypeError::Status422(github_response.to_json_async().await?).into()),
11617                code => Err(OrgsUpdateIssueTypeError::Generic { code }.into()),
11618            }
11619        }
11620    }
11621
11622    /// ---
11623    ///
11624    /// # Update issue type for an organization
11625    ///
11626    /// Updates an issue type for an organization.
11627    /// 
11628    /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).
11629    /// 
11630    /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
11631    /// personal access tokens (classic) need the `admin:org` scope to use this endpoint.
11632    ///
11633    /// [GitHub API docs for update_issue_type](https://docs.github.com/rest/orgs/issue-types#update-issue-type-for-an-organization)
11634    ///
11635    /// ---
11636    #[cfg(not(target_arch = "wasm32"))]
11637    pub fn update_issue_type(&self, org: &str, issue_type_id: i32, body: PutOrgsUpdateIssueType) -> Result<IssueType, AdapterError> {
11638
11639        let request_uri = format!("{}/orgs/{}/issue-types/{}", super::GITHUB_BASE_API_URL, org, issue_type_id);
11640
11641
11642        let req = GitHubRequest {
11643            uri: request_uri,
11644            body: Some(C::from_json::<PutOrgsUpdateIssueType>(body)?),
11645            method: "PUT",
11646            headers: vec![]
11647        };
11648
11649        let request = self.client.build(req)?;
11650
11651        // --
11652
11653        let github_response = self.client.fetch(request)?;
11654
11655        // --
11656
11657        if github_response.is_success() {
11658            Ok(github_response.to_json()?)
11659        } else {
11660            match github_response.status_code() {
11661                404 => Err(OrgsUpdateIssueTypeError::Status404(github_response.to_json()?).into()),
11662                422 => Err(OrgsUpdateIssueTypeError::Status422(github_response.to_json()?).into()),
11663                code => Err(OrgsUpdateIssueTypeError::Generic { code }.into()),
11664            }
11665        }
11666    }
11667
11668    /// ---
11669    ///
11670    /// # Update an organization membership for the authenticated user
11671    ///
11672    /// Converts the authenticated user to an active member of the organization, if that user has a pending invitation from the organization.
11673    ///
11674    /// [GitHub API docs for update_membership_for_authenticated_user](https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user)
11675    ///
11676    /// ---
11677    pub async fn update_membership_for_authenticated_user_async(&self, org: &str, body: PatchOrgsUpdateMembershipForAuthenticatedUser) -> Result<OrgMembership, AdapterError> {
11678
11679        let request_uri = format!("{}/user/memberships/orgs/{}", super::GITHUB_BASE_API_URL, org);
11680
11681
11682        let req = GitHubRequest {
11683            uri: request_uri,
11684            body: Some(C::from_json::<PatchOrgsUpdateMembershipForAuthenticatedUser>(body)?),
11685            method: "PATCH",
11686            headers: vec![]
11687        };
11688
11689        let request = self.client.build(req)?;
11690
11691        // --
11692
11693        let github_response = self.client.fetch_async(request).await?;
11694
11695        // --
11696
11697        if github_response.is_success() {
11698            Ok(github_response.to_json_async().await?)
11699        } else {
11700            match github_response.status_code() {
11701                403 => Err(OrgsUpdateMembershipForAuthenticatedUserError::Status403(github_response.to_json_async().await?).into()),
11702                404 => Err(OrgsUpdateMembershipForAuthenticatedUserError::Status404(github_response.to_json_async().await?).into()),
11703                422 => Err(OrgsUpdateMembershipForAuthenticatedUserError::Status422(github_response.to_json_async().await?).into()),
11704                code => Err(OrgsUpdateMembershipForAuthenticatedUserError::Generic { code }.into()),
11705            }
11706        }
11707    }
11708
11709    /// ---
11710    ///
11711    /// # Update an organization membership for the authenticated user
11712    ///
11713    /// Converts the authenticated user to an active member of the organization, if that user has a pending invitation from the organization.
11714    ///
11715    /// [GitHub API docs for update_membership_for_authenticated_user](https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user)
11716    ///
11717    /// ---
11718    #[cfg(not(target_arch = "wasm32"))]
11719    pub fn update_membership_for_authenticated_user(&self, org: &str, body: PatchOrgsUpdateMembershipForAuthenticatedUser) -> Result<OrgMembership, AdapterError> {
11720
11721        let request_uri = format!("{}/user/memberships/orgs/{}", super::GITHUB_BASE_API_URL, org);
11722
11723
11724        let req = GitHubRequest {
11725            uri: request_uri,
11726            body: Some(C::from_json::<PatchOrgsUpdateMembershipForAuthenticatedUser>(body)?),
11727            method: "PATCH",
11728            headers: vec![]
11729        };
11730
11731        let request = self.client.build(req)?;
11732
11733        // --
11734
11735        let github_response = self.client.fetch(request)?;
11736
11737        // --
11738
11739        if github_response.is_success() {
11740            Ok(github_response.to_json()?)
11741        } else {
11742            match github_response.status_code() {
11743                403 => Err(OrgsUpdateMembershipForAuthenticatedUserError::Status403(github_response.to_json()?).into()),
11744                404 => Err(OrgsUpdateMembershipForAuthenticatedUserError::Status404(github_response.to_json()?).into()),
11745                422 => Err(OrgsUpdateMembershipForAuthenticatedUserError::Status422(github_response.to_json()?).into()),
11746                code => Err(OrgsUpdateMembershipForAuthenticatedUserError::Generic { code }.into()),
11747            }
11748        }
11749    }
11750
11751    /// ---
11752    ///
11753    /// # Update the access a fine-grained personal access token has to organization resources
11754    ///
11755    /// Updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access.
11756    /// 
11757    /// Only GitHub Apps can use this endpoint.
11758    ///
11759    /// [GitHub API docs for update_pat_access](https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources)
11760    ///
11761    /// ---
11762    pub async fn update_pat_access_async(&self, org: &str, pat_id: i32, body: PostOrgsUpdatePatAccess) -> Result<(), AdapterError> {
11763
11764        let request_uri = format!("{}/orgs/{}/personal-access-tokens/{}", super::GITHUB_BASE_API_URL, org, pat_id);
11765
11766
11767        let req = GitHubRequest {
11768            uri: request_uri,
11769            body: Some(C::from_json::<PostOrgsUpdatePatAccess>(body)?),
11770            method: "POST",
11771            headers: vec![]
11772        };
11773
11774        let request = self.client.build(req)?;
11775
11776        // --
11777
11778        let github_response = self.client.fetch_async(request).await?;
11779
11780        // --
11781
11782        if github_response.is_success() {
11783            Ok(())
11784        } else {
11785            match github_response.status_code() {
11786                500 => Err(OrgsUpdatePatAccessError::Status500(github_response.to_json_async().await?).into()),
11787                404 => Err(OrgsUpdatePatAccessError::Status404(github_response.to_json_async().await?).into()),
11788                403 => Err(OrgsUpdatePatAccessError::Status403(github_response.to_json_async().await?).into()),
11789                422 => Err(OrgsUpdatePatAccessError::Status422(github_response.to_json_async().await?).into()),
11790                code => Err(OrgsUpdatePatAccessError::Generic { code }.into()),
11791            }
11792        }
11793    }
11794
11795    /// ---
11796    ///
11797    /// # Update the access a fine-grained personal access token has to organization resources
11798    ///
11799    /// Updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access.
11800    /// 
11801    /// Only GitHub Apps can use this endpoint.
11802    ///
11803    /// [GitHub API docs for update_pat_access](https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources)
11804    ///
11805    /// ---
11806    #[cfg(not(target_arch = "wasm32"))]
11807    pub fn update_pat_access(&self, org: &str, pat_id: i32, body: PostOrgsUpdatePatAccess) -> Result<(), AdapterError> {
11808
11809        let request_uri = format!("{}/orgs/{}/personal-access-tokens/{}", super::GITHUB_BASE_API_URL, org, pat_id);
11810
11811
11812        let req = GitHubRequest {
11813            uri: request_uri,
11814            body: Some(C::from_json::<PostOrgsUpdatePatAccess>(body)?),
11815            method: "POST",
11816            headers: vec![]
11817        };
11818
11819        let request = self.client.build(req)?;
11820
11821        // --
11822
11823        let github_response = self.client.fetch(request)?;
11824
11825        // --
11826
11827        if github_response.is_success() {
11828            Ok(())
11829        } else {
11830            match github_response.status_code() {
11831                500 => Err(OrgsUpdatePatAccessError::Status500(github_response.to_json()?).into()),
11832                404 => Err(OrgsUpdatePatAccessError::Status404(github_response.to_json()?).into()),
11833                403 => Err(OrgsUpdatePatAccessError::Status403(github_response.to_json()?).into()),
11834                422 => Err(OrgsUpdatePatAccessError::Status422(github_response.to_json()?).into()),
11835                code => Err(OrgsUpdatePatAccessError::Generic { code }.into()),
11836            }
11837        }
11838    }
11839
11840    /// ---
11841    ///
11842    /// # Update the access to organization resources via fine-grained personal access tokens
11843    ///
11844    /// Updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access.
11845    /// 
11846    /// Only GitHub Apps can use this endpoint.
11847    ///
11848    /// [GitHub API docs for update_pat_accesses](https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens)
11849    ///
11850    /// ---
11851    pub async fn update_pat_accesses_async(&self, org: &str, body: PostOrgsUpdatePatAccesses) -> Result<HashMap<String, Value>, AdapterError> {
11852
11853        let request_uri = format!("{}/orgs/{}/personal-access-tokens", super::GITHUB_BASE_API_URL, org);
11854
11855
11856        let req = GitHubRequest {
11857            uri: request_uri,
11858            body: Some(C::from_json::<PostOrgsUpdatePatAccesses>(body)?),
11859            method: "POST",
11860            headers: vec![]
11861        };
11862
11863        let request = self.client.build(req)?;
11864
11865        // --
11866
11867        let github_response = self.client.fetch_async(request).await?;
11868
11869        // --
11870
11871        if github_response.is_success() {
11872            Ok(github_response.to_json_async().await?)
11873        } else {
11874            match github_response.status_code() {
11875                500 => Err(OrgsUpdatePatAccessesError::Status500(github_response.to_json_async().await?).into()),
11876                404 => Err(OrgsUpdatePatAccessesError::Status404(github_response.to_json_async().await?).into()),
11877                403 => Err(OrgsUpdatePatAccessesError::Status403(github_response.to_json_async().await?).into()),
11878                422 => Err(OrgsUpdatePatAccessesError::Status422(github_response.to_json_async().await?).into()),
11879                code => Err(OrgsUpdatePatAccessesError::Generic { code }.into()),
11880            }
11881        }
11882    }
11883
11884    /// ---
11885    ///
11886    /// # Update the access to organization resources via fine-grained personal access tokens
11887    ///
11888    /// Updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access.
11889    /// 
11890    /// Only GitHub Apps can use this endpoint.
11891    ///
11892    /// [GitHub API docs for update_pat_accesses](https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens)
11893    ///
11894    /// ---
11895    #[cfg(not(target_arch = "wasm32"))]
11896    pub fn update_pat_accesses(&self, org: &str, body: PostOrgsUpdatePatAccesses) -> Result<HashMap<String, Value>, AdapterError> {
11897
11898        let request_uri = format!("{}/orgs/{}/personal-access-tokens", super::GITHUB_BASE_API_URL, org);
11899
11900
11901        let req = GitHubRequest {
11902            uri: request_uri,
11903            body: Some(C::from_json::<PostOrgsUpdatePatAccesses>(body)?),
11904            method: "POST",
11905            headers: vec![]
11906        };
11907
11908        let request = self.client.build(req)?;
11909
11910        // --
11911
11912        let github_response = self.client.fetch(request)?;
11913
11914        // --
11915
11916        if github_response.is_success() {
11917            Ok(github_response.to_json()?)
11918        } else {
11919            match github_response.status_code() {
11920                500 => Err(OrgsUpdatePatAccessesError::Status500(github_response.to_json()?).into()),
11921                404 => Err(OrgsUpdatePatAccessesError::Status404(github_response.to_json()?).into()),
11922                403 => Err(OrgsUpdatePatAccessesError::Status403(github_response.to_json()?).into()),
11923                422 => Err(OrgsUpdatePatAccessesError::Status422(github_response.to_json()?).into()),
11924                code => Err(OrgsUpdatePatAccessesError::Generic { code }.into()),
11925            }
11926        }
11927    }
11928
11929    /// ---
11930    ///
11931    /// # Update an organization webhook
11932    ///
11933    /// Updates a webhook configured in an organization. When you update a webhook,
11934    /// the `secret` will be overwritten. If you previously had a `secret` set, you must
11935    /// provide the same `secret` or set a new `secret` or the secret will be removed. If
11936    /// you are only updating individual webhook `config` properties, use "[Update a webhook
11937    /// configuration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)".
11938    /// 
11939    /// You must be an organization owner to use this endpoint.
11940    /// 
11941    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
11942    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
11943    ///
11944    /// [GitHub API docs for update_webhook](https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook)
11945    ///
11946    /// ---
11947    pub async fn update_webhook_async(&self, org: &str, hook_id: i32, body: PatchOrgsUpdateWebhook) -> Result<OrgHook, AdapterError> {
11948
11949        let request_uri = format!("{}/orgs/{}/hooks/{}", super::GITHUB_BASE_API_URL, org, hook_id);
11950
11951
11952        let req = GitHubRequest {
11953            uri: request_uri,
11954            body: Some(C::from_json::<PatchOrgsUpdateWebhook>(body)?),
11955            method: "PATCH",
11956            headers: vec![]
11957        };
11958
11959        let request = self.client.build(req)?;
11960
11961        // --
11962
11963        let github_response = self.client.fetch_async(request).await?;
11964
11965        // --
11966
11967        if github_response.is_success() {
11968            Ok(github_response.to_json_async().await?)
11969        } else {
11970            match github_response.status_code() {
11971                422 => Err(OrgsUpdateWebhookError::Status422(github_response.to_json_async().await?).into()),
11972                404 => Err(OrgsUpdateWebhookError::Status404(github_response.to_json_async().await?).into()),
11973                code => Err(OrgsUpdateWebhookError::Generic { code }.into()),
11974            }
11975        }
11976    }
11977
11978    /// ---
11979    ///
11980    /// # Update an organization webhook
11981    ///
11982    /// Updates a webhook configured in an organization. When you update a webhook,
11983    /// the `secret` will be overwritten. If you previously had a `secret` set, you must
11984    /// provide the same `secret` or set a new `secret` or the secret will be removed. If
11985    /// you are only updating individual webhook `config` properties, use "[Update a webhook
11986    /// configuration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)".
11987    /// 
11988    /// You must be an organization owner to use this endpoint.
11989    /// 
11990    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
11991    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
11992    ///
11993    /// [GitHub API docs for update_webhook](https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook)
11994    ///
11995    /// ---
11996    #[cfg(not(target_arch = "wasm32"))]
11997    pub fn update_webhook(&self, org: &str, hook_id: i32, body: PatchOrgsUpdateWebhook) -> Result<OrgHook, AdapterError> {
11998
11999        let request_uri = format!("{}/orgs/{}/hooks/{}", super::GITHUB_BASE_API_URL, org, hook_id);
12000
12001
12002        let req = GitHubRequest {
12003            uri: request_uri,
12004            body: Some(C::from_json::<PatchOrgsUpdateWebhook>(body)?),
12005            method: "PATCH",
12006            headers: vec![]
12007        };
12008
12009        let request = self.client.build(req)?;
12010
12011        // --
12012
12013        let github_response = self.client.fetch(request)?;
12014
12015        // --
12016
12017        if github_response.is_success() {
12018            Ok(github_response.to_json()?)
12019        } else {
12020            match github_response.status_code() {
12021                422 => Err(OrgsUpdateWebhookError::Status422(github_response.to_json()?).into()),
12022                404 => Err(OrgsUpdateWebhookError::Status404(github_response.to_json()?).into()),
12023                code => Err(OrgsUpdateWebhookError::Generic { code }.into()),
12024            }
12025        }
12026    }
12027
12028    /// ---
12029    ///
12030    /// # Update a webhook configuration for an organization
12031    ///
12032    /// Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)."
12033    /// 
12034    /// You must be an organization owner to use this endpoint.
12035    /// 
12036    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
12037    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
12038    ///
12039    /// [GitHub API docs for update_webhook_config_for_org](https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)
12040    ///
12041    /// ---
12042    pub async fn update_webhook_config_for_org_async(&self, org: &str, hook_id: i32, body: PatchOrgsUpdateWebhookConfigForOrg) -> Result<WebhookConfig, AdapterError> {
12043
12044        let request_uri = format!("{}/orgs/{}/hooks/{}/config", super::GITHUB_BASE_API_URL, org, hook_id);
12045
12046
12047        let req = GitHubRequest {
12048            uri: request_uri,
12049            body: Some(C::from_json::<PatchOrgsUpdateWebhookConfigForOrg>(body)?),
12050            method: "PATCH",
12051            headers: vec![]
12052        };
12053
12054        let request = self.client.build(req)?;
12055
12056        // --
12057
12058        let github_response = self.client.fetch_async(request).await?;
12059
12060        // --
12061
12062        if github_response.is_success() {
12063            Ok(github_response.to_json_async().await?)
12064        } else {
12065            match github_response.status_code() {
12066                code => Err(OrgsUpdateWebhookConfigForOrgError::Generic { code }.into()),
12067            }
12068        }
12069    }
12070
12071    /// ---
12072    ///
12073    /// # Update a webhook configuration for an organization
12074    ///
12075    /// Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)."
12076    /// 
12077    /// You must be an organization owner to use this endpoint.
12078    /// 
12079    /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
12080    /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
12081    ///
12082    /// [GitHub API docs for update_webhook_config_for_org](https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)
12083    ///
12084    /// ---
12085    #[cfg(not(target_arch = "wasm32"))]
12086    pub fn update_webhook_config_for_org(&self, org: &str, hook_id: i32, body: PatchOrgsUpdateWebhookConfigForOrg) -> Result<WebhookConfig, AdapterError> {
12087
12088        let request_uri = format!("{}/orgs/{}/hooks/{}/config", super::GITHUB_BASE_API_URL, org, hook_id);
12089
12090
12091        let req = GitHubRequest {
12092            uri: request_uri,
12093            body: Some(C::from_json::<PatchOrgsUpdateWebhookConfigForOrg>(body)?),
12094            method: "PATCH",
12095            headers: vec![]
12096        };
12097
12098        let request = self.client.build(req)?;
12099
12100        // --
12101
12102        let github_response = self.client.fetch(request)?;
12103
12104        // --
12105
12106        if github_response.is_success() {
12107            Ok(github_response.to_json()?)
12108        } else {
12109            match github_response.status_code() {
12110                code => Err(OrgsUpdateWebhookConfigForOrgError::Generic { code }.into()),
12111            }
12112        }
12113    }
12114
12115}