1use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum OrgsSlashAddSecurityManagerTeamError {
22 Status409(),
23 UnknownValue(serde_json::Value),
24}
25
26#[derive(Debug, Clone, Serialize, Deserialize)]
28#[serde(untagged)]
29pub enum OrgsSlashAssignTeamToOrgRoleError {
30 Status404(),
31 Status422(),
32 UnknownValue(serde_json::Value),
33}
34
35#[derive(Debug, Clone, Serialize, Deserialize)]
37#[serde(untagged)]
38pub enum OrgsSlashAssignUserToOrgRoleError {
39 Status404(),
40 Status422(),
41 UnknownValue(serde_json::Value),
42}
43
44#[derive(Debug, Clone, Serialize, Deserialize)]
46#[serde(untagged)]
47pub enum OrgsSlashBlockUserError {
48 Status422(models::ValidationError),
49 UnknownValue(serde_json::Value),
50}
51
52#[derive(Debug, Clone, Serialize, Deserialize)]
54#[serde(untagged)]
55pub enum OrgsSlashCancelInvitationError {
56 Status404(models::BasicError),
57 Status422(models::ValidationError),
58 UnknownValue(serde_json::Value),
59}
60
61#[derive(Debug, Clone, Serialize, Deserialize)]
63#[serde(untagged)]
64pub enum OrgsSlashCheckBlockedUserError {
65 Status404(models::BasicError),
66 UnknownValue(serde_json::Value),
67}
68
69#[derive(Debug, Clone, Serialize, Deserialize)]
71#[serde(untagged)]
72pub enum OrgsSlashCheckMembershipForUserError {
73 Status404(),
74 UnknownValue(serde_json::Value),
75}
76
77#[derive(Debug, Clone, Serialize, Deserialize)]
79#[serde(untagged)]
80pub enum OrgsSlashCheckPublicMembershipForUserError {
81 Status404(),
82 UnknownValue(serde_json::Value),
83}
84
85#[derive(Debug, Clone, Serialize, Deserialize)]
87#[serde(untagged)]
88pub enum OrgsSlashConvertMemberToOutsideCollaboratorError {
89 Status403(),
90 Status404(models::BasicError),
91 UnknownValue(serde_json::Value),
92}
93
94#[derive(Debug, Clone, Serialize, Deserialize)]
96#[serde(untagged)]
97pub enum OrgsSlashCreateCustomOrganizationRoleError {
98 Status404(models::BasicError),
99 Status409(models::BasicError),
100 Status422(models::ValidationError),
101 UnknownValue(serde_json::Value),
102}
103
104#[derive(Debug, Clone, Serialize, Deserialize)]
106#[serde(untagged)]
107pub enum OrgsSlashCreateInvitationError {
108 Status404(models::BasicError),
109 Status422(models::ValidationError),
110 UnknownValue(serde_json::Value),
111}
112
113#[derive(Debug, Clone, Serialize, Deserialize)]
115#[serde(untagged)]
116pub enum OrgsSlashCreateOrUpdateCustomPropertiesError {
117 Status403(models::BasicError),
118 Status404(models::BasicError),
119 UnknownValue(serde_json::Value),
120}
121
122#[derive(Debug, Clone, Serialize, Deserialize)]
124#[serde(untagged)]
125pub enum OrgsSlashCreateOrUpdateCustomPropertiesValuesForReposError {
126 Status403(models::BasicError),
127 Status404(models::BasicError),
128 Status422(models::ValidationError),
129 UnknownValue(serde_json::Value),
130}
131
132#[derive(Debug, Clone, Serialize, Deserialize)]
134#[serde(untagged)]
135pub enum OrgsSlashCreateOrUpdateCustomPropertyError {
136 Status403(models::BasicError),
137 Status404(models::BasicError),
138 UnknownValue(serde_json::Value),
139}
140
141#[derive(Debug, Clone, Serialize, Deserialize)]
143#[serde(untagged)]
144pub enum OrgsSlashCreateWebhookError {
145 Status404(models::BasicError),
146 Status422(models::ValidationError),
147 UnknownValue(serde_json::Value),
148}
149
150#[derive(Debug, Clone, Serialize, Deserialize)]
152#[serde(untagged)]
153pub enum OrgsSlashDeleteError {
154 Status403(models::BasicError),
155 Status404(models::BasicError),
156 UnknownValue(serde_json::Value),
157}
158
159#[derive(Debug, Clone, Serialize, Deserialize)]
161#[serde(untagged)]
162pub enum OrgsSlashDeleteCustomOrganizationRoleError {
163 UnknownValue(serde_json::Value),
164}
165
166#[derive(Debug, Clone, Serialize, Deserialize)]
168#[serde(untagged)]
169pub enum OrgsSlashDeleteWebhookError {
170 Status404(models::BasicError),
171 UnknownValue(serde_json::Value),
172}
173
174#[derive(Debug, Clone, Serialize, Deserialize)]
176#[serde(untagged)]
177pub enum OrgsSlashEnableOrDisableSecurityProductOnAllOrgReposError {
178 Status422(),
179 UnknownValue(serde_json::Value),
180}
181
182#[derive(Debug, Clone, Serialize, Deserialize)]
184#[serde(untagged)]
185pub enum OrgsSlashGetError {
186 Status404(models::BasicError),
187 UnknownValue(serde_json::Value),
188}
189
190#[derive(Debug, Clone, Serialize, Deserialize)]
192#[serde(untagged)]
193pub enum OrgsSlashGetAllCustomPropertiesError {
194 Status403(models::BasicError),
195 Status404(models::BasicError),
196 UnknownValue(serde_json::Value),
197}
198
199#[derive(Debug, Clone, Serialize, Deserialize)]
201#[serde(untagged)]
202pub enum OrgsSlashGetCustomPropertyError {
203 Status403(models::BasicError),
204 Status404(models::BasicError),
205 UnknownValue(serde_json::Value),
206}
207
208#[derive(Debug, Clone, Serialize, Deserialize)]
210#[serde(untagged)]
211pub enum OrgsSlashGetMembershipForAuthenticatedUserError {
212 Status403(models::BasicError),
213 Status404(models::BasicError),
214 UnknownValue(serde_json::Value),
215}
216
217#[derive(Debug, Clone, Serialize, Deserialize)]
219#[serde(untagged)]
220pub enum OrgsSlashGetMembershipForUserError {
221 Status403(models::BasicError),
222 Status404(models::BasicError),
223 UnknownValue(serde_json::Value),
224}
225
226#[derive(Debug, Clone, Serialize, Deserialize)]
228#[serde(untagged)]
229pub enum OrgsSlashGetOrgRoleError {
230 Status404(models::BasicError),
231 Status422(models::ValidationError),
232 UnknownValue(serde_json::Value),
233}
234
235#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum OrgsSlashGetWebhookError {
239 Status404(models::BasicError),
240 UnknownValue(serde_json::Value),
241}
242
243#[derive(Debug, Clone, Serialize, Deserialize)]
245#[serde(untagged)]
246pub enum OrgsSlashGetWebhookConfigForOrgError {
247 UnknownValue(serde_json::Value),
248}
249
250#[derive(Debug, Clone, Serialize, Deserialize)]
252#[serde(untagged)]
253pub enum OrgsSlashGetWebhookDeliveryError {
254 Status400(models::BasicError),
255 Status422(models::ValidationError),
256 UnknownValue(serde_json::Value),
257}
258
259#[derive(Debug, Clone, Serialize, Deserialize)]
261#[serde(untagged)]
262pub enum OrgsSlashListError {
263 UnknownValue(serde_json::Value),
264}
265
266#[derive(Debug, Clone, Serialize, Deserialize)]
268#[serde(untagged)]
269pub enum OrgsSlashListAppInstallationsError {
270 UnknownValue(serde_json::Value),
271}
272
273#[derive(Debug, Clone, Serialize, Deserialize)]
275#[serde(untagged)]
276pub enum OrgsSlashListBlockedUsersError {
277 UnknownValue(serde_json::Value),
278}
279
280#[derive(Debug, Clone, Serialize, Deserialize)]
282#[serde(untagged)]
283pub enum OrgsSlashListCustomPropertiesValuesForReposError {
284 Status403(models::BasicError),
285 Status404(models::BasicError),
286 UnknownValue(serde_json::Value),
287}
288
289#[derive(Debug, Clone, Serialize, Deserialize)]
291#[serde(untagged)]
292pub enum OrgsSlashListFailedInvitationsError {
293 Status404(models::BasicError),
294 UnknownValue(serde_json::Value),
295}
296
297#[derive(Debug, Clone, Serialize, Deserialize)]
299#[serde(untagged)]
300pub enum OrgsSlashListForAuthenticatedUserError {
301 Status401(models::BasicError),
302 Status403(models::BasicError),
303 UnknownValue(serde_json::Value),
304}
305
306#[derive(Debug, Clone, Serialize, Deserialize)]
308#[serde(untagged)]
309pub enum OrgsSlashListForUserError {
310 UnknownValue(serde_json::Value),
311}
312
313#[derive(Debug, Clone, Serialize, Deserialize)]
315#[serde(untagged)]
316pub enum OrgsSlashListInvitationTeamsError {
317 Status404(models::BasicError),
318 UnknownValue(serde_json::Value),
319}
320
321#[derive(Debug, Clone, Serialize, Deserialize)]
323#[serde(untagged)]
324pub enum OrgsSlashListMembersError {
325 Status422(models::ValidationError),
326 UnknownValue(serde_json::Value),
327}
328
329#[derive(Debug, Clone, Serialize, Deserialize)]
331#[serde(untagged)]
332pub enum OrgsSlashListMembershipsForAuthenticatedUserError {
333 Status401(models::BasicError),
334 Status403(models::BasicError),
335 Status422(models::ValidationError),
336 UnknownValue(serde_json::Value),
337}
338
339#[derive(Debug, Clone, Serialize, Deserialize)]
341#[serde(untagged)]
342pub enum OrgsSlashListOrgRoleTeamsError {
343 Status404(),
344 Status422(),
345 UnknownValue(serde_json::Value),
346}
347
348#[derive(Debug, Clone, Serialize, Deserialize)]
350#[serde(untagged)]
351pub enum OrgsSlashListOrgRoleUsersError {
352 Status404(),
353 Status422(),
354 UnknownValue(serde_json::Value),
355}
356
357#[derive(Debug, Clone, Serialize, Deserialize)]
359#[serde(untagged)]
360pub enum OrgsSlashListOrgRolesError {
361 Status404(models::BasicError),
362 Status422(models::ValidationError),
363 UnknownValue(serde_json::Value),
364}
365
366#[derive(Debug, Clone, Serialize, Deserialize)]
368#[serde(untagged)]
369pub enum OrgsSlashListOrganizationFineGrainedPermissionsError {
370 Status404(models::BasicError),
371 Status422(models::ValidationError),
372 UnknownValue(serde_json::Value),
373}
374
375#[derive(Debug, Clone, Serialize, Deserialize)]
377#[serde(untagged)]
378pub enum OrgsSlashListOutsideCollaboratorsError {
379 UnknownValue(serde_json::Value),
380}
381
382#[derive(Debug, Clone, Serialize, Deserialize)]
384#[serde(untagged)]
385pub enum OrgsSlashListPatGrantRepositoriesError {
386 Status403(models::BasicError),
387 Status404(models::BasicError),
388 Status500(models::BasicError),
389 UnknownValue(serde_json::Value),
390}
391
392#[derive(Debug, Clone, Serialize, Deserialize)]
394#[serde(untagged)]
395pub enum OrgsSlashListPatGrantRequestRepositoriesError {
396 Status403(models::BasicError),
397 Status404(models::BasicError),
398 Status500(models::BasicError),
399 UnknownValue(serde_json::Value),
400}
401
402#[derive(Debug, Clone, Serialize, Deserialize)]
404#[serde(untagged)]
405pub enum OrgsSlashListPatGrantRequestsError {
406 Status403(models::BasicError),
407 Status404(models::BasicError),
408 Status422(models::ValidationError),
409 Status500(models::BasicError),
410 UnknownValue(serde_json::Value),
411}
412
413#[derive(Debug, Clone, Serialize, Deserialize)]
415#[serde(untagged)]
416pub enum OrgsSlashListPatGrantsError {
417 Status403(models::BasicError),
418 Status404(models::BasicError),
419 Status422(models::ValidationError),
420 Status500(models::BasicError),
421 UnknownValue(serde_json::Value),
422}
423
424#[derive(Debug, Clone, Serialize, Deserialize)]
426#[serde(untagged)]
427pub enum OrgsSlashListPendingInvitationsError {
428 Status404(models::BasicError),
429 UnknownValue(serde_json::Value),
430}
431
432#[derive(Debug, Clone, Serialize, Deserialize)]
434#[serde(untagged)]
435pub enum OrgsSlashListPublicMembersError {
436 UnknownValue(serde_json::Value),
437}
438
439#[derive(Debug, Clone, Serialize, Deserialize)]
441#[serde(untagged)]
442pub enum OrgsSlashListSecurityManagerTeamsError {
443 UnknownValue(serde_json::Value),
444}
445
446#[derive(Debug, Clone, Serialize, Deserialize)]
448#[serde(untagged)]
449pub enum OrgsSlashListWebhookDeliveriesError {
450 Status400(models::BasicError),
451 Status422(models::ValidationError),
452 UnknownValue(serde_json::Value),
453}
454
455#[derive(Debug, Clone, Serialize, Deserialize)]
457#[serde(untagged)]
458pub enum OrgsSlashListWebhooksError {
459 Status404(models::BasicError),
460 UnknownValue(serde_json::Value),
461}
462
463#[derive(Debug, Clone, Serialize, Deserialize)]
465#[serde(untagged)]
466pub enum OrgsSlashPatchCustomOrganizationRoleError {
467 Status404(models::BasicError),
468 Status409(models::BasicError),
469 Status422(models::ValidationError),
470 UnknownValue(serde_json::Value),
471}
472
473#[derive(Debug, Clone, Serialize, Deserialize)]
475#[serde(untagged)]
476pub enum OrgsSlashPingWebhookError {
477 Status404(models::BasicError),
478 UnknownValue(serde_json::Value),
479}
480
481#[derive(Debug, Clone, Serialize, Deserialize)]
483#[serde(untagged)]
484pub enum OrgsSlashRedeliverWebhookDeliveryError {
485 Status400(models::BasicError),
486 Status422(models::ValidationError),
487 UnknownValue(serde_json::Value),
488}
489
490#[derive(Debug, Clone, Serialize, Deserialize)]
492#[serde(untagged)]
493pub enum OrgsSlashRemoveCustomPropertyError {
494 Status403(models::BasicError),
495 Status404(models::BasicError),
496 UnknownValue(serde_json::Value),
497}
498
499#[derive(Debug, Clone, Serialize, Deserialize)]
501#[serde(untagged)]
502pub enum OrgsSlashRemoveMemberError {
503 Status403(models::BasicError),
504 UnknownValue(serde_json::Value),
505}
506
507#[derive(Debug, Clone, Serialize, Deserialize)]
509#[serde(untagged)]
510pub enum OrgsSlashRemoveMembershipForUserError {
511 Status403(models::BasicError),
512 Status404(models::BasicError),
513 UnknownValue(serde_json::Value),
514}
515
516#[derive(Debug, Clone, Serialize, Deserialize)]
518#[serde(untagged)]
519pub enum OrgsSlashRemoveOutsideCollaboratorError {
520 Status422(models::OrgsRemoveOutsideCollaborator422Response),
521 UnknownValue(serde_json::Value),
522}
523
524#[derive(Debug, Clone, Serialize, Deserialize)]
526#[serde(untagged)]
527pub enum OrgsSlashRemovePublicMembershipForAuthenticatedUserError {
528 UnknownValue(serde_json::Value),
529}
530
531#[derive(Debug, Clone, Serialize, Deserialize)]
533#[serde(untagged)]
534pub enum OrgsSlashRemoveSecurityManagerTeamError {
535 UnknownValue(serde_json::Value),
536}
537
538#[derive(Debug, Clone, Serialize, Deserialize)]
540#[serde(untagged)]
541pub enum OrgsSlashReviewPatGrantRequestError {
542 Status403(models::BasicError),
543 Status404(models::BasicError),
544 Status422(models::ValidationError),
545 Status500(models::BasicError),
546 UnknownValue(serde_json::Value),
547}
548
549#[derive(Debug, Clone, Serialize, Deserialize)]
551#[serde(untagged)]
552pub enum OrgsSlashReviewPatGrantRequestsInBulkError {
553 Status403(models::BasicError),
554 Status404(models::BasicError),
555 Status422(models::ValidationError),
556 Status500(models::BasicError),
557 UnknownValue(serde_json::Value),
558}
559
560#[derive(Debug, Clone, Serialize, Deserialize)]
562#[serde(untagged)]
563pub enum OrgsSlashRevokeAllOrgRolesTeamError {
564 UnknownValue(serde_json::Value),
565}
566
567#[derive(Debug, Clone, Serialize, Deserialize)]
569#[serde(untagged)]
570pub enum OrgsSlashRevokeAllOrgRolesUserError {
571 UnknownValue(serde_json::Value),
572}
573
574#[derive(Debug, Clone, Serialize, Deserialize)]
576#[serde(untagged)]
577pub enum OrgsSlashRevokeOrgRoleTeamError {
578 UnknownValue(serde_json::Value),
579}
580
581#[derive(Debug, Clone, Serialize, Deserialize)]
583#[serde(untagged)]
584pub enum OrgsSlashRevokeOrgRoleUserError {
585 UnknownValue(serde_json::Value),
586}
587
588#[derive(Debug, Clone, Serialize, Deserialize)]
590#[serde(untagged)]
591pub enum OrgsSlashSetMembershipForUserError {
592 Status403(models::BasicError),
593 Status422(models::ValidationError),
594 UnknownValue(serde_json::Value),
595}
596
597#[derive(Debug, Clone, Serialize, Deserialize)]
599#[serde(untagged)]
600pub enum OrgsSlashSetPublicMembershipForAuthenticatedUserError {
601 Status403(models::BasicError),
602 UnknownValue(serde_json::Value),
603}
604
605#[derive(Debug, Clone, Serialize, Deserialize)]
607#[serde(untagged)]
608pub enum OrgsSlashUnblockUserError {
609 UnknownValue(serde_json::Value),
610}
611
612#[derive(Debug, Clone, Serialize, Deserialize)]
614#[serde(untagged)]
615pub enum OrgsSlashUpdateError {
616 Status409(models::BasicError),
617 Status422(models::OrgsUpdate422Response),
618 UnknownValue(serde_json::Value),
619}
620
621#[derive(Debug, Clone, Serialize, Deserialize)]
623#[serde(untagged)]
624pub enum OrgsSlashUpdateMembershipForAuthenticatedUserError {
625 Status403(models::BasicError),
626 Status404(models::BasicError),
627 Status422(models::ValidationError),
628 UnknownValue(serde_json::Value),
629}
630
631#[derive(Debug, Clone, Serialize, Deserialize)]
633#[serde(untagged)]
634pub enum OrgsSlashUpdatePatAccessError {
635 Status403(models::BasicError),
636 Status404(models::BasicError),
637 Status422(models::ValidationError),
638 Status500(models::BasicError),
639 UnknownValue(serde_json::Value),
640}
641
642#[derive(Debug, Clone, Serialize, Deserialize)]
644#[serde(untagged)]
645pub enum OrgsSlashUpdatePatAccessesError {
646 Status403(models::BasicError),
647 Status404(models::BasicError),
648 Status422(models::ValidationError),
649 Status500(models::BasicError),
650 UnknownValue(serde_json::Value),
651}
652
653#[derive(Debug, Clone, Serialize, Deserialize)]
655#[serde(untagged)]
656pub enum OrgsSlashUpdateWebhookError {
657 Status404(models::BasicError),
658 Status422(models::ValidationError),
659 UnknownValue(serde_json::Value),
660}
661
662#[derive(Debug, Clone, Serialize, Deserialize)]
664#[serde(untagged)]
665pub enum OrgsSlashUpdateWebhookConfigForOrgError {
666 UnknownValue(serde_json::Value),
667}
668
669
670pub async fn orgs_slash_add_security_manager_team(configuration: &configuration::Configuration, org: &str, team_slug: &str) -> Result<(), Error<OrgsSlashAddSecurityManagerTeamError>> {
672 let local_var_configuration = configuration;
673
674 let local_var_client = &local_var_configuration.client;
675
676 let local_var_uri_str = format!("{}/orgs/{org}/security-managers/teams/{team_slug}", local_var_configuration.base_path, org=crate::apis::urlencode(org), team_slug=crate::apis::urlencode(team_slug));
677 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
678
679 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
680 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
681 }
682
683 let local_var_req = local_var_req_builder.build()?;
684 let local_var_resp = local_var_client.execute(local_var_req).await?;
685
686 let local_var_status = local_var_resp.status();
687 let local_var_content = local_var_resp.text().await?;
688
689 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
690 Ok(())
691 } else {
692 let local_var_entity: Option<OrgsSlashAddSecurityManagerTeamError> = serde_json::from_str(&local_var_content).ok();
693 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
694 Err(Error::ResponseError(local_var_error))
695 }
696}
697
698pub async fn orgs_slash_assign_team_to_org_role(configuration: &configuration::Configuration, org: &str, team_slug: &str, role_id: i32) -> Result<(), Error<OrgsSlashAssignTeamToOrgRoleError>> {
700 let local_var_configuration = configuration;
701
702 let local_var_client = &local_var_configuration.client;
703
704 let local_var_uri_str = format!("{}/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), team_slug=crate::apis::urlencode(team_slug), role_id=role_id);
705 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
706
707 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
708 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
709 }
710
711 let local_var_req = local_var_req_builder.build()?;
712 let local_var_resp = local_var_client.execute(local_var_req).await?;
713
714 let local_var_status = local_var_resp.status();
715 let local_var_content = local_var_resp.text().await?;
716
717 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
718 Ok(())
719 } else {
720 let local_var_entity: Option<OrgsSlashAssignTeamToOrgRoleError> = serde_json::from_str(&local_var_content).ok();
721 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
722 Err(Error::ResponseError(local_var_error))
723 }
724}
725
726pub async fn orgs_slash_assign_user_to_org_role(configuration: &configuration::Configuration, org: &str, username: &str, role_id: i32) -> Result<(), Error<OrgsSlashAssignUserToOrgRoleError>> {
728 let local_var_configuration = configuration;
729
730 let local_var_client = &local_var_configuration.client;
731
732 let local_var_uri_str = format!("{}/orgs/{org}/organization-roles/users/{username}/{role_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username), role_id=role_id);
733 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
734
735 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
736 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
737 }
738
739 let local_var_req = local_var_req_builder.build()?;
740 let local_var_resp = local_var_client.execute(local_var_req).await?;
741
742 let local_var_status = local_var_resp.status();
743 let local_var_content = local_var_resp.text().await?;
744
745 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
746 Ok(())
747 } else {
748 let local_var_entity: Option<OrgsSlashAssignUserToOrgRoleError> = serde_json::from_str(&local_var_content).ok();
749 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
750 Err(Error::ResponseError(local_var_error))
751 }
752}
753
754pub async fn orgs_slash_block_user(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error<OrgsSlashBlockUserError>> {
756 let local_var_configuration = configuration;
757
758 let local_var_client = &local_var_configuration.client;
759
760 let local_var_uri_str = format!("{}/orgs/{org}/blocks/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username));
761 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
762
763 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
764 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
765 }
766
767 let local_var_req = local_var_req_builder.build()?;
768 let local_var_resp = local_var_client.execute(local_var_req).await?;
769
770 let local_var_status = local_var_resp.status();
771 let local_var_content = local_var_resp.text().await?;
772
773 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
774 Ok(())
775 } else {
776 let local_var_entity: Option<OrgsSlashBlockUserError> = serde_json::from_str(&local_var_content).ok();
777 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
778 Err(Error::ResponseError(local_var_error))
779 }
780}
781
782pub async fn orgs_slash_cancel_invitation(configuration: &configuration::Configuration, org: &str, invitation_id: i32) -> Result<(), Error<OrgsSlashCancelInvitationError>> {
784 let local_var_configuration = configuration;
785
786 let local_var_client = &local_var_configuration.client;
787
788 let local_var_uri_str = format!("{}/orgs/{org}/invitations/{invitation_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), invitation_id=invitation_id);
789 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
790
791 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
792 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
793 }
794
795 let local_var_req = local_var_req_builder.build()?;
796 let local_var_resp = local_var_client.execute(local_var_req).await?;
797
798 let local_var_status = local_var_resp.status();
799 let local_var_content = local_var_resp.text().await?;
800
801 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
802 Ok(())
803 } else {
804 let local_var_entity: Option<OrgsSlashCancelInvitationError> = serde_json::from_str(&local_var_content).ok();
805 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
806 Err(Error::ResponseError(local_var_error))
807 }
808}
809
810pub async fn orgs_slash_check_blocked_user(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error<OrgsSlashCheckBlockedUserError>> {
812 let local_var_configuration = configuration;
813
814 let local_var_client = &local_var_configuration.client;
815
816 let local_var_uri_str = format!("{}/orgs/{org}/blocks/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username));
817 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
818
819 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
820 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
821 }
822
823 let local_var_req = local_var_req_builder.build()?;
824 let local_var_resp = local_var_client.execute(local_var_req).await?;
825
826 let local_var_status = local_var_resp.status();
827 let local_var_content = local_var_resp.text().await?;
828
829 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
830 Ok(())
831 } else {
832 let local_var_entity: Option<OrgsSlashCheckBlockedUserError> = serde_json::from_str(&local_var_content).ok();
833 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
834 Err(Error::ResponseError(local_var_error))
835 }
836}
837
838pub async fn orgs_slash_check_membership_for_user(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error<OrgsSlashCheckMembershipForUserError>> {
840 let local_var_configuration = configuration;
841
842 let local_var_client = &local_var_configuration.client;
843
844 let local_var_uri_str = format!("{}/orgs/{org}/members/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username));
845 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
846
847 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
848 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
849 }
850
851 let local_var_req = local_var_req_builder.build()?;
852 let local_var_resp = local_var_client.execute(local_var_req).await?;
853
854 let local_var_status = local_var_resp.status();
855 let local_var_content = local_var_resp.text().await?;
856
857 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
858 Ok(())
859 } else {
860 let local_var_entity: Option<OrgsSlashCheckMembershipForUserError> = serde_json::from_str(&local_var_content).ok();
861 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
862 Err(Error::ResponseError(local_var_error))
863 }
864}
865
866pub async fn orgs_slash_check_public_membership_for_user(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error<OrgsSlashCheckPublicMembershipForUserError>> {
868 let local_var_configuration = configuration;
869
870 let local_var_client = &local_var_configuration.client;
871
872 let local_var_uri_str = format!("{}/orgs/{org}/public_members/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username));
873 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
874
875 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
876 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
877 }
878
879 let local_var_req = local_var_req_builder.build()?;
880 let local_var_resp = local_var_client.execute(local_var_req).await?;
881
882 let local_var_status = local_var_resp.status();
883 let local_var_content = local_var_resp.text().await?;
884
885 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
886 Ok(())
887 } else {
888 let local_var_entity: Option<OrgsSlashCheckPublicMembershipForUserError> = serde_json::from_str(&local_var_content).ok();
889 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
890 Err(Error::ResponseError(local_var_error))
891 }
892}
893
894pub async fn orgs_slash_convert_member_to_outside_collaborator(configuration: &configuration::Configuration, org: &str, username: &str, orgs_convert_member_to_outside_collaborator_request: Option<models::OrgsConvertMemberToOutsideCollaboratorRequest>) -> Result<serde_json::Value, Error<OrgsSlashConvertMemberToOutsideCollaboratorError>> {
896 let local_var_configuration = configuration;
897
898 let local_var_client = &local_var_configuration.client;
899
900 let local_var_uri_str = format!("{}/orgs/{org}/outside_collaborators/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username));
901 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
902
903 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
904 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
905 }
906 local_var_req_builder = local_var_req_builder.json(&orgs_convert_member_to_outside_collaborator_request);
907
908 let local_var_req = local_var_req_builder.build()?;
909 let local_var_resp = local_var_client.execute(local_var_req).await?;
910
911 let local_var_status = local_var_resp.status();
912 let local_var_content = local_var_resp.text().await?;
913
914 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
915 serde_json::from_str(&local_var_content).map_err(Error::from)
916 } else {
917 let local_var_entity: Option<OrgsSlashConvertMemberToOutsideCollaboratorError> = serde_json::from_str(&local_var_content).ok();
918 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
919 Err(Error::ResponseError(local_var_error))
920 }
921}
922
923pub async fn orgs_slash_create_custom_organization_role(configuration: &configuration::Configuration, org: &str, orgs_create_custom_organization_role_request: models::OrgsCreateCustomOrganizationRoleRequest) -> Result<models::OrganizationRole, Error<OrgsSlashCreateCustomOrganizationRoleError>> {
925 let local_var_configuration = configuration;
926
927 let local_var_client = &local_var_configuration.client;
928
929 let local_var_uri_str = format!("{}/orgs/{org}/organization-roles", local_var_configuration.base_path, org=crate::apis::urlencode(org));
930 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
931
932 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
933 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
934 }
935 local_var_req_builder = local_var_req_builder.json(&orgs_create_custom_organization_role_request);
936
937 let local_var_req = local_var_req_builder.build()?;
938 let local_var_resp = local_var_client.execute(local_var_req).await?;
939
940 let local_var_status = local_var_resp.status();
941 let local_var_content = local_var_resp.text().await?;
942
943 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
944 serde_json::from_str(&local_var_content).map_err(Error::from)
945 } else {
946 let local_var_entity: Option<OrgsSlashCreateCustomOrganizationRoleError> = serde_json::from_str(&local_var_content).ok();
947 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
948 Err(Error::ResponseError(local_var_error))
949 }
950}
951
952pub async fn orgs_slash_create_invitation(configuration: &configuration::Configuration, org: &str, orgs_create_invitation_request: Option<models::OrgsCreateInvitationRequest>) -> Result<models::OrganizationInvitation, Error<OrgsSlashCreateInvitationError>> {
954 let local_var_configuration = configuration;
955
956 let local_var_client = &local_var_configuration.client;
957
958 let local_var_uri_str = format!("{}/orgs/{org}/invitations", local_var_configuration.base_path, org=crate::apis::urlencode(org));
959 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
960
961 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
962 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
963 }
964 local_var_req_builder = local_var_req_builder.json(&orgs_create_invitation_request);
965
966 let local_var_req = local_var_req_builder.build()?;
967 let local_var_resp = local_var_client.execute(local_var_req).await?;
968
969 let local_var_status = local_var_resp.status();
970 let local_var_content = local_var_resp.text().await?;
971
972 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
973 serde_json::from_str(&local_var_content).map_err(Error::from)
974 } else {
975 let local_var_entity: Option<OrgsSlashCreateInvitationError> = serde_json::from_str(&local_var_content).ok();
976 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
977 Err(Error::ResponseError(local_var_error))
978 }
979}
980
981pub async fn orgs_slash_create_or_update_custom_properties(configuration: &configuration::Configuration, org: &str, orgs_create_or_update_custom_properties_request: models::OrgsCreateOrUpdateCustomPropertiesRequest) -> Result<Vec<models::OrgCustomProperty>, Error<OrgsSlashCreateOrUpdateCustomPropertiesError>> {
983 let local_var_configuration = configuration;
984
985 let local_var_client = &local_var_configuration.client;
986
987 let local_var_uri_str = format!("{}/orgs/{org}/properties/schema", local_var_configuration.base_path, org=crate::apis::urlencode(org));
988 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
989
990 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
991 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
992 }
993 local_var_req_builder = local_var_req_builder.json(&orgs_create_or_update_custom_properties_request);
994
995 let local_var_req = local_var_req_builder.build()?;
996 let local_var_resp = local_var_client.execute(local_var_req).await?;
997
998 let local_var_status = local_var_resp.status();
999 let local_var_content = local_var_resp.text().await?;
1000
1001 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1002 serde_json::from_str(&local_var_content).map_err(Error::from)
1003 } else {
1004 let local_var_entity: Option<OrgsSlashCreateOrUpdateCustomPropertiesError> = serde_json::from_str(&local_var_content).ok();
1005 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1006 Err(Error::ResponseError(local_var_error))
1007 }
1008}
1009
1010pub async fn orgs_slash_create_or_update_custom_properties_values_for_repos(configuration: &configuration::Configuration, org: &str, orgs_create_or_update_custom_properties_values_for_repos_request: models::OrgsCreateOrUpdateCustomPropertiesValuesForReposRequest) -> Result<(), Error<OrgsSlashCreateOrUpdateCustomPropertiesValuesForReposError>> {
1012 let local_var_configuration = configuration;
1013
1014 let local_var_client = &local_var_configuration.client;
1015
1016 let local_var_uri_str = format!("{}/orgs/{org}/properties/values", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1017 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1018
1019 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1020 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1021 }
1022 local_var_req_builder = local_var_req_builder.json(&orgs_create_or_update_custom_properties_values_for_repos_request);
1023
1024 let local_var_req = local_var_req_builder.build()?;
1025 let local_var_resp = local_var_client.execute(local_var_req).await?;
1026
1027 let local_var_status = local_var_resp.status();
1028 let local_var_content = local_var_resp.text().await?;
1029
1030 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1031 Ok(())
1032 } else {
1033 let local_var_entity: Option<OrgsSlashCreateOrUpdateCustomPropertiesValuesForReposError> = serde_json::from_str(&local_var_content).ok();
1034 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1035 Err(Error::ResponseError(local_var_error))
1036 }
1037}
1038
1039pub async fn orgs_slash_create_or_update_custom_property(configuration: &configuration::Configuration, org: &str, custom_property_name: &str, orgs_create_or_update_custom_property_request: models::OrgsCreateOrUpdateCustomPropertyRequest) -> Result<models::OrgCustomProperty, Error<OrgsSlashCreateOrUpdateCustomPropertyError>> {
1041 let local_var_configuration = configuration;
1042
1043 let local_var_client = &local_var_configuration.client;
1044
1045 let local_var_uri_str = format!("{}/orgs/{org}/properties/schema/{custom_property_name}", local_var_configuration.base_path, org=crate::apis::urlencode(org), custom_property_name=crate::apis::urlencode(custom_property_name));
1046 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1047
1048 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1049 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1050 }
1051 local_var_req_builder = local_var_req_builder.json(&orgs_create_or_update_custom_property_request);
1052
1053 let local_var_req = local_var_req_builder.build()?;
1054 let local_var_resp = local_var_client.execute(local_var_req).await?;
1055
1056 let local_var_status = local_var_resp.status();
1057 let local_var_content = local_var_resp.text().await?;
1058
1059 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1060 serde_json::from_str(&local_var_content).map_err(Error::from)
1061 } else {
1062 let local_var_entity: Option<OrgsSlashCreateOrUpdateCustomPropertyError> = serde_json::from_str(&local_var_content).ok();
1063 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1064 Err(Error::ResponseError(local_var_error))
1065 }
1066}
1067
1068pub async fn orgs_slash_create_webhook(configuration: &configuration::Configuration, org: &str, orgs_create_webhook_request: models::OrgsCreateWebhookRequest) -> Result<models::OrgHook, Error<OrgsSlashCreateWebhookError>> {
1070 let local_var_configuration = configuration;
1071
1072 let local_var_client = &local_var_configuration.client;
1073
1074 let local_var_uri_str = format!("{}/orgs/{org}/hooks", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1075 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1076
1077 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1078 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1079 }
1080 local_var_req_builder = local_var_req_builder.json(&orgs_create_webhook_request);
1081
1082 let local_var_req = local_var_req_builder.build()?;
1083 let local_var_resp = local_var_client.execute(local_var_req).await?;
1084
1085 let local_var_status = local_var_resp.status();
1086 let local_var_content = local_var_resp.text().await?;
1087
1088 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1089 serde_json::from_str(&local_var_content).map_err(Error::from)
1090 } else {
1091 let local_var_entity: Option<OrgsSlashCreateWebhookError> = serde_json::from_str(&local_var_content).ok();
1092 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1093 Err(Error::ResponseError(local_var_error))
1094 }
1095}
1096
1097pub async fn orgs_slash_delete(configuration: &configuration::Configuration, org: &str) -> Result<serde_json::Value, Error<OrgsSlashDeleteError>> {
1099 let local_var_configuration = configuration;
1100
1101 let local_var_client = &local_var_configuration.client;
1102
1103 let local_var_uri_str = format!("{}/orgs/{org}", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1104 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1105
1106 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1107 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1108 }
1109
1110 let local_var_req = local_var_req_builder.build()?;
1111 let local_var_resp = local_var_client.execute(local_var_req).await?;
1112
1113 let local_var_status = local_var_resp.status();
1114 let local_var_content = local_var_resp.text().await?;
1115
1116 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1117 serde_json::from_str(&local_var_content).map_err(Error::from)
1118 } else {
1119 let local_var_entity: Option<OrgsSlashDeleteError> = serde_json::from_str(&local_var_content).ok();
1120 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1121 Err(Error::ResponseError(local_var_error))
1122 }
1123}
1124
1125pub async fn orgs_slash_delete_custom_organization_role(configuration: &configuration::Configuration, org: &str, role_id: i32) -> Result<(), Error<OrgsSlashDeleteCustomOrganizationRoleError>> {
1127 let local_var_configuration = configuration;
1128
1129 let local_var_client = &local_var_configuration.client;
1130
1131 let local_var_uri_str = format!("{}/orgs/{org}/organization-roles/{role_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), role_id=role_id);
1132 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1133
1134 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1135 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1136 }
1137
1138 let local_var_req = local_var_req_builder.build()?;
1139 let local_var_resp = local_var_client.execute(local_var_req).await?;
1140
1141 let local_var_status = local_var_resp.status();
1142 let local_var_content = local_var_resp.text().await?;
1143
1144 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1145 Ok(())
1146 } else {
1147 let local_var_entity: Option<OrgsSlashDeleteCustomOrganizationRoleError> = serde_json::from_str(&local_var_content).ok();
1148 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1149 Err(Error::ResponseError(local_var_error))
1150 }
1151}
1152
1153pub async fn orgs_slash_delete_webhook(configuration: &configuration::Configuration, org: &str, hook_id: i32) -> Result<(), Error<OrgsSlashDeleteWebhookError>> {
1155 let local_var_configuration = configuration;
1156
1157 let local_var_client = &local_var_configuration.client;
1158
1159 let local_var_uri_str = format!("{}/orgs/{org}/hooks/{hook_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), hook_id=hook_id);
1160 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1161
1162 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1163 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1164 }
1165
1166 let local_var_req = local_var_req_builder.build()?;
1167 let local_var_resp = local_var_client.execute(local_var_req).await?;
1168
1169 let local_var_status = local_var_resp.status();
1170 let local_var_content = local_var_resp.text().await?;
1171
1172 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1173 Ok(())
1174 } else {
1175 let local_var_entity: Option<OrgsSlashDeleteWebhookError> = serde_json::from_str(&local_var_content).ok();
1176 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1177 Err(Error::ResponseError(local_var_error))
1178 }
1179}
1180
1181pub async fn orgs_slash_enable_or_disable_security_product_on_all_org_repos(configuration: &configuration::Configuration, org: &str, security_product: &str, enablement: &str, orgs_enable_or_disable_security_product_on_all_org_repos_request: Option<models::OrgsEnableOrDisableSecurityProductOnAllOrgReposRequest>) -> Result<(), Error<OrgsSlashEnableOrDisableSecurityProductOnAllOrgReposError>> {
1183 let local_var_configuration = configuration;
1184
1185 let local_var_client = &local_var_configuration.client;
1186
1187 let local_var_uri_str = format!("{}/orgs/{org}/{security_product}/{enablement}", local_var_configuration.base_path, org=crate::apis::urlencode(org), security_product=crate::apis::urlencode(security_product), enablement=crate::apis::urlencode(enablement));
1188 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1189
1190 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1191 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1192 }
1193 local_var_req_builder = local_var_req_builder.json(&orgs_enable_or_disable_security_product_on_all_org_repos_request);
1194
1195 let local_var_req = local_var_req_builder.build()?;
1196 let local_var_resp = local_var_client.execute(local_var_req).await?;
1197
1198 let local_var_status = local_var_resp.status();
1199 let local_var_content = local_var_resp.text().await?;
1200
1201 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1202 Ok(())
1203 } else {
1204 let local_var_entity: Option<OrgsSlashEnableOrDisableSecurityProductOnAllOrgReposError> = serde_json::from_str(&local_var_content).ok();
1205 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1206 Err(Error::ResponseError(local_var_error))
1207 }
1208}
1209
1210pub async fn orgs_slash_get(configuration: &configuration::Configuration, org: &str) -> Result<models::OrganizationFull, Error<OrgsSlashGetError>> {
1212 let local_var_configuration = configuration;
1213
1214 let local_var_client = &local_var_configuration.client;
1215
1216 let local_var_uri_str = format!("{}/orgs/{org}", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1217 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1218
1219 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1220 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1221 }
1222
1223 let local_var_req = local_var_req_builder.build()?;
1224 let local_var_resp = local_var_client.execute(local_var_req).await?;
1225
1226 let local_var_status = local_var_resp.status();
1227 let local_var_content = local_var_resp.text().await?;
1228
1229 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1230 serde_json::from_str(&local_var_content).map_err(Error::from)
1231 } else {
1232 let local_var_entity: Option<OrgsSlashGetError> = serde_json::from_str(&local_var_content).ok();
1233 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1234 Err(Error::ResponseError(local_var_error))
1235 }
1236}
1237
1238pub async fn orgs_slash_get_all_custom_properties(configuration: &configuration::Configuration, org: &str) -> Result<Vec<models::OrgCustomProperty>, Error<OrgsSlashGetAllCustomPropertiesError>> {
1240 let local_var_configuration = configuration;
1241
1242 let local_var_client = &local_var_configuration.client;
1243
1244 let local_var_uri_str = format!("{}/orgs/{org}/properties/schema", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1245 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1246
1247 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1248 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1249 }
1250
1251 let local_var_req = local_var_req_builder.build()?;
1252 let local_var_resp = local_var_client.execute(local_var_req).await?;
1253
1254 let local_var_status = local_var_resp.status();
1255 let local_var_content = local_var_resp.text().await?;
1256
1257 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1258 serde_json::from_str(&local_var_content).map_err(Error::from)
1259 } else {
1260 let local_var_entity: Option<OrgsSlashGetAllCustomPropertiesError> = serde_json::from_str(&local_var_content).ok();
1261 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1262 Err(Error::ResponseError(local_var_error))
1263 }
1264}
1265
1266pub async fn orgs_slash_get_custom_property(configuration: &configuration::Configuration, org: &str, custom_property_name: &str) -> Result<models::OrgCustomProperty, Error<OrgsSlashGetCustomPropertyError>> {
1268 let local_var_configuration = configuration;
1269
1270 let local_var_client = &local_var_configuration.client;
1271
1272 let local_var_uri_str = format!("{}/orgs/{org}/properties/schema/{custom_property_name}", local_var_configuration.base_path, org=crate::apis::urlencode(org), custom_property_name=crate::apis::urlencode(custom_property_name));
1273 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1274
1275 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1276 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1277 }
1278
1279 let local_var_req = local_var_req_builder.build()?;
1280 let local_var_resp = local_var_client.execute(local_var_req).await?;
1281
1282 let local_var_status = local_var_resp.status();
1283 let local_var_content = local_var_resp.text().await?;
1284
1285 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1286 serde_json::from_str(&local_var_content).map_err(Error::from)
1287 } else {
1288 let local_var_entity: Option<OrgsSlashGetCustomPropertyError> = serde_json::from_str(&local_var_content).ok();
1289 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1290 Err(Error::ResponseError(local_var_error))
1291 }
1292}
1293
1294pub async fn orgs_slash_get_membership_for_authenticated_user(configuration: &configuration::Configuration, org: &str) -> Result<models::OrgMembership, Error<OrgsSlashGetMembershipForAuthenticatedUserError>> {
1296 let local_var_configuration = configuration;
1297
1298 let local_var_client = &local_var_configuration.client;
1299
1300 let local_var_uri_str = format!("{}/user/memberships/orgs/{org}", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1301 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1302
1303 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1304 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1305 }
1306
1307 let local_var_req = local_var_req_builder.build()?;
1308 let local_var_resp = local_var_client.execute(local_var_req).await?;
1309
1310 let local_var_status = local_var_resp.status();
1311 let local_var_content = local_var_resp.text().await?;
1312
1313 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1314 serde_json::from_str(&local_var_content).map_err(Error::from)
1315 } else {
1316 let local_var_entity: Option<OrgsSlashGetMembershipForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
1317 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1318 Err(Error::ResponseError(local_var_error))
1319 }
1320}
1321
1322pub async fn orgs_slash_get_membership_for_user(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<models::OrgMembership, Error<OrgsSlashGetMembershipForUserError>> {
1324 let local_var_configuration = configuration;
1325
1326 let local_var_client = &local_var_configuration.client;
1327
1328 let local_var_uri_str = format!("{}/orgs/{org}/memberships/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username));
1329 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1330
1331 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1332 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1333 }
1334
1335 let local_var_req = local_var_req_builder.build()?;
1336 let local_var_resp = local_var_client.execute(local_var_req).await?;
1337
1338 let local_var_status = local_var_resp.status();
1339 let local_var_content = local_var_resp.text().await?;
1340
1341 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1342 serde_json::from_str(&local_var_content).map_err(Error::from)
1343 } else {
1344 let local_var_entity: Option<OrgsSlashGetMembershipForUserError> = serde_json::from_str(&local_var_content).ok();
1345 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1346 Err(Error::ResponseError(local_var_error))
1347 }
1348}
1349
1350pub async fn orgs_slash_get_org_role(configuration: &configuration::Configuration, org: &str, role_id: i32) -> Result<models::OrganizationRole, Error<OrgsSlashGetOrgRoleError>> {
1352 let local_var_configuration = configuration;
1353
1354 let local_var_client = &local_var_configuration.client;
1355
1356 let local_var_uri_str = format!("{}/orgs/{org}/organization-roles/{role_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), role_id=role_id);
1357 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1358
1359 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1360 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1361 }
1362
1363 let local_var_req = local_var_req_builder.build()?;
1364 let local_var_resp = local_var_client.execute(local_var_req).await?;
1365
1366 let local_var_status = local_var_resp.status();
1367 let local_var_content = local_var_resp.text().await?;
1368
1369 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1370 serde_json::from_str(&local_var_content).map_err(Error::from)
1371 } else {
1372 let local_var_entity: Option<OrgsSlashGetOrgRoleError> = serde_json::from_str(&local_var_content).ok();
1373 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1374 Err(Error::ResponseError(local_var_error))
1375 }
1376}
1377
1378pub async fn orgs_slash_get_webhook(configuration: &configuration::Configuration, org: &str, hook_id: i32) -> Result<models::OrgHook, Error<OrgsSlashGetWebhookError>> {
1380 let local_var_configuration = configuration;
1381
1382 let local_var_client = &local_var_configuration.client;
1383
1384 let local_var_uri_str = format!("{}/orgs/{org}/hooks/{hook_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), hook_id=hook_id);
1385 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1386
1387 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1388 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1389 }
1390
1391 let local_var_req = local_var_req_builder.build()?;
1392 let local_var_resp = local_var_client.execute(local_var_req).await?;
1393
1394 let local_var_status = local_var_resp.status();
1395 let local_var_content = local_var_resp.text().await?;
1396
1397 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1398 serde_json::from_str(&local_var_content).map_err(Error::from)
1399 } else {
1400 let local_var_entity: Option<OrgsSlashGetWebhookError> = serde_json::from_str(&local_var_content).ok();
1401 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1402 Err(Error::ResponseError(local_var_error))
1403 }
1404}
1405
1406pub async fn orgs_slash_get_webhook_config_for_org(configuration: &configuration::Configuration, org: &str, hook_id: i32) -> Result<models::WebhookConfig, Error<OrgsSlashGetWebhookConfigForOrgError>> {
1408 let local_var_configuration = configuration;
1409
1410 let local_var_client = &local_var_configuration.client;
1411
1412 let local_var_uri_str = format!("{}/orgs/{org}/hooks/{hook_id}/config", local_var_configuration.base_path, org=crate::apis::urlencode(org), hook_id=hook_id);
1413 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1414
1415 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1416 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1417 }
1418
1419 let local_var_req = local_var_req_builder.build()?;
1420 let local_var_resp = local_var_client.execute(local_var_req).await?;
1421
1422 let local_var_status = local_var_resp.status();
1423 let local_var_content = local_var_resp.text().await?;
1424
1425 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1426 serde_json::from_str(&local_var_content).map_err(Error::from)
1427 } else {
1428 let local_var_entity: Option<OrgsSlashGetWebhookConfigForOrgError> = serde_json::from_str(&local_var_content).ok();
1429 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1430 Err(Error::ResponseError(local_var_error))
1431 }
1432}
1433
1434pub async fn orgs_slash_get_webhook_delivery(configuration: &configuration::Configuration, org: &str, hook_id: i32, delivery_id: i32) -> Result<models::HookDelivery, Error<OrgsSlashGetWebhookDeliveryError>> {
1436 let local_var_configuration = configuration;
1437
1438 let local_var_client = &local_var_configuration.client;
1439
1440 let local_var_uri_str = format!("{}/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), hook_id=hook_id, delivery_id=delivery_id);
1441 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1442
1443 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1444 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1445 }
1446
1447 let local_var_req = local_var_req_builder.build()?;
1448 let local_var_resp = local_var_client.execute(local_var_req).await?;
1449
1450 let local_var_status = local_var_resp.status();
1451 let local_var_content = local_var_resp.text().await?;
1452
1453 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1454 serde_json::from_str(&local_var_content).map_err(Error::from)
1455 } else {
1456 let local_var_entity: Option<OrgsSlashGetWebhookDeliveryError> = serde_json::from_str(&local_var_content).ok();
1457 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1458 Err(Error::ResponseError(local_var_error))
1459 }
1460}
1461
1462pub async fn orgs_slash_list(configuration: &configuration::Configuration, since: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::OrganizationSimple>, Error<OrgsSlashListError>> {
1464 let local_var_configuration = configuration;
1465
1466 let local_var_client = &local_var_configuration.client;
1467
1468 let local_var_uri_str = format!("{}/organizations", local_var_configuration.base_path);
1469 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1470
1471 if let Some(ref local_var_str) = since {
1472 local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
1473 }
1474 if let Some(ref local_var_str) = per_page {
1475 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1476 }
1477 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1478 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1479 }
1480
1481 let local_var_req = local_var_req_builder.build()?;
1482 let local_var_resp = local_var_client.execute(local_var_req).await?;
1483
1484 let local_var_status = local_var_resp.status();
1485 let local_var_content = local_var_resp.text().await?;
1486
1487 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1488 serde_json::from_str(&local_var_content).map_err(Error::from)
1489 } else {
1490 let local_var_entity: Option<OrgsSlashListError> = serde_json::from_str(&local_var_content).ok();
1491 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1492 Err(Error::ResponseError(local_var_error))
1493 }
1494}
1495
1496pub async fn orgs_slash_list_app_installations(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::OrgsListAppInstallations200Response, Error<OrgsSlashListAppInstallationsError>> {
1498 let local_var_configuration = configuration;
1499
1500 let local_var_client = &local_var_configuration.client;
1501
1502 let local_var_uri_str = format!("{}/orgs/{org}/installations", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1503 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1504
1505 if let Some(ref local_var_str) = per_page {
1506 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1507 }
1508 if let Some(ref local_var_str) = page {
1509 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1510 }
1511 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1512 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1513 }
1514
1515 let local_var_req = local_var_req_builder.build()?;
1516 let local_var_resp = local_var_client.execute(local_var_req).await?;
1517
1518 let local_var_status = local_var_resp.status();
1519 let local_var_content = local_var_resp.text().await?;
1520
1521 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1522 serde_json::from_str(&local_var_content).map_err(Error::from)
1523 } else {
1524 let local_var_entity: Option<OrgsSlashListAppInstallationsError> = serde_json::from_str(&local_var_content).ok();
1525 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1526 Err(Error::ResponseError(local_var_error))
1527 }
1528}
1529
1530pub async fn orgs_slash_list_blocked_users(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::SimpleUser>, Error<OrgsSlashListBlockedUsersError>> {
1532 let local_var_configuration = configuration;
1533
1534 let local_var_client = &local_var_configuration.client;
1535
1536 let local_var_uri_str = format!("{}/orgs/{org}/blocks", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1537 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1538
1539 if let Some(ref local_var_str) = per_page {
1540 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1541 }
1542 if let Some(ref local_var_str) = page {
1543 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1544 }
1545 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1546 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1547 }
1548
1549 let local_var_req = local_var_req_builder.build()?;
1550 let local_var_resp = local_var_client.execute(local_var_req).await?;
1551
1552 let local_var_status = local_var_resp.status();
1553 let local_var_content = local_var_resp.text().await?;
1554
1555 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1556 serde_json::from_str(&local_var_content).map_err(Error::from)
1557 } else {
1558 let local_var_entity: Option<OrgsSlashListBlockedUsersError> = serde_json::from_str(&local_var_content).ok();
1559 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1560 Err(Error::ResponseError(local_var_error))
1561 }
1562}
1563
1564pub async fn orgs_slash_list_custom_properties_values_for_repos(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>, repository_query: Option<&str>) -> Result<Vec<models::OrgRepoCustomPropertyValues>, Error<OrgsSlashListCustomPropertiesValuesForReposError>> {
1566 let local_var_configuration = configuration;
1567
1568 let local_var_client = &local_var_configuration.client;
1569
1570 let local_var_uri_str = format!("{}/orgs/{org}/properties/values", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1571 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1572
1573 if let Some(ref local_var_str) = per_page {
1574 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1575 }
1576 if let Some(ref local_var_str) = page {
1577 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1578 }
1579 if let Some(ref local_var_str) = repository_query {
1580 local_var_req_builder = local_var_req_builder.query(&[("repository_query", &local_var_str.to_string())]);
1581 }
1582 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1583 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1584 }
1585
1586 let local_var_req = local_var_req_builder.build()?;
1587 let local_var_resp = local_var_client.execute(local_var_req).await?;
1588
1589 let local_var_status = local_var_resp.status();
1590 let local_var_content = local_var_resp.text().await?;
1591
1592 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1593 serde_json::from_str(&local_var_content).map_err(Error::from)
1594 } else {
1595 let local_var_entity: Option<OrgsSlashListCustomPropertiesValuesForReposError> = serde_json::from_str(&local_var_content).ok();
1596 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1597 Err(Error::ResponseError(local_var_error))
1598 }
1599}
1600
1601pub async fn orgs_slash_list_failed_invitations(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::OrganizationInvitation>, Error<OrgsSlashListFailedInvitationsError>> {
1603 let local_var_configuration = configuration;
1604
1605 let local_var_client = &local_var_configuration.client;
1606
1607 let local_var_uri_str = format!("{}/orgs/{org}/failed_invitations", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1608 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1609
1610 if let Some(ref local_var_str) = per_page {
1611 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1612 }
1613 if let Some(ref local_var_str) = page {
1614 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1615 }
1616 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1617 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1618 }
1619
1620 let local_var_req = local_var_req_builder.build()?;
1621 let local_var_resp = local_var_client.execute(local_var_req).await?;
1622
1623 let local_var_status = local_var_resp.status();
1624 let local_var_content = local_var_resp.text().await?;
1625
1626 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1627 serde_json::from_str(&local_var_content).map_err(Error::from)
1628 } else {
1629 let local_var_entity: Option<OrgsSlashListFailedInvitationsError> = serde_json::from_str(&local_var_content).ok();
1630 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1631 Err(Error::ResponseError(local_var_error))
1632 }
1633}
1634
1635pub async fn orgs_slash_list_for_authenticated_user(configuration: &configuration::Configuration, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::OrganizationSimple>, Error<OrgsSlashListForAuthenticatedUserError>> {
1637 let local_var_configuration = configuration;
1638
1639 let local_var_client = &local_var_configuration.client;
1640
1641 let local_var_uri_str = format!("{}/user/orgs", local_var_configuration.base_path);
1642 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1643
1644 if let Some(ref local_var_str) = per_page {
1645 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1646 }
1647 if let Some(ref local_var_str) = page {
1648 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1649 }
1650 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1651 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1652 }
1653
1654 let local_var_req = local_var_req_builder.build()?;
1655 let local_var_resp = local_var_client.execute(local_var_req).await?;
1656
1657 let local_var_status = local_var_resp.status();
1658 let local_var_content = local_var_resp.text().await?;
1659
1660 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1661 serde_json::from_str(&local_var_content).map_err(Error::from)
1662 } else {
1663 let local_var_entity: Option<OrgsSlashListForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
1664 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1665 Err(Error::ResponseError(local_var_error))
1666 }
1667}
1668
1669pub async fn orgs_slash_list_for_user(configuration: &configuration::Configuration, username: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::OrganizationSimple>, Error<OrgsSlashListForUserError>> {
1671 let local_var_configuration = configuration;
1672
1673 let local_var_client = &local_var_configuration.client;
1674
1675 let local_var_uri_str = format!("{}/users/{username}/orgs", local_var_configuration.base_path, username=crate::apis::urlencode(username));
1676 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1677
1678 if let Some(ref local_var_str) = per_page {
1679 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1680 }
1681 if let Some(ref local_var_str) = page {
1682 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1683 }
1684 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1685 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1686 }
1687
1688 let local_var_req = local_var_req_builder.build()?;
1689 let local_var_resp = local_var_client.execute(local_var_req).await?;
1690
1691 let local_var_status = local_var_resp.status();
1692 let local_var_content = local_var_resp.text().await?;
1693
1694 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1695 serde_json::from_str(&local_var_content).map_err(Error::from)
1696 } else {
1697 let local_var_entity: Option<OrgsSlashListForUserError> = serde_json::from_str(&local_var_content).ok();
1698 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1699 Err(Error::ResponseError(local_var_error))
1700 }
1701}
1702
1703pub async fn orgs_slash_list_invitation_teams(configuration: &configuration::Configuration, org: &str, invitation_id: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Team>, Error<OrgsSlashListInvitationTeamsError>> {
1705 let local_var_configuration = configuration;
1706
1707 let local_var_client = &local_var_configuration.client;
1708
1709 let local_var_uri_str = format!("{}/orgs/{org}/invitations/{invitation_id}/teams", local_var_configuration.base_path, org=crate::apis::urlencode(org), invitation_id=invitation_id);
1710 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1711
1712 if let Some(ref local_var_str) = per_page {
1713 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1714 }
1715 if let Some(ref local_var_str) = page {
1716 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1717 }
1718 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1719 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1720 }
1721
1722 let local_var_req = local_var_req_builder.build()?;
1723 let local_var_resp = local_var_client.execute(local_var_req).await?;
1724
1725 let local_var_status = local_var_resp.status();
1726 let local_var_content = local_var_resp.text().await?;
1727
1728 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1729 serde_json::from_str(&local_var_content).map_err(Error::from)
1730 } else {
1731 let local_var_entity: Option<OrgsSlashListInvitationTeamsError> = serde_json::from_str(&local_var_content).ok();
1732 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1733 Err(Error::ResponseError(local_var_error))
1734 }
1735}
1736
1737pub async fn orgs_slash_list_members(configuration: &configuration::Configuration, org: &str, filter: Option<&str>, role: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::SimpleUser>, Error<OrgsSlashListMembersError>> {
1739 let local_var_configuration = configuration;
1740
1741 let local_var_client = &local_var_configuration.client;
1742
1743 let local_var_uri_str = format!("{}/orgs/{org}/members", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1744 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1745
1746 if let Some(ref local_var_str) = filter {
1747 local_var_req_builder = local_var_req_builder.query(&[("filter", &local_var_str.to_string())]);
1748 }
1749 if let Some(ref local_var_str) = role {
1750 local_var_req_builder = local_var_req_builder.query(&[("role", &local_var_str.to_string())]);
1751 }
1752 if let Some(ref local_var_str) = per_page {
1753 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1754 }
1755 if let Some(ref local_var_str) = page {
1756 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1757 }
1758 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1759 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1760 }
1761
1762 let local_var_req = local_var_req_builder.build()?;
1763 let local_var_resp = local_var_client.execute(local_var_req).await?;
1764
1765 let local_var_status = local_var_resp.status();
1766 let local_var_content = local_var_resp.text().await?;
1767
1768 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1769 serde_json::from_str(&local_var_content).map_err(Error::from)
1770 } else {
1771 let local_var_entity: Option<OrgsSlashListMembersError> = serde_json::from_str(&local_var_content).ok();
1772 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1773 Err(Error::ResponseError(local_var_error))
1774 }
1775}
1776
1777pub async fn orgs_slash_list_memberships_for_authenticated_user(configuration: &configuration::Configuration, state: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::OrgMembership>, Error<OrgsSlashListMembershipsForAuthenticatedUserError>> {
1779 let local_var_configuration = configuration;
1780
1781 let local_var_client = &local_var_configuration.client;
1782
1783 let local_var_uri_str = format!("{}/user/memberships/orgs", local_var_configuration.base_path);
1784 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1785
1786 if let Some(ref local_var_str) = state {
1787 local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
1788 }
1789 if let Some(ref local_var_str) = per_page {
1790 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1791 }
1792 if let Some(ref local_var_str) = page {
1793 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1794 }
1795 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1796 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1797 }
1798
1799 let local_var_req = local_var_req_builder.build()?;
1800 let local_var_resp = local_var_client.execute(local_var_req).await?;
1801
1802 let local_var_status = local_var_resp.status();
1803 let local_var_content = local_var_resp.text().await?;
1804
1805 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1806 serde_json::from_str(&local_var_content).map_err(Error::from)
1807 } else {
1808 let local_var_entity: Option<OrgsSlashListMembershipsForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
1809 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1810 Err(Error::ResponseError(local_var_error))
1811 }
1812}
1813
1814pub async fn orgs_slash_list_org_role_teams(configuration: &configuration::Configuration, org: &str, role_id: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Team>, Error<OrgsSlashListOrgRoleTeamsError>> {
1816 let local_var_configuration = configuration;
1817
1818 let local_var_client = &local_var_configuration.client;
1819
1820 let local_var_uri_str = format!("{}/orgs/{org}/organization-roles/{role_id}/teams", local_var_configuration.base_path, org=crate::apis::urlencode(org), role_id=role_id);
1821 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1822
1823 if let Some(ref local_var_str) = per_page {
1824 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1825 }
1826 if let Some(ref local_var_str) = page {
1827 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1828 }
1829 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1830 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1831 }
1832
1833 let local_var_req = local_var_req_builder.build()?;
1834 let local_var_resp = local_var_client.execute(local_var_req).await?;
1835
1836 let local_var_status = local_var_resp.status();
1837 let local_var_content = local_var_resp.text().await?;
1838
1839 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1840 serde_json::from_str(&local_var_content).map_err(Error::from)
1841 } else {
1842 let local_var_entity: Option<OrgsSlashListOrgRoleTeamsError> = serde_json::from_str(&local_var_content).ok();
1843 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1844 Err(Error::ResponseError(local_var_error))
1845 }
1846}
1847
1848pub async fn orgs_slash_list_org_role_users(configuration: &configuration::Configuration, org: &str, role_id: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::SimpleUser>, Error<OrgsSlashListOrgRoleUsersError>> {
1850 let local_var_configuration = configuration;
1851
1852 let local_var_client = &local_var_configuration.client;
1853
1854 let local_var_uri_str = format!("{}/orgs/{org}/organization-roles/{role_id}/users", local_var_configuration.base_path, org=crate::apis::urlencode(org), role_id=role_id);
1855 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1856
1857 if let Some(ref local_var_str) = per_page {
1858 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1859 }
1860 if let Some(ref local_var_str) = page {
1861 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1862 }
1863 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1864 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1865 }
1866
1867 let local_var_req = local_var_req_builder.build()?;
1868 let local_var_resp = local_var_client.execute(local_var_req).await?;
1869
1870 let local_var_status = local_var_resp.status();
1871 let local_var_content = local_var_resp.text().await?;
1872
1873 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1874 serde_json::from_str(&local_var_content).map_err(Error::from)
1875 } else {
1876 let local_var_entity: Option<OrgsSlashListOrgRoleUsersError> = serde_json::from_str(&local_var_content).ok();
1877 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1878 Err(Error::ResponseError(local_var_error))
1879 }
1880}
1881
1882pub async fn orgs_slash_list_org_roles(configuration: &configuration::Configuration, org: &str) -> Result<models::OrgsListOrgRoles200Response, Error<OrgsSlashListOrgRolesError>> {
1884 let local_var_configuration = configuration;
1885
1886 let local_var_client = &local_var_configuration.client;
1887
1888 let local_var_uri_str = format!("{}/orgs/{org}/organization-roles", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1889 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1890
1891 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1892 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1893 }
1894
1895 let local_var_req = local_var_req_builder.build()?;
1896 let local_var_resp = local_var_client.execute(local_var_req).await?;
1897
1898 let local_var_status = local_var_resp.status();
1899 let local_var_content = local_var_resp.text().await?;
1900
1901 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1902 serde_json::from_str(&local_var_content).map_err(Error::from)
1903 } else {
1904 let local_var_entity: Option<OrgsSlashListOrgRolesError> = serde_json::from_str(&local_var_content).ok();
1905 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1906 Err(Error::ResponseError(local_var_error))
1907 }
1908}
1909
1910pub async fn orgs_slash_list_organization_fine_grained_permissions(configuration: &configuration::Configuration, org: &str) -> Result<Vec<models::OrganizationFineGrainedPermission>, Error<OrgsSlashListOrganizationFineGrainedPermissionsError>> {
1912 let local_var_configuration = configuration;
1913
1914 let local_var_client = &local_var_configuration.client;
1915
1916 let local_var_uri_str = format!("{}/orgs/{org}/organization-fine-grained-permissions", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1917 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1918
1919 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1920 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1921 }
1922
1923 let local_var_req = local_var_req_builder.build()?;
1924 let local_var_resp = local_var_client.execute(local_var_req).await?;
1925
1926 let local_var_status = local_var_resp.status();
1927 let local_var_content = local_var_resp.text().await?;
1928
1929 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1930 serde_json::from_str(&local_var_content).map_err(Error::from)
1931 } else {
1932 let local_var_entity: Option<OrgsSlashListOrganizationFineGrainedPermissionsError> = serde_json::from_str(&local_var_content).ok();
1933 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1934 Err(Error::ResponseError(local_var_error))
1935 }
1936}
1937
1938pub async fn orgs_slash_list_outside_collaborators(configuration: &configuration::Configuration, org: &str, filter: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::SimpleUser>, Error<OrgsSlashListOutsideCollaboratorsError>> {
1940 let local_var_configuration = configuration;
1941
1942 let local_var_client = &local_var_configuration.client;
1943
1944 let local_var_uri_str = format!("{}/orgs/{org}/outside_collaborators", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1945 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1946
1947 if let Some(ref local_var_str) = filter {
1948 local_var_req_builder = local_var_req_builder.query(&[("filter", &local_var_str.to_string())]);
1949 }
1950 if let Some(ref local_var_str) = per_page {
1951 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1952 }
1953 if let Some(ref local_var_str) = page {
1954 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1955 }
1956 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1957 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1958 }
1959
1960 let local_var_req = local_var_req_builder.build()?;
1961 let local_var_resp = local_var_client.execute(local_var_req).await?;
1962
1963 let local_var_status = local_var_resp.status();
1964 let local_var_content = local_var_resp.text().await?;
1965
1966 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1967 serde_json::from_str(&local_var_content).map_err(Error::from)
1968 } else {
1969 let local_var_entity: Option<OrgsSlashListOutsideCollaboratorsError> = serde_json::from_str(&local_var_content).ok();
1970 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1971 Err(Error::ResponseError(local_var_error))
1972 }
1973}
1974
1975pub async fn orgs_slash_list_pat_grant_repositories(configuration: &configuration::Configuration, org: &str, pat_id: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::MinimalRepository>, Error<OrgsSlashListPatGrantRepositoriesError>> {
1977 let local_var_configuration = configuration;
1978
1979 let local_var_client = &local_var_configuration.client;
1980
1981 let local_var_uri_str = format!("{}/orgs/{org}/personal-access-tokens/{pat_id}/repositories", local_var_configuration.base_path, org=crate::apis::urlencode(org), pat_id=pat_id);
1982 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1983
1984 if let Some(ref local_var_str) = per_page {
1985 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1986 }
1987 if let Some(ref local_var_str) = page {
1988 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1989 }
1990 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1991 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1992 }
1993
1994 let local_var_req = local_var_req_builder.build()?;
1995 let local_var_resp = local_var_client.execute(local_var_req).await?;
1996
1997 let local_var_status = local_var_resp.status();
1998 let local_var_content = local_var_resp.text().await?;
1999
2000 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2001 serde_json::from_str(&local_var_content).map_err(Error::from)
2002 } else {
2003 let local_var_entity: Option<OrgsSlashListPatGrantRepositoriesError> = serde_json::from_str(&local_var_content).ok();
2004 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2005 Err(Error::ResponseError(local_var_error))
2006 }
2007}
2008
2009pub async fn orgs_slash_list_pat_grant_request_repositories(configuration: &configuration::Configuration, org: &str, pat_request_id: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::MinimalRepository>, Error<OrgsSlashListPatGrantRequestRepositoriesError>> {
2011 let local_var_configuration = configuration;
2012
2013 let local_var_client = &local_var_configuration.client;
2014
2015 let local_var_uri_str = format!("{}/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories", local_var_configuration.base_path, org=crate::apis::urlencode(org), pat_request_id=pat_request_id);
2016 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2017
2018 if let Some(ref local_var_str) = per_page {
2019 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2020 }
2021 if let Some(ref local_var_str) = page {
2022 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2023 }
2024 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2025 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2026 }
2027
2028 let local_var_req = local_var_req_builder.build()?;
2029 let local_var_resp = local_var_client.execute(local_var_req).await?;
2030
2031 let local_var_status = local_var_resp.status();
2032 let local_var_content = local_var_resp.text().await?;
2033
2034 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2035 serde_json::from_str(&local_var_content).map_err(Error::from)
2036 } else {
2037 let local_var_entity: Option<OrgsSlashListPatGrantRequestRepositoriesError> = serde_json::from_str(&local_var_content).ok();
2038 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2039 Err(Error::ResponseError(local_var_error))
2040 }
2041}
2042
2043pub async fn orgs_slash_list_pat_grant_requests(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>, sort: Option<&str>, direction: Option<&str>, owner: Option<Vec<String>>, repository: Option<&str>, permission: Option<&str>, last_used_before: Option<String>, last_used_after: Option<String>) -> Result<Vec<models::OrganizationProgrammaticAccessGrantRequest>, Error<OrgsSlashListPatGrantRequestsError>> {
2045 let local_var_configuration = configuration;
2046
2047 let local_var_client = &local_var_configuration.client;
2048
2049 let local_var_uri_str = format!("{}/orgs/{org}/personal-access-token-requests", local_var_configuration.base_path, org=crate::apis::urlencode(org));
2050 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2051
2052 if let Some(ref local_var_str) = per_page {
2053 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2054 }
2055 if let Some(ref local_var_str) = page {
2056 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2057 }
2058 if let Some(ref local_var_str) = sort {
2059 local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
2060 }
2061 if let Some(ref local_var_str) = direction {
2062 local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
2063 }
2064 if let Some(ref local_var_str) = owner {
2065 local_var_req_builder = match "multi" {
2066 "multi" => local_var_req_builder.query(&local_var_str.iter().map(|p| ("owner".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
2067 _ => local_var_req_builder.query(&[("owner", &local_var_str.iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
2068 };
2069 }
2070 if let Some(ref local_var_str) = repository {
2071 local_var_req_builder = local_var_req_builder.query(&[("repository", &local_var_str.to_string())]);
2072 }
2073 if let Some(ref local_var_str) = permission {
2074 local_var_req_builder = local_var_req_builder.query(&[("permission", &local_var_str.to_string())]);
2075 }
2076 if let Some(ref local_var_str) = last_used_before {
2077 local_var_req_builder = local_var_req_builder.query(&[("last_used_before", &local_var_str.to_string())]);
2078 }
2079 if let Some(ref local_var_str) = last_used_after {
2080 local_var_req_builder = local_var_req_builder.query(&[("last_used_after", &local_var_str.to_string())]);
2081 }
2082 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2083 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2084 }
2085
2086 let local_var_req = local_var_req_builder.build()?;
2087 let local_var_resp = local_var_client.execute(local_var_req).await?;
2088
2089 let local_var_status = local_var_resp.status();
2090 let local_var_content = local_var_resp.text().await?;
2091
2092 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2093 serde_json::from_str(&local_var_content).map_err(Error::from)
2094 } else {
2095 let local_var_entity: Option<OrgsSlashListPatGrantRequestsError> = serde_json::from_str(&local_var_content).ok();
2096 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2097 Err(Error::ResponseError(local_var_error))
2098 }
2099}
2100
2101pub async fn orgs_slash_list_pat_grants(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>, sort: Option<&str>, direction: Option<&str>, owner: Option<Vec<String>>, repository: Option<&str>, permission: Option<&str>, last_used_before: Option<String>, last_used_after: Option<String>) -> Result<Vec<models::OrganizationProgrammaticAccessGrant>, Error<OrgsSlashListPatGrantsError>> {
2103 let local_var_configuration = configuration;
2104
2105 let local_var_client = &local_var_configuration.client;
2106
2107 let local_var_uri_str = format!("{}/orgs/{org}/personal-access-tokens", local_var_configuration.base_path, org=crate::apis::urlencode(org));
2108 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2109
2110 if let Some(ref local_var_str) = per_page {
2111 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2112 }
2113 if let Some(ref local_var_str) = page {
2114 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2115 }
2116 if let Some(ref local_var_str) = sort {
2117 local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
2118 }
2119 if let Some(ref local_var_str) = direction {
2120 local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
2121 }
2122 if let Some(ref local_var_str) = owner {
2123 local_var_req_builder = match "multi" {
2124 "multi" => local_var_req_builder.query(&local_var_str.iter().map(|p| ("owner".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
2125 _ => local_var_req_builder.query(&[("owner", &local_var_str.iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
2126 };
2127 }
2128 if let Some(ref local_var_str) = repository {
2129 local_var_req_builder = local_var_req_builder.query(&[("repository", &local_var_str.to_string())]);
2130 }
2131 if let Some(ref local_var_str) = permission {
2132 local_var_req_builder = local_var_req_builder.query(&[("permission", &local_var_str.to_string())]);
2133 }
2134 if let Some(ref local_var_str) = last_used_before {
2135 local_var_req_builder = local_var_req_builder.query(&[("last_used_before", &local_var_str.to_string())]);
2136 }
2137 if let Some(ref local_var_str) = last_used_after {
2138 local_var_req_builder = local_var_req_builder.query(&[("last_used_after", &local_var_str.to_string())]);
2139 }
2140 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2141 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2142 }
2143
2144 let local_var_req = local_var_req_builder.build()?;
2145 let local_var_resp = local_var_client.execute(local_var_req).await?;
2146
2147 let local_var_status = local_var_resp.status();
2148 let local_var_content = local_var_resp.text().await?;
2149
2150 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2151 serde_json::from_str(&local_var_content).map_err(Error::from)
2152 } else {
2153 let local_var_entity: Option<OrgsSlashListPatGrantsError> = serde_json::from_str(&local_var_content).ok();
2154 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2155 Err(Error::ResponseError(local_var_error))
2156 }
2157}
2158
2159pub async fn orgs_slash_list_pending_invitations(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>, role: Option<&str>, invitation_source: Option<&str>) -> Result<Vec<models::OrganizationInvitation>, Error<OrgsSlashListPendingInvitationsError>> {
2161 let local_var_configuration = configuration;
2162
2163 let local_var_client = &local_var_configuration.client;
2164
2165 let local_var_uri_str = format!("{}/orgs/{org}/invitations", local_var_configuration.base_path, org=crate::apis::urlencode(org));
2166 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2167
2168 if let Some(ref local_var_str) = per_page {
2169 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2170 }
2171 if let Some(ref local_var_str) = page {
2172 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2173 }
2174 if let Some(ref local_var_str) = role {
2175 local_var_req_builder = local_var_req_builder.query(&[("role", &local_var_str.to_string())]);
2176 }
2177 if let Some(ref local_var_str) = invitation_source {
2178 local_var_req_builder = local_var_req_builder.query(&[("invitation_source", &local_var_str.to_string())]);
2179 }
2180 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2181 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2182 }
2183
2184 let local_var_req = local_var_req_builder.build()?;
2185 let local_var_resp = local_var_client.execute(local_var_req).await?;
2186
2187 let local_var_status = local_var_resp.status();
2188 let local_var_content = local_var_resp.text().await?;
2189
2190 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2191 serde_json::from_str(&local_var_content).map_err(Error::from)
2192 } else {
2193 let local_var_entity: Option<OrgsSlashListPendingInvitationsError> = serde_json::from_str(&local_var_content).ok();
2194 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2195 Err(Error::ResponseError(local_var_error))
2196 }
2197}
2198
2199pub async fn orgs_slash_list_public_members(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::SimpleUser>, Error<OrgsSlashListPublicMembersError>> {
2201 let local_var_configuration = configuration;
2202
2203 let local_var_client = &local_var_configuration.client;
2204
2205 let local_var_uri_str = format!("{}/orgs/{org}/public_members", local_var_configuration.base_path, org=crate::apis::urlencode(org));
2206 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2207
2208 if let Some(ref local_var_str) = per_page {
2209 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2210 }
2211 if let Some(ref local_var_str) = page {
2212 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2213 }
2214 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2215 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2216 }
2217
2218 let local_var_req = local_var_req_builder.build()?;
2219 let local_var_resp = local_var_client.execute(local_var_req).await?;
2220
2221 let local_var_status = local_var_resp.status();
2222 let local_var_content = local_var_resp.text().await?;
2223
2224 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2225 serde_json::from_str(&local_var_content).map_err(Error::from)
2226 } else {
2227 let local_var_entity: Option<OrgsSlashListPublicMembersError> = serde_json::from_str(&local_var_content).ok();
2228 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2229 Err(Error::ResponseError(local_var_error))
2230 }
2231}
2232
2233pub async fn orgs_slash_list_security_manager_teams(configuration: &configuration::Configuration, org: &str) -> Result<Vec<models::TeamSimple>, Error<OrgsSlashListSecurityManagerTeamsError>> {
2235 let local_var_configuration = configuration;
2236
2237 let local_var_client = &local_var_configuration.client;
2238
2239 let local_var_uri_str = format!("{}/orgs/{org}/security-managers", local_var_configuration.base_path, org=crate::apis::urlencode(org));
2240 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2241
2242 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2243 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2244 }
2245
2246 let local_var_req = local_var_req_builder.build()?;
2247 let local_var_resp = local_var_client.execute(local_var_req).await?;
2248
2249 let local_var_status = local_var_resp.status();
2250 let local_var_content = local_var_resp.text().await?;
2251
2252 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2253 serde_json::from_str(&local_var_content).map_err(Error::from)
2254 } else {
2255 let local_var_entity: Option<OrgsSlashListSecurityManagerTeamsError> = serde_json::from_str(&local_var_content).ok();
2256 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2257 Err(Error::ResponseError(local_var_error))
2258 }
2259}
2260
2261pub async fn orgs_slash_list_webhook_deliveries(configuration: &configuration::Configuration, org: &str, hook_id: i32, per_page: Option<i32>, cursor: Option<&str>, redelivery: Option<bool>) -> Result<Vec<models::HookDeliveryItem>, Error<OrgsSlashListWebhookDeliveriesError>> {
2263 let local_var_configuration = configuration;
2264
2265 let local_var_client = &local_var_configuration.client;
2266
2267 let local_var_uri_str = format!("{}/orgs/{org}/hooks/{hook_id}/deliveries", local_var_configuration.base_path, org=crate::apis::urlencode(org), hook_id=hook_id);
2268 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2269
2270 if let Some(ref local_var_str) = per_page {
2271 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2272 }
2273 if let Some(ref local_var_str) = cursor {
2274 local_var_req_builder = local_var_req_builder.query(&[("cursor", &local_var_str.to_string())]);
2275 }
2276 if let Some(ref local_var_str) = redelivery {
2277 local_var_req_builder = local_var_req_builder.query(&[("redelivery", &local_var_str.to_string())]);
2278 }
2279 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2280 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2281 }
2282
2283 let local_var_req = local_var_req_builder.build()?;
2284 let local_var_resp = local_var_client.execute(local_var_req).await?;
2285
2286 let local_var_status = local_var_resp.status();
2287 let local_var_content = local_var_resp.text().await?;
2288
2289 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2290 serde_json::from_str(&local_var_content).map_err(Error::from)
2291 } else {
2292 let local_var_entity: Option<OrgsSlashListWebhookDeliveriesError> = serde_json::from_str(&local_var_content).ok();
2293 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2294 Err(Error::ResponseError(local_var_error))
2295 }
2296}
2297
2298pub async fn orgs_slash_list_webhooks(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::OrgHook>, Error<OrgsSlashListWebhooksError>> {
2300 let local_var_configuration = configuration;
2301
2302 let local_var_client = &local_var_configuration.client;
2303
2304 let local_var_uri_str = format!("{}/orgs/{org}/hooks", local_var_configuration.base_path, org=crate::apis::urlencode(org));
2305 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2306
2307 if let Some(ref local_var_str) = per_page {
2308 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2309 }
2310 if let Some(ref local_var_str) = page {
2311 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2312 }
2313 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2314 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2315 }
2316
2317 let local_var_req = local_var_req_builder.build()?;
2318 let local_var_resp = local_var_client.execute(local_var_req).await?;
2319
2320 let local_var_status = local_var_resp.status();
2321 let local_var_content = local_var_resp.text().await?;
2322
2323 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2324 serde_json::from_str(&local_var_content).map_err(Error::from)
2325 } else {
2326 let local_var_entity: Option<OrgsSlashListWebhooksError> = serde_json::from_str(&local_var_content).ok();
2327 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2328 Err(Error::ResponseError(local_var_error))
2329 }
2330}
2331
2332pub async fn orgs_slash_patch_custom_organization_role(configuration: &configuration::Configuration, org: &str, role_id: i32, orgs_patch_custom_organization_role_request: models::OrgsPatchCustomOrganizationRoleRequest) -> Result<models::OrganizationRole, Error<OrgsSlashPatchCustomOrganizationRoleError>> {
2334 let local_var_configuration = configuration;
2335
2336 let local_var_client = &local_var_configuration.client;
2337
2338 let local_var_uri_str = format!("{}/orgs/{org}/organization-roles/{role_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), role_id=role_id);
2339 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
2340
2341 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2342 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2343 }
2344 local_var_req_builder = local_var_req_builder.json(&orgs_patch_custom_organization_role_request);
2345
2346 let local_var_req = local_var_req_builder.build()?;
2347 let local_var_resp = local_var_client.execute(local_var_req).await?;
2348
2349 let local_var_status = local_var_resp.status();
2350 let local_var_content = local_var_resp.text().await?;
2351
2352 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2353 serde_json::from_str(&local_var_content).map_err(Error::from)
2354 } else {
2355 let local_var_entity: Option<OrgsSlashPatchCustomOrganizationRoleError> = serde_json::from_str(&local_var_content).ok();
2356 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2357 Err(Error::ResponseError(local_var_error))
2358 }
2359}
2360
2361pub async fn orgs_slash_ping_webhook(configuration: &configuration::Configuration, org: &str, hook_id: i32) -> Result<(), Error<OrgsSlashPingWebhookError>> {
2363 let local_var_configuration = configuration;
2364
2365 let local_var_client = &local_var_configuration.client;
2366
2367 let local_var_uri_str = format!("{}/orgs/{org}/hooks/{hook_id}/pings", local_var_configuration.base_path, org=crate::apis::urlencode(org), hook_id=hook_id);
2368 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2369
2370 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2371 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2372 }
2373
2374 let local_var_req = local_var_req_builder.build()?;
2375 let local_var_resp = local_var_client.execute(local_var_req).await?;
2376
2377 let local_var_status = local_var_resp.status();
2378 let local_var_content = local_var_resp.text().await?;
2379
2380 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2381 Ok(())
2382 } else {
2383 let local_var_entity: Option<OrgsSlashPingWebhookError> = serde_json::from_str(&local_var_content).ok();
2384 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2385 Err(Error::ResponseError(local_var_error))
2386 }
2387}
2388
2389pub async fn orgs_slash_redeliver_webhook_delivery(configuration: &configuration::Configuration, org: &str, hook_id: i32, delivery_id: i32) -> Result<serde_json::Value, Error<OrgsSlashRedeliverWebhookDeliveryError>> {
2391 let local_var_configuration = configuration;
2392
2393 let local_var_client = &local_var_configuration.client;
2394
2395 let local_var_uri_str = format!("{}/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts", local_var_configuration.base_path, org=crate::apis::urlencode(org), hook_id=hook_id, delivery_id=delivery_id);
2396 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2397
2398 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2399 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2400 }
2401
2402 let local_var_req = local_var_req_builder.build()?;
2403 let local_var_resp = local_var_client.execute(local_var_req).await?;
2404
2405 let local_var_status = local_var_resp.status();
2406 let local_var_content = local_var_resp.text().await?;
2407
2408 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2409 serde_json::from_str(&local_var_content).map_err(Error::from)
2410 } else {
2411 let local_var_entity: Option<OrgsSlashRedeliverWebhookDeliveryError> = serde_json::from_str(&local_var_content).ok();
2412 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2413 Err(Error::ResponseError(local_var_error))
2414 }
2415}
2416
2417pub async fn orgs_slash_remove_custom_property(configuration: &configuration::Configuration, org: &str, custom_property_name: &str) -> Result<(), Error<OrgsSlashRemoveCustomPropertyError>> {
2419 let local_var_configuration = configuration;
2420
2421 let local_var_client = &local_var_configuration.client;
2422
2423 let local_var_uri_str = format!("{}/orgs/{org}/properties/schema/{custom_property_name}", local_var_configuration.base_path, org=crate::apis::urlencode(org), custom_property_name=crate::apis::urlencode(custom_property_name));
2424 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2425
2426 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2427 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2428 }
2429
2430 let local_var_req = local_var_req_builder.build()?;
2431 let local_var_resp = local_var_client.execute(local_var_req).await?;
2432
2433 let local_var_status = local_var_resp.status();
2434 let local_var_content = local_var_resp.text().await?;
2435
2436 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2437 Ok(())
2438 } else {
2439 let local_var_entity: Option<OrgsSlashRemoveCustomPropertyError> = serde_json::from_str(&local_var_content).ok();
2440 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2441 Err(Error::ResponseError(local_var_error))
2442 }
2443}
2444
2445pub async fn orgs_slash_remove_member(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error<OrgsSlashRemoveMemberError>> {
2447 let local_var_configuration = configuration;
2448
2449 let local_var_client = &local_var_configuration.client;
2450
2451 let local_var_uri_str = format!("{}/orgs/{org}/members/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username));
2452 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2453
2454 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2455 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2456 }
2457
2458 let local_var_req = local_var_req_builder.build()?;
2459 let local_var_resp = local_var_client.execute(local_var_req).await?;
2460
2461 let local_var_status = local_var_resp.status();
2462 let local_var_content = local_var_resp.text().await?;
2463
2464 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2465 Ok(())
2466 } else {
2467 let local_var_entity: Option<OrgsSlashRemoveMemberError> = serde_json::from_str(&local_var_content).ok();
2468 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2469 Err(Error::ResponseError(local_var_error))
2470 }
2471}
2472
2473pub async fn orgs_slash_remove_membership_for_user(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error<OrgsSlashRemoveMembershipForUserError>> {
2475 let local_var_configuration = configuration;
2476
2477 let local_var_client = &local_var_configuration.client;
2478
2479 let local_var_uri_str = format!("{}/orgs/{org}/memberships/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username));
2480 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2481
2482 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2483 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2484 }
2485
2486 let local_var_req = local_var_req_builder.build()?;
2487 let local_var_resp = local_var_client.execute(local_var_req).await?;
2488
2489 let local_var_status = local_var_resp.status();
2490 let local_var_content = local_var_resp.text().await?;
2491
2492 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2493 Ok(())
2494 } else {
2495 let local_var_entity: Option<OrgsSlashRemoveMembershipForUserError> = serde_json::from_str(&local_var_content).ok();
2496 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2497 Err(Error::ResponseError(local_var_error))
2498 }
2499}
2500
2501pub async fn orgs_slash_remove_outside_collaborator(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error<OrgsSlashRemoveOutsideCollaboratorError>> {
2503 let local_var_configuration = configuration;
2504
2505 let local_var_client = &local_var_configuration.client;
2506
2507 let local_var_uri_str = format!("{}/orgs/{org}/outside_collaborators/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username));
2508 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2509
2510 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2511 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2512 }
2513
2514 let local_var_req = local_var_req_builder.build()?;
2515 let local_var_resp = local_var_client.execute(local_var_req).await?;
2516
2517 let local_var_status = local_var_resp.status();
2518 let local_var_content = local_var_resp.text().await?;
2519
2520 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2521 Ok(())
2522 } else {
2523 let local_var_entity: Option<OrgsSlashRemoveOutsideCollaboratorError> = serde_json::from_str(&local_var_content).ok();
2524 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2525 Err(Error::ResponseError(local_var_error))
2526 }
2527}
2528
2529pub async fn orgs_slash_remove_public_membership_for_authenticated_user(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error<OrgsSlashRemovePublicMembershipForAuthenticatedUserError>> {
2531 let local_var_configuration = configuration;
2532
2533 let local_var_client = &local_var_configuration.client;
2534
2535 let local_var_uri_str = format!("{}/orgs/{org}/public_members/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username));
2536 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2537
2538 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2539 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2540 }
2541
2542 let local_var_req = local_var_req_builder.build()?;
2543 let local_var_resp = local_var_client.execute(local_var_req).await?;
2544
2545 let local_var_status = local_var_resp.status();
2546 let local_var_content = local_var_resp.text().await?;
2547
2548 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2549 Ok(())
2550 } else {
2551 let local_var_entity: Option<OrgsSlashRemovePublicMembershipForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
2552 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2553 Err(Error::ResponseError(local_var_error))
2554 }
2555}
2556
2557pub async fn orgs_slash_remove_security_manager_team(configuration: &configuration::Configuration, org: &str, team_slug: &str) -> Result<(), Error<OrgsSlashRemoveSecurityManagerTeamError>> {
2559 let local_var_configuration = configuration;
2560
2561 let local_var_client = &local_var_configuration.client;
2562
2563 let local_var_uri_str = format!("{}/orgs/{org}/security-managers/teams/{team_slug}", local_var_configuration.base_path, org=crate::apis::urlencode(org), team_slug=crate::apis::urlencode(team_slug));
2564 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2565
2566 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2567 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2568 }
2569
2570 let local_var_req = local_var_req_builder.build()?;
2571 let local_var_resp = local_var_client.execute(local_var_req).await?;
2572
2573 let local_var_status = local_var_resp.status();
2574 let local_var_content = local_var_resp.text().await?;
2575
2576 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2577 Ok(())
2578 } else {
2579 let local_var_entity: Option<OrgsSlashRemoveSecurityManagerTeamError> = serde_json::from_str(&local_var_content).ok();
2580 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2581 Err(Error::ResponseError(local_var_error))
2582 }
2583}
2584
2585pub async fn orgs_slash_review_pat_grant_request(configuration: &configuration::Configuration, org: &str, pat_request_id: i32, orgs_review_pat_grant_request_request: models::OrgsReviewPatGrantRequestRequest) -> Result<(), Error<OrgsSlashReviewPatGrantRequestError>> {
2587 let local_var_configuration = configuration;
2588
2589 let local_var_client = &local_var_configuration.client;
2590
2591 let local_var_uri_str = format!("{}/orgs/{org}/personal-access-token-requests/{pat_request_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), pat_request_id=pat_request_id);
2592 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2593
2594 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2595 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2596 }
2597 local_var_req_builder = local_var_req_builder.json(&orgs_review_pat_grant_request_request);
2598
2599 let local_var_req = local_var_req_builder.build()?;
2600 let local_var_resp = local_var_client.execute(local_var_req).await?;
2601
2602 let local_var_status = local_var_resp.status();
2603 let local_var_content = local_var_resp.text().await?;
2604
2605 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2606 Ok(())
2607 } else {
2608 let local_var_entity: Option<OrgsSlashReviewPatGrantRequestError> = serde_json::from_str(&local_var_content).ok();
2609 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2610 Err(Error::ResponseError(local_var_error))
2611 }
2612}
2613
2614pub async fn orgs_slash_review_pat_grant_requests_in_bulk(configuration: &configuration::Configuration, org: &str, orgs_review_pat_grant_requests_in_bulk_request: models::OrgsReviewPatGrantRequestsInBulkRequest) -> Result<serde_json::Value, Error<OrgsSlashReviewPatGrantRequestsInBulkError>> {
2616 let local_var_configuration = configuration;
2617
2618 let local_var_client = &local_var_configuration.client;
2619
2620 let local_var_uri_str = format!("{}/orgs/{org}/personal-access-token-requests", local_var_configuration.base_path, org=crate::apis::urlencode(org));
2621 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2622
2623 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2624 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2625 }
2626 local_var_req_builder = local_var_req_builder.json(&orgs_review_pat_grant_requests_in_bulk_request);
2627
2628 let local_var_req = local_var_req_builder.build()?;
2629 let local_var_resp = local_var_client.execute(local_var_req).await?;
2630
2631 let local_var_status = local_var_resp.status();
2632 let local_var_content = local_var_resp.text().await?;
2633
2634 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2635 serde_json::from_str(&local_var_content).map_err(Error::from)
2636 } else {
2637 let local_var_entity: Option<OrgsSlashReviewPatGrantRequestsInBulkError> = serde_json::from_str(&local_var_content).ok();
2638 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2639 Err(Error::ResponseError(local_var_error))
2640 }
2641}
2642
2643pub async fn orgs_slash_revoke_all_org_roles_team(configuration: &configuration::Configuration, org: &str, team_slug: &str) -> Result<(), Error<OrgsSlashRevokeAllOrgRolesTeamError>> {
2645 let local_var_configuration = configuration;
2646
2647 let local_var_client = &local_var_configuration.client;
2648
2649 let local_var_uri_str = format!("{}/orgs/{org}/organization-roles/teams/{team_slug}", local_var_configuration.base_path, org=crate::apis::urlencode(org), team_slug=crate::apis::urlencode(team_slug));
2650 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2651
2652 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2653 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2654 }
2655
2656 let local_var_req = local_var_req_builder.build()?;
2657 let local_var_resp = local_var_client.execute(local_var_req).await?;
2658
2659 let local_var_status = local_var_resp.status();
2660 let local_var_content = local_var_resp.text().await?;
2661
2662 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2663 Ok(())
2664 } else {
2665 let local_var_entity: Option<OrgsSlashRevokeAllOrgRolesTeamError> = serde_json::from_str(&local_var_content).ok();
2666 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2667 Err(Error::ResponseError(local_var_error))
2668 }
2669}
2670
2671pub async fn orgs_slash_revoke_all_org_roles_user(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error<OrgsSlashRevokeAllOrgRolesUserError>> {
2673 let local_var_configuration = configuration;
2674
2675 let local_var_client = &local_var_configuration.client;
2676
2677 let local_var_uri_str = format!("{}/orgs/{org}/organization-roles/users/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username));
2678 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2679
2680 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2681 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2682 }
2683
2684 let local_var_req = local_var_req_builder.build()?;
2685 let local_var_resp = local_var_client.execute(local_var_req).await?;
2686
2687 let local_var_status = local_var_resp.status();
2688 let local_var_content = local_var_resp.text().await?;
2689
2690 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2691 Ok(())
2692 } else {
2693 let local_var_entity: Option<OrgsSlashRevokeAllOrgRolesUserError> = serde_json::from_str(&local_var_content).ok();
2694 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2695 Err(Error::ResponseError(local_var_error))
2696 }
2697}
2698
2699pub async fn orgs_slash_revoke_org_role_team(configuration: &configuration::Configuration, org: &str, team_slug: &str, role_id: i32) -> Result<(), Error<OrgsSlashRevokeOrgRoleTeamError>> {
2701 let local_var_configuration = configuration;
2702
2703 let local_var_client = &local_var_configuration.client;
2704
2705 let local_var_uri_str = format!("{}/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), team_slug=crate::apis::urlencode(team_slug), role_id=role_id);
2706 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2707
2708 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2709 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2710 }
2711
2712 let local_var_req = local_var_req_builder.build()?;
2713 let local_var_resp = local_var_client.execute(local_var_req).await?;
2714
2715 let local_var_status = local_var_resp.status();
2716 let local_var_content = local_var_resp.text().await?;
2717
2718 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2719 Ok(())
2720 } else {
2721 let local_var_entity: Option<OrgsSlashRevokeOrgRoleTeamError> = serde_json::from_str(&local_var_content).ok();
2722 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2723 Err(Error::ResponseError(local_var_error))
2724 }
2725}
2726
2727pub async fn orgs_slash_revoke_org_role_user(configuration: &configuration::Configuration, org: &str, username: &str, role_id: i32) -> Result<(), Error<OrgsSlashRevokeOrgRoleUserError>> {
2729 let local_var_configuration = configuration;
2730
2731 let local_var_client = &local_var_configuration.client;
2732
2733 let local_var_uri_str = format!("{}/orgs/{org}/organization-roles/users/{username}/{role_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username), role_id=role_id);
2734 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2735
2736 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2737 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2738 }
2739
2740 let local_var_req = local_var_req_builder.build()?;
2741 let local_var_resp = local_var_client.execute(local_var_req).await?;
2742
2743 let local_var_status = local_var_resp.status();
2744 let local_var_content = local_var_resp.text().await?;
2745
2746 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2747 Ok(())
2748 } else {
2749 let local_var_entity: Option<OrgsSlashRevokeOrgRoleUserError> = serde_json::from_str(&local_var_content).ok();
2750 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2751 Err(Error::ResponseError(local_var_error))
2752 }
2753}
2754
2755pub async fn orgs_slash_set_membership_for_user(configuration: &configuration::Configuration, org: &str, username: &str, orgs_set_membership_for_user_request: Option<models::OrgsSetMembershipForUserRequest>) -> Result<models::OrgMembership, Error<OrgsSlashSetMembershipForUserError>> {
2757 let local_var_configuration = configuration;
2758
2759 let local_var_client = &local_var_configuration.client;
2760
2761 let local_var_uri_str = format!("{}/orgs/{org}/memberships/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username));
2762 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2763
2764 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2765 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2766 }
2767 local_var_req_builder = local_var_req_builder.json(&orgs_set_membership_for_user_request);
2768
2769 let local_var_req = local_var_req_builder.build()?;
2770 let local_var_resp = local_var_client.execute(local_var_req).await?;
2771
2772 let local_var_status = local_var_resp.status();
2773 let local_var_content = local_var_resp.text().await?;
2774
2775 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2776 serde_json::from_str(&local_var_content).map_err(Error::from)
2777 } else {
2778 let local_var_entity: Option<OrgsSlashSetMembershipForUserError> = serde_json::from_str(&local_var_content).ok();
2779 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2780 Err(Error::ResponseError(local_var_error))
2781 }
2782}
2783
2784pub async fn orgs_slash_set_public_membership_for_authenticated_user(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error<OrgsSlashSetPublicMembershipForAuthenticatedUserError>> {
2786 let local_var_configuration = configuration;
2787
2788 let local_var_client = &local_var_configuration.client;
2789
2790 let local_var_uri_str = format!("{}/orgs/{org}/public_members/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username));
2791 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2792
2793 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2794 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2795 }
2796
2797 let local_var_req = local_var_req_builder.build()?;
2798 let local_var_resp = local_var_client.execute(local_var_req).await?;
2799
2800 let local_var_status = local_var_resp.status();
2801 let local_var_content = local_var_resp.text().await?;
2802
2803 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2804 Ok(())
2805 } else {
2806 let local_var_entity: Option<OrgsSlashSetPublicMembershipForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
2807 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2808 Err(Error::ResponseError(local_var_error))
2809 }
2810}
2811
2812pub async fn orgs_slash_unblock_user(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error<OrgsSlashUnblockUserError>> {
2814 let local_var_configuration = configuration;
2815
2816 let local_var_client = &local_var_configuration.client;
2817
2818 let local_var_uri_str = format!("{}/orgs/{org}/blocks/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username));
2819 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2820
2821 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2822 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2823 }
2824
2825 let local_var_req = local_var_req_builder.build()?;
2826 let local_var_resp = local_var_client.execute(local_var_req).await?;
2827
2828 let local_var_status = local_var_resp.status();
2829 let local_var_content = local_var_resp.text().await?;
2830
2831 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2832 Ok(())
2833 } else {
2834 let local_var_entity: Option<OrgsSlashUnblockUserError> = serde_json::from_str(&local_var_content).ok();
2835 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2836 Err(Error::ResponseError(local_var_error))
2837 }
2838}
2839
2840pub async fn orgs_slash_update(configuration: &configuration::Configuration, org: &str, orgs_update_request: Option<models::OrgsUpdateRequest>) -> Result<models::OrganizationFull, Error<OrgsSlashUpdateError>> {
2842 let local_var_configuration = configuration;
2843
2844 let local_var_client = &local_var_configuration.client;
2845
2846 let local_var_uri_str = format!("{}/orgs/{org}", local_var_configuration.base_path, org=crate::apis::urlencode(org));
2847 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
2848
2849 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2850 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2851 }
2852 local_var_req_builder = local_var_req_builder.json(&orgs_update_request);
2853
2854 let local_var_req = local_var_req_builder.build()?;
2855 let local_var_resp = local_var_client.execute(local_var_req).await?;
2856
2857 let local_var_status = local_var_resp.status();
2858 let local_var_content = local_var_resp.text().await?;
2859
2860 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2861 serde_json::from_str(&local_var_content).map_err(Error::from)
2862 } else {
2863 let local_var_entity: Option<OrgsSlashUpdateError> = serde_json::from_str(&local_var_content).ok();
2864 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2865 Err(Error::ResponseError(local_var_error))
2866 }
2867}
2868
2869pub async fn orgs_slash_update_membership_for_authenticated_user(configuration: &configuration::Configuration, org: &str, orgs_update_membership_for_authenticated_user_request: models::OrgsUpdateMembershipForAuthenticatedUserRequest) -> Result<models::OrgMembership, Error<OrgsSlashUpdateMembershipForAuthenticatedUserError>> {
2871 let local_var_configuration = configuration;
2872
2873 let local_var_client = &local_var_configuration.client;
2874
2875 let local_var_uri_str = format!("{}/user/memberships/orgs/{org}", local_var_configuration.base_path, org=crate::apis::urlencode(org));
2876 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
2877
2878 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2879 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2880 }
2881 local_var_req_builder = local_var_req_builder.json(&orgs_update_membership_for_authenticated_user_request);
2882
2883 let local_var_req = local_var_req_builder.build()?;
2884 let local_var_resp = local_var_client.execute(local_var_req).await?;
2885
2886 let local_var_status = local_var_resp.status();
2887 let local_var_content = local_var_resp.text().await?;
2888
2889 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2890 serde_json::from_str(&local_var_content).map_err(Error::from)
2891 } else {
2892 let local_var_entity: Option<OrgsSlashUpdateMembershipForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
2893 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2894 Err(Error::ResponseError(local_var_error))
2895 }
2896}
2897
2898pub async fn orgs_slash_update_pat_access(configuration: &configuration::Configuration, org: &str, pat_id: i32, orgs_update_pat_access_request: models::OrgsUpdatePatAccessRequest) -> Result<(), Error<OrgsSlashUpdatePatAccessError>> {
2900 let local_var_configuration = configuration;
2901
2902 let local_var_client = &local_var_configuration.client;
2903
2904 let local_var_uri_str = format!("{}/orgs/{org}/personal-access-tokens/{pat_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), pat_id=pat_id);
2905 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2906
2907 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2908 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2909 }
2910 local_var_req_builder = local_var_req_builder.json(&orgs_update_pat_access_request);
2911
2912 let local_var_req = local_var_req_builder.build()?;
2913 let local_var_resp = local_var_client.execute(local_var_req).await?;
2914
2915 let local_var_status = local_var_resp.status();
2916 let local_var_content = local_var_resp.text().await?;
2917
2918 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2919 Ok(())
2920 } else {
2921 let local_var_entity: Option<OrgsSlashUpdatePatAccessError> = serde_json::from_str(&local_var_content).ok();
2922 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2923 Err(Error::ResponseError(local_var_error))
2924 }
2925}
2926
2927pub async fn orgs_slash_update_pat_accesses(configuration: &configuration::Configuration, org: &str, orgs_update_pat_accesses_request: models::OrgsUpdatePatAccessesRequest) -> Result<serde_json::Value, Error<OrgsSlashUpdatePatAccessesError>> {
2929 let local_var_configuration = configuration;
2930
2931 let local_var_client = &local_var_configuration.client;
2932
2933 let local_var_uri_str = format!("{}/orgs/{org}/personal-access-tokens", local_var_configuration.base_path, org=crate::apis::urlencode(org));
2934 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2935
2936 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2937 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2938 }
2939 local_var_req_builder = local_var_req_builder.json(&orgs_update_pat_accesses_request);
2940
2941 let local_var_req = local_var_req_builder.build()?;
2942 let local_var_resp = local_var_client.execute(local_var_req).await?;
2943
2944 let local_var_status = local_var_resp.status();
2945 let local_var_content = local_var_resp.text().await?;
2946
2947 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2948 serde_json::from_str(&local_var_content).map_err(Error::from)
2949 } else {
2950 let local_var_entity: Option<OrgsSlashUpdatePatAccessesError> = serde_json::from_str(&local_var_content).ok();
2951 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2952 Err(Error::ResponseError(local_var_error))
2953 }
2954}
2955
2956pub async fn orgs_slash_update_webhook(configuration: &configuration::Configuration, org: &str, hook_id: i32, orgs_update_webhook_request: Option<models::OrgsUpdateWebhookRequest>) -> Result<models::OrgHook, Error<OrgsSlashUpdateWebhookError>> {
2958 let local_var_configuration = configuration;
2959
2960 let local_var_client = &local_var_configuration.client;
2961
2962 let local_var_uri_str = format!("{}/orgs/{org}/hooks/{hook_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), hook_id=hook_id);
2963 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
2964
2965 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2966 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2967 }
2968 local_var_req_builder = local_var_req_builder.json(&orgs_update_webhook_request);
2969
2970 let local_var_req = local_var_req_builder.build()?;
2971 let local_var_resp = local_var_client.execute(local_var_req).await?;
2972
2973 let local_var_status = local_var_resp.status();
2974 let local_var_content = local_var_resp.text().await?;
2975
2976 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2977 serde_json::from_str(&local_var_content).map_err(Error::from)
2978 } else {
2979 let local_var_entity: Option<OrgsSlashUpdateWebhookError> = serde_json::from_str(&local_var_content).ok();
2980 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2981 Err(Error::ResponseError(local_var_error))
2982 }
2983}
2984
2985pub async fn orgs_slash_update_webhook_config_for_org(configuration: &configuration::Configuration, org: &str, hook_id: i32, apps_update_webhook_config_for_app_request: Option<models::AppsUpdateWebhookConfigForAppRequest>) -> Result<models::WebhookConfig, Error<OrgsSlashUpdateWebhookConfigForOrgError>> {
2987 let local_var_configuration = configuration;
2988
2989 let local_var_client = &local_var_configuration.client;
2990
2991 let local_var_uri_str = format!("{}/orgs/{org}/hooks/{hook_id}/config", local_var_configuration.base_path, org=crate::apis::urlencode(org), hook_id=hook_id);
2992 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
2993
2994 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2995 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2996 }
2997 local_var_req_builder = local_var_req_builder.json(&apps_update_webhook_config_for_app_request);
2998
2999 let local_var_req = local_var_req_builder.build()?;
3000 let local_var_resp = local_var_client.execute(local_var_req).await?;
3001
3002 let local_var_status = local_var_resp.status();
3003 let local_var_content = local_var_resp.text().await?;
3004
3005 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3006 serde_json::from_str(&local_var_content).map_err(Error::from)
3007 } else {
3008 let local_var_entity: Option<OrgsSlashUpdateWebhookConfigForOrgError> = serde_json::from_str(&local_var_content).ok();
3009 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3010 Err(Error::ResponseError(local_var_error))
3011 }
3012}
3013